/* ==========================================================================
   IMAGICA — SHARED RESPONSIVE LAYER
   Loaded last on every page. Normalises phone/tablet sizing that the page
   stylesheets define separately, so every page behaves the same:
   - readable text (nothing under 12px on phones)
   - tap targets of at least 24px (WCAG 2.5.8), 36-44px for primary controls
   - a navbar that fits from 320px phones up without shrinking text
   ========================================================================== */

/* ---------- Navbar (all pages) ---------- */
/* The button is a flex container, which trims the leading space inside
   " Desktop", so the gap is added explicitly. */
.btn-nav-outline .nav-btn-extra {
  margin-left: 0.32em;
}

@media (max-width: 640px) {
  .nav-about .nav-brand {
    min-height: 44px;
  }

  .nav-about .nav-actions {
    gap: 6px;
  }

  .nav-about .btn-nav-outline,
  body.desktop-page .nav-about .btn-nav-outline {
    min-height: 36px;
    padding: 0 14px;
    font-size: 0.75rem;
    letter-spacing: 0.03em;
  }

  .nav-about .nav-signin-link,
  .nav-about:not(.scrolled) .nav-signin-link {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 8px;
    font-size: 0.75rem;
    letter-spacing: 0.03em;
  }
}

/* Very narrow phones (iPhone SE 1st gen, small Androids): "Download" only */
@media (max-width: 400px) {
  .nav-about .nav-btn-extra {
    display: none;
  }

  .nav-about .nav-brand-logo {
    height: 24px;
    max-width: 96px;
  }

  .nav-about .btn-nav-outline,
  body.desktop-page .nav-about .btn-nav-outline {
    padding: 0 12px;
  }
}

/* Tablets: some page stylesheets shrink "Sign in" between 641px and 1023px */
@media (min-width: 641px) and (max-width: 1023px) {
  .nav-about .nav-signin-link,
  .nav-about:not(.scrolled) .nav-signin-link {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 10px;
  }
}

/* ---------- Footer ---------- */
@media (max-width: 1023px) {
  .footer-link {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    min-width: 32px; /* short labels such as "X" */
  }

  .footer-cookie-settings {
    min-height: 32px;
  }

  /* Keep the last footer row clear of floating buttons in the bottom-right
     corner (back-to-top on legal pages). */
  .footer-bottom-row {
    padding-bottom: 72px;
  }
}

/* ---------- Secondary navigation links ---------- */
.support-back-home,
.partner-back,
.error-link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
}

/* ---------- Minimum readable text on phones and tablets ---------- */
@media (max-width: 1023px) {
  .terms-pill-btn,
  .terms-pill-btn.active {
    font-size: 0.78rem;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
  }

  .badge-tag-part,
  .hero-partners-label,
  .error-eyebrow {
    font-size: 0.75rem;
  }
}

/* Links inside legal-page lists and the privacy "cookie settings" control */
@media (max-width: 1023px) {
  .terms-list .terms-link,
  .terms-clause .cookie-settings-link {
    display: inline-block;
    padding-block: 4px;
  }
}

/* Long words / URLs in legal pages must wrap instead of overflowing */
.terms-clause,
.terms-list li,
.faq-answer,
.terms-intro-p {
  overflow-wrap: anywhere;
}
