/* ============================================================
   We It Is — Global Site Styles
   ------------------------------------------------------------
   Shared styling for the Raccoon & Centipede story website.
   ============================================================ */


/* ==============================
   Base
   ============================== */
:root {
    --color-page-bg: #eef6f4;
    --color-card-bg: #fcfffe;
    --color-card-border: #e8d8c8;
    --color-text-main: #2f2925;
    --color-text-soft: #4f6b65;
    --color-accent: #61BDAB;
    --color-accent-hover: #4da392;
    --color-secondary: #7aa79d;
    --shadow-soft: 0 18px 45px rgba(65, 45, 35, 0.08);
    --radius-large: 28px;
    --radius-medium: 20px;
}

body.dark-theme,
html.dark-theme-loading body {
    --color-page-bg: #101c1c;
    --color-card-bg: #172827;
    --color-card-border: #2a4542;
    --color-text-main: #f4fbf9;
    --color-text-soft: #bfd8d3;
    --color-accent: #61BDAB;
    --color-accent-hover: #7ed6c8;
    --color-secondary: #8ed1c4;
    --shadow-soft: 0 18px 45px rgba(0, 0, 0, 0.28);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    font-size: 16px;
}

body {
    margin: 0;
    min-height: 100%;
    font-family: Georgia, "Times New Roman", serif;
    background: radial-gradient(circle at top left, rgba(255, 249, 241, 0.95), transparent 36rem), var(--color-page-bg);
    color: var(--color-text-main);
}


/* ==============================
   Layout
   ============================== */
.site-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 2rem;
    background: rgba(255, 249, 241, 0.92);
    border-bottom: 1px solid var(--color-card-border);
}

.site-logo {
    color: var(--color-text-main);
    font-size: 1.35rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.02em;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

    .site-nav a {
        color: var(--color-text-soft);
        font-size: 0.98rem;
        font-weight: 700;
        text-decoration: none;
    }

        .site-nav a:hover {
            color: var(--color-accent);
        }

.site-main {
    width: min(1360px, calc(100% - 2rem));
    margin: 0 auto;
    padding: 3.5rem 0;
}

.site-footer {
    margin-top: 3rem;
    padding: 2rem 1rem;
    text-align: center;
    background: #4f9d8e;
    color: var(--color-card-bg);
}


/* ==============================
   Shared Page Elements
   ============================== */
.eyebrow,
.story-number {
    margin: 0 0 0.75rem;
    color: var(--color-secondary);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.page-header {
    max-width: 780px;
    margin: 0 auto 3rem;
    text-align: center;
}

    .page-header h1 {
        margin: 0 0 1rem;
        font-size: clamp(2.5rem, 6vw, 4.5rem);
        line-height: 1;
    }

    .page-header p {
        margin: 0;
        color: var(--color-text-soft);
        font-size: 1.12rem;
        line-height: 1.7;
    }

.content-card {
    background: var(--color-card-bg);
    border: 1px solid var(--color-card-border);
    border-radius: var(--radius-large);
    box-shadow: var(--shadow-soft);
}


/* ==============================
   Buttons
   ============================== */
.button-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.85rem;
}

.btn-primary,
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0.8rem 1.35rem;
    border-radius: 999px;
    font-weight: 700;
    text-decoration: none;
}

.btn-primary {
    background: var(--color-accent);
    color: var(--color-card-bg);
}

    .btn-primary:hover {
        background: var(--color-accent-hover);
    }

.btn-secondary {
    background: var(--color-card-bg);
    border: 1px solid var(--color-card-border);
    color: var(--color-accent);
}

    .btn-secondary:hover {
        border-color: var(--color-accent);
    }


/* ==============================
   Homepage
   ============================== */
.home-hero {
    max-width: 900px;
    margin: 2rem auto 4rem;
    text-align: center;
}

    .home-hero h1 {
        margin: 0;
        font-size: clamp(4rem, 12vw, 8rem);
        line-height: 0.9;
        letter-spacing: -0.04em;
    }

    .home-hero h2 {
        margin: 1rem 0 0;
        color: var(--color-text-soft);
        font-size: clamp(1.25rem, 3vw, 2rem);
        font-weight: 400;
    }

.home-intro-card {
    max-width: 760px;
    margin: 2.5rem auto;
    padding: 2rem;
}

    .home-intro-card p {
        margin: 0;
        color: var(--color-text-main);
        font-size: 1.18rem;
        line-height: 1.8;
    }

.featured-section {
    margin-top: 4rem;
}

.section-heading {
    margin-bottom: 1.25rem;
    text-align: center;
}

    .section-heading h2 {
        margin: 0;
        font-size: 2rem;
    }


/* ==============================
   Story Cards
   ============================== */
.story-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
}

@media (max-width: 1000px) {
    .story-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .story-grid {
        grid-template-columns: 1fr;
    }
}

.story-card {
    padding: 1.5rem;
}

    .story-card h2 {
        margin: 0 0 0.75rem;
        font-size: 1.8rem;
    }

    .story-card p {
        color: var(--color-text-soft);
        line-height: 1.7;
    }

    .story-card a {
        color: var(--color-accent);
        font-weight: 700;
        text-decoration: none;
    }


/* ==============================
   Story Detail Page
   ============================== */
.story-page {
    max-width: 1200px;
    margin: 0 auto;
}

.story-header {
    margin-bottom: 2.5rem;
    text-align: center;
}

    .story-header h1 {
        margin: 0 0 1rem;
        font-size: clamp(2.75rem, 7vw, 5rem);
        line-height: 1;
    }

    .story-header p {
        margin: 0;
        color: var(--color-text-soft);
        font-size: 1.1rem;
    }

.story-content {
    padding: 2rem;
    font-size: 1.15rem;
    line-height: 1.95;
}

    .story-content p {
        margin: 0 0 1.5rem;
    }

        .story-content p:last-child {
            margin-bottom: 0;
        }

.story-footer {
    margin-top: 2.5rem;
    text-align: center;
}


/* ==============================
   Illustrated Story Layout
   ============================== */
.story-reading-layout {
    display: grid;
    grid-template-columns: minmax(420px, 0.95fr) minmax(520px, 1.05fr);
    gap: 2rem;
    align-items: start;
}

.story-image-panel {
    position: sticky;
    top: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    overflow: hidden;
}

    .story-image-panel img {
        width: 100%;
        height: auto;
        max-height: 82vh;
        object-fit: contain;
        display: block;
        border-radius: var(--radius-medium);
    }

.story-scroll-panel {
    max-height: 82vh;
    overflow-y: auto;
}

    .story-scroll-panel::-webkit-scrollbar {
        width: 10px;
    }

    .story-scroll-panel::-webkit-scrollbar-track {
        background: #edf7f4;
        border-radius: 999px;
    }

    .story-scroll-panel::-webkit-scrollbar-thumb {
        background: var(--color-accent);
        border-radius: 999px;
    }

@media (max-width: 850px) {
    .story-reading-layout {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
    }

    .story-image-panel {
        position: relative;
        top: auto;
        padding: 1rem;
        max-height: none;
    }

        .story-image-panel img {
            width: 100%;
            height: auto;
            max-height: none;
            object-fit: contain;
        }

    .story-scroll-panel {
        max-height: none;
        overflow-y: visible;
    }
}

.story-section-title {
    margin: 0 0 1rem;
    color: var(--color-accent);
    font-size: 1.45rem;
}

.story-divider {
    margin: 2rem 0;
    border: 0;
    border-top: 1px solid var(--color-card-border);
}


/* ==============================
   Gallery
   ============================== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.gallery-card {
    overflow: hidden;
}

    .gallery-card img {
        width: 100%;
        aspect-ratio: 1 / 1;
        object-fit: cover;
        display: block;
    }

    .gallery-card h2 {
        margin: 0;
        padding: 1.1rem 1.25rem 1.25rem;
        color: var(--color-text-main);
        font-size: 1.25rem;
    }


/* ==============================
   Simple Info Pages
   ============================== */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
}

.info-card {
    padding: 1.5rem;
}

    .info-card h2 {
        margin-top: 0;
    }

    .info-card p {
        color: var(--color-text-soft);
        line-height: 1.7;
    }


/* ==============================
   Mobile Responsive
   ============================== */
@media (max-width: 850px) {

    /* ============================================================
       Mobile Header Layout
       ============================================================ */

    .site-header {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 0.65rem;
        padding: 1rem 1rem 0.85rem;
    }

    .site-brand-block {
        display: contents;
    }

    .site-logo {
        grid-column: 1;
        grid-row: 1;
        justify-self: start;
        white-space: nowrap;
        font-size: 1.35rem;
    }

    .site-actions {
        display: contents;
    }

    .theme-toggle {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
        align-self: center;
        padding: 0.55rem 0.9rem;
        font-size: 0.9rem;
    }

    .next-adventure-countdown {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-self: start;
        max-width: 100%;
        padding: 0.45rem 0.85rem;
        font-size: 0.72rem;
    }

    .countdown-timer {
        font-size: 0.8rem;
    }

    /* ============================================================
       Mobile Navigation
       ============================================================ */

    .site-nav {
        grid-column: 1 / -1;
        grid-row: 3;
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.55rem;
        width: 100%;
    }

        .site-nav a {
            padding: 0.55rem 0.7rem;
            font-size: 0.95rem;
            border: 1px solid var(--color-card-border);
            border-radius: 18px;
            background: var(--color-card-bg);
            text-align: center;
        }

    /* ============================================================
       Mobile Hero Sections
       ============================================================ */

    .page-hero {
        padding-top: 4rem;
        padding-bottom: 3rem;
    }

        .page-hero h1 {
            font-size: 4rem;
        }

        .page-hero p {
            font-size: 1.15rem;
            line-height: 1.7;
        }

    /* ============================================================
       Mobile Story Cards
       ============================================================ */

    .story-card {
        padding: 1.8rem;
    }

        .story-card h2 {
            font-size: 2.2rem;
        }

        .story-card p {
            line-height: 1.9;
        }
}


/* ==============================
   Header Countdown
   ============================== */
.site-brand-block {
    display: contents;
}

.site-logo {
    justify-self: start;
}

.next-adventure-countdown {
    justify-self: center;
}

.site-actions {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.next-adventure-countdown {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--color-card-border);
    border-radius: 999px;
    background: var(--color-card-bg);
    color: var(--color-text-soft);
    font-size: 0.82rem;
    font-weight: 700;
}

.countdown-label {
    color: var(--color-text-soft);
}

.countdown-timer {
    color: var(--color-accent);
    white-space: nowrap;
}


/* ==============================
   UI Polish / Motion
   ============================== */

.site-main {
    animation: pageFadeIn 0.45s ease both;
}

@keyframes pageFadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-card,
.btn-primary,
.btn-secondary,
.theme-toggle,
.site-nav a {
    transition:
        transform 0.22s ease,
        box-shadow 0.22s ease,
        border-color 0.22s ease,
        background-color 0.22s ease,
        color 0.22s ease;
}

.story-card:hover,
.gallery-card:hover,
.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 22px 55px rgba(65, 45, 35, 0.13);
}

.btn-primary:hover,
.btn-secondary:hover,
.theme-toggle:hover,
.site-nav a:hover {
    transform: translateY(-2px);
}

.btn-primary:hover {
    box-shadow: 0 10px 26px rgba(97, 189, 171, 0.34);
}

.btn-secondary:hover,
.theme-toggle:hover,
.site-nav a:hover {
    box-shadow: 0 10px 24px rgba(97, 189, 171, 0.18);
}

.gallery-card img {
    transition: transform 0.35s ease;
}

.gallery-card:hover img {
    transform: scale(1.025);
}

.story-card a {
    transition: color 0.22s ease;
}

.story-card a:hover {
    color: var(--color-accent-hover);
}

@media (prefers-reduced-motion: reduce) {
    .site-main {
        animation: none;
    }

    .content-card,
    .btn-primary,
    .btn-secondary,
    .theme-toggle,
    .site-nav a,
    .gallery-card img {
        transition: none;
    }

    .story-card:hover,
    .gallery-card:hover,
    .info-card:hover,
    .btn-primary:hover,
    .btn-secondary:hover,
    .theme-toggle:hover,
    .site-nav a:hover,
    .gallery-card:hover img {
        transform: none;
    }
}


/* ==============================
   Theme Toggle
   ============================== */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 36px;
    padding: 0.35rem 0.8rem;
    border: 1px solid var(--color-card-border);
    border-radius: 999px;
    background: var(--color-card-bg);
    color: var(--color-text-soft);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

    .theme-toggle:hover {
        transform: translateY(-1px);
        border-color: var(--color-accent);
        color: var(--color-accent);
    }

.theme-toggle__icon {
    font-size: 0.95rem;
}

body.dark-theme,
html.dark-theme-loading body {
    background: radial-gradient(circle at top left, rgba(97, 189, 171, 0.12), transparent 34rem), var(--color-page-bg);
}

    body.dark-theme .site-header,
    html.dark-theme-loading body .site-header {
        background: rgba(23, 40, 39, 0.94);
    }

    body.dark-theme .site-footer,
    html.dark-theme-loading body .site-footer {
        background: #0b1414;
    }

    body.dark-theme .btn-secondary,
    html.dark-theme-loading body .btn-secondary {
        background: #122120;
    }

    body.dark-theme .story-scroll-panel::-webkit-scrollbar-track,
    html.dark-theme-loading body .story-scroll-panel::-webkit-scrollbar-track {
        background: #10201f;
    }
    
    body.dark-theme .story-card:hover,
    body.dark-theme .gallery-card:hover,
    body.dark-theme .info-card:hover,
    html.dark-theme-loading body .story-card:hover,
    html.dark-theme-loading body .gallery-card:hover,
    html.dark-theme-loading body .info-card:hover {
        box-shadow: 0 22px 55px rgba(0, 0, 0, 0.36);
    }
    
    
/* ==============================
Soundtrack Section
============================== */
.soundtrack-section {
    margin-top: 5rem;
}

.soundtrack-card {
    max-width: 900px;
    margin: 0 auto;
    padding: 1.5rem;
}

.soundtrack-actions {
    margin-top: 1rem;
    text-align: center;
}

.soundtrack-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 180px;

    border: 2px dashed var(--color-card-border);
    border-radius: var(--radius-medium);

    color: var(--color-text-soft);
    text-align: center;
}

.soundtrack-card iframe {
    width: 100%;
    border: 0;
    border-radius: var(--radius-medium);
}


/* ============================================================
   Hide & Seek (Future Feature)
   ============================================================ */

.hide-and-seek-section {
    margin-top: 5rem;
}

.hide-and-seek-card {
    max-width: 900px;
    margin: 0 auto;
    padding: 2.5rem;
    text-align: center;
}

    .hide-and-seek-card p {
        max-width: 650px;
        margin: 0 auto 2rem;
        color: var(--color-text-soft);
        font-size: 1.1rem;
        line-height: 1.8;
    }
