/*
 * The Connectome League Almanac
 * ------------------------------
 * Club portal for Fly Brain Soccer. Loads after /styles.css and
 * /editorial.css, so the site nav, type, and footer stay shared. This file
 * adds the matchday-programme layer: a floodlit night masthead taken from
 * the game, monospace programme labels, and per-club colors.
 *
 * Each page sets --club (bright kit color, dark backgrounds only),
 * --club-dark (text-safe on paper), and --club-signal (accent) on <body>.
 */

.almanac-page {
    --club: #7afff2;
    --club-dark: #173d5a;
    --club-signal: #ffd750;
    --night: #07111a;
    --night-ink: #e9f3f1;
    --night-dim: #a9bfc1;
    --almanac-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}

.almanac-page a {
    color: var(--club-dark);
}

.almanac-page .site-nav {
    background: var(--editorial-paper-bright);
    backdrop-filter: none;
}

.almanac-page a:hover {
    color: var(--editorial-ink);
}

.almanac-reading {
    max-width: 760px;
}

.almanac-reading p {
    margin: 0 0 1.15rem;
}

.almanac-jumps {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.5rem;
    padding-block: 1rem;
    border-bottom: 1px solid var(--editorial-rule);
}

.almanac-jumps a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-size: 0.94rem;
    font-weight: 700;
}

.almanac-page :is(section, h2)[id] {
    scroll-margin-top: 6rem;
}

.almanac-page a:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 4px;
}

.almanac-label {
    margin: 0 0 0.9rem;
    color: var(--club-dark);
    font-family: var(--almanac-mono);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    line-height: 1.5;
    text-transform: uppercase;
}

/* Masthead: the floodlit night band */

.almanac-masthead {
    position: relative;
    overflow: hidden;
    padding: clamp(2.25rem, 5vw, 4rem) 0 clamp(2.75rem, 6vw, 4.5rem);
    background:
        radial-gradient(60% 90% at 88% 0%, color-mix(in srgb, var(--club) 26%, transparent), transparent 70%),
        radial-gradient(45% 70% at 8% 100%, color-mix(in srgb, var(--club-signal) 14%, transparent), transparent 70%),
        var(--night);
    color: var(--night-ink);
}

.almanac-masthead::after {
    position: absolute;
    inset: auto 0 0;
    height: 8px;
    background: repeating-linear-gradient(90deg, var(--club) 0 48px, var(--night) 48px 56px, var(--club-signal) 56px 72px, var(--night) 72px 80px);
    content: "";
}

.almanac-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1.4rem;
    margin: 0 0 clamp(1.75rem, 4vw, 3rem);
    padding-bottom: 0.9rem;
    border-bottom: 1px solid rgba(233, 243, 241, 0.22);
    color: var(--night-dim);
    font-family: var(--almanac-mono);
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.almanac-strip span:first-child {
    color: var(--club);
    font-weight: 700;
}

.almanac-masthead-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(160px, 260px);
    gap: clamp(1.5rem, 5vw, 4rem);
    align-items: center;
}

.editorial-page .almanac-masthead h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(2.6rem, 6vw, 5.25rem);
}

.almanac-kicker {
    margin: 0 0 1rem;
    color: var(--club);
    font-family: var(--almanac-mono);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.editorial-page .almanac-masthead p {
    color: var(--night-ink);
}

.almanac-motto {
    margin: 1.1rem 0 0;
    font-family: var(--editorial-serif);
    font-size: clamp(1.3rem, 2.4vw, 1.8rem);
    font-style: italic;
    line-height: 1.35;
}

.editorial-page .almanac-masthead .almanac-deck {
    max-width: 640px;
    margin: 1.1rem 0 0;
    color: #c9dad9;
    font-size: 1.05rem;
}

.almanac-page .almanac-crest {
    display: block;
    width: 100%;
    max-width: 260px;
    height: auto;
    margin-inline: auto;
    filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.45));
}

.almanac-masthead-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    align-items: center;
    margin-top: 1.75rem;
}

.almanac-page .almanac-play {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    padding: 0.7rem 1.15rem;
    border: 1px solid var(--club);
    border-radius: 2px;
    background: var(--club);
    color: var(--night);
    font-size: 0.9rem;
    font-weight: 800;
    text-decoration: none;
}

.almanac-page .almanac-play:hover {
    background: #fff;
    border-color: #fff;
    color: var(--night);
}

.almanac-page .almanac-masthead .almanac-quiet {
    color: var(--night-ink);
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration-color: rgba(233, 243, 241, 0.45);
}

.almanac-page .almanac-masthead .almanac-quiet:hover {
    color: #fff;
}

/* Fiction notice, shown on every page */

.almanac-notice {
    margin: 0;
    padding: 1rem 0;
    border-bottom: 1px solid var(--editorial-rule);
    background: var(--editorial-paper-bright);
}

.almanac-notice-inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.4rem 1rem;
    align-items: baseline;
}

.almanac-notice strong {
    padding: 0.2rem 0.5rem;
    border: 1px dashed var(--club-dark);
    color: var(--club-dark);
    font-family: var(--almanac-mono);
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    white-space: nowrap;
}

.editorial-page .almanac-notice p {
    margin: 0;
    font-size: 0.94rem;
    line-height: 1.55;
}

/* Sections */

.almanac-page .editorial-section {
    padding: clamp(3.25rem, 6vw, 5.5rem) 0;
}

.editorial-page.almanac-page h2 {
    font-size: clamp(1.9rem, 3.4vw, 3rem);
}

.almanac-section-head {
    max-width: 760px;
    margin: 0 0 2rem;
}

.almanac-section-head h2 {
    margin: 0;
}

.almanac-section-head p:not(.almanac-label) {
    margin: 0.9rem 0 0;
}

.almanac-story {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
    gap: clamp(2rem, 5vw, 4.5rem);
    align-items: start;
}

.almanac-prose p {
    margin: 0 0 1.15rem;
}

.almanac-prose p:first-of-type::first-letter {
    float: left;
    margin: 0.32rem 0.55rem 0 0;
    color: var(--club-dark);
    font-family: var(--editorial-serif);
    font-size: 3.6rem;
    font-weight: 700;
    line-height: 0.8;
}

.almanac-figure {
    margin: 0 0 2.25rem;
}

.almanac-figure img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 3px;
    background: var(--night);
    box-shadow: 0 0 0 1px var(--editorial-rule), 0 22px 40px -28px rgba(7, 17, 26, 0.55);
}

.almanac-figure figcaption {
    margin-top: 0.65rem;
    color: var(--editorial-muted);
    font-size: 0.86rem;
    line-height: 1.5;
}

.almanac-figure figcaption b {
    color: var(--club-dark);
    font-family: var(--almanac-mono);
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* Fact file: the programme's info box */

.almanac-facts {
    margin: 0;
    padding: 1.4rem 1.4rem 0.6rem;
    border-top: 6px solid var(--club-dark);
    background: var(--editorial-paper-bright);
    box-shadow: 0 0 0 1px var(--editorial-rule);
}

.almanac-facts h3 {
    margin: 0 0 1rem;
    font-size: 1.35rem;
}

.almanac-facts dl {
    margin: 0;
}

.almanac-facts div {
    padding: 0.65rem 0;
    border-top: 1px solid var(--editorial-rule);
}

.almanac-facts dt {
    color: var(--editorial-muted);
    font-family: var(--almanac-mono);
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.almanac-facts dd {
    margin: 0.15rem 0 0;
    color: var(--editorial-ink);
    font-size: 0.98rem;
    line-height: 1.5;
}

.almanac-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.4rem;
    padding: 0;
    list-style: none;
}

.almanac-swatches li {
    display: inline-flex;
    gap: 0.4rem;
    align-items: center;
    color: var(--editorial-ink-soft);
    font-family: var(--almanac-mono);
    font-size: 0.72rem;
}

.almanac-swatches li::before {
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 50%;
    background: var(--swatch);
    box-shadow: inset 0 0 0 1px rgba(23, 33, 43, 0.25);
    content: "";
}

/* Team sheet */

.almanac-squad {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.almanac-squad li {
    position: relative;
    min-width: 0;
    padding: 1.3rem 1.3rem 1.4rem;
    border: 1px solid var(--editorial-rule);
    border-top: 4px solid var(--club-dark);
    background: var(--editorial-paper);
}

.almanac-num {
    display: block;
    color: var(--club-dark);
    font-family: var(--editorial-serif);
    font-size: 3.4rem;
    font-weight: 700;
    line-height: 1;
}

.almanac-squad h3 {
    margin: 0.5rem 0 0.2rem;
    font-size: 1.5rem;
}

.almanac-pos {
    margin: 0 0 0.8rem;
    color: var(--editorial-muted);
    font-family: var(--almanac-mono);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.almanac-squad p:not(.almanac-pos) {
    margin: 0;
    font-size: 0.96rem;
    line-height: 1.55;
}

.almanac-aside {
    max-width: 760px;
    margin: 1.5rem 0 0;
    color: var(--editorial-muted);
    font-size: 0.92rem;
}

/* Fixtures and rivalries */

.almanac-fixtures {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.almanac-fixtures li {
    min-width: 0;
    padding: 1.2rem 1.25rem 1.3rem;
    border: 1px solid var(--editorial-rule);
    background: var(--editorial-paper-bright);
}

.almanac-fixtures h3 {
    margin: 0 0 0.4rem;
    font-size: 1.3rem;
}

.almanac-pair {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    margin: 0 0 0.7rem;
    font-family: var(--almanac-mono);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.almanac-chip {
    padding: 0.15rem 0.45rem;
    border-radius: 2px;
    background: var(--chip);
    color: #fff;
    text-decoration: none;
}

.almanac-page a.almanac-chip {
    color: #fff;
    text-decoration: none;
}

.almanac-page a.almanac-chip:hover {
    color: #fff;
    text-decoration: underline;
}

.almanac-fixtures p:not(.almanac-pair) {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.55;
}

/* Timeline */

.almanac-timeline {
    position: relative;
    max-width: 860px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.almanac-timeline::before {
    position: absolute;
    top: 0.4rem;
    bottom: 0.4rem;
    left: 5.6rem;
    width: 2px;
    background: linear-gradient(var(--editorial-rule-strong), var(--editorial-rule));
    content: "";
}

.almanac-timeline li {
    position: relative;
    display: grid;
    grid-template-columns: 5.6rem minmax(0, 1fr);
    gap: 1.6rem;
    padding: 0 0 1.6rem;
}

.almanac-timeline li::before {
    position: absolute;
    top: 0.45rem;
    left: calc(5.6rem - 6px);
    width: 14px;
    height: 14px;
    border: 3px solid var(--editorial-paper-bright);
    border-radius: 50%;
    background: var(--dot, var(--editorial-ink-soft));
    content: "";
}

.almanac-year {
    color: var(--editorial-ink);
    font-family: var(--almanac-mono);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding-top: 0.15rem;
}

.almanac-timeline h3 {
    margin: 0 0 0.3rem;
    font-size: 1.25rem;
}

.almanac-timeline p {
    margin: 0;
    font-size: 0.97rem;
    line-height: 1.6;
}

.almanac-timeline li.almanac-now::before {
    background: var(--editorial-paper-bright);
    box-shadow: 0 0 0 2px var(--editorial-ink);
}

/* Club cards on the hub */

.almanac-clubs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.almanac-club {
    position: relative;
    display: flex;
    min-width: 0;
    flex-direction: column;
    padding: 1.4rem 1.25rem 1.5rem;
    border: 1px solid var(--editorial-rule);
    border-top: 6px solid var(--card-dark);
    background: var(--editorial-paper-bright);
}

.almanac-club img {
    display: block;
    width: 132px;
    height: 132px;
    margin: 0 auto 1rem;
}

.almanac-club .almanac-label {
    color: var(--card-dark);
    margin-bottom: 0.4rem;
}

.almanac-club h3 {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
}

.almanac-club h3 a {
    color: var(--editorial-ink);
    text-decoration: none;
}

.almanac-club h3 a::after {
    position: absolute;
    inset: 0;
    content: "";
}

.almanac-club h3 a:focus-visible {
    outline: none;
}

.almanac-club:focus-within {
    outline: 3px solid var(--card-dark);
    outline-offset: 2px;
}

.almanac-club:hover {
    border-color: var(--card-dark);
}

.almanac-club p {
    margin: 0 0 0.6rem;
    font-size: 0.95rem;
    line-height: 1.55;
}

.almanac-club .almanac-club-motto {
    color: var(--editorial-ink);
    font-family: var(--editorial-serif);
    font-style: italic;
}

.almanac-club .almanac-club-more {
    margin-top: auto;
    padding-top: 0.4rem;
    color: var(--card-dark);
    font-size: 0.9rem;
    font-weight: 700;
}

/* Honours board */

.almanac-honours {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--editorial-rule-strong);
}

.almanac-honours li {
    padding: 1.1rem 1rem 1.2rem 0;
    border-bottom: 1px solid var(--editorial-rule);
}

.almanac-honours b {
    display: block;
    color: var(--card-dark, var(--editorial-ink));
    font-family: var(--editorial-serif);
    font-size: 2.6rem;
    line-height: 1;
}

.almanac-honours span {
    display: block;
    margin-top: 0.3rem;
    color: var(--editorial-ink-soft);
    font-size: 0.92rem;
}

/* Real-versus-fiction box */

.almanac-real {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.almanac-real > div {
    padding: 1.3rem 1.35rem;
    border: 1px solid var(--editorial-rule);
    background: var(--editorial-paper);
}

.almanac-real h3 {
    margin: 0 0 0.6rem;
    font-size: 1.3rem;
}

.almanac-real ul {
    margin: 0;
    padding-left: 1.1rem;
}

.almanac-real li {
    margin: 0 0 0.45rem;
    font-size: 0.95rem;
    line-height: 1.55;
}

/* Matchday band and club switcher */

.almanac-matchday {
    padding: clamp(2.75rem, 6vw, 4.5rem) 0;
    background:
        radial-gradient(50% 120% at 50% 0%, color-mix(in srgb, var(--club) 20%, transparent), transparent 70%),
        var(--night);
    color: var(--night-ink);
}

.almanac-matchday-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem 3rem;
    align-items: center;
    justify-content: space-between;
}

.editorial-page .almanac-matchday h2 {
    margin: 0;
    color: #fff;
    font-size: clamp(1.8rem, 3.2vw, 2.6rem);
}

.editorial-page .almanac-matchday p {
    max-width: 560px;
    margin: 0.6rem 0 0;
    color: #c9dad9;
}

.almanac-switcher {
    padding: 1.6rem 0;
    border-top: 1px solid var(--editorial-rule);
    background: var(--editorial-paper-bright);
}

.almanac-switcher ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 1.6rem;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
}

.almanac-switcher li:first-child {
    color: var(--editorial-muted);
    font-family: var(--almanac-mono);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.almanac-switcher a {
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;
    min-height: 44px;
    font-size: 0.94rem;
    font-weight: 700;
}

.almanac-switcher img {
    width: 36px;
    height: 36px;
}

.almanac-switcher [aria-current="page"] {
    color: var(--editorial-ink);
    text-decoration: none;
}

@media (max-width: 960px) {
    .almanac-clubs,
    .almanac-honours {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .almanac-story {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .almanac-masthead-layout {
        grid-template-columns: 1fr;
    }

    .almanac-masthead-layout > :last-child {
        order: -1;
    }

    .almanac-page .almanac-crest {
        max-width: 150px;
        margin: 0;
    }

    .almanac-squad,
    .almanac-real {
        grid-template-columns: 1fr;
    }

    .almanac-notice-inner {
        grid-template-columns: 1fr;
    }

    .almanac-notice strong {
        width: fit-content;
    }

    .almanac-timeline::before {
        left: 0.4rem;
    }

    .almanac-timeline li {
        grid-template-columns: 1fr;
        gap: 0.2rem;
        padding-left: 1.9rem;
    }

    .almanac-timeline li::before {
        left: calc(0.4rem - 6px);
    }
}

@media (max-width: 480px) {
    .almanac-clubs,
    .almanac-honours {
        grid-template-columns: 1fr;
    }

    .almanac-club img {
        width: 112px;
        height: 112px;
    }
}

/* Late additions: hub crest grid, lead figure, screen-reader text */

.almanac-figure-lead {
    margin-top: 2rem;
}

.almanac-crest-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    max-width: 280px;
    margin: 0 0 0 auto;
    padding: 0;
    list-style: none;
}

.almanac-crest-grid a {
    display: block;
    border-radius: 50%;
}

.almanac-crest-grid img {
    display: block;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.45));
    transition: transform 160ms ease;
}

.almanac-crest-grid a:hover img,
.almanac-crest-grid a:focus-visible img {
    transform: translateY(-3px) scale(1.04);
}

.almanac-crest-grid a:focus-visible {
    outline: 3px solid var(--club);
    outline-offset: 2px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

@media (max-width: 720px) {
    .almanac-crest-grid {
        grid-template-columns: repeat(4, minmax(0, 72px));
        max-width: none;
        margin: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .almanac-crest-grid img {
        transition: none;
    }
}
