/* ════════════════════════════════════════════
   A3 Digital Tools — Responsive CSS
   Breakpoints:
   xl:  1200px
   lg:  1024px
   md:  768px
   sm:  640px
   xs:  480px
════════════════════════════════════════════ */

/* ── XL: 1200px ── */
@media (max-width: 1200px) {
  .mega-menu__inner { flex-wrap: wrap; }
  .mega-col { min-width: 180px; flex: 1 1 180px; }
  .footer-grid { grid-template-columns: 1.5fr 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

/* ── LG: 1024px ── */
@media (max-width: 1024px) {

  /* Header */
  .primary-nav { display: none; }
  .mobile-menu-toggle { display: flex; }
  .header-cta { display: none; }

  /* Homepage */
  .hero { padding: 60px 0 48px; }
  .hero__stats { gap: 24px; }
  .hero__stat-value { font-size: 26px; }

  .why-grid { grid-template-columns: repeat(2, 1fr); }
  .tools-grid--3col { grid-template-columns: repeat(2, 1fr); }
  .categories-grid { grid-template-columns: repeat(4, 1fr); }

  /* Tool page */
  .tool-content-grid { grid-template-columns: 1fr; }
  .tool-content-sidebar { position: static; }
  .tool-steps { grid-template-columns: 1fr; gap: 12px; }
  .tool-hero__inner { flex-direction: column; }
  .tool-hero__rating { align-self: flex-start; }

  /* Blog */
  .single-post__layout { grid-template-columns: 1fr; }
  .single-post__sidebar { position: static; display: none; }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-brand { grid-column: 1 / -1; }

  /* Steps */
  .steps-row {
    flex-direction: column;
    align-items: center;
    gap: 0;
  }
  .step { max-width: 100%; width: 100%; padding: 20px 0; display: flex; align-items: flex-start; text-align: left; gap: 20px; }
  .step__num { margin: 0; flex-shrink: 0; }
  .step__icon { display: none; }
  .step-arrow { transform: rotate(90deg); margin: 0 auto; }
}

/* ── MD: 768px ── */
@media (max-width: 768px) {

  /* Typography */
  h1 { font-size: 28px; }
  h2 { font-size: 24px; }

  /* Container */
  :root { --container-pad: 16px; }

  /* Hero */
  .hero { padding: 48px 0 40px; }
  .hero__title { font-size: 32px; }
  .hero__subtitle { font-size: 15px; }
  .hero__stats { gap: 16px; flex-wrap: wrap; justify-content: center; }
  .hero__stat-value { font-size: 22px; }
  .hero__ctas { flex-direction: column; align-items: stretch; }
  .hero__ctas .btn { text-align: center; }

  /* Search bar */
  .hero-search-bar { flex-wrap: wrap; border-radius: 16px; padding: 12px 16px; gap: 8px; }
  .hero-search-btn { width: 100%; justify-content: center; border-radius: 10px; }

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

  /* Categories */
  .categories-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .categories-grid--compact { grid-template-columns: repeat(3, 1fr); }

  /* Why grid */
  .why-grid { grid-template-columns: 1fr 1fr; }

  /* Section headers */
  .section-header { flex-direction: column; align-items: flex-start; }
  .section-header .section-see-all { align-self: flex-start; }

  /* Blog grid */
  .blog-grid { grid-template-columns: 1fr; }

  /* Tool hero */
  .tool-hero__left { flex-direction: column; }
  .tool-hero__icon { width: 56px; height: 56px; font-size: 28px; }
  .tool-hero__title { font-size: 22px; }

  /* Tool steps */
  .tool-steps { grid-template-columns: 1fr; }

  /* CTA band */
  .cta-band { flex-direction: column; text-align: center; }
  .cta-band__text { text-align: center; }

  /* Newsletter */
  .newsletter-inner { flex-direction: column; gap: 20px; }
  .newsletter-input-row { flex-direction: column; }
  .newsletter-btn { width: 100%; justify-content: center; }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-newsletter { padding: 40px 0; }

  /* Category hero */
  .cat-hero__inner { flex-direction: column; }
  .cat-hero__icon { width: 60px; height: 60px; font-size: 30px; }

  /* Filter tabs */
  .filter-tabs { gap: 6px; }
  .filter-tab { font-size: 12px; padding: 6px 12px; }

  /* Page hero */
  .page-hero { padding: 40px 0 32px; }
  .page-hero__title { font-size: 26px; }
}

/* ── SM: 640px ── */
@media (max-width: 640px) {

  /* Tools grid - single column */
  .tools-grid--3col,
  .tools-grid--4col,
  .tools-grid--2col { grid-template-columns: 1fr; }

  /* Categories */
  .categories-grid { grid-template-columns: repeat(2, 1fr); }
  .categories-grid--compact { grid-template-columns: repeat(2, 1fr); }

  /* Why grid */
  .why-grid { grid-template-columns: 1fr; }

  /* Steps inline */
  .step { flex-direction: column; text-align: center; align-items: center; }
  .step__num { margin: 0 auto 12px; }

  /* Tool hero meta */
  .tool-hero__meta { flex-wrap: wrap; }
  .tool-hero__inner { flex-direction: column; gap: 16px; }

  /* Footer */
  .footer-grid { grid-template-columns: 1fr; }
  .footer-main { padding: 40px 0 32px; }

  /* Breadcrumb */
  .breadcrumb__list { font-size: 12px; }

  /* Section title */
  .section-title { font-size: 22px; }

  /* Post meta */
  .post-meta { flex-wrap: wrap; gap: 8px; }

  /* Sidebar facts */
  .sidebar-facts li { font-size: 12px; }

  /* Search toggle */
  .search-toggle { width: 32px; height: 32px; }

  /* Hero search */
  .hero__search { margin-bottom: 24px; }

  /* Stats */
  .hero__stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    text-align: center;
  }
  .hero__stat-value { font-size: 20px; }
  .hero__stat-label { font-size: 10px; }

  /* Trust bar */
  .tool-trust-bar { gap: 12px; font-size: 11px; flex-wrap: wrap; justify-content: center; }

  /* FAQ */
  .faq-question { padding: 14px 16px; font-size: 14px; }
  .faq-answer { padding: 0 16px 14px; }

  /* Tool meta badges */
  .tool-meta-badge { font-size: 11px; padding: 3px 8px; }
}

/* ── XS: 480px ── */
@media (max-width: 480px) {
  .hero__title { font-size: 28px; letter-spacing: -0.02em; }
  .tool-hero__title { font-size: 20px; }
  .cat-hero__title { font-size: 22px; }
  .single-post__title { font-size: 22px; }

  .categories-grid { grid-template-columns: repeat(2, 1fr); }

  .back-to-top { bottom: 16px; right: 16px; width: 40px; height: 40px; }

  /* Iframe container - allow scroll on mobile */
  .tool-iframe-container { overflow: auto; -webkit-overflow-scrolling: touch; }

  /* Header logo sub text - hide on very small screens */
  .logo-sub { display: none; }

  /* Footer bottom */
  .footer-bottom__inner { flex-direction: column; text-align: center; gap: 8px; }

  /* Newsletter */
  .newsletter-title { font-size: 20px; }

  /* Blog card */
  .blog-card__title { font-size: 16px; }
}

/* ── PRINT STYLES ── */
@media print {
  .site-header,
  .site-footer,
  .tool-embed-section,
  .back-to-top,
  .breadcrumb,
  .filter-tabs { display: none !important; }

  body { font-size: 12pt; color: black; background: white; }
  a { color: black; text-decoration: underline; }
  .tool-hero { border: 1px solid #ccc; padding: 16pt; }
}
