/* ==========================================================================
   Kiddoo Play School - Responsive Overrides (mobile-first breakpoints)
   ========================================================================== */

@media (max-width: 992px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .hero .container {
    grid-template-columns: 1fr;
  }

  .hero-visual {
    order: -1;
  }

  .nav-toggle {
    display: flex;
  }

  .main-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
    background-color: var(--surface);
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-md);
    box-shadow: var(--shadow-md);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    /* visibility (not just opacity) is what actually removes the closed menu
       from the tab order and the accessibility tree - without it all 5 links
       stayed keyboard-focusable while invisible. It's transitioned so the
       fade-out still plays. */
    visibility: hidden;
    transition: transform 0.2s ease, opacity 0.2s ease, visibility 0.2s;
  }

  .main-nav.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
  }

  .nav-links {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
    width: 100%;
  }

  .main-nav .btn {
    margin-top: var(--space-sm);
    width: 100%;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-brand {
    justify-content: center;
  }

  /* No !important needed now that .contact-layout has a real base rule in
     components.css instead of an inline style attribute. */
  .contact-layout {
    grid-template-columns: 1fr;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    flex-direction: row;
    border-right: none;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
  }
}

@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .gallery-filters {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 0.5rem;
  }
}
