/* ─────────────────────────────────────────────────────────────────────────
   Case-study mobile typography & layout tightening
   Loaded LAST on every project detail page, so it can use !important
   sparingly and still beat earlier desktop rules.
   ──────────────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {

  /* ── Container & section rhythm ── */
  .main-content {
    padding-left: 18px !important;
    padding-right: 18px !important;
  }
  .content-section {
    margin-bottom: 48px !important;
  }
  .content-section.cs-section,
  .content-section.cs-section-alt,
  section[class*="content-section"] {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  .cs-wrap { padding: 0 !important; }
  /* Center hero overlay padding */
  .hero-image, .hero-image-wrapper { border-radius: 14px !important; }

  /* ── Big inline Times serif statements (used as section openers) ── */
  h2[style*="Times New Roman"],
  h2[style*="font-size: 36px"],
  h2[style*="font-size:36px"] {
    font-size: clamp(22px, 6.4vw, 28px) !important;
    margin-bottom: 28px !important;
    padding: 0 4px !important;
    line-height: 1.3 !important;
  }
  /* The wrapping content blocks for those headlines */
  section[id="research-question"] .section-content,
  section[id="problem-framing"] .section-content,
  section[id="problem-statement"] .section-content,
  section[id="research-insight"] .section-content,
  section[id="solution-overview"] .section-content,
  section[id="outcome"] .section-content,
  section[id="reflection"] .section-content {
    padding: 28px 0 !important;
  }

  /* ── Big stat numbers (52px / 72px / 48px) ── */
  div[style*="font-size: 72px"],
  div[style*="font-size:72px"] {
    font-size: clamp(40px, 11vw, 56px) !important;
  }
  div[style*="font-size: 52px"],
  div[style*="font-size:52px"] {
    font-size: clamp(34px, 9vw, 44px) !important;
  }
  div[style*="font-size: 48px"],
  div[style*="font-size:48px"] {
    font-size: clamp(32px, 8.5vw, 40px) !important;
  }

  /* ── Class-based headlines ── */
  .cs-title { font-size: clamp(22px, 6.5vw, 28px) !important; line-height: 1.25 !important; max-width: 100% !important; }
  .cs-sub { font-size: 15px !important; line-height: 1.55 !important; }
  .cs-eyebrow { font-size: 10px !important; letter-spacing: 0.14em !important; }
  .section-title {
    font-size: clamp(20px, 5.6vw, 24px) !important;
    line-height: 1.3 !important;
    margin-bottom: 16px !important;
  }
  .section-content h3 { font-size: 17px !important; line-height: 1.35 !important; margin-bottom: 8px !important; }
  .section-content p, .section-content li {
    font-size: 15px !important;
    line-height: 1.6 !important;
  }
  .project-title {
    font-size: clamp(24px, 7vw, 30px) !important;
    line-height: 1.2 !important;
  }
  .project-subtitle, .hero-subtitle {
    font-size: 16px !important;
    line-height: 1.5 !important;
  }

  /* ── Two-column / grid sections collapse ── */
  .two-column-section,
  .two-column-overview,
  .analysis-two-column,
  .project-meta-below,
  .meta-grid {
    grid-template-columns: 1fr !important;
    gap: 22px !important;
  }
  /* Inline grid-template-columns overrides used inside cs sections */
  div[style*="grid-template-columns: 1fr 1fr"],
  div[style*="grid-template-columns:1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr 1fr"],
  div[style*="grid-template-columns:1fr 1fr 1fr"],
  div[style*="grid-template-columns: repeat(2"],
  div[style*="grid-template-columns: repeat(3"] {
    grid-template-columns: 1fr !important;
    gap: 18px !important;
  }

  /* Card-like blocks tighten */
  .cs-card {
    padding: 18px !important;
    border-radius: 14px !important;
  }
  .cs-card-label { font-size: 10px !important; letter-spacing: 0.12em !important; margin-bottom: 10px !important; }
  .cs-card-body { font-size: 14px !important; line-height: 1.55 !important; }

  /* ── Meta columns ── */
  .meta-column h3 {
    font-size: 11px !important;
    letter-spacing: 0.14em !important;
    margin-bottom: 6px !important;
  }
  .meta-column p { font-size: 14px !important; line-height: 1.5 !important; }

  /* ── Inline padding monsters ── */
  section[style*="padding: 60px 0"],
  section[style*="padding:60px 0"],
  div[style*="padding: 60px 0"],
  div[style*="padding:60px 0"] {
    padding: 32px 0 !important;
  }
  div[style*="padding: 24px"],
  div[style*="padding:24px"] {
    padding: 16px !important;
  }
  div[style*="margin-bottom: 60px"],
  div[style*="margin-bottom:60px"],
  h2[style*="margin-bottom: 60px"],
  h2[style*="margin-bottom:60px"] {
    margin-bottom: 28px !important;
  }
  div[style*="margin-bottom: 40px"],
  div[style*="margin-bottom:40px"] {
    margin-bottom: 22px !important;
  }

  /* ── Images & media ── */
  img, video, picture, iframe {
    max-width: 100% !important;
    height: auto !important;
  }
  /* Forced inline pixel widths on figures */
  div[style*="height: 200px"],
  div[style*="height:200px"] { height: auto !important; min-height: 140px; }

  /* ── Iframe wrappers (interactive demos) ── */
  .interactive-iframe-wrapper iframe {
    height: 60vh !important;
    min-height: 380px !important;
  }

  /* ── Password/button blocks ── */
  .password-section input, .password-section button {
    font-size: 16px !important;
  }

  /* ── Hero overlay text (project title at top of page) ── */
  .hero-overlay h1, .hero-text h1, .project-meta h1 {
    font-size: clamp(26px, 7.5vw, 34px) !important;
    line-height: 1.15 !important;
  }
  .hero-overlay p { font-size: 14px !important; line-height: 1.5 !important; }

  /* ── Sticker / quote blocks ── */
  .sticker-note { padding: 14px !important; }
  .sticker-note p { font-size: 14px !important; line-height: 1.55 !important; }

  /* Reduce huge gaps */
  section[style*="padding: 80px"] { padding: 40px 0 !important; }
}

/* Extra-small phones */
@media (max-width: 380px) {
  h2[style*="Times New Roman"] { font-size: 21px !important; }
  .project-title { font-size: 22px !important; }
  div[style*="font-size: 72px"] { font-size: 36px !important; }
  div[style*="font-size: 52px"] { font-size: 30px !important; }
}
