/* ===========================================================
   Musici Volanti – design tokens
   Inspired by Viennese coffee-house posters and concert
   programmes: high-contrast Didone type, deep teal, brass
   gold, and a five-line music staff as the signature divider.
   =========================================================== */

:root {
  --paper: #f4efe4;
  --paper-deep: #ebe3d0;
  --ink: #1b2430;
  --ink-soft: #4a5564;
  --teal: #1d4750;
  --teal-deep: #143339;
  --gold: #8a6a24;
  --tango: #9a2b2f;
  --line: #cfc2a3;
  --shadow: rgba(27, 36, 48, 0.16);

  --display: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --body: "Work Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --max-width: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  background-image:
    radial-gradient(circle at 10% 0%, rgba(29, 71, 80, 0.07), transparent 40%),
    radial-gradient(circle at 90% 12%, rgba(176, 138, 62, 0.09), transparent 45%);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--teal-deep); text-decoration: underline; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

img { max-width: 100%; display: block; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 500;
  color: var(--ink);
  margin: 0 0 0.45em;
  line-height: 1.15;
}
h1 { font-size: clamp(2.4rem, 5vw, 4.2rem); font-style: italic; }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
h3 { font-size: 1.3rem; }
p { margin: 0 0 1em; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.eyebrow {
  font-family: var(--body);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 0.8rem;
}

section { padding: 1rem 0; }
.section-head { max-width: 62ch; margin-bottom: 1.6rem; }

/* ---------- header & navigation ---------- */

.site-header {
  padding: 1.3rem 0 1rem;
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand { display: flex; flex-direction: column; line-height: 1.1; }
.brand:hover { text-decoration: none; }
.brand-name {
  font-family: var(--display);
  font-style: italic;
  font-size: 1.75rem;
  color: var(--teal);
}
.brand-sub {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 0.2rem;
}

/* desktop: the wrapper is "invisible", so brand + nav sit side by side */
.nav-panel { display: contents; }

.main-nav { display: flex; align-items: center; gap: 1.3rem; flex-wrap: wrap; }
.main-nav a {
  color: var(--ink);
  font-size: 0.92rem;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}
.main-nav a:hover { color: var(--teal); text-decoration: none; border-bottom-color: var(--line); }
.main-nav a[aria-current="page"] { color: var(--teal); border-bottom-color: var(--gold); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;

  /* Accessible touch target */
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;

  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 24px;
  background: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle.is-active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.is-active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.is-active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-toggle:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}

@media (max-width: 960px) {
  .nav-toggle { display: flex; }
  .nav-panel {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding-top: 1rem;
  }
  .nav-panel.is-open { display: flex; }
  .main-nav { flex-direction: column; align-items: center; gap: 0.9rem; }
}

/* ---------- signature element: music staff divider ---------- */

.staff {
  position: relative;
  height: 25px;
  margin: 3rem 0;
  background: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 6px);
}
.staff::before {               /* note head */
  content: "";
  position: absolute;
  left: 50%;
  top: 8px;
  width: 15px;
  height: 11px;
  background: var(--gold);
  border-radius: 50%;
  transform: translateX(-50%) rotate(-20deg);
}
.staff::after {                /* note stem */
  content: "";
  position: absolute;
  left: calc(50% + 6px);
  top: -9px;
  width: 1.5px;
  height: 27px;
  background: var(--gold);
}

/* ---------- hero ---------- */

.hero {
  padding: 3.5rem 0 1.5rem;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2.5rem;
  align-items: center;
}
.hero .eyebrow { max-width: 34ch; line-height: 1.5; }
.hero-copy .lede { font-size: 1.12rem; color: var(--ink-soft); max-width: 46ch; }
.hero-actions { display: flex; gap: 1rem; margin-top: 1.6rem; flex-wrap: wrap; }

.hero-photo img {
  width: 100%;
  height: auto;
  border-radius: 2px;
  box-shadow: 0 8px 28px var(--shadow);
}

@media (max-width: 800px) {
  .hero { grid-template-columns: 1fr; }
  .hero-photo { max-width: 420px; margin: 0 auto; }
}

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.85rem 1.5rem;
  border: 1px solid var(--teal);
  color: var(--teal);
  border-radius: 2px;
  transition: background 0.2s ease, color 0.2s ease;
}
.btn:hover { background: var(--teal); color: var(--paper); text-decoration: none; }
.btn.filled { background: var(--teal); color: var(--paper); }
.btn.filled:hover { background: var(--teal-deep); border-color: var(--teal-deep); }

/* ---------- members ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.8rem;
}
.member-card {
  background: var(--paper-deep);
  border: 1px solid var(--line);
  padding: 1.4rem 1.5rem;
  border-radius: 3px;
}
.member-photo-wrap { margin-bottom: 1rem; }
.member-photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 2px;
}
.member-role {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tango);
  margin-bottom: 0.3rem;
}
.member-card h3 { color: var(--teal); }

/* ---------- programmes ---------- */

.program {
  padding: 1.3rem 0;
  border-top: 1px solid var(--line);
}
.program h3 { color: var(--teal); font-style: italic; margin-bottom: 0.3rem; }
.program p { margin-bottom: 0.5rem; }
.listen { font-size: 0.88rem; display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; }
.listen span { color: var(--ink-soft); }
.listen a.is-playing { color: var(--tango); font-weight: 600; }
.listen .track { white-space: nowrap; }
.track .time {
  display: inline-block;
  min-width: 2.9em;                      /* reserves the space, so nothing shifts when the time appears */
  margin-left: 0.5rem;                   /* change this one number to adjust the gap on both pages */
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
  color: var(--ink-soft);
  opacity: 0;
  transition: opacity 0.5s ease;         /* soft fade-in */
}
.track .time.is-ready { opacity: 1; }

.favourites h3 { font-size: 1.1rem; color: var(--tango); font-style: italic; }
.plain-list { list-style: none; margin: 0; padding: 0; font-size: 0.95rem; }
.plain-list li { padding: 0.15rem 0; }

/* ---------- agenda ---------- */

.programme { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.programme li {
  display: grid;
  grid-template-columns: 230px 1fr auto;
  gap: 1rem;
  align-items: baseline;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}
.programme .date { font-weight: 600; color: var(--teal); }
.programme .date small {
  display: block;
  font-weight: 400;
  color: var(--ink-soft);
  font-size: 0.875rem;
}
.programme .place { display: block; font-size: 0.9rem; color: var(--ink-soft); }
@media (max-width: 640px) {
  .programme li { grid-template-columns: 1fr; gap: 0.2rem; }
}

.year-block { border-bottom: 1px solid var(--line); }
.year-block > summary.year-heading {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.9rem 0;
  font-family: var(--display);
  font-size: 1.35rem;
  color: var(--teal);
}
.year-block > summary.year-heading::-webkit-details-marker { display: none; }
.year-block > summary.year-heading::before {
  content: "▸";
  font-size: 0.9rem;
  color: var(--gold);
  transition: transform 0.15s ease;
}
.year-block[open] > summary.year-heading::before { transform: rotate(90deg); }
.year-block .programme { border-top: none; margin-bottom: 0.8rem; }

/* ---------- press & links ---------- */

.link-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.link-list li { border-bottom: 1px solid var(--line); }
.link-list a {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem 0.2rem;
  color: var(--ink);
}
.link-list a:hover { text-decoration: none; background: var(--paper-deep); }
.link-list strong { font-weight: 500; color: var(--teal); }
.link-list span { color: var(--ink-soft); font-size: 0.9rem; }

/* ---------- videos ---------- */

.media-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}
.media-grid figure { margin: 0; }
.media-grid iframe { width: 100%; aspect-ratio: 16 / 9; border: none; display: block; }
.media-grid figcaption { font-size: 0.85rem; color: var(--ink-soft); padding-top: 0.5rem; }
@media (max-width: 700px) { .media-grid { grid-template-columns: 1fr; } }

/* ---------- audio ---------- */
.audio-group { margin-top: 2.2rem; color: var(--teal); font-style: italic; }
.tracks { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.tracks li { padding: 0.8rem 0 0.3rem; border-bottom: 1px solid var(--line); }
.tracks .track { font-size: 0.88rem; }   /* same size as the programme list */
.tracks a.is-playing { color: var(--tango); font-weight: 600; }

/* progress bar */
.bar {
  position: relative;
  height: 24px;               /* generous touch area, the visible line is thin */
  margin: 0.1rem 8px 0;       /* side margin so the circle isn't cut off at the ends */
  cursor: pointer;
  touch-action: pan-y;        /* horizontal drag = scrub, vertical swipe still scrolls the page */
  user-select: none;
}
.bar::before,
.bar-fill {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  height: 3px;
  margin-top: -1.5px;
}
.bar::before { right: 0; background: var(--line); }
.bar-fill { width: 0; background: var(--tango); transition: width 0.25s linear; }

/* the circle at the head */
.bar-fill::after {
  content: "";
  position: absolute;
  right: -8px;
  top: 50%;
  width: 9px;
  height: 9px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: var(--ink-soft);          /* grey when the track is idle */
  border: 2px solid var(--paper);
  box-shadow: 0 1px 4px var(--shadow);
  cursor: grab;
  transition: transform 0.15s ease, background 0.15s ease;
}
.bar.active .bar-fill::after { background: var(--tango); }   /* red while this track is active */
.bar:hover .bar-fill::after { transform: translateY(-50%) scale(1.2); }

/* while dragging */
.bar.dragging .bar-fill { transition: none; }                /* follow the finger without lag */
.bar.dragging .bar-fill::after { transform: translateY(-50%) scale(1.3); cursor: grabbing; }
.bar.dragging { cursor: grabbing; }

.bar { -webkit-tap-highlight-color: transparent; }   /* no grey flash on phones */
.bar:focus { outline: none; }                        /* no frame after mouse or touch */
.bar:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }   /* still shown for keyboard (Tab) users *//* ---------- contact ---------- */

.contact-card {
  max-width: 560px;
  background: var(--paper-deep);
  border: 1px solid var(--line);
  padding: 1.6rem 1.8rem;
  border-radius: 3px;
}
.contact-card h3 { color: var(--teal); }
.contact-details dt {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tango);
  margin-top: 1rem;
}
.contact-details dd { margin: 0.15rem 0 0; }

/* ---------- footer ---------- */

.site-footer {
  margin-top: 4rem;
  border-top: 1px solid var(--line);
  padding: 2rem 0;
  font-size: 0.88rem;
  color: var(--ink-soft);
}
.site-footer .container {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ---------- lightbox (click any .zoomable image) ---------- */

/* ---------- accessible lightbox ---------- */

.zoomable {
  display: block;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: zoom-in;
  max-width: 100%;
}

.zoomable:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
}

.lightbox-overlay {
  position: fixed;
  inset: 0;
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100%;
  margin: 0;
  border: 0;
  background: rgba(20, 28, 36, 0.93);
  color: var(--paper);
  align-items: center;
  justify-content: center;
  padding: 2rem;
  z-index: 100;
}

.lightbox-overlay[open] {
  display: flex;
}

.lightbox-overlay::backdrop {
  background: rgba(20, 28, 36, 0.93);
}

.lightbox-overlay img {
  max-width: 100%;
  max-height: 100%;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 1.1rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: var(--paper);
  font-size: 2.3rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox-close:hover {
  color: var(--gold);
}

.lightbox-close:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}
/* ---------- ensemble overview: cards with button ---------- */

.member-card {
  display: flex;
  flex-direction: column;
}
.member-card h3 { margin-bottom: 1rem; }
.member-card .btn {
  margin-top: auto;
  align-self: flex-start;
}

/* ---------- single musician page ---------- */

.back-link { font-size: 0.9rem; margin-bottom: 1.5rem; }

.member-detail {
  display: grid;
  grid-template-columns: minmax(0, 340px) 1fr;
  gap: 2.5rem;
  align-items: start;
}
.member-detail.no-photo { grid-template-columns: 1fr; }
.member-detail.no-photo .member-photo-wrap { display: none; }

.member-photo-large {
  width: 100%;
  height: auto;
  border-radius: 2px;
  box-shadow: 0 8px 28px var(--shadow);
}
.member-text h1 { font-size: clamp(2rem, 4vw, 3rem); }
.member-text p { max-width: 62ch; }

.member-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  font-size: 0.92rem;
}

@media (max-width: 800px) {
  .member-detail { grid-template-columns: 1fr; }
  .member-photo-wrap { max-width: 360px; }
}

/* ---------- ensemble: all musicians in one row on large screens ---------- */

@media (min-width: 1100px) {
  .members-grid {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 1rem;
  }
  .members-grid .member-card {
    padding: 1rem;
  }
  .members-grid .member-card h3 {
    font-size: 1.1rem;
  }
  .members-grid .member-card .btn {
    align-self: stretch;
    text-align: center;
    padding: 0.8rem 0.4rem;
  }
}

/* ---------- start page: slightly bigger photo, slightly smaller text ---------- */

@media (min-width: 801px) {
  .hero {
    grid-template-columns: 0.95fr 1.05fr;
    gap: 2.2rem;
  }
  .hero-copy h1 {
    font-size: clamp(2.2rem, 4.2vw, 3.7rem);
  }
  .hero-copy .lede {
    font-size: 1.05rem;
    line-height: 1.62;
  }
  .hero-actions {
    gap: 0.8rem;
  }
  .hero-actions .btn {
    padding: 0.8rem 1.3rem;
    font-size: 0.75rem;
  }
}