/*
======================
HOME PAGE
======================

The home page is rendered by the server from the same JSON the rest of the
site uses (see the Home block in server.js): the latest session is the hero,
the sessions before it and the newest articles fill the first bands, and the
page changes every time a session or article is saved.

Every colour is a styles.css token. The section colour code from BRANDING.md
holds: crimson for the campaign, purple for the channel and articles, blue for
tools. The band itself (.band, .band-head, .band-eyebrow, .band-link, .pill)
and the closing community band live in bands.css, which the cast and tools
pages share; this sheet is only what the home page's own bands add.
*/

/*
======================
HERO: THE LATEST SESSION
======================
Dark, crimson-lit: the campaign's colour, so the handoff to the court subsite
is the same colour a reader already followed here.
*/
.hero-session {
    position: relative;
    padding: var(--spacing-lg) 0 var(--spacing-lg);
    background:
        radial-gradient(ellipse at 20% 0%, rgba(195, 10, 61, 0.35), transparent 55%),
        radial-gradient(ellipse at 90% 100%, rgba(127, 14, 189, 0.35), transparent 50%),
        linear-gradient(180deg, var(--night) 0%, var(--night-deep) 100%);
    color: var(--text-light);
    overflow: hidden;
}

.hero-session::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("../assets/images/hero-bg.png") center / cover no-repeat;
    opacity: 0.18;
    mix-blend-mode: luminosity;
    pointer-events: none;
}

.hero-session .container {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: var(--spacing-md) var(--spacing-lg);
    align-items: center;
}

.hero-strap {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1.5rem;
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.75);
    font-size: 1rem;
}

.hero-strap strong {
    color: var(--text-light);
    font-family: var(--font-headers);
    font-weight: 600;
}

.hero-strap-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.25rem;
    font-family: var(--font-headers);
    font-size: 0.85rem;
}

.hero-strap-links a {
    color: rgba(255, 255, 255, 0.85);
}

.hero-strap-links a:hover {
    color: var(--text-light);
    text-decoration: underline;
}

.hero-copy .band-eyebrow {
    color: #ff7d9e;
}

.hero-copy h1 {
    margin: 0 0 var(--spacing-xs);
    font-family: var(--font-headers);
    font-size: clamp(2rem, 4.2vw, 3.2rem);
    line-height: 1.1;
    letter-spacing: 0;
    color: var(--text-light);
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.45);
}

.hero-teaser {
    max-width: 58ch;
    margin: 0 0 var(--spacing-sm);
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.2rem;
    line-height: 1.55;
}

.hero-meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: var(--spacing-md);
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
}

.hero-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.hero-meta-row > i {
    width: 1.2rem;
    text-align: center;
    color: #ff7d9e;
}

.hero-meta .pill {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* Hero buttons: same .btn base as the site, tuned to sit on the dark ground. */
.hero-actions .btn {
    padding: 0.85rem 1.5rem;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.hero-actions .btn-crimson {
    background: var(--gradient-red, linear-gradient(135deg, var(--primary-red), var(--primary-red-dark)));
    color: var(--text-light);
    border: 2px solid rgba(255, 255, 255, 0.55);
}

.hero-actions .btn-crimson:hover,
.hero-actions .btn-crimson:focus {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(195, 10, 61, 0.4);
    color: var(--text-light);
}

.hero-actions .btn-quiet {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-light);
    border: 2px solid rgba(255, 255, 255, 0.25);
    box-shadow: none;
}

.hero-actions .btn-quiet:hover,
.hero-actions .btn-quiet:focus {
    background: rgba(255, 255, 255, 0.16);
    transform: translateY(-3px);
    color: var(--text-light);
}

/* The poster on the right: the session's image, or a card built from what
   the session does have (the act and chapter) when it has no image yet. */
.hero-poster {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.5);
    color: var(--text-light);
    text-decoration: none;
    background: var(--night);
}

.hero-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}

.hero-poster:hover img {
    transform: scale(1.03);
}

.hero-poster--card {
    background:
        radial-gradient(ellipse at 50% 120%, rgba(195, 10, 61, 0.55), transparent 60%),
        url("../assets/images/cc-bg.png") center / cover no-repeat,
        var(--night);
}

.hero-poster--card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(20, 9, 31, 0.15), rgba(20, 9, 31, 0.7));
}

.hero-poster-inner {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: var(--spacing-sm);
    text-align: center;
}

.hero-poster-inner img {
    width: 96px;
    height: 96px;
    object-fit: contain;
    filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.6));
    transition: none;
}

.hero-poster-inner .poster-act {
    font-family: var(--font-headers);
    font-size: 0.8rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
}

.hero-poster-inner .poster-chapter {
    font-family: var(--font-headers);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-light);
}

.hero-poster-inner .poster-play {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    font-family: var(--font-headers);
    font-size: 0.8rem;
    letter-spacing: 0.06em;
}

.hero-poster-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    padding: 0.6rem 1rem;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.75));
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.85);
}

/*
======================
CATCH UP: RECENT SESSIONS
======================
*/
.band--sessions {
    background: var(--divine-light-white);
}

.session-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--spacing-sm);
}

.session-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.25rem 1.35rem 1.35rem;
    background: #fff;
    border: 1px solid rgba(195, 10, 61, 0.12);
    border-top: 4px solid var(--primary-red);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.06));
    color: var(--text-dark);
    text-decoration: none;
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.session-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md, 0 8px 24px rgba(0, 0, 0, 0.12));
    color: var(--text-dark);
}

.session-card .card-kicker {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-family: var(--font-headers);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--primary-red);
}

.session-card .card-kicker span:last-child {
    color: #8a8599;
}

.session-card h3 {
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.25;
    color: var(--text-dark);
}

.session-card p {
    margin: 0;
    color: #5a5670;
    font-size: 0.98rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.session-card .card-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: auto;
    padding-top: 0.5rem;
}

.session-card .card-read {
    margin-top: 0.25rem;
    font-family: var(--font-headers);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--primary-red);
}

.session-empty {
    padding: var(--spacing-md);
    text-align: center;
    color: #5a5670;
    background: #fff;
    border: 1px dashed rgba(51, 51, 51, 0.2);
    border-radius: var(--border-radius);
}

/*
======================
DM ADVICE: NEWEST ARTICLES
======================
*/
.band--advice {
    background: #fff;
}

.advice-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: var(--spacing-sm);
}

.advice-lead {
    display: grid;
    grid-template-rows: auto 1fr;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(127, 14, 189, 0.15);
    box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.06));
    color: var(--text-dark);
    text-decoration: none;
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.advice-lead:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md, 0 8px 24px rgba(0, 0, 0, 0.12));
    color: var(--text-dark);
}

.advice-lead-image {
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, var(--primary-purple-dark), var(--primary-blue-dark));
}

.advice-lead-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.advice-lead-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.25rem 1.5rem 1.5rem;
}

.advice-lead-body h3 {
    margin: 0;
    font-size: 1.5rem;
    line-height: 1.2;
    color: var(--text-dark);
}

.advice-lead-body p {
    margin: 0;
    color: #5a5670;
    font-size: 1.02rem;
    line-height: 1.5;
}

.advice-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.advice-item {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
    padding: 0.85rem;
    border-radius: var(--border-radius);
    background: #fff;
    border: 1px solid rgba(127, 14, 189, 0.15);
    color: var(--text-dark);
    text-decoration: none;
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

.advice-item:hover {
    transform: translateY(-2px);
    border-color: var(--primary-purple-light);
    box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.08));
    color: var(--text-dark);
}

.advice-item-image {
    aspect-ratio: 4 / 3;
    border-radius: 6px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-purple-dark), var(--primary-blue-dark));
}

.advice-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.advice-item h3 {
    margin: 0 0 0.25rem;
    font-size: 1.05rem;
    line-height: 1.3;
    color: var(--text-dark);
}

.advice-cta {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.1rem 1.25rem;
    border-radius: var(--border-radius);
    background: linear-gradient(135deg, rgba(127, 14, 189, 0.08), rgba(11, 42, 169, 0.08));
    color: #5a5670;
    font-size: 0.95rem;
}

.advice-cta strong {
    font-family: var(--font-headers);
    color: var(--text-dark);
}

/*
======================
THE HEIRS
======================
*/
.band--heirs {
    background:
        radial-gradient(ellipse at 50% 0%, rgba(195, 10, 61, 0.28), transparent 60%),
        linear-gradient(180deg, var(--night), #120818);
    color: var(--text-light);
}

.band--heirs .band-eyebrow,
.band--heirs .band-link {
    color: #ff7d9e;
}

.heir-row {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: var(--spacing-xs);
}

.heir-tile {
    --heir-color: var(--primary-red);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 1.25rem 0.75rem 1.1rem;
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    text-align: center;
    text-decoration: none;
    transition: transform var(--transition-speed) ease, border-color var(--transition-speed) ease, background-color var(--transition-speed) ease;
}

.heir-tile:hover {
    transform: translateY(-4px);
    border-color: var(--heir-color);
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-light);
}

.heir-tile img {
    width: 108px;
    height: 108px;
    border-radius: 50%;
    object-fit: cover;
    object-position: top;
    border: 3px solid var(--heir-color);
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.35), 0 10px 24px rgba(0, 0, 0, 0.45);
    background: #120818;
}

.heir-tile h3 {
    margin: 0.4rem 0 0;
    font-size: 1.1rem;
    color: var(--text-light);
}

.heir-tile p {
    margin: 0;
    font-size: 0.88rem;
    font-style: italic;
    color: var(--heir-color);
}

/*
======================
TOOLS
======================
*/
.band--tools {
    background: var(--divine-light-white);
}

.tool-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--spacing-sm);
}

.tool-tile {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1.25rem;
    border-radius: var(--border-radius);
    background: #fff;
    border: 1px solid rgba(11, 42, 169, 0.14);
    color: var(--text-dark);
    text-decoration: none;
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

.tool-tile:hover {
    transform: translateY(-3px);
    border-color: var(--primary-blue-light);
    box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.08));
    color: var(--text-dark);
}

.tool-tile-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-dark));
    color: var(--text-light);
    font-size: 1.3rem;
}

.tool-tile h3 {
    margin: 0 0 0.25rem;
    font-size: 1.1rem;
    color: var(--text-dark);
}

.tool-tile p {
    margin: 0;
    color: #5a5670;
    font-size: 0.95rem;
    line-height: 1.45;
}

/*
======================
SPONSORS
======================
*/
.band--sponsors {
    padding: var(--spacing-md) 0;
    background: #fff;
    border-top: 1px solid rgba(51, 51, 51, 0.08);
}

.sponsor-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
}

.sponsor-row-label {
    font-family: var(--font-headers);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #8a8599;
}

.sponsor-logos {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-sm);
}

.sponsor-logos a {
    display: block;
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid rgba(51, 51, 51, 0.1);
    transition: transform var(--transition-speed) ease;
}

.sponsor-logos a:hover {
    transform: translateY(-2px);
}

.sponsor-logos img {
    display: block;
    height: 64px;
    width: auto;
}

.sponsor-ask {
    font-size: 0.95rem;
    color: #5a5670;
}

.sponsor-ask a {
    color: var(--primary-purple);
    font-weight: 600;
}

/*
======================
RESPONSIVE
======================
*/
@media (max-width: 992px) {
    .hero-session .container {
        grid-template-columns: 1fr;
    }

    .hero-poster {
        max-width: 640px;
    }

    .session-grid,
    .tool-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .advice-grid {
        grid-template-columns: 1fr;
    }

    .heir-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .hero-session {
        padding: var(--spacing-md) 0;
    }

    .hero-copy h1 {
        font-size: 2rem;
    }

    .hero-teaser {
        font-size: 1.05rem;
    }

    .hero-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .session-grid,
    .tool-row {
        grid-template-columns: 1fr;
    }

    .heir-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .heir-tile img {
        width: 84px;
        height: 84px;
    }

    .advice-item {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .sponsor-row {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-poster img,
    .session-card,
    .advice-lead,
    .advice-item,
    .heir-tile,
    .tool-tile {
        transition: none;
    }
}
