/* =====================================================
   RESPONSIVE.CSS — RecallRadar
   Mobile-first breakpoints for all components.
   Blueprint Section 17.
   ===================================================== */

/* ── 1280px — Large desktop tweaks ──────────────── */
@media (max-width: 1280px) {
  .country-hubs-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .stats-top-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ── 1024px — Tablet landscape / small desktop ─── */
@media (max-width: 1024px) {
  /* Layout: drop sidebar below content */
  .content-area {
    grid-template-columns: 1fr;
  }

  .site-sidebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
  }

  .sidebar-widget { margin-bottom: 0; }

  /* Hero */
  .hero__inner {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .hero__stats {
    grid-template-columns: repeat(4, 1fr);
    width: 100%;
  }

  /* Country hubs */
  .country-hubs-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Tools grid */
  .tools-grid--full {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Charts */
  .charts-grid {
    grid-template-columns: 1fr;
  }

  /* Stats row */
  .stats-top-row {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
  }
}

/* ── 900px — Tablet portrait ─────────────────────── */
@media (max-width: 900px) {
  /* Nav: hide primary nav, show hamburger */
  .primary-nav { display: none; }
  .nav-hamburger { display: flex; }

  /* Mobile nav panel */
  .primary-nav.is-open {
    display: block;
    position: fixed;
    top: 96px; /* ticker(36px) + header(60px) */
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--color-dark);
    z-index: 900;
    overflow-y: auto;
    padding: var(--space-lg);
  }

  .primary-nav.is-open .nav-menu {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }

  .primary-nav.is-open .nav-link {
    padding: 14px var(--space-md);
    font-size: 16px;
    border-radius: var(--radius-md);
  }

  /* Mobile mega menu: inline, not absolute */
  .primary-nav.is-open .mega-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
    box-shadow: none;
    border: none;
    background: rgba(255,255,255,0.05);
    border-radius: var(--radius-md);
    margin-top: 4px;
    display: none;
  }

  .primary-nav.is-open .nav-item--open .mega-menu {
    display: block;
  }

  .primary-nav.is-open .mega-menu__link {
    color: rgba(255,255,255,0.85);
  }

  .primary-nav.is-open .mega-menu__link:hover {
    background: rgba(255,255,255,0.1);
    color: white;
  }

  .primary-nav.is-open .mega-menu__heading {
    color: rgba(255,255,255,0.4);
  }

  /* Hamburger animation when open */
  .nav-hamburger[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .nav-hamburger[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }
  .nav-hamburger[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* Nav search: full width on mobile, anchored right */
  .nav-search__form {
    position: fixed;
    top: 96px;
    left: 0;
    right: 0;
    width: 100%;
    border-radius: 0;
    border-left: none;
    border-right: none;
    box-sizing: border-box;
  }

  /* Country hubs */
  .country-hubs-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Country hub hero */
  .country-hub-hero {
    flex-direction: column;
    gap: var(--space-md);
  }
  .country-hub-hero__flag { font-size: 48px; }

  /* Tools */
  .tools-grid--full {
    grid-template-columns: 1fr;
  }

  /* VIN input */
  .vin-input-row {
    flex-direction: column;
  }

  /* Product search */
  .product-search__input-wrap {
    flex-direction: column;
  }

  .product-search__filters {
    flex-direction: column;
  }
  .product-search__select { max-width: 100%; }
}

/* ── 768px — Large mobile / small tablet ─────────── */
@media (max-width: 768px) {
  /* Base font */
  body { font-size: 16px; }

  /* Container padding */
  .container { padding: 0 var(--space-md); }

  /* Sidebar: single column */
  .site-sidebar {
    grid-template-columns: 1fr;
  }

  /* Hero */
  .hero { padding: var(--space-2xl) 0; }
  .hero__stats {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Country hubs */
  .country-hubs-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Tools grid */
  .tools-grid { grid-template-columns: 1fr; }

  /* Recall grid */
  .recall-grid { grid-template-columns: 1fr; }
  .recall-grid--3col { grid-template-columns: repeat(2, 1fr); }
  .recall-grid--4col { grid-template-columns: repeat(2, 1fr); }

  /* Recall meta panel grid */
  .recall-details-grid {
    grid-template-columns: 1fr;
  }

  /* Stats */
  .stats-top-row {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Charts */
  .charts-grid { grid-template-columns: 1fr; }

  /* Authority cards */
  .authority-cards {
    grid-template-columns: 1fr;
  }

  /* Footer */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: var(--space-sm);
  }

  /* Country tabs: scroll horizontally */
  .country-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: var(--space-md);
    gap: var(--space-sm);
  }
  .country-tabs::-webkit-scrollbar { display: none; }
  .country-tab { flex-shrink: 0; }

  /* Archive hero */
  .archive-hero__heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  /* Single post byline: wrap */
  .single-recall__byline { font-size: 13px; }

  /* Section header */
  .section-header { flex-direction: column; align-items: flex-start; gap: var(--space-xs); }

  /* Tool explainer steps */
  .tool-explainer { padding: var(--space-md); }

  /* Breadcrumb: clip long crumbs */
  .breadcrumb { font-size: 12px; }
}

/* ── 480px — Mobile portrait ─────────────────────── */
@media (max-width: 480px) {
  /* Hero stat numbers */
  .hero-stat__number { font-size: 22px; }

  /* Country hubs: single col */
  .country-hubs-grid {
    grid-template-columns: 1fr;
  }

  /* Recall grids: single col */
  .recall-grid--3col,
  .recall-grid--4col { grid-template-columns: 1fr; }

  /* Stats: single col */
  .stats-top-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-card__number { font-size: 24px; }

  /* Hero actions: stack */
  .hero__actions { flex-direction: column; gap: var(--space-sm); }
  .hero__actions .btn { width: 100%; justify-content: center; }

  /* Buttons: full width on narrow */
  .error-page__actions { flex-direction: column; }
  .error-page__actions .btn { width: 100%; justify-content: center; }

  /* Tool page hero: smaller */
  .tool-page-hero__icon { font-size: 36px; }
  .tool-page-hero__title { font-size: 24px; }

  /* VIN input */
  .vin-input { font-size: 15px; letter-spacing: 1px; }

  /* Nav search form: full width on narrow */
  .nav-search__form { left: 0; right: 0; width: 100%; border-radius: 0; }

  /* Recall card meta: wrap tighter */
  .recall-card__meta { gap: 4px; }
  .recall-card__date { margin-left: 0; }

  /* Footer logo */
  .site-logo__text { font-size: 18px; }

  /* Ticker: faster on mobile */
  .ticker-list { animation-duration: 20s; }

  /* Mega menu grid: single col on mobile */
  .mega-menu__list--grid { grid-template-columns: 1fr; }
}

/* ── Print styles ─────────────────────────────────── */
@media print {
  .site-header,
  .breaking-ticker,
  .site-footer,
  .site-sidebar,
  .breadcrumb,
  .related-recalls,
  .ad-unit,
  .country-tabs,
  .hero,
  .tools-teaser,
  .country-hubs {
    display: none !important;
  }

  .content-area { grid-template-columns: 1fr; }

  body {
    font-size: 14px;
    color: #000;
    background: #fff;
  }

  .recall-meta-panel {
    border: 1px solid #ccc;
  }

  a { color: #000; text-decoration: underline; }

  .recall-source-link::after {
    content: " (" attr(href) ")";
    font-size: 11px;
  }
}

/* =====================================================
   RESPONSIVE ADDITIONS — new components
   ===================================================== */

/* Vertical ticker */
@media (max-width: 480px) {
  .vticker-item { font-size: 12px; padding: 0 12px; }
  .vticker-bar__label { padding: 0 10px; font-size: 10px; }
}

/* Hero redesign */
@media (max-width: 1024px) {
  .hero__inner { grid-template-columns: 1fr; gap: 32px; }
  .hero__stats  { grid-template-columns: repeat(4, 1fr); }
  .hero__desc   { max-width: 100%; }
}

@media (max-width: 768px) {
  .hero { padding: 40px 0 36px; }
  .hero__stats { grid-template-columns: repeat(2, 1fr); }
  .hero-search-wrap { max-width: 100%; }
  .hero-search-btn { padding: 14px 16px; font-size: 13px; }
  .hero__heading { letter-spacing: -0.5px; }
}

@media (max-width: 480px) {
  .hero__stats { grid-template-columns: 1fr 1fr; }
  .hero-stat__number { font-size: 26px; }
  .hero__actions { flex-direction: column; }
  .btn--outline-white { justify-content: center; }
  .hero-search-input { font-size: 14px; padding: 12px 6px; }
}

/* Filters bar */
@media (max-width: 768px) {
  .filters-bar { flex-direction: column; align-items: flex-start; gap: 10px; }
  .filters-bar .country-tabs { width: 100%; }
  .filter-selects { margin-left: 0; width: 100%; }
  .filter-select { flex: 1; }
  .authority-bar { gap: 6px; }
  .authority-bar__label { width: 100%; }
}

@media (max-width: 480px) {
  .filter-selects { flex-direction: column; }
}

/* Pagination */
@media (max-width: 480px) {
  .nav-links { gap: 4px; }
  .page-numbers { min-width: 36px; height: 36px; font-size: 13px; }
  .page-numbers.prev, .page-numbers.next { padding: 0 14px; min-width: 90px; }
}

/* Footer bottom links */
@media (max-width: 480px) {
  .footer-bottom { flex-direction: column; text-align: center; gap: 8px; }
  .footer-bottom__links { justify-content: center; }
}
