/* ============================================================
   Digital Warrior Academy — Responsive Styles
   Desktop  ≥ 1025px  (default, no query needed)
   Tablet   769–1024px
   Mobile   ≤ 768px
   ============================================================ */

/* ── elements hidden on desktop, shown only on mobile ──────── */
.dwa-menu-btn    { display: none; }
.dwa-mobile-nav  { display: none; }

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

  /* Section gutters */
  .wp-block-group.alignfull {
    padding-left: 28px !important;
    padding-right: 28px !important;
  }

  /* Codec article grid: 3 → 2 columns */
  .wp-block-post-template {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Footer: 4-col → 2×2 */
  .dwa-footer > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr 1fr !important;
  }

  /* Course/About inline 2-col grids → slightly narrower gap */
  div[style*="grid-template-columns:1fr 1.4fr"],
  div[style*="grid-template-columns: 1fr 1.4fr"] {
    gap: 40px !important;
  }

  /* Tutorial sidebar: reduce fixed width */
  div[style*="grid-template-columns:220px"],
  div[style*="grid-template-columns: 220px"] {
    grid-template-columns: 180px 1fr !important;
    gap: 40px !important;
  }

}

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

  /* ── Section gutters ────────────────────────────────────── */
  .wp-block-group.alignfull,
  .wp-block-group[style*="padding-left:40px"],
  .wp-block-group[style*="padding-left: 40px"] {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  /* ── Vertical padding: hero ─────────────────────────────── */
  .wp-block-group[style*="padding-top:180px"],
  .wp-block-group[style*="padding-top: 180px"],
  .wp-block-group[style*="padding-top:160px"],
  .wp-block-group[style*="padding-top: 160px"] {
    padding-top: 100px !important;
  }

  /* ── Vertical padding: content sections ─────────────────── */
  .wp-block-group[style*="padding-top:120px"],
  .wp-block-group[style*="padding-top: 120px"],
  .wp-block-group[style*="padding-top:100px"],
  .wp-block-group[style*="padding-top: 100px"],
  .wp-block-group[style*="padding-top:80px"],
  .wp-block-group[style*="padding-top: 80px"] {
    padding-top: 56px !important;
  }
  .wp-block-group[style*="padding-bottom:120px"],
  .wp-block-group[style*="padding-bottom: 120px"],
  .wp-block-group[style*="padding-bottom:100px"],
  .wp-block-group[style*="padding-bottom: 100px"],
  .wp-block-group[style*="padding-bottom:80px"],
  .wp-block-group[style*="padding-bottom: 80px"] {
    padding-bottom: 56px !important;
  }

  /* ── All inline multi-column grids → single column ─────── */
  /* Targets every div that has an explicit grid-template-columns
     inline style (all our page content sections & footer).
     Exceptions (.dwa-cohort, .dwa-faq-item) get their own rules
     in dwa-custom.css and use class-based grids, not inline. */
  div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }

  /* ── Article query grid → 1 column ─────────────────────── */
  .wp-block-post-template {
    grid-template-columns: 1fr !important;
  }

  /* ── Tutorial: sidebar TOC stacks above content ─────────── */
  div[style*="grid-template-columns:220px"],
  div[style*="grid-template-columns: 220px"] {
    display: block !important;
  }
  div[style*="position:sticky"][style*="top:120px"],
  div[style*="position: sticky"] {
    position: static !important;
    margin-bottom: 40px;
    top: auto !important;
  }

  /* ── Header ─────────────────────────────────────────────── */
  .dwa-header {
    padding: 14px 20px !important;
  }
  .dwa-nav      { display: none !important; }
  .dwa-btn-header { display: none !important; }
  .dwa-menu-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
  }

  /* ── Mobile nav overlay ──────────────────────────────────── */
  .dwa-mobile-nav {
    position: fixed;
    inset: 0;
    background: #14101e;
    z-index: 9999;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 28px;
    padding: 40px 20px;
  }
  .dwa-mobile-nav.dwa-open {
    display: flex !important;
  }
  .dwa-mobile-nav a {
    font-family: Anton, Impact, sans-serif !important;
    font-size: clamp(32px, 8vw, 52px) !important;
    color: #f6f3ee !important;
    text-decoration: none !important;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    line-height: 1;
    transition: color 0.15s;
    opacity: 1 !important;
  }
  .dwa-mobile-nav a:hover { color: #a78bfa !important; }
  .dwa-mobile-nav-cta {
    font-family: 'JetBrains Mono', monospace !important;
    font-size: 13px !important;
    letter-spacing: 0.15em !important;
    padding: 14px 28px;
    background: #5b21d6;
    color: #fff !important;
    margin-top: 12px;
  }
  .dwa-mobile-nav-cta:hover { background: #a78bfa; }
  .dwa-nav-close-btn {
    position: absolute;
    top: 18px;
    right: 20px;
    background: none;
    border: none;
    color: rgba(246,243,238,0.45);
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 6px;
    transition: color 0.15s;
  }
  .dwa-nav-close-btn:hover { color: #f6f3ee; }

  /* ── Single post content padding ────────────────────────── */
  /* Single post templates have 60px padding — reduce on mobile */
  .wp-block-group[style*="padding-top:60px"],
  .wp-block-group[style*="padding-top: 60px"] {
    padding-top: 36px !important;
  }
  .wp-block-group[style*="padding-bottom:60px"],
  .wp-block-group[style*="padding-bottom: 60px"] {
    padding-bottom: 36px !important;
  }

  /* ── Excerpt bar (spotlight template) ───────────────────── */
  .wp-block-group[style*="padding-top:36px"],
  .wp-block-group[style*="padding-top: 36px"] {
    padding-top: 24px !important;
  }

  /* ── Buttons: stack vertically on mobile ─────────────────── */
  .wp-block-buttons {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
  }
  .wp-block-buttons .wp-block-button {
    width: 100%;
  }
  .wp-block-buttons .wp-block-button__link {
    display: block !important;
    text-align: center !important;
    white-space: normal !important;
  }

  /* ── Images: full width ──────────────────────────────────── */
  .wp-block-image img,
  figure.wp-block-image {
    width: 100% !important;
    height: auto !important;
  }

  /* ── Cohort table: override to 1 col ────────────────────── */
  .dwa-cohort {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
  .dwa-cohort-status { text-align: left !important; }

  /* ── Contact grid ────────────────────────────────────────── */
  .dwa-contact-grid {
    grid-template-columns: 1fr !important;
    gap: 40px !important;
  }

  /* ── FAQ items ───────────────────────────────────────────── */
  .dwa-faq-item {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
}

/* ── Very small screens ≤ 480px ───────────────────────────── */
@media (max-width: 480px) {
  .wp-block-group.alignfull,
  .wp-block-group[style*="padding-left:40px"] {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  .wp-block-group[style*="padding-top:100px"],
  .wp-block-group[style*="padding-top:180px"],
  .wp-block-group[style*="padding-top:160px"] {
    padding-top: 80px !important;
  }
}
