/* =============================================================================
   TRIODOS EVENT TEMPLATE — main.css
   Mobile-first, component-based, no framework.
   Sections:
     1. Design tokens
     2. Reset + base
     3. Typography
     4. Layout primitives
     5. Components: header / language switcher / meta-strip / player /
                    timeline (programme) / documents / footer
     6. Utilities
     7. Media queries
   ========================================================================== */

/* -----------------------------------------------------------------------------
   1. DESIGN TOKENS
   --------------------------------------------------------------------------- */
:root {
    /* Triodos brand palette
       Navy + cyan are the historic core; cream surface and warm coral give
       the editorial / "energising" feel of the refreshed identity. */
    --c-navy:        #002E5C;
    --c-navy-deep:   #001E3D;
    --c-cyan:        #00A4B4;
    --c-cyan-soft:   #B8E5EA;
    --c-coral:       #E26C50;        /* used very sparingly: live indicator only */

    /* Surfaces — warm, editorial, not pure white */
    --c-bg:          #FAF7F2;
    --c-surface:     #FFFFFF;
    --c-surface-alt: #F2EDE5;
    --c-border:      #E5DFD5;
    --c-border-soft: #EFEAE1;

    /* Text */
    --c-text:        #14202E;
    --c-text-soft:   #4A586A;
    --c-text-muted:  #7A8696;
    --c-text-on-navy:#FAF7F2;

    /* Type families
       Source Sans 3 — humanist sans, calm, professional, Triodos-aligned.
       Fraunces italic — used very sparingly as editorial accent. */
    --f-sans:    "Source Sans 3", -apple-system, BlinkMacSystemFont,
                 "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --f-accent:  "Fraunces", Georgia, "Times New Roman", serif;

    /* Type scale — fluid where it counts */
    --fs-display: clamp(2rem, 1.2rem + 3.5vw, 3.75rem);
    --fs-h1:      clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem);
    --fs-h2:      clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
    --fs-lead:    clamp(1rem, 0.95rem + 0.3vw, 1.125rem);
    --fs-base:    1rem;
    --fs-sm:      0.875rem;
    --fs-xs:      0.75rem;

    /* Spacing scale */
    --s-1: 0.25rem;
    --s-2: 0.5rem;
    --s-3: 0.75rem;
    --s-4: 1rem;
    --s-5: 1.25rem;
    --s-6: 1.5rem;
    --s-8: 2rem;
    --s-10: 2.5rem;
    --s-12: 3rem;
    --s-16: 4rem;
    --s-20: 5rem;
    --s-24: 6rem;

    /* Radius / shadow */
    --r-sm: 4px;
    --r-md: 8px;
    --r-lg: 14px;
    --r-xl: 20px;

    --shadow-sm: 0 1px 2px rgba(20, 32, 46, 0.04),
                 0 1px 3px rgba(20, 32, 46, 0.06);
    --shadow-md: 0 2px 4px rgba(20, 32, 46, 0.04),
                 0 8px 24px rgba(20, 32, 46, 0.08);
    --shadow-lg: 0 4px 8px rgba(20, 32, 46, 0.05),
                 0 24px 48px rgba(20, 32, 46, 0.10);

    /* Layout */
    --container:    72rem;        /* 1152px */
    --container-sm: 56rem;        /* narrow */
    --header-h:     auto;

    /* Motion */
    --t-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --t-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --t-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* -----------------------------------------------------------------------------
   2. RESET + BASE
   --------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    scroll-behavior: smooth;
    tab-size: 4;
}

body {
    margin: 0;
    background: var(--c-bg);
    color: var(--c-text);
    font-family: var(--f-sans);
    font-size: var(--fs-base);
    font-weight: 400;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

img, svg, video, iframe { display: block; max-width: 100%; }
img { height: auto; }

a {
    color: var(--c-navy);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color var(--t-fast);
}
a:hover { color: var(--c-cyan); }
a:focus-visible {
    outline: 2px solid var(--c-cyan);
    outline-offset: 3px;
    border-radius: 2px;
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    cursor: pointer;
}

ul, ol { padding: 0; margin: 0; list-style: none; }

p { margin: 0 0 var(--s-4); }
p:last-child { margin-bottom: 0; }

/* Skip link for keyboard users — bulletproof hide until focused.
   Uses the clip + 1×1 + overflow pattern so no pixel sliver can leak
   through, regardless of font-size or line-height. */
.skip-link {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    color: var(--c-text-on-navy);
    text-decoration: none;
}
.skip-link:focus {
    position: fixed;
    top: var(--s-3);
    left: var(--s-3);
    width: auto;
    height: auto;
    padding: var(--s-3) var(--s-5);
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    background: var(--c-navy);
    color: var(--c-text-on-navy);
    border-radius: var(--r-sm);
    z-index: 100;
    font-weight: 600;
    box-shadow: var(--shadow-md);
}

/* -----------------------------------------------------------------------------
   3. TYPOGRAPHY
   --------------------------------------------------------------------------- */
h1, h2, h3, h4 {
    margin: 0;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--c-navy);
}

.display {
    font-size: var(--fs-display);
    font-weight: 700;
    line-height: 1.05;
    letter-spacing: -0.025em;
    color: var(--c-navy);
}

.h1 { font-size: var(--fs-h1); font-weight: 600; }
.h2 { font-size: var(--fs-h2); font-weight: 600; }

.lead {
    font-size: var(--fs-lead);
    color: var(--c-text-soft);
    line-height: 1.5;
}

.eyebrow {
    font-size: var(--fs-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--c-cyan);
}

.accent {
    font-family: var(--f-accent);
    font-style: italic;
    font-weight: 300;
    letter-spacing: -0.01em;
}

em { font-style: italic; color: var(--c-text-soft); }
strong { font-weight: 600; }

/* -----------------------------------------------------------------------------
   4. LAYOUT
   --------------------------------------------------------------------------- */
.container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding-inline: var(--s-5);
}
@media (min-width: 768px) {
    .container { padding-inline: var(--s-8); }
}

.section { padding-block: var(--s-12); }
@media (min-width: 768px) {
    .section { padding-block: var(--s-16); }
}

/* -----------------------------------------------------------------------------
   5a. HEADER
   --------------------------------------------------------------------------- */
.site-header {
    background: var(--c-surface);
    border-bottom: 1px solid var(--c-border);
    padding-block: var(--s-5);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: saturate(180%) blur(8px);
    -webkit-backdrop-filter: saturate(180%) blur(8px);
    background: rgba(255, 255, 255, 0.92);
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-4);
    flex-wrap: wrap;
}

.site-header__brand {
    display: flex;
    align-items: center;
    gap: var(--s-4);
}

.site-header__logo {
    height: 32px;
    width: auto;
}
@media (min-width: 768px) {
    .site-header__logo { height: 40px; }
}

/* -----------------------------------------------------------------------------
   5b. STREAM SWITCHER (native <select> with optgroups, custom-styled)
   --------------------------------------------------------------------------- */
.stream-switcher-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--s-2);
}
@media (max-width: 639px) {
    .stream-switcher-wrap { align-items: flex-start; width: 100%; }
}

.stream-switcher {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.stream-switcher select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    font: inherit;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--c-navy);
    background: var(--c-surface-alt);
    border: 1px solid transparent;
    border-radius: 999px;

    /* Right padding leaves space for the chevron */
    padding: var(--s-3) calc(var(--s-4) + 22px) var(--s-3) var(--s-5);
    min-height: 40px;
    min-width: 220px;
    cursor: pointer;
    line-height: 1.2;

    /* Custom chevron */
    background-image:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='none' stroke='%23002E5C' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M3.5 6l4.5 4.5L12.5 6'/></svg>");
    background-repeat: no-repeat;
    background-position: right var(--s-4) center;
    background-size: 14px;

    transition: background-color var(--t-fast), border-color var(--t-fast),
                box-shadow var(--t-fast);
}
.stream-switcher select:hover {
    background-color: rgba(0, 46, 92, 0.08);
}
.stream-switcher select:focus-visible {
    outline: 2px solid var(--c-cyan);
    outline-offset: 2px;
}
@media (max-width: 639px) {
    .stream-switcher select { width: 100%; min-width: 0; }
}

.stream-switcher__submit {
    margin-left: var(--s-2);
    padding: var(--s-2) var(--s-3);
    background: var(--c-navy);
    color: var(--c-text-on-navy);
    border-radius: 999px;
    font-weight: 600;
}

.stream-switcher__current {
    margin: 0;
    font-size: var(--fs-xs);
    color: var(--c-text-muted);
    line-height: 1.4;
}
.stream-switcher__current strong {
    color: var(--c-navy);
    font-weight: 600;
}

/* -----------------------------------------------------------------------------
   5c. HERO (event title + meta strip)
   --------------------------------------------------------------------------- */
.hero {
    padding-block: var(--s-12) var(--s-8);
    background:
        radial-gradient(ellipse at top right, rgba(0, 164, 180, 0.06), transparent 60%),
        var(--c-bg);
}
@media (min-width: 768px) {
    .hero { padding-block: var(--s-20) var(--s-10); }
}

.hero__eyebrow {
    margin-bottom: var(--s-4);
    display: flex;
    align-items: center;
    gap: var(--s-3);
}
.hero__eyebrow::before {
    content: "";
    width: 32px;
    height: 1px;
    background: var(--c-cyan);
    display: inline-block;
}

.hero__title {
    margin-bottom: var(--s-3);
    max-width: 22ch;
}

/* -----------------------------------------------------------------------------
   5d. PLAYER SECTION SPACING
   --------------------------------------------------------------------------- */
.player-section { padding-bottom: var(--s-12); }

/* -----------------------------------------------------------------------------
   5e. PLAYER
   --------------------------------------------------------------------------- */
.player {
    --player-radius: var(--r-lg);
    position: relative;
    background: var(--c-navy-deep);
    border-radius: var(--player-radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    aspect-ratio: 16 / 9;
    isolation: isolate;
}

.player iframe,
.player img {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    object-fit: cover;
}

.player__placeholder {
    position: relative;
    width: 100%;
    height: 100%;
}
.player__placeholder img { filter: brightness(0.92); }
.player__placeholder::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(0, 30, 61, 0) 50%,
        rgba(0, 30, 61, 0.55) 100%
    );
    pointer-events: none;
}

.player__caption {
    position: absolute;
    left: var(--s-5);
    bottom: var(--s-5);
    display: inline-flex;
    align-items: center;
    gap: var(--s-3);
    color: var(--c-text-on-navy);
    font-size: var(--fs-sm);
    font-weight: 500;
    letter-spacing: 0.01em;
    z-index: 2;
}

/* Live status indicator */
.live-dot {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 8px;
    background: rgba(226, 108, 80, 0.95);
    color: #fff;
    border-radius: 999px;
    font-size: var(--fs-xs);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.live-dot::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
    animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7); }
    70%  { box-shadow: 0 0 0 8px rgba(255, 255, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--c-navy);
    border-radius: 999px;
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* -----------------------------------------------------------------------------
   5f. CONTENT GRID — programme + documents
   --------------------------------------------------------------------------- */
.content-grid {
    display: grid;
    gap: var(--s-10);
}
@media (min-width: 960px) {
    .content-grid {
        grid-template-columns: 1.15fr 1fr;
        gap: var(--s-12);
    }
}

.panel { /* shared block for programme + documents */ }
.panel__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--s-4);
    margin-bottom: var(--s-6);
    padding-bottom: var(--s-4);
    border-bottom: 1px solid var(--c-border);
}
.panel__head h2 { font-size: var(--fs-h1); font-weight: 600; }

/* -----------------------------------------------------------------------------
   5g. TIMELINE (programme)
   --------------------------------------------------------------------------- */
.timeline { position: relative; }

.timeline__item {
    display: grid;
    grid-template-columns: 4.5rem 1fr;
    gap: var(--s-4);
    padding: var(--s-5) 0;
    border-bottom: 1px solid var(--c-border-soft);
    position: relative;
}
.timeline__item:last-child { border-bottom: 0; padding-bottom: 0; }
.timeline__item:first-child { padding-top: 0; }

@media (min-width: 480px) {
    .timeline__item { grid-template-columns: 3rem 1fr; gap: var(--s-6); }
}

.timeline__time {
    font-family: var(--f-sans);
    font-size: var(--fs-h2);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--c-navy);
    line-height: 1.2;
    letter-spacing: -0.01em;
    position: relative;
}
.timeline__time--empty { color: var(--c-text-muted); font-weight: 400; }
.timeline__time--empty::before {
    content: "";
    display: block;
    width: 24px;
    height: 1px;
    background: var(--c-border);
    margin-top: 0.7em;
}

.timeline__content { min-width: 0; }
.timeline__title {
    font-size: var(--fs-lead);
    font-weight: 600;
    color: var(--c-navy);
    line-height: 1.35;
    margin-bottom: var(--s-2);
}
.timeline__body {
    color: var(--c-text-soft);
    font-size: var(--fs-base);
    margin-bottom: var(--s-3);
}
.timeline__sublist {
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
    margin-top: var(--s-3);
    padding-left: var(--s-4);
    border-left: 2px solid var(--c-cyan-soft);
}
.timeline__sublist li {
    font-size: var(--fs-sm);
    color: var(--c-text-soft);
    line-height: 1.55;
    counter-increment: subitem;
    position: relative;
}
.timeline__sublist li::before {
    content: counter(subitem, lower-alpha) ".";
    position: absolute;
    left: -2.4ch;
    color: var(--c-cyan);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.timeline__sublist {
    counter-reset: subitem;
    padding-left: calc(var(--s-4) + 2.4ch);
}

/* -----------------------------------------------------------------------------
   5h. DOCUMENTS (cards)
   --------------------------------------------------------------------------- */
.docs { display: flex; flex-direction: column; gap: var(--s-3); }

.doc-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: var(--s-4);
    padding: var(--s-4) var(--s-5);
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--r-md);
    text-decoration: none;
    color: var(--c-text);
    transition: border-color var(--t-base), transform var(--t-base),
                box-shadow var(--t-base);
}
.doc-card:hover {
    border-color: var(--c-cyan);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
    color: var(--c-navy);
}
.doc-card:focus-visible {
    outline: 2px solid var(--c-cyan);
    outline-offset: 2px;
}

.doc-card__icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: var(--r-sm);
    background: var(--c-surface-alt);
    color: var(--c-navy);
    flex-shrink: 0;
}
.doc-card__icon svg { width: 20px; height: 20px; }

.doc-card__body { min-width: 0; }
.doc-card__title {
    font-size: var(--fs-base);
    font-weight: 600;
    line-height: 1.35;
    color: var(--c-text);
    margin-bottom: 2px;
}
.doc-card__meta {
    font-size: var(--fs-xs);
    color: var(--c-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.doc-card__arrow {
    color: var(--c-text-muted);
    transition: transform var(--t-base), color var(--t-base);
    flex-shrink: 0;
}
.doc-card:hover .doc-card__arrow {
    color: var(--c-cyan);
    transform: translate(2px, -2px);
}

.docs-note {
    margin-top: var(--s-3);
    padding: var(--s-3) var(--s-4);
    font-size: var(--fs-sm);
    font-style: italic;
    color: var(--c-text-muted);
    background: transparent;
    border-left: 2px solid var(--c-border);
}

/* -----------------------------------------------------------------------------
   5i. FOOTER
   --------------------------------------------------------------------------- */
.site-footer {
    margin-top: var(--s-16);
    padding-block: var(--s-10) var(--s-8);
    background: var(--c-surface);
    border-top: 1px solid var(--c-border);
    color: var(--c-text-soft);
    font-size: var(--fs-sm);
}
.site-footer__inner {
    display: flex;
    flex-direction: column;
    gap: var(--s-4);
    align-items: flex-start;
}
@media (min-width: 768px) {
    .site-footer__inner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.site-footer__copy { color: var(--c-text-muted); }

/* -----------------------------------------------------------------------------
   6. UTILITIES
   --------------------------------------------------------------------------- */
.sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}

.divider {
    height: 1px;
    background: var(--c-border);
    border: 0;
    margin-block: var(--s-12);
}

/* -----------------------------------------------------------------------------
   7. PAGE LOAD ANIMATION (subtle, single shot, additive)
   Content is fully visible by default; animation only enhances arrival.
   This survives JS-off, slow connections, and screenshot tools.
   --------------------------------------------------------------------------- */
.fade-in { animation: fadeInUp 500ms ease-out both; }
.fade-in--d1 { animation-delay: 80ms; }
.fade-in--d2 { animation-delay: 160ms; }
.fade-in--d3 { animation-delay: 240ms; }
.fade-in--d4 { animation-delay: 320ms; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}