/* Mobile/tablet polish (Turno 6): tap targets >=44px, legible text, no iOS input zoom.
   Applies to narrow screens AND to any touch device (iPad landscape 1024-1366px). */
@media (max-width: 1023px), (pointer: coarse) {
  /* hamburger + header controls */
  #navDrawerOpenBtn, button[onclick*="toggleNavDrawer"] { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
  /* Header links stay compact and aligned */
  header a, header nav a { min-height: auto !important; }
  /* footer links */
  footer a { display: inline-flex; align-items: center; min-height: 44px; padding-left: 2px; padding-right: 2px; }
  /* form controls: 16px avoids iOS auto-zoom on focus */
  input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea { font-size: 16px !important; min-height: 44px; }
  input[type=checkbox], input[type=radio] { width: 20px; height: 20px; }
  label:has(> input[type=checkbox]) { min-height: 44px; display: inline-flex; align-items: center; }
  /* Primary touch action buttons */
  .btn-touch, .primary-cta { min-height: 44px; display: inline-flex; align-items: center; }
  nav[aria-label] a { min-height: 40px; display: inline-flex; align-items: center; }
  /* long words / codes never overflow */
  code, .font-mono { overflow-wrap: anywhere; }
  h1, h2, h3 { overflow-wrap: break-word; hyphens: auto; }
  img, video, iframe { max-width: 100%; }
}
@media (max-width: 1023px) and (orientation: landscape) {
  /* landscape phones: keep hero/header compact */
  .min-h-screen { min-height: auto !important; }
}

/* drawer must scroll on short landscape screens */
#mobileDrawer { overflow-y: auto; -webkit-overflow-scrolling: touch; }

/* ---- iOS Safari hardening (m8) ---- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { min-height: 100vh; min-height: 100svh; overflow-x: hidden; overflow-x: clip; }
/* 100vh on iOS = viewport WITH the toolbar hidden -> hero taller than screen & content hidden behind the toolbar.
   svh = small viewport (toolbar visible), dvh = dynamic. Fallback to vh where unsupported. */
@supports (height: 100svh) {
  .min-h-screen { min-height: 100svh; }
  .h-screen { height: 100dvh; }
  .min-h-\[85vh\] { min-height: 85svh; }
  .max-h-screen { max-height: 100dvh; }
}
/* drawer: full dynamic height, respects the home indicator, does not scroll the page behind it */
#mobileDrawer { height: 100vh; height: 100dvh; padding-bottom: max(1.5rem, env(safe-area-inset-bottom)); overscroll-behavior: contain; }
/* fixed header: respect landscape notch insets */
header.fixed { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
footer { padding-bottom: env(safe-area-inset-bottom); }
/* Safari needs the prefixed property for hyphenation */
h1, h2, h3 { -webkit-hyphens: auto; }
/* long URLs / emails / tables never push the layout sideways */
p, li, td, dd { overflow-wrap: anywhere; }
table { max-width: 100%; }
.prose table, #articleContent table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
pre { max-width: 100%; overflow-x: auto; }
/* no iOS tap flash; touch devices: no sticky hover lift on cards */
a, button { -webkit-tap-highlight-color: rgba(16,185,129,.18); }
@media (hover: none) {
  .event-card:hover, .driver-card:hover, .stat-card:hover, .contact-method:hover, .role-card:hover, .game-card:hover,
  .group:hover .group-hover\:scale-105 { transform: none !important; }
}
/* grid/flex children may shrink below their min-content (prevents overflow from long words in cards) */
@media (max-width: 767px) { .grid > * { min-width: 0; } }

/* t257: foco visible accesible, microinteracciones discretas y jerarquía tipográfica */
:where(a,button,input,select,textarea,summary,[tabindex]):focus-visible{outline:2px solid #34d399;outline-offset:3px;border-radius:6px}
h1,h2,h3{text-wrap:balance}
p{text-wrap:pretty}
html{-webkit-tap-highlight-color:rgba(16,185,129,.18)}
.pl-card,.pl-link{transition:border-color .2s,transform .2s,box-shadow .2s,background-color .2s}
.pl-card:hover,.pl-link:hover{transform:translateY(-2px);box-shadow:0 10px 24px -12px rgba(16,185,129,.45);background-color:#1a222c}
.pl-card:active,.pl-link:active{transform:translateY(0) scale(.99)}
.pl-grid{gap:14px}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}}


/* ========================================================================= */
/* MUNTRUME LIGHT THEME STYLING                                              */
/* ========================================================================= */
html.light body,
html[data-theme="light"] body {
  background-color: #F3F5F4 !important;
  color: #121A17 !important;
}

html.light .bg-\[\#0E1211\], [data-theme="light"] .bg-\[\#0E1211\],
html.light .bg-\[\#080C0A\], [data-theme="light"] .bg-\[\#080C0A\],
html.light .bg-\[\#0A0E0D\], [data-theme="light"] .bg-\[\#0A0E0D\],
html.light .bg-\[\#0C1210\], [data-theme="light"] .bg-\[\#0C1210\],
html.light .bg-\[\#0E1513\], [data-theme="light"] .bg-\[\#0E1513\],
html.light .bg-\[\#0A0F0D\], [data-theme="light"] .bg-\[\#0A0F0D\],
html.light .bg-\[\#090b0f\], [data-theme="light"] .bg-\[\#090b0f\] {
  background-color: #FFFFFF !important;
}
/* /overlay/brands/ stays dark: the marks use white lettering. */
html.light .brand-hud,
html[data-theme="light"] .brand-hud,
html.light .brand-hud .bg-\[\#090b0f\],
html[data-theme="light"] .brand-hud .bg-\[\#090b0f\] {
  background-color: #090b0f !important;
  color: #e2e8f0 !important;
}
html.light .brand-hud .bg-\[\#0d1118\],
html[data-theme="light"] .brand-hud .bg-\[\#0d1118\] {
  background-color: #0d1118 !important;
  color: #e2e8f0 !important;
}
html.light .brand-hud .text-white,
html[data-theme="light"] .brand-hud .text-white,
html.light .brand-hud .text-slate-100,
html[data-theme="light"] .brand-hud .text-slate-100,
html.light .brand-hud .text-slate-200,
html[data-theme="light"] .brand-hud .text-slate-200,
html.light .brand-hud .text-slate-300,
html[data-theme="light"] .brand-hud .text-slate-300 {
  color: #e2e8f0 !important;
}
html.light .brand-hud .text-slate-400,
html[data-theme="light"] .brand-hud .text-slate-400,
html.light .brand-hud .text-slate-500,
html[data-theme="light"] .brand-hud .text-slate-500 {
  color: #94a3b8 !important;
}
html.light .brand-hud .border-white\/10,
html[data-theme="light"] .brand-hud .border-white\/10,
html.light .brand-hud .border-white\/15,
html[data-theme="light"] .brand-hud .border-white\/15 {
  border-color: rgba(255, 255, 255, 0.12) !important;
}

html.light .bg-\[\#1A2120\], [data-theme="light"] .bg-\[\#1A2120\],
html.light .bg-\[\#121A17\], [data-theme="light"] .bg-\[\#121A17\],
html.light .bg-\[\#101514\], [data-theme="light"] .bg-\[\#101514\],
html.light .bg-\[\#141E1A\], [data-theme="light"] .bg-\[\#141E1A\],
html.light .bg-\[\#16201C\], [data-theme="light"] .bg-\[\#16201C\],
html.light .bg-\[\#1E2A26\], [data-theme="light"] .bg-\[\#1E2A26\],
html.light .bg-\[\#161c24\], [data-theme="light"] .bg-\[\#161c24\],
html.light .bg-\[\#0e1217\], [data-theme="light"] .bg-\[\#0e1217\],
html.light .bg-\[\#0d1118\], [data-theme="light"] .bg-\[\#0d1118\],
html.light .bg-\[\#0d1117\], [data-theme="light"] .bg-\[\#0d1117\] {
  background-color: #F8FAF9 !important;
}

html.light .border-\[\#1A2120\], [data-theme="light"] .border-\[\#1A2120\],
html.light .border-\[\#1E2A26\], [data-theme="light"] .border-\[\#1E2A26\],
html.light .border-\[\#242E2C\], [data-theme="light"] .border-\[\#242E2C\],
html.light .border-\[\#232C2A\], [data-theme="light"] .border-\[\#232C2A\],
html.light .border-\[\#1C2523\], [data-theme="light"] .border-\[\#1C2523\],
html.light .border-\[\#2A3331\], [data-theme="light"] .border-\[\#2A3331\],
html.light .border-white\/10, [data-theme="light"] .border-white\/10,
html.light .border-white\/15, [data-theme="light"] .border-white\/15 {
  border-color: #E2E8E5 !important;
}

html.light :not(.brand-hud) .text-slate-100, [data-theme="light"] :not(.brand-hud) .text-slate-100,
html.light :not(.brand-hud) .text-slate-200, [data-theme="light"] :not(.brand-hud) .text-slate-200 {
  color: #0E1412 !important;
}
html.light :not(.brand-hud) .text-slate-300, [data-theme="light"] :not(.brand-hud) .text-slate-300,
html.light :not(.brand-hud) .text-slate-400, [data-theme="light"] :not(.brand-hud) .text-slate-400 {
  color: #4A5854 !important;
}

html.light :not(footer):not(.r-footer):not(.r-hero):not(.race-control-console):not(.race-control-console *):not(.brand-hud):not(.brand-hud *) > .text-white,
[data-theme="light"] :not(footer):not(.r-footer):not(.r-hero):not(.race-control-console):not(.race-control-console *):not(.brand-hud):not(.brand-hud *) > .text-white,
html.light :not(.race-control-console):not(.race-control-console *) .text-\[\#F5F5F5\], [data-theme="light"] :not(.race-control-console):not(.race-control-console *) .text-\[\#F5F5F5\],
html.light :not(.race-control-console):not(.race-control-console *) .text-\[\#E0E6E4\], [data-theme="light"] :not(.race-control-console):not(.race-control-console *) .text-\[\#E0E6E4\] {
  color: #0E1412 !important;
}

html.light :not(.race-control-console):not(.race-control-console *) .text-\[\#9AA8A3\], [data-theme="light"] :not(.race-control-console):not(.race-control-console *) .text-\[\#9AA8A3\],
html.light :not(.race-control-console):not(.race-control-console *) .text-\[\#8B9A8F\], [data-theme="light"] :not(.race-control-console):not(.race-control-console *) .text-\[\#8B9A8F\],
html.light :not(.race-control-console):not(.race-control-console *) .text-\[\#A3B0AC\], [data-theme="light"] :not(.race-control-console):not(.race-control-console *) .text-\[\#A3B0AC\],
html.light :not(.race-control-console):not(.race-control-console *) .text-neutral-300, [data-theme="light"] :not(.race-control-console):not(.race-control-console *) .text-neutral-300,
html.light :not(.race-control-console):not(.race-control-console *) .text-neutral-400, [data-theme="light"] :not(.race-control-console):not(.race-control-console *) .text-neutral-400 {
  color: #4A5854 !important;
}

html.light #mobileDrawer, [data-theme="light"] #mobileDrawer {
  background-color: #FFFFFF !important;
  border-color: #E2E8E5 !important;
}

/* t260 · contraste en tema claro (Lighthouse color-contrast) */
html.light :not(.race-control-console):not(.race-control-console *) .text-neutral-200, [data-theme="light"] :not(.race-control-console):not(.race-control-console *) .text-neutral-200 { color: #1f2a27 !important; }
html.light :not(.race-control-console):not(.race-control-console *) .text-\[\#00E699\], [data-theme="light"] :not(.race-control-console):not(.race-control-console *) .text-\[\#00E699\] { color: #00704a !important; }
html.light :not(.race-control-console):not(.race-control-console *) .bg-\[\#242E2C\], [data-theme="light"] :not(.race-control-console):not(.race-control-console *) .bg-\[\#242E2C\] { background-color: #e3ebe8 !important; color: #1f2a27 !important; }

/* t262: evita scroll horizontal por el menú lateral fuera de pantalla */
html,body{overflow-x:clip}
/* t263: el menú cerrado no deja asomar su sombra ni es enfocable */
#mobileDrawer:not(.open){box-shadow:none!important;visibility:hidden;transition:transform .3s cubic-bezier(.4,0,.2,1),visibility 0s linear .3s}
#mobileDrawer.open{visibility:visible}
