/* === Responsive === */

/* Tablet */
@media (max-width: 1024px) {
  .sidebar { width: 320px; }
  .header__subtitle { display: none; }
}

/* Mobile */
@media (max-width: 768px) {
  :root {
    --header-height: 48px;
    --timeline-height: 0px;
  }

  .header__title { font-size: 0.95rem; }
  .hamburger { display: flex; }
  .header__subtitle { display: none; }

  .main { flex-direction: column; }

  .map-container {
    height: calc(100vh - var(--header-height) - 44px);
    min-height: 300px;
    flex: none;
  }

  /* Hide timeline on mobile — not enough room */
  .timeline-container {
    display: none;
  }

  /* Bottom sheet sidebar */
  .sidebar {
    width: 100%;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 55vh;
    border-left: none;
    border-top: 1px solid var(--border);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    box-shadow: var(--shadow-xl);
    transform: translateY(calc(100% - 56px));
    transition: transform var(--transition-slow);
    z-index: 800;
  }

  .sidebar--expanded { transform: translateY(0); }
  .sidebar--collapsed {
    transform: translateY(calc(100% - 56px));
    position: fixed;
    right: auto;
  }

  .sidebar__drag-handle {
    display: block;
    width: 36px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 8px auto 4px;
  }

  .sidebar-toggle { display: none; }

  /* Filter modal */
  .filter-panel {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: var(--bg-card);
    overflow-y: auto;
    padding: 20px;
    border: none;
    border-radius: 0;
  }

  /* Hide desktop ads on mobile, allow mobile footer ad */
  .ad-slot--header,
  .ad-slot--sidebar { display: none !important; }
  .ad-slot--mobile-footer.ad-slot--loaded {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9000;
  }

  /* Leaflet attribution — compact on mobile */
  .leaflet-control-attribution {
    font-size: 8px !important;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .footer {
    display: none;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  .map-container {
    height: calc(100vh - var(--header-height) - 44px);
    min-height: 250px;
  }

  .sidebar { height: 60vh; }
  .event-card { padding: 10px 14px; }
  .event-card__title { font-size: 0.78rem; }
  .last-updated { display: none; }
}

/* Large desktop */
@media (min-width: 1280px) {
  .sidebar { width: 400px; }
  .header { padding: 0 28px; }
  .header__subtitle { display: inline; }
}

/* Print */
@media print {
  .sidebar, .ad-slot, .timeline-container, .footer, .header__actions {
    display: none !important;
  }
  .map-container { height: 100vh; }
}
