/*
 * Shared site-wide styles. Loaded on every page after the inline <style> block,
 * so rules here override page-level CSS at equal specificity.
 *
 * Purpose: mobile polish + accessibility that should apply uniformly to all 19+ pages.
 */

/* Defense against horizontal scroll on any page that didn't add it inline. */
html, body { overflow-x: hidden; }

/* Prevent iOS from zooming the viewport when a user taps a form input.
   iOS only zooms when font-size < 16px. We force >=16px on all narrow viewports. */
@media (max-width: 640px) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="url"],
  input[type="search"],
  input[type="number"],
  input[type="password"],
  input[type="datetime-local"],
  input[type="date"],
  input[type="time"],
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* Ensure tap targets meet Apple's 44pt / Material 48dp guidance. */
@media (max-width: 840px) {
  .nav-cta,
  .lang-toggle,
  .home-link {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding-left: 16px;
    padding-right: 16px;
  }
  .nav-cta { padding-top: 12px; padding-bottom: 12px; }
}

/* ---------- Mobile nav (hamburger overlay) ---------- */

/* Desktop / wide layout: hide the toggle button entirely. */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border, rgba(245, 240, 232, 0.08));
  color: var(--cream, #f5f0e8);
  width: 44px;
  height: 44px;
  border-radius: 12px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  line-height: 1;
  transition: border-color 0.2s, background 0.2s;
  padding: 0;
}
.nav-toggle:hover { border-color: var(--border-strong, rgba(245, 240, 232, 0.16)); background: rgba(245, 240, 232, 0.03); }
.nav-toggle:focus-visible { outline: 2px solid var(--cyan, #22d3ee); outline-offset: 2px; }

/* Hamburger icon — three bars that morph to an X when open. */
.nav-toggle .bars {
  position: relative;
  width: 18px;
  height: 12px;
  display: inline-block;
}
.nav-toggle .bars::before,
.nav-toggle .bars::after,
.nav-toggle .bars span {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.2s, opacity 0.2s, top 0.2s, bottom 0.2s;
}
.nav-toggle .bars::before { top: 0; }
.nav-toggle .bars span     { top: 50%; transform: translateY(-50%); display: block; }
.nav-toggle .bars::after  { bottom: 0; }
.nav-toggle[aria-expanded="true"] .bars::before { top: 50%; transform: translateY(-50%) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .bars span    { opacity: 0; }
.nav-toggle[aria-expanded="true"] .bars::after  { bottom: 50%; transform: translateY(50%) rotate(-45deg); }

@media (max-width: 840px) {
  .nav-toggle { display: inline-flex; }

  /* When the nav is closed on mobile, hide the link rail. */
  .nav-links {
    position: fixed;
    inset: 64px 0 0 0;
    background: var(--bg-deep, #050608);
    border-top: 1px solid var(--border, rgba(245, 240, 232, 0.08));
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 24px clamp(20px, 4vw, 32px);
    overflow-y: auto;
    transform: translateY(-10px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.22s ease, opacity 0.18s ease;
    z-index: 50;
    display: flex !important;
  }
  body.nav-open .nav-links {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  body.nav-open { overflow: hidden; }

  /* Re-show all the non-CTA links in the drawer (the 840px desktop rule hid them). */
  .nav-links a:not(.nav-cta) {
    display: flex !important;
    align-items: center;
    padding: 16px 4px;
    border-bottom: 1px solid var(--border, rgba(245, 240, 232, 0.08));
    font-size: 1.05rem;
    color: var(--cream, #f5f0e8);
    min-height: 56px;
  }
  .nav-links a:not(.nav-cta):last-of-type { border-bottom: none; }

  .nav-links .lang-toggle {
    align-self: flex-start;
    margin: 16px 0;
    min-height: 44px;
  }

  .nav-links .nav-cta {
    margin-top: 18px;
    width: 100%;
    justify-content: center;
    padding-top: 18px;
    padding-bottom: 18px;
    font-size: 1rem;
  }
}

/* ---------- compare.html table — horizontal scroll wrapper on mobile ---------- */

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0 calc(var(--gutter, 24px) * -1);
  padding: 0 var(--gutter, 24px);
}
.table-scroll > * { min-width: 920px; }

/* ---------- Small polish ---------- */

a, button { -webkit-tap-highlight-color: rgba(34, 211, 238, 0.18); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  html { scroll-behavior: auto; }
}

/* Footer brand-family entries for not-yet-launched sister brands. Renders as
 * plain text with same visual weight as the linked siblings. Replace with
 * a real <a> when the brand site goes live. */
.brand-family-pending {
  color: var(--cream-faint, rgba(245,240,232,0.35));
  cursor: default;
}
