/* Choir Material page (/choir-material, /choir-material/YYYY-MM-DD) — shared by all 5 ICKSP-IE sites.
   Desktop: section nav | entry | calendar + search + list.
   Tablet:  entry with a sticky chip bar of sections | calendar column.
   Phone:   "Browse by date" panel, chip bar, entry. */

.choir-page { padding: var(--sp-3xl) 0 var(--sp-4xl); background: var(--bg); }
/* position:sticky needs its ancestors to leave overflow alone. The site clips sections
   (overflow:hidden) and the body (overflow-x:hidden) — both become scroll containers and
   pin the sticky columns inside them. On this page only: let the section overflow, and
   clip the body sideways with `clip`, which clips without creating a scroll container. */
section.choir-page { overflow: visible; }
body:has(#choir-app) { overflow-x: clip; }

.choir-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 300px;
  grid-template-areas: "toc entry aside";
  gap: var(--sp-xl);
  align-items: start;
}
.choir-main { display: contents; }
.choir-toc { grid-area: toc; position: sticky; top: calc(var(--header-h) + 1.25rem); }
.choir-toc[hidden] { display: none; }
.choir-entry { grid-area: entry; min-width: 0; }
.choir-aside { grid-area: aside; position: sticky; top: calc(var(--header-h) + 1.25rem); }

/* ── section nav ─────────────────────────────────────────── */
.choir-toc-title {
  font-family: var(--ff-ui); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-muted); margin: 0 0 var(--sp-sm);
}
.choir-toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--border); }
.choir-toc a {
  display: block; padding: .4rem 0 .4rem .9rem; margin-left: -2px; border-left: 2px solid transparent;
  font-family: var(--ff-ui); font-size: var(--fs-sm); line-height: 1.3; color: var(--text-muted); text-decoration: none;
}
.choir-toc a:hover { color: var(--burgundy); }
.choir-toc a.is-active { color: var(--burgundy); border-left-color: var(--burgundy); font-weight: 600; }

/* ── entry ───────────────────────────────────────────────── */
.choir-entry-head { margin-bottom: var(--sp-xl); }
.choir-entry-date {
  font-family: var(--ff-ui); font-size: var(--fs-sm); font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--gold-dark); margin: 0 0 .3rem;
}
.choir-entry-head h2 { font-size: var(--fs-3xl); color: var(--burgundy); margin: 0; line-height: 1.15; }
.choir-sec {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: var(--sp-lg) var(--sp-xl); margin-bottom: var(--sp-lg);
  scroll-margin-top: calc(var(--header-h) + 1.25rem);
}
.choir-sec h3 {
  font-size: var(--fs-2xl); color: var(--burgundy); margin: 0 0 var(--sp-md);
  padding-bottom: var(--sp-sm); border-bottom: 1px solid var(--border);
}
.choir-item + .choir-item { margin-top: var(--sp-lg); padding-top: var(--sp-lg); border-top: 1px dashed var(--border); }
.choir-item h4 { font-family: var(--ff-ui); font-size: 1rem; font-weight: 700; color: var(--dark); margin: 0 0 var(--sp-sm); }
.choir-audio { display: flex; align-items: center; gap: var(--sp-md); flex-wrap: wrap; }
.choir-audio audio { flex: 1 1 260px; min-width: 0; max-width: 100%; }
.choir-dl { font-family: var(--ff-ui); font-size: var(--fs-sm); color: var(--burgundy); white-space: nowrap; }
.choir-dl span { color: var(--text-muted); }
/* Notes read like a rubric in a missal: the director's instruction in red, no box. */
.choir-notes {
  margin-top: var(--sp-sm); max-width: 62ch;
  font-family: var(--ff-body); font-style: normal; font-size: 1.06rem; line-height: 1.6;
  color: var(--burgundy-dark);
}
.choir-pdf { display: flex; gap: var(--sp-lg); align-items: center; flex-wrap: wrap; }
.choir-pdf-open {
  position: relative; width: 150px; padding: 0; overflow: hidden; cursor: zoom-in;
  border: 1px solid var(--border); border-radius: var(--radius); background: #fff;
}
.choir-pdf-open img { display: block; width: 100%; height: auto; }
.choir-pdf-hint {
  position: absolute; left: 0; right: 0; bottom: 0; padding: .3rem;
  font-family: var(--ff-ui); font-size: .72rem; color: #fff; text-align: center; background: rgba(26, 20, 16, .72);
}
.choir-pdf-actions { display: flex; flex-direction: column; gap: var(--sp-sm); align-items: stretch; }
.choir-state {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: var(--sp-xl); text-align: center; color: var(--text-muted);
}
.choir-state h2 { color: var(--burgundy); margin: 0 0 var(--sp-sm); }

/* ── calendar ────────────────────────────────────────────── */
.choir-browse {
  display: flex; flex-direction: column; min-height: 0;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--sp-md);
}
.choir-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-sm); }
.choir-cal-title { font-family: var(--ff-heading); font-size: 1.2rem; color: var(--burgundy); }
.choir-cal-nav {
  width: 34px; height: 34px; padding: 0; border: 1px solid var(--border); border-radius: 50%;
  background: transparent; font-size: 1.25rem; line-height: 1; color: var(--dark); cursor: pointer;
}
.choir-cal-nav:hover:not(:disabled), .choir-cal-nav:focus-visible { border-color: var(--burgundy); color: var(--burgundy); outline: none; }
.choir-cal-nav:disabled { opacity: .3; cursor: default; }
.choir-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; text-align: center; }
.choir-cal-wd { font-family: var(--ff-ui); font-size: .68rem; font-weight: 700; text-transform: uppercase; color: var(--text-muted); padding: .2rem 0; }
.choir-cal-day {
  position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 1;
  font-family: var(--ff-ui); font-size: .85rem; color: var(--text-muted);
  border: 0; border-radius: 50%; background: none; padding: 0;
}
.choir-cal-day.is-today { box-shadow: inset 0 0 0 1px var(--border); }
button.choir-cal-day { cursor: pointer; color: #fff; background: var(--burgundy); font-weight: 700; }
button.choir-cal-day:hover, button.choir-cal-day:focus-visible { background: var(--burgundy-dark); outline: none; }
button.choir-cal-day.is-current { background: var(--gold); color: var(--slate-dark); box-shadow: 0 0 0 2px var(--bg-card), 0 0 0 4px var(--gold); }
/* Hover / keyboard-focus tooltip with the day's title */
.choir-cal-day[data-tip]::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  width: max-content; max-width: 210px; padding: .35rem .55rem; border-radius: 6px;
  background: var(--slate-dark); color: #fff; font-family: var(--ff-ui); font-size: .75rem; font-weight: 600;
  line-height: 1.3; text-align: left; white-space: normal; pointer-events: none;
  opacity: 0; visibility: hidden; transition: opacity .15s; z-index: 6;
}
.choir-cal-day.tip-left[data-tip]::after { left: 0; transform: none; }
.choir-cal-day.tip-right[data-tip]::after { left: auto; right: 0; transform: none; }
.choir-cal-day[data-tip]:hover::after, .choir-cal-day[data-tip]:focus-visible::after { opacity: 1; visibility: visible; }

/* ── search + list ───────────────────────────────────────── */
.choir-search-label {
  display: block; margin: var(--sp-md) 0 .3rem; font-family: var(--ff-ui); font-size: var(--fs-xs);
  font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted);
}
.choir-search {
  width: 100%; box-sizing: border-box; padding: .55rem .75rem; border: 1px solid var(--border);
  border-radius: var(--radius); background: #fff; font-family: var(--ff-ui); font-size: 1rem; color: var(--dark);
}
.choir-search:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }
.choir-list { list-style: none; margin: var(--sp-sm) 0 0; padding: 0; overflow-y: auto; }
/* While the column is pinned, keep all of it on screen: the list takes what height is left
   under the calendar and scrolls inside itself. */
@media (min-width: 821px) {
  .choir-aside { display: flex; flex-direction: column; max-height: calc(100vh - var(--header-h) - 2.5rem); }
  .choir-browse { flex: 1 1 auto; }
  .choir-list { flex: 1 1 auto; min-height: 7rem; }
}
.choir-list-item {
  display: flex; flex-direction: column; gap: .1rem; width: 100%; padding: .55rem .4rem;
  border: 0; border-bottom: 1px solid var(--border); background: none; text-align: left; cursor: pointer; font: inherit;
}
.choir-list-item:hover, .choir-list-item:focus-visible { background: var(--bg); outline: none; }
.choir-list-date { font-family: var(--ff-ui); font-size: .75rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--gold-dark); }
.choir-list-title { color: var(--dark); line-height: 1.3; }
.choir-list-empty { padding: .6rem .4rem; color: var(--text-muted); font-size: var(--fs-sm); }
.choir-browse-toggle { display: none; }

/* ── tablet: chip bar over the entry, calendar column on the right ── */
@media (max-width: 1100px) {
  .choir-layout { grid-template-columns: minmax(0, 1fr) 270px; grid-template-areas: "main aside"; }
  .choir-main { display: block; grid-area: main; min-width: 0; }
  .choir-toc {
    top: calc(var(--header-h) + .25rem); z-index: 5; margin-bottom: var(--sp-md);
    padding: .5rem 0; background: var(--bg);
  }
  .choir-toc-title { display: none; }
  .choir-toc ol { display: flex; gap: .4rem; overflow-x: auto; border-left: 0; scrollbar-width: none; }
  .choir-toc ol::-webkit-scrollbar { display: none; }
  .choir-toc a {
    white-space: nowrap; margin: 0; padding: .35rem .85rem; border: 1px solid var(--border);
    border-radius: 999px; background: var(--bg-card);
  }
  .choir-toc a.is-active { border-color: var(--burgundy); background: var(--burgundy); color: #fff; }
}

/* ── phone: browse panel on top, one column ── */
@media (max-width: 820px) {
  .choir-page { padding-top: var(--sp-xl); }
  .choir-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "aside" "main"; gap: var(--sp-md); }
  .choir-aside { position: static; }
  .choir-browse-toggle {
    display: flex; align-items: center; justify-content: space-between; width: 100%;
    padding: .8rem 1rem; border: 1px solid var(--border); border-radius: var(--radius-lg);
    background: var(--bg-card); font-family: var(--ff-ui); font-size: 1rem; font-weight: 700; color: var(--burgundy); cursor: pointer;
  }
  .choir-browse-toggle::after { content: '\25BE'; transition: transform .2s; }
  .choir-browse-toggle[aria-expanded="true"]::after { transform: rotate(180deg); }
  .choir-browse { display: none; margin-top: var(--sp-sm); }
  .choir-browse.is-open { display: flex; }
  .choir-list { max-height: 50vh; }
  .choir-sec { padding: var(--sp-md); }
  .choir-entry-head h2 { font-size: var(--fs-2xl); }
  .choir-pdf-open { width: 120px; }
}

/* No section menu to show (nothing published yet, a date that isn't published, or an empty
   entry): the entry takes the left of the page so the calendar column stays against the right. */
.choir-aside[hidden] { display: none; }
@media (min-width: 1101px) {
  .choir-page.is-bare .choir-layout { grid-template-columns: minmax(0, 1fr) 300px; grid-template-areas: "entry aside"; }
}

/* Buttons on this page use the header Donate button's type (Volkhov, bold caps). Their own class, not
   .btn: the site .btn sets IM Fell with wide letter-spacing, which pushes the label off-centre. */
.choir-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  box-sizing: border-box; min-height: 40px; padding: 0 1.15em;
  font-family: 'Volkhov', Garamond, Georgia, serif; font-weight: 700; font-size: .78rem; line-height: 1;
  letter-spacing: .03em; text-transform: uppercase; text-decoration: none; white-space: nowrap;
  border: 2px solid var(--burgundy); border-radius: 4px; cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}
.choir-btn--primary { background: var(--burgundy); color: #fff; }
.choir-btn--primary:hover { background: var(--burgundy-light); border-color: var(--burgundy-light); color: #fff; }
.choir-btn--outline { background: transparent; color: var(--burgundy); }
.choir-btn--outline:hover { background: var(--burgundy); color: #fff; }
.choir-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
