/* Silkes Musikgarten — site styles
   Layout: document flow + CSS grid. No fixed canvas, no absolute positioning.
   Breakpoints: 40rem (640px) and 56rem (896px). Type scale in rem. */

:root {
  --brand: #ffc900;
  --brand-soft: #f2ecd9; /* muted brand sand for hover fills (was #fff3cc, too glaring) */
  --brand-ink: #5c4a00;
  --ink: #1f1f1f;
  --muted: #565656;
  --link: #6b5200;
  --accent: #b00020;
  --hover: #c29a00; /* yellow family, 47/100/76: 2.3:1 on --paper */
  --paper: #f0f0f0; /* fully neutral grey-white (R=G=B), same brightness as before */
  --surface: #f7f7f7; /* neutral, lighter than the page so cards still separate */
  --line: #dcdcdc; /* neutral border grey (was warm beige) */
  --radius: 12px;
  --maxw: 72rem;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
}

h1 { font-size: clamp(1.7rem, 1.2rem + 2.5vw, 2.5rem); line-height: 1.2; margin: 0 0 1rem; }
h2 { font-size: clamp(1.25rem, 1.1rem + 1vw, 1.6rem); line-height: 1.25; margin: 2rem 0 0.75rem; }
h3 { font-size: 1.15rem; line-height: 1.3; margin: 1.75rem 0 0.5rem; }
h4 { font-size: 1.05rem; margin: 1.5rem 0 0.5rem; }
p, ul, ol { max-width: 68ch; }
ul, ol { padding-left: 1.25rem; }
li + li { margin-top: 0.35rem; }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

img { max-width: 100%; height: auto; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand);
  color: var(--brand-ink);
  padding: 0.6rem 1rem;
  border-radius: 0 0 var(--radius) 0;
  font-weight: 600;
  z-index: 10;
}
.skip-link:focus { left: 0; text-decoration: none; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- header ---------- */

.site-header {
  border-bottom: 4px solid var(--brand);
  background: var(--paper);
}

.header-bar {
  width: min(var(--maxw), 100% - 2rem);
  margin-inline: auto;
  padding: 1rem 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  position: relative; /* anchor for the mobile nav-toggle input */
}

.brand {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  color: inherit;
  min-width: 0;
}
.brand:hover { text-decoration: none; }

.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 1.8rem; letter-spacing: 0.01em; }
.brand-text em { font-style: normal; font-size: 1.275rem; color: var(--muted); }

.main-nav { margin-left: auto; }
/* hamburger toggle exists on mobile only (CSS-only checkbox pattern, no JS) */
.nav-toggle,
.nav-toggle-btn { display: none; }
.main-nav ul {
  list-style: none;
  margin: 0; padding: 0;
  font-size: 0; /* kills the inline-block whitespace gap (labels reset below) */
  max-width: none;
  text-align: right;
}
.main-nav li { display: inline-block; vertical-align: middle; margin: 0 0 0.4rem 0.4rem; }
.main-nav a {
  /* plain text link in a fixed 44 px touch box: identical boxes, identical
     tops. The ul is NOT a flex container on purpose — in a wrapped flex row
     the baseline group shifts items by descender depth, which put
     "Musikgarten" (g) 2.8 px above the others. */
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  line-height: 1.2;
  white-space: nowrap;
  padding: 0.45rem 0.85rem;
  color: var(--ink);
  font-size: 1.25rem;
}
.main-nav a:hover,
.main-nav a:focus-visible { color: var(--hover); text-decoration: underline; }
.main-nav a[aria-current="page"] {
  color: var(--brand-ink);
  font-weight: 700;
}

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

.hero {
  display: block;
  /* same content box as `main.page` — the hero must never be wider than the page */
  width: min(var(--maxw), 100% - 2rem);
  margin-inline: auto;
  margin-block: 0;
}
.hero img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 26rem;
  object-fit: cover;
  object-position: 50% 45%;
}

/* ---------- page grid ---------- */

.page {
  width: min(var(--maxw), 100% - 2rem);
  margin-inline: auto;
  padding-block: 0 clamp(1.5rem, 4vw, 3rem); /* top padding 0 (user request); bottom unchanged */
  flex: 1 0 auto;
}

.page.has-aside {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3rem);
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

@media (min-width: 56rem) {
  .page.has-aside { grid-template-columns: 15rem minmax(0, 1fr); }
  .aside { position: sticky; top: 1rem; }
}

.content { min-width: 0; }

/* aside */
.aside-title { margin: 0 0 0.5rem; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.aside nav ul { list-style: none; margin: 0; padding: 0; }
.aside-nav a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-left: 3px solid var(--line);
  color: var(--ink);
  font-size: 0.95rem;
}
.aside-nav a:hover { background: var(--brand-soft); text-decoration: none; }
.aside-nav a[aria-current="page"] {
  border-left-color: var(--brand);
  background: var(--brand-soft);
  font-weight: 700;
}
.aside-cta {
  margin-top: 1.5rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.9rem;
}
.aside-cta h3 { margin: 0 0 0.5rem; font-size: 0.95rem; }
.aside-cta p { margin: 0 0 0.75rem; }

/* ---------- components ---------- */

.lead-note {
  width: fit-content; /* width determined by content, not stretched */
  margin: 0 0 2rem;
  padding: 1rem 1.25rem;
  background: var(--brand-soft);
  border-left: 5px solid var(--brand);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.lead-note p { margin: 0; }

.card-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  margin: 1.5rem 0;
  padding: 0;
  list-style: none;
  max-width: none;
}
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1rem 1.1rem;
}
.card h3 { margin: 0 0 0.4rem; font-size: 1.05rem; }
.card p { margin: 0; font-size: 0.92rem; color: var(--muted); }

.timetable {
  border-collapse: collapse;
  width: 100%;
  max-width: 24rem;
  margin: 0.5rem 0 1rem;
  font-size: 0.95rem;
}
.timetable caption { text-align: left; }
.timetable th, .timetable td {
  padding: 0.5rem 0.9rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.timetable thead th { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.timetable tbody th { font-weight: 600; }

.age { color: var(--muted); font-weight: 400; font-size: 0.9em; }
.group-link { margin: 0 0 1rem; font-size: 0.95rem; }

.btn {
  display: inline-block;
  padding: 0.65rem 1.15rem;
  border-radius: 999px;
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 700;
  border: 1px solid var(--brand-ink);
}
.btn:hover { background: #ffd940; text-decoration: none; }

figure { margin: 1.5rem 0; }
figure img { border-radius: var(--radius); border: 1px solid var(--line); }
figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 0.5rem; }

.credit { font-size: 0.85rem; color: var(--muted); }

.contact-list { list-style: none; padding: 0; max-width: 32rem; }
.contact-list li { display: flex; gap: 0.5rem; }
.contact-list .label { min-width: 5rem; color: var(--muted); }

.venue { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.venue-address { font-weight: 600; margin: 0 0 1rem; }
.map { margin: 0 0 0.75rem; max-width: 50rem; } /* 800 px cap on the embedded map */
.map iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  height: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
/* Map scroll-zoom guard (see src/js/map.js): while the map is locked the
   iframe takes no pointer events, so the wheel scrolls the page. Ctrl+wheel
   or a click activates it (then the wheel belongs to the map). No JS = no lock. */
.map.js iframe { pointer-events: none; opacity: 0.92; }
.map.js.is-active iframe { pointer-events: auto; opacity: 1; }
.map.js.is-active { outline: 2px solid var(--brand); outline-offset: 2px; }
.map-hint { display: none; }
.map.js .map-hint {
  display: block;
  max-width: none;          /* the p rule caps text at 68ch — the hint is one line */
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0.5rem 0 0;
  white-space: nowrap;      /* hint is meant to be a single line */
  overflow: hidden;
  text-overflow: ellipsis;
}
.map-note { font-size: 0.85rem; color: var(--muted); }

.legal { font-size: 0.95rem; }
.legal h2 { margin-top: 1.75rem; }
.legal h3 { font-size: 1rem; }

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

.site-footer {
  margin-top: auto;
  background: var(--brand);
  color: var(--brand-ink);
  border-top: 1px solid var(--brand-ink);
}
.footer-bar {
  width: min(var(--maxw), 100% - 2rem);
  margin-inline: auto;
  padding: 1rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  font-size: 1rem;
}
.footer-bar p { margin: 0; max-width: none; }
.footer-bar a { color: #3a2f00; font-weight: 600; }
.footer-nav ul { list-style: none; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem; margin: 0; padding: 0; max-width: none; }
/* block-level flex links: equal-height boxes, so all links share one baseline
   (inline links of differing descender depths shifted each other by ~5 px) and
   every link meets the 44x44 px touch-target size. Padding stays narrow so all
   three links fit one row at 320 px (289 px of pills + gaps would wrap). */
.footer-nav a { display: flex; align-items: center; min-height: 2.75rem; padding: 0.35rem 0.6rem; border-radius: 999px; }
.footer-nav a:hover { background: var(--brand-soft); text-decoration: none; }

/* ---------- small screens ---------- */

@media (max-width: 40rem) {
  .header-bar { flex-direction: column; align-items: flex-start; padding: 0.5rem 0 0.25rem; gap: 0.4rem; }
  /* hamburger: invisible checkbox + styled label; the label click toggles it,
     keyboard focus lands on the checkbox (focus ring forwarded to the label) */
  .nav-toggle {
    position: absolute;
    top: 0.6rem; right: 0;
    width: 2.75rem; height: 2.75rem;
    margin: 0; opacity: 0; z-index: 3;
    appearance: none; -webkit-appearance: none;
  }
  .nav-toggle-btn {
    display: flex; align-items: center; justify-content: center;
    align-self: flex-end; /* toggle sits on the right */
    min-width: 2.75rem; min-height: 2.75rem; padding: 0; /* 44 px touch target, icon centered */
    color: var(--ink); cursor: pointer;
  }
  /* 3-bar icon: span = middle bar, ::before/::after = top/bottom; morphs to an X when open */
  .nav-toggle-icon {
    position: relative; display: block;
    width: 1.8rem; height: 3px; margin: 8px 0;
    background: currentColor; transition: background 0.2s ease;
  }
  .nav-toggle-icon::before, .nav-toggle-icon::after {
    content: ""; position: absolute; left: 0; width: 100%; height: 3px;
    background: currentColor; transition: top 0.25s ease, transform 0.25s ease;
  }
  .nav-toggle-icon::before { top: -8px; }
  .nav-toggle-icon::after { top: 8px; }
  .nav-toggle:checked ~ .nav-toggle-btn .nav-toggle-icon { background: transparent; }
  .nav-toggle:checked ~ .nav-toggle-btn .nav-toggle-icon::before { top: 0; transform: rotate(45deg); }
  .nav-toggle:checked ~ .nav-toggle-btn .nav-toggle-icon::after { top: 0; transform: rotate(-45deg); }
  .nav-toggle:focus-visible ~ .nav-toggle-btn { outline: 3px solid var(--accent); outline-offset: 3px; }
  .nav-toggle:checked ~ .nav-toggle-btn { color: var(--hover); }
  /* open/close animation: grid-rows 0fr→1fr slide (display:none can't animate);
     visibility delay keeps closed links un-tabbable */
  .main-nav { margin-left: 0; width: 100%; display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.25s ease; }
  .nav-toggle:checked ~ .main-nav { grid-template-rows: 1fr; }
  .main-nav ul { display: block; overflow: hidden; min-height: 0; text-align: left; visibility: hidden; transition: visibility 0s linear 0.25s; }
  .nav-toggle:checked ~ .main-nav ul { visibility: visible; transition-delay: 0s; }
  .main-nav li { display: block; margin: 0; }
  .main-nav li + li { border-top: 1px solid var(--line); }
  .main-nav a { font-size: 1.1rem; padding: 0.7rem 0.25rem; }
  .hero { width: 100%; } /* full-bleed on mobile: no side margins */
  .hero img { max-height: 12rem; object-position: 50% 40%; }
  .footer-bar { flex-direction: column; align-items: flex-start; }
  /* keep all three footer links on one row down to 320 px:
     246 px of pills + 2x4 px gaps = 254 px inside the 273 px content box */
  .footer-nav ul { gap: 0.25rem; }
  .footer-nav a { padding: 0.35rem 0.45rem; }
}

@media (orientation: landscape) and (max-height: 30rem) {
  /* phone in landscape: hero full-bleed, no side margins */
  .hero { width: 100%; margin-inline: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .main-nav, .main-nav ul,
  .nav-toggle-icon, .nav-toggle-icon::before, .nav-toggle-icon::after { transition: none !important; }
}

@media print {
  .site-header, .main-nav, .nav-toggle-btn, .hero, .aside, .skip-link, .map iframe { display: none; }
  body { color: #000; background: #fff; font-size: 12pt; }
  a { color: #000; }
}
