/*
Theme Name: Podisti AVIS Forlì
Theme URI: https://www.podistiavisforli.it/
Author: Gruppo Podistico AVIS Forlì
Description: Tema del Gruppo Podistico AVIS Forlì: homepage, notizie e calendario gare. Richiede il plugin “AVIS Gare” per il calendario.
Version: 0.1.0
Requires at least: 6.5
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: podisti-avis
*/

:root {
  color-scheme: light;
  --paper: #f7f9fc;
  --paper-deep: #edf2f7;
  --ink: #172637;
  --muted: #637286;
  --red: #e30613;
  --red-dark: #b91425;
  --blue: #0069ad;
  --blue-dark: #084d7c;
  --blue-soft: #e5f1f9;
  --red-soft: #fbe8ea;
  --line: #d7e1ea;
  --display: "Segoe UI", "Arial", sans-serif;
  --body: "Segoe UI", "Arial", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--body); font-size: 18px; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input { font: inherit; }
.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; }
.skip-link { position: absolute; z-index: 20; top: 8px; left: 8px; padding: 12px 16px; background: var(--ink); color: white; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }

.site-header { position: sticky; z-index: 10; top: 0; display: flex; align-items: center; justify-content: space-between; min-height: 96px; padding: 0 clamp(22px, 6.3vw, 100px); background: rgb(255 255 255 / 96%); border-bottom: 1px solid rgb(23 38 55 / 8%); backdrop-filter: blur(14px); }
.brand { display: inline-flex; flex: 0 0 auto; align-items: center; text-decoration: none; }
.brand-logo { display: block; width: 205px; height: 90px; object-fit: cover; object-position: center top; }
.site-nav { display: flex; align-items: center; gap: clamp(24px, 3vw, 48px); }
.site-nav a { font-size: 18px; font-weight: 600; text-decoration: none; transition: color .2s ease; }
.site-nav a:hover, .footer-link:hover { color: var(--red); }
.site-nav a[aria-current="page"]:not(.nav-cta) { color: var(--red); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 8px; }
.site-nav .nav-cta { padding: 11px 16px; border: 1px solid var(--blue-dark); border-radius: 2px; }
.site-nav .nav-cta span { padding-left: 9px; color: var(--red); }
.menu-toggle { display: none; }

.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(400px, .8fr); gap: 6vw; align-items: center; min-height: 570px; padding: 68px clamp(22px, 10.4vw, 160px) 76px; overflow: hidden; }
.hero::before { position: absolute; top: -220px; right: 3%; width: 680px; height: 680px; border: 1px solid #e1ebf3; border-radius: 50%; content: ""; }
.hero::after { position: absolute; top: -130px; right: 10%; width: 500px; height: 500px; border: 1px solid #e1ebf3; border-radius: 50%; content: ""; }
.hero-copy, .next-race { position: relative; z-index: 1; }
.eyebrow { margin: 0 0 19px; color: var(--muted); font-size: 17px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.live-dot { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 4px rgb(227 6 19 / 12%); }
h1, h2, p { margin-top: 0; }
h1, .section-heading h2, .club-copy h2 { font-family: var(--display); font-weight: 700; letter-spacing: -.075em; }
h1 { max-width: 650px; margin-bottom: 22px; font-size: clamp(58px, 7.3vw, 104px); line-height: .96; }
h1 em, .section-heading h2 em, .club-copy h2 em { color: var(--red); font-weight: 500; }
.hero-intro { max-width: 480px; margin-bottom: 27px; color: var(--muted); font-size: 18px; line-height: 1.75; }
.button { display: inline-flex; align-items: center; justify-content: space-between; gap: 30px; min-height: 47px; padding: 0 17px; border: 1px solid transparent; font-size: 18px; font-weight: 700; text-decoration: none; transition: background .2s ease, transform .2s ease; }
.button:hover { transform: translateY(-2px); }
.button-dark { background: var(--blue-dark); color: white; }
.button-dark:hover { background: var(--red); }
.button span { font-size: 17px; font-weight: 400; }
.hero-proof { display: flex; align-items: center; gap: 13px; margin-top: 34px; color: var(--muted); font-size: 18px; }
.hero-proof strong { color: var(--ink); }

.next-race { max-width: 430px; width: 100%; justify-self: center; padding: 22px 24px 20px; overflow: hidden; background: var(--blue-dark); color: white; box-shadow: 0 20px 50px rgb(8 77 124 / 16%); }
.next-race-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 17px; border-bottom: 1px solid rgb(255 255 255 / 22%); }
.next-race .eyebrow { margin: 0; color: rgb(255 255 255 / 75%); font-size: 16px; }
.next-count { flex: 0 0 auto; padding: 6px 8px; background: var(--red); color: white; font-size: 16px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.race-date { display: flex; align-items: baseline; gap: 9px; padding: 15px 0 12px; color: rgb(255 255 255 / 70%); font-size: 16px; font-weight: 700; letter-spacing: .1em; }
.race-date strong { color: white; font-family: var(--display); font-size: 38px; letter-spacing: -.06em; line-height: 1; }
.next-race-details { position: relative; z-index: 1; }
.race-time { margin-bottom: 7px; color: #b9def5; font-size: 17px; font-weight: 700; }
.next-race h2 { margin: 0 0 12px; font-family: var(--display); font-size: 29px; font-weight: 700; letter-spacing: -.055em; line-height: 1.08; }
.race-place { margin-bottom: 17px; color: rgb(255 255 255 / 75%); font-size: 17px; line-height: 1.75; }
.race-place span { color: #b9def5; }
.next-race-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 13px; border-top: 1px solid rgb(255 255 255 / 22%); color: white; font-size: 17px; font-weight: 600; }
.next-race-footer a { text-decoration: none; }
.next-race-footer a:hover { color: #b9def5; }
.next-race-footer a span { padding-left: 5px; }
.route-mark { position: absolute; width: 115px; height: 115px; border: 1px solid rgb(255 255 255 / 9%); border-radius: 50%; }
.route-mark-one { right: -52px; bottom: -50px; }
.route-mark-two { right: -27px; bottom: -75px; }

.ticker { display: flex; align-items: center; justify-content: center; gap: clamp(15px, 3vw, 42px); min-height: 60px; padding: 14px 20px; overflow: hidden; background: var(--red); color: white; }
.ticker span { flex: 0 0 auto; font-size: 17px; font-weight: 600; letter-spacing: .04em; }
.ticker i { color: #b9def5; font-size: 18px; font-style: normal; }

.safeguarding-section { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.2fr) minmax(0, .9fr); gap: clamp(28px, 4vw, 64px); align-items: start; padding: 56px clamp(22px, 10.4vw, 160px); border-bottom: 1px solid var(--line); background: white; }
.safeguarding-intro .eyebrow { margin-bottom: 14px; color: var(--red); }
.safeguarding-intro h2 { margin: 0; font-family: var(--display); font-size: clamp(34px, 3.6vw, 48px); font-weight: 700; letter-spacing: -.07em; line-height: 1.04; }
.safeguarding-intro h2 em { color: var(--red); font-weight: 500; }
.safeguarding-copy p { margin: 0; color: var(--muted); font-size: 18px; line-height: 1.75; }
.safeguarding-copy .safeguarding-contact { margin-top: 14px; color: var(--ink); font-weight: 600; }
.safeguarding-contact a { color: var(--blue-dark); text-underline-offset: 4px; overflow-wrap: anywhere; }
.safeguarding-contact a:hover { color: var(--red); }
.safeguarding-docs { margin: 0 0 20px; padding: 0; list-style: none; }
.safeguarding-docs li { border-bottom: 1px solid var(--line); }
.safeguarding-docs a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; font-size: 17px; font-weight: 600; text-decoration: none; }
.safeguarding-docs a:hover { color: var(--red); }
.safeguarding-docs span { flex: 0 0 auto; padding: 3px 6px; background: var(--red-soft); color: var(--red-dark); font-size: 13px; font-weight: 700; letter-spacing: .08em; }

.section-wrap { padding: 100px clamp(22px, 10.4vw, 160px) 96px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 40px; }
.section-heading .eyebrow, .club-copy .eyebrow { margin-bottom: 14px; }
.section-heading h1, .section-heading h2, .club-copy h2 { margin-bottom: 0; font-size: clamp(42px, 5.2vw, 66px); line-height: 1.02; }
.section-note { max-width: 280px; margin-bottom: 5px; color: var(--muted); font-size: 18px; line-height: 1.8; }
.calendar-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 46px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.filter-group { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-button { padding: 9px 13px; border: 1px solid transparent; border-radius: 2px; background: transparent; color: var(--muted); cursor: pointer; font-size: 17px; font-weight: 600; transition: all .2s ease; }
.filter-button:hover { border-color: var(--line); color: var(--ink); }
.filter-button.is-active { background: var(--blue-dark); color: white; }
.filter-button span { display: inline-grid; min-width: 17px; height: 17px; margin-left: 4px; place-items: center; border-radius: 50%; background: rgb(255 255 255 / 18%); font-size: 16px; }
.filter-button:not(.is-active) span { background: var(--paper-deep); color: var(--muted); }
.search-field { display: flex; align-items: center; gap: 8px; width: 206px; padding: 8px 0; border-bottom: 1px solid #c6d6e3; }
.search-field svg { width: 16px; height: 16px; fill: none; stroke: var(--muted); stroke-width: 1.6; }
.search-field input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 17px; }
.search-field input::placeholder { color: #7d8b9b; }
.search-field:focus-within { border-color: var(--red); }
.results-note { min-height: 13px; margin: 16px 0; color: var(--muted); font-size: 17px; }
.race-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.race-card { display: flex; min-height: 290px; flex-direction: column; padding: 19px 19px 16px; border: 1px solid var(--line); background: white; transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease; }
.race-card:hover { transform: translateY(-4px); border-color: #a9c1d4; box-shadow: 0 14px 24px rgb(8 77 124 / 7%); }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.card-date { display: grid; gap: 1px; color: var(--muted); font-size: 16px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.card-date strong { color: var(--ink); font-family: var(--display); font-size: 29px; letter-spacing: -.06em; line-height: 1.1; }
.card-badges { display: flex; flex-wrap: wrap; justify-content: end; gap: 5px; }
.badge { padding: 6px 7px; background: var(--blue-soft); color: var(--blue-dark); font-size: 16px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.badge-social { background: var(--red-soft); color: var(--red-dark); }
.race-card h3 { margin: 23px 0 7px; font-family: var(--display); font-size: 21px; font-weight: 700; letter-spacing: -.05em; line-height: 1.18; }
.card-location { display: flex; align-items: flex-start; gap: 6px; margin-bottom: 14px; color: var(--muted); font-size: 17px; line-height: 1.55; }
.card-location svg { flex: 0 0 13px; width: 13px; height: 13px; margin-top: 1px; fill: none; stroke: var(--red); stroke-width: 1.5; }
.distance-list { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 14px; }
.distance-list span { padding: 5px 7px; border: 1px solid var(--line); color: var(--ink); font-size: 16px; font-weight: 600; }
.card-bottom { display: flex; align-items: end; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.entry-fee { display: grid; gap: 3px; color: var(--muted); font-size: 16px; line-height: 1.35; }
.entry-fee strong { color: var(--ink); font-size: 18px; }
.card-links { display: flex; flex-wrap: wrap; justify-content: end; gap: 11px; }
.card-links a { color: var(--ink); font-size: 16px; font-weight: 700; text-decoration-color: #b8c8d6; text-underline-offset: 3px; }
.card-links a:hover { color: var(--red); }
.card-links a span { padding-left: 3px; color: var(--red); }
.empty-state { padding: 48px 15px; color: var(--muted); text-align: center; }
.empty-state > span { color: var(--red); font-size: 30px; }
.empty-state p { margin: 8px 0; font-size: 18px; }
.text-button { padding: 4px; border: 0; background: none; color: var(--red); cursor: pointer; font-size: 18px; text-decoration: underline; text-underline-offset: 3px; }
.calendar-footnote { margin: 19px 0 0; color: var(--muted); font-size: 16px; line-height: 1.6; }

.news-section { border-bottom: 1px solid var(--line); background: white; }
.news-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(32px, 4.4vw, 64px); margin-top: 46px; }
.news-card { position: relative; }
.news-link { text-decoration: none; transition: color .2s ease; }
.news-link::after { position: absolute; z-index: 2; inset: 0; content: ""; }
.news-link:focus-visible { outline: 0; }
.news-link:focus-visible::after { outline: 3px solid var(--red); outline-offset: 3px; }
.news-card:hover .news-link { color: var(--red); }
.news-featured { display: flex; flex-direction: column; border: 1px solid var(--line); background: white; transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease; }
.news-featured:hover { transform: translateY(-4px); border-color: #a9c1d4; box-shadow: 0 14px 24px rgb(8 77 124 / 7%); }
.news-photo { position: relative; margin: 0; overflow: hidden; background: var(--blue-dark); }
.news-photo img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; object-position: 50% 35%; transition: transform .4s ease; }
.news-featured:hover .news-photo img { transform: scale(1.03); }
.news-photo figcaption { position: absolute; right: 0; bottom: 0; left: 0; padding: 40px 36px 14px; background: linear-gradient(transparent, rgb(8 40 66 / 85%)); color: white; font-size: 16px; font-weight: 600; }
.news-featured-body { display: flex; flex: 1; flex-direction: column; padding: 26px 36px 30px; }
.news-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-bottom: 14px; color: var(--muted); font-size: 16px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.news-tag { padding: 6px 8px; background: var(--red-soft); color: var(--red-dark); }
.news-featured h3 { margin: 0 0 12px; font-family: var(--display); font-size: clamp(26px, 2.3vw, 32px); letter-spacing: -.05em; line-height: 1.12; }
.news-excerpt { margin-bottom: 20px; color: var(--muted); font-size: 18px; line-height: 1.7; }
.news-read { margin-top: auto; font-size: 17px; font-weight: 700; }
.news-read span { padding-left: 6px; color: var(--red); }
.news-list { display: flex; flex-direction: column; }
.news-list-label { margin-bottom: 8px; }
.news-item { display: grid; grid-template-columns: 128px minmax(0, 1fr); align-items: center; gap: 22px; padding: 20px 0; border-top: 1px solid var(--line); }
.news-item:last-of-type { margin-bottom: 26px; border-bottom: 1px solid var(--line); }
.news-thumb { display: block; width: 128px; height: 128px; overflow: hidden; background: var(--paper-deep); }
.news-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.news-item:hover .news-thumb img { transform: scale(1.05); }
.news-item time { color: var(--muted); font-size: 16px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.news-item h3 { margin: 6px 0; font-family: var(--display); font-size: 22px; letter-spacing: -.04em; line-height: 1.2; }
.news-item p { margin: 0; color: var(--muted); font-size: 17px; line-height: 1.5; }
.news-all { display: inline-flex; align-self: flex-start; align-items: center; gap: 10px; margin-top: auto; padding: 12px 16px; border: 1px solid var(--blue-dark); color: var(--ink); font-size: 18px; font-weight: 700; text-decoration: none; transition: background .2s ease, color .2s ease; }
.news-all:hover { background: var(--blue-dark); color: white; }
.news-all span { color: var(--red); }
.news-all:hover span { color: #ff9da5; }

.club-section { display: grid; grid-template-columns: .7fr 1.25fr .8fr; align-items: center; gap: 5vw; padding: 73px clamp(22px, 10.4vw, 160px); background: var(--blue-dark); color: white; }
.club-stamp { display: grid; width: 150px; height: 150px; justify-self: center; place-content: center; border: 1px solid rgb(255 255 255 / 46%); border-radius: 50%; text-align: center; transform: rotate(-12deg); }
.club-stamp span { font-size: 16px; font-weight: 700; letter-spacing: .25em; }
.club-stamp strong { font-family: var(--display); font-size: 61px; letter-spacing: -.1em; line-height: 1.02; }
.club-copy .eyebrow { color: rgb(255 255 255 / 75%); }
.club-copy h2 { font-size: clamp(40px, 4.5vw, 58px); }
.club-copy h2 em { color: #ff9da5; }
.club-copy > p:not(.eyebrow, .club-social) { max-width: 400px; margin: 17px 0 20px; color: rgb(255 255 255 / 80%); font-size: 18px; line-height: 1.8; }
.club-social { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 22px 0 0; color: rgb(255 255 255 / 75%); font-size: 15px; }
.club-social a { font-weight: 700; text-decoration-color: rgb(255 255 255 / 60%); text-underline-offset: 4px; }
.club-social a:hover { text-decoration-color: white; }
.club-social a span { padding-left: 3px; color: #ff9da5; }
.button-light { min-height: 42px; background: white; color: var(--ink); }
.button-light:hover { background: var(--blue-soft); }
.club-aside { padding-left: 22px; border-left: 1px solid rgb(255 255 255 / 35%); }
.club-aside-number { display: block; font-family: var(--display); font-size: 70px; font-weight: 700; letter-spacing: -.09em; line-height: 1; }
.club-aside-number span { margin-left: 6px; color: #ff9da5; font-size: 38px; letter-spacing: -.04em; }
.club-aside p { margin: 6px 0 21px; color: rgb(255 255 255 / 75%); font-size: 17px; line-height: 1.7; }
.club-aside a { font-size: 16px; font-weight: 700; text-decoration-color: rgb(255 255 255 / 60%); text-underline-offset: 4px; }
.club-aside a span { padding-left: 5px; color: #ff9da5; }

.site-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 92px; padding: 20px clamp(22px, 6.3vw, 100px); }
.brand-footer .brand-logo { width: 175px; height: 76px; }
.site-footer p { margin: 0; color: var(--muted); font-size: 16px; }
.site-footer p span { padding-left: 8px; color: #aaa99f; }
.footer-link { color: var(--ink); font-size: 16px; font-weight: 700; text-decoration: none; }
.footer-link span { padding-left: 5px; color: var(--red); }

:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }

@media (min-width: 1500px) {
  .hero { padding-right: max(160px, calc((100vw - 1200px) / 2)); padding-left: max(160px, calc((100vw - 1200px) / 2)); }
}

@media (max-width: 950px) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(300px, .78fr); gap: 30px; padding-right: 7vw; padding-left: 7vw; }
  .hero h1 { font-size: clamp(56px, 8vw, 78px); }
  .section-wrap, .club-section, .safeguarding-section { padding-right: 7vw; padding-left: 7vw; }
  .safeguarding-section { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .safeguarding-intro { grid-column: 1 / -1; }
  .race-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .news-grid { grid-template-columns: 1fr; }
  .club-section { grid-template-columns: .65fr 1.3fr; }
  .club-aside { grid-column: 2; display: flex; align-items: center; gap: 15px; padding: 15px 0 0; border-top: 1px solid rgb(255 255 255 / 35%); border-left: 0; }
  .club-aside-number { font-size: 50px; }
  .club-aside p { margin: 0; }
  .club-aside a { margin-left: auto; }
}

@media (max-width: 680px) {
  html { scroll-padding-top: 70px; }
  .site-header { min-height: 68px; padding: 0 20px; }
  .brand-logo { width: 150px; height: 66px; }
  .menu-toggle { display: flex; align-items: center; gap: 9px; padding: 9px 0 9px 9px; border: 0; background: none; color: var(--ink); cursor: pointer; font-size: 17px; font-weight: 700; }
  .menu-toggle-icon { display: grid; gap: 4px; width: 18px; }
  .menu-toggle-icon i { height: 1px; background: var(--ink); transition: transform .2s ease; }
  .menu-toggle[aria-expanded="true"] .menu-toggle-icon i:first-child { transform: translateY(2.5px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] .menu-toggle-icon i:last-child { transform: translateY(-2.5px) rotate(-45deg); }
  .site-nav { position: absolute; top: calc(100% + 1px); right: 0; left: 0; display: none; align-items: stretch; gap: 0; padding: 8px 20px 18px; border-bottom: 1px solid var(--line); background: var(--paper); }
  .site-nav.is-open { display: flex; flex-direction: column; }
  .site-nav a { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .site-nav .nav-cta { align-self: flex-start; margin-top: 10px; padding: 11px 14px; border: 1px solid var(--ink); }
  .hero { grid-template-columns: 1fr; gap: 37px; min-height: auto; padding: 61px 22px 55px; }
  .hero::before { top: -210px; right: -430px; }
  .hero::after { top: -150px; right: -330px; }
  .hero h1 { font-size: clamp(57px, 15vw, 82px); }
  .hero-intro { max-width: 365px; font-size: 18px; }
  .hero-proof { margin-top: 25px; }
  .next-race { max-width: none; padding: 18px 19px 17px; }
  .next-race h2 { font-size: 26px; }
  .ticker { justify-content: flex-start; gap: 17px; min-height: 48px; }
  .ticker span { font-size: 16px; }
  .ticker span:nth-of-type(n+3), .ticker i:nth-of-type(n+3) { display: none; }
  .section-wrap { padding: 72px 22px 66px; }
  .safeguarding-section { grid-template-columns: 1fr; gap: 22px; padding: 44px 22px; }
  .safeguarding-intro h2 { font-size: 38px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 15px; }
  .section-heading h1, .section-heading h2, .club-copy h2 { font-size: 50px; }
  .section-note { max-width: 360px; font-size: 18px; }
  .calendar-toolbar { align-items: stretch; flex-direction: column; gap: 13px; margin-top: 29px; }
  .filter-group { gap: 3px; }
  .filter-button { padding: 9px 10px; font-size: 16px; }
  .search-field { width: 100%; }
  .race-grid { grid-template-columns: 1fr; gap: 10px; }
  .race-card { min-height: 253px; padding: 17px; }
  .race-card h3 { margin-top: 17px; font-size: 20px; }
  .news-grid { gap: 36px; margin-top: 30px; }
  .news-photo figcaption { padding: 32px 20px 12px; }
  .news-featured-body { padding: 20px 20px 24px; }
  .news-featured h3 { font-size: 25px; }
  .news-item { grid-template-columns: 96px minmax(0, 1fr); align-items: start; gap: 16px; padding: 18px 0; }
  .news-thumb { width: 96px; height: 96px; }
  .news-item h3 { font-size: 20px; }
  .club-section { grid-template-columns: 1fr; gap: 30px; padding: 52px 22px; }
  .club-stamp { width: 114px; height: 114px; justify-self: start; }
  .club-stamp strong { font-size: 47px; }
  .club-aside { grid-column: auto; flex-wrap: wrap; gap: 10px 15px; }
  .club-aside p { flex: 1; min-width: 125px; }
  .club-aside a { width: 100%; margin: 0; }
  .site-footer { align-items: flex-start; flex-wrap: wrap; min-height: 0; padding: 23px 22px; }
  .site-footer p { order: 3; width: 100%; line-height: 1.8; }
  .site-footer p span { padding-left: 0; }
}

/* WordPress: shared */
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.admin-bar .site-header { top: 32px; }
.button-outline { border-color: var(--blue-dark); color: var(--ink); }
.button-outline:hover { background: var(--blue-dark); color: white; }
.button-outline span { color: var(--red); }
.button-outline:hover span { color: #ff9da5; }
.button-red { background: var(--red); color: white; }
.button-red:hover { background: var(--red-dark); }
.button-ghost { border-color: rgb(255 255 255 / 45%); color: white; }
.button-ghost:hover { border-color: white; }
.calendar-more { margin-top: 30px; }
.site-footer p { line-height: 1.6; }
.site-footer p span { display: block; padding-left: 0; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer-nav:empty { display: none; }
.footer-nav a { color: var(--ink); font-size: 16px; font-weight: 700; text-decoration: none; }
.footer-nav a:hover { color: var(--red); }

.page-hero { position: relative; margin-bottom: 46px; }
.page-hero h1 { max-width: 760px; margin-bottom: 0; font-size: clamp(46px, 6vw, 84px); line-height: 1; }
.page-intro { max-width: 520px; margin: 22px 0 0; color: var(--muted); font-size: 18px; line-height: 1.75; }
.back-link { display: inline-flex; gap: 8px; margin-bottom: 34px; color: var(--muted); font-size: 16px; font-weight: 700; letter-spacing: .09em; text-decoration: none; text-transform: uppercase; }
.back-link:hover { color: var(--red); }
.back-link span { color: var(--red); }
.notice { margin: 0 0 24px; padding: 14px 18px; border-left: 3px solid var(--red); background: var(--red-soft); color: var(--red-dark); font-size: 17px; font-weight: 600; line-height: 1.5; }

/* News */
.news-page .news-grid { margin-top: 0; }
.news-more { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 48px; margin-top: 40px; border-bottom: 1px solid var(--line); }
.news-more .news-item:last-of-type { margin-bottom: 0; border-bottom: 0; }
.news-thumb-empty { display: grid; place-items: center; background: var(--blue-soft); color: var(--red); font-size: 34px; }
.news-photo-empty { display: grid; aspect-ratio: 16 / 9; place-items: center; }
.news-photo-empty::before, .news-photo-empty::after { position: absolute; border: 1px solid rgb(255 255 255 / 12%); border-radius: 50%; content: ""; }
.news-photo-empty::before { right: -60px; bottom: -120px; width: 320px; height: 320px; }
.news-photo-empty::after { right: 30px; bottom: -160px; width: 260px; height: 260px; }
.news-photo-mark { color: #ff9da5; font-size: 72px; }
.news-photo img.is-portrait, .news-thumb img.is-portrait { object-position: 50% 0; }

/* Articles and pages */
.article { padding-right: max(7vw, calc((100% - 860px) / 2)); padding-left: max(7vw, calc((100% - 860px) / 2)); }
.article-header { margin-bottom: 36px; }
.article-header h1 { max-width: none; margin: 0; font-size: clamp(40px, 5vw, 64px); letter-spacing: -.06em; line-height: 1.04; }
.article-lead { margin: 22px 0 0; color: var(--muted); font-size: 21px; line-height: 1.65; }
.article-photo { margin: 0 0 40px; }
.article-photo img { display: block; width: 100%; height: auto; }
.article-photo figcaption { margin-top: 10px; color: var(--muted); font-size: 16px; }
.prose { font-size: 19px; line-height: 1.8; overflow-wrap: break-word; }
.prose > * { margin-top: 0; margin-bottom: 1.15em; }
.prose > :last-child { margin-bottom: 0; }
.prose h2 { margin: 1.8em 0 .6em; font-size: 32px; letter-spacing: -.05em; line-height: 1.15; }
.prose h3 { margin: 1.6em 0 .5em; font-size: 24px; letter-spacing: -.03em; line-height: 1.25; }
.prose a { color: var(--blue-dark); text-decoration-color: rgb(8 77 124 / 35%); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { color: var(--red); }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li + li { margin-top: .4em; }
.prose li::marker { color: var(--red); }
.prose blockquote { margin: 1.6em 0; padding: 4px 0 4px 24px; border-left: 3px solid var(--red); font-size: 22px; }
.prose img { max-width: 100%; height: auto; }
.prose figure { margin: 1.8em 0; }
.prose figcaption, .wp-element-caption { margin-top: 8px; color: var(--muted); font-size: 15px; }
.prose hr { margin: 2em 0; border: 0; border-top: 1px solid var(--line); }
.prose table { width: 100%; border-collapse: collapse; font-size: 17px; }
.prose th, .prose td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.prose .wp-block-button__link { padding: 12px 18px; border-radius: 0; background: var(--blue-dark); color: white; font-size: 18px; font-weight: 700; text-decoration: none; }
.prose .wp-block-button__link:hover { background: var(--red); color: white; }
.prose .wp-block-file { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 14px 16px; border: 1px solid var(--line); background: white; }
.prose .wp-block-file__button { border-radius: 0; background: var(--blue-dark); color: white; text-decoration: none; }
.prose::after { display: table; clear: both; content: ""; }
.prose .wp-caption { max-width: 100%; }
.prose .wp-caption-text { margin: 8px 0 0; color: var(--muted); font-size: 15px; line-height: 1.5; }
.prose .link-logo { display: inline-block; margin: 0 14px 14px 0; vertical-align: middle; }
.prose td { vertical-align: top; }
.prose thead th { border-bottom: 2px solid var(--blue-dark); color: var(--blue-dark); font-size: 15px; letter-spacing: .08em; text-transform: uppercase; }
.aligncenter { display: block; margin-right: auto; margin-left: auto; }
.alignleft { float: left; margin: .3em 1.5em 1em 0; }
.alignright { float: right; margin: .3em 0 1em 1.5em; }
.post-navigation { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); }
.post-navigation .nav-links { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.post-navigation .nav-next { grid-column: 2; text-align: right; }
.post-navigation a { display: grid; gap: 6px; text-decoration: none; }
.post-nav-label { color: var(--muted); font-size: 15px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.post-nav-title { font-size: 20px; font-weight: 700; letter-spacing: -.03em; line-height: 1.3; }
.post-navigation a:hover .post-nav-title { color: var(--red); }

.pagination { margin-top: 40px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; }
.pagination .page-numbers { display: inline-grid; min-width: 44px; min-height: 44px; padding: 0 14px; place-items: center; border: 1px solid var(--line); background: white; font-size: 17px; font-weight: 700; text-decoration: none; }
.pagination .page-numbers.current { border-color: var(--blue-dark); background: var(--blue-dark); color: white; }
.pagination a.page-numbers:hover { border-color: var(--red); color: var(--red); }
.pagination .dots { border: 0; background: none; }

/* Calendar */
.calendar-tabs { display: flex; margin-top: 46px; border-bottom: 1px solid var(--line); }
.calendar-tabs a { margin-bottom: -1px; padding: 12px 18px; border-bottom: 3px solid transparent; color: var(--muted); font-size: 18px; font-weight: 700; text-decoration: none; }
.calendar-tabs a:hover { color: var(--ink); }
.calendar-tabs a[aria-current="page"] { border-color: var(--red); color: var(--ink); }
.calendar-page .calendar-toolbar { margin-top: 22px; }
.calendar-month-group + .calendar-month-group { margin-top: 40px; }
.calendar-month { display: flex; align-items: center; gap: 16px; margin: 0 0 16px; color: var(--blue-dark); font-size: 17px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.calendar-month::after { flex: 1; height: 1px; background: var(--line); content: ""; }
.race-card { position: relative; }
.race-card h3 a { text-decoration: none; }
.race-card h3 a::after { position: absolute; inset: 0; content: ""; }
.race-card:hover h3 a, .race-card h3 a:focus-visible { color: var(--red); }
.race-card:focus-within { border-color: #a9c1d4; }
.race-card .card-links a { position: relative; z-index: 1; }
.race-card.is-past .card-date strong { color: var(--muted); }

/* Race detail */
.race-detail-header { margin-bottom: 40px; }
.race-detail-header .card-badges { justify-content: flex-start; margin-bottom: 18px; }
.race-detail-header h1 { max-width: 900px; margin: 0; font-size: clamp(44px, 6vw, 84px); line-height: 1; }
.race-detail-when { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 20px 0 0; color: var(--muted); font-size: 19px; font-weight: 600; }
.race-detail-when span { color: var(--red); }
.race-detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); gap: clamp(32px, 5vw, 72px); align-items: start; }
.race-detail-main .article-lead { margin: 0 0 24px; }
.race-poster { margin: 32px 0 0; }
.race-poster img { display: block; width: auto; max-width: 100%; height: auto; max-height: 720px; border: 1px solid var(--line); }
.race-facts { position: sticky; top: 120px; overflow: hidden; padding: 22px 24px 24px; background: var(--blue-dark); color: white; box-shadow: 0 20px 50px rgb(8 77 124 / 16%); }
.race-facts > :not(.route-mark) { position: relative; z-index: 1; }
.race-facts .race-date { align-items: center; padding: 0 0 16px; border-bottom: 1px solid rgb(255 255 255 / 22%); }
.race-facts .next-count { margin-left: auto; letter-spacing: .08em; }
.race-facts-list { margin: 0; }
.race-facts-list > div { padding: 16px 0; border-bottom: 1px solid rgb(255 255 255 / 22%); }
.race-facts-list dt { margin-bottom: 6px; color: rgb(255 255 255 / 70%); font-size: 15px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.race-facts-list dd { margin: 0; font-size: 19px; font-weight: 700; line-height: 1.45; }
.race-facts-list dd span { display: block; color: rgb(255 255 255 / 75%); font-size: 17px; font-weight: 400; }
.race-facts .distance-list { margin: 0; }
.race-facts .distance-list span { display: inline-block; border-color: rgb(255 255 255 / 35%); color: white; font-size: 16px; font-weight: 600; }
.race-actions { display: grid; gap: 10px; margin-top: 20px; }
.race-actions .button { width: 100%; }
.not-found-links { display: flex; flex-wrap: wrap; gap: 12px; }

/* Photos */
.photo-years { position: relative; overflow-x: auto; border-bottom: 0; box-shadow: inset 0 -1px var(--line); scrollbar-width: none; }
.photo-years::-webkit-scrollbar { display: none; }
.photo-years a { flex: 0 0 auto; margin-bottom: 0; }
.photo-toolbar { margin-top: 22px; }
.photo-toolbar .search-field { width: 260px; }
.photo-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.photo-card { position: relative; display: flex; flex-direction: column; border: 1px solid var(--line); background: white; transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease; }
.photo-card:hover { transform: translateY(-4px); border-color: #a9c1d4; box-shadow: 0 14px 24px rgb(8 77 124 / 7%); }
.photo-card:focus-within { border-color: #a9c1d4; }
.photo-card-cover { position: relative; margin: 0; overflow: hidden; aspect-ratio: 4 / 3; background: var(--blue-soft); }
.photo-card-cover img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.photo-card:hover .photo-card-cover img { transform: scale(1.03); }
.photo-count { position: absolute; right: 10px; bottom: 10px; padding: 5px 8px; background: rgb(9 20 31 / 75%); color: white; font-size: 15px; font-weight: 700; letter-spacing: .04em; }
.photo-card-body { display: flex; flex: 1; flex-direction: column; padding: 16px 19px 18px; }
.photo-card-date { color: var(--muted); font-size: 15px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.photo-card h3 { margin: 8px 0 6px; font-family: var(--display); font-size: 21px; font-weight: 700; letter-spacing: -.05em; line-height: 1.18; }
.photo-card h3 a { text-decoration: none; }
.photo-card h3 a::after { position: absolute; inset: 0; content: ""; }
.photo-card:hover h3 a, .photo-card h3 a:focus-visible { color: var(--red); }
.photo-card-meta { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.5; }
.photos-section { border-top: 1px solid var(--line); background: white; }
.photos-section .photo-cards { margin-top: 46px; }
.race-photos { margin-top: 64px; }
.race-photos .photo-cards { margin-top: 0; }

.photo-service-header { margin-bottom: 36px; }
.photo-service-header h1 { max-width: 900px; margin: 0; font-size: clamp(40px, 5.4vw, 76px); line-height: 1.02; }
.photo-facts { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 20px 0 0; padding: 0; color: var(--muted); font-size: 18px; font-weight: 600; list-style: none; }
.photo-facts li { display: inline-flex; align-items: center; gap: 7px; }
.photo-facts svg { width: 15px; height: 15px; fill: none; stroke: var(--red); stroke-width: 1.5; }
.photo-race-link { margin-top: 24px; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; }
.photo-thumb { display: block; overflow: hidden; aspect-ratio: 1; background: var(--paper-deep); cursor: zoom-in; }
.photo-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.photo-thumb:hover img { transform: scale(1.04); }
.photo-service .calendar-footnote { margin-top: 24px; }

html.has-lightbox { overflow: hidden; }
.lightbox { width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 0; overflow: hidden; border: 0; background: rgb(9 20 31 / 96%); color: white; }
.lightbox[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.lightbox::backdrop { background: #09141f; }
.lightbox-bar { display: flex; align-items: center; gap: 18px; padding: 10px 12px 10px 22px; }
.lightbox-counter { margin: 0 auto 0 0; font-size: 16px; font-weight: 700; letter-spacing: .09em; font-variant-numeric: tabular-nums; }
.lightbox-original { color: white; font-size: 16px; font-weight: 700; text-decoration-color: rgb(255 255 255 / 50%); text-underline-offset: 4px; }
.lightbox-original:hover { color: #ff9da5; }
.lightbox-close, .lightbox-nav { display: grid; place-items: center; padding: 0; border: 0; background: rgb(255 255 255 / 10%); color: white; cursor: pointer; transition: background .2s ease, opacity .2s ease; }
.lightbox-close { width: 44px; height: 44px; }
.lightbox-close:hover, .lightbox-nav:hover:not(:disabled) { background: var(--red); }
.lightbox svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.lightbox-figure { display: grid; grid-template-rows: minmax(0, 1fr) auto; place-items: center; gap: 10px; min-height: 0; margin: 0; padding: 0 72px 18px; touch-action: pinch-zoom; user-select: none; }
.lightbox.is-zoomed .lightbox-figure { touch-action: auto; }
.lightbox-image { display: block; width: auto; height: auto; min-width: 0; max-width: 100%; min-height: 0; max-height: 100%; transition: opacity .2s ease; }
.lightbox.is-loading .lightbox-image { opacity: .35; }
.lightbox-caption { max-width: 760px; color: rgb(255 255 255 / 80%); font-size: 16px; line-height: 1.5; text-align: center; }
.lightbox-nav { position: absolute; top: 50%; width: 52px; height: 72px; margin-top: -36px; }
.lightbox-prev { left: 10px; }
.lightbox-next { right: 10px; }
.lightbox-nav:disabled { opacity: .2; cursor: default; }

@media (max-width: 950px) {
  .race-detail-grid { grid-template-columns: 1fr; }
  .race-facts { position: relative; top: auto; order: -1; }
  .news-more { grid-template-columns: 1fr; }
  .photo-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 782px) {
  .admin-bar .site-header { top: 46px; }
}

@media (max-width: 680px) {
  .page-hero { margin-bottom: 30px; }
  .article { padding-right: 22px; padding-left: 22px; }
  .page-hero h1 { font-size: 48px; }
  .calendar-tabs { margin-top: 29px; }
  .calendar-tabs a { padding: 12px; font-size: 17px; }
  .article-header h1, .race-detail-header h1 { font-size: 40px; }
  .article-lead { font-size: 19px; }
  .prose { font-size: 18px; }
  .prose .alignleft, .prose .alignright { display: block; float: none; margin: 0 0 1.15em; }
  .prose .alignleft > figcaption, .prose .alignright > figcaption { display: block; }
  .prose table { display: block; overflow-x: auto; font-size: 15px; }
  .prose th, .prose td { padding: 8px 6px; }
  .prose thead th { font-size: 12px; letter-spacing: .04em; }
  .race-detail-when { font-size: 17px; }
  .post-navigation .nav-links { grid-template-columns: 1fr; }
  .post-navigation .nav-next { grid-column: 1; text-align: left; }
  .photo-years { margin-right: -22px; margin-left: -22px; padding: 0 10px; }
  .photo-toolbar .search-field { width: 100%; }
  .photo-cards { grid-template-columns: 1fr; gap: 10px; }
  .photos-section .photo-cards { margin-top: 30px; }
  .race-photos { margin-top: 48px; }
  .photo-service-header h1 { font-size: 40px; }
  .photo-facts { font-size: 17px; }
  .photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; margin-right: -22px; margin-left: -22px; }
  .photo-thumb:hover img { transform: none; }
  .lightbox-bar { padding: 6px 6px 6px 16px; }
  .lightbox-figure { padding: 0 0 12px; }
  .lightbox-caption { padding: 0 16px; }
  .lightbox-nav { width: 40px; height: 56px; margin-top: -28px; background: rgb(9 20 31 / 45%); }
  .lightbox-prev { left: 0; }
  .lightbox-next { right: 0; }
}

@media (max-width: 600px) {
  .admin-bar .site-header { top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
