/* ============================================
   ACF Events Shortcode v1.6.4 — events.css
   4 / 3 / 2 column responsive grid (default / past events)
   Upcoming events: 1 event = full-width list,
   2 events = list style in one row, 3+ = grid
   Padded, inset image + light card border
   Cover image + dark blue date & CTA
   Distinct UPCOMING (green) / PAST EVENT (slate) pills
   ============================================ */

/* ── Grid container ──────────────────────── */
.acf-events-grid {
    /* Theme tokens — override these from your theme to recolor */
    --acf-event-pill-upcoming:       #1e5b37;   /* green — UPCOMING pill */
    --acf-event-pill-upcoming-text:  #ffffff;
    --acf-event-pill-past:           #0B2242;   /* navy — PAST EVENT pill */
    --acf-event-pill-past-text:      #ffffff;
    --acf-event-accent:        #1e5b37;   /* hover accent (matches upcoming) */
    --acf-event-accent-hover:  #143d24;
    --acf-event-pin:           #dc2626;   /* red pin icon */
    --acf-event-date:          #B97A2D;   /* date badge background */
    --acf-event-cta:           #0B2242;   /* read-more link + title hover color */
    --acf-event-cta-hover:     #081a33;
    --acf-event-text:          #111827;
    --acf-event-muted:         #6b7280;
    --acf-event-border:        #e7e5df;   /* light, soft card border */
    --acf-event-card-bg:       #ffffff;
    --acf-event-card-pad:      16px;      /* outer padding around each card */

    display: grid;
    grid-template-columns: repeat(4, 1fr);   /* 4 cols on desktop */
    gap: 20px;
    margin: 24px 0;
}

/* ── Card (is an <a> tag) ────────────────── */
.acf-event-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-decoration: none;
    color: inherit;
    padding: var(--acf-event-card-pad);
    border-radius: 16px;
    background: var(--acf-event-card-bg);
    border: 1px solid var(--acf-event-border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.22s ease, transform 0.22s ease, border-color 0.22s ease;
}

.acf-event-card:hover {
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.10);
    border-color: #d8d5cc;
    transform: translateY(-3px);
    text-decoration: none;
    color: inherit;
}

/* ── Image wrapper — inset inside the card padding, own rounded corners ── */
.acf-event-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;        /* shorter than 16/10 → ~30px less height */
    overflow: hidden;
    border-radius: 10px;
    background: #e5e7eb;
    flex-shrink: 0;
}

/* Bulletproof cover — beats theme overrides like `img { height:auto !important }` */
.acf-event-img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
    max-height: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    transition: transform 0.4s ease;
}

.acf-event-card:hover .acf-event-img {
    transform: scale(1.04);
}

/* ── Tag pill (top-right) ─────────────────── */
.acf-event-tag {
    position: absolute;
    top: 14px;
    right: 14px;
    background: var(--acf-event-pill-upcoming);
    color: var(--acf-event-pill-upcoming-text);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    padding: 8px 16px;
    border-radius: 999px;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
    z-index: 2;
    white-space: nowrap;
}

/* Past-events pill — slate (clearly different from upcoming green) */
.acf-events-past .acf-event-tag {
    background: var(--acf-event-pill-past);
    color: var(--acf-event-pill-past-text);
}

/* ── Date badge (top-left, over the image) ── */
.acf-event-date-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    background: var(--acf-event-date);
    border-radius: 8px;
    padding: 10px 14px 9px;
    text-align: center;
    line-height: 1;
    min-width: 54px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.acf-event-date-day {
    display: block;
    font-size: 1.6rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1;
}

.acf-event-date-month {
    display: block;
    margin-top: 4px;
    font-size: 0.62rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.85;
}

/* ── Card body ───────────────────────────── */
.acf-event-body {
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

/* ── Meta row (time stacked above venue) ── */
.acf-event-meta-row {
    display: flex;
    flex-direction: column;        /* time on its own line, venue on the next */
    align-items: flex-start;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--acf-event-muted);
    font-weight: 500;
    line-height: 1.2;
}

.acf-event-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.acf-event-meta-icon {
    flex-shrink: 0;
}

.acf-event-meta-time .acf-event-meta-icon {
    color: var(--acf-event-muted);
}

.acf-event-meta-loc .acf-event-meta-icon {
    color: var(--acf-event-pin);   /* red pin */
}

/* ── Title ───────────────────────────────── */
.acf-event-title {
    margin: 4px 0 0;
    font-size: 18px;
    font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
    font-weight: 700;
    line-height: 1.3;
    color: var(--acf-event-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.acf-event-card:hover .acf-event-title {
    color: var(--acf-event-cta);   /* dark blue on hover */
}

/* ── Excerpt ─────────────────────────────── */
.acf-event-excerpt {
    margin: 0;
    font-size: 16px;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #000000;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── CTA — DARK BLUE ─────────────────────── */
.acf-event-cta {
    margin-top: auto;
    padding-top: 4px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--acf-event-cta);   /* DARK BLUE */
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1;
}

.acf-event-cta svg {
    transition: transform 0.22s ease;
}

.acf-event-card:hover .acf-event-cta {
    color: var(--acf-event-cta-hover);
}

.acf-event-card:hover .acf-event-cta svg {
    transform: translateX(3px);
}

/* ── Past events (slightly muted) ────────── */
.acf-events-past .acf-event-card {
    opacity: 0.85;
}

.acf-events-past .acf-event-card:hover {
    opacity: 1;
}

/* ── Empty state ─────────────────────────── */
.acf-events-empty {
    padding: 14px 18px;
    background: #f3f4f6;
    border-left: 4px solid #d1d5db;
    border-radius: 6px;
    color: #6b7280;
    font-size: 0.95rem;
    margin: 16px 0;
}

/* ============================================
   List-style layout — used only for UPCOMING
   events when there are 1 or 2 posts found.
   Grid layout (default above) is untouched and
   still used for 3+ upcoming events and for
   all past events.
   ============================================ */

/* Single upcoming event: one full-width list card */
.acf-events-layout-list-single {
    grid-template-columns: 1fr;
}

/* Two upcoming events: list-style cards side-by-side in one row */
.acf-events-layout-list-double {
    grid-template-columns: repeat(2, 1fr);
}

/* Horizontal ("list") card layout: image left, content right */
.acf-events-layout-list-single .acf-event-card,
.acf-events-layout-list-double .acf-event-card {
    flex-direction: row;
    align-items: stretch;
    gap: 24px;
}

.acf-events-layout-list-single .acf-event-img-wrap,
.acf-events-layout-list-double .acf-event-img-wrap {
    aspect-ratio: auto;
    flex-shrink: 0;
}

/* Single full-width card: give the image a generous, fixed-ratio column */
.acf-events-layout-list-single .acf-event-img-wrap {
    width: 42%;
}

/* Two-up row: slightly narrower image column so the card reads well at half width */
.acf-events-layout-list-double .acf-event-img-wrap {
    width: 46%;
}

.acf-events-layout-list-single .acf-event-body,
.acf-events-layout-list-double .acf-event-body {
    flex: 1;
    justify-content: center;
}

/* ── Responsive: 4 / 3 / 2 columns ───────── */

/* 3 columns on tablet */
@media (max-width: 1024px) {
    .acf-events-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 18px;
    }

    /* Keep list layouts as horizontal cards on tablet, just re-balance columns */
    .acf-events-layout-list-single,
    .acf-events-layout-list-double {
        grid-template-columns: 1fr;
    }
}

/* Below tablet, list-style cards switch to a stacked (image-on-top) layout */
@media (max-width: 780px) {
    .acf-events-layout-list-single .acf-event-card,
    .acf-events-layout-list-double .acf-event-card {
        flex-direction: column;
        gap: 16px;
    }

    .acf-events-layout-list-single .acf-event-img-wrap,
    .acf-events-layout-list-double .acf-event-img-wrap {
        width: 100%;
        aspect-ratio: 16 / 9;
    }
}

/* 2 columns on mobile */
@media (max-width: 640px) {
    .acf-events-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    /* List layouts stay single-column (full width) on mobile, stacked cards */
    .acf-events-layout-list-single,
    .acf-events-layout-list-double {
        grid-template-columns: 1fr;
    }

    .acf-event-card {
        padding: 12px;
        gap: 12px;
        border-radius: 14px;
    }

    .acf-event-img-wrap {
        border-radius: 8px;
    }

    .acf-event-tag {
        top: 10px;
        right: 10px;
        font-size: 10px;
        padding: 5px 10px;
        letter-spacing: 0.06em;
    }

    .acf-event-date-badge {
        top: 10px;
        left: 10px;
        padding: 6px 8px 5px;
        min-width: 38px;
    }

    .acf-event-date-day {
        font-size: 19px;
    }

    .acf-event-date-month {
        font-size: 7px;
    }

    .acf-event-title {
        font-size: 18px;
    }

    .acf-event-excerpt {
        font-size: 16px;
        -webkit-line-clamp: 2;
    }

    .acf-event-cta {
        font-size: 0.8rem;
    }
}
