/* ─── Design tokens ──────────────────────────────────────── */
:root {
  /* Palette */
  --color-opera-blue: #073991;
  --color-midnight: #071E46;
  --color-heritage-gold: #B89146;
  --color-champagne: #E8DCC2;
  --color-white: #FFFFFF;
  --color-ivory: #F8F5EF;
  --color-text: #222222;
  --color-text-secondary: #626262;
  --color-text-muted: #858585;
  --color-border: #D5D5D2;
  --color-divider: #E1E0DC;
  --color-action: var(--color-opera-blue);
  --color-action-hover: #062E76;

  /* Semantic surfaces (light mode: cream page, white elevated) */
  --page-bg: var(--color-ivory);
  --surface-elevated: var(--color-white);

  --font-display: "Fraunces", Georgia, serif;
  --font-ui: "IBM Plex Sans", Arial, sans-serif;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;

  --radius-sm: 2px;
  --radius-md: 4px;

  --border-default: 1px solid var(--color-border);
  --divider-default: 1px solid var(--color-divider);
}

/* ─── Dark mode ──────────────────────────────────────────── */
/* Applied when OS is dark AND user hasn't overridden to light */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-opera-blue: #5B8FE0;
    --color-midnight: #B4CDF0;
    --color-heritage-gold: #C8A95E;
    --color-text: #DDD9D2;
    --color-text-secondary: #978F87;
    --color-text-muted: #6A6865;
    --color-border: #252D3A;
    --color-divider: #1C2430;
    --color-action: #5B8FE0;
    --color-action-hover: #7AA5F0;
    --border-default: 1px solid var(--color-border);
    --divider-default: 1px solid var(--color-divider);
    --page-bg: #0D1219;
    --surface-elevated: #141B26;
  }
}

/* Applied when user has explicitly toggled dark, regardless of OS */
[data-theme="dark"] {
  --color-opera-blue: #5B8FE0;
  --color-midnight: #B4CDF0;
  --color-heritage-gold: #C8A95E;
  --color-text: #DDD9D2;
  --color-text-secondary: #978F87;
  --color-text-muted: #6A6865;
  --color-border: #252D3A;
  --color-divider: #1C2430;
  --color-action: #5B8FE0;
  --color-action-hover: #7AA5F0;
  --border-default: 1px solid var(--color-border);
  --divider-default: 1px solid var(--color-divider);
  --page-bg: #0D1219;
  --surface-elevated: #141B26;
}

/* Show correct icon per theme */
.theme-icon-sun  { display: none; }
.theme-icon-moon { display: block; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-icon-sun  { display: block; }
  :root:not([data-theme="light"]) .theme-icon-moon { display: none;  }
}
[data-theme="dark"]  .theme-icon-sun  { display: block; }
[data-theme="dark"]  .theme-icon-moon { display: none;  }
[data-theme="light"] .theme-icon-sun  { display: none;  }
[data-theme="light"] .theme-icon-moon { display: block; }

/* ─── Base ───────────────────────────────────────────────── */
html, body, button, input, select, textarea {
  font-family: var(--font-ui);
  color: var(--color-text);
}

body {
  line-height: 1.5;
  margin: 0;
  background: var(--page-bg);
}

* { box-sizing: border-box; }

h1, h2, h3, h4, h5 { margin: 0; padding: 0; }

a { color: var(--color-opera-blue); }
a:hover { color: var(--color-action-hover); }

:focus-visible {
  outline: 2px solid var(--color-opera-blue);
  outline-offset: 2px;
}

/* ─── Header ─────────────────────────────────────────────── */
#header {
  padding: var(--space-3) 0;
  border-bottom: var(--divider-default);
  margin-bottom: 0;
}

.header-content {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 48px;
  max-width: 1100px;
  margin: 0 auto;
}

.header-logo-link {
  grid-column: 2;
}

.header-logo-link { display: block; line-height: 0; grid-column: 2; }

/* Inline SVG logo */
.ao-logo { display: block; width: 100px; height: auto; }
@media (min-width: 480px) { .ao-logo { width: 114px; } }
.ao-logo-mark { fill: var(--color-opera-blue); }
.ao-logo-type { fill: var(--color-text); }

/* legacy img fallback, kept in case referenced elsewhere */
.header-logo-img { width: 110px; height: auto; display: block; }

.header-nav {
  grid-column: 3;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.header-nav-link {
  font-size: .8125em;
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color 120ms ease;
}

.header-nav-link:hover { color: var(--color-opera-blue); }

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 50%;
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease;
  flex-shrink: 0;
}
.theme-toggle:hover {
  color: var(--color-text-secondary);
  border-color: var(--color-text-muted);
}
.theme-toggle:focus-visible {
  outline: 2px solid var(--color-opera-blue);
  outline-offset: 2px;
}

/* legacy, kept for other pages */
.header-icon-left, .header-icon-right { width: 40px; }
.header-logo { width: 120px; }
.header-logo img { width: 100%; height: auto; display: block; }
.header-menu { display: none; }

/* ─── Footer ─────────────────────────────────────────────── */
#footer {
  margin-top: var(--space-9);
  padding: var(--space-5) 0;
  border-top: var(--divider-default);
}

#footer .footer-content { text-align: center; }

#footer .colophon {
  font-size: .8125em;
  color: var(--color-text-muted);
}

#footer .colophon a { color: inherit; }

/* ─── Home hero ──────────────────────────────────────────── */
.home-hero {
  text-align: center;
  padding: var(--space-9) 0 var(--space-7);
}

.home-hero-title {
  font-family: var(--font-display);
  font-size: 2.5em;
  font-weight: 500;
  color: var(--color-midnight);
  line-height: 1.1;
  margin-bottom: var(--space-3);
}

.home-hero-sub {
  font-size: 1em;
  color: var(--color-text-secondary);
  margin: 0 0 var(--space-6);
}

@media (min-width: 480px) {
  .home-hero-title { font-size: 3.25em; }
  .home-hero-sub { font-size: 1.0625em; }
}

@media (min-width: 992px) {
  .home-hero-title { font-size: 4em; }
}

/* Hero search form */
.hero-search-form { margin-bottom: var(--space-5); }

.hero-search-row {
  display: flex;
  gap: var(--space-2);
}

.hero-search-input {
  flex: 1;
  height: 52px;
  padding: 0 var(--space-4);
  font-size: 1em;
  font-family: var(--font-ui);
  border: var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
  color: var(--color-text);
  outline: none;
  transition: border-color 150ms ease;
}

.hero-search-input:focus { border-color: var(--color-opera-blue); }

.hero-search-btn {
  height: 52px;
  padding: 0 var(--space-5);
  border: 0;
  background: var(--color-opera-blue);
  color: var(--color-white);
  font-family: var(--font-ui);
  font-size: .875em;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  transition: background 150ms ease;
}

.hero-search-btn:hover { background: var(--color-action-hover); }

.home-stats {
  font-size: .8125em;
  color: var(--color-text-muted);
  letter-spacing: .04em;
  margin-bottom: var(--space-5);
}

.home-stats-dot {
  margin: 0 var(--space-2);
  color: var(--color-heritage-gold);
}

.discover-link {
  display: inline-block;
  font-size: .875em;
  color: var(--color-text-muted);
  text-decoration: none;
  margin-top: var(--space-2);
  transition: color 120ms ease;
}

.discover-link:hover { color: var(--color-opera-blue); }

/* Featured operas on home page */
.home-featured {
  border-top: var(--divider-default);
  padding: var(--space-7) 0 var(--space-9);
  margin-top: var(--space-5);
}

.home-featured-label {
  font-size: .75em;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-5);
}

.home-featured-grid {
  grid-template-columns: 1fr;
}

@media (min-width: 480px) {
  .home-featured-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 992px) {
  .home-featured-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Voice type search (collapsible) */
.voice-search-details {
  border-top: var(--divider-default);
  padding-top: var(--space-5);
  margin-bottom: var(--space-7);
}

.voice-search-summary {
  font-size: .8125em;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  cursor: pointer;
  list-style: none;
  user-select: none;
  padding: var(--space-2) 0;
}

.voice-search-summary::-webkit-details-marker { display: none; }

.voice-search-summary::before {
  content: '▸ ';
  color: var(--color-opera-blue);
}

details[open] .voice-search-summary::before { content: '▾ '; }

.voice-search-form { padding-top: var(--space-4); }

.voice-inputs {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: var(--space-4);
}

.voice-input-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
}

.voice-input {
  width: 56px;
  height: 48px;
  text-align: center;
  font-size: 1.125em;
  font-family: var(--font-ui);
  border: var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
  color: var(--color-text);
  outline: none;
  transition: border-color 150ms ease;
}

.voice-input:focus { border-color: var(--color-opera-blue); }

.voice-label {
  font-size: .6875em;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--color-text-secondary);
  text-align: center;
}

.voice-search-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-top: var(--space-3);
  border-top: var(--divider-default);
}

.voice-exact-label {
  font-size: .875em;
  color: var(--color-text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.voice-search-btn {
  height: 40px;
  padding: 0 var(--space-5);
  border: 0;
  background: var(--color-opera-blue);
  color: var(--color-white);
  font-family: var(--font-ui);
  font-size: .8125em;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 150ms ease;
}

.voice-search-btn:hover { background: var(--color-action-hover); }

/* ─── Search page ────────────────────────────────────────── */
.search-page { padding: var(--space-6) 0 var(--space-9); }

.search-bar-compact {
  padding-bottom: var(--space-5);
  border-bottom: var(--divider-default);
  margin-bottom: var(--space-5);
}

.compact-search-form { margin-bottom: var(--space-4); }

.fach-search-compact { margin-bottom: var(--space-4); }

/* Filters */
.search-filters { margin-top: var(--space-4); }

.filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  align-items: center;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.filter-label {
  font-size: .75em;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.filter-select {
  font-size: .8125em;
  font-family: var(--font-ui);
  height: 32px;
  padding: 0 var(--space-3);
  border: var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-elevated);
  color: var(--color-text);
  cursor: pointer;
  transition: border-color 150ms ease;
}

.filter-select:focus {
  border-color: var(--color-opera-blue);
  outline: none;
}

/* Results header */
.results-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--space-3);
}

.results-count {
  font-size: .75em;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--color-opera-blue);
}

.export-link {
  font-size: .8em;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
}

.export-link:hover { color: var(--color-opera-blue); }

/* Opera result rows */
.opera-results {
  list-style: none;
  margin: 0;
  padding: 0;
}

.opera-result {
  display: block;
  padding: var(--space-4) 0;
  border-bottom: var(--divider-default);
  text-decoration: none;
  color: inherit;
}

.opera-result:hover .opera-result-title {
  color: var(--color-opera-blue);
}

.opera-result-title {
  font-family: var(--font-display);
  font-size: 1.1875em;
  font-weight: 500;
  color: var(--color-midnight);
  line-height: 1.2;
  transition: color 120ms ease;
}

.opera-result-composer {
  font-size: .9375em;
  font-weight: 500;
  color: var(--color-text);
  margin-top: var(--space-1);
}

.opera-result-meta {
  font-size: .8125em;
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

.opera-results-empty {
  padding: var(--space-7) 0;
  color: var(--color-text-muted);
  text-align: center;
  font-size: .9375em;
}

@media (min-width: 480px) {
  .opera-result-title { font-size: 1.3125em; }
}

@media (min-width: 992px) {
  .opera-result-title { font-size: 1.4375em; }
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-6);
  margin-top: var(--space-7);
  padding-top: var(--space-5);
  border-top: var(--divider-default);
  font-size: .875em;
}

.pagination-link {
  color: var(--color-opera-blue);
  text-decoration: none;
  font-weight: 500;
}

.pagination-link:hover { text-decoration: underline; }

.pagination-info { color: var(--color-text-muted); }

/* ─── Opera detail ───────────────────────────────────────── */
.opera-detail,
.person-detail {
  text-align: center;
  padding: var(--space-7) 0;
}

.title {
  font-family: var(--font-display);
  font-size: 2em;
  line-height: 1.1;
  font-weight: 500;
  color: var(--color-midnight);
}

.title-alt {
  font-family: var(--font-display);
  font-size: 1em;
  font-style: italic;
  font-weight: 400;
  color: var(--color-text-muted);
  margin-top: .35em;
}

.subtitle {
  font-size: .8125em;
  margin-top: .5em;
  text-transform: uppercase;
  letter-spacing: .2em;
  color: var(--color-text-secondary);
}

.seperator:before {
  content: '';
  height: 0;
  display: inline-block;
  margin: var(--space-5) 0;
}

.seperator.line:before {
  height: 3px;
  background: var(--color-heritage-gold);
  width: 36px;
}

.opera-credits { margin-bottom: var(--space-5); }
.opera-credits.last { margin-bottom: 0; }

.credits-title {
  font-size: .6875em;
  text-transform: uppercase;
  letter-spacing: .2em;
  margin-bottom: .3em;
  color: var(--color-text-muted);
}

.credits-title.credits-title-large {
  font-size: .75em;
  margin-bottom: var(--space-4);
  letter-spacing: .12em;
  font-weight: 600;
  color: var(--color-opera-blue);
}

.credits-name {
  font-size: 1.0625em;
  font-weight: 600;
}

.credits-name a,
.credits-name a:focus,
.credits-name a:visited {
  color: inherit;
  text-decoration: none;
}

.credits-name a:hover { color: var(--color-opera-blue); }

.credits-list > ul {
  list-style: none;
  padding: 0;
  margin: var(--space-3) 0 0;
}

.credits-list > ul > li {
  padding: var(--space-3) 0 var(--space-5);
  display: flex;
  justify-content: space-between;
  border-top: var(--divider-default);
}

.credits-list ul.role-fach-list {
  list-style-type: none;
  font-size: .8em;
  margin-top: .25em;
  padding: 0;
  color: var(--color-text-secondary);
}

.role-name { text-align: left; }

.role-name .role-character-name {
  font-size: 1em;
  font-weight: 600;
}

.role-name .role-character-description {
  font-size: .8125em;
  color: var(--color-text-secondary);
  margin-top: .15em;
}

.role-fach { text-align: right; }
.role-parent-fach { font-weight: 600; }

@media (min-width: 480px) {
  .title { font-size: 2.5em; }
  .subtitle { font-size: .9375em; }
  .credits-name { font-size: 1.1875em; }
  .role-name { font-size: 1.0625em; }
}

@media (min-width: 992px) {
  .title { font-size: 3.25em; }
  .subtitle { font-size: 1em; }
  .credits-title { font-size: .75em; }
  .credits-name { font-size: 1.25em; }
  .role-name { font-size: 1.125em; }
  .credits-list ul.role-fach-list { font-size: .875em; }
}

/* Synopsis */
.opera-synopsis {
  font-size: .9375em;
  line-height: 1.7;
  color: var(--color-text-secondary);
  text-align: left;
  max-width: 52ch;
  margin: 0 auto;
}

/* External links (IMSLP, etc.) */
.opera-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: center;
  padding-top: var(--space-2);
}

.opera-link {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: .75em;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: border-color 150ms ease, color 150ms ease;
}

.opera-link:hover {
  border-color: var(--color-opera-blue);
  color: var(--color-opera-blue);
}

/* Related sections on detail page */
.related-section {
  margin-top: var(--space-7);
  text-align: left;
}

.related-section-label {
  font-size: .75em;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--color-opera-blue);
  margin-bottom: var(--space-4);
}

.related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
}

@media (min-width: 480px) {
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 992px) {
  .related-grid { grid-template-columns: repeat(3, 1fr); }
}

.related-card {
  display: block;
  padding: var(--space-4);
  border: var(--border-default);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: border-color 150ms ease;
}

.related-card:hover {
  border-color: var(--color-opera-blue);
}

.related-card-title {
  font-family: var(--font-display);
  font-size: 1.125em;
  font-weight: 500;
  color: var(--color-midnight);
  line-height: 1.25;
  transition: color 150ms ease;
}

.related-card:hover .related-card-title {
  color: var(--color-opera-blue);
}

.related-card-composer {
  font-size: .75em;
  font-weight: 500;
  color: var(--color-text-secondary);
  margin-top: var(--space-1);
}

.related-card-meta {
  font-size: .75em;
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

/* Legacy list styles (opera-list used in related boxes + detail) */
.opera-list ul { padding: 0; margin: 0; list-style: none; }

.opera-list li {
  border-top: var(--divider-default);
  padding: var(--space-3) 0;
}

.opera-list li a {
  color: inherit;
  text-decoration: none;
  transition: color 120ms ease;
}

.opera-list li a:hover { color: var(--color-opera-blue); }

.opera-list-main { font-size: 1em; line-height: 1.4; }
.opera-list-title { font-weight: 600; }

.opera-list-premiere {
  font-weight: 400;
  color: var(--color-text-secondary);
  font-size: .9em;
}

.opera-list-info {
  font-size: .875em;
  color: var(--color-text-secondary);
  margin-top: .2em;
}

/* ═══════════════════════════════════════════════════════════
   Opera detail — redesign (od-* namespace)
   Container-fluid uses 2rem horizontal padding; sections
   with stripe backgrounds use margin: 0 -2rem to fill edge-
   to-edge within the container, then restore padding inline.
   ═══════════════════════════════════════════════════════════ */

/* ── Full-bleed stripe within container ── */
.od-stripe {
  margin-left: -2rem;
  margin-right: -2rem;
  padding-left: 2rem;
  padding-right: 2rem;
}
/* page bg = cream; elevated sections pop as white */
.od-ivory { background: var(--page-bg); }
.od-white { background: var(--surface-elevated); }

/* Centered inner wrapper */
.od-inner {
  max-width: 1100px;
  margin: 0 auto;
}

/* ── Section label ── */
.od-section-label {
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-divider);
  padding-top: var(--space-4);
  margin-bottom: var(--space-6);
}

/* ── Hero ── */
.od-hero {
  text-align: center;
  padding: 48px 0 56px;
  max-width: 1100px;
  margin: 0 auto;
}

.od-hero-title-alt {
  font-family: var(--font-display);
  font-size: .9375rem;
  font-style: italic;
  font-weight: 400;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

.od-hero-title {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 500;
  color: var(--color-midnight);
  line-height: 1.05;
  margin: 0;
}

.od-hero-rule {
  width: 32px;
  height: 1px;
  background: var(--color-heritage-gold);
  margin: var(--space-5) auto;
}

.od-hero-type {
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-3);
}

.od-hero-meta {
  font-size: .9375rem;
  color: var(--color-text-secondary);
  line-height: 1.7;
}

.od-hero-meta a {
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color 120ms ease;
}
.od-hero-meta a:hover { color: var(--color-opera-blue); }

.od-meta-sep {
  margin: 0 .4em;
  color: var(--color-divider);
}

@media (min-width: 480px)  { .od-hero-title { font-size: 3.75rem; } }
@media (min-width: 992px)  { .od-hero-title { font-size: 4.5rem; } }
@media (max-width: 768px)  { .od-hero { padding: 32px 0 40px; } }

/* ── About + Details (two-column) ── */
.od-body {
  padding: var(--space-6) 0;
  border-top: 1px solid var(--color-divider);
  border-bottom: 1px solid var(--color-divider);
}

.od-body-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: var(--space-9);
  align-items: start;
}

.od-synopsis {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--color-text);
  margin: 0 0 var(--space-5);
  max-width: 58ch;
}

.od-ext-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-4);
}

.od-ext-link {
  display: inline-block;
  padding: 4px var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: border-color 120ms ease, color 120ms ease;
}
.od-ext-link:hover {
  border-color: var(--color-opera-blue);
  color: var(--color-opera-blue);
}

.od-dl { margin: 0; }

.od-dl-row {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-divider);
}
.od-dl-row:first-child { border-top: 1px solid var(--color-divider); }

.od-dt {
  font-size: .625rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: .2em;
}

.od-dd {
  font-size: .9375rem;
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.5;
}
.od-dd a {
  color: inherit;
  text-decoration: none;
  transition: color 120ms ease;
}
.od-dd a:hover { color: var(--color-opera-blue); }

@media (max-width: 768px) {
  .od-body-grid {
    grid-template-columns: 1fr;
    gap: var(--space-7);
  }
  .od-body { padding: var(--space-5) 0; }
}

/* ── Roles ── */
.od-roles {
  padding: var(--space-6) 0;
  border-bottom: 1px solid var(--color-divider);
}

.od-roles-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-5);
  flex-wrap: wrap;
}

.od-roles-header .od-section-label { flex-shrink: 0; }

.od-voice-summary {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-divider);
  flex: 1;
  justify-content: flex-end;
  min-width: 0;
}

.od-voice-pill {
  display: inline-flex;
  align-items: baseline;
  gap: .35em;
  padding: 2px 9px;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  font-size: .625rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.od-voice-count {
  color: var(--color-opera-blue);
  font-size: .75rem;
}

.od-role-list { margin-top: var(--space-4); }

.od-role-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: var(--space-5);
  padding: var(--space-4) 0;
  border-top: 1px solid var(--color-divider);
}
.od-role-row:last-child { border-bottom: 1px solid var(--color-divider); }

.od-role-char {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 400;
  color: var(--color-midnight);
  line-height: 1.2;
}

.od-role-char-desc {
  font-size: .8125rem;
  color: var(--color-text-muted);
  margin-top: .2em;
  font-family: var(--font-ui);
}

.od-role-subtype {
  font-size: .75rem;
  font-weight: 400;
  color: var(--color-text-secondary);
  margin-top: 2px;
}

.od-role-voice {
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

@media (max-width: 768px) {
  .od-roles { padding: var(--space-5) 0; }
  .od-voice-summary { justify-content: flex-start; }
}

/* ── Composer catalogue ── */
.od-catalogue {
  padding: var(--space-6) 0;
}

.od-catalogue-heading {
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  border-top: 1px solid var(--color-divider);
  padding-top: var(--space-4);
  margin-bottom: 0;
}

.od-catalogue-list { border-bottom: 1px solid var(--color-divider); }

.od-cat-row {
  display: grid;
  grid-template-columns: 2.5ch 1fr auto 1.5ch;
  align-items: baseline;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-top: 1px solid var(--color-divider);
  text-decoration: none;
  color: inherit;
  transition: background 120ms ease;
  border-radius: 0;
}

.od-cat-row:focus-visible { outline: 2px solid var(--color-opera-blue); outline-offset: 2px; }

.od-cat-num {
  font-size: .6875rem;
  font-weight: 600;
  color: var(--color-heritage-gold);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

.od-cat-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 400;
  color: var(--color-midnight);
  line-height: 1.3;
  transition: color 120ms ease;
}

.od-cat-row:hover .od-cat-title { color: var(--color-opera-blue); }

.od-cat-year {
  font-size: .8125rem;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.od-cat-arrow {
  font-size: .875rem;
  color: var(--color-opera-blue);
  opacity: 0;
  transition: opacity 120ms ease, transform 120ms ease;
  text-align: right;
}

.od-cat-row:hover .od-cat-arrow,
.od-cat-row:focus-visible .od-cat-arrow {
  opacity: 1;
  transform: translateX(2px);
}

.od-cat-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: var(--space-4);
}

.od-cat-view-all {
  font-size: .8125rem;
  font-weight: 500;
  color: var(--color-opera-blue);
  text-decoration: none;
  transition: color 120ms ease;
}
.od-cat-view-all:hover { color: var(--color-action-hover); text-decoration: underline; }

@media (max-width: 480px) {
  .od-cat-row { grid-template-columns: 2.5ch 1fr auto; }
  .od-cat-arrow { display: none; }
  .od-catalogue { padding: var(--space-5) 0; }
}

/* ── Person detail ── */
.od-person-years {
  font-family: var(--font-ui);
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  margin-top: var(--space-3);
}

.od-person-bio {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--color-text);
  max-width: 72ch;
  margin-top: var(--space-5);
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

.od-person-meta {
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-top: var(--space-5);
}

/* Person page: no number column */
.od-catalogue--plain .od-cat-row {
  grid-template-columns: 1fr auto 1.5ch;
}

@media (max-width: 480px) {
  .od-catalogue--plain .od-cat-row { grid-template-columns: 1fr auto; }
}

/* Librettist catalogue row — title stacks above composer name */
.od-cat-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.od-cat-composer {
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Related discovery ── */
.od-related {
  padding: var(--space-7) 0 var(--space-9);
}

.od-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.od-related-item {
  display: block;
  padding: var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: border-color 120ms ease;
}
.od-related-item:hover { border-color: var(--color-opera-blue); }

.od-related-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 400;
  color: var(--color-midnight);
  line-height: 1.25;
  transition: color 120ms ease;
}
.od-related-item:hover .od-related-title { color: var(--color-opera-blue); }

.od-related-sub {
  font-size: .75rem;
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

/* ─── Dark mode overrides for legacy components ──────────── */
/* These use CSS variables directly so they update automatically.
   The vars are set by the dark-mode blocks above. */
.related-card { background: var(--surface-elevated); }
