/* ---------- ROOT VARIABLER (Radio Projekti 21) ---------- */
:root {
    --bg-night: #0F1115;
    --surface-charcoal: #1A1F29;
    --surface-alt: #151922;
    --primary-red: #C1121F;
    --primary-hover: #E63946;
    --text-ivory: #F4F1EA;
    --text-silver: #A8B0BC;
    --border-smoke: #2B3240;
    --accent-gold: #D4A373;
    --live-red: #E63946;
    --transition: all 0.25s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg-night);
    color: var(--text-ivory);
    font-family: system-ui, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
    scroll-behavior: smooth;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ---------- HEADER ---------- */
.radio-header {
    background: var(--surface-charcoal);
    border-bottom: 1px solid var(--border-smoke);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(6px);
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    padding: 1rem 0;
}

.radio-logo {
    text-decoration: none;
    display: inline-flex;
    flex-direction: column;
}

.logo-main {
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-ivory);
}

.logo-freq {
    font-size: 0.8rem;
    color: var(--accent-gold);
}

.primary-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-list {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-item {
    color: var(--text-silver);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.nav-item:hover {
    color: var(--primary-red);
}

.live-header-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(230, 57, 70, 0.15);
    padding: 0.3rem 1rem;
    border-radius: 40px;
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--live-red);
}

.live-pulse {
    width: 10px;
    height: 10px;
    background: var(--live-red);
    border-radius: 50%;
    animation: pulse 1.2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; transform: scale(1);}
    100% { opacity: 0.2; transform: scale(1.4);}
}

/* ---------- MOBILE NAV ---------- */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 6px;
}

.hamburger-line {
    width: 28px;
    height: 2px;
    background: var(--text-ivory);
    transition: 0.2s;
}

@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }
    .primary-nav {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 80%;
        height: calc(100vh - 70px);
        background: var(--surface-charcoal);
        flex-direction: column;
        align-items: start;
        padding: 2rem;
        transition: left 0.3s ease;
        z-index: 99;
        border-right: 1px solid var(--border-smoke);
    }
    .primary-nav.open {
        left: 0;
    }
    .nav-list {
        flex-direction: column;
        width: 100%;
    }
    .live-header-badge {
        margin-top: 1.5rem;
    }
}

/* ---------- BUTTONS ---------- */
.btn-live, .btn-schedule, .btn-donate {
    display: inline-block;
    padding: 0.75rem 1.8rem;
    border-radius: 40px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.btn-live {
    background: var(--primary-red);
    color: white;
}
.btn-live:hover {
    background: var(--primary-hover);
    transform: scale(1.02);
}

.btn-schedule {
    background: transparent;
    border: 1.5px solid var(--primary-red);
    color: var(--text-ivory);
}
.btn-schedule:hover {
    background: var(--primary-red);
    color: white;
}

.btn-donate {
    background: var(--accent-gold);
    color: var(--bg-night);
}
.btn-donate:hover {
    background: #e6b87e;
    transform: translateY(-2px);
}

/* ---------- HERO ---------- */
.hero-wave {
    background: linear-gradient(145deg, var(--surface-alt), var(--bg-night));
    text-align: center;
    padding: 5rem 0 3rem;
    position: relative;
}

.hero-headline {
    font-size: 3.5rem;
    font-weight: 800;
    margin: 0.5rem 0;
}

.hero-subhead {
    font-size: 1.3rem;
    color: var(--accent-gold);
    margin-bottom: 2rem;
}

.live-flag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(193, 18, 31, 0.2);
    padding: 0.3rem 1.2rem;
    border-radius: 60px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-content {
    max-width: 940px;
}

.hero-radio-widget {
    margin: 2rem auto 0;
    padding: 1.35rem;
    text-align: left;
    background:
        radial-gradient(circle at top left, rgba(212, 163, 115, 0.18), transparent 34%),
        linear-gradient(135deg, rgba(26, 31, 41, 0.98), rgba(15, 17, 21, 0.98));
    border: 1px solid rgba(212, 163, 115, 0.24);
    border-radius: 24px;
    box-shadow: 0 24px 60px -32px rgba(0, 0, 0, 0.7);
}

.radio-widget-top,
.radio-widget-main,
.radio-widget-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.radio-widget-top {
    margin-bottom: 1rem;
}

.radio-widget-station {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.radio-widget-label,
.radio-widget-note {
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-silver);
}

.radio-widget-name {
    font-size: 1.2rem;
    color: var(--text-ivory);
}

.radio-widget-meta,
#radioConnectionText {
    color: var(--text-silver);
    font-size: 0.95rem;
}

.radio-widget-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.9rem;
    background: rgba(230, 57, 70, 0.1);
    border: 1px solid rgba(230, 57, 70, 0.18);
    border-radius: 999px;
    color: var(--text-ivory);
    white-space: nowrap;
}

.radio-widget-pulse {
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 50%;
    background: var(--live-red);
    box-shadow: 0 0 0 0 rgba(230, 57, 70, 0.55);
}

.radio-control {
    width: 74px;
    height: 74px;
    border: none;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary-red), var(--primary-hover));
    color: #fff;
    font-size: 1.6rem;
    cursor: pointer;
    box-shadow: 0 14px 30px -16px rgba(230, 57, 70, 0.85);
    transition: var(--transition);
}

.radio-control:hover {
    transform: translateY(-2px) scale(1.02);
}

.radio-control:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.radio-track {
    flex: 1;
    min-width: 0;
}

.radio-track-head {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

#radioNowTitle {
    font-size: 1.05rem;
    color: var(--text-ivory);
}

#radioNowMeta {
    color: var(--accent-gold);
    font-size: 0.92rem;
}

.radio-visualizer {
    height: 42px;
    margin-top: 0.9rem;
    display: flex;
    align-items: end;
    gap: 0.45rem;
}

.radio-visualizer span {
    width: 9px;
    height: 14px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--accent-gold), var(--primary-red));
    opacity: 0.5;
    transform-origin: bottom center;
}

.hero-radio-widget.is-playing .radio-widget-pulse {
    animation: pulse-ring 1.4s infinite;
}

.hero-radio-widget.is-playing .radio-visualizer span:nth-child(1) { animation: equalize 0.9s ease-in-out infinite; }
.hero-radio-widget.is-playing .radio-visualizer span:nth-child(2) { animation: equalize 1.1s ease-in-out infinite 0.1s; }
.hero-radio-widget.is-playing .radio-visualizer span:nth-child(3) { animation: equalize 0.8s ease-in-out infinite 0.2s; }
.hero-radio-widget.is-playing .radio-visualizer span:nth-child(4) { animation: equalize 1.2s ease-in-out infinite 0.05s; }
.hero-radio-widget.is-playing .radio-visualizer span:nth-child(5) { animation: equalize 1s ease-in-out infinite 0.15s; }

@keyframes pulse-ring {
    0% {
        box-shadow: 0 0 0 0 rgba(230, 57, 70, 0.55);
    }
    100% {
        box-shadow: 0 0 0 10px rgba(230, 57, 70, 0);
    }
}

@keyframes equalize {
    0%, 100% {
        height: 12px;
        opacity: 0.45;
    }
    50% {
        height: 38px;
        opacity: 1;
    }
}

.radio-volume {
    min-width: 150px;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    color: var(--text-silver);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.radio-volume input {
    width: 100%;
    accent-color: var(--primary-red);
    cursor: pointer;
}

.radio-widget-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-radio-widget.is-error {
    border-color: rgba(230, 57, 70, 0.38);
}

body.has-floating-radio {
    padding-bottom: 110px;
}

.floating-radio-player {
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    width: min(920px, calc(100% - 24px));
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(212, 163, 115, 0.24);
    border-radius: 20px;
    background: rgba(15, 17, 21, 0.94);
    backdrop-filter: blur(12px);
    box-shadow: 0 20px 50px -28px rgba(0, 0, 0, 0.8);
    z-index: 150;
}

.floating-radio-player.is-playing {
    border-color: rgba(230, 57, 70, 0.42);
}

.floating-radio-player.is-error {
    border-color: rgba(230, 57, 70, 0.42);
}

.floating-radio-toggle {
    width: 56px;
    height: 56px;
    border: none;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary-red), var(--primary-hover));
    color: #fff;
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition);
}

.floating-radio-toggle:hover {
    transform: translateY(-2px);
}

.floating-radio-copy {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.floating-radio-title {
    color: var(--text-ivory);
    font-size: 1rem;
}

.floating-radio-status {
    color: var(--text-silver);
    font-size: 0.92rem;
}

.floating-radio-volume {
    width: 170px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-silver);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.floating-radio-range {
    width: 100%;
    accent-color: var(--primary-red);
}

.wave-divider {
    height: 60px;
    background: repeating-linear-gradient(45deg, var(--border-smoke) 0px, var(--border-smoke) 2px, transparent 2px, transparent 8px);
    margin-top: 2rem;
}

/* ---------- LIVE CARD ---------- */
.now-playing {
    padding: 3rem 0;
}

.air-card {
    background: var(--surface-charcoal);
    border-radius: 28px;
    padding: 1.8rem;
    border-left: 5px solid var(--live-red);
    box-shadow: 0 20px 30px -12px rgba(0,0,0,0.4);
}

.air-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.air-badge {
    background: var(--primary-red);
    padding: 0.2rem 1rem;
    border-radius: 40px;
    font-size: 0.8rem;
}

.air-time {
    color: var(--text-silver);
}

.show-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.progress-track {
    height: 4px;
    background: var(--border-smoke);
    border-radius: 4px;
    margin-top: 1.2rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent-gold);
    width: 0%;
    border-radius: 4px;
}

/* ---------- PROGRAM GRID ---------- */
.program-grid {
    background: var(--surface-alt);
    padding: 4rem 0;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    border-left: 4px solid var(--primary-red);
    padding-left: 1rem;
}

.shows-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
}

.show-card {
    background: var(--surface-charcoal);
    border-radius: 24px;
    padding: 1.8rem;
    border: 1px solid var(--border-smoke);
    transition: var(--transition);
}
.show-card:hover {
    transform: translateY(-6px);
    border-color: var(--accent-gold);
}
.card-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}
.show-tag {
    display: inline-block;
    margin-top: 1rem;
    font-size: 0.7rem;
    background: var(--primary-red);
    padding: 0.2rem 0.8rem;
    border-radius: 40px;
}

/* ---------- COMMUNITY FEED ---------- */
.community-feed {
    padding: 4rem 0;
}
.feed-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.8rem;
}
.feed-item {
    background: var(--surface-charcoal);
    border-radius: 20px;
    padding: 1.5rem;
    border-bottom: 2px solid var(--accent-gold);
}
.feed-badge {
    font-weight: bold;
    color: var(--accent-gold);
    margin-bottom: 0.75rem;
}

/* ---------- SUPPORT SECTION ---------- */
.support-cta {
    padding: 4rem 0;
    background: radial-gradient(circle at 20% 30%, var(--surface-charcoal), var(--bg-night));
    text-align: center;
}
.support-wrapper h2 {
    font-size: 2rem;
}
.support-wrapper p {
    margin: 1rem 0;
}

/* ---------- FOOTER ---------- */
.radio-footer {
    background: var(--surface-charcoal);
    border-top: 1px solid var(--border-smoke);
    padding: 2rem 0;
}
.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}
.slogan-footer {
    font-size: 0.85rem;
    color: var(--accent-gold);
}
.social-links {
    display: flex;
    gap: 1rem;
}
.social-link {
    background: linear-gradient(180deg, rgba(43, 50, 64, 0.95), rgba(26, 31, 41, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.08);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    text-decoration: none;
    color: var(--text-ivory);
    box-shadow: 0 12px 24px -18px rgba(0, 0, 0, 0.7);
    transition: var(--transition);
}
.social-link:hover {
    background: linear-gradient(135deg, var(--primary-red), var(--primary-hover));
    border-color: rgba(230, 57, 70, 0.4);
    transform: translateY(-2px);
}
.social-link svg {
    width: 18px;
    height: 18px;
    display: block;
    fill: currentColor;
}

/* ---------- CARD / LIST STYLES ---------- */
.card-grid, .blog-grid, .related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}
.post-card, .blog-card, .related-card {
    background: var(--surface-charcoal);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border-smoke);
    transition: var(--transition);
}
.post-card:hover, .blog-card:hover {
    border-color: var(--accent-gold);
    transform: translateY(-4px);
}
.card-img, .blog-card-img, .related-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}
.card-info, .blog-card-body, .related-info {
    padding: 1.25rem;
}
.card-title a, .blog-card-title a, .related-info h4 a {
    color: var(--text-ivory);
    text-decoration: none;
    font-weight: 600;
}
.card-summary, .blog-excerpt {
    color: var(--text-silver);
    margin-top: 0.5rem;
}

/* ---------- SINGLE ARTICLE ---------- */
.single-article {
    max-width: 800px;
    margin: 2rem auto;
}
.hero-figure {
    margin: 2rem 0;
}
.featured-image {
    width: 100%;
    border-radius: 24px;
}
.article-body {
    font-size: 1.1rem;
}
.article-body a {
    color: var(--primary-red);
}
.article-separator {
    margin: 2rem 0;
    border-color: var(--border-smoke);
}
.list-page-title,
.article-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    border-left: 5px solid var(--primary-red);
    padding-left: 1rem;
    color: var(--text-ivory);
}

/* ---------- CONTENT TABLES ---------- */
.hugo-content table,
.markdown-body table,
.article-body table {
    width: 100%;
    display: block;
    overflow-x: auto;
    border-collapse: collapse;
    margin: 1.75rem 0;
    background: linear-gradient(180deg, rgba(26, 31, 41, 0.96), rgba(21, 25, 34, 0.96));
    border: 1px solid var(--border-smoke);
    border-radius: 18px;
    box-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.55);
    -webkit-overflow-scrolling: touch;
}

.hugo-content table::-webkit-scrollbar,
.markdown-body table::-webkit-scrollbar,
.article-body table::-webkit-scrollbar {
    height: 10px;
}

.hugo-content table::-webkit-scrollbar-thumb,
.markdown-body table::-webkit-scrollbar-thumb,
.article-body table::-webkit-scrollbar-thumb {
    background: var(--border-smoke);
    border-radius: 999px;
}

.hugo-content table thead,
.hugo-content table tbody,
.markdown-body table thead,
.markdown-body table tbody,
.article-body table thead,
.article-body table tbody {
    width: 100%;
}

.hugo-content table thead tr,
.hugo-content table tbody tr,
.markdown-body table thead tr,
.markdown-body table tbody tr,
.article-body table thead tr,
.article-body table tbody tr {
    background: transparent;
}

.hugo-content th,
.hugo-content td,
.markdown-body th,
.markdown-body td,
.article-body th,
.article-body td {
    min-width: 180px;
    padding: 1rem 1.15rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border-smoke);
}

.hugo-content th,
.markdown-body th,
.article-body th {
    background: rgba(193, 18, 31, 0.14);
    color: var(--text-ivory);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.hugo-content td,
.markdown-body td,
.article-body td {
    color: var(--text-silver);
    line-height: 1.6;
}

.hugo-content tbody tr:nth-child(even),
.markdown-body tbody tr:nth-child(even),
.article-body tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.hugo-content tbody tr:hover,
.markdown-body tbody tr:hover,
.article-body tbody tr:hover {
    background: rgba(212, 163, 115, 0.08);
}

.hugo-content tbody tr:last-child td,
.markdown-body tbody tr:last-child td,
.article-body tbody tr:last-child td {
    border-bottom: none;
}

.hugo-content td:first-child,
.hugo-content th:first-child,
.markdown-body td:first-child,
.markdown-body th:first-child,
.article-body td:first-child,
.article-body th:first-child {
    font-weight: 600;
    color: var(--text-ivory);
}

/* ---------- PAGINATION ---------- */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}
.page-item {
    list-style: none;
}
.page-link {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--surface-charcoal);
    border-radius: 30px;
    border: 1px solid var(--border-smoke);
    color: var(--text-ivory);
    text-decoration: none;
}
.page-link:hover {
    background: var(--primary-red);
}

/* ---------- ADAPTIVE ---------- */
@media (max-width: 640px) {
    .hero-headline { font-size: 2.3rem; }
    .show-title { font-size: 1.5rem; }
    .section-title { font-size: 1.6rem; }
    .footer-inner { flex-direction: column; text-align: center; }
    .card-grid, .blog-grid { grid-template-columns: 1fr; }
    .list-page-title,
    .article-title {
        font-size: 1.8rem;
    }
    .hero-radio-widget {
        padding: 1rem;
        border-radius: 18px;
    }
    body.has-floating-radio {
        padding-bottom: 132px;
    }
    .floating-radio-player {
        width: calc(100% - 16px);
        bottom: 8px;
        padding: 0.85rem;
        border-radius: 16px;
        gap: 0.75rem;
    }
    .floating-radio-volume {
        width: 120px;
        gap: 0.5rem;
    }
    .radio-widget-top,
    .radio-widget-main,
    .radio-widget-footer {
        flex-direction: column;
        align-items: stretch;
    }
    .radio-widget-indicator {
        align-self: flex-start;
    }
    .radio-control {
        width: 64px;
        height: 64px;
        font-size: 1.4rem;
    }
    .radio-volume {
        min-width: 0;
    }
    .radio-widget-footer {
        gap: 0.5rem;
    }
    .floating-radio-title {
        font-size: 0.95rem;
    }
    .floating-radio-status {
        font-size: 0.84rem;
    }
    .hugo-content table,
    .markdown-body table,
    .article-body table {
        margin: 1.25rem 0;
        border-radius: 14px;
    }
    .hugo-content th,
    .hugo-content td,
    .markdown-body th,
    .markdown-body td,
    .article-body th,
    .article-body td {
        min-width: 160px;
        padding: 0.85rem 0.9rem;
        font-size: 0.95rem;
    }
}
