/**
 * Competition History — visual layout aligned to the FA Cup mockup.
 * Tokens from variables.css. Accent colours are used sparingly.
 */

body.btfc-competition-history .btfc-hero-section,
body.btfc-competition-history .btfc-hero-section.btfc-hero-title-only {
    display: none !important;
}

.btfc-ch {
    --btfc-ch-accent: #2563eb;
    --btfc-ch-navy: #071b36;
    --btfc-ch-ink: #071b36;
    color: var(--btfc-ch-ink);
    font-family: var(--font-primary);
    background: #ffffff;
}

.btfc-ch[data-accent="blue"] {
    --btfc-ch-accent: #2563eb;
}

.btfc-ch[data-accent="green"] {
    --btfc-ch-accent: #1b5e3b;
}

.btfc-ch[data-accent="purple"] {
    --btfc-ch-accent: #5b3a8c;
}

.btfc-ch-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.btfc-ch-wrap {
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: 24px;
}

.btfc-ch-heading {
    margin: 0 0 0.85rem;
    font-family: var(--font-heading, inherit);
    font-size: 1.35rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    line-height: 1;
    text-transform: uppercase;
    color: var(--btfc-ch-navy);
}

.btfc-ch-heading--panel {
    margin-bottom: 0.45rem;
}

.btfc-ch-panel-lede {
    margin: 0 0 0.9rem;
    color: #6b7280;
    font-size: 0.8rem;
    line-height: 1.35;
}

.btfc-ch-heading--panel::after,
.btfc-ch-heading::after {
    content: none;
}

.btfc-ch-panel {
    background: #ffffff;
    border: 1px solid #e8edf3;
}

.btfc-ch-text-link {
    color: var(--btfc-ch-accent);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-decoration: none;
}

.btfc-ch-text-link:hover {
    color: var(--btfc-ch-navy);
}

.btfc-ch-muted {
    margin: 0;
    color: #6b7280;
    font-size: 0.92rem;
}

.btfc-ch-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.75rem 1.2rem;
    border-radius: 2px;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    line-height: 1.2;
    border: 1px solid transparent;
}

.btfc-ch-btn-icon {
    display: inline-flex;
    width: 1rem;
    height: 1rem;
}

.btfc-ch-btn-icon svg {
    width: 1rem;
    height: 1rem;
}

.btfc-ch-btn-accent {
    background: var(--btfc-ch-accent);
    border-color: var(--btfc-ch-accent);
    color: #ffffff;
}

.btfc-ch-btn-accent:hover {
    filter: brightness(0.92);
    color: #ffffff;
}

.btfc-ch-btn-ghost {
    background: transparent;
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.75);
}

.btfc-ch-btn-ghost:hover {
    border-color: #ffffff;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.btfc-ch-btn-outline {
    background: transparent;
    color: var(--btfc-ch-navy);
    border-color: #d5dce6;
}

.btfc-ch-btn-outline:hover {
    border-color: var(--btfc-ch-accent);
    color: var(--btfc-ch-accent);
}

.btfc-ch-btn-block {
    width: 100%;
}

/* Hero — 340px editorial banner */

.btfc-ch-hero {
    position: relative;
    height: 340px;
    background: #04101f;
    overflow: hidden;
}

.btfc-ch-hero-art {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 78% center;
}

.btfc-ch-hero.has-photo {
    background-image: none;
}

.btfc-ch-hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            90deg,
            rgba(4, 16, 31, 0.94) 0%,
            color-mix(in srgb, var(--btfc-ch-accent) 28%, rgba(4, 16, 31, 0.72)) 36%,
            rgba(4, 16, 31, 0.18) 100%
        );
    pointer-events: none;
}

.btfc-ch-hero-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-sizing: border-box;
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 24px 24px;
}

.btfc-ch-hero-crumb {
    padding-top: 0;
    margin-bottom: 0.7rem;
    color: rgba(255, 255, 255, 0.7);
}

.btfc-ch-hero-crumb a,
.btfc-ch-hero-crumb .btfc-breadcrumb-sep {
    color: rgba(255, 255, 255, 0.7);
}

.btfc-ch-hero-crumb a:hover,
.btfc-ch-hero-crumb .btfc-breadcrumb-current {
    color: #ffffff;
}

.btfc-ch-hero-copy {
    max-width: 34rem;
}

.btfc-ch-hero-title {
    margin: 0 0 0.3rem;
    color: #ffffff;
    font-family: var(--font-heading, 'Bebas Neue', sans-serif);
    font-size: clamp(2.4rem, 5vw, 3.9rem);
    font-weight: 400;
    letter-spacing: 0.04em;
    line-height: 0.88;
    text-transform: uppercase;
}

.btfc-ch-hero-kicker {
    margin: 0 0 0.5rem;
    color: var(--btfc-ch-accent);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.btfc-ch-hero-lede {
    margin: 0 0 0.85rem;
    max-width: 32rem;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.9rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

.btfc-ch-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.btfc-ch-hero-actions .btfc-ch-btn {
    padding: 0.58rem 0.85rem;
    font-size: 0.7rem;
    white-space: nowrap;
}

/* Upper region: 60/20/20-ish, top-aligned, natural heights */

.btfc-ch-upper {
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) minmax(220px, 1fr) minmax(220px, 1fr);
    gap: 20px;
    align-items: start;
    padding-top: 2rem;
    padding-bottom: 0.35rem;
}

.btfc-ch-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.btfc-ch-glance,
.btfc-ch-featured-col,
.btfc-ch-notable-col,
.btfc-ch-scorers-col {
    min-width: 0;
}

.btfc-ch-band {
    background: #f5f7fa;
    padding: 2.25rem 0 2.5rem;
}

.btfc-ch-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.btfc-ch-stat {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
    padding: 0.7rem 0.65rem 0.75rem;
    background: #ffffff;
    border: 1px solid #e8edf3;
}

.btfc-ch-stat-icon {
    display: inline-flex;
    flex-shrink: 0;
    width: 1.85rem;
    height: 1.85rem;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: color-mix(in srgb, var(--btfc-ch-accent) 12%, #ffffff);
    color: var(--btfc-ch-accent);
}

.btfc-ch-stat-icon svg {
    width: 0.95rem;
    height: 0.95rem;
}

.btfc-ch-stat-copy {
    min-width: 0;
    width: 100%;
}

.btfc-ch-stat-label {
    margin: 0;
    color: #6b7280;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.btfc-ch-stat-value {
    margin: 0.15rem 0 0;
    font-family: var(--font-heading);
    font-size: 1.05rem;
    letter-spacing: 0.03em;
    line-height: 1.1;
    text-transform: uppercase;
    color: var(--btfc-ch-navy);
}

.btfc-ch-stat-detail {
    margin: 0.2rem 0 0;
    color: #6b7280;
    font-size: 0.68rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Featured */

.btfc-ch-featured {
    position: relative;
    min-height: 300px;
    height: auto;
    overflow: hidden;
    background: #04101f;
    color: #ffffff;
}

.btfc-ch-featured.has-photo {
    background-image: var(--btfc-ch-featured-image);
    background-size: cover;
    background-position: center;
}

.btfc-ch-featured-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            105deg,
            color-mix(in srgb, var(--btfc-ch-accent) 55%, #04101f) 0%,
            rgba(4, 16, 31, 0.78) 46%,
            rgba(4, 16, 31, 0.22) 100%
        );
}

.btfc-ch-crowd {
    position: absolute;
    top: 1.1rem;
    right: 1.1rem;
    z-index: 2;
    width: 6.5rem;
    height: 6.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(4, 16, 31, 0.82);
    border: 2px solid var(--btfc-ch-accent);
    text-align: center;
    padding: 0.4rem;
}

.btfc-ch-crowd span {
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
}

.btfc-ch-crowd strong {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    letter-spacing: 0.03em;
    color: #ffffff;
}

.btfc-ch-featured-copy {
    position: relative;
    z-index: 1;
    padding: 1.6rem 1.5rem 1.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    min-height: 300px;
    justify-content: flex-end;
    max-width: 34rem;
}

.btfc-ch-season-badge {
    align-self: flex-start;
    padding: 0.22rem 0.6rem;
    background: var(--btfc-ch-accent);
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.btfc-ch-featured-copy h2 {
    margin: 0;
    color: #ffffff;
    font-size: clamp(1.9rem, 3.2vw, 2.7rem);
    letter-spacing: 0.04em;
}

.btfc-ch-featured-copy p,
.btfc-ch-editorial {
    margin: 0;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.95rem;
    line-height: 1.5;
}

.btfc-ch-featured-results {
    list-style: none;
    margin: 0.15rem 0 0.2rem;
    padding: 0;
}

.btfc-ch-featured-results li {
    padding: 0.45rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.btfc-ch-featured-round {
    display: block;
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.btfc-ch-featured-line {
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 600;
}

.btfc-ch-featured .btfc-ch-btn {
    align-self: flex-start;
    margin-top: 0.35rem;
}

.btfc-ch-notable,
.btfc-ch-scorers {
    padding: 1.05rem 1rem 1.05rem;
    width: 100%;
    height: auto;
    display: flex;
    flex-direction: column;
}

.btfc-ch-notable-list {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
}

.btfc-ch-notable-list a {
    display: grid;
    grid-template-columns: 5.4rem minmax(0, 1fr) 1.1rem;
    gap: 0.7rem;
    align-items: center;
    padding: 0.85rem 0;
    border-bottom: 1px solid #eef1f5;
    text-decoration: none;
    color: inherit;
}

.btfc-ch-notable-list li:first-child a {
    padding-top: 0.15rem;
}

.btfc-ch-notable-season {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--btfc-ch-accent);
}

.btfc-ch-notable-text {
    color: #4b5563;
    font-size: 0.84rem;
    line-height: 1.35;
}

.btfc-ch-notable-arrow {
    display: inline-flex;
    color: #9ca3af;
}

.btfc-ch-notable-arrow svg {
    width: 1.05rem;
    height: 1.05rem;
}

.btfc-ch-placeholder {
    padding: 1.4rem;
    min-height: 0;
}

/* Scorers */

.btfc-ch-scorer-list {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
}

.btfc-ch-scorer-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid #eef1f5;
}

.btfc-ch-scorer-list li:last-child {
    border-bottom: 0;
}

.btfc-ch-scorer-rank {
    width: 1.4rem;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--btfc-ch-navy);
}

.btfc-ch-scorer-photo {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 50%;
    background: #f3f4f6;
    flex-shrink: 0;
}

.btfc-ch-scorer-photo.is-empty {
    display: inline-block;
}

.btfc-ch-scorer-name {
    flex: 1;
    min-width: 0;
    font-weight: 600;
}

.btfc-ch-scorer-name a {
    color: var(--btfc-ch-navy);
    text-decoration: none;
}

.btfc-ch-scorer-name a:hover {
    color: var(--btfc-ch-accent);
}

.btfc-ch-scorer-years {
    display: block;
    color: #6b7280;
    font-size: 0.72rem;
    font-weight: 500;
}

.btfc-ch-scorers > .btfc-ch-btn {
    margin-top: 0.25rem;
}

.btfc-ch-scorer-goals {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    letter-spacing: 0.03em;
    color: var(--btfc-ch-navy);
}

/* Archive */

.btfc-ch-band--archive {
    margin-top: 1.75rem;
    padding-top: 2.25rem;
    padding-bottom: 2.5rem;
}

.btfc-ch-archive {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(250px, 0.9fr) minmax(300px, 1.2fr);
    gap: 20px;
    align-items: start;
}

.btfc-ch-seasons-panel,
.btfc-ch-campaign,
.btfc-ch-latest {
    padding: 1.15rem 1.15rem 1.2rem;
    height: auto;
}

.btfc-ch-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 0.9rem;
}

.btfc-ch-filter select,
.btfc-ch-filter input {
    min-height: 2.4rem;
    padding: 0.4rem 0.7rem;
    border: 1px solid #e4e7ec;
    background: #ffffff;
    color: var(--btfc-ch-navy);
    font: inherit;
    font-size: 0.84rem;
}

.btfc-ch-filter input {
    flex: 1;
    min-width: 10rem;
}

.btfc-ch-table-wrap {
    overflow: auto;
    margin-bottom: 1rem;
}

.btfc-ch-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.btfc-ch-table th,
.btfc-ch-table td {
    padding: 0.48rem 0.45rem;
    border-bottom: 1px solid #eef1f5;
    text-align: left;
    white-space: nowrap;
}

.btfc-ch-table thead th {
    color: #6b7280;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: transparent;
}

.btfc-ch-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

.btfc-ch-table tbody tr:hover,
.btfc-ch-season-row.is-active {
    background: #eef3fb;
}

.btfc-ch-season-row {
    cursor: pointer;
}

.btfc-ch-table a {
    color: var(--btfc-ch-accent);
    font-weight: 600;
    text-decoration: none;
}

.btfc-ch-table a:hover {
    text-decoration: underline;
}

.btfc-ch-seasons-panel > .btfc-ch-btn {
    align-self: flex-start;
}

.btfc-ch-tabs {
    display: flex;
    gap: 0.15rem;
    margin: 0 0 1rem;
    border-bottom: 1px solid #e8edf3;
}

.btfc-ch-tabs button {
    appearance: none;
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;
    padding: 0.45rem 0.7rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #6b7280;
    cursor: pointer;
}

.btfc-ch-tabs button.is-active {
    color: var(--btfc-ch-navy);
    border-bottom-color: var(--btfc-ch-accent);
}

.btfc-ch-tab-panel {
    height: auto;
}

.btfc-ch-campaign-record,
.btfc-ch-campaign-best {
    margin: 0 0 0.7rem;
    font-size: 0.9rem;
}

.btfc-ch-campaign-record {
    font-weight: 600;
}

.btfc-ch-timeline {
    list-style: none;
    margin: 0 0 0.4rem;
    padding: 0 0 0 0.85rem;
    border-left: 2px solid #e5eaf1;
}

.btfc-ch-timeline li {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.4fr) 1.4rem 1.6rem auto;
    gap: 0.4rem;
    align-items: center;
    padding: 0.55rem 0 0.55rem 0.95rem;
    font-size: 0.8rem;
}

.btfc-ch-timeline li::before {
    content: "";
    position: absolute;
    left: -0.38rem;
    top: 0.85rem;
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: var(--btfc-ch-accent);
}

.btfc-ch-timeline-round {
    color: #6b7280;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.btfc-ch-ha {
    color: #6b7280;
    font-weight: 700;
    font-size: 0.72rem;
}

.btfc-ch-result {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.35rem;
    height: 1.35rem;
    font-size: 0.68rem;
    font-weight: 800;
    color: #ffffff;
}

.btfc-ch-result--w {
    background: #16a34a;
}

.btfc-ch-result--d {
    background: #9ca3af;
}

.btfc-ch-result--l {
    background: #dc2626;
}

.btfc-ch-timeline-score {
    font-weight: 700;
}

.btfc-ch-campaign-cta {
    margin-top: 1rem;
}

/* Latest */

.btfc-ch-latest-meta {
    margin: 0 0 0.75rem;
    color: #6b7280;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.btfc-ch-latest-scoreline {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0.7rem;
    align-items: center;
    margin-bottom: 1rem;
    text-align: center;
    font-weight: 600;
}

.btfc-ch-latest-scoreline strong {
    font-family: var(--font-heading);
    font-size: 1.5rem;
}

.btfc-ch-latest > .btfc-ch-btn {
    align-self: stretch;
}

/* Index */

.btfc-ch-index-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.btfc-ch-index-card {
    display: flex;
    flex-direction: column;
    padding: 1.3rem 1.2rem 1.2rem;
    text-decoration: none;
    color: inherit;
}

.btfc-ch-index-card h2 {
    margin: 0 0 0.55rem;
    font-size: 1.7rem;
}

.btfc-ch-index-card p {
    margin: 0;
    color: #6b7280;
    font-size: 0.9rem;
    flex: 1;
}

.btfc-ch-index-cta {
    margin-top: 1rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-primary);
}

@media (max-width: 1000px) {
    .btfc-ch-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .btfc-ch-upper {
        grid-template-columns: 1fr 1fr;
    }

    .btfc-ch-main {
        grid-column: 1 / -1;
    }

    .btfc-ch-archive,
    .btfc-ch-index-grid {
        grid-template-columns: 1fr;
    }

    .btfc-ch-hero {
        height: auto;
        min-height: 280px;
    }

    .btfc-ch-hero-inner {
        height: auto;
        padding: 1.15rem 24px 1.35rem;
    }

    .btfc-ch-featured,
    .btfc-ch-featured-copy {
        min-height: 260px;
    }
}

@media (max-width: 640px) {
    .btfc-ch-upper {
        grid-template-columns: 1fr;
    }

    .btfc-ch-hero-inner,
    .btfc-ch-wrap {
        padding-left: 16px;
        padding-right: 16px;
    }

    .btfc-ch-hero-title {
        font-size: clamp(2.1rem, 12vw, 3rem);
    }

    .btfc-ch-hero-art {
        object-position: center top;
    }

    .btfc-ch-timeline li,
    .btfc-ch-notable-list a {
        grid-template-columns: 1fr auto;
    }

    .btfc-ch-crowd {
        width: 5.4rem;
        height: 5.4rem;
        top: 0.75rem;
        right: 0.75rem;
    }
}
