/*
 * mobile.css — All responsive overrides for ≤768px
 *
 * RULE: This is the ONLY file that may contain @media queries.
 * No other CSS file should define breakpoints.
 * Sections added per phase as mobile behaviour is built out.
 */

@media (max-width: 768px) {

  /* ── P1: Navigation ─────────────────────────────────────── */

  /* Hide search bar on mobile — logo + grievance only */
  .nav__search {
    display: none;
  }

  .nav__inner {
    padding: 0 var(--space-md);
    justify-content: space-between;
  }

  /* ── P3: Map (hidden on mobile per PRD Section 9) ──────── */

  #map {
    display: none;
  }

  /* Panel must also be hidden — mobile uses full-width list/detail instead */
  #panel {
    display: none;
  }

  /* ── P4: Filter row (replaced by mobile filter in P8) ───── */

  #filter {
    display: none;
  }

  /* ── P8: Mobile filter form ─────────────────────────────── */

  #mobile-filter {
    display: block;
    background-color: var(--color-bg);
    border-bottom: 1px solid var(--color-border-light);
  }

  .mobile-filter__inner {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    padding: var(--space-md);
  }

  .mobile-filter__heading {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    letter-spacing: var(--letter-spacing-caps);
    text-transform: uppercase;
    color: var(--color-text-dark);
    margin-bottom: var(--space-xs);
  }

  .mobile-filter__select {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    background-color: var(--color-bg);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpolyline points='1,1 6,7 11,1' fill='none' stroke='%234a6080' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-sm);
    padding: var(--space-sm) var(--space-xl) var(--space-sm) var(--space-md);
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--color-text-dark);
    cursor: pointer;
  }

  .mobile-filter__select:focus {
    border-color: var(--color-navy);
    outline: none;
  }

  .mobile-filter__search-btn {
    width: 100%;
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-bold);
    letter-spacing: var(--letter-spacing-caps);
    text-transform: uppercase;
    color: var(--color-navy);
    background-color: var(--color-orange);
    border-radius: var(--radius-sm);
    padding: var(--space-md) var(--space-lg);
  }

  .mobile-filter__search-btn:active {
    background-color: var(--color-orange-dark);
  }

  /* ── P7: Carousel ───────────────────────────────────────── */

  /* Push arrows + dots to a bottom bar — add space for them */
  #carousel {
    padding-bottom: 48px;
  }

  /* Move arrows from vertical-centre to bottom of section */
  .carousel__arrow {
    top: auto;
    bottom: var(--space-sm);
    transform: none;
    width: 32px;
    height: 32px;
  }

  /* Absolutely position dots so arrows sit beside them */
  .carousel__dots {
    position: absolute;
    bottom: var(--space-sm);
    left: 50%;
    transform: translateX(-50%);
    padding-bottom: 0;
    white-space: nowrap;
  }

  /* Stack title + stats vertically, full-width padding */
  .carousel__slide-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: var(--space-md);
  }

  .carousel__slide {
    min-height: 0;
  }

  .carousel__title {
    flex: none;
    width: auto;
    font-size: var(--font-size-sm);
  }

  .carousel__stat {
    padding: 0 var(--space-md);
  }

  .carousel__stat:first-child {
    padding-left: 0;
  }

  .carousel__stat-value {
    font-size: var(--font-size-lg);
  }

  .carousel__stat-label {
    font-size: var(--font-size-xs);
  }

  /* ── P9: Footer ─────────────────────────────────────────── */

  .footer__inner {
    padding: var(--space-lg) var(--space-md);
  }

  /* Stack logo and disclaimer vertically on small screens */
  .footer__top {
    flex-direction: column;
    gap: var(--space-md);
  }

  /* ── P8: Panel — full-width in document flow on mobile ──── */

  #panel {
    position: static;
    width: 100%;
    min-width: 0;
    height: auto;
    max-height: calc(100vh - var(--nav-height));
    transform: none;
    transition: none;
    box-shadow: none;
    border-top: 1px solid var(--color-grey-border);
  }

  /* Hide via display rather than transform on mobile */
  #panel.panel--hidden {
    display: none;
  }

  #panel:not(.panel--hidden) {
    display: flex;
  }

  /* Cap scrollable areas so the panel doesn't grow taller than the viewport */
  #panel .panel__list-view,
  #panel .panel__detail-view {
    max-height: calc(100vh - var(--nav-height) - 60px);
  }

}
