/* =====================================================
   Responsive global — 3 breakpoints (ver tokens.css)
   Desktop ≥1024 | Tablet 768–1023 | Móvil ≤767
   ===================================================== */

/* ===================== DESKTOP ≥1024 ===================== */
@media (min-width: 1024px) {
  header {
    --header-padding-top: 0.55rem;
    --header-nav-margin-block: 0.35rem;
    padding: var(--header-padding-top) 0 0;
  }

  #nav-container {
    margin: var(--header-nav-margin-block) 0 0.55rem;
    padding-inline: var(--layout-inline-pad);
    width: 100%;
  }

  /* Compact cluster — no space-evenly / flex-grow (those stretched edge-to-edge) */
  .nav-menu {
    justify-content: center;
    gap: var(--nav-link-gap);
    max-width: var(--nav-menu-max-width);
    width: max-content;
    padding: 0.25rem 0.5rem;
    flex-wrap: nowrap;
  }

  .nav-menu li {
    flex: 0 0 auto;
    text-align: center;
  }

  .nav-menu a {
    display: inline-block;
    padding: 0.35em 0.55em;
    font-size: var(--nav-link-size);
  }
}

/* ===================== TABLET 768–1023 ===================== */
@media (min-width: 768px) and (max-width: 1023px) {
  header {
    --header-padding-top: 0.5rem;
    padding: var(--header-padding-top) 0 0;
  }

  #nav-container {
    margin: 0.3rem 0 0.45rem;
  }

  .content-card,
  main > section {
    padding: 1.75em 1.25em;
    margin: 1.25rem;
  }

  .page-title,
  .content-card h2,
  section h2 {
    font-size: 2em;
  }
}

/* ===================== MÓVIL ≤767 ===================== */
@media (max-width: 767px) {
  header {
    --header-padding-top: 0.45rem;
    padding: var(--header-padding-top) 0;
    background-image: var(--overlay-header), url('../images/bateria-champetera-atardecer-mobile.webp');
  }

  /* Título | tema | hamburguesa */
  #header-container {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 0.35rem 0.4rem;
    width: 100%;
    padding-inline: 0.55rem 0.35rem;
    box-sizing: border-box;
  }

  #header-container .title {
    margin: 0;
    padding: 0;
    text-align: left;
    font-size: clamp(1.15rem, 4.8vw, 1.55rem);
    line-height: 1.2;
  }

  #header-container .theme-toggle--header {
    position: static;
    top: auto;
    right: auto;
    padding: 0.3em 0.55em;
    font-size: 0.75rem;
    border-width: 2px;
  }

  #nav-container {
    margin: 0;
    width: auto;
    max-width: none;
    padding-inline: 0;
  }

  main {
    justify-content: flex-start;
    padding: 0.75rem 0;
  }

  .content-card,
  main > section {
    padding: 1.5em 1em;
    margin: 1rem;
  }

  .page-title,
  .content-card h2,
  section h2 {
    font-size: 1.8em;
  }

  section p,
  .content-card p {
    font-size: var(--font-size-sm);
  }

  .cta-button {
    padding: 0.7em 1.5em;
    font-size: var(--font-size-sm);
  }

  .modal-content {
    padding: 1.5rem;
    margin: 1rem;
    width: 95%;
  }

  .modal-content h3 {
    font-size: var(--font-size-2xl);
  }

  .modal-content p {
    font-size: var(--font-size-sm);
  }

  .ticker-content {
    animation-duration: 40s;
  }
}

/* Ajuste fino móvil muy estrecho */
@media (max-width: 360px) {
  #header-container .title {
    font-size: 1.05rem;
  }

  main > section,
  .content-card {
    margin: 0.8rem 0.6rem;
    padding: 1.2em 0.9em;
  }
}

/* Preferencias de accesibilidad */
@media (prefers-reduced-motion: reduce) {
  .nav-hamburger span {
    transition: none;
  }
}
