/* Ömer erklärt C – Responsive Styles
 * Wird in alle unit*_website.html und unit*_arbeitsblatt.html eingebunden.
 * Ergänzt die bestehenden Inline-Styles um mobile Breakpoints.
 */

/* ── Tablet (≤900px) ──────────────────────────────────────────────── */
@media (max-width: 900px) {

  /* TopNav: Crumb ausblenden, Buttons kleiner */
  .topnav-crumb { display: none; }
  .topnav { padding: 0 16px; gap: 10px; }
  .nav-btn { padding: 5px 10px; font-size: 12px; }

  /* Hero: Ömer-Bild kleiner */
  .hero-inner {
    grid-template-columns: 1fr 140px;
    padding: 24px 20px 0;
  }
  .hero h1 { font-size: 28px; }
  .hero-sub { font-size: 13px; }

  /* Layout: Sidebar schmaler */
  :root { --sidebar-w: 200px; }

  /* Orange-Strip: wrap */
  .orange-strip { flex-wrap: wrap; gap: 10px; padding: 10px 20px; }

  /* Arbeitsblatt Header */
  .header-content { padding: 20px 20px 16px; }
  .header-title { font-size: 26px; }
  .header-oemer { width: 120px; }
  .page-body { padding: 24px 20px; }
}

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

  /* ── TopNav ─────────────────────────────────────────────────────── */
  .topnav { height: auto; min-height: 52px; flex-wrap: wrap; padding: 8px 14px; gap: 8px; }
  .topnav-sep { display: none; }
  .topnav-right { width: 100%; justify-content: flex-start; flex-wrap: wrap; gap: 6px; margin-left: 0; }
  .nav-btn { padding: 4px 10px; font-size: 11px; }

  /* ── Hero Banner ─────────────────────────────────────────────────── */
  .hero-inner {
    grid-template-columns: 1fr;
    padding: 20px 16px 0;
  }
  .hero-oemer { display: none; }   /* Ömer-Bild im Hero auf Mobil verstecken */
  .hero h1 { font-size: 24px; }
  .hero-text { padding-bottom: 20px; }
  .hero-sub { font-size: 13px; max-width: 100%; }
  .progress-bar-outer { max-width: 200px; }

  /* ── Layout: Sidebar wird zur horizontalen Tab-Leiste ────────────── */
  .layout {
    grid-template-columns: 1fr !important;
    padding: 0;
  }

  .sidebar {
    position: static !important;
    max-height: none !important;
    border-right: none !important;
    border-bottom: 2px solid #E0DBD0;
    padding: 0 !important;
    display: flex;
    flex-direction: column;
    background: #FAF8F5;
  }

  /* Kapitel-Einheiten-Liste auf Mobil ausblenden */
  .sidebar .sidebar-section:last-child { display: none; }

  /* Inhalt-Navigation als horizontale Scroll-Tabs */
  .sidebar .sidebar-section:first-child {
    margin: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .sidebar .sidebar-section:first-child .sidebar-heading { display: none; }
  .sidebar .sidebar-section:first-child {
    display: flex;
    flex-direction: row;
    gap: 0;
  }
  .sidebar-link {
    border-left: none !important;
    border-bottom: 3px solid transparent;
    padding: 10px 14px !important;
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 13px !important;
  }
  .sidebar-link.active {
    border-left-color: transparent !important;
    border-bottom-color: var(--orange, #F28C28) !important;
    background: rgba(242,140,40,0.08) !important;
  }

  /* ── Content ─────────────────────────────────────────────────────── */
  .content { padding: 20px 16px; }

  /* ── Ömer-Sprechblase ────────────────────────────────────────────── */
  .oemer-speech, .oemer-intro {
    flex-direction: column;
    gap: 10px;
  }
  .oemer-mini, .oemer-small { width: 48px; }

  /* ── Code-Blöcke ─────────────────────────────────────────────────── */
  .code-block pre,
  pre { font-size: 12px; overflow-x: auto; }

  /* ── Quiz ────────────────────────────────────────────────────────── */
  .quiz-card { padding: 16px; }
  .quiz-options { gap: 8px; }
  .quiz-option { padding: 10px 12px; font-size: 13px; }

  /* ── Arbeitsblatt-Header ─────────────────────────────────────────── */
  .page-header { grid-template-columns: 1fr; min-height: auto; }
  .header-oemer { display: none; }
  .header-content { padding: 18px 16px 14px; }
  .header-title { font-size: 22px; }
  .orange-strip { flex-wrap: wrap; gap: 8px; padding: 8px 16px; font-size: 11px; }
  .page-body { padding: 20px 16px; padding-bottom: 80px; /* Platz für Status-Bar */ }

  /* ── Exercise-Blöcke ─────────────────────────────────────────────── */
  .exercise-block { padding: 16px; }

  /* ── Footer ──────────────────────────────────────────────────────── */
  footer, .page-footer { padding: 12px 16px; font-size: 12px; text-align: center; }
}

/* ── Kleines Handy (≤480px) ───────────────────────────────────────── */
@media (max-width: 480px) {

  .topnav-brand { font-size: 15px; }
  .nav-btn { padding: 4px 8px; font-size: 10px; }

  .hero h1 { font-size: 20px; }
  .hero-badge { font-size: 9px; padding: 3px 10px; }

  .header-title { font-size: 19px; }

  /* interaktive Status-Bar (interactive.js) bleibt lesbar */
  #oemer-bar {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 6px !important;
    padding: 8px 14px !important;
    font-size: 0.78rem !important;
  }
  #oemer-bar > div:last-child { align-self: stretch; justify-content: flex-end; }
}

/* ── Drucken: Sidebar und Nav ausblenden ─────────────────────────── */
@media print {
  .topnav, .sidebar, #oemer-bar, #oemer-quiz-cta { display: none !important; }
  .layout { grid-template-columns: 1fr !important; }
  .content { padding: 0 !important; }
}
