/* Captain's Handbook — the captaincy deck as a page you can navigate.
   Same furniture as history/honours: #f8f9fa ground, white cards, square
   corners, mono for anything that acts as a label. Red is kept for the
   things that actually cost you the match. */

body {
    margin: 0;
    background-color: #f8f9fa;
    color: #111111;
    font-family: var(--font-primary);
}

.hb-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Reading progress, hairline across the very top of the window. */
.hb-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 100%;
    transform: scaleX(0);
    transform-origin: 0 50%;
    background: #111111;
    z-index: 1002;
    pointer-events: none;
}

.hb-page {
    max-width: 68rem;
    margin: 0 auto;
    padding: 2.5rem 1.25rem 4rem;
}

/* --- header ------------------------------------------------------------- */

.hb-header {
    max-width: 44rem;
    margin: 0 auto 2.75rem;
    text-align: center;
}

.hb-kicker {
    margin: 0 0 0.9rem;
    font-family: var(--font-mono);
    font-size: 0.64rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #9aa3ad;
}

.hb-header h1 {
    margin: 0 0 0.85rem;
    font-size: clamp(2rem, 5vw, 2.75rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.hb-intro {
    margin: 0 auto;
    max-width: 34rem;
    font-size: 1rem;
    line-height: 1.6;
    color: #666666;
}

.hb-meta {
    margin: 1rem 0 0;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #9aa3ad;
}

/* --- layout ------------------------------------------------------------- */

.hb-layout {
    display: grid;
    grid-template-columns: 14rem minmax(0, 1fr);
    gap: 3.5rem;
    align-items: start;
}

/* --- desktop rail ------------------------------------------------------- */

.hb-rail {
    position: sticky;
    top: 4.5rem;
    max-height: calc(100vh - 6.5rem);
    overflow-y: auto;
    padding-bottom: 1rem;
    scrollbar-width: thin;
}

.hb-rail__group + .hb-rail__group {
    margin-top: 1.35rem;
}

.hb-rail__grouplabel {
    margin: 0 0 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #b6bcc3;
}

.hb-rail__list {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 1px solid #e6e8eb;
}

.hb-rail__link {
    display: block;
    padding: 0.3rem 0 0.3rem 0.85rem;
    margin-left: -1px;
    border-left: 2px solid transparent;
    font-size: 0.83rem;
    line-height: 1.35;
    color: #6b7280;
    text-decoration: none;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.hb-rail__link:hover {
    color: #111111;
    border-left-color: #d5d9de;
}

.hb-rail__link.is-active {
    color: #111111;
    font-weight: 600;
    border-left-color: #111111;
}

.hb-rail__link:focus-visible {
    outline: 2px solid #111111;
    outline-offset: 2px;
}

/* --- mobile contents ---------------------------------------------------- */

.hb-mobilenav {
    display: none;
    position: sticky;
    top: 48px;
    z-index: 900;
    margin: 0 0 2rem;
    background: #ffffff;
    border: 1px solid #e6e8eb;
}

.hb-mobilenav__btn {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.75rem 0.9rem;
    appearance: none;
    background: none;
    border: none;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    color: #111111;
}

.hb-mobilenav__label {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #b6bcc3;
    flex: none;
}

.hb-mobilenav__current {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hb-mobilenav__chevron {
    flex: none;
    transition: transform 0.2s ease;
}

.hb-mobilenav__btn[aria-expanded="true"] .hb-mobilenav__chevron {
    transform: rotate(180deg);
}

.hb-mobilenav__panel {
    display: none;
    max-height: 60vh;
    overflow-y: auto;
    padding: 0.25rem 0.9rem 1rem;
    border-top: 1px solid #e6e8eb;
}

.hb-mobilenav__panel.is-open {
    display: block;
}

.hb-mobilenav__panel .hb-rail__group + .hb-rail__group {
    margin-top: 1.1rem;
}

.hb-mobilenav__panel .hb-rail__grouplabel {
    margin-top: 0.9rem;
}

/* --- sections ----------------------------------------------------------- */

.hb-content {
    min-width: 0;
}

.hb-section {
    scroll-margin-top: 5rem;
    padding-bottom: 3rem;
}

.hb-section + .hb-section {
    padding-top: 0.5rem;
}

.hb-section__num {
    display: block;
    margin-bottom: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.64rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #b6bcc3;
    font-variant-numeric: tabular-nums;
}

.hb-section h2 {
    margin: 0 0 1.1rem;
    font-size: clamp(1.4rem, 3.2vw, 1.75rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.hb-section h3 {
    margin: 2rem 0 0.9rem;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.hb-section p {
    margin: 0 0 1rem;
    font-size: 0.95rem;
    line-height: 1.65;
    color: #333333;
}

.hb-section p:last-child {
    margin-bottom: 0;
}

.hb-lead {
    font-size: 1.02rem !important;
    color: #111111 !important;
}

/* Plain bullet list, tick-marked so a run of them reads as a checklist. */
.hb-list {
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
}

.hb-list li {
    position: relative;
    padding-left: 1.4rem;
    margin-bottom: 0.7rem;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #333333;
}

.hb-list li::before {
    content: '';
    position: absolute;
    left: 0.15rem;
    top: 0.62rem;
    width: 5px;
    height: 5px;
    background: #c2c8ce;
}

.hb-list--check li::before {
    content: '';
    left: 0.1rem;
    top: 0.42rem;
    width: 0.42rem;
    height: 0.72rem;
    background: none;
    border: solid #111111;
    border-width: 0 1.6px 1.6px 0;
    transform: rotate(45deg);
}

.hb-list strong {
    font-weight: 600;
    color: #111111;
}

/* --- cards -------------------------------------------------------------- */

.hb-card {
    background: #ffffff;
    border: 1px solid #e6e8eb;
    padding: 1.35rem 1.5rem;
    margin-bottom: 1.25rem;
}

.hb-card__title {
    margin: 0 0 0.9rem;
    font-family: var(--font-mono);
    font-size: 0.64rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #9aa3ad;
}

.hb-card > :last-child {
    margin-bottom: 0;
}

/* Pull-quote for the line the deck repeats on every single slide. */
.hb-note {
    margin: 0 0 1.5rem;
    padding: 1.1rem 1.35rem;
    background: #ffffff;
    border: 1px solid #e6e8eb;
    border-left: 3px solid #111111;
    font-size: 0.98rem;
    line-height: 1.55;
    font-weight: 500;
    color: #111111;
}

/* Red is reserved for rules that actually forfeit the match. */
.hb-warn {
    background: #ffffff;
    border: 1px solid #f0d3da;
    border-left: 3px solid #D11149;
    padding: 1.25rem 1.4rem;
    margin-bottom: 1.5rem;
}

.hb-warn__title {
    margin: 0 0 0.85rem;
    font-family: var(--font-mono);
    font-size: 0.64rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #D11149;
}

.hb-warn .hb-list li::before {
    background: #D11149;
}

/* --- teams grid --------------------------------------------------------- */

.hb-teams {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    list-style: none;
    padding: 0;
}

.hb-team {
    display: block;
    padding: 1rem 1.1rem;
    background: #ffffff;
    border: 1px solid #e6e8eb;
    text-decoration: none;
    color: #111111;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.hb-team:hover {
    border-color: #111111;
    transform: translateY(-1px);
}

.hb-team__name {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.hb-team__div {
    display: block;
    margin-top: 0.3rem;
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.06em;
    color: #9aa3ad;
}

/* --- people ------------------------------------------------------------- */

.hb-tier {
    background: #ffffff;
    border: 1px solid #e6e8eb;
    padding: 1.25rem 1.4rem;
    margin-bottom: 0.75rem;
}

.hb-tier__label {
    margin: 0 0 0.9rem;
    font-family: var(--font-mono);
    font-size: 0.64rem;
    font-weight: 500;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #9aa3ad;
}

.hb-people {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: 0.85rem 1.5rem;
}

.hb-person__role {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #b6bcc3;
    margin-bottom: 0.15rem;
}

.hb-person__name {
    display: block;
    font-size: 0.95rem;
    font-weight: 500;
}

.hb-tier__plain {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.55;
    color: #333333;
}

/* --- year timeline ------------------------------------------------------ */

.hb-year {
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0 0 0 0.5rem;
    border-left: 1px solid #e6e8eb;
}

.hb-year__item {
    position: relative;
    padding: 0 0 1.5rem 1.5rem;
}

.hb-year__item:last-child {
    padding-bottom: 0;
}

.hb-year__item::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 0.55rem;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #111111;
    box-shadow: 0 0 0 3px #f8f9fa;
}

.hb-year__month {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.64rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #9aa3ad;
    margin-bottom: 0.2rem;
}

.hb-year__title {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 0.3rem;
}

.hb-year__text {
    margin: 0 !important;
    font-size: 0.9rem !important;
    line-height: 1.6;
    color: #666666 !important;
}

/* --- numbered principles / priorities ----------------------------------- */

.hb-numbered {
    list-style: none;
    counter-reset: hb-n;
    margin: 0 0 1.5rem;
    padding: 0;
    display: grid;
    gap: 0.75rem;
}

.hb-numbered li {
    counter-increment: hb-n;
    position: relative;
    padding: 1.05rem 1.35rem 1.05rem 3.25rem;
    background: #ffffff;
    border: 1px solid #e6e8eb;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #333333;
}

.hb-numbered li::before {
    content: counter(hb-n, decimal-leading-zero);
    position: absolute;
    left: 1.35rem;
    top: 1.05rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    color: #c2c8ce;
    font-variant-numeric: tabular-nums;
}

/* Selection order — a ranked list, tighter than the principle cards. */
.hb-priority {
    list-style: none;
    counter-reset: hb-p;
    margin: 0 0 1.5rem;
    padding: 0;
    background: #ffffff;
    border: 1px solid #e6e8eb;
}

.hb-priority li {
    counter-increment: hb-p;
    display: flex;
    align-items: baseline;
    gap: 0.9rem;
    padding: 0.7rem 1.35rem;
    font-size: 0.95rem;
}

.hb-priority li + li {
    border-top: 1px solid #f1f3f5;
}

.hb-priority li::before {
    content: counter(hb-p);
    flex: none;
    width: 1.1rem;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 600;
    color: #c2c8ce;
    font-variant-numeric: tabular-nums;
}

.hb-priority__team {
    font-weight: 600;
}

.hb-priority__note {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.06em;
    color: #9aa3ad;
}

/* --- match-day week ----------------------------------------------------- */

.hb-week {
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0;
    background: #ffffff;
    border: 1px solid #e6e8eb;
}

.hb-week li {
    display: grid;
    grid-template-columns: 5.5rem minmax(0, 1fr);
    gap: 1.1rem;
    padding: 1.05rem 1.35rem;
    font-size: 0.94rem;
    line-height: 1.6;
    color: #333333;
}

.hb-week li + li {
    border-top: 1px solid #f1f3f5;
}

.hb-week__day {
    font-family: var(--font-mono);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #111111;
    padding-top: 0.22rem;
}

/* --- home vs away ------------------------------------------------------- */

.hb-split {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.hb-split .hb-card {
    margin-bottom: 0;
}

/* --- fees --------------------------------------------------------------- */

.hb-fees {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
    gap: 0.75rem;
    margin: 0 0 1.25rem;
    list-style: none;
    padding: 0;
}

.hb-fee {
    background: #ffffff;
    border: 1px solid #e6e8eb;
    padding: 1.1rem 1.2rem;
}

.hb-fee__amount {
    display: block;
    font-family: var(--font-mono);
    font-size: 1.6rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.hb-fee__what {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.82rem;
    line-height: 1.4;
    color: #666666;
}

/* --- links -------------------------------------------------------------- */

.hb-links {
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
}

.hb-links li + li {
    margin-top: 0.15rem;
}

.hb-links a {
    display: inline-flex;
    align-items: baseline;
    gap: 0.45rem;
    max-width: 100%;
    font-size: 0.9rem;
    color: #111111;
    text-decoration: none;
    border-bottom: 1px solid #d5d9de;
    padding-bottom: 1px;
    word-break: break-word;
}

.hb-links a:hover {
    border-bottom-color: #111111;
}

.hb-links a::before {
    content: '↗';
    flex: none;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: #9aa3ad;
}

.hb-inline-link {
    color: #111111;
    text-decoration: none;
    border-bottom: 1px solid #d5d9de;
}

.hb-inline-link:hover {
    border-bottom-color: #111111;
}

/* --- source footnote ---------------------------------------------------- */

.hb-source {
    margin-top: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e6e8eb;
    font-family: var(--font-mono);
    font-size: 0.66rem;
    letter-spacing: 0.06em;
    line-height: 1.7;
    color: #b6bcc3;
}

/* --- responsive --------------------------------------------------------- */

@media (max-width: 900px) {
    .hb-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }

    .hb-rail {
        display: none;
    }

    .hb-mobilenav {
        display: block;
    }

    .hb-section {
        scroll-margin-top: 7.25rem;
    }
}

@media (max-width: 600px) {
    .hb-page {
        padding: 1.75rem 1rem 3rem;
    }

    .hb-card,
    .hb-tier,
    .hb-warn {
        padding: 1.1rem 1.15rem;
    }

    .hb-week li {
        grid-template-columns: minmax(0, 1fr);
        gap: 0.35rem;
    }

    .hb-numbered li {
        padding: 0.95rem 1.15rem 0.95rem 1.15rem;
    }

    .hb-numbered li::before {
        position: static;
        display: block;
        margin-bottom: 0.35rem;
    }

    .hb-priority li,
    .hb-week li {
        padding-left: 1.15rem;
        padding-right: 1.15rem;
    }
}

@media (prefers-reduced-motion: reduce) {

    .hb-team,
    .hb-mobilenav__chevron {
        transition: none;
    }
}
