/* Reset, document defaults, accessibility basics. Nothing project-specific. */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: normal;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;          /* nothing may scroll the page sideways */
}

img, picture, video, canvas, svg { display: block; max-width: 100%; }
img { height: auto; }

input, button, textarea, select { font: inherit; color: inherit; }

/* headings take face, size and line-height from their class, per mockup node — a
   global display face silently changes every card title set in the body face */
h1, h2, h3, h4 { font: inherit; }

a { color: inherit; }

ul, ol { list-style: none; padding: 0; }

/* Visible focus is not optional, whatever the mockup shows. */
:focus-visible { outline: 2px solid var(--color-brand); outline-offset: 3px; border-radius: 2px; }
:focus:not(:focus-visible) { outline: none; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: var(--z-modal);
  padding: var(--space-8) var(--space-16); background: var(--color-text); color: var(--color-bg); border-radius: var(--radius-md); text-decoration: none; font-weight: 700;
}
.skip-link:focus { left: var(--space-8); top: var(--space-8); }

/* A hidden control inside a component must stay hidden even when the component
   sizes its inputs (`.field input { width:100% }`): the doubled class wins. */
.visually-hidden.visually-hidden { width: 1px; height: 1px; min-height: 0; padding: 0; border: 0; }

/* A hidden element must stay hidden even when a component sets display.
   Without this a closed panel keeps its height and pushes sections down. */
[hidden][hidden] { display: none !important; }

/* Tap targets: 24×24 minimum (WCAG 2.2 AA, 2.5.8) added by a pseudo-element,
   never by padding — padding changes the layout, this does not. */
.tap-target { position: relative; }
.tap-target::after {
  content: ""; position: absolute; inset: 50% 0 auto 0; translate: 0 -50%;
  height: 100%; min-height: 24px; z-index: 1;
}

/* Touch screens: the same pattern grows the hit area of stand-alone controls (header,
   tabs, odds, bet-slip buttons, phone links, call-to-action links) to 44×44 — Apple HIG /
   WCAG 2.5.5. Only the invisible hit box changes; the drawn size stays as in the mockup.
   Controls sitting in running text keep the 24px minimum: 44px would overlap the next line. */
@media (pointer: coarse) {
  .tap-target::after { inset: 50% auto auto 50%; translate: -50% -50%; width: max(100%, 44px); height: max(100%, 44px); }
  .btn, .odd, .logo, .tabs__tab, .sportnav__tab, .racing-strip__tab, .race__tab, .slip__remove, .slip__quick-btn,
  .stone__support-phone, .site-footer__cookies, .rail__phone, .rail__support-link, .rg-helpline__phone, .rg-betstop__btn,
  .hitem__link, .mrow__more, .ntj__all, .featured__all, .workspace__all, .racing-strip__all, .consent-btn, .arrow-link, .dl-link, .skip-link { position: relative; }
  .btn::before, .odd::before, .logo::before, .tabs__tab::before, .sportnav__tab::before, .racing-strip__tab::before, .race__tab::before,
  .slip__remove::before, .slip__quick-btn::before, .stone__support-phone::before, .site-footer__cookies::before, .rail__phone::before,
  .rail__support-link::before, .rg-helpline__phone::before, .rg-betstop__btn::before, .hitem__link::before, .mrow__more::before,
  .ntj__all::before, .featured__all::before, .workspace__all::before, .racing-strip__all::before, .consent-btn::before, .arrow-link::before, .dl-link::before {
    content: ""; position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: max(100%, 44px); height: max(100%, 44px); z-index: 1;
  }
  .skip-link:focus { position: absolute; }
}

/* Section rhythm helpers */
.section-inner { padding-inline: var(--container-pad); }
@media (max-width: 1199px) { .section-inner { padding-inline: var(--container-pad-m); } }
