:root {
    --page-bg: #f3f5f7;
    --surface: #ffffff;
    --surface-soft: #f7f8fa;
    --ink: #17191d;
    --muted: #66707c;
    --line: #dce1e7;
    --brand: #205b9c;
    --brand-dark: #102b4a;
    --nav: #111820;
    --focus: #ffbf47;
    --success: #237a4b;
    --radius: .72rem;
    --shadow: 0 .4rem 1.35rem rgb(15 23 42 / .08);
    --content: 84rem;
    --narrow: 66rem;
    --article: 50rem;
    --category-colour: #687483;
}

*, *::before, *::after { box-sizing: border-box; }
html { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color-scheme: light; scroll-behavior: smooth; }
body { margin: 0; background: var(--page-bg); color: var(--ink); line-height: 1.55; }
a { color: inherit; }
img { max-width: 100%; }
button, input, select { font: inherit; }
:focus-visible { outline: .2rem solid var(--focus); outline-offset: .18rem; }
[hidden] { display: none !important; }

.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; }
.skip-link { position: fixed; z-index: 1000; top: .5rem; left: .5rem; transform: translateY(-200%); padding: .7rem 1rem; border-radius: .35rem; background: #fff; box-shadow: var(--shadow); }
.skip-link:focus { transform: none; }
.content-width { width: min(100% - 1.5rem, var(--content)); margin-inline: auto; }
.content-width--narrow { max-width: var(--narrow); }
.content-width--article { max-width: var(--article); }

/* Header */
.site-header { position: relative; z-index: 50; background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header__masthead { min-height: 4.6rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: baseline; gap: .28rem; text-decoration: none; text-transform: uppercase; font-weight: 950; font-style: italic; line-height: .92; letter-spacing: -.065em; }
.brand__county, .brand__sport { font-size: clamp(1.45rem, 7vw, 2.4rem); }
.brand__county { color: var(--ink); }
.brand__sport { color: var(--brand); }
.header-actions { display: flex; align-items: center; gap: .35rem; }
.header-action { min-width: 2.7rem; height: 2.7rem; display: inline-grid; place-items: center; border: 0; border-radius: 999px; padding: 0 .8rem; background: var(--surface-soft); color: var(--ink); text-decoration: none; cursor: pointer; font-weight: 800; }
.header-action--account { display: none; }
.site-main-sponsor { padding-block: .35rem .55rem; }

/* Sponsorship */
.sponsor-slot { margin-block: .7rem; text-align: center; }
.sponsor-slot__label { display: block; margin-bottom: .3rem; color: var(--muted); font-size: .65rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.sponsor-slot img { width: 100%; max-height: 8rem; display: block; object-fit: contain; border-radius: .35rem; background: #fff; }
.site-main-sponsor .sponsor-slot__label { display: none; }
.site-main-sponsor .sponsor-slot img { max-height: 4.75rem; object-position: center; }
.sponsor-slot__placeholder { min-height: 5rem; display: grid; place-items: center; border: 1px dashed #aeb8c4; border-radius: .45rem; background: #fff; color: #697584; font-weight: 800; padding: .9rem; }
.sponsor-slot--site-main .sponsor-slot__placeholder { min-height: 4.5rem; }
.sponsor-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .6rem; margin-block: 1.25rem; }
.sponsor-grid .sponsor-slot { margin: 0; }
.sponsor-break { margin-block: 1rem; }

/* Navigation - mobile first */
.main-navigation { display: none; background: var(--nav); color: #fff; }
.main-navigation--open { display: block; }
.main-navigation__inner { padding-block: .35rem .65rem; }
.nav-disclosure { border-bottom: 1px solid rgb(255 255 255 / .08); }
.nav-disclosure__row { display: flex; align-items: stretch; }
.nav-link { flex: 1 1 auto; display: flex; align-items: center; min-height: 2.9rem; padding: .65rem .75rem; border: 0; background: transparent; color: #fff; text-decoration: none; font-weight: 800; text-align: left; cursor: pointer; }
.nav-child-toggle { width: 3rem; border: 0; border-left: 1px solid rgb(255 255 255 / .08); background: transparent; color: #fff; cursor: pointer; }
.nav-child-toggle[aria-expanded="true"] span, .nav-toggle[aria-expanded="true"] span { display: inline-block; transform: rotate(180deg); }
.nav-children { margin: 0 .5rem .55rem; padding: .35rem; border-radius: .45rem; background: rgb(255 255 255 / .06); }
.nav-children .nav-disclosure { border: 0; }
.nav-children .nav-link { min-height: 2.5rem; color: #e3e9ef; font-size: .92rem; }
.nav-toggle { width: 100%; justify-content: space-between; }
.nav-link--search { margin-top: .3rem; color: #bfd8f5; }

/* Headings */
.page-shell { padding-bottom: 3rem; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin: 1.3rem 0 .8rem; }
.section-heading--stacked { display: block; }
.section-heading h1, .section-heading h2, .category-header h1, .archive-header h1, .account-header h1 { margin: 0; font-size: clamp(1.8rem, 8vw, 3.25rem); line-height: 1; letter-spacing: -.045em; }
.section-heading__link { display: none; color: var(--brand); font-weight: 850; text-decoration: none; }
.eyebrow { display: block; margin-bottom: .24rem; color: var(--brand); font-size: .76rem; font-weight: 950; letter-spacing: .11em; text-transform: uppercase; }

/* Category colours are deliberately subtle */
.category-tag { --category-colour: #687483; display: inline-flex; align-items: center; min-height: 1.65rem; padding: .22rem .52rem; border-radius: 999px; background: color-mix(in srgb, var(--category-colour) 12%, white); color: color-mix(in srgb, var(--category-colour) 83%, black); font-size: .72rem; font-weight: 950; line-height: 1; text-decoration: none; }
.category-football { --category-colour: #527b62; }
.category-rugby { --category-colour: #8a5965; }
.category-cricket { --category-colour: #927432; }
.category-junior { --category-colour: #4e6f91; }
.category-womens, .category-women { --category-colour: #875a86; }
.category-athletics { --category-colour: #945d3e; }
.category-disability { --category-colour: #4a7885; }
.category-pictures-of-the-week { --category-colour: #6c6098; }
.category-pcc-leisure { --category-colour: #4d7b73; }
.category-fixtures { --category-colour: #416f8d; }
.category-golf { --category-colour: #4f7568; }
.category-indoor { --category-colour: #665f8b; }
.category-gymnastics { --category-colour: #8a687c; }
.category-outdoor { --category-colour: #55754d; }
.category-sports-spotlight { --category-colour: #87672d; }
.category-unsung-heroes { --category-colour: #6a5b8d; }
.category-beat-the-expert { --category-colour: #795947; }
.category-sports-snippets { --category-colour: #59718c; }
.category-where-are-they-now { --category-colour: #786749; }
.category-featured-news { --category-colour: #8a6b2c; }
.category-special-offers { --category-colour: #6b6f75; }
.category-milford-rfc { --category-colour: #81505b; }
.category-preseli-school { --category-colour: #526e8a; }
.category-short-mat-bowls { --category-colour: #52716f; }
.category-watsons-words { --category-colour: #6e6386; }
.category-good-sport-award { --category-colour: #79713e; }
.category-star-of-the-month { --category-colour: #82622d; }
.category-sporting-memories { --category-colour: #6f675b; }
.category-sporting-stars { --category-colour: #4e6d8f; }

/* Standardised editorial images. Full-size URLs are used everywhere. */
.editorial-image { width: 100%; aspect-ratio: 16 / 9; display: block; background-size: cover; background-repeat: no-repeat; background-position: center top; background-color: #dfe5eb; }
.editorial-image--placeholder { display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--brand-dark), var(--brand)); font-size: 1.5rem; font-weight: 950; }

/* Stories */
.featured-section, .personalised-section, .latest-section { margin-top: 1rem; }
.featured-layout { display: grid; gap: .8rem; }
.featured-secondary, .story-grid { display: grid; gap: .75rem; }
.lead-story { overflow: hidden; border-radius: var(--radius); border-top: .3rem solid var(--category-colour); background: #17202a; box-shadow: var(--shadow); }
.lead-story__image { position: relative; width: 100%; aspect-ratio: 16 / 9; display: block; overflow: hidden; background-size: cover; background-repeat: no-repeat; background-position: center top; text-decoration: none; }
.lead-story__placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--brand-dark), var(--brand)); font-weight: 950; }
.lead-story__overlay { position: absolute; inset: auto 0 0; display: flex; flex-direction: column; align-items: flex-start; gap: .48rem; padding: 2.7rem 1rem 1rem; color: #fff; background: linear-gradient(to top, rgb(0 0 0 / .82), rgb(0 0 0 / 0)); }
.lead-story__overlay .category-tag { background: #fff; }
.lead-story__headline { max-width: 22ch; font-size: clamp(1.45rem, 7vw, 2.65rem); font-weight: 950; line-height: 1.03; letter-spacing: -.04em; }
.lead-story time { font-size: .82rem; color: #e2e7ec; }

.article-card { overflow: hidden; border-radius: var(--radius); border-top: .22rem solid var(--category-colour); background: var(--surface); box-shadow: 0 .18rem .85rem rgb(15 23 42 / .055); transition: transform .16s ease, box-shadow .16s ease; }
.article-card__link { display: grid; grid-template-columns: 7.4rem minmax(0,1fr); min-width: 0; height: 100%; color: inherit; text-decoration: none; cursor: pointer; }
.article-card__image { display: block; min-width: 0; text-decoration: none; }
.article-card:hover { transform: translateY(-2px); box-shadow: 0 .45rem 1.25rem rgb(15 23 42 / .11); }
.article-card__link:focus-visible { outline: .2rem solid var(--brand); outline-offset: -.25rem; border-radius: calc(var(--radius) - .1rem); }
.article-card__image .editorial-image { height: 100%; min-height: 7.1rem; aspect-ratio: auto; }
.article-card__body { min-width: 0; padding: .72rem .72rem .72rem .8rem; }
.article-card__title { margin: .43rem 0 .34rem; font-size: 1rem; line-height: 1.23; letter-spacing: -.016em; }
.article-card__title { color: var(--text); }
.story-date { color: var(--muted); font-size: .82rem; }
.story-grid__sponsor { grid-column: 1 / -1; }
.news-layout { display: grid; gap: 1rem; }
.desktop-sponsor-rail { display: none; }

/* Category and archive */
.category-header { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-top: 1.35rem; padding-left: .75rem; border-left: .36rem solid var(--category-colour); }
.category-main-sponsor { margin-top: .85rem; }
.archive-page, .search-page, .account-page { padding-block: 1.3rem 3rem; }
.archive-header { padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.archive-header p { color: var(--muted); }
.archive-month { margin-top: 2rem; }
.archive-month h2 { margin: 0 0 .8rem; padding-bottom: .4rem; border-bottom: 2px solid var(--line); font-size: 1.35rem; }

/* Article */
.article-page { padding-top: 1.25rem; }
.article-header h1 { margin: .65rem 0 .5rem; font-size: clamp(2rem, 10vw, 4.35rem); line-height: .99; letter-spacing: -.055em; }
.article-hero { aspect-ratio: 16 / 9; margin-top: 1rem; border-radius: var(--radius); background-size: cover; background-repeat: no-repeat; background-position: center top; background-color: #e1e6eb; }
.article-layout { display: grid; gap: 1.5rem; margin-top: 1.35rem; }
.article-content { min-width: 0; max-width: var(--article); }
.article-body { font-family: Georgia, "Times New Roman", serif; font-size: 1.07rem; line-height: 1.72; overflow-wrap: anywhere; }
.article-body > :first-child { margin-top: 0; }
.article-body img { max-width: 100% !important; height: auto !important; }
.article-body table { display: block; max-width: 100%; overflow-x: auto; }
.article-body iframe, .article-body video { max-width: 100% !important; }
.article-body a { color: var(--brand); }
.article-sidebar { display: none; }
.article-taxonomy, .related-section { margin-top: 2rem; margin-bottom: 2rem; }
.article-taxonomy h2 { font-size: 1rem; }
.tag-list { display: flex; flex-wrap: wrap; gap: .4rem; }
.sponsor-grid--mobile { display: grid; }

/* Fixtures and results */
.fixture-panel { overflow: hidden; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.fixture-toolbar { padding: .9rem; border-bottom: 1px solid var(--line); }
.fixture-toolbar h2 { margin: 0 0 .75rem; font-size: 1.35rem; }
.fixture-filters { display: flex; gap: .35rem; overflow-x: auto; }
.fixture-filters a { flex: 0 0 auto; padding: .42rem .72rem; border-radius: 999px; background: #edf1f5; color: var(--ink); text-decoration: none; font-size: .86rem; font-weight: 850; }
.fixture-filters a.is-active { background: var(--brand); color: #fff; }
.fixture-date { padding: .9rem; }
.fixture-date + .fixture-date { border-top: .55rem solid var(--page-bg); }
.fixture-date h3 { margin: 0 0 .6rem; color: var(--brand-dark); font-size: 1rem; }
.fixture-date__items { display: grid; gap: .55rem; }
.fixture-row { padding: .7rem; border: 1px solid var(--line); border-radius: .5rem; background: #fff; }
.fixture-row--result { background: #f9fafb; }
.fixture-row__teams { display: grid; grid-template-columns: minmax(0,1fr) 3rem minmax(0,1fr); align-items: center; gap: .35rem; }
.fixture-team { line-height: 1.2; }
.fixture-team--home { text-align: right; }
.fixture-team--away { text-align: left; }
.fixture-qualifier { text-align: center; color: var(--brand); font-weight: 950; }
.fixture-info { margin-top: .45rem; text-align: center; color: var(--muted); font-size: .86rem; }
.fixture-scorers { display: grid; grid-template-columns: 1fr 1fr; gap: 3.7rem; margin-top: .42rem; color: var(--muted); font-size: .82rem; font-style: italic; }
.fixture-scorers span:first-child { text-align: right; }
.fixture-notes { margin-top: .48rem; padding-top: .48rem; border-top: 1px dashed var(--line); color: #4c5663; font-size: .86rem; }

/* Search and forms */
.search-form, .preference-form { display: grid; gap: .85rem; margin: 1rem 0; padding: 1rem; border-radius: var(--radius); background: var(--surface); box-shadow: 0 .2rem .9rem rgb(15 23 42 / .04); }
.form-field label, .preference-form legend { display: block; margin-bottom: .38rem; font-weight: 850; }
.form-field input, .form-field select { width: 100%; min-height: 3rem; border: 1px solid #aeb8c4; border-radius: .4rem; padding: .62rem .72rem; background: #fff; }
.search-summary { margin: 1rem 0; color: var(--muted); }
.button { min-height: 2.8rem; display: inline-flex; align-items: center; justify-content: center; padding: .62rem 1rem; border: 0; border-radius: .42rem; background: var(--brand); color: #fff; font-weight: 850; text-decoration: none; cursor: pointer; }
.button--secondary { background: #e7edf3; color: var(--ink); }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: .55rem; margin: 1.5rem 0; }
.pagination__status { color: var(--muted); font-size: .83rem; text-align: center; }
.empty-state, .notice, .error-page { margin-block: 1rem; padding: 1rem; border-radius: var(--radius); background: var(--surface); }
.notice { border-left: .32rem solid var(--brand); }
.notice--success { border-left-color: var(--success); }

/* Account */
.account-header { margin-bottom: 1rem; }
.account-header p { max-width: 52rem; color: var(--muted); }
.social-login-list { display: grid; gap: .7rem; max-width: 30rem; }
.social-login { width: 100%; min-height: 3.2rem; border: 1px solid var(--line); border-radius: .45rem; background: #fff; font-weight: 850; cursor: pointer; }
.social-login--google { border-color: #cdd6df; }
.social-login--facebook { background: #1877f2; border-color: #1877f2; color: #fff; }
.preference-form fieldset { margin: 0; padding: 0; border: 0; }
.preference-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .55rem; }
.preference-option { display: flex; align-items: center; gap: .55rem; min-height: 2.8rem; padding: .6rem; border: 1px solid var(--line); border-radius: .45rem; background: var(--surface-soft); cursor: pointer; }
.preference-option input { width: 1.1rem; height: 1.1rem; }
.logout-form { margin-top: 1rem; }

/* Footer */
.site-footer { margin-top: 2rem; padding: 1.1rem 0; background: var(--nav); color: #fff; }
.site-footer__bottom { display: grid; gap: .65rem; padding: .9rem 0; color: #d3dae2; font-size: .85rem; }
.site-footer__bottom div { display: flex; flex-direction: column; }
.site-footer__bottom nav { display: flex; gap: 1rem; }
.site-footer__bottom a { color: #fff; }
.muted { color: var(--muted); }

@media (min-width: 42rem) {
    .content-width { width: min(100% - 2.2rem, var(--content)); }
    .header-action--account { display: inline-grid; }
    .section-heading__link { display: inline; }
        .featured-secondary { align-content: start; }
    .featured-secondary .article-card__link { grid-template-columns: 8rem minmax(0,1fr); }
    .story-grid--compact, .story-grid--category, .story-grid--archive, .story-grid--search, .story-grid--related { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .story-grid--compact .article-card__link, .story-grid--category .article-card__link, .story-grid--archive .article-card__link, .story-grid--search .article-card__link, .story-grid--related .article-card__link { grid-template-columns: 1fr; }
    .story-grid--compact .article-card__image .editorial-image, .story-grid--category .article-card__image .editorial-image, .story-grid--archive .article-card__image .editorial-image, .story-grid--search .article-card__image .editorial-image, .story-grid--related .article-card__image .editorial-image { aspect-ratio: 16 / 9; min-height: 0; }
    .story-grid--compact .article-card__body, .story-grid--category .article-card__body, .story-grid--archive .article-card__body, .story-grid--search .article-card__body, .story-grid--related .article-card__body { padding: .85rem; }
    .sponsor-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .search-form { grid-template-columns: minmax(0,2fr) minmax(12rem,1fr) auto; align-items: end; }
    .preference-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .site-footer__bottom { grid-template-columns: 1fr auto auto; align-items: end; }
}

@media (min-width: 72rem) {
    .featured-layout { grid-template-columns: minmax(0,1.65fr) minmax(18rem,1fr); }
}

@media (min-width: 64rem) {
    .site-header { position: sticky; top: 0; }
    .site-header__masthead { min-height: 5.2rem; }
    .brand__county, .brand__sport { font-size: 2.5rem; }
    .header-actions [data-menu-toggle] { display: none; }
    .main-navigation { display: block; }
    .main-navigation__inner { display: flex; align-items: stretch; gap: 0; padding-block: 0; overflow: visible; }
    .main-navigation > .main-navigation__inner > .nav-link,
    .main-navigation > .main-navigation__inner > .nav-disclosure > .nav-disclosure__row > .nav-link,
    .main-navigation > .main-navigation__inner > .nav-disclosure > .nav-toggle { min-height: 3rem; padding: .7rem .65rem; font-size: .84rem; white-space: nowrap; }
    .main-navigation > .main-navigation__inner > .nav-disclosure { position: relative; border: 0; flex: 0 0 auto; }
    .main-navigation > .main-navigation__inner > .nav-link { flex: 0 0 auto; }
    .nav-disclosure__row { height: 100%; }
    .main-navigation > .main-navigation__inner > .nav-disclosure > .nav-children { position: absolute; z-index: 80; top: 100%; left: 0; width: 18rem; max-height: 70vh; overflow-y: auto; margin: 0; padding: .5rem; border-radius: 0 0 .5rem .5rem; background: #1b2530; box-shadow: var(--shadow); }
    .main-navigation > .main-navigation__inner > .nav-disclosure--more > .nav-children--more { right: 0; left: auto; width: 22rem; }
    .nav-link:hover, .nav-link:focus-visible, .nav-child-toggle:hover { background: rgb(255 255 255 / .08); }
    .news-layout { grid-template-columns: minmax(0,1fr) 18rem; gap: 1.4rem; }
    .story-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .story-grid .article-card__link { grid-template-columns: 10rem minmax(0,1fr); }
    .story-grid .article-card__image .editorial-image { aspect-ratio: auto; min-height: 8.2rem; }
    .story-grid--compact, .story-grid--category, .story-grid--archive, .story-grid--search { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .story-grid--related { grid-template-columns: repeat(4,minmax(0,1fr)); }
    .story-grid--compact .article-card__link, .story-grid--category .article-card__link, .story-grid--archive .article-card__link, .story-grid--search .article-card__link, .story-grid--related .article-card__link { grid-template-columns: 1fr; }
    .story-grid--compact .article-card__image .editorial-image, .story-grid--category .article-card__image .editorial-image, .story-grid--archive .article-card__image .editorial-image, .story-grid--search .article-card__image .editorial-image, .story-grid--related .article-card__image .editorial-image { aspect-ratio: 16 / 9; min-height: 0; }
    .desktop-sponsor-rail { display: block; }
    .article-layout { grid-template-columns: minmax(0,var(--article)) 18rem; justify-content: center; gap: 3rem; }
    .article-sidebar { display: block; }
    .sponsor-grid--mobile { display: none; }
    .sponsor-grid { grid-template-columns: repeat(6,minmax(0,1fr)); }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* --------------------------------------------------------------------------
   Article page refinements (v4)
   -------------------------------------------------------------------------- */

.article-page {
    padding-top: 1.65rem;
}

.article-header {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--line);
}

.article-header h1 {
    max-width: 48rem;
    margin: .6rem 0 .4rem;
    font-size: clamp(2.25rem, 8vw, 4.6rem);
    line-height: .98;
    letter-spacing: -.055em;
}

/* Article imagery comes from the article body itself. */
.article-hero {
    display: none !important;
}

.article-content {
    margin-top: 1.4rem;
}

.article-body {
    width: 100%;
    max-width: none;
    color: #222831;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.03rem, 1.7vw, 1.13rem);
    line-height: 1.75;
}

.article-body > :first-child {
    margin-top: 0 !important;
}

.article-body p {
    margin: 0 0 1.25em;
}

.article-body h2,
.article-body h3,
.article-body h4 {
    margin: 2em 0 .7em;
    color: var(--ink);
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    line-height: 1.15;
    letter-spacing: -.025em;
}

.article-body h2 {
    font-size: clamp(1.45rem, 4vw, 2rem);
}

.article-body h3 {
    font-size: clamp(1.25rem, 3vw, 1.55rem);
}

.article-body img {
    display: block;
    max-width: 100% !important;
    height: auto !important;
    margin: 1.25rem auto !important;
    border-radius: .55rem;
}

.article-body figure {
    max-width: 100% !important;
    margin: 1.4rem auto;
}

.article-body figure img {
    margin: 0 auto !important;
}

.article-body figcaption {
    margin-top: .45rem;
    color: var(--muted);
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        sans-serif;
    font-size: .82rem;
    line-height: 1.45;
}

.article-body iframe,
.article-body video {
    width: 100% !important;
    max-width: 100% !important;
}

.article-body table {
    width: 100% !important;
    max-width: 100% !important;
    border-collapse: collapse;
}

.article-body td,
.article-body th {
    vertical-align: top;
}

.article-body [style*="font-size"] {
    font-size: inherit !important;
}

.article-body [style*="line-height"] {
    line-height: inherit !important;
}

.article-partners {
    margin-top: 1rem;
    margin-bottom: 1.15rem;
    padding: .85rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 .15rem .7rem rgb(15 23 42 / .05);
}

.article-partners__heading {
    margin-bottom: .55rem;
}

.article-partners__heading .eyebrow {
    margin-bottom: .08rem;
}

.article-partners__heading h2 {
    margin: 0;
    font-size: .98rem;
    line-height: 1.2;
}

.article-partners__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .6rem;
}

.article-partners__main {
    grid-column: 1 / -1;
}

.article-partners .sponsor-slot {
    margin: 0;
}

.article-partners .sponsor-slot__label {
    font-size: .58rem;
}

.article-partners .sponsor-slot__placeholder {
    min-height: 3.8rem;
}

.article-partners__main .sponsor-slot__placeholder {
    min-height: 4.4rem;
}

.article-taxonomy {
    padding-top: 1.15rem;
    border-top: 1px solid var(--line);
}

@media (max-width: 41.99rem) {
    /* Old articles often used HTML tables for desktop column layouts.
       Allow them to collapse naturally on small screens without horizontal scroll. */
    .article-body table:not(.fixture-table),
    .article-body table:not(.fixture-table) tbody,
    .article-body table:not(.fixture-table) tr,
    .article-body table:not(.fixture-table) td {
        max-width: 100% !important;
    }
}

@media (min-width: 42rem) {
    .article-partners {
        padding: 1rem;
    }

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

    .article-partners__main {
        grid-column: span 3;
    }
}

@media (min-width: 64rem) {
    .article-content {
        margin-top: 1.75rem;
    }

    .article-partners__grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .article-partners__main {
        grid-column: span 6;
    }
}

/* Homepage sponsors are populated dynamically from the configured CMS article.
   Header and footer sponsorship remain completely separate. */
.homepage-sponsors {
    margin-top: 1.25rem;
    padding: 1rem;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.homepage-sponsors__heading {
    margin-bottom: .8rem;
}

.homepage-sponsors__heading h2 {
    margin: 0;
    font-size: 1.35rem;
    line-height: 1.1;
}

.homepage-sponsors__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .65rem;
}

.homepage-sponsor {
    min-width: 0;
    min-height: 5.5rem;
    display: grid;
    place-items: center;
    padding: .7rem;
    border: 1px solid var(--line);
    border-radius: .5rem;
    background: #fff;
}

.homepage-sponsor a {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
}

.homepage-sponsor img {
    width: 100%;
    height: 5rem;
    display: block;
    object-fit: contain;
}

@media (min-width: 42rem) {
    .homepage-sponsors__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 64rem) {
    .homepage-sponsors {
        padding: 1.15rem;
    }

    .homepage-sponsors__grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .homepage-sponsor img {
        height: 5.5rem;
    }
}

/* CMS article-driven sponsor logo grids (category, article and archive pages). */
.cms-sponsors {
    margin-block: 1.25rem 1.5rem;
    padding-block: .9rem;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.cms-sponsors__heading {
    margin-bottom: .75rem;
}
.cms-sponsors__heading h2 {
    margin: .15rem 0 0;
    font-size: clamp(1.15rem, 2vw, 1.55rem);
}
.cms-sponsors__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .7rem;
}
.cms-sponsor {
    min-height: 5.2rem;
    display: grid;
    place-items: center;
    padding: .65rem;
    border: 1px solid var(--border);
    border-radius: .45rem;
    background: #fff;
}
.cms-sponsor a {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
}
.cms-sponsor img {
    display: block;
    width: 100%;
    max-width: 14rem;
    height: 4.5rem;
    object-fit: contain;
}
@media (min-width: 42rem) {
    .cms-sponsors__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 64rem) {
    .cms-sponsors__grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* Fixture parser diagnostics: only rendered when ?debug=true is supplied. */
.fixture-debug {
    margin-block: 1.25rem;
    padding: 1rem;
    border: 2px solid #d19a24;
    border-radius: .65rem;
    background: #fff8e8;
    overflow: hidden;
}
.fixture-debug h2 { margin: 0 0 .25rem; }
.fixture-debug__notice { margin: 0 0 1rem; color: #5f4a20; }
.fixture-debug__summary { display: grid; gap: .35rem; margin: 0 0 1rem; }
.fixture-debug__summary > div { display: grid; grid-template-columns: minmax(12rem, 1fr) minmax(0, 2fr); gap: .75rem; padding: .4rem .5rem; background: rgb(255 255 255 / .65); }
.fixture-debug dt { font-weight: 800; }
.fixture-debug dd { margin: 0; overflow-wrap: anywhere; }
.fixture-debug .debug-good { color: #176b35; font-weight: 900; }
.fixture-debug .debug-bad { color: #a21d1d; font-weight: 900; }
.fixture-debug__error { margin-block: .75rem; padding: .75rem; border-left: .3rem solid #a21d1d; background: #fff; }
.fixture-debug details { margin-top: .75rem; }
.fixture-debug summary { cursor: pointer; font-weight: 850; }
.fixture-debug pre { max-height: 28rem; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; padding: .75rem; border-radius: .4rem; background: #111923; color: #f5f7fa; font: .78rem/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; }
@media (max-width: 42rem) {
    .fixture-debug__summary > div { grid-template-columns: 1fr; gap: .15rem; }
}

/* --------------------------------------------------------------------------
   Responsive sports navigation (v13)
   Level 1 = sport, Level 2 = league/competition, Level 3 = actions.
   The same API hierarchy is rendered as an accordion on smaller screens and
   as a competition mega-menu on wide screens.
   -------------------------------------------------------------------------- */

.main-navigation__inner {
    display: block;
    padding-block: 0;
}

.mobile-sports-nav {
    display: block;
    padding: .45rem 0 .7rem;
}

.desktop-sports-nav {
    display: none;
}

.mobile-sports-nav__home,
.mobile-sport-item__link {
    min-height: 3.15rem;
    display: flex;
    align-items: center;
    padding: .7rem .8rem;
    color: #fff;
    text-decoration: none;
    font-weight: 900;
}

.mobile-sports-nav__home {
    border-bottom: 1px solid rgb(255 255 255 / .1);
}

.mobile-sport-item {
    border-bottom: 1px solid rgb(255 255 255 / .1);
}

.mobile-sport-item__row {
    display: flex;
    align-items: stretch;
}

.mobile-sport-item__link {
    flex: 1 1 auto;
}

.mobile-sport-item__toggle {
    width: 3.35rem;
    flex: 0 0 3.35rem;
    border: 0;
    border-left: 1px solid rgb(255 255 255 / .09);
    background: transparent;
    color: #fff;
    cursor: pointer;
}

.mobile-sport-item__toggle span {
    display: inline-block;
    transition: transform .18s ease;
}

.mobile-sport-item__toggle[aria-expanded="true"] span {
    transform: rotate(180deg);
}

.mobile-sport-panel {
    margin: 0 .35rem .6rem;
    padding: .55rem;
    border-radius: .65rem;
    background: #1b2530;
}

.mobile-sport-panel__all {
    display: block;
    padding: .58rem .62rem .72rem;
    border-bottom: 1px solid rgb(255 255 255 / .1);
    color: #cde1f7;
    text-decoration: none;
    font-size: .84rem;
    font-weight: 900;
}

.mobile-league-list {
    display: grid;
    gap: .45rem;
    padding-top: .45rem;
}

.mobile-league {
    padding: .68rem;
    border-radius: .55rem;
    background: rgb(255 255 255 / .055);
}

.mobile-league__title {
    display: block;
    color: #fff;
    text-decoration: none;
    font-weight: 900;
    line-height: 1.2;
}

.league-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-top: .62rem;
}

.league-action {
    min-height: 2.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .48rem .72rem;
    border: 1px solid rgb(255 255 255 / .13);
    border-radius: 999px;
    background: rgb(255 255 255 / .08);
    color: #fff;
    text-decoration: none;
    font-size: .78rem;
    font-weight: 900;
}

.league-action:hover,
.league-action:focus-visible {
    background: #fff;
    color: var(--nav);
}

/* Keep the compact mobile navigation until there is genuinely room for a
   desktop sports bar and its competition panels. */
@media (min-width: 64rem) and (max-width: 71.999rem) {
    .main-navigation {
        display: none;
    }

    .main-navigation.main-navigation--open {
        display: block;
    }

    .header-actions [data-menu-toggle] {
        display: inline-grid;
    }
}

@media (min-width: 72rem) {
    .header-actions [data-menu-toggle] {
        display: none;
    }

    .main-navigation {
        display: block;
    }

    .mobile-sports-nav {
        display: none;
    }

    .desktop-sports-nav {
        position: relative;
        display: flex;
        align-items: stretch;
        min-height: 3.15rem;
    }

    .desktop-sports-nav__home,
    .desktop-sport-link,
    .desktop-sport-toggle {
        min-height: 3.15rem;
        display: inline-flex;
        align-items: center;
        border: 0;
        background: transparent;
        color: #fff;
        text-decoration: none;
        font-size: .84rem;
        font-weight: 900;
        white-space: nowrap;
    }

    .desktop-sports-nav__home {
        padding: .7rem .8rem;
    }

    .desktop-sport-item {
        position: static;
        flex: 0 0 auto;
    }

    .desktop-sport-item__row {
        display: flex;
        height: 100%;
    }

    .desktop-sport-link {
        padding: .7rem .58rem .7rem .72rem;
    }

    .desktop-sport-toggle {
        width: 1.8rem;
        justify-content: center;
        padding: 0;
        cursor: pointer;
    }

    .desktop-sport-link--button {
        gap: .42rem;
        padding-inline: .75rem;
        cursor: pointer;
    }

    .desktop-sport-caret,
    .desktop-sport-toggle span {
        display: inline-block;
        transition: transform .18s ease;
    }

    .desktop-sport-toggle[aria-expanded="true"] span,
    .desktop-sport-link--button[aria-expanded="true"] .desktop-sport-caret {
        transform: rotate(180deg);
    }

    .desktop-sports-nav__home:hover,
    .desktop-sport-link:hover,
    .desktop-sport-toggle:hover,
    .desktop-sport-link--button:hover,
    .desktop-sports-nav__home:focus-visible,
    .desktop-sport-link:focus-visible,
    .desktop-sport-toggle:focus-visible,
    .desktop-sport-link--button:focus-visible {
        background: rgb(255 255 255 / .08);
    }

    .desktop-sport-mega {
        position: absolute;
        z-index: 90;
        top: 100%;
        left: 0;
        right: 0;
        max-height: min(72vh, 42rem);
        overflow-y: auto;
        padding: 1rem;
        border-radius: 0 0 .75rem .75rem;
        background: #1b2530;
        box-shadow: 0 1.2rem 2.3rem rgb(0 0 0 / .26);
    }

    .desktop-sport-mega__heading {
        display: flex;
        align-items: end;
        justify-content: space-between;
        gap: 1rem;
        padding: .1rem .15rem .9rem;
        border-bottom: 1px solid rgb(255 255 255 / .11);
    }

    .desktop-sport-mega__heading strong {
        display: block;
        color: #fff;
        font-size: 1.35rem;
        line-height: 1.1;
    }

    .desktop-sport-mega__eyebrow {
        display: block;
        margin-bottom: .15rem;
        color: #9fc4eb;
        font-size: .7rem;
        font-weight: 950;
        letter-spacing: .11em;
        text-transform: uppercase;
    }

    .desktop-sport-mega__all {
        color: #cde1f7;
        text-decoration: none;
        font-size: .82rem;
        font-weight: 900;
    }

    .desktop-league-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: .75rem;
        padding-top: .85rem;
    }

    .desktop-league-card {
        min-width: 0;
        padding: .78rem;
        border: 1px solid rgb(255 255 255 / .08);
        border-radius: .62rem;
        background: rgb(255 255 255 / .05);
    }

    .desktop-league-card__title {
        display: inline-block;
        color: #fff;
        text-decoration: none;
        font-weight: 950;
        line-height: 1.2;
    }

    .desktop-more-sports-grid {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: .8rem;
        padding-top: .85rem;
    }

    .desktop-more-sport {
        min-width: 0;
        padding: .8rem;
        border-radius: .62rem;
        background: rgb(255 255 255 / .05);
    }

    .desktop-more-sport__title {
        display: block;
        padding-bottom: .55rem;
        color: #fff;
        text-decoration: none;
        font-size: 1rem;
        font-weight: 950;
    }

    .desktop-more-sport__leagues {
        display: grid;
        gap: .55rem;
    }

    .desktop-more-league {
        padding-top: .5rem;
        border-top: 1px solid rgb(255 255 255 / .08);
    }

    .desktop-more-league__title {
        color: #e8edf2;
        text-decoration: none;
        font-size: .84rem;
        font-weight: 850;
    }

    .league-actions--compact {
        gap: .28rem;
        margin-top: .38rem;
    }

    .league-actions--compact .league-action {
        min-height: 1.9rem;
        padding: .3rem .48rem;
        font-size: .68rem;
    }
}

@media (min-width: 88rem) {
    .desktop-league-grid,
    .desktop-more-sports-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}


/* --------------------------------------------------------------------------
   League / competition section switcher (v14)
   Mobile first: the three key destinations remain large, equal-width touch
   targets. The control stays close to the fixture/table content and can be
   reused by any sport that gains a third menu level in future.
   -------------------------------------------------------------------------- */

.league-switcher {
    position: sticky;
    top: .5rem;
    z-index: 35;
    margin-bottom: .8rem;
    padding: .7rem;
    border: 1px solid var(--line);
    border-radius: .75rem;
    background: rgb(255 255 255 / .96);
    box-shadow: 0 .35rem 1rem rgb(15 23 42 / .09);
    backdrop-filter: blur(.45rem);
}

.league-switcher__context {
    min-width: 0;
    margin-bottom: .6rem;
}

.league-switcher__context span {
    display: block;
    margin-bottom: .08rem;
    color: var(--brand);
    font-size: .68rem;
    font-weight: 950;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.league-switcher__context strong {
    display: block;
    overflow: hidden;
    color: var(--ink);
    font-size: 1rem;
    line-height: 1.15;
    text-overflow: ellipsis;
}

.league-switcher__tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .38rem;
}

.league-switcher__tabs a {
    min-width: 0;
    min-height: 2.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .55rem .35rem;
    border-radius: .55rem;
    background: #edf1f5;
    color: var(--ink);
    text-align: center;
    text-decoration: none;
    font-size: .82rem;
    font-weight: 900;
}

.league-switcher__tabs a:hover,
.league-switcher__tabs a:focus-visible {
    background: #dfe8f2;
}

.league-switcher__tabs a.is-active {
    background: var(--brand);
    color: #fff;
}

@media (min-width: 42rem) {
    .league-switcher {
        position: static;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding: .75rem .85rem;
    }

    .league-switcher__context {
        flex: 1 1 auto;
        margin-bottom: 0;
    }

    .league-switcher__tabs {
        width: min(26rem, 55%);
        flex: 0 1 26rem;
    }
}


/* --------------------------------------------------------------------------
   External All Wales Sport data embedded through legacy webservice(...) tags.
   Server-side expansion keeps HTTP legacy calls away from the browser, while
   this wrapper gives returned fixtures/results/tables a modern responsive UI.
   -------------------------------------------------------------------------- */

.external-sports-data {
    margin: .25rem 0 1.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    font-size: .92rem;
    line-height: 1.45;
}

.external-sports-data__scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: inherit;
}

.article-body .external-sports-data table,
.external-sports-data table {
    width: 100% !important;
    min-width: 38rem;
    margin: 0 !important;
    border: 0 !important;
    border-collapse: collapse !important;
    background: #fff;
    color: var(--ink);
    font-family: inherit;
    font-size: .86rem;
    line-height: 1.35;
}

.article-body .external-sports-data th,
.article-body .external-sports-data td,
.external-sports-data th,
.external-sports-data td {
    height: auto !important;
    padding: .65rem .55rem !important;
    border: 0 !important;
    border-bottom: 1px solid var(--line) !important;
    background: transparent;
    color: inherit;
    vertical-align: middle;
    font-size: inherit !important;
    line-height: inherit !important;
}

.article-body .external-sports-data th,
.external-sports-data th {
    background: #edf3f8;
    color: var(--brand-dark);
    font-size: .72rem !important;
    font-weight: 950;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.external-sports-data tr:last-child td {
    border-bottom: 0 !important;
}

.external-sports-data tr:nth-child(even) td {
    background: #fafbfd;
}

.external-sports-data--fixtures table,
.external-sports-data--results table {
    min-width: 34rem;
}

.external-sports-data--table table {
    min-width: 44rem;
}

.external-sports-data a {
    color: var(--brand);
    font-weight: 750;
}

.external-sports-data--error {
    padding: 1rem;
    border-left: .3rem solid #b45309;
    box-shadow: none;
}

.external-sports-data--error > p {
    margin: 0;
    font-family: inherit;
    font-weight: 800;
}

.external-sports-data__debug {
    padding: .65rem .8rem;
    border-top: 1px solid var(--line);
    background: #fff8e6;
    color: #513d16;
    font-size: .78rem;
}

.external-sports-data__debug summary {
    cursor: pointer;
    font-weight: 900;
}

.external-sports-data__debug dl {
    display: grid;
    gap: .25rem;
    margin: .55rem 0 0;
}

.external-sports-data__debug dl > div {
    display: grid;
    grid-template-columns: 5rem minmax(0, 1fr);
    gap: .5rem;
}

.external-sports-data__debug dt {
    font-weight: 850;
}

.external-sports-data__debug dd {
    margin: 0;
    overflow-wrap: anywhere;
}

@media (max-width: 41.99rem) {
    .external-sports-data {
        margin-inline: -.15rem;
        border-radius: .65rem;
    }

    .external-sports-data__scroll::after {
        content: "Swipe to view full table";
        position: sticky;
        left: .65rem;
        display: inline-block;
        margin: .45rem .65rem .6rem;
        color: var(--muted);
        font-size: .68rem;
        font-weight: 800;
    }
}


/* --------------------------------------------------------------------------
   v17 page tools: breadcrumbs + share
   -------------------------------------------------------------------------- */
.page-tools {
    min-height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .7rem;
    padding-block: .5rem;
}
.page-tools--article { max-width: var(--article); }
.page-tools > .share-control:first-child:last-child { margin-left: auto; }
.breadcrumbs { min-width: 0; overflow-x: auto; scrollbar-width: none; }
.breadcrumbs::-webkit-scrollbar { display: none; }
.breadcrumbs ol { display: flex; align-items: center; gap: .35rem; margin: 0; padding: 0; list-style: none; white-space: nowrap; }
.breadcrumbs li { display: inline-flex; align-items: center; color: var(--muted); font-size: .76rem; font-weight: 750; }
.breadcrumbs li + li::before { content: "›"; margin-right: .35rem; color: #9aa3ad; }
.breadcrumbs a { color: var(--brand); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }

.share-control { position: relative; flex: 0 0 auto; }
.share-control__button {
    min-height: 2.35rem;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .45rem .75rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--ink);
    box-shadow: 0 .12rem .5rem rgb(15 23 42 / .06);
    cursor: pointer;
    font-size: .78rem;
    font-weight: 900;
}
.share-control__menu {
    position: absolute;
    z-index: 120;
    top: calc(100% + .4rem);
    right: 0;
    width: min(18rem, calc(100vw - 1.5rem));
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .35rem;
    padding: .5rem;
    border: 1px solid var(--line);
    border-radius: .7rem;
    background: #fff;
    box-shadow: var(--shadow);
}
.share-control__menu a,
.share-control__menu button {
    min-height: 2.45rem;
    display: flex;
    align-items: center;
    padding: .55rem .65rem;
    border: 0;
    border-radius: .45rem;
    background: var(--surface-soft);
    color: var(--ink);
    text-decoration: none;
    cursor: pointer;
    font-size: .78rem;
    font-weight: 850;
}
.share-control__menu a:hover,
.share-control__menu button:hover { background: #e8eef5; }
.share-control__status { grid-column: 1 / -1; min-height: 1rem; color: var(--success); font-size: .72rem; font-weight: 800; }

/* --------------------------------------------------------------------------
   v17 CMS-driven header/footer sponsors
   -------------------------------------------------------------------------- */
.site-header__masthead { flex-wrap: wrap; padding-block: .45rem; }
.header-sponsors { order: 3; flex: 1 0 100%; width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem; }
.header-sponsors:has(.header-sponsor:only-child) { grid-template-columns: 1fr; }
.header-sponsor { min-width: 0; height: 3.5rem; display: grid; place-items: center; overflow: hidden; border-radius: .3rem; background: #fff; }
.header-sponsor a { width: 100%; height: 100%; display: grid; place-items: center; }
.header-sponsor img { width: 100%; height: 100%; object-fit: contain; display: block; }
.header-actions { margin-left: auto; }

.footer-sponsors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; padding: 1.2rem 0; border-bottom: 1px solid rgb(255 255 255 / .14); }
.footer-sponsor { min-height: 4.6rem; display: grid; place-items: center; padding: .55rem; border-radius: .45rem; background: #fff; }
.footer-sponsor a { width: 100%; height: 100%; display: grid; place-items: center; }
.footer-sponsor img { width: 100%; max-width: 13rem; height: 3.7rem; object-fit: contain; display: block; }

@media (min-width: 64rem) {
    .site-header__masthead { flex-wrap: nowrap; }
    .header-sponsors { order: initial; flex: 0 1 24rem; width: 24rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .header-sponsors:has(.header-sponsor:only-child) { grid-template-columns: 1fr; }
    .header-sponsor { height: 4.35rem; }
    .footer-sponsors { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* --------------------------------------------------------------------------
   v17 external league data. The legacy service can return fixed-width wrappers
   and dense tables; these rules make the result behave like a native component.
   -------------------------------------------------------------------------- */
.external-sports-data {
    overflow: hidden;
    border-color: #d7dee7;
    box-shadow: 0 .45rem 1.4rem rgb(15 23 42 / .075);
}
.external-sports-data__scroll {
    position: relative;
    background: #fff;
}
.external-sports-data__scroll > div,
.external-sports-data__scroll > section,
.external-sports-data__scroll > form {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin-inline: 0 !important;
}
.external-sports-data__scroll div[style] {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
}
.article-body .external-sports-data table,
.external-sports-data table {
    width: 100% !important;
    min-width: 31rem;
    table-layout: auto;
    font-size: .78rem;
}
.article-body .external-sports-data th,
.article-body .external-sports-data td,
.external-sports-data th,
.external-sports-data td {
    padding: .7rem .42rem !important;
    white-space: nowrap;
}
.external-sports-data--table tbody td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    min-width: 9.5rem;
    white-space: normal;
    font-weight: 850;
    background: #fff !important;
    box-shadow: .5rem 0 .7rem -.75rem rgb(15 23 42 / .55);
}
.external-sports-data--table tbody tr:nth-child(even) td:first-child { background: #fafbfd !important; }
.external-sports-data--table .league-position {
    display: inline-block;
    width: 1.55rem;
    margin-right: .2rem;
    color: var(--muted);
    font-size: .7rem;
    font-weight: 900;
}
.external-sports-data--table thead th:first-child,
.external-sports-data--table tr:first-child th:first-child {
    position: sticky;
    left: 0;
    z-index: 4;
    min-width: 9.5rem;
    background: #edf3f8 !important;
}
.external-sports-data--table td:last-child,
.external-sports-data--table th:last-child {
    color: var(--brand-dark);
    font-weight: 950;
}
.external-sports-data--table a { font-weight: 850; }
.external-sports-data--table .external-sports-data__scroll > p,
.external-sports-data--table .external-sports-data__scroll > div:first-child:not(:has(table)) {
    margin: 0;
    padding: .6rem .75rem;
    color: var(--muted);
    font-size: .72rem;
}
@media (min-width: 42rem) {
    .article-body .external-sports-data table,
    .external-sports-data table { min-width: 36rem; font-size: .84rem; }
    .external-sports-data--table tbody td:first-child,
    .external-sports-data--table thead th:first-child,
    .external-sports-data--table tr:first-child th:first-child { min-width: 12rem; }
}


/* --------------------------------------------------------------------------
   v18 refinements
   -------------------------------------------------------------------------- */
.header-sponsors { align-items: center; }
.header-sponsor {
    height: auto;
    min-height: 3.35rem;
    overflow: visible;
    padding: .2rem;
}
.header-sponsor a {
    width: 100%;
    height: auto;
    min-height: inherit;
}
.header-sponsor img,
.header-sponsor a img {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 3.65rem;
    object-fit: contain;
    object-position: center;
}

.cms-sponsors--card {
    margin-block: 1.25rem 1.6rem;
    padding: 1rem;
    border: 0;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}
.cms-sponsors--card .cms-sponsors__heading { margin-bottom: .85rem; }

.external-sports-data--table {
    margin-top: .65rem;
    overflow: visible;
    border: 0;
    border-radius: .8rem;
    background: transparent;
    box-shadow: none;
}
.external-sports-data--table .external-sports-data__scroll {
    position: relative;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    border: 1px solid var(--line);
    border-radius: .8rem;
    background: #fff;
    box-shadow: 0 .3rem 1rem rgb(15 23 42 / .07);
    scrollbar-width: thin;
}
.article-body .external-sports-data--table table,
.external-sports-data--table table {
    width: 100% !important;
    min-width: 42rem;
    margin: 0 !important;
    border: 0 !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    table-layout: auto;
    background: #fff;
    font-size: .78rem;
    line-height: 1.25;
}
.article-body .external-sports-data--table th,
.article-body .external-sports-data--table td,
.external-sports-data--table th,
.external-sports-data--table td {
    min-width: 3rem;
    height: 3.15rem !important;
    padding: .65rem .5rem !important;
    border: 0 !important;
    border-bottom: 1px solid #e4e9ef !important;
    background: #fff !important;
    color: var(--ink);
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
}
.external-sports-data--table .league-table__header > th,
.external-sports-data--table .league-table__header > td {
    height: 2.75rem !important;
    background: #eef3f8 !important;
    color: #536170;
    font-size: .68rem !important;
    font-weight: 950;
    letter-spacing: .045em;
    text-transform: uppercase;
}
.external-sports-data--table .league-table__row:nth-child(odd) > td { background: #fafbfd !important; }
.external-sports-data--table .league-col-position {
    position: sticky;
    left: 0;
    z-index: 5;
    width: 2.8rem;
    min-width: 2.8rem;
    max-width: 2.8rem;
    padding-inline: .25rem !important;
    color: #6b7682;
    font-weight: 900;
    text-align: center;
}
.external-sports-data--table .league-col-team {
    position: sticky;
    left: 2.8rem;
    z-index: 4;
    width: 10.75rem;
    min-width: 10.75rem;
    max-width: 10.75rem;
    padding-left: .7rem !important;
    text-align: left;
    white-space: normal;
    font-weight: 850;
    box-shadow: .55rem 0 .8rem -.75rem rgb(15 23 42 / .55);
}
.external-sports-data--table .league-table__header .league-col-position,
.external-sports-data--table .league-table__header .league-col-team {
    z-index: 8;
    background: #eef3f8 !important;
}
.external-sports-data--table .league-col-stat,
.external-sports-data--table .league-col-gd {
    min-width: 3rem;
    font-variant-numeric: tabular-nums;
}
.external-sports-data--table .league-col-points {
    min-width: 3.6rem;
    background: #f0f6fc !important;
    color: var(--brand-dark);
    font-size: .86rem;
    font-weight: 950;
    font-variant-numeric: tabular-nums;
}
.external-sports-data--table .league-table__row--leader .league-col-position {
    background: var(--brand) !important;
    color: #fff;
}
.external-sports-data--table .league-table__row--leader .league-col-team { font-weight: 950; }
.external-sports-data__meta {
    display: block !important;
    margin: 0 !important;
    padding: .65rem .75rem !important;
    border-bottom: 1px solid var(--line);
    background: #f8fafc !important;
    color: var(--muted) !important;
    font-size: .7rem !important;
    font-weight: 750;
}
.external-sports-data__credit {
    display: block !important;
    margin: 0 !important;
    padding: .75rem !important;
    border-top: 1px solid var(--line);
    background: #f8fafc !important;
    color: var(--muted) !important;
    font-size: .7rem !important;
}
.external-sports-data__credit a { color: var(--brand) !important; font-weight: 900 !important; }

@media (max-width: 41.99rem) {
    .external-sports-data--table .external-sports-data__scroll::after { content: none; }
    .external-sports-data--table.external-sports-data--scrollable::after {
        content: "Swipe table for more stats →";
        display: block;
        margin-top: .4rem;
        padding-inline: .25rem;
        color: var(--muted);
        font-size: .68rem;
        font-weight: 800;
        text-align: right;
    }
}
@media (min-width: 42rem) {
    .header-sponsor { min-height: 4rem; }
    .header-sponsor img,
    .header-sponsor a img { max-height: 4.35rem; }
    .external-sports-data--table .league-col-team {
        width: 13rem;
        min-width: 13rem;
        max-width: 13rem;
    }
    .article-body .external-sports-data--table table,
    .external-sports-data--table table {
        min-width: 45rem;
        font-size: .84rem;
    }
}
@media (min-width: 64rem) {
    .header-sponsor img,
    .header-sponsor a img { max-height: 4.7rem; }
    .cms-sponsors--card { padding: 1.15rem; }
}


/* --------------------------------------------------------------------------
   v19 league-table and sponsor refinements
   -------------------------------------------------------------------------- */

/* The external AWS table sits inside article-body, whose generic legacy-table
   rule uses display:block. Restore true table layout here so the league table
   actually fills the complete league panel. */
.article-body .external-sports-data--table table,
.external-sports-data--table table {
    display: table !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 100% !important;
}

/* Ensure every wrapper returned by the legacy service also occupies the panel. */
.external-sports-data--table .external-sports-data__scroll,
.external-sports-data--table .external-sports-data__scroll > div,
.external-sports-data--table .external-sports-data__scroll > section,
.external-sports-data--table .external-sports-data__scroll > form,
.external-sports-data--table table,
.external-sports-data--table thead,
.external-sports-data--table tbody {
    width: 100% !important;
    max-width: none !important;
}

/* Team names are editorial content, not statistics: always align them left. */
.external-sports-data--table th.league-col-team,
.external-sports-data--table td.league-col-team,
.article-body .external-sports-data--table th.league-col-team,
.article-body .external-sports-data--table td.league-col-team {
    text-align: left !important;
}

/* On phones retain a practical minimum width and allow horizontal scrolling.
   From tablet upwards the table fills the panel without an artificial minimum. */
@media (max-width: 41.99rem) {
    .article-body .external-sports-data--table table,
    .external-sports-data--table table {
        min-width: 36rem !important;
    }
}

@media (min-width: 42rem) {
    .article-body .external-sports-data--table table,
    .external-sports-data--table table {
        min-width: 100% !important;
    }
}


/* --------------------------------------------------------------------------
   v20 native All Wales Sport fixture/result presentation
   -------------------------------------------------------------------------- */

.external-sports-data--native {
    margin-top: .65rem;
    border: 0;
    background: transparent;
    box-shadow: none;
    font-family: Arial, Helvetica, sans-serif;
}

.external-sports-data--native .external-fixture-panel {
    width: 100%;
}

.external-sports-data--native .fixture-list {
    width: 100%;
}

.external-sports-data--native .fixture-date {
    padding: .9rem;
}

.external-sports-data--native .fixture-date h3 {
    margin-bottom: .65rem;
    font-size: 1rem;
    line-height: 1.25;
}

.external-fixture-date__subtitle {
    margin: -.25rem 0 .65rem;
    color: var(--muted);
    font-size: .82rem;
    font-weight: 750;
}

.external-sports-data--native .fixture-row {
    min-width: 0;
    padding: .75rem .6rem;
}

.external-sports-data--native .fixture-row__teams {
    grid-template-columns: minmax(0, 1fr) 3.4rem minmax(0, 1fr);
    gap: .45rem;
}

.external-sports-data--native .fixture-team {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: .92rem;
}

.external-sports-data--native .fixture-qualifier {
    white-space: nowrap;
    font-size: 1rem;
}

.external-sports-data--native .external-sports-data__credit {
    margin: 0;
    padding: .8rem .9rem;
    border-top: 1px solid var(--line);
    background: #f8fafc;
    color: var(--muted);
    font-size: .76rem;
}

.external-sports-data--native .external-sports-data__credit a {
    font-weight: 900;
}

@media (max-width: 25rem) {
    .external-sports-data--native .fixture-row__teams {
        grid-template-columns: minmax(0, 1fr) 3rem minmax(0, 1fr);
        gap: .3rem;
    }

    .external-sports-data--native .fixture-team {
        font-size: .82rem;
    }

    .external-sports-data--native .fixture-qualifier {
        font-size: .9rem;
    }
}

/* Category sponsor areas use the same card language as the homepage. */
.category-page > .cms-sponsors--card {
    margin-top: 1rem;
}


/* --------------------------------------------------------------------------
   v21 menu interaction refinements
   -------------------------------------------------------------------------- */

.mobile-sport-item__link--toggle {
    width: 100%;
    justify-content: space-between;
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
    font: inherit;
}

.mobile-sport-item__link--toggle .mobile-sport-caret {
    display: inline-block;
    margin-left: .75rem;
    transition: transform .18s ease;
}

.mobile-sport-item__link--toggle[aria-expanded="true"] .mobile-sport-caret {
    transform: rotate(180deg);
}

.mobile-sport-item__link--disabled,
.desktop-sport-link--disabled {
    cursor: default;
}

.mobile-league--clickable,
.desktop-league-card--clickable,
.desktop-more-league--clickable {
    cursor: pointer;
    transition: background-color .16s ease, border-color .16s ease, transform .16s ease;
}

.mobile-league--clickable:hover,
.mobile-league--clickable:focus-visible,
.desktop-league-card--clickable:hover,
.desktop-league-card--clickable:focus-visible,
.desktop-more-league--clickable:hover,
.desktop-more-league--clickable:focus-visible {
    background: rgb(255 255 255 / .10);
    border-color: rgb(255 255 255 / .18);
    outline: none;
}

.mobile-league--clickable:focus-visible,
.desktop-league-card--clickable:focus-visible,
.desktop-more-league--clickable:focus-visible {
    box-shadow: 0 0 0 3px rgb(159 196 235 / .35);
}

.desktop-league-card__title--static,
.mobile-league__title--static,
.desktop-more-sport__title--static,
.desktop-more-league__title--static {
    cursor: default;
}

@media (min-width: 72rem) {
    .desktop-sport-link--toggle-only {
        gap: .4rem;
        padding-inline: .72rem;
    }

    .desktop-league-card--clickable:hover,
    .desktop-more-league--clickable:hover {
        transform: translateY(-1px);
    }
}


/* --------------------------------------------------------------------------
   v22 ordered sponsor pool
   -------------------------------------------------------------------------- */
@media (min-width: 64rem) {
    .homepage-sponsors__grid,
    .cms-sponsors__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Footer sponsor rows only exist when there are actual sponsors. The grid can
   wrap naturally if a sponsor article contains more than nine logos overall. */
.footer-sponsors:empty { display: none; }

/* --------------------------------------------------------------------------
   v23 compact mobile masthead
   -------------------------------------------------------------------------- */
@media (max-width: 37.5rem) {
    .site-header__masthead {
        min-height: 0;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: .35rem .45rem;
        padding-block: .5rem .4rem;
    }

    .brand {
        flex: 1 1 auto;
        min-width: 0;
        gap: .18rem;
        letter-spacing: -.055em;
    }

    .brand__county,
    .brand__sport {
        font-size: clamp(1.05rem, 5.65vw, 1.45rem);
    }

    .header-actions {
        flex: 0 0 auto;
        gap: .25rem;
        margin-left: auto;
    }

    .header-action {
        min-width: 2.45rem;
        width: 2.45rem;
        height: 2.45rem;
        padding: 0;
    }

    .header-sponsors {
        order: 3;
        flex: 0 0 100%;
        width: 100%;
        min-height: 0;
        gap: .3rem;
        padding-top: .15rem;
    }

    .header-sponsor {
        width: 100%;
        height: 3.35rem;
        min-height: 0;
        padding: .1rem .25rem;
        overflow: hidden;
    }

    .header-sponsor a {
        width: 100%;
        height: 100%;
    }

    .header-sponsor img,
    .header-sponsor a img {
        width: auto;
        max-width: min(10.75rem, 100%);
        height: auto;
        max-height: 3.15rem;
        margin-inline: auto;
        object-fit: contain;
    }
}

@media (max-width: 22.5rem) {
    .content-width {
        width: min(100% - 1rem, var(--content));
    }

    .brand__county,
    .brand__sport {
        font-size: 1.02rem;
    }

    .header-action {
        min-width: 2.3rem;
        width: 2.3rem;
        height: 2.3rem;
    }

    .header-sponsor {
        height: 3.1rem;
    }

    .header-sponsor img,
    .header-sponsor a img {
        max-height: 2.9rem;
        max-width: 10rem;
    }
}

/* --------------------------------------------------------------------------
   v23 mobile-first league table priorities
   Pos + Team + Pts stay visible; remaining statistics scroll between them.
   -------------------------------------------------------------------------- */
.external-sports-data--table .league-col-position {
    width: 2.15rem !important;
    min-width: 2.15rem !important;
    max-width: 2.15rem !important;
    padding-inline: .15rem !important;
    color: #586575 !important;
    font-size: .72rem !important;
    font-weight: 850 !important;
    background: #fff !important;
}

.external-sports-data--table .league-col-team {
    left: 2.15rem !important;
    width: 9rem !important;
    min-width: 9rem !important;
    max-width: 9rem !important;
    padding-left: .55rem !important;
    text-align: left !important;
    background: #fff !important;
}

.external-sports-data--table .league-col-points {
    position: sticky;
    right: 0;
    z-index: 6;
    width: 3.15rem !important;
    min-width: 3.15rem !important;
    max-width: 3.15rem !important;
    padding-inline: .3rem !important;
    background: #edf4fb !important;
    color: var(--brand-dark) !important;
    text-align: center !important;
    box-shadow: -.55rem 0 .8rem -.75rem rgb(15 23 42 / .55);
}

.external-sports-data--table .league-table__header .league-col-position,
.external-sports-data--table .league-table__header .league-col-team,
.external-sports-data--table .league-table__header .league-col-points {
    z-index: 9;
    background: #eef3f8 !important;
}

/* First place should not receive a different colour treatment. */
.external-sports-data--table .league-table__row--leader .league-col-position {
    background: #fff !important;
    color: #586575 !important;
}

.external-sports-data--table .league-table__row:nth-child(odd) .league-col-position,
.external-sports-data--table .league-table__row:nth-child(odd) .league-col-team {
    background: #fafbfd !important;
}

.external-sports-data--table .league-table__row:nth-child(odd) .league-col-points {
    background: #eaf2fa !important;
}

@media (max-width: 41.99rem) {
    .external-sports-data--table .league-table__header > th,
    .external-sports-data--table .league-table__header > td {
        height: 2.35rem !important;
        padding-block: .45rem !important;
        font-size: .62rem !important;
    }

    .external-sports-data--table .league-table__row > td {
        height: 2.85rem !important;
        padding-block: .5rem !important;
    }

    .external-sports-data--table .league-col-position {
        font-size: .68rem !important;
    }

    .external-sports-data--table .league-col-team {
        font-size: .78rem !important;
        line-height: 1.15;
    }

    .external-sports-data--table .league-col-points {
        font-size: .8rem !important;
    }

    .external-sports-data--table .league-col-stat,
    .external-sports-data--table .league-col-gd {
        min-width: 2.8rem !important;
        font-size: .7rem !important;
    }

    .article-body .external-sports-data--table table,
    .external-sports-data--table table {
        min-width: 35rem !important;
    }
}

@media (min-width: 42rem) {
    .external-sports-data--table .league-col-position {
        width: 2.65rem !important;
        min-width: 2.65rem !important;
        max-width: 2.65rem !important;
        font-size: .76rem !important;
    }

    .external-sports-data--table .league-col-team {
        left: 2.65rem !important;
        width: 13rem !important;
        min-width: 13rem !important;
        max-width: 13rem !important;
        font-size: .84rem !important;
    }

    .external-sports-data--table .league-col-points {
        width: 3.6rem !important;
        min-width: 3.6rem !important;
        max-width: 3.6rem !important;
    }
}


/* --------------------------------------------------------------------------
   v24 homepage share / Featured alignment
   -------------------------------------------------------------------------- */

.homepage-featured-heading {
    align-items: center;
    margin-top: .8rem;
    margin-bottom: .65rem;
}

.homepage-featured-heading .share-control {
    margin-left: auto;
}

@media (max-width: 41.99rem) {
    .homepage-featured-heading {
        gap: .6rem;
        margin-top: .65rem;
        margin-bottom: .55rem;
    }

    .homepage-featured-heading h1 {
        font-size: clamp(1.85rem, 10vw, 2.5rem);
    }

    .homepage-featured-heading .share-control__button {
        min-height: 2.35rem;
        padding-inline: .75rem;
    }

    .featured-section {
        margin-top: .35rem;
    }
}


/* --------------------------------------------------------------------------
   v25 full-panel story links
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .article-card {
        transition: none;
    }

    .article-card:hover {
        transform: none;
    }
}

/* Social account enhancements - v30 */
.social-login { display: flex; align-items: center; justify-content: center; gap: .7rem; padding-inline: 1rem; }
.social-login__mark { display: inline-grid; place-items: center; width: 1.65rem; height: 1.65rem; border-radius: 50%; background: #fff; color: #202124; border: 1px solid #d7dce1; font-size: 1rem; font-weight: 900; line-height: 1; }
.social-login--facebook .social-login__mark { border-color: #fff; color: #1877f2; }
.account-privacy-note { max-width: 30rem; margin-top: 1rem; color: var(--muted); font-size: .9rem; line-height: 1.55; }
.account-summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 0 0 1.25rem; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: .55rem; background: var(--surface-soft); }
.account-summary > div { display: grid; gap: .15rem; }
.account-summary > div span { color: var(--muted); font-size: .9rem; overflow-wrap: anywhere; }
.account-summary__provider { white-space: nowrap; color: var(--muted); font-size: .88rem; }
.notice--error { border-color: #d93838; background: #fff1f1; color: #761d1d; }
@media (max-width: 600px) {
  .account-summary { align-items: flex-start; flex-direction: column; }
  .account-summary__provider { white-space: normal; }
}
