/* Program Fold: one stylesheet for the editor, the guides and the audience page. */
@font-face { font-family: "EB Garamond"; src: url(/fonts/ebg-regular.woff) format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url(/fonts/ebg-italic.woff) format("woff"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "EB Garamond"; src: url(/fonts/ebg-semibold.woff) format("woff"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Jost"; src: url(/fonts/jost-regular.woff) format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Jost"; src: url(/fonts/jost-italic.woff) format("woff"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Jost"; src: url(/fonts/jost-medium.woff) format("woff"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url(/fonts/corm-semibold.woff) format("woff"); font-weight: 600; font-display: swap; }

:root {
  --ink: #1d1b19; --muted: #5d564e; --paper: #fbf8f3; --card: #fff; --line: #e3ddd3; --line-strong: #c9c0b3;
  --accent: #7a1f2b; --accent-ink: #fff; --blue: #1f5c8f; --ok: #1d6b3a; --warn: #8a4b00;
  --serif: "EB Garamond", Garamond, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.55 var(--sans); }
a { color: var(--blue); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid #2f6fcf; outline-offset: 2px; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; letter-spacing: -0.005em; }
h1 { font-size: clamp(2rem, 4.5vw, 3rem); margin: 0.2em 0 0.35em; }
h2 { font-size: 1.7rem; margin: 1.6em 0 0.5em; }
h3 { font-size: 1.3rem; margin: 1.3em 0 0.4em; }
p, li { max-width: 68ch; }
small, .small { font-size: 0.875rem; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* header / footer */
.site-head { display: flex; align-items: center; gap: 1.2rem; padding: 0.7rem clamp(1rem, 3vw, 2rem); border-bottom: 1px solid var(--line); background: var(--paper); flex-wrap: wrap; }
.brand { font-family: var(--serif); font-size: 1.45rem; font-weight: 600; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 0.5rem; }
.brand svg { width: 26px; height: 26px; }
.site-head nav { display: flex; gap: 1.1rem; margin-left: auto; flex-wrap: wrap; }
.site-head nav a { color: var(--ink); text-decoration: none; font-size: 0.95rem; }
.site-head nav a:hover, .site-head nav a[aria-current] { text-decoration: underline; }
.site-foot { border-top: 1px solid var(--line); margin-top: 4rem; padding: 1.5rem clamp(1rem, 3vw, 2rem) 2.5rem; color: var(--muted); font-size: 0.9rem; }
.site-foot nav { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
.site-foot a { color: var(--muted); }
main.page { max-width: 860px; margin: 0 auto; padding: 1.5rem clamp(1rem, 3vw, 2rem); }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 60ch; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; font: 600 0.95rem/1.2 var(--sans); padding: 0.62rem 1rem; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--card); color: var(--ink); cursor: pointer; text-decoration: none; min-height: 44px; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { background: #5f1621; }
.btn.small { padding: 0.35rem 0.6rem; min-height: 34px; font-size: 0.85rem; font-weight: 500; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { border-color: var(--line-strong); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.icon-btn { width: 34px; height: 34px; min-height: 34px; padding: 0; border-radius: 6px; border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--muted); font-size: 1rem; line-height: 1; }
.icon-btn:hover { border-color: var(--line-strong); color: var(--ink); }
.cta-row { display: flex; gap: 0.75rem; flex-wrap: wrap; margin: 1.2rem 0; }
.pro-tag { display: inline-block; font: 600 0.68rem/1 var(--sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); border: 1px solid var(--accent); border-radius: 4px; padding: 0.18rem 0.3rem; vertical-align: middle; margin-left: 0.3rem; }

/* forms */
label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--muted); margin-bottom: 0.2rem; }
input[type=text], input[type=email], input[type=search], textarea, select { width: 100%; font: 0.98rem/1.35 var(--sans); color: var(--ink); background: #fff; border: 1px solid var(--line-strong); border-radius: 7px; padding: 0.5rem 0.6rem; min-height: 40px; }
textarea { resize: vertical; min-height: 64px; }
input:focus, textarea:focus, select:focus { border-color: #2f6fcf; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; padding: 0; margin-bottom: 0.6rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem 0.8rem; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem 0.8rem; }
.span2 { grid-column: span 2; }
.check { display: flex; align-items: center; gap: 0.5rem; font-weight: 500; color: var(--ink); font-size: 0.95rem; margin: 0.25rem 0; }
.check input { width: 18px; height: 18px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; flex-wrap: wrap; }
.seg label { margin: 0; font-size: 0.9rem; color: var(--ink); font-weight: 500; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span { display: block; padding: 0.45rem 0.8rem; cursor: pointer; min-height: 38px; }
.seg input:checked + span { background: var(--ink); color: #fff; }
.seg input:focus-visible + span { outline: 3px solid #2f6fcf; outline-offset: -3px; }

/* editor */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1.5rem; max-width: 1240px; margin: 0 auto; padding: 1.2rem clamp(0.75rem, 2.5vw, 2rem); align-items: start; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem 1.2rem; margin-bottom: 1rem; }
.panel h2 { margin: 0 0 0.6rem; font-size: 1.35rem; }
.side { position: sticky; top: 1rem; }
.toolbar { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.toolbar .status { margin-left: auto; color: var(--muted); font-size: 0.85rem; }
.toolbar select { width: auto; min-height: 34px; padding: 0.3rem 0.5rem; font-size: 0.85rem; }
.accent-row { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; margin-top: 0.6rem; }
.accent-row label { margin: 0; }
.accent-row input[type=color] { width: 44px; height: 34px; padding: 2px; border: 1px solid var(--line-strong); border-radius: 6px; background: #fff; }
.section-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); margin-bottom: 1rem; }
.section-head { display: flex; gap: 0.5rem; align-items: end; padding: 0.75rem 0.9rem; border-bottom: 1px solid var(--line); background: #fdfbf8; border-radius: var(--radius) var(--radius) 0 0; flex-wrap: wrap; }
.section-head .grow { flex: 1 1 200px; }
.section-head select { width: auto; }
.section-body { padding: 0.75rem 0.9rem 0.9rem; }
.rows { list-style: none; margin: 0; padding: 0; counter-reset: row; }
.row { position: relative; border: 1px solid var(--line); border-radius: 8px; padding: 0.6rem 0.7rem 0.7rem 2.2rem; margin-bottom: 0.6rem; background: #fff; counter-increment: row; }
.row::before { content: counter(row); position: absolute; left: 0.65rem; top: 0.65rem; font: 600 0.85rem var(--sans); color: var(--muted); }
.row.dragging { opacity: 0.45; }
.row.drop-before { box-shadow: 0 -3px 0 #2f6fcf; }
.row-actions { display: flex; gap: 0.15rem; justify-content: flex-end; margin: -0.25rem -0.3rem 0.2rem 0; }
.handle { cursor: grab; }
.row .grid2 { gap: 0.45rem 0.6rem; }
.row label { font-size: 0.75rem; }
.row input, .row textarea { min-height: 36px; padding: 0.38rem 0.5rem; font-size: 0.95rem; }
.row .more { margin-top: 0.4rem; }
.row .more summary { cursor: pointer; font-size: 0.82rem; color: var(--muted); }
.row-links { font-size: 0.8rem; margin-top: 0.3rem; color: var(--muted); }
.add-row { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.add-section { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 0.5rem 0 1.5rem; }
.themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.theme-card { position: relative; border: 2px solid var(--line); border-radius: 8px; padding: 0.55rem 0.6rem; cursor: pointer; background: #fff; text-align: center; min-height: 64px; }
.theme-card input { position: absolute; opacity: 0; }
.theme-card:has(input:checked) { border-color: var(--ink); }
.theme-card:has(input:focus-visible) { outline: 3px solid #2f6fcf; outline-offset: 2px; }
.theme-card b { display: block; font-size: 1.05rem; color: var(--ink); }
.theme-card.classic b { font-family: var(--serif); color: #7a1f2b; }
.theme-card.modern b { font-family: "Jost", var(--sans); color: #1f5c8f; font-weight: 500; }
.theme-card.holiday b { font-family: "Cormorant Garamond", var(--serif); color: #9e1b2a; }
.theme-card .small { color: var(--muted); font-weight: 400; }
.export-list { display: grid; gap: 0.5rem; }
.export-list .btn { justify-content: flex-start; text-align: left; }
.export-list .btn small { display: block; font-weight: 400; color: inherit; opacity: 0.85; }
.export-meta { font-size: 0.85rem; color: var(--muted); margin: 0.6rem 0 0; min-height: 1.3em; }
.warn { color: var(--warn); }
.ok { color: var(--ok); }
.note { background: #f6f1e8; border-left: 3px solid var(--accent); padding: 0.6rem 0.8rem; border-radius: 0 6px 6px 0; font-size: 0.9rem; }

/* combobox */
.combo { position: relative; }
.combo ul { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; margin: 2px 0 0; padding: 0.25rem 0; list-style: none; background: #fff; border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); max-height: 280px; overflow: auto; }
.combo li { padding: 0.4rem 0.65rem; cursor: pointer; font-size: 0.92rem; line-height: 1.3; }
.combo li small { display: block; color: var(--muted); font-size: 0.78rem; }
.combo li[aria-selected=true], .combo li:hover { background: #eef3fb; }
.combo li.hint { cursor: default; color: var(--muted); font-size: 0.82rem; background: none; }

/* dialogs */
dialog { border: 0; border-radius: 12px; padding: 0; max-width: min(640px, 94vw); width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,0.3); color: var(--ink); }
dialog::backdrop { background: rgba(20, 18, 16, 0.45); }
.dlg { padding: 1.2rem 1.3rem 1.3rem; }
.dlg h2 { margin-top: 0; font-size: 1.5rem; }
.dlg-actions { display: flex; gap: 0.6rem; justify-content: flex-end; flex-wrap: wrap; margin-top: 1rem; }
.map-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; margin-top: 0.6rem; display: block; overflow: auto; max-height: 260px; }
.map-table th, .map-table td { border: 1px solid var(--line); padding: 0.3rem 0.4rem; text-align: left; white-space: nowrap; }
.map-table select { min-height: 30px; padding: 0.15rem; font-size: 0.82rem; }
.preview-frame { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: 8px; background: #888; }
.share-url { font-family: ui-monospace, Menlo, monospace; font-size: 0.8rem; }

/* small utilities (no inline styles: the CSP doesn't allow them) */
.mt-s { margin-top: 0.5rem; } .mt-m { margin-top: 0.8rem; } .align-end { align-items: end; } .center { text-align: center; } .indent { padding-left: 1.2rem; }
.cta-row.tight { margin: 0.6rem 0 0; } .grid-copy { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem; } .stack { display: grid; gap: 0.6rem; }
dialog.wide-dlg { max-width: min(980px, 96vw); } .narrow { max-width: 520px; }

/* landing & guides */
.hero { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 2rem; align-items: center; max-width: 1100px; margin: 0 auto; padding: 2.5rem clamp(1rem, 3vw, 2rem) 1rem; }
.hero img { border-radius: 6px; box-shadow: 0 12px 40px rgba(0,0,0,0.14); background: #fff; }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; max-width: 1100px; margin: 1rem auto; padding: 0 clamp(1rem, 3vw, 2rem); }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.feature h3 { margin-top: 0.2rem; }
.examples { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.2rem; margin: 1.2rem 0; }
.example { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.7rem; }
.example .pages { display: flex; gap: 6px; }
.example .pages img { display: block; flex: 1 1 0; min-width: 0; border: 1px solid var(--line); background: #fff; }
.example figcaption { font-size: 0.9rem; margin-top: 0.5rem; }
table.compare { border-collapse: collapse; width: 100%; font-size: 0.92rem; margin: 1rem 0; }
table.compare th, table.compare td { border-bottom: 1px solid var(--line); padding: 0.55rem 0.5rem; text-align: left; vertical-align: top; }
table.compare th[scope=col] { font-size: 0.82rem; color: var(--muted); }
.table-wrap { overflow-x: auto; }
.sample { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 1rem 1.2rem; font-family: var(--serif); font-size: 1.05rem; }
.sample p { margin: 0.3rem 0; }
.crumbs { font-size: 0.88rem; color: var(--muted); }
.crumbs a { color: var(--muted); }
.guide-list { padding-left: 1.1rem; }
.guide-list li { margin: 0.35rem 0; }

@media (max-width: 960px) {
  .editor { grid-template-columns: 1fr; }
  .side { position: static; }
  .hero { grid-template-columns: 1fr; padding-top: 1.5rem; }
}
@media (max-width: 560px) {
  .site-head { gap: 0.4rem 1rem; padding: 0.55rem 1rem; }
  .site-head nav { margin-left: 0; gap: 0.25rem 0.9rem; }
  .site-head nav a { font-size: 0.9rem; padding: 0.35rem 0; }
  .brand { font-size: 1.25rem; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .themes { grid-template-columns: 1fr 1fr 1fr; }
  .row { padding-left: 1.9rem; }
}

/* ---- audience page (/p) ---- */
.web-program { max-width: 640px; margin: 0 auto; padding: 1.5rem 1.1rem 3rem; }
.web-program header { text-align: center; padding: 1.5rem 0 1rem; }
.web-program .presenter { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.78rem; color: var(--muted); }
.web-program h1 { color: var(--wp-accent, var(--accent)); font-size: clamp(2.1rem, 9vw, 3rem); margin: 0.3rem 0; }
.web-program .subtitle { font-style: italic; font-size: 1.15rem; margin: 0.2rem 0 0.8rem; }
.web-program .when { margin: 0.2rem 0; }
.web-program .cover-note { font-style: italic; color: var(--muted); font-size: 0.95rem; }
.web-program .orn { display: block; margin: 0.8rem auto; width: 140px; height: 14px; }
.web-program h2 { text-align: center; color: var(--wp-accent, var(--accent)); margin: 1.8rem 0 0.8rem; font-size: 1.6rem; }
.web-program ol { list-style: none; padding: 0; margin: 0; }
.web-program .item { padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
.web-program .piece { font-size: 1.12rem; }
.web-program .composer { font-weight: 600; }
.web-program .dates, .web-program .mv, .web-program .arr, .web-program .meta { color: var(--muted); font-size: 0.95rem; }
.web-program .mv { font-style: italic; }
.web-program .perf { font-style: italic; margin-top: 0.25rem; }
.web-program .num { color: var(--wp-accent, var(--accent)); font-weight: 600; margin-right: 0.4rem; }
.web-program .dancers { font-size: 0.95rem; margin-top: 0.3rem; }
.web-program .dancers b { font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--wp-accent, var(--accent)); font-weight: 600; display: block; }
.web-program .interm { text-align: center; font-style: italic; color: var(--muted); margin: 1.4rem 0; }
.web-program .prose p { margin: 0.6rem 0; }
.web-program .thanks { text-align: center; }
.web-program .made { text-align: center; color: var(--muted); font-size: 0.85rem; margin-top: 3rem; }
.web-program .score { font-size: 0.82rem; }
.wp-classic, .wp-holiday { font-family: var(--serif); font-size: 18px; }
.wp-holiday h1, .wp-holiday h2 { font-family: "Cormorant Garamond", var(--serif); }
.wp-modern { font-family: "Jost", var(--sans); }
.wp-modern h1, .wp-modern h2 { font-family: "Jost", var(--sans); font-weight: 500; }
.wp-modern header, .wp-modern h2 { text-align: left; }
.wp-modern .orn { margin-left: 0; }
.wp-error { max-width: 560px; margin: 3rem auto; padding: 0 1rem; text-align: center; }

@media print {
  .site-head, .site-foot, .no-print { display: none !important; }
  body { background: #fff; }
  .web-program { max-width: none; padding: 0; font-size: 11pt; }
  .web-program .item { break-inside: avoid; }
  .web-program h2 { break-after: avoid; }
  a { color: inherit; text-decoration: none; }
}
