/* En Armonía Studio — the media page (R9 → R16 · Teatro + hilo). Loaded after base.css; composes its components.
   Top: the theater (one work on stage). Below: the programme, an index of filters and the thread of works. */

.media-page { padding-top: var(--header-h); }
body.has-dock .media-page { padding-bottom: 104px; }   /* the folded theater never sits over the last line */

/* ========== The theater ========== */
.theater { background: var(--theater); color: var(--theater-ink); padding: var(--s1) 0 var(--s6); scroll-margin-top: var(--header-h); }
.theater-inner { max-width: 1200px; margin: 0 auto; display: grid; gap: var(--s4); }
.screen-slot { position: relative; min-width: 0; }
.screen { container-type: inline-size; width: 100%; }

/* The playbill: our own cover, in the title face on Paper 001. Nothing from a platform until Play. */
.playbill { position: relative; aspect-ratio: var(--cover-ratio); display: grid; place-items: center; text-align: center; padding: var(--s5); }
.playbill.is-audio { aspect-ratio: auto; min-height: 150px; }
.playbill-text { display: grid; justify-items: center; gap: var(--s2); max-width: 100%; }
.playbill-kind { font-size: var(--t-label); letter-spacing: .2em; text-transform: uppercase; color: var(--c); }
.playbill-title { font-family: var(--font-title); font-weight: 400; font-size: clamp(1.8rem, 10cqi, 5.25rem); line-height: 1; color: var(--ink-2); overflow-wrap: break-word; max-width: 100%; }
.playbill.is-audio .playbill-title { font-size: clamp(1.5rem, 6cqi, 3rem); }
.playbill-by { font-family: var(--font-display); font-style: italic; font-size: 1rem; color: var(--ink); }
.playbill-play { position: absolute; right: var(--s4); bottom: var(--s4); width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink-2); color: var(--paper); box-shadow: 0 0 0 3px var(--accent-2); }
.playbill-play svg { width: 18px; height: 18px; }
.playbill.is-audio .playbill-play { position: static; margin-top: var(--s3); }

/* The platform's player, once Play is pressed */
.screen iframe { display: block; width: 100%; border: 0; background: var(--theater-deep); }
.screen.is-video iframe { aspect-ratio: var(--cover-ratio); }
.screen.is-audio iframe { border-radius: 8px; margin: var(--s3) var(--gutter) 0; width: calc(100% - 2 * var(--gutter)); }

.theater-info { display: grid; gap: var(--s2); padding: 0 var(--gutter); min-width: 0; }
.theater-label { font-size: var(--t-label); letter-spacing: .2em; text-transform: uppercase; color: var(--accent-2); }
.theater-title { font-family: var(--font-display); font-weight: 400; font-size: clamp(1.5rem, 5vw, 2.5rem); line-height: 1.08; color: var(--theater-ink); overflow-wrap: anywhere; }
.theater:not(.is-playing) .theater-title { display: none; }   /* phones: the playbill already carries it */
.theater-meta { font-size: var(--t-small); color: var(--theater-quiet); }
.theater-meta a { color: var(--theater-ink); }
.theater-note { font-family: var(--font-display); font-size: 1.05rem; line-height: 1.4; }
.theater-src { font-size: .78rem; color: var(--theater-quiet); }
.theater-src a { color: var(--theater-ink); }
.theater-actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s2); }
.theater-actions .to-programme, .theater-actions [data-act="play"] { display: none; }   /* phones: the playbill carries Play */

@media (min-width: 900px) {
  .theater { padding: var(--s5) var(--gutter) var(--s7); }
  .theater-inner { grid-template-columns: minmax(0, 1fr) 360px; gap: var(--s7); align-items: center; }
  .theater-info { padding: 0; gap: var(--s3); }
  .theater .theater-title { display: block; }
  .playbill { border-radius: 4px; }
  .playbill-play { width: 72px; height: 72px; right: var(--s5); bottom: var(--s5); box-shadow: 0 0 0 4px var(--accent-2); }
  .screen.is-audio iframe { margin: var(--s3) 0 0; width: 100%; }
  .screen.is-video iframe { border-radius: 4px; }
  .theater-actions .to-programme, .theater-actions [data-act="play"] { display: inline-flex; }
}

/* ========== The folded theater (dock) ==========
   The same .screen element moves into fixed position, so the platform's player keeps playing. Audio: the player is
   kept but not shown; the dock is a title bar. */
.dock { position: fixed; left: 12px; right: 12px; bottom: 14px; z-index: 30; max-width: 560px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: var(--s3); min-height: 72px; padding: 8px 8px 8px 16px;
  border-radius: var(--r-tile); background: var(--theater); color: var(--theater-ink); box-shadow: 0 10px 30px color-mix(in oklab, var(--ink) 35%, transparent); }
.dock[hidden] { display: none; }
.dock[data-kind="video"] { padding-left: 136px; }
.dock-tie { position: absolute; left: calc(var(--thread-x) + var(--gutter) - 12px); top: -22px; height: 22px; border-left: 1.6px dashed var(--ink-2); }
.dock-text { min-width: 0; display: grid; }
.dock-label { color: var(--accent-2); }
.dock-title { font-family: var(--font-display); font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-actions { display: flex; gap: 6px; }
.screen.is-docked { position: fixed; z-index: 31; bottom: 22px; left: max(20px, calc(50% - 280px + 8px)); width: 112px; border-radius: 6px; overflow: hidden; }
.screen.is-docked.is-audio { width: 1px; height: 1px; opacity: 0; pointer-events: none; left: 0; bottom: 0; }
.screen.is-docked.is-audio iframe { margin: 0; }

/* ========== The programme: index + thread ========== */
.programme { max-width: 1200px; margin: 0 auto; padding: var(--s6) var(--gutter) 0; display: grid; gap: var(--s6); }

.index { display: grid; gap: var(--s3); align-content: start; min-width: 0; }
.index-kinds { justify-self: start; }
.index-areas { display: flex; flex-wrap: wrap; gap: var(--s2); }
.area-btn { --c: var(--ink-2); display: inline-flex; align-items: center; gap: var(--s3); border-radius: 7px; color: var(--ink-2); }
.area-btn .seal { width: 44px; height: 44px; border-radius: 7px; font-size: 17px; }
.area-btn[aria-pressed="true"] .seal { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--c); }
.area-btn .area-name, .area-btn .leader, .area-btn .area-count {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }   /* phones: seals only */
.area-btn.is-all { display: none; }
.index-more summary { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r-chip);
  background: var(--paper); font-size: var(--t-small); color: var(--ink-2); cursor: pointer; list-style: none; }
.index-more summary::-webkit-details-marker { display: none; }
.index-more summary::after { content: " ▾"; color: var(--text-quiet); }
.index-more[open] summary::after { content: " ▴"; }
.index-more-inner { display: grid; gap: var(--s4); margin-top: var(--s3); }
.index-group { display: grid; gap: var(--s2); }
.index-group[hidden] { display: none; }
.index-group .label { color: var(--text-quiet); }
.index-group .opts { display: flex; flex-wrap: wrap; gap: var(--s2); }
.index-group .opts button { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--paper); font-size: var(--t-small); color: var(--ink-2); }
.index-group .opts button[aria-pressed="true"] { background: var(--ink-2); border-color: var(--ink-2); color: var(--paper); }
.index-count { color: var(--text-quiet); display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.person-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px; border-radius: var(--r-chip);
  background: var(--ink-2); color: var(--paper); font-size: var(--t-small); letter-spacing: 0; text-transform: none; }
.index-clear { justify-self: start; font-size: var(--t-small); color: var(--text-quiet); text-decoration: underline; text-underline-offset: .15em; }
.index-clear[hidden] { display: none; }

@media (min-width: 900px) {
  .programme { grid-template-columns: minmax(0, 1fr) 300px; gap: 56px; padding-top: var(--s7); }
  .index { order: 2; position: sticky; top: calc(var(--header-h) + var(--s5)); gap: var(--s4); }
  .index-areas { display: grid; gap: 0; }
  .area-btn, .area-btn.is-all { display: flex; min-height: 44px; }
  .area-btn .seal { width: 24px; height: 24px; border-radius: 5px; font-size: 13px; }
  .area-btn[aria-pressed="true"] .seal { box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--c); }
  .area-btn[aria-pressed="true"] .area-name { text-decoration: underline; text-underline-offset: .2em; }
  .area-btn .area-name, .area-btn .leader, .area-btn .area-count { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
  .area-btn .area-name { font-family: var(--font-display); font-size: 1.05rem; }
  .area-btn .area-count { font-size: var(--t-small); color: var(--text-quiet); }
  .area-btn .leader { transform: none; align-self: center; }
  .index-more summary { display: none; }
}

/* The thread of works: newest at the top, each play button a knot on the thread */
.timeline { position: relative; min-width: 0; }
.timeline-thread { position: absolute; left: 0; top: 0; width: calc(2 * var(--thread-x)); height: 100%; overflow: visible; pointer-events: none; }
.timeline-head { position: relative; margin: 0 0 var(--s1) calc(2 * var(--thread-x)); color: var(--ink-2); }
.timeline-head[hidden] { display: none; }
.timeline-list { position: relative; list-style: none; margin: 0; padding: 0; }
.timeline-list > li { display: grid; grid-template-columns: calc(2 * var(--thread-x)) minmax(0, 1fr); align-items: start; }
.timeline-list .year { min-height: 44px; align-items: center; }
.timeline-list .year .year-stamp { justify-self: center; }
.timeline-list .work { padding: 10px 0; }
.work .knot { justify-self: center; }
.work-body { min-width: 0; padding-top: 2px; display: grid; gap: 4px; }
.work-line { display: flex; align-items: baseline; gap: var(--s2); }
.work-title { font-family: var(--font-display); font-weight: 400; font-size: 1.2rem; line-height: 1.2; color: var(--ink-2); overflow-wrap: anywhere; min-width: 0; }
.work-len { font-size: .82rem; white-space: nowrap; color: var(--ink); }
.work-meta { font-size: .82rem; color: var(--text-quiet); }
.work-meta a { color: var(--ink-2); }
.work-meta .glyph { color: var(--c); }
.work-meta .src { color: var(--ink-2); white-space: nowrap; }
.work-meta .on-stage { color: var(--ink-2); font-weight: 600; }
.work-note { display: none; font-size: var(--t-small); color: var(--ink); max-width: 56ch; }
.timeline .no-results { padding: var(--s6) 0 0 calc(2 * var(--thread-x)); }
.timeline-note { margin: var(--s7) 0 0 calc(2 * var(--thread-x)); max-width: 56ch; font-size: var(--t-small); color: var(--text-quiet); }
@media (min-width: 720px) {
  .work-title { font-size: 1.35rem; }
  .work-note { display: block; }
  .timeline-list .work { padding: 12px 0; }
}

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