/*
======================
BANDS
======================

The band vocabulary the main site's newer pages are built from: the home
page, Meet the Cast, the tools page, the articles index and the reading
page, the four tool pages and the AI disclaimer. A page is a stack of bands, each
carrying the section colour code from BRANDING.md (crimson for the campaign,
purple for the channel, blue for the tools), with a band header of eyebrow,
title, one line of copy and an "all of it" link on the right.

Every colour is a styles.css token, apart from the three light tints used
for coloured text on a dark ground, which have no token: #ff7d9e (crimson),
#b98cff (purple) and #8fa0ff (blue), and the two greys for secondary copy
on a light band, #5a5670 and #8a8599. BRANDING.md lists them.

Bare <section> gets styles.css's 4rem padding and overflow:hidden, so a band
sets its own padding and overflow with .band.
*/

.band {
    position: relative;
    padding: var(--spacing-lg) 0;
    overflow: visible;
}

.band .container {
    position: relative;
    z-index: 1;
}

/* Band header: eyebrow, title, one line, and an "all of it" link on the right. */
.band-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    text-align: left;
}

.band-head h2 {
    display: block;
    margin: 0;
    font-size: clamp(1.6rem, 3vw, 2.1rem);
    line-height: 1.15;
}

.band-head p {
    margin: 0.35rem 0 0;
    max-width: 58ch;
    color: #5a5670;
    font-size: 1.05rem;
}

.band-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-family: var(--font-headers);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.band-eyebrow i {
    font-size: 0.85rem;
}

.band-link {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding-bottom: 0.35rem;
    font-family: var(--font-headers);
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
}

.band-link i {
    transition: transform var(--transition-speed) ease;
}

.band-link:hover i {
    transform: translateX(3px);
}

/* Colour codes for the eyebrow and link. */
.band--crimson .band-eyebrow,
.band--crimson .band-link { color: var(--primary-red); }
.band--purple .band-eyebrow,
.band--purple .band-link { color: var(--primary-purple); }
.band--blue .band-eyebrow,
.band--blue .band-link { color: var(--primary-blue); }

/* A band on a dark ground: the title goes white and the copy translucent,
   and the colour codes take their light tints so they still read. */
.band--dark {
    color: var(--text-light);
}

.band--dark .band-head h2 {
    color: var(--text-light);
}

.band--dark .band-head p {
    color: rgba(255, 255, 255, 0.72);
}

.band--dark.band--crimson .band-eyebrow,
.band--dark.band--crimson .band-link { color: #ff7d9e; }
.band--dark.band--purple .band-eyebrow,
.band--dark.band--purple .band-link { color: #b98cff; }
.band--dark.band--blue .band-eyebrow,
.band--dark.band--blue .band-link { color: #8fa0ff; }

/* The date and read-time line on an article card, here and on /articles. */
.article-kicker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.9rem;
    font-size: 0.85rem;
    color: #8a8599;
}

.article-kicker i {
    margin-right: 0.25rem;
    color: var(--primary-purple);
}

/* Small pills reused across the bands. */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.65rem;
    border-radius: 999px;
    background: rgba(51, 51, 51, 0.07);
    color: #5a5670;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.6;
    white-space: nowrap;
}

/* A light band: the divet white the home page's session band sits on. */
.band--light {
    background: var(--divine-light-white);
}

/* Pills on a dark band read as translucent white; a linked one lifts. */
.band--dark .pill {
    padding: 0.35rem 0.85rem;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    font-family: var(--font-headers);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
}

.band--dark.band--crimson .pill i { color: #ff7d9e; }
.band--dark.band--purple .pill i { color: #b98cff; }
.band--dark.band--blue .pill i { color: #8fa0ff; }

.pill--link {
    text-decoration: none;
    transition: background-color var(--transition-speed) ease, transform var(--transition-speed) ease, color var(--transition-speed) ease;
}

.band--dark .pill--link {
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.band--dark .pill--link:hover,
.band--dark .pill--link:focus-visible {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-2px);
    color: var(--text-light);
}

/* A location pill whose place has a pin on the realm map leads to it. On the
   hero it is an anchor; inside a session card, which is one link already, it
   is a span carrying data-realm that main.js follows, so it is given the
   pointer the anchor has. */
.pill--realm {
    cursor: pointer;
}

.session-card .pill--realm {
    text-decoration: underline;
    text-decoration-color: rgba(51, 51, 51, 0.25);
    text-underline-offset: 2px;
}

.session-card .pill--realm:hover {
    background: rgba(51, 51, 51, 0.14);
    text-decoration-color: currentColor;
}

/*
======================
HERO
======================
The page-top hero the reading page, the four tool pages and the disclaimer
share: the home hero's night ground (--night to --night-deep) under the
hero-bg texture, lit from the top left by the page's section colour and from
the bottom right by its neighbour. A page adds .band-hero--purple, --blue or
--crimson for the light, and .band--dark plus the same .band--<colour> so
the eyebrow, pills and links take the dark-ground tints above. The home,
cast, tools and articles-index heroes are older and carry their own rules
in their page sheets; they are the same ground.
*/
.band-hero {
    --hero-light: rgba(127, 14, 189, 0.5);
    --hero-light-2: rgba(11, 42, 169, 0.35);
    position: relative;
    padding: var(--spacing-lg) 0;
    background:
        radial-gradient(ellipse at 15% 0%, var(--hero-light), transparent 55%),
        radial-gradient(ellipse at 90% 100%, var(--hero-light-2), transparent 50%),
        linear-gradient(180deg, var(--night) 0%, var(--night-deep) 100%);
    color: var(--text-light);
    overflow: hidden;
}

.band-hero--purple {
    --hero-light: rgba(127, 14, 189, 0.5);
    --hero-light-2: rgba(11, 42, 169, 0.35);
}

.band-hero--blue {
    --hero-light: rgba(11, 42, 169, 0.6);
    --hero-light-2: rgba(127, 14, 189, 0.35);
}

.band-hero--crimson {
    --hero-light: rgba(195, 10, 61, 0.5);
    --hero-light-2: rgba(127, 14, 189, 0.35);
}

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

.band-hero .container {
    position: relative;
    z-index: 1;
}

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

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

/* A row of pills under the lead: the facts about the page, and the way back. */
.band-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/*
======================
COMMUNITY: SUBSCRIBE, DISCORD, NEWSLETTER
======================
The closing band on the home page and on the cast and tools pages. YouTube
red (#ff0000) and Discord blurple (#5865f2) are the only off-palette colours,
and they are those brands' own. The newsletter form posts to /api/newsletter
through main.js, which looks for #newsletter-form on any page.
*/
.band--community {
    background: linear-gradient(135deg, var(--night), #0f1a4d 55%, var(--night));
    color: var(--text-light);
}

.band--community .band-eyebrow,
.band--community .band-link {
    color: #b98cff;
}

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

.community-card {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.community-card i.card-icon {
    font-size: 1.6rem;
}

.community-card h3 {
    margin: 0;
    font-size: 1.15rem;
    color: var(--text-light);
}

.community-card p {
    margin: 0 0 0.25rem;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.95rem;
    line-height: 1.45;
}

.community-card .btn {
    margin-top: auto;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.2rem;
    font-size: 0.85rem;
    border: 2px solid rgba(255, 255, 255, 0.35);
    color: var(--text-light);
}

.community-card .btn-youtube {
    background: #ff0000;
}

.community-card .btn-discord {
    background: #5865f2;
}

.community-card .btn:hover {
    transform: translateY(-3px);
    color: var(--text-light);
}

.newsletter-form {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
}

.newsletter-form input[type="email"] {
    flex: 1;
    min-width: 0;
    height: 46px;
    padding: 0 0.9rem;
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    font-family: var(--font-body);
    font-size: 1rem;
}

.newsletter-form input[type="email"]::placeholder {
    color: rgba(255, 255, 255, 0.55);
}

.newsletter-form input[type="email"].shake {
    animation: shakeInput 0.4s;
}

@keyframes shakeInput {
    0%, 100% { transform: translateX(0); }
    25%, 75% { transform: translateX(-6px); }
    50% { transform: translateX(6px); }
}

.newsletter-form button {
    height: 46px;
    padding: 0 1.1rem;
    border-radius: var(--border-radius);
    border: 0;
    background: linear-gradient(135deg, var(--primary-purple), var(--primary-purple-dark));
    color: var(--text-light);
    font-family: var(--font-headers);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.newsletter-form button:disabled {
    opacity: 0.6;
    cursor: wait;
}

.newsletter-form .success-message {
    margin: 0;
    color: #9be7ad;
}

/* The scroll-to-top button. styles.css positions it absolutely at the bottom
   right of the section it sits in, which on a band page put it over the
   newsletter form's Subscribe button. main.js fades it in once the page has
   scrolled 300px, so it is a floating control: on band pages it sits at the
   viewport's corner, and takes no clicks while it is faded out. */
.scroll-to-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: var(--z-fixed);
}

.scroll-to-top #scroll-top-btn:not(.visible) {
    pointer-events: none;
}

/*
======================
RESPONSIVE
======================
*/
@media (max-width: 992px) {
    .community-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

    .band-hero h1 {
        font-size: 2.1rem;
    }

    .band-hero-lead {
        font-size: 1.05rem;
    }

    .band-head {
        flex-direction: column;
        align-items: flex-start;
    }

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