/* ================================
   Base Styles
   ================================ */

/* 1) Fonts */
@font-face{
  font-family: "Team42HN";
  src:
    url("/fonts/HeaderFont.woff2") format("woff2"),
    url("/fonts/HeaderFont.woff")  format("woff");
  font-weight: 900;
  font-style: italic;    /* Only italic is provided */
  font-display: swap;    /* Better CLS */
}

/* 2) Design tokens */
:root{
  --brand: #fff000;
  --bg:    #111111;
  --radius: .5rem;
  --sticky-offset: 84px; /* height reserved under sticky header */
}

/* 3) Headings (fluid sizes, italic weight) */
h1, h2, h3{
  font-family: "Team42HN", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-weight: 900;
  font-style: italic;     /* required since only italic is defined */
  font-synthesis: none;   /* prevent fake styles */
  line-height: 1.05;
  letter-spacing: -0.01em;
}

/* Fluid type with sensible caps 
h1{ font-size: clamp(2.25rem, 6vw + 1rem, 5rem); }
h2{ font-size: clamp(1.75rem, 4vw + .5rem, 3rem); }
h3{ font-size: clamp(1.25rem, 2.5vw + .25rem, 2rem); }*/

/* Utility: brand heading font (same as h1–h3) */
.font-brand{
  font-family: "Team42HN", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-weight: 900;
  font-style: italic;
  font-synthesis: none;
}

/* Utility: force italic on brand wordmarks if needed */
.headline-italic{ font-style: italic; }

/* 4) Accessibility */
:focus-visible{
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--radius);
}

/* Respect motion preferences */
@media (prefers-reduced-motion: reduce){
  *{
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 5) Layout helpers */
html{
  overflow-x: hidden;
}
section[id]{ scroll-margin-top: var(--sticky-offset); }

.min-h-svh{ min-height: 100vh; }
@supports (height: 100svh){
  .min-h-svh{ min-height: 100svh; }
}

/* Guard against horizontal overflow (hero full-bleed video overrides via .hero-video) */
img:not(.race-region-flag):not(.coach-card-photo), video:not(.hero-video){ max-width: 100%; height: auto; display: block; }
/* Inline country flags (SVG): global img rule would let these fill the flex row — keep thumb-sized */
img.race-region-flag{
  border:0;
  max-width: 2rem;
  width: auto;
  height: 1.4rem;
  min-width: 0;
  flex-shrink: 0;
  align-self: center;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
}
.hero-video{
  display: block;
  max-width: none;
  width: 100%;
  height: 100%;
}
.min-w-0{ min-width: 0; } /* use on flex/grid parents to prevent overflow */

/* [hidden] must override display utilities (e.g. button inline-flex + Tailwind .hidden fighting each other) */
[hidden]{
  display: none !important;
}

/* 6) Mobile gutters (comfortable + safe areas) */
@media (max-width: 767px){
  .mobile-gutters{
    padding-left:  max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
  }
}

/* 7) Media/card imagery */
.card-img{
  width: 100%;
  height: 10rem;
  object-fit: cover;
  border-radius: var(--radius);
  /* Optional: use aspect-ratio instead of fixed height
     aspect-ratio: 16 / 9; height: auto; */
}
@media (min-width: 768px){
  .card-img{ height: 10rem; }
}
