/* ==========================================================================
   Star Musical Entertainer — footer responsive layer
   Loaded last.

   The problem: the footer holds three link lists (9 quick links, 9 services,
   4 contact rows) plus a brand block and a legal bar. With the 44px touch
   tap-target rule applied, each link occupied about 52px, so the footer ran
   to roughly 1,676px on a phone — more than four screens of scrolling before
   a visitor reaches the copyright line.

   The fix keeps every link reachable and every tap target comfortable, but
   lays the lists out in two columns and tightens the surrounding blocks.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tablet
   Four columns become two, and the brand block spans the full width so its
   description does not sit in a narrow strip.
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sp-6) var(--sp-5);
  }

  .footer-brand { grid-column: 1 / -1; }
  .footer-about { max-width: 62ch; }
}

/* --------------------------------------------------------------------------
   2. Phone
   The single biggest saving: link lists run in two columns instead of one.
   Nine links become five rows rather than nine, halving the height while tap
   targets stay a comfortable 44px.
   -------------------------------------------------------------------------- */

@media (max-width: 640px) {
  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-5);
  }

  .site-footer { padding-top: clamp(2.25rem, 8vw, 3rem); }

  /* Two-column link lists. */
  .footer-links {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--sp-1) var(--sp-4);
  }

  .footer-links a {
    /* Comfortable to tap without the excessive 44px block height. */
    min-height: 40px;
    font-size: .84rem;
    padding-block: 2px;
  }

  /* The services list is long; a slightly smaller size keeps two columns
     readable without wrapping every entry onto three lines. */
  .footer-links a { line-height: 1.35; }

  /* Section headings sit tighter to their list. */
  .footer h4 {
    margin-bottom: var(--sp-3);
    font-size: .74rem;
    letter-spacing: .16em;
  }

  /* Brand block. */
  .footer-brand { text-align: center; }
  .footer-logo-plate { margin-inline: auto; }
  .footer-about {
    font-size: .84rem;
    margin-inline: auto;
    max-width: 46ch;
  }
  .social-links { justify-content: center; }

  /* Contact rows stay single-column: each is a distinct piece of
     information and would be unreadable split across two. */
  .footer-contact { gap: var(--sp-3); }
  .footer-contact-item { font-size: .84rem; }

  /* Legal bar. */
  .footer-bottom {
    flex-direction: column;
    gap: var(--sp-3);
    text-align: center;
    padding-block: var(--sp-5);
  }
  .footer-legal {
    justify-content: center;
    gap: var(--sp-2) var(--sp-4);
    flex-wrap: wrap;
  }
  .footer-legal a { font-size: .78rem; }
}

/* --------------------------------------------------------------------------
   3. Collapsible sections on phones
   Even two-column lists add height. Each footer section becomes a disclosure
   that is closed by default, so the footer opens at roughly one screen and
   the visitor expands only what they want.

   The markup uses <details>/<summary>, which needs no JavaScript and stays
   fully accessible and crawlable — search engines read closed content.
   -------------------------------------------------------------------------- */

@media (max-width: 640px) {
  .footer-section { border-top: 1px solid rgba(212,165,66,.16); }
  .footer-section:first-of-type { border-top: 0; }

  .footer-section > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-3);
    padding: var(--sp-4) 0;
    cursor: pointer;
    list-style: none;
    font-family: var(--font-accent);
    font-size: .78rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--gold);
    min-height: 44px;
  }

  /* Remove the native disclosure triangle in every engine. */
  .footer-section > summary::-webkit-details-marker { display: none; }
  .footer-section > summary::marker { content: ''; }

  /* Chevron indicator, rotated when open. */
  .footer-section > summary::after {
    content: '';
    width: 9px;
    height: 9px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translate(-2px, -2px);
    transition: transform var(--dur) var(--ease);
    flex-shrink: 0;
  }
  .footer-section[open] > summary::after {
    transform: rotate(-135deg) translate(-2px, -2px);
  }

  .footer-section > summary:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
  }

  .footer-section-body { padding-bottom: var(--sp-4); }

  /* The heading inside is redundant once summary carries the label. */
  .footer-section .footer-section-body > h4 { display: none; }
}

/* Above 640px the disclosure behaves as a plain block: always visible, with
   no summary row, matching the existing desktop design exactly. */
@media (min-width: 641px) {
  .footer-section > summary { display: none; }
  .footer-section > .footer-section-body { display: block !important; }
}

/* --------------------------------------------------------------------------
   4. Small phone
   -------------------------------------------------------------------------- */

@media (max-width: 400px) {
  /* Below this width two columns of long service names wrap awkwardly, so
     the services list returns to a single column while the shorter quick
     links stay two-up. */
  .footer-links--long { grid-template-columns: minmax(0, 1fr); }

  .footer-brand img { width: 150px; }
  .footer-about { font-size: .8rem; }
}

/* --------------------------------------------------------------------------
   5. Reduced motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .footer-section > summary::after { transition: none; }
}
