/* ============================================================
   Claudiu Moldovan — responsive refinements
   Loaded last so these rules win. Targets phones (≤430px),
   large phones / small tablets, and iPad (768–1024px).
   ============================================================ */

/* ---- Prevent iOS auto-zoom on input focus (needs ≥16px) ---- */
.field input, .field select, .field textarea,
.nl-form input {
  font-size: 16px;
}

/* ---- CONTACT: stack info + form on tablet/phone (was always 2-col) ---- */
@media (max-width: 860px) {
  .contact-grid { grid-template-columns: 1fr; gap: clamp(28px, 5vw, 44px); }
}

/* ---- TABLET RANGE (iPad portrait & landscape, 768–1024) ---- */
@media (min-width: 768px) and (max-width: 1024px) {
  :root { --gutter: clamp(28px, 5vw, 56px); }
  /* keep 3-up service/tool/quote grids as 2-up so cards aren't huge & lonely */
  .tools-grid { grid-template-columns: repeat(2, 1fr); }
  .refs { grid-template-columns: repeat(2, 1fr); }
  .logo-wall { grid-template-columns: repeat(4, 1fr); }
}

/* iPad landscape (1024) keeps the side-by-side hero feeling balanced */
@media (min-width: 901px) and (max-width: 1024px) {
  .hero-media { width: 54%; }
  .hero-copy { max-width: 480px; }
}

/* ---- TAP TARGETS: make controls comfortably tappable (≥44px) ---- */
@media (max-width: 1024px) {
  .lang-toggle button { padding: 11px 15px; min-height: 44px; font-size: 13px; }
  .menu-btn { min-width: 44px; min-height: 44px; align-items: center; justify-content: center; }
  .footer-social a { width: 44px; height: 44px; }
  .nav a { min-height: 44px; display: flex; align-items: center; }
  .tool, a.lw-cell { min-height: 56px; }
}

/* ---- PHONES (≤560px) ---- */
@media (max-width: 560px) {
  :root { --section-pad: clamp(54px, 9vh, 76px); }
  body { font-size: 17px; }

  /* hero: comfortable photo height, copy breathes */
  .hero-media { height: 46vh; min-height: 320px; }
  .hero-name { font-size: clamp(2.4rem, 11vw, 3.4rem); }
  .hero-statement { font-size: clamp(1.2rem, 5.4vw, 1.5rem); }
  .hero-sub { font-size: 1rem; }
  .hero-actions { gap: 10px; }
  .hero-actions .btn { flex: 1 1 auto; justify-content: center; }

  /* buttons full-width where it reads better */
  .btn--lg { width: 100%; }

  /* logo marquee cards a touch smaller */
  .logo-chip { height: 72px; width: 150px; padding: 14px 18px; }

  /* TEDx play button smaller so it doesn't dominate */
  .ted-play { width: 64px; height: 64px; }
  .ted-play svg { width: 24px; height: 24px; }
  .ted-tag { font-size: 0.92rem; left: 14px; bottom: 12px; }

  /* category headers stack cleanly */
  .cat-head { gap: 12px; }
  .cat-head .num { font-size: 2.2rem; }

  /* timeline tighter */
  .tl-item { grid-template-columns: 56px 1fr; gap: 14px; }

  /* recruitment offer inputs single column on tiny screens */
  .offer-grid { grid-template-columns: 1fr; gap: 10px; }

  /* style switcher: keep clear of content, smaller */
  .dir-switch { right: 8px; bottom: 8px; }
}

/* ---- VERY SMALL (≤360px) keep everything inside the viewport ---- */
@media (max-width: 400px) {
  .header-inner { gap: 10px; }
  .header-tools { gap: 8px; flex-shrink: 0; }
  .lang-toggle button { padding: 10px 11px; }
  .brand { font-size: 17px; min-width: 0; }
}
@media (max-width: 360px) {
  .hero-name { font-size: 2.15rem; }
  .logo-chip { width: 132px; }
  .brand { font-size: 16px; }
}

/* ---- Safe-area insets (notched iPhones) ---- */
@supports (padding: max(0px)) {
  .site-header .header-inner,
  .wrap { padding-left: max(var(--gutter), env(safe-area-inset-left));
          padding-right: max(var(--gutter), env(safe-area-inset-right)); }
  .dir-switch { bottom: max(8px, env(safe-area-inset-bottom)); }
}

/* ---- Belt-and-braces: nothing should cause horizontal scroll ---- */
html, body { max-width: 100%; }
img, video, iframe { max-width: 100%; }
