/*
 * Sivukohtaiset teemapoikkeukset.
 *
 * Yhteiset arvot ovat theme-tokens.css-tiedostossa. Tähän tiedostoon tulevat
 * vain sivun tai sivuryhmän omat token-arvojen vaihdot.
 */

/* Radioviestit käyttää yhteistä pohjagradienttia ilman värillisiä overlayta. */
.radio-radioviestit-page {
    --page-glow-red: transparent;
    --page-glow-green: transparent;
    --radio-button-bg: rgba(255, 255, 255, 0.05);
    --radio-button-border: rgba(255, 255, 255, 0.14);
    --radio-button-text: #fff;
    --radio-button-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
    --radio-button-hover-bg: rgba(255, 255, 255, 0.09);
    --radio-button-hover-border: rgba(255, 255, 255, 0.28);
    --radio-button-hover-shadow: 0 12px 30px rgba(0, 0, 0, 0.24);
    --radio-button-ghost-bg: rgba(255, 255, 255, 0.03);
    --radio-button-ghost-text: #fff;
    --color-accent-2: #f0f0f0;
}

/* Omat radioviestit säilyttää oman painikekorostuksensa, mutta käyttää samaa
 * neutraalia sivupohjaa kuin muu Radioviestit-sivu. */
.radio-radioviestit-page--mine {
    --radio-button-bg: linear-gradient(180deg, #df4d67 0%, #c93452 100%);
    --radio-button-border: rgba(255, 94, 133, 0.85);
    --radio-button-text: #fff;
    --radio-button-shadow: 0 10px 26px rgba(201, 52, 82, 0.24);
    --radio-button-hover-bg: linear-gradient(180deg, #ff6b9d 0%, #e74d7f 100%);
    --radio-button-hover-border: rgba(255, 137, 177, 0.9);
    --radio-button-hover-shadow: 0 12px 30px rgba(231, 77, 127, 0.22);
    --radio-button-ghost-bg: rgba(255, 255, 255, 0.04);
    --radio-button-ghost-text: #fff;
}

/* Mainostajille-sivun sininen sivukohtainen teema. */
.radio-advertisers-page {
    --radio-button-bg: linear-gradient(180deg, rgba(112, 152, 214, 0.18), rgba(86, 118, 172, 0.22));
    --radio-button-border: rgba(141, 184, 235, 0.5);
    --radio-button-text: #eef7ff;
    --radio-button-shadow: 0 10px 28px rgba(5, 12, 24, 0.28);
    --radio-button-hover-bg: linear-gradient(180deg, rgba(126, 170, 232, 0.28), rgba(95, 132, 190, 0.34));
    --radio-button-hover-border: rgba(191, 217, 250, 0.7);
    --radio-button-hover-shadow: 0 12px 30px rgba(5, 12, 24, 0.34);
    --radio-button-ghost-bg: rgba(129, 166, 219, 0.06);
    --radio-button-ghost-text: #eef7ff;
    background:
        radial-gradient(circle at 16% 10%, rgba(120, 155, 210, 0.16), transparent 26rem),
        radial-gradient(circle at 82% 22%, rgba(95, 123, 158, 0.12), transparent 22rem),
        linear-gradient(180deg, #111822 0%, #0d1118 52%, #10141b 100%);
}

/* Tapahtumat käyttää omaa lämmintä live-teemaa. */
.radio-page--live {
    --color-accent: var(--brand-live-accent);
    --color-accent-3: #f0c27d;
    --radio-button-bg: linear-gradient(180deg, #e0a15b 0%, #b96d3f 100%);
    --radio-button-border: rgba(224, 161, 91, 0.78);
    --radio-button-shadow: 0 10px 26px rgba(185, 109, 63, 0.24);
    --radio-button-hover-bg: linear-gradient(180deg, #f0c27d 0%, #d48652 100%);
    --radio-button-hover-border: rgba(240, 194, 125, 0.88);
    --radio-button-hover-shadow: 0 12px 30px rgba(212, 134, 82, 0.24);
    background:
        radial-gradient(circle at 14% 8%, rgba(224, 161, 91, 0.07), transparent 32rem),
        radial-gradient(circle at 82% 18%, rgba(111, 184, 176, 0.05), transparent 28rem),
        linear-gradient(180deg, #101214 0%, #0b0d0f 48%, #101316 100%);
}

.radio-page--live .radio-kicker {
    color: var(--brand-live-accent);
}

/* Tapahtumat näkyy päävalikossa samalla kuparilla kuin sivun oma teema. */
body.post-type-archive-radio_event .site-nav__link--radio.is-current,
body.single-radio_event .site-nav__link--radio.is-current {
    --nav-active-color: var(--brand-live-accent);
}

/* Jäsenalueet käyttävät samaa sinivihreää pohjateemaa. */
.radio-page--chat,
.radio-page--account,
.radio-page--member-profile,
.radio-page--community-gallery,
.radio-page--community-feed,
.radio-games-page,
.radio-biisitoiveet-page {
    --color-accent-2: var(--brand-member-accent);
    --color-accent-3: var(--brand-member-accent-soft);
    --radio-button-bg: linear-gradient(180deg, #6fb8b0 0%, #438a86 100%);
    --radio-button-border: rgba(111, 184, 176, 0.68);
    --radio-button-shadow: 0 10px 26px rgba(48, 111, 109, 0.22);
    --radio-button-hover-bg: linear-gradient(180deg, #8ccfc6 0%, #5ba39d 100%);
    --radio-button-hover-border: rgba(154, 215, 208, 0.86);
    --radio-button-hover-shadow: 0 12px 30px rgba(68, 139, 135, 0.25);
    background:
        radial-gradient(circle at 12% 8%, var(--brand-member-page-glow), transparent 32rem),
        radial-gradient(circle at 86% 18%, var(--brand-member-page-cool-glow), transparent 28rem),
        linear-gradient(180deg, var(--brand-member-page-bg-start) 0%, var(--brand-member-page-bg-mid) 48%, var(--brand-member-page-bg-end) 100%);
}

.radio-page--chat .radio-kicker,
.radio-page--account .radio-kicker,
.radio-page--member-profile .radio-kicker,
.radio-page--community-gallery .radio-kicker,
.radio-page--community-feed .radio-kicker,
.radio-games-page .radio-kicker,
.radio-biisitoiveet-page .radio-kicker,
.radio-biisitoiveet-page .radio-label {
    color: var(--brand-member-accent);
}

/* Profiilisivu käyttää jäsenpohjaa myös omissa yhteisöpaneeleissaan. */
.radio-page--member-profile .jrc-member-profile__hero,
.radio-page--member-profile .jrc-member-profile__gallery-shell {
    --jrc-profile-accent: var(--brand-member-accent);
    --jrc-profile-panel-border: var(--brand-member-profile-border);
    --jrc-profile-panel-glow: var(--brand-member-profile-panel-glow);
    --jrc-profile-panel-cool-glow: var(--brand-member-profile-panel-cool-glow);
    --jrc-profile-panel-bg-start: var(--brand-member-profile-panel-bg-start);
    --jrc-profile-panel-bg-end: var(--brand-member-profile-panel-bg-end);
    --jrc-profile-active-bg: var(--brand-member-profile-active-bg);
    --jrc-profile-active-border: var(--brand-member-profile-active-border);
}

.radio-page--chat .radio-chat-box {
    border-color: var(--brand-member-chat-border);
    background:
        radial-gradient(circle at top left, var(--brand-member-chat-glow), transparent 20rem),
        radial-gradient(circle at top right, var(--brand-member-chat-cool-glow), transparent 20rem),
        linear-gradient(180deg, var(--brand-member-chat-bg-start), var(--brand-member-chat-bg-end));
}

.radio-page--chat .ja-radio-chat {
    --chat-profile-bot: var(--brand-member-accent);
}

/* Radion tarina: rauhallinen kaksipalstainen hero ja rajattu logomerkki. */
.radio-story-page {
    --radio-story-accent: #8cffb7;
}

.radio-story-hero {
    display: grid;
    align-items: center;
    min-height: clamp(23rem, 48vh, 34rem);
    border-bottom: 1px solid var(--color-line);
    background:
        radial-gradient(ellipse 34rem 24rem at 82% 35%, rgba(140, 255, 183, 0.08), transparent 70%),
        radial-gradient(ellipse 32rem 22rem at 8% 15%, rgba(255, 59, 59, 0.055), transparent 72%);
}

.radio-story-hero__inner,
.radio-story-main__inner,
.radio-story-community__inner {
    display: grid;
    align-items: center;
    gap: clamp(2rem, 5vw, 5rem);
}

.radio-story-hero__inner {
    grid-template-columns: minmax(0, 1fr) minmax(10rem, 15rem);
    padding-block: clamp(3rem, 7vw, 6rem);
}

.radio-story-hero__copy {
    max-width: 48rem;
}

.radio-story-page .radio-kicker {
    color: var(--radio-story-accent);
}

.radio-story-hero h1 {
    margin: 0 0 1.25rem;
    color: #fff;
    font-size: clamp(2.8rem, 1.7rem + 4vw, 5.4rem);
    line-height: 0.98;
}

.radio-story-hero__lede {
    max-width: 54ch;
    margin: 0;
    color: var(--color-muted);
    font-size: clamp(1.08rem, 0.98rem + 0.45vw, 1.32rem);
    line-height: 1.7;
}

.radio-story-hero__brand {
    display: grid;
    place-items: center;
    width: 100%;
    aspect-ratio: 1;
    margin: 0;
    border: 1px solid rgba(140, 255, 183, 0.18);
    border-radius: 1.5rem;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.018));
    box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.28), inset 0 1px rgba(255, 255, 255, 0.05);
}

.radio-story-hero__brand img {
    display: block;
    width: min(72%, 10rem);
    height: min(72%, 10rem);
    object-fit: contain;
}

.radio-story-main {
    padding-block: clamp(3.5rem, 8vw, 7rem);
}

.radio-story-main__inner {
    grid-template-columns: minmax(15rem, 0.8fr) minmax(0, 1.2fr);
    align-items: start;
}

.radio-story-main__heading h2,
.radio-story-community h2 {
    margin: 0;
    color: #fff;
    font-size: clamp(1.8rem, 1.3rem + 1.8vw, 2.8rem);
    line-height: 1.12;
}

.radio-story-main__body {
    max-width: 66ch;
    color: var(--color-muted);
    font-size: 1.06rem;
    line-height: 1.85;
}

.radio-story-main__body p {
    margin: 0 0 1.25rem;
}

.radio-story-main__body p:last-child {
    margin-bottom: 0;
}

.radio-story-community {
    padding-block: 0 clamp(4rem, 9vw, 7rem);
}

.radio-story-community__inner {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: clamp(1.75rem, 4vw, 3rem);
    border: 1px solid rgba(140, 255, 183, 0.16);
    border-radius: 1.25rem;
    background:
        radial-gradient(ellipse 28rem 18rem at 0% 100%, rgba(140, 255, 183, 0.075), transparent 75%),
        rgba(255, 255, 255, 0.025);
}

.radio-story-community__copy {
    max-width: 54ch;
}

.radio-story-community__copy > p:last-child {
    margin: 0.9rem 0 0;
    color: var(--color-muted);
    line-height: 1.7;
}

.radio-story-community .radio-button span {
    margin-left: 0.5rem;
}

@media (max-width: 700px) {
    .radio-story-hero__inner {
        grid-template-columns: minmax(0, 1fr) 6rem;
        gap: 1.25rem;
        padding-block: 3.25rem;
    }

    .radio-story-hero__brand {
        border-radius: 1rem;
    }

    .radio-story-hero__brand img {
        width: 76%;
        height: 76%;
    }

    .radio-story-main__inner,
    .radio-story-community__inner {
        grid-template-columns: minmax(0, 1fr);
    }

    .radio-story-community__inner {
        justify-items: start;
    }
}

@media (max-width: 420px) {
    .radio-story-hero__inner {
        grid-template-columns: minmax(0, 1fr);
    }

    .radio-story-hero__brand {
        width: 5.5rem;
        margin-top: -0.25rem;
    }
}

/* Taustakuva seuraa WordPressin aikavyöhykettä: yö, syysusva, sumumäki, aamumetsä. */
body.radio-time-theme--night {
    --radio-time-background-image: url("../images/themes/radio-night-studio.webp");
    --radio-time-glow-left: var(--page-glow-red);
    --radio-time-glow-right: var(--page-glow-green);
    --radio-time-overlay-top: rgba(7, 9, 12, 0.56);
    --radio-time-overlay-bottom: rgba(7, 9, 12, 0.76);
}

body.radio-time-theme--misty-autumn-forest {
    --radio-time-background-image: url("../images/themes/radio-forest-autumn-pines.webp");
    --radio-time-glow-left: rgba(154, 177, 199, 0.045);
    --radio-time-glow-right: rgba(112, 145, 133, 0.035);
    --radio-time-overlay-top: rgba(7, 9, 12, 0.62);
    --radio-time-overlay-bottom: rgba(7, 9, 12, 0.82);
}

body.radio-time-theme--misty-hill {
    --radio-time-background-image: url("../images/themes/radio-forest-misty-hill.webp");
    --radio-time-glow-left: rgba(154, 177, 199, 0.045);
    --radio-time-glow-right: rgba(112, 145, 133, 0.035);
    --radio-time-overlay-top: rgba(7, 9, 12, 0.56);
    --radio-time-overlay-bottom: rgba(7, 9, 12, 0.76);
}

body.radio-time-theme--morning-forest {
    --radio-time-background-image: url("../images/themes/radio-forest-morning.webp");
    --radio-time-glow-left: rgba(198, 145, 91, 0.055);
    --radio-time-glow-right: rgba(112, 157, 130, 0.045);
    --radio-time-overlay-top: rgba(7, 9, 12, 0.50);
    --radio-time-overlay-bottom: rgba(7, 9, 12, 0.70);
}

body.radio-time-theme--night,
body.radio-time-theme--misty-autumn-forest,
body.radio-time-theme--misty-hill,
body.radio-time-theme--morning-forest {
    isolation: isolate;
    background: #080a0d;
}

body.radio-time-theme--night .radio-page,
body.radio-time-theme--misty-autumn-forest .radio-page,
body.radio-time-theme--misty-hill .radio-page,
body.radio-time-theme--morning-forest .radio-page {
    background: transparent;
}

body.radio-time-theme--night::before,
body.radio-time-theme--misty-autumn-forest::before,
body.radio-time-theme--misty-hill::before,
body.radio-time-theme--morning-forest::before,
body.radio-time-theme--night::after,
body.radio-time-theme--misty-autumn-forest::after,
body.radio-time-theme--misty-hill::after,
body.radio-time-theme--morning-forest::after {
    position: fixed;
    z-index: -1;
    inset: 0;
    display: block;
    content: "";
    pointer-events: none;
    background-color: #080a0d;
    background-repeat: no-repeat;
    transition: opacity 2.6s ease-in-out;
}

body.radio-time-theme--night::before,
body.radio-time-theme--misty-autumn-forest::before,
body.radio-time-theme--misty-hill::before,
body.radio-time-theme--morning-forest::before {
    background:
        radial-gradient(ellipse 48rem 32rem at 12% 10%, var(--radio-time-glow-left), transparent 24rem),
        radial-gradient(ellipse 52rem 36rem at 86% 18%, var(--radio-time-glow-right), transparent 24rem),
        linear-gradient(180deg, var(--radio-time-overlay-top), var(--radio-time-overlay-bottom)),
        var(--radio-time-current-image, var(--radio-time-background-image)) center center / cover fixed;
    opacity: 1;
}

body.radio-time-theme--night::after,
body.radio-time-theme--misty-autumn-forest::after,
body.radio-time-theme--misty-hill::after,
body.radio-time-theme--morning-forest::after {
    background:
        radial-gradient(ellipse 48rem 32rem at 12% 10%, var(--radio-time-glow-left), transparent 24rem),
        radial-gradient(ellipse 52rem 36rem at 86% 18%, var(--radio-time-glow-right), transparent 24rem),
        linear-gradient(180deg, var(--radio-time-overlay-top), var(--radio-time-overlay-bottom)),
        var(--radio-time-next-image, var(--radio-time-current-image, var(--radio-time-background-image))) center center / cover fixed;
    opacity: 0;
}

body[data-radio-time-fading="true"].radio-time-theme--night::before,
body[data-radio-time-fading="true"].radio-time-theme--misty-autumn-forest::before,
body[data-radio-time-fading="true"].radio-time-theme--misty-hill::before,
body[data-radio-time-fading="true"].radio-time-theme--morning-forest::before {
    opacity: 0;
}

body[data-radio-time-fading="true"].radio-time-theme--night::after,
body[data-radio-time-fading="true"].radio-time-theme--misty-autumn-forest::after,
body[data-radio-time-fading="true"].radio-time-theme--misty-hill::after,
body[data-radio-time-fading="true"].radio-time-theme--morning-forest::after {
    opacity: 1;
}

@media (max-width: 820px) {
    /* The pseudo-element is already viewport-fixed; avoid mobile fixed-background repaint/resize quirks. */
    body.radio-time-theme--night::before,
    body.radio-time-theme--misty-autumn-forest::before,
    body.radio-time-theme--misty-hill::before,
    body.radio-time-theme--morning-forest::before,
    body.radio-time-theme--night::after,
    body.radio-time-theme--misty-autumn-forest::after,
    body.radio-time-theme--misty-hill::after,
    body.radio-time-theme--morning-forest::after,
    body.radio-bg-debug-preview::before,
    body.radio-bg-debug-preview::after {
        background-attachment: scroll;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.radio-time-theme--night::before,
    body.radio-time-theme--misty-autumn-forest::before,
    body.radio-time-theme--misty-hill::before,
    body.radio-time-theme--morning-forest::before,
    body.radio-time-theme--night::after,
    body.radio-time-theme--misty-autumn-forest::after,
    body.radio-time-theme--misty-hill::after,
    body.radio-time-theme--morning-forest::after {
        transition: none;
    }
}

.radio-bg-debug {
    position: fixed;
    z-index: 100000;
    top: 5.5rem;
    right: 1rem;
    width: min(18rem, calc(100vw - 2rem));
    color: #f4f7f7;
    font: 500 0.875rem/1.4 system-ui, sans-serif;
}

.radio-bg-debug__toggle,
.radio-bg-debug__controls button {
    width: 100%;
    border: 1px solid rgba(106, 202, 186, 0.55);
    border-radius: 0.55rem;
    background: rgba(10, 17, 20, 0.96);
    color: inherit;
    padding: 0.65rem 0.8rem;
    text-align: left;
    cursor: pointer;
}

.radio-bg-debug__toggle {
    width: auto;
    margin-left: auto;
    display: block;
    font-weight: 700;
}

.radio-bg-debug__controls {
    display: grid;
    gap: 0.45rem;
    margin-top: 0.4rem;
    padding: 0.7rem;
    border: 1px solid rgba(106, 202, 186, 0.35);
    border-radius: 0.7rem;
    background: rgba(10, 17, 20, 0.96);
    box-shadow: 0 0.8rem 2rem rgba(0, 0, 0, 0.35);
}

.radio-bg-debug__controls[hidden] {
    display: none;
}

.radio-bg-debug__picker {
    display: grid;
    grid-template-columns: 2.5rem minmax(0, 1fr) 2.5rem;
    align-items: center;
    gap: 0.35rem;
}

.radio-bg-debug__picker span {
    text-align: center;
    font-size: 0.78rem;
}

.radio-bg-debug__picker button {
    width: auto;
    text-align: center;
    font-size: 1.15rem;
}

.radio-bg-debug button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.radio-bg-debug__controls p {
    margin: 0 0 0.25rem;
    color: #b8c3c4;
    font-size: 0.78rem;
}

.radio-bg-debug__controls button:hover,
.radio-bg-debug__toggle:hover {
    border-color: #6acaba;
    background: rgba(24, 48, 49, 0.98);
}

body.radio-bg-debug-preview {
    isolation: isolate;
    background: #080a0d;
    --radio-time-glow-left: rgba(154, 177, 199, 0.035);
    --radio-time-glow-right: rgba(112, 145, 133, 0.03);
    --radio-time-overlay-top: rgba(7, 9, 12, 0.56);
    --radio-time-overlay-bottom: rgba(7, 9, 12, 0.76);
}

body.radio-bg-debug-preview .radio-page {
    background: transparent;
}

body.radio-bg-debug-preview::before,
body.radio-bg-debug-preview::after {
    position: fixed;
    z-index: -1;
    inset: 0;
    display: block;
    content: "";
    pointer-events: none;
    background-color: #080a0d;
    background-repeat: no-repeat;
    transition: opacity 2.6s ease-in-out;
}

body.radio-bg-debug-preview::before {
    background:
        radial-gradient(ellipse 48rem 32rem at 12% 10%, var(--radio-time-glow-left), transparent 24rem),
        radial-gradient(ellipse 52rem 36rem at 86% 18%, var(--radio-time-glow-right), transparent 24rem),
        linear-gradient(180deg, var(--radio-time-overlay-top), var(--radio-time-overlay-bottom)),
        var(--radio-time-current-image) center center / cover fixed;
    opacity: 1;
}

body.radio-bg-debug-preview::after {
    background:
        radial-gradient(ellipse 48rem 32rem at 12% 10%, var(--radio-time-glow-left), transparent 24rem),
        radial-gradient(ellipse 52rem 36rem at 86% 18%, var(--radio-time-glow-right), transparent 24rem),
        linear-gradient(180deg, var(--radio-time-overlay-top), var(--radio-time-overlay-bottom)),
        var(--radio-time-next-image, var(--radio-time-current-image)) center center / cover fixed;
    opacity: 0;
}

body[data-radio-time-fading="true"].radio-bg-debug-preview::before { opacity: 0; }
body[data-radio-time-fading="true"].radio-bg-debug-preview::after { opacity: 1; }

/* Mainostajille-sivun pohja pysyy sinisenä kellonaikateemasta riippumatta. */
body.radio-advertisers-body::before,
body.radio-advertisers-body::after {
    background: #0d1726;
}

body.radio-advertisers-body .radio-advertisers-page {
    background:
        radial-gradient(circle at 16% 10%, rgba(120, 155, 210, 0.16), transparent 26rem),
        radial-gradient(circle at 82% 22%, rgba(95, 123, 158, 0.12), transparent 22rem),
        linear-gradient(180deg, #111e30 0%, #0d1726 52%, #101a2a 100%);
}
