/* The phone layer. Loaded after site.css.
   Three aims: everything a thumb touches is at least 44px, nothing is set
   smaller than 14px, and long pages are easy to move around in. */

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5.5rem; }
a, button, [role="button"], input, select, textarea, label { -webkit-tap-highlight-color: rgba(201, 168, 76, 0.25); touch-action: manipulation; }

/* The Contact shortcut and back-to-top exist for phones and small tablets only */
.c-nav__quick { display: none; }
.c-top { display: none; }

@media (max-width: 1023px) {
  /* ── Header: menu button a full thumb wide, Contact one tap away ── */
  .c-nav__bar { gap: 0.75rem; }
  .c-nav__name { margin-right: auto; }
  .c-nav .hamburger { min-width: 2.75rem; min-height: 2.75rem; align-items: center; justify-content: center; }
  .c-nav__quick {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 2.75rem; padding: 0 1rem;
    font-family: var(--sans); font-weight: 600; font-size: 0.95rem; letter-spacing: 0.02em;
    color: var(--gold); border: 1px solid var(--gold); border-radius: 2px; text-decoration: none;
  }
  .c-nav__quick:active, .c-nav__quick[aria-current="page"] { background: var(--gold); color: var(--night); }
  .c-nav__quick:has(+ .hamburger.open) { visibility: hidden; }
}
/* On a phone the name, Contact and the menu button share one row */
@media (max-width: 480px) {
  .c-nav__bar { gap: 0.5rem; padding: 0 1rem; }
  .c-nav__name { font-size: clamp(1rem, 4.6vw, 1.3rem); letter-spacing: 0.1em; min-width: 0; overflow: hidden; text-overflow: clip; }
  .c-nav__name.c-nav__mark { width: 2.6rem; height: 2.6rem; font-size: 1rem; letter-spacing: 0.06em; overflow: visible; }
  .c-nav__quick { padding: 0 0.75rem; font-size: 0.9rem; flex: none; }
  .c-nav .hamburger { flex: none; }
}
@media (max-width: 339px) { .c-nav__quick { display: none; } }

@media (max-width: 767px) {
  /* ── Reading size ─────────────────────────────────────── */
  main p, main li { font-size: max(1.0625rem, 1em); }
  body:not(.page-home) main .rich-content, body:not(.page-home) main .rich-content p, body:not(.page-home) main .rich-content li { font-size: 1.0938rem; line-height: 1.7; }
  main .text-xs, main .text-\[10px\], main .text-sm { font-size: 0.9375rem; line-height: 1.5; }
  main figcaption, .c-stage__credit, .g-item__credit { font-size: 0.875rem; }
  main input, main select, main textarea { font-size: 1rem; }   /* 16px: iOS does not zoom the page on focus */

  /* ── Touch sizes ──────────────────────────────────────── */
  main a.c-link { display: inline-flex; align-items: center; min-height: 2.75rem; }
  main p > a, main li > a, main a.text-gold, main a.text-sm { display: inline-block; padding-block: 0.7rem; margin-block: -0.35rem; }
  main button, main a.inline-block, main a.inline-flex, main [role="tab"], main input[type="submit"] { min-height: 2.75rem; }
  main input[type="checkbox"], main input[type="radio"] { width: 1.5rem; height: 1.5rem; flex: none; margin-top: 0.1rem; }
  main input[type="text"], main input[type="email"], main input[type="tel"], main input[type="search"], main select { min-height: 3rem; }
  .c-footer a { display: inline-flex; align-items: center; min-height: 2.75rem; }
  .c-menu a { min-height: 3.25rem; }

  /* ── Title band: tighter, so the page starts sooner ───── */
  main > div > section.bg-navy:first-child { padding-top: 2.75rem; padding-bottom: 2.25rem; }
  main > div > section.bg-navy:first-child h1 { font-size: clamp(2.5rem, 12vw, 3.25rem); overflow-wrap: anywhere; }
  main > div > section.bg-navy:first-child p { font-size: 1.0625rem; }
  body:not(.page-home) main .section-padding { padding-top: 3rem; padding-bottom: 3rem; }

  /* ── Repertoire: the sections become one swipeable strip that stays
        under the header while the list scrolls ── */
  #repertoire-tabs [role="tablist"] {
    position: sticky; top: 4.25rem; z-index: 5;
    flex-wrap: nowrap; justify-content: flex-start;
    overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
    margin: 0 calc(var(--gutter) * -1) 1.75rem; padding: 0.6rem var(--gutter);
    background: var(--paper);
    box-shadow: 0 10px 18px -16px rgba(26, 26, 46, 0.6);
  }
  #repertoire-tabs [role="tablist"]::-webkit-scrollbar { display: none; }
  #repertoire-tabs [role="tablist"] > * { flex: none; scroll-snap-align: start; white-space: nowrap; }
  #repertoire-tabs .rich-content h3 { scroll-margin-top: 9rem; }

  /* ── Link boxes and cards: full width, comfortable ───── */
  body:not(.page-home) main a.rounded-xl.border { padding: 1.4rem 1.25rem; text-align: left; }
  .p-card { padding: 1.5rem !important; }
  .p-lead__quote { padding-left: 1.25rem; }
  .g-rows { gap: 1.75rem 1rem; }
  .g-item { max-width: 100%; }

  /* ── Back to top, for the long pages ─────────────────── */
  .c-top {
    display: grid; place-items: center;
    position: fixed; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom)); z-index: 40;
    width: 3rem; height: 3rem; border-radius: 50%;
    background: var(--ink); color: var(--gold); border: 1px solid var(--gold);
    box-shadow: 0 14px 30px -12px rgba(13, 13, 24, 0.8);
    font: 600 1.25rem/1 var(--sans); cursor: pointer;
    opacity: 0; transform: translateY(0.75rem); pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
  }
  .c-top.is-on { opacity: 1; transform: none; pointer-events: auto; }
  body:has(.hamburger.open) .c-top { display: none; }

  /* ── Edges of the screen ─────────────────────────────── */
  .c-footer { padding-bottom: calc(2rem + env(safe-area-inset-bottom)); }
  .c-wrap { padding-left: max(var(--gutter), env(safe-area-inset-left)); padding-right: max(var(--gutter), env(safe-area-inset-right)); }
}

@media (prefers-reduced-motion: reduce) { .c-top { transition: none; } }

/* Small targets the audit found */
@media (max-width: 767px) {
  .c-footer__social a { min-width: 2.75rem; justify-content: center; }
  .c-footer__social { gap: 0.25rem; margin-left: -0.75rem; }
  .lightbox-overlay button { min-width: 2.75rem; min-height: 2.75rem; }
}
