/* ==================================================
   TABLET / RESPONSIVE
   ================================================== */

@media (max-width:980px) {

  :root {
    --header-h: 76px;
  }

  .container {
    width: min(calc(100% - 28px), var(--max));
  }

  /* NAVEGACIÓ */

  .nav-links {
    position: fixed;
    top: var(--header-h);
    left: auto;
    right: 14px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: max-content;
    min-width: max-content;
    padding: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    z-index: 1000;
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links a {
    display: block;
    padding: 12px 18px;
    white-space: nowrap;
    transition: background-color .2s ease, color .2s ease;
  }

  .nav-links a + a {
    border-top: 1px solid var(--vigar-red);
  }

  .nav-links a:hover {
    background: var(--vigar-red);
    color: #fff;
  }

  .nav-links a::after {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }

  .nav-actions .btn {
    display: none;
  }

  .brand img {
    width: 150px;
  }

  /* HERO */

  /* FEATURES */

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

  .feature:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--border);
  }

  .feature:nth-child(4) {
    border-top: 1px solid var(--border);
  }

  /* CARDS */

  /* GALERIA GENERAL */

  /* FOOTER */


  /* ==================================================
     ESPAI - TABLET I MÒBIL
     ================================================== */

  .map-photo-row {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* Primer foto exterior, després mapa */

  .space-photo {
    order: 1;
  }

  .map-block {
    order: 2;
  }

  /* Galeria de l'aula en una columna */

  .gallery-four {
    grid-template-columns: 1fr;
    gap: 16px;
  }

}


/* ==================================================
   MÒBIL
   ================================================== */

@media (max-width:640px) {

  /* CAPÇALERA */

  .brand img {
    width: 138px;
    height: 48px;
  }

  /* HERO */

  .hero {
    padding-top: 20px;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

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

  /* FEATURES */

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

  .feature {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .feature:nth-child(2) {
    border-left: 1px solid var(--border);
  }

  .feature:nth-child(3) {
    border-left: 0;
  }

  .feature h3 {
    font-size: .95rem;
  }

  .feature p {
    font-size: .82rem;
  }

  /* CARDS */

  /* SPLIT */

  /* GALERIA GENERAL */

  /* INFO */

  /* FOOTER */

  .footer-bottom {
    flex-direction: column;
  }


  /* ==================================================
     ESPAI - AJUSTOS ESPECÍFICS MÒBIL
     ================================================== */

  .space-photo {
    min-height: 320px;
  }

  .map-embed {
    height: 280px;
  }

  .map-info {
    padding: 18px 20px 20px;
  }

  .gallery-photo {
    min-height: 240px;
  }

}