:root {
  --ivory: #f8f3e8;
  --walnut: #2b2924;
  --sand: #d9cba8;
  --gold: #c8962e;
  --gold-2: #d9ad4b;
  --sky: #3d6244;
  --stone: #756f62;
  --bg: #f8f3e8;
  --text: #322f29;
  --dark: #292822;
  --navy: #292822;
  --navy-2: #3a3931;
  --cream: #f8f3e8;
  --ink: #292822;
  --muted: #756f62;
  --card: #fffdf8;
  --orange: #b65e32;
  --green: #3d6244;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(43, 41, 36, 0.07);
  --space-1: 8px;
  --space-2: 12px;
  --space-3: 18px;
  --space-4: 26px;
  --space-5: 38px;
  --space-6: 56px;
  --font-serif: "Noto Serif", Georgia, serif;
  --font-sans: "Be Vietnam Pro", "Segoe UI", sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.thanh-ca-body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--sky); text-decoration: none; }
a:hover { color: var(--walnut); }
button, input, select { font: inherit; }
:focus-visible { outline: 3px solid rgba(200, 150, 46, .55); outline-offset: 3px; }
h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.15;
  color: var(--walnut);
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.2rem, 5vw, 4.2rem); }
h2 { font-size: clamp(1.7rem, 3vw, 2.6rem); }
h3 { font-size: 1.25rem; }

.container { width: min(1120px, calc(100% - 32px)); margin-inline: auto; }
.container.narrow { width: min(760px, calc(100% - 32px)); }
.skip-link {
  position: absolute; left: -999px; top: 0;
}
.skip-link:focus { left: 12px; background: var(--gold); color: var(--bg); padding: 8px 12px; z-index: 99; }
.screen-reader-text {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0);
}

/* Header — walnut menu on cream */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(246, 242, 232, 0.94);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--sand);
}
.header-inner {
  display: flex; align-items: center; gap: 20px;
  padding: 14px 0;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--walnut); }
.brand img, .brand-mark, .custom-logo {
  width: 56px; height: 56px; border-radius: 11px;
  object-fit: contain; border: 1px solid var(--gold); background: #fff;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--font-serif); font-size: 1.15rem; color: var(--walnut); }
.site-nav { margin-left: auto; }
.site-nav ul { display: flex; gap: 18px; list-style: none; margin: 0; padding: 0; }
.site-nav a { color: var(--walnut); font-size: 0.88rem; white-space: nowrap; }
.site-nav a { position: relative; padding: 8px 0; }
.site-nav a::after { content: ""; position: absolute; right: 0; bottom: 3px; left: 0; height: 1px; background: var(--gold); transform: scaleX(0); transform-origin: left; transition: transform .22s ease; }
.site-nav a:hover::after, .site-nav .current-menu-item a::after { transform: scaleX(1); }
.site-nav a:hover { color: var(--gold); }
.nav-toggle { display: none; background: transparent; color: var(--walnut); border: 1px solid var(--gold); border-radius: 999px; padding: 6px 12px; }
.header-search {
  display: flex;
  position: relative;
  align-items: center;
  height: 46px;
  gap: 0;
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 255, 255, .92), transparent 34%),
    linear-gradient(120deg, #fffdf8 0%, #f4e6bd 100%);
  border: 1px solid var(--sand);
  border-radius: 999px;
  overflow: hidden;
}
.header-search::before {
  content: "⌕";
  flex: 0 0 auto;
  margin-left: 14px;
  color: var(--gold);
  font: 700 1.45rem/1 var(--font-sans);
}
.header-search input {
  height: 100%;
  min-width: 0;
  background: transparent;
  border: 0;
  border-radius: 999px 0 0 999px;
  color: var(--text);
  padding: 0 12px 0 8px;
  width: 194px;
  font: inherit;
  line-height: 1;
}
.header-search input::placeholder { color: var(--stone); opacity: 1; }
.header-search input:focus-visible,
.hero-search input:focus-visible {
  outline: 0;
  box-shadow: none;
}
.header-search .search-topic-filter {
  align-self: stretch;
  max-width: 100px;
  min-width: 88px;
  padding: 0 30px 0 11px;
  border: 0;
  border-left: 1px solid var(--sand);
  border-radius: 0;
  appearance: none;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='m3 4.5 3 3 3-3' stroke='%232b2924' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 11px center;
  color: var(--walnut);
  font: 500 .8rem/1 var(--font-sans);
  cursor: pointer;
}
.header-search .search-topic-filter option { color: var(--text); background: var(--bg); }
.header-search button {
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--gold);
  color: var(--dark);
  border: 0;
  border-radius: 0 999px 999px 0;
  padding: 0 16px;
  font: 600 .86rem/1 var(--font-sans);
  cursor: pointer;
}
.header-search .live-results { min-width: 320px; top: calc(100% + 6px); }

/* Breadcrumbs keep orientation clear without competing with the page title. */
.breadcrumb-bar {
  background: rgba(255, 253, 248, .9);
  border-bottom: 1px solid rgba(217, 203, 168, .72);
}
.breadcrumbs {
  min-height: 46px;
  display: flex;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
}
.breadcrumbs::-webkit-scrollbar { display: none; }
.breadcrumbs ol {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: max-content;
  margin: 0;
  padding: 10px 0;
  list-style: none;
}
.breadcrumbs li {
  display: inline-flex;
  align-items: center;
  color: var(--stone);
  font: 500 .82rem/1.35 var(--font-sans);
  white-space: nowrap;
}
.breadcrumbs li + li::before {
  content: "›";
  margin: 0 10px;
  color: var(--gold);
  font: 400 1.25rem/1 var(--font-serif);
}
.breadcrumbs a { color: var(--stone); transition: color .18s ease; }
.breadcrumbs a:hover { color: var(--walnut); }
.breadcrumbs li[aria-current="page"] { color: var(--walnut); font-weight: 700; }

/* Hero — charcoal olive veil (brand mood) */
.hero {
  position: relative;
  min-height: 78vh;
  display: grid;
  place-items: end stretch;
  background: var(--dark) center/cover no-repeat;
  background-image: var(--hero-image);
}
.hero-veil {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(37,36,31,.28) 0%, rgba(37,36,31,.55) 45%, rgba(37,36,31,.92) 100%);
}
.hero-copy { position: relative; padding: clamp(72px, 9vh, 116px) 0 clamp(64px, 8vh, 96px); }
.hero-copy h1 { max-width: 690px; margin-bottom: 0.4em; color: var(--gold-2); }
.eyebrow {
  color: var(--gold);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.78rem;
  margin: 0 0 10px;
}
.lede { font-size: 1.15rem; color: var(--ivory); max-width: 36rem; }
.hero-copy .lede { color: var(--ivory); }

.hero-search {
  position: relative;
  margin-top: 34px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px auto;
  align-items: stretch;
  gap: 8px;
  max-width: 760px;
  background:
    radial-gradient(circle at 9% 0%, rgba(255, 230, 159, .24), transparent 32%),
    linear-gradient(125deg, rgba(35, 31, 23, .86), rgba(77, 57, 24, .72));
  border: 1px solid rgba(169, 134, 79, 0.55);
  padding: 8px;
  border-radius: 18px;
  backdrop-filter: blur(10px);
  box-shadow: 0 14px 32px rgba(18, 16, 12, .22);
}
.hero-search.compact { margin-top: 24px; }
.search-input-wrap {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  grid-template-rows: 18px 26px;
  align-content: center;
  min-width: 0;
  min-height: 64px;
  padding: 9px 16px 9px 12px;
  border: 1px solid rgba(232, 184, 48, .5);
  border-radius: 12px;
  background:
    radial-gradient(circle at 94% 0%, rgba(255, 255, 255, .95), transparent 31%),
    linear-gradient(125deg, #fffdf8 0%, #f1dfad 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
}
.search-input-wrap::before {
  content: "⌕";
  grid-row: 1 / -1;
  align-self: center;
  color: var(--gold);
  font: 700 1.55rem/1 var(--font-sans);
}
.search-input-label {
  grid-column: 2;
  grid-row: 1;
  align-self: end;
  color: var(--stone);
  font: 700 .69rem/1 var(--font-sans);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.hero-search input {
  grid-column: 2;
  grid-row: 2;
  width: 100%;
  min-width: 0;
  height: 26px;
  background: transparent;
  border: 0;
  color: var(--walnut);
  font: 500 .98rem/1.2 var(--font-sans);
  line-height: 1;
  padding: 1px 0 0;
}
.hero-search input::placeholder { color: var(--stone); opacity: 1; }
.search-filter-wrap {
  position: relative;
  min-width: 0;
  min-height: 64px;
}
.search-filter-label {
  position: absolute;
  top: 13px;
  left: 16px;
  z-index: 1;
  pointer-events: none;
  color: rgba(255, 253, 248, .76);
  font: 700 .64rem/1 var(--font-sans);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.hero-search .search-topic-filter {
  display: block;
  width: 100%;
  height: 64px;
  padding: 19px 36px 0 16px;
  border: 1px solid rgba(232, 184, 48, .62);
  border-radius: 12px;
  appearance: none;
  background: rgba(37, 36, 31, .48) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='m3 4.5 3 3 3-3' stroke='%23fcf4dd' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 15px center;
  color: var(--ivory);
  font: 500 .9rem/1 var(--font-sans);
  cursor: pointer;
}
.hero-search .search-topic-filter option { color: var(--text); background: var(--bg); }
.hero-search .btn { min-height: 64px; padding-inline: 22px; white-space: nowrap; }
.live-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px);
  background: var(--bg);
  border: 1px solid var(--sand);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  z-index: 20;
}
.live-results a {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 12px 16px; color: var(--text);
  border-bottom: 1px solid rgba(176, 155, 124, 0.35);
}
.live-results a:hover { background: var(--ivory); color: var(--walnut); }
.live-results-label {
  margin: 0; padding: 10px 16px 6px;
  color: var(--muted); font-size: 0.76rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  background: rgba(176, 155, 124, 0.12);
}
.live-results-label + a { border-top: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px; border: 1px solid transparent;
  padding: 12px 20px; font: 600 0.95rem var(--font-sans);
  cursor: pointer; line-height: 1.3; text-decoration: none;
  transition: transform .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.gold { background: var(--gold); color: var(--dark); }
.btn.gold:hover { background: var(--gold-2); color: var(--dark); }
.btn.cream { background: var(--ivory); color: var(--walnut); }
.btn.cream:hover { background: #fff; color: var(--walnut); }
.btn.ghost { background: transparent; border-color: var(--gold); color: var(--gold); }
.btn.ghost:hover { background: var(--gold); color: var(--dark); }
.btn.outline { background: transparent; border-color: var(--sand); color: var(--walnut); }
.btn.outline:hover { background: #fff; border-color: var(--gold); color: var(--walnut); }
.btn.sm {
  padding: 7px 9px;
  font-size: .78rem;
  line-height: 1.2;
  white-space: nowrap;
}

.section { padding: clamp(64px, 8vw, 104px) 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 28px; margin-bottom: 34px; }
.section-head .text-link { margin-left: auto; color: var(--sky); }
.section-head .text-link { font-size: .9rem; font-weight: 600; }
.home-latest { background: linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,0)); }
.home-instrument-data {
  padding-top: 10px;
  background: linear-gradient(180deg, transparent, rgba(217, 203, 168, .22) 52%, transparent);
}
.home-instrument-panel {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 4vw, 44px);
  border: 1px solid rgba(200, 150, 46, .55);
  border-radius: 18px;
  background:
    radial-gradient(circle at 92% 9%, rgba(232, 184, 48, .24), transparent 23%),
    radial-gradient(circle at 7% 100%, rgba(99, 131, 89, .22), transparent 30%),
    linear-gradient(128deg, #292822 0%, #3d392d 53%, #292822 100%);
  box-shadow: 0 18px 42px rgba(43, 41, 36, .16);
}
.home-instrument-panel::after {
  content: "♫";
  position: absolute;
  right: clamp(14px, 4vw, 46px);
  bottom: -34px;
  color: rgba(232, 184, 48, .1);
  font: 700 clamp(7rem, 15vw, 12rem)/1 var(--font-serif);
  pointer-events: none;
}
.home-instrument-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 24px;
}
.home-instrument-head .eyebrow { margin-bottom: 8px; }
.home-instrument-head h2 { margin: 0 0 8px; color: var(--ivory); }
.home-instrument-head p:not(.eyebrow) { max-width: 590px; margin: 0; color: rgba(248, 243, 232, .8); }
.home-instrument-all { flex: 0 0 auto; }
.home-instrument-grid {
  position: relative;
  z-index: 1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.home-instrument-card {
  min-height: 164px;
  border-color: rgba(247, 237, 211, .46);
  background:
    radial-gradient(circle at 100% 0%, rgba(217, 173, 75, .2), transparent 36%),
    linear-gradient(145deg, rgba(255, 253, 248, .98), rgba(248, 240, 221, .94));
}
.home-instrument-card h3 {
  overflow-wrap: anywhere;
  margin: 0;
  font: 600 1.04rem/1.38 var(--font-sans);
}
.home-instrument-empty {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 20px;
  border: 1px dashed rgba(247, 237, 211, .45);
  border-radius: 13px;
  background: rgba(255, 253, 248, .07);
}
.home-instrument-empty > span { color: var(--gold); font-size: 2rem; }
.home-instrument-empty p { margin: 0; color: rgba(248, 243, 232, .85); }
.cross-rule {
  text-align: center; color: var(--gold); font-size: 1.4rem; opacity: 0.85; margin: 0 0 34px;
}

/* Catalogue cards — quieter, more like a music library than an app dashboard. */
.song-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 26px;
}
.song-card {
  background: var(--card);
  border: 1px solid var(--sand);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  transition: transform .24s ease, box-shadow .24s ease, border-color .24s ease;
}
.song-card:hover { transform: translateY(-4px); border-color: rgba(200, 150, 46, .62); box-shadow: 0 16px 34px rgba(43, 41, 36, .12); }
.card-cover { position: relative; display: block; aspect-ratio: 4/3; overflow: hidden; }
.card-cover a { display: block; height: 100%; }
.card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.song-card:hover .card-cover img { transform: scale(1.06); }
.play-badge {
  position: absolute; right: 12px; bottom: 12px;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--orange); color: #fff;
  display: grid; place-items: center; font-size: 14px;
  border: 0; cursor: pointer;
}
.card-body { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 9px; flex: 1; }
.card-topic { margin: 0; color: var(--green); font-size: 0.75rem; letter-spacing: .12em; text-transform: uppercase; }
.card-body h3 { margin: 1px 0 2px; min-height: 2.3em; font-size: clamp(1.08rem, 1.5vw, 1.25rem); }
.card-body h3 a { color: var(--walnut); }
.card-body h3 a:hover { color: var(--gold); }
.card-meta { margin: 0; color: var(--stone); font-size: 0.85rem; display: flex; gap: 10px; }
.card-author { display: grid; gap: 2px; margin-top: 2px; color: var(--walnut); }
.card-author-name { font-size: 0.8rem; font-weight: 700; }
.card-author-bio { color: var(--text); font-size: 0.78rem; line-height: 1.5; white-space: pre-line; }
.card-pdf-meta {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 5px 0 0; color: var(--muted); font-size: 0.74rem;
}
.card-pdf-meta span + span::before { content: "·"; margin-right: 6px; color: var(--sand); }
.card-pdf-meta span:first-child {
  color: var(--green); font-weight: 700; letter-spacing: .08em;
}
.card-actions {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 16px;
}
.card-actions .btn.sm { flex: 0 1 auto; min-height: 34px; }

.topic-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.topic-card {
  position: relative; border-radius: var(--radius); overflow: hidden;
  min-height: 190px; display: block; color: #fff;
  box-shadow: var(--shadow); transition: transform .24s ease, box-shadow .24s ease;
}
.topic-card:hover { transform: translateY(-3px); box-shadow: 0 16px 30px rgba(43, 41, 36, .15); }
.topic-card img { width: 100%; height: 100%; object-fit: cover; min-height: 190px; filter: brightness(.68); transition: transform .4s ease, filter .4s ease; }
.topic-card:hover img { transform: scale(1.04); filter: brightness(.62); }
.topic-card span {
  position: absolute; inset: auto 0 0 0; padding: 18px;
  background: linear-gradient(transparent, rgba(37, 36, 31, 0.92));
}
.topic-card strong { display: block; font-family: var(--font-serif); font-size: 1.4rem; color: var(--ivory); }
.topic-card em { font-style: normal; color: var(--gold); font-size: 0.8rem; }

.page-hero {
  padding: 84px 0 52px;
  background:
    linear-gradient(180deg, rgba(37,36,31,.55), var(--dark)),
    url("../img/hero-nha-tho.jpg") center/cover;
}
.page-hero h1,
.page-hero .lede,
.page-hero .eyebrow { color: var(--ivory); }
.instrument-data-hero p { max-width: 520px; margin: 0; color: rgba(248, 243, 232, .88); }
.instrument-data-section { padding-top: clamp(48px, 6vw, 76px); }
.instrument-data-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.instrument-data-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  min-height: 172px;
  padding: 20px;
  border: 1px solid var(--sand);
  border-radius: 13px;
  background:
    radial-gradient(circle at 100% 0%, rgba(217, 173, 75, .16), transparent 36%),
    linear-gradient(145deg, #fffdf8, #f8f0dd);
  box-shadow: var(--shadow);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.instrument-data-card:hover {
  border-color: rgba(200, 150, 46, .72);
  box-shadow: 0 15px 30px rgba(43, 41, 36, .11);
  transform: translateY(-3px);
}
.instrument-data-card-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(200, 150, 46, .52);
  border-radius: 12px;
  background: var(--gold);
  color: var(--dark);
  font: 700 1.35rem/1 var(--font-serif);
}
.instrument-data-card-copy { min-width: 0; }
.instrument-data-type {
  display: inline-block;
  margin-bottom: 7px;
  color: var(--green);
  font: 700 .7rem/1 var(--font-sans);
  letter-spacing: .1em;
}
.instrument-data-card h2 {
  overflow-wrap: anywhere;
  margin: 0;
  font: 600 1.08rem/1.35 var(--font-sans);
}
.instrument-data-card p { margin: 7px 0 0; color: var(--stone); font-size: .82rem; }
.instrument-data-download {
  grid-column: 1 / -1;
  width: 100%;
  margin-top: auto;
}
.instrument-data-missing {
  grid-column: 1 / -1;
  margin-top: auto;
  color: var(--stone);
  font-size: .85rem;
}
.instrument-data-empty {
  display: grid;
  justify-items: center;
  padding: 58px 24px;
  border: 1px dashed var(--sand);
  border-radius: 14px;
  background: var(--card);
  text-align: center;
}
.instrument-data-empty > span { color: var(--gold); font-size: 2rem; }
.instrument-data-empty h2 { margin: 8px 0 6px; font-size: 1.5rem; }
.instrument-data-empty p { margin: 0; color: var(--stone); }
.topic-hero { background: linear-gradient(180deg, rgba(37,36,31,.5), var(--dark)), var(--hero-image) center/cover; }
/* Catalogue topics are presented as one compact, crafted index rather than loose pills. */
.topic-filter-panel {
  position: relative;
  display: flex;
  align-items: center;
  gap: 24px;
  margin: 0 0 38px;
  padding: 18px 22px;
  overflow: hidden;
  border: 1px solid var(--sand);
  border-radius: 8px;
  background:
    radial-gradient(circle at 2% 8%, rgba(217, 173, 75, .24), transparent 20%),
    radial-gradient(circle at 96% 94%, rgba(61, 98, 68, .12), transparent 24%),
    linear-gradient(115deg, #fffdf8 0%, #f7efd9 50%, #fffaf0 100%);
  box-shadow: 0 10px 24px rgba(43, 41, 36, .055);
}
.topic-filter-panel::before,
.topic-filter-panel::after {
  position: absolute;
  color: rgba(200, 150, 46, .16);
  font-family: var(--font-serif);
  line-height: 1;
  pointer-events: none;
}
.topic-filter-panel::before { content: "✝"; top: -15px; right: 14px; font-size: 5rem; }
.topic-filter-panel::after { content: "✦"; bottom: -13px; left: 34%; font-size: 3.2rem; }
.topic-filter-heading {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
  min-width: 152px;
  color: var(--green);
}
.topic-filter-heading span { color: var(--gold); font-size: .9rem; }
.topic-filter-heading p {
  margin: 0;
  font: 700 .78rem/1.3 var(--font-sans);
  letter-spacing: .12em;
  text-transform: uppercase;
}
.filter-pills {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}
.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid rgba(217, 203, 168, .9);
  border-radius: 6px;
  padding: 7px 12px;
  background: rgba(255, 253, 248, .78);
  color: var(--walnut);
  font-size: .82rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  transition: transform .18s ease, background-color .18s ease, border-color .18s ease, color .18s ease;
}
.pill.is-on, .pill:hover { background: var(--gold); color: var(--dark); border-color: var(--gold); }
.pill:hover { transform: translateY(-1px); }

/* Single player */
.single-song { padding: 56px 0 96px; }
.player-panel {
  display: grid;
  grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
  gap: clamp(32px, 4.5vw, 54px);
  background: var(--card);
  border: 1px solid var(--sand);
  border-radius: 14px;
  padding: clamp(24px, 3.5vw, 38px);
  box-shadow: var(--shadow);
}
.player-cover img {
  width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--sand);
}
.player-info { align-self: center; }
.player-info .eyebrow { margin-bottom: 12px; }
.player-info h1 { margin-bottom: 18px; }
.player-byline { margin: 0 0 4px; color: var(--stone); }
.native-player audio { width: 100%; margin: 22px 0 0; }
.sample-video {
  grid-column: 1 / -1;
  margin: 0;
  padding-top: 36px;
  border-top: 1px solid var(--sand);
}
.sample-video h2 {
  margin: 0;
  color: var(--walnut);
  font-size: 1.2rem;
  text-align: center;
}
.youtube-embed {
  position: relative;
  width: min(100%, 880px);
  aspect-ratio: 16 / 9;
  margin: 18px auto 0;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--sand);
}
.youtube-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.score-download-panel {
  position: relative;
  max-width: 720px;
  margin-top: 26px;
  padding: 16px;
  overflow: visible;
  border: 1px solid rgba(217, 203, 168, .94);
  border-radius: 14px;
  background:
    radial-gradient(circle at 100% 0%, rgba(217, 173, 75, .18), transparent 37%),
    linear-gradient(135deg, #fffdf8 0%, #f8f0dc 100%);
  box-shadow: 0 9px 22px rgba(43, 41, 36, .055);
}
.score-download-title {
  margin: 0 0 11px;
  color: var(--green);
  font: 700 .82rem/1.25 var(--font-sans);
  letter-spacing: .065em;
  text-transform: uppercase;
}
.score-download-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.score-download-actions .btn { width: 100%; min-height: 48px; }
.score-download-actions .is-unavailable,
.score-download-actions .is-unavailable:hover {
  background: #eee6d4;
  border-color: var(--sand);
  color: var(--stone);
  cursor: not-allowed;
  opacity: .72;
}
.download-menu { position: relative; min-width: 0; }
.download-menu-trigger { position: relative; z-index: 1; }
.download-menu-trigger[aria-expanded="true"] {
  background: var(--gold-2);
  box-shadow: 0 5px 15px rgba(200, 150, 46, .28);
}
.download-menu-chevron {
  width: 7px;
  height: 7px;
  margin: -4px 0 0 3px;
  border: solid currentColor;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
  transition: transform .18s ease;
}
.download-menu-trigger[aria-expanded="true"] .download-menu-chevron { transform: translateY(3px) rotate(225deg); }
.download-menu-popover {
  position: absolute;
  z-index: 24;
  top: calc(100% + 9px);
  left: 0;
  width: min(320px, calc(100vw - 42px));
  padding: 12px;
  border: 1px solid rgba(201, 158, 60, .6);
  border-radius: 13px;
  background:
    radial-gradient(circle at 100% 0%, rgba(231, 189, 75, .26), transparent 37%),
    linear-gradient(145deg, #fffdf8 0%, #f7edd4 100%);
  box-shadow: 0 15px 32px rgba(43, 41, 36, .18), inset 0 1px 0 rgba(255, 255, 255, .84);
}
.download-menu--arrangement .download-menu-popover { right: 0; left: auto; }
.download-menu-popover > p {
  margin: 1px 4px 9px;
  color: var(--green);
  font: 700 .72rem/1.2 var(--font-sans);
  letter-spacing: .075em;
  text-transform: uppercase;
}
.download-menu-options { display: grid; gap: 6px; }
.download-menu-options a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 9px 10px 9px 12px;
  border: 1px solid rgba(217, 203, 168, .95);
  border-radius: 9px;
  background: rgba(255, 253, 248, .83);
  color: var(--walnut);
  text-decoration: none;
  transition: transform .18s ease, background-color .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.download-menu-options a:hover,
.download-menu-options a:focus-visible {
  border-color: var(--gold);
  background: #fff;
  box-shadow: 0 4px 12px rgba(43, 41, 36, .1);
  transform: translateX(2px);
  outline: 0;
}
.download-menu-option-copy { display: grid; gap: 2px; min-width: 0; }
.download-menu-option-copy strong {
  overflow: hidden;
  font: 650 .86rem/1.2 var(--font-sans);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.download-menu-option-copy small {
  overflow: hidden;
  color: var(--stone);
  font: 500 .72rem/1.2 var(--font-sans);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.download-menu-option-action {
  padding: 5px 7px;
  border-radius: 999px;
  background: rgba(235, 188, 47, .18);
  color: #76560d;
  font: 700 .68rem/1 var(--font-sans);
  white-space: nowrap;
}
.player-author { display: grid; gap: 4px; margin: 18px 0 4px; color: var(--text); }
.player-author strong { color: var(--walnut); }
.player-author span { white-space: pre-line; }
.sample-video-action { margin: 20px 0 0; text-align: center; }

.score-files {
  margin-top: 44px;
  padding: clamp(24px, 3.5vw, 38px);
  background: var(--card);
  border: 1px solid var(--sand);
  border-radius: 16px;
}
.score-files-head { margin-bottom: 26px; }
.score-files-head .eyebrow { margin-bottom: 8px; }
.score-files-head h2 { margin: 0; font-size: clamp(1.45rem, 2.2vw, 2rem); }
.score-version-list { display: grid; gap: 28px; }
.score-version-card {
  padding: clamp(18px, 2.4vw, 24px);
  border: 1px solid var(--sand);
  border-radius: 12px;
  background:
    radial-gradient(circle at 100% 0%, rgba(217, 173, 75, .15), transparent 24%),
    #fffdf8;
}
.score-version-card-head { margin-bottom: 20px; }
.score-version-card-head .score-file-type { margin-bottom: 7px; }
.score-version-card-head h3 { margin: 0; font-size: clamp(1.2rem, 2vw, 1.45rem); }
.score-version-arranger { margin: 7px 0 0; color: var(--stone); font-size: .9rem; }
.score-file-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.score-file {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: clamp(18px, 2.4vw, 24px);
  background: #fffdf8;
  border: 1px solid var(--sand);
  border-radius: 12px;
}
.score-file-head { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.score-file-type { margin: 0 0 7px; color: var(--gold-dark); font-size: .76rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.score-file h3 { margin: 0; font-size: 1.15rem; }
.score-pdf-viewer { width: 100%; margin-top: 20px; overflow: hidden; border: 1px solid var(--sand); border-radius: 10px; background: #e9e7e2; box-shadow: inset 0 0 0 1px rgba(43, 41, 36, .03); }
.score-pdf-frame { display: block; width: 100%; height: clamp(720px, 82vh, 1120px); border: 0; background: #e9e7e2; }
.score-pdf-canvas { width: 100%; background: #e9e7e2; }
.score-pdf-page { display: block; width: 100%; height: auto; background: #fff; }
.score-pdf-page + .score-pdf-page { margin-top: 8px; }
.page-plain { padding: 64px 0 96px; }
.prose p { color: var(--text); }

.site-footer {
  border-top: 1px solid var(--sand);
  padding: 48px 0 28px;
  background: var(--dark);
  color: var(--ivory);
}
.site-footer h3 { color: var(--ivory); }
.site-footer a { color: var(--ivory); }
.site-footer a:hover { color: var(--gold); }
.footer-note { margin-top: 1.5rem; color: var(--ivory); text-align: center; line-height: 1.65; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin: 6px 0; }
.copyright { text-align: center; color: var(--stone); font-size: 0.8rem; margin: 32px 0 0; }

.sticky-player {
  position: sticky; bottom: 0; z-index: 50;
  background: rgba(37, 36, 31, 0.96);
  border-top: 1px solid var(--gold);
  padding: 10px 0;
  color: var(--ivory);
}
.sticky-inner { display: flex; align-items: center; gap: 14px; }
.sticky-inner img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; }
.sticky-meta { flex: 1; min-width: 0; }
.sticky-meta strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ivory); }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 0;
  background: var(--gold); color: var(--dark); font-size: 16px; cursor: pointer;
}

.empty, .notice, .result-count { color: var(--text); }
.search-results-section { margin-top: 28px; }
.search-results-more { border-top: 1px solid var(--sand); padding-top: 32px; }
.search-section-title { color: var(--walnut); font-size: 1.55rem; margin: 0; }
.pagination { margin-top: 32px; }
.pagination .nav-links { display: flex; gap: 8px; }
.pagination a, .pagination span {
  border: 1px solid var(--sand); padding: 6px 12px; border-radius: 8px; color: var(--walnut);
  background: #fff;
}

@media (max-width: 980px) {
  .song-grid, .topic-grid, .instrument-data-grid { grid-template-columns: repeat(2, 1fr); }
  .home-instrument-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .player-panel, .footer-grid { grid-template-columns: 1fr; }
  .header-search input { width: 120px; }
  .nav-toggle { display: inline-flex; margin-left: auto; }
  .site-nav, .header-search { display: none; }
  .site-nav.is-open {
    display: block; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--bg); padding: 12px 20px;
    border-bottom: 1px solid var(--sand);
  }
  .site-nav.is-open ul { flex-direction: column; }
}
@media (min-width: 721px) and (max-width: 980px) {
  .player-panel {
    grid-template-columns: minmax(220px, .72fr) minmax(0, 1fr);
    gap: 24px;
    padding: 20px;
  }
  .player-cover img { height: 100%; min-height: 240px; }
  .sample-video { grid-column: 1 / -1; }
  .youtube-embed { width: min(100%, 760px); }
}
@media (max-width: 720px) {
  .hero { min-height: 0; }
  .hero-copy { padding: 48px 0 38px; }
  .hero-copy h1 { font-size: clamp(2.15rem, 11vw, 3.3rem); }
  .hero-search { margin-top: 28px; padding: 8px; }
  .hero-search { border-radius: 20px; }
  .hero-search { grid-template-columns: 1fr; gap: 7px; }
  .search-input-wrap, .search-filter-wrap { min-height: 58px; }
  .search-input-wrap { grid-template-rows: 17px 23px; padding-block: 8px; }
  .hero-search input { height: 23px; font-size: .96rem; }
  .hero-search .search-topic-filter { width: 100%; height: 58px; min-height: 58px; padding-top: 18px; border-radius: 12px; }
  .search-filter-label { top: 11px; }
  .hero-search .btn { width: 100%; min-height: 52px; }
  .breadcrumbs { min-height: 42px; }
  .breadcrumbs ol { padding: 9px 0; }
  .breadcrumbs li { font-size: .78rem; }
  .song-grid, .topic-grid, .instrument-data-grid { grid-template-columns: 1fr; }
  .home-instrument-data { padding-top: 0; }
  .home-instrument-panel { padding: 24px 18px; border-radius: 14px; }
  .home-instrument-head { align-items: flex-start; flex-direction: column; gap: 16px; }
  .home-instrument-head h2 { font-size: 1.78rem; }
  .home-instrument-all { width: 100%; }
  .home-instrument-grid {
    display: flex;
    grid-template-columns: none;
    overflow-x: auto;
    gap: 12px;
    padding: 2px 1px 10px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .home-instrument-grid::-webkit-scrollbar { display: none; }
  .home-instrument-card { flex: 0 0 min(82vw, 320px); scroll-snap-align: start; }
  .home-instrument-empty { grid-template-columns: auto minmax(0, 1fr); padding: 18px; }
  .home-instrument-empty .btn { grid-column: 1 / -1; width: 100%; }
  .sticky-player .btn { display: none; }
  .section { padding: 54px 0; }
  .section-head { gap: 8px 16px; margin-bottom: 26px; }
  .section-head h2 { font-size: 1.72rem; }
  .topic-filter-panel {
    display: block;
    margin-bottom: 30px;
    padding: 16px 0 0;
    border-radius: 10px;
  }
  .topic-filter-panel::before { top: -13px; right: 8px; font-size: 4.2rem; }
  .topic-filter-panel::after { display: none; }
  .topic-filter-heading { min-width: 0; padding: 0 16px 12px; }
  .filter-pills {
    flex-wrap: nowrap;
    gap: 9px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding: 2px 16px 16px;
    -webkit-overflow-scrolling: touch;
  }
  .filter-pills::-webkit-scrollbar { display: none; }
  .pill { flex: 0 0 auto; min-height: 40px; padding-inline: 14px; scroll-snap-align: start; }
  .home-scroll-row {
    display: grid;
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(252px, 78vw);
    gap: 14px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: 3px 16px 14px;
    margin-inline: -16px;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: var(--sand) transparent;
  }
  .home-scroll-row > * { scroll-snap-align: start; }
  .home-scroll-row::-webkit-scrollbar { height: 5px; }
  .home-scroll-row::-webkit-scrollbar-thumb { background: var(--sand); border-radius: 999px; }
  .home-scroll-row .song-card { box-shadow: 0 5px 16px rgba(43, 41, 36, .08); }
  .home-scroll-row .topic-card { min-height: 190px; }
  .single-song { padding: 32px 0 64px; }
  .player-panel { gap: 26px; padding: 18px; border-radius: 12px; }
  .player-cover img { aspect-ratio: 4 / 3; }
  .player-info h1 { font-size: clamp(2.05rem, 11vw, 3.15rem); }
  .score-download-panel { max-width: none; margin-top: 22px; padding: 14px; }
  .score-download-actions { grid-template-columns: 1fr; gap: 10px; }
  .score-download-actions .btn { padding: 11px 12px; font-size: .9rem; }
  .download-menu-popover { width: 100%; }
  .download-menu--arrangement .download-menu-popover { right: auto; left: 0; }
  .sample-video { padding-top: 28px; }
  .sample-video h2 { font-size: 1.08rem; }
  .youtube-embed { width: 100%; margin-top: 16px; }
  .score-files { margin-top: 36px; padding: 18px; }
  .score-version-list { gap: 20px; }
  .score-version-card { padding: 14px; }
  .score-version-card-head { margin-bottom: 16px; }
  .score-pdf-frame { height: clamp(560px, 72vh, 850px); }
  .score-pdf-viewer.is-pdf-rendering .score-pdf-frame { display: none; }
  .score-pdf-canvas { padding: 0; }
}
