:root {
    --text-color: #ffffff;
    --muted-text: #6b7280;
    --bg-color: #192e24;
    --card-bg: #ffffff;
    --border: #e5e7eb;
    --shadow: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    --header-height: 56px;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
    color: var(--text-color);
    background: var(--bg-color);
    padding-top: var(--header-height);
}

.container {
    max-width: 1100px;
    margin: 3rem auto;
    padding: 0 24px;
}

/* Footer */

.site-footer {
    background: rgba(25, 46, 36, 0.98);
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.site-footer__inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 10px 24px;
}

.site-footer__text {
    margin: 0;
    color: var(--muted-text);
    font-size: 0.9rem;
}

.site-footer a {
    color: #c7d2fe;
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}


h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

p {
    line-height: 1.6;
}

/* Hero layout */
.hero {
    display: grid;
    grid-template-columns: 1.6fr 0.4fr;
    gap: 32px;
    align-items: center;
}

.hero__media {
    width: 100%;
}

.hero__image {
    width: 100%;
    height: auto;
    border-radius: 16px;
    box-shadow: var(--shadow);
    display: block;
}

.hero__frame {
    width: 100%;
    aspect-ratio: 4 / 3;
    border: 0;
    border-radius: 16px;
    box-shadow: var(--shadow);
    display: block;
}

.hero__qr {
    width: 100%;
}

.qr-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow);
}

/* Themed card backgrounds (exclude the QR code card in hero) */
.streams .qr-card,
#download-app .qr-card,
#about .qr-card {
    background: #2b4d3c;
    border-color: #2b4d3c;
}

/* Legal card styles */
.legal .legal-card {
    background: #2b4d3c; /* lighter green used elsewhere */
    border-color: #2b4d3c;
    color: #ffffff;
}

.legal .legal-card a {
    color: #ffffff;
    text-decoration: underline;
}

/* Ensure readable text on the white QR card in hero */
.hero__qr .qr-card {
    color: #111827;
    border-color: #ffffff;
}

.qr-card__image {
    width: 100%;
    max-width: 220px;
    height: auto;
    display: block;
    margin: 0 auto 16px auto;
    border-radius: 12px;
}

/* Ensure QR PNG variants have crisp square corners */
.qr-card__image[src$="qr-bch-bollekeshoef.png"],
.qr-card__image[src$="qr-bch-pollofarm.png"] {
    border-radius: 0;
}

.qr-card__title {
    font-size: 1.25rem;
    margin: 0 0 6px 0;
}

.qr-card__text {
    margin: 0;
    color: inherit;
}

/* Responsive */
@media (max-width: 900px) {
    .container { margin: 2.5rem auto; }
    .hero { grid-template-columns: 1fr; }
    /* Ensure no-streams card matches other cards on mobile */
    .stream-card--no-streams {
        max-width: none;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* Remove width constraint from streams container when no-streams card is present */
    .streams:has(.stream-card--no-streams) {
        max-width: none;
        margin: 0;
    }
    /* Hide the hero QR section on mobile */
    .hero__qr { display: none; }
    /* Show mobile-only note */
    .mobile-note { display: block; }
}

/* Header */
.site-header {
    background-color: var(--bg-color);
    border-bottom: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    transition: background-color 250ms ease;
}

.site-header__inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.site-header__logo img {
    height: 28px;
    width: auto;
    display: block;
}

.site-nav { margin-left: 0; }

.site-nav__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 16px;
}

.site-nav__link {
    color: #f3f4f6;
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 8px;
    display: inline-block;
}

.site-nav__link:hover {
    background: rgba(255, 255, 255, 0.06);
}

/* Hamburger toggle (hidden on desktop) */
.site-nav__toggle {
    appearance: none;
    background: transparent;
    border: 0;
    padding: 8px;
    margin-left: 0;
    border-radius: 8px;
    cursor: pointer;
    display: none; /* shown on small screens */
}

.site-nav__toggle:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
}

.site-nav__toggle-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: #f3f4f6;
    border-radius: 2px;
    position: relative;
}

.site-nav__toggle-bar + .site-nav__toggle-bar { margin-top: 5px; }

/* Mobile nav panel (closed by default) */
.site-nav {
    position: static;
}

@media (max-width: 900px) {
    .site-nav__toggle { display: inline-block; }
    .site-nav { position: absolute; top: var(--header-height); left: 0; right: 0; }
    .site-nav__list {
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: rgba(25, 46, 36, 0.98);
        border-bottom: 1px solid rgba(255, 255, 255, 0.12);
        padding: 8px;
    }
    .site-header[data-nav-open="true"] .site-nav__list { display: flex; }
    .site-nav__link { padding: 12px 12px; border-radius: 8px; }
    .lang-menu, .mode-toggle { margin-left: 0; }
    .mode-toggle { display: none; }
}

/* Language flag menu */
.lang-menu { position: relative; margin-left: auto; }
.lang-menu__btn {
    appearance: none;
    background: rgba(255, 255, 255, 0.08);
    color: #f3f4f6;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 6px 10px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.lang-menu__btn:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
}
.lang-menu__list {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 180px;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: rgba(25, 46, 36, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    box-shadow: var(--shadow);
    z-index: 1100;
}
.lang-menu__item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #f3f4f6;
    text-decoration: none;
    padding: 8px 10px;
    border-radius: 8px;
}
.lang-menu__item:hover { background: rgba(255, 255, 255, 0.06); }
.flag { display: inline-block; }
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Mode toggle */
.mode-toggle {
    margin-left: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 4px;
    display: inline-flex;
    gap: 4px;
}

.mode-toggle__btn {
    appearance: none;
    background: transparent;
    color: #f3f4f6;
    border: 0;
    padding: 6px 10px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

.mode-toggle__btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.mode-toggle__btn.is-active {
    background: #f3f4f6;
    color: #111827;
}

.mode-toggle__btn:focus-visible {
    outline: 2px solid #93c5fd;
    outline-offset: 2px;
}

/* Header state when page is scrolled */
.site-header.is-scrolled {
    background-color: #2b4d3c; /* matches card green */
}

@media (max-width: 600px) {
    .site-header__logo img { height: 24px; }
    .site-nav__list { gap: 10px; }
}

/* Sections */
.section {
    margin-top: 4rem;
}

/* Ensure anchor links account for fixed header height */
.hero,
.section {
    scroll-margin-top: var(--header-height);
}

/* Add a bit more space above the hero title when scrolled into view */
.hero {
    scroll-margin-top: calc(var(--header-height) + 12px);
}

.section__title {
    color: #f3f4f6;
    margin: 0 0 1rem 0;
}

.section__text {
    margin: 0 0 1rem 0;
}

.streams {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

/* Responsive grid for stream cards - based on 4-card reference width */
@media (min-width: 580px) {
    .streams {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (min-width: 880px) {
    .streams {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

@media (min-width: 1180px) {
    .streams {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }
}

/* Ensure no-streams card takes full width on desktop */
@media (min-width: 901px) {
    .stream-card--no-streams {
        max-width: none;
        width: 100%;
        box-sizing: border-box;
        grid-column: 1 / -1; /* Span all grid columns */
    }
    
    /* Override grid for no-streams card to be full width */
    .streams:has(.stream-card--no-streams) {
        grid-template-columns: 1fr;
        max-width: none; /* Remove width constraint to match download app card */
        margin: 0;
    }
}

/* Align language dropdown to iframe right edge when no stream is available */
@media (min-width: 901px) {
    body[data-has-stream="false"] .site-header__inner {
        /* header content width stays container-wide; shift lang menu inward to iframe edge */
        position: relative;
    }
    body[data-has-stream="false"] .lang-menu {
        /* Container is 1100px + 48px padding (24 each side). The hero grid gap is 32px
           and the left column is 80% of remaining width. This margin-right equals the
           right column (20%) plus the 32px gap, aligning the dropdown with iframe edge. */
        margin-right: calc((100% - 48px) * 0.2 + 32px);
    }
}

/* Desktop alignment rules */
@media (min-width: 901px) {
    /* Always match hero left column width (80% of grid minus gap) */
    .streams {
        width: calc((100% - 32px) * 0.8);
        margin-left: 0;
        margin-right: auto;
    }
    /* Make sections match iframe width; their inner cards will fill it */
    #download-app,
    #about {
        width: calc((100% - 32px) * 0.8);
        margin-left: 0;
        margin-right: auto;
    }
}

.stream-card {
    /* Keep all stream cards the same width/height */
    aspect-ratio: 16 / 9;
    min-height: 80px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    text-align: left;
    padding: 16px;
    border-radius: 12px;
}

/* Center text only for actual available stream cards */
.stream-card.stream-select {
    align-items: center;
    text-align: center;
}

.stream-card__title {
    margin: 0 0 6px 0;
    color: #ffffff; /* ensure white title text on livestream cards */
    /* Prevent tall variations due to long titles */
    font-size: 0.9rem;
    font-weight: 600;
    line-clamp: 2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stream-card__text {
    margin: 0;
}

/* Active/selected stream card */
.stream-card.is-active {
    border: 2px solid #6CBE54;
    color: #6CBE54;
}

.stream-card.is-active .stream-card__title,
.stream-card.is-active .stream-card__text {
    color: #6CBE54;
}

/* No streams available card - minimal height, fits mobile width */
.stream-card--no-streams {
    aspect-ratio: unset;
    min-height: unset;
    height: auto;
    padding: 20px;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

/* Ensure no-streams card spans full width in grid */
@media (min-width: 580px) {
    .stream-card--no-streams {
        grid-column: 1 / -1;
    }
}

/* Override with higher specificity to match download app and about cards */
.streams .stream-card--no-streams {
    background: #2b4d3c !important;
    border: 1px solid #2b4d3c !important;
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.download-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.download-buttons a {
    display: inline-block;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
}

.download-buttons img {
    height: 48px;
    width: auto;
    display: block;
    position: relative;
    /* Ensure full badge remains visible on small screens */
    clip-path: none;
    border-radius: 10px;
}


/* Hidden by default; revealed in mobile media query */
.mobile-note {
    display: none;
    color: #f3f4f6;
    margin-top: 10px;
    font-size: 0.95rem;
    text-align: center;
}

.mobile-note__btn {
    display: inline-block;
    background: #6CBE54;
    color: #ffffff;
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    margin-top: 8px;
}

/* Ensure mobile note is visible on small screens (override cascade) */
@media (max-width: 900px) {
    .mobile-note { display: block !important; }
    /* Force-hide mode toggle on mobile */
    .mode-toggle { display: none !important; }
}
