/* ============================================================
   LuminaThera — Event Enhancement Styles
   
   Design system styles for dynamic event UI elements:
     • Availability badges on event cards
     • Filter bar and filter pill controls
     • Micro-animations (fade-in, filter transitions)
   
   Companion to design-system.css — uses the same tokens and
   follows the same surface-variation pattern.
   ============================================================ */


/* ============================================================
   AVAILABILITY BADGE
   .lt-event-card__availability
   
   A subtle pill badge showing live seat / registration status.
   Positioned inside an event card (absolute to card, or inline
   depending on layout). Three semantic variants:
     (default)  — open / available slots
     --low      — few remaining spots, draws attention
     --closed   — sold out / registration closed
   ============================================================ */

.lt-event-card__availability {
    display: inline-flex;
    align-items: center;
    gap: var(--wp--preset--spacing--10);
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: var(--wp--preset--font-size--label);
    letter-spacing: var(--wp--custom--tracking--label);
    text-transform: uppercase;
    line-height: 1;
    padding: var(--wp--preset--spacing--10) var(--wp--preset--spacing--30);
    border-radius: var(--radius-pill);
    white-space: nowrap;

    /* Default: teal — available */
    background: var(--teal-deep);
    color: var(--cream);
}

/* Low availability — copper with subtle glow pulse */
.lt-event-card__availability--low {
    background: var(--copper);
    color: var(--cream);
    box-shadow: 0 0 10px rgba(208, 116, 68, 0.30);
}

/* Closed / sold out — desaturated, muted */
.lt-event-card__availability--closed {
    background: var(--border-dark-divider);
    color: var(--fg-on-dark-muted);
}


/* ============================================================
   FILTER BAR
   .lt-event-listing__filter-bar

   Container for filter pill buttons above an event grid.
   Flex row, wraps on small screens, consistent spacing.
   ============================================================ */

.lt-event-listing__filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--wp--preset--spacing--30);
    margin-block: var(--wp--preset--spacing--60) var(--wp--preset--spacing--50);
}


/* ============================================================
   FILTER PILL
   .lt-filter-pill

   Individual filter toggle button. Ghost style by default,
   filled when active. Mirrors the CTA primitive spec
   (font-weight 500, 0.75rem, 0.15em tracking, uppercase)
   but with smaller padding for the compact pill form.
   ============================================================ */

.lt-filter-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-family: var(--font-sans);
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 0.5rem 1.125rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--border-dark-strong);
    background: transparent;
    color: var(--section-heading, var(--fg-on-dark));
    cursor: pointer;
    text-decoration: none;
    transition: all var(--duration-fast) var(--ease-smooth);
    white-space: nowrap;
    -webkit-font-smoothing: antialiased;
}

/* Hover — copper glow border */
.lt-filter-pill:hover {
    border-color: var(--interaction-rule-hover);
    color: var(--link-hover);
    background: var(--interaction-wash);
    box-shadow: none;
}

/* Active / selected state — filled */
.lt-filter-pill[aria-pressed="true"],
.lt-filter-pill.is-active {
    background: var(--teal-deep);
    border-color: var(--teal-deep);
    color: var(--cream);
}

/* Active hover — copper accent fill */
.lt-filter-pill[aria-pressed="true"]:hover,
.lt-filter-pill.is-active:hover {
    background: var(--teal-mid);
    border-color: var(--teal-mid);
    color: var(--cream);
    box-shadow: none;
}

/* Focus-visible ring — matches global CTA pattern */
.lt-filter-pill:focus-visible {
    outline: 2px solid var(--focus-ring, currentColor);
    outline-offset: 0.25em;
}

/* ---- Filter Pill — Light Surface Adaptation --------------- */
:is(.is-style-light-1, .is-style-light-2, .is-style-light) .lt-filter-pill {
    border-color: var(--border-light-strong);
    color: var(--section-heading, var(--text-heading));
}

:is(.is-style-light-1, .is-style-light-2, .is-style-light) .lt-filter-pill:hover {
    border-color: var(--interaction-rule-hover);
    color: var(--link-hover);
}

:is(.is-style-light-1, .is-style-light-2, .is-style-light) .lt-filter-pill[aria-pressed="true"],
:is(.is-style-light-1, .is-style-light-2, .is-style-light) .lt-filter-pill.is-active {
    background: var(--teal-deep);
    border-color: var(--teal-deep);
    color: var(--cream);
}


/* ============================================================
   MICRO-ANIMATIONS
   
   All motion is opt-in via prefers-reduced-motion: no-preference.
   Without this media query match, elements appear in their
   final state immediately — progressive enhancement.
   ============================================================ */

@media (prefers-reduced-motion: no-preference) {

    /* -- Badge fade-in on load ------------------------------ */
    @keyframes lt-badge-fade-in {
        from {
            opacity: 0;
            transform: translateY(4px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .lt-event-card__availability {
        animation: lt-badge-fade-in var(--duration-fast) var(--ease-entrance) both;
    }

    /* Stagger badges in a list */
    .lt-event-card:nth-child(2) .lt-event-card__availability {
        animation-delay: 0.08s;
    }
    .lt-event-card:nth-child(3) .lt-event-card__availability {
        animation-delay: 0.16s;
    }
    .lt-event-card:nth-child(4) .lt-event-card__availability {
        animation-delay: 0.24s;
    }
    .lt-event-card:nth-child(n+5) .lt-event-card__availability {
        animation-delay: 0.32s;
    }

    /* -- Low-availability pulse ----------------------------- */
    @keyframes lt-availability-pulse {
        0%, 100% {
            box-shadow: 0 0 10px rgba(208, 116, 68, 0.30);
        }
        50% {
            box-shadow: 0 0 18px rgba(208, 116, 68, 0.50);
        }
    }

    .lt-event-card__availability--low {
        animation:
            lt-badge-fade-in var(--duration-fast) var(--ease-entrance) both,
            lt-availability-pulse 3s var(--ease-default) 0.6s infinite;
    }


    /* -- Filter card transition ----------------------------- */
    /* Cards use these utility classes toggled by JS when
       the active filter changes:
         .lt-filter-out  → card is being hidden
         .lt-filter-in   → card is being revealed           */

    @keyframes lt-filter-card-out {
        from {
            opacity: 1;
            transform: scale(1);
        }
        to {
            opacity: 0;
            transform: scale(0.96);
        }
    }

    @keyframes lt-filter-card-in {
        from {
            opacity: 0;
            transform: scale(0.96);
        }
        to {
            opacity: 1;
            transform: scale(1);
        }
    }

    .lt-filter-out {
        animation: lt-filter-card-out var(--duration-fast) var(--ease-smooth) both;
    }

    .lt-filter-in {
        animation: lt-filter-card-in var(--duration-fast) var(--ease-entrance) both;
    }

    /* Stagger filter-in cards */
    .lt-filter-in:nth-child(2) { animation-delay: 0.04s; }
    .lt-filter-in:nth-child(3) { animation-delay: 0.08s; }
    .lt-filter-in:nth-child(4) { animation-delay: 0.12s; }
    .lt-filter-in:nth-child(n+5) { animation-delay: 0.16s; }
}


/* ============================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================ */

/* -- Tablet (≤ 768px) --------------------------------------- */
@media (max-width: 768px) {
    .lt-event-listing__filter-bar {
        gap: var(--wp--preset--spacing--20);
        margin-block: var(--wp--preset--spacing--50) var(--wp--preset--spacing--40);
    }

    .lt-filter-pill {
        padding: 0.4rem 0.875rem;
        font-size: 0.68rem;
    }
}

/* -- Mobile (≤ 480px) --------------------------------------- */
@media (max-width: 480px) {
    .lt-event-listing__filter-bar {
        gap: var(--wp--preset--spacing--20);
        margin-block: var(--wp--preset--spacing--40) var(--wp--preset--spacing--30);
        /* Allow horizontal scroll if too many pills */
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;  /* Firefox */
        padding-bottom: var(--wp--preset--spacing--10);
    }

    .lt-event-listing__filter-bar::-webkit-scrollbar {
        display: none;
    }

    .lt-filter-pill {
        padding: 0.35rem 0.75rem;
        font-size: 0.65rem;
        flex-shrink: 0;
    }

    .lt-event-card__availability {
        font-size: 0.6rem;
        padding: 3px var(--wp--preset--spacing--20);
    }
}


/* ============================================================
   REDUCED MOTION — explicit fallback
   (Global design-system.css already kills transitions via
   the universal * selector, but this ensures animation
   keyframes never fire either.)
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .lt-event-card__availability,
    .lt-event-card__availability--low,
    .lt-filter-out,
    .lt-filter-in {
        animation: none;
    }

    .lt-filter-pill {
        transition: none;
    }
}

/* ============================================================
   EDITORIAL EVENTS ARCHIVE
   One clear featured decision followed by a compact chronological agenda.
   ============================================================ */

.lt-event-listing--editorial-archive {
    padding-block: clamp(7.5rem, 13vw, 11rem) var(--lt-section-padding);
}

.lt-event-listing:not(.lt-event-listing--editorial-archive) .lt-event-listing__header > div {
    max-width: 46rem;
}

.lt-event-listing__body {
    margin: 1rem 0 0;
    color: var(--section-body, var(--text-body));
    font-size: clamp(1rem, 1.4vw, 1.15rem);
    line-height: 1.65;
}

.lt-event-archive__masthead {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(20rem, 0.8fr);
    gap: clamp(3rem, 9vw, 9rem);
    align-items: end;
    margin-bottom: clamp(3rem, 7vw, 6rem);
}

.lt-event-archive__eyebrow,
.lt-event-feature__topline,
.lt-event-agenda__topline,
.lt-event-status {
    font-family: var(--font-sans);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    line-height: 1.35;
    text-transform: uppercase;
}

.lt-event-archive__eyebrow {
    margin: 0 0 1.25rem;
    color: var(--section-copper, var(--copper-text-sand));
}

.lt-event-archive__masthead h1 {
    max-width: 10ch;
    margin: 0;
    color: var(--section-heading, var(--text-heading));
    font-family: var(--font-serif);
    font-size: clamp(3.6rem, 8vw, 8rem);
    font-weight: 300;
    letter-spacing: -0.045em;
    line-height: 0.86;
    text-wrap: balance;
}

.lt-event-archive__intro > p {
    max-width: 36rem;
    margin: 0;
    color: var(--section-body, var(--text-body));
    font-size: clamp(1.05rem, 1.5vw, 1.25rem);
    font-weight: 300;
    line-height: 1.75;
}

.lt-event-archive__signals {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 2rem;
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--interaction-rule);
    color: var(--section-muted, var(--text-muted));
    font-size: 0.78rem;
}

.lt-event-archive__signals strong {
    margin-right: 0.35rem;
    color: var(--section-heading, var(--text-heading));
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 400;
}

.lt-event-listing--editorial-archive .lt-event-listing__filter-bar {
    margin: 0 0 2.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--interaction-rule);
}

.lt-event-listing--editorial-archive .lt-filter-btn {
    border-color: transparent;
    border-radius: 0;
    color: var(--section-muted, var(--text-muted));
}

.lt-event-listing--editorial-archive .lt-filter-btn:hover,
.lt-event-listing--editorial-archive .lt-filter-btn:focus-visible {
    border-color: transparent;
    background: var(--interaction-wash);
    color: var(--section-heading, var(--text-heading));
}

.lt-event-listing--editorial-archive .lt-filter-btn.is-active {
    border-color: transparent;
    background: var(--teal-deep);
    color: var(--cream);
}

.lt-event-feature {
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    min-height: clamp(34rem, 54vw, 44rem);
    margin-bottom: clamp(4rem, 8vw, 7rem);
    overflow: hidden;
    background: var(--surface-4);
    border: 1px solid var(--interaction-rule);
    border-radius: var(--radius-panel);
}

.lt-event-feature__media {
    min-height: 100%;
    overflow: hidden;
}

.lt-event-feature__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--duration-slow) var(--ease-smooth);
}

.lt-event-feature:hover .lt-event-feature__media img {
    transform: scale(1.025);
}

.lt-event-feature__content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(2.25rem, 5vw, 5rem);
}

.lt-event-feature__topline,
.lt-event-agenda__topline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    align-items: center;
    color: var(--section-copper, var(--copper-text-sand));
}

.lt-event-status {
    display: inline-flex;
    width: fit-content;
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--teal-deep);
    border-radius: var(--radius-pill);
    background: var(--teal-deep);
    color: var(--cream);
    letter-spacing: 0.08em;
}

.lt-event-status--coming-soon {
    border-color: var(--teal-mid);
    background: var(--teal-mid);
}

.lt-event-status--past,
.lt-event-status--closed {
    background: transparent;
    color: var(--section-muted, var(--text-muted));
}

.lt-event-feature__media--fallback,
.lt-event-card__image--fallback {
    display: grid;
    min-height: 100%;
    place-items: center;
    background:
        radial-gradient(circle at 25% 20%, rgba(243, 198, 170, 0.68), transparent 38%),
        radial-gradient(circle at 78% 74%, rgba(123, 171, 164, 0.72), transparent 45%),
        linear-gradient(145deg, var(--cream), var(--teal-light));
    color: var(--teal-deep);
    font-family: var(--font-serif);
    font-size: clamp(1.1rem, 2.4vw, 1.6rem);
    font-style: italic;
    letter-spacing: 0.04em;
}

.lt-event-feature h2 {
    margin: 1.5rem 0 1rem;
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 5vw, 5.2rem);
    font-weight: 300;
    letter-spacing: -0.035em;
    line-height: 0.94;
}

.lt-event-feature h2 a,
.lt-event-agenda__main h2 a {
    color: var(--section-heading, var(--text-heading));
    text-decoration: none;
}

.lt-event-feature__description {
    max-width: 43rem;
    margin: 0;
    color: var(--section-body, var(--text-body));
    font-size: clamp(1rem, 1.25vw, 1.15rem);
    line-height: 1.7;
}

.lt-event-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: clamp(2rem, 4vw, 3rem) 0 0;
    border-top: 1px solid var(--interaction-rule);
}

.lt-event-facts > div {
    padding: 1rem 1rem 1rem 0;
    border-bottom: 1px solid var(--interaction-rule);
}

.lt-event-facts > div:nth-child(even) {
    padding-left: 1rem;
    border-left: 1px solid var(--interaction-rule);
}

.lt-event-facts dt {
    margin-bottom: 0.35rem;
    /* Fact labels are small; use the body token so they remain AA on the
       mineral archive surface instead of relying on a low-contrast muted gray. */
    color: var(--section-body, var(--text-body));
    font-size: 0.64rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.lt-event-facts dd {
    margin: 0;
    color: var(--section-heading, var(--text-heading));
    font-family: var(--font-serif);
    font-size: 1.12rem;
    line-height: 1.3;
}

.lt-event-feature__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.75rem;
    align-items: center;
    margin-top: 2rem;
}

.lt-event-feature__program {
    color: var(--section-muted, var(--text-muted));
    font-size: 0.8rem;
    text-decoration: none;
}

.lt-event-agenda {
    border-top: 1px solid var(--interaction-rule);
}

.lt-event-agenda__item {
    display: grid;
    grid-template-columns: 5rem minmax(0, 1fr) minmax(12rem, 0.34fr);
    gap: clamp(1.5rem, 4vw, 4rem);
    align-items: start;
    padding: clamp(2rem, 4vw, 3.25rem) 0;
    border-bottom: 1px solid var(--interaction-rule);
}

.lt-event-agenda__date {
    display: grid;
    gap: 0.1rem;
    color: var(--section-heading, var(--text-heading));
    font-family: var(--font-serif);
    font-size: 2.6rem;
    line-height: 1;
}

.lt-event-agenda__date span {
    color: var(--section-copper, var(--copper-text-sand));
    font-family: var(--font-sans);
    font-size: 0.66rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.lt-event-agenda__main h2 {
    margin: 0.75rem 0 0.6rem;
    font-family: var(--font-serif);
    font-size: clamp(1.75rem, 3vw, 3rem);
    font-weight: 300;
    line-height: 1.02;
}

.lt-event-agenda__main > p {
    max-width: 52rem;
    margin: 0;
    color: var(--section-body, var(--text-body));
    line-height: 1.65;
}

.lt-event-agenda__decision {
    display: grid;
    gap: 0.45rem;
    color: var(--section-muted, var(--text-muted));
    font-size: 0.78rem;
}

.lt-event-agenda__decision a {
    display: inline-flex;
    gap: 0.5rem;
    width: fit-content;
    margin-top: 0.65rem;
    color: var(--link-color);
    font-weight: 500;
    text-decoration: none;
}

.lt-event-listing--editorial-archive .lt-event-card__availability {
    animation: none;
}

@media (max-width: 900px) {
    .lt-event-archive__masthead,
    .lt-event-feature {
        grid-template-columns: 1fr;
    }

    .lt-event-feature {
        min-height: 0;
    }

    .lt-event-feature__media {
        min-height: 22rem;
    }

    .lt-event-agenda__item {
        grid-template-columns: 4rem minmax(0, 1fr);
    }

    .lt-event-agenda__decision {
        grid-column: 2;
    }
}

@media (max-width: 600px) {
    .lt-event-listing--editorial-archive {
        padding-top: 7rem;
    }

    .lt-event-archive__masthead {
        gap: 2rem;
    }

    .lt-event-archive__masthead h1 {
        font-size: clamp(3.35rem, 18vw, 5.25rem);
    }

    .lt-event-feature__media {
        min-height: 17rem;
    }

    .lt-event-feature__content {
        padding: 2rem 1.4rem;
    }

    .lt-event-facts {
        grid-template-columns: 1fr;
    }

    .lt-event-facts > div:nth-child(even) {
        padding-left: 0;
        border-left: 0;
    }

    .lt-event-agenda__item {
        grid-template-columns: 3.25rem minmax(0, 1fr);
        gap: 1rem;
    }

    .lt-event-agenda__date {
        font-size: 2rem;
    }
}

/* ============================================================
   LEAD FACILITATOR / HOST BADGE
   .lt-event-card__host
   .lt-event-card__host-avatar
   ============================================================ */

.lt-event-card__host {
    display: inline-flex;
    align-items: center;
    gap: var(--wp--preset--spacing--20, 0.5rem);
    margin-bottom: var(--wp--preset--spacing--30, 0.75rem);
    font-family: var(--font-sans);
    font-size: var(--wp--preset--font-size--label, 0.65rem);
    letter-spacing: var(--wp--custom--tracking--label, 0.15em);
    text-transform: uppercase;
    color: var(--fg-on-dark-muted, rgba(255,255,255,0.7));
    line-height: 1;
}

:is(.is-style-light-1, .is-style-light-2, .is-style-light) .lt-event-card__host {
    color: var(--fg-muted, #707070);
}

.lt-event-card__host-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-dark-strong, rgba(255,255,255,0.15));
}

:is(.is-style-light-1, .is-style-light-2, .is-style-light) .lt-event-card__host-avatar {
    border-color: var(--border-light-strong, rgba(0,0,0,0.1));
}
