/* ==========================================================================
   Phones, tablets and TVs. Loaded last, so it adjusts the other style sheets.
   - Touch screens: finger-sized targets, no zoom on form fields, notch-safe edges.
   - Landscape phones: two columns again instead of one very tall column.
   - Large screens and TVs: everything scales up so it reads from a sofa.
   ========================================================================== */

html { -webkit-tap-highlight-color: rgba(10, 110, 168, 0.18); }
a, button, summary, select, label { touch-action: manipulation; }   /* no double-tap zoom or tap delay */

/* Notches and rounded corners (iPhone, Android cut-outs) in landscape */
.wrap {
  width: min(1180px, 100% - 2 * var(--gutter) - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
}
.site-header { padding-top: env(safe-area-inset-top, 0px); }
.site-footer { padding-bottom: calc(2.5rem + env(safe-area-inset-bottom, 0px)); }

/* Form fields: at least 16px so iPhones do not zoom in when one is tapped */
.field input:not([type="checkbox"]), .field select, .field textarea { font-size: max(16px, 1rem); }

/* ---------- Touch screens ---------- */
@media (pointer: coarse) {
  .nav-toggle, .btn { min-height: 44px; }
  .tab { min-height: 44px; padding-block: 0.9rem; }
  .tab::before, .tab::after { bottom: 0.35rem; }
  .pause { width: 44px; height: 44px; }
  .rail__btn { width: 44px; height: 44px; }
  .rail__track a { padding-block: 0.7rem; }
  .social { min-height: 48px; }
  .consent input { width: 1.4rem; height: 1.4rem; margin-top: 0.15rem; }
  .consent { gap: 0.85rem; }
  .nav a:not(.btn) { min-height: 44px; display: inline-flex; align-items: center; }
  .footer__links a { display: inline-block; padding-block: 0.6rem; }
  .ring a { -webkit-tap-highlight-color: transparent; }
}

/* ---------- Small phones ---------- */
@media (max-width: 640px) {
  .slide { padding-block: 1.5rem 5.25rem; }
  .slide__title { font-size: clamp(1.7rem, 7.4vw, 2.2rem); }
  .slide .lead { margin-top: 1rem; }
  .slide--1 .slide__visual, .slide--2 .slide__visual, .slide__visual { max-width: 340px; }
  .rails { gap: 0.75rem; }
  .rail { padding: 0.7rem 0.75rem 0.55rem; border-radius: 18px; }
  .rail__title { font-size: 0.95rem; }
  .rail .tile { width: 3rem; height: 3rem; border-radius: 1rem; }
  .rail__label { font-size: 0.78rem; }
  .events__head { gap: 0.5rem; }
  .event { flex-basis: 85%; }
  .feedback__btns { width: 100%; }
  .feedback__btns .btn { flex: 1 1 100%; }
}
@media (max-width: 640px) {
  .banner__ctrl { gap: 0.25rem; padding-inline: 0.5rem; }
  .tabs { flex-wrap: nowrap; gap: 0; }
  .tab { padding-inline: 0.5rem; font-size: 0.88rem; white-space: nowrap; }
  .tab::before, .tab::after { left: 0.5rem; right: 0.5rem; }
}
@media (max-width: 340px) {
  .rail__label { font-size: 0.72rem; }
  .tab { padding-inline: 0.45rem; font-size: 0.85rem; }
}

/* ---------- Phones turned sideways (short and wide) ---------- */
@media (orientation: landscape) and (max-height: 520px) and (max-width: 1000px) {
  .slide__grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 1.25rem; }
  .slide__title { font-size: clamp(1.5rem, 4.2vw, 2rem); }
  .slide .lead { margin-top: 0.6rem; font-size: 0.98rem; line-height: 1.5; }
  .slide .hero__actions { margin-top: 1rem; }
  .slide--1 .slide__visual, .slide--2 .slide__visual, .slide__visual { max-width: 300px; }
  .rails { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .slide { padding-block: 1.25rem 4.25rem; }
  .site-header { position: static; }
  .pd, .sd { grid-template-columns: 1fr 1fr; }
  html { scroll-padding-top: 1rem; }
}

/* ---------- Large screens and TVs ---------- */
/* The whole page is scaled so text reads from a sofa. Browsers without "zoom" simply show the normal size. */
@media (min-width: 1600px) { html { zoom: 1.25; } }
@media (min-width: 1920px) { html { zoom: 1.5; } }
@media (min-width: 2560px) { html { zoom: 2; } }
@media (min-width: 3200px) { html { zoom: 2.5; } }
@media (min-width: 3800px) { html { zoom: 2.9; } }

/* A remote control moves focus around, so the focus ring must be easy to see */
@media (min-width: 1280px) {
  :focus-visible { outline: 4px solid #0a6ea8; outline-offset: 4px; border-radius: 6px; }
  .site-header :focus-visible, .section--deep :focus-visible, .site-footer :focus-visible { outline-color: #7ee6ff; }
  .ring a:focus-visible circle { stroke: #10203f; stroke-width: 5; }
}
/* Devices with no mouse (most TVs): keep content away from the screen edge */
@media (hover: none) and (pointer: none) {
  body { padding-inline: 2.5vw; }
  .site-header { margin-inline: -2.5vw; padding-inline: 2.5vw; }
}

@media print { html { zoom: 1; } }
