/* Shared styles for the hymn book pages (song accordions, players, lyrics, PDF, MIDI). */

:root {
  --brand: #6e1f2d;
  --brand-2: #8b3041;
  --brand-dark: #4c111d;
  --gold: #b18a3b;
  --gold-soft: #efe4c8;
  --ink: #25231f;
  --muted: #706b61;
  --line: #e3dccf;
  --surface: rgba(255, 253, 248, 0.96);
  --soft: #f8f1e7;
  --page: #f6f2ea;
  --success: #45624a;
  --shadow-sm: 0 8px 24px rgba(61, 45, 33, 0.06);
  --shadow: 0 18px 50px rgba(61, 45, 33, 0.12);
  --radius: 22px;
  --radius-sm: 14px;
  --container: 1180px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% -10%, rgba(110, 31, 45, 0.10), transparent 34%),
    radial-gradient(circle at 92% 8%, rgba(177, 138, 59, 0.10), transparent 30%),
    linear-gradient(180deg, #faf7f1 0%, var(--page) 100%);
  font-family: "Noto Sans Sinhala", "Iskoola Pota", "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

button, input { font: inherit; }

.container {
  width: min(calc(100% - 32px), var(--container));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid rgba(231, 233, 238, 0.8);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.navbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  box-shadow: 0 10px 24px rgba(76, 17, 29, 0.22);
  font-size: 1.25rem;
}

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}

.nav-toggle svg { width: 22px; height: 22px; }

.nav-menu {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
  padding: 0;
  margin-top: 0;
  margin-bottom: 0;
}

.nav-item { position: relative; }

.nav-link,
.nav-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #384152;
  text-decoration: none;
  font-size: 0.91rem;
  font-weight: 700;
  cursor: pointer;
  transition: .2s ease;
  white-space: nowrap;
}

.nav-link:hover,
.nav-button:hover,
.nav-item.open > .nav-button {
  color: var(--brand-dark);
  background: var(--soft);
}

.chevron {
  width: 15px;
  height: 15px;
  transition: transform .2s ease;
}

.nav-item.open .chevron { transform: rotate(180deg); }

.dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 250px;
  max-height: min(70vh, 560px);
  overflow-y: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow);
}

.nav-item.open > .dropdown { display: block; }

.dropdown a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: #475467;
  text-decoration: none;
  font-size: 0.9rem;
  line-height: 1.45;
}

.dropdown a:hover {
  color: var(--brand-dark);
  background: var(--soft);
}

main { padding-bottom: 64px; }

.hero {
  padding: 70px 0 34px;
}

.hero-card {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 5vw, 58px);
  border: 1px solid rgba(177, 138, 59, 0.30);
  border-radius: 30px;
  color: #fff;
  background:
    linear-gradient(120deg, rgba(255,255,255,.03), rgba(255,255,255,0)),
    linear-gradient(135deg, #3f101b 0%, #681d2b 52%, #8a3242 100%);
  box-shadow: 0 24px 70px rgba(76, 17, 29, 0.24);
}

.hero-card::before,
.hero-card::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
}

.hero-card::before {
  width: 290px;
  height: 290px;
  right: -80px;
  top: -110px;
  background: rgba(239,228,200,.12);
}

.hero-card::after {
  width: 200px;
  height: 200px;
  right: 90px;
  bottom: -130px;
  border: 36px solid rgba(239,228,200,.10);
}

/* Christmas hero (naththalSeenu.html): maroon fading into evergreen, a star glow and falling snow. */
.hero-card.christmas {
  border-color: rgba(212,175,55,.42);
  background:
    radial-gradient(circle at 86% 14%, rgba(255,244,214,.16), rgba(255,244,214,0) 26%),
    radial-gradient(130% 45% at 50% 118%, rgba(255,255,255,.14), rgba(255,255,255,0) 62%),
    linear-gradient(135deg, #7d2233 0%, #561422 34%, #1a3024 62%, #0f3a25 100%);
  box-shadow: 0 24px 70px rgba(31,40,30,.32);
}

.hero-card.christmas::before,
.hero-card.christmas::after {
  inset: 0;
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  animation: linear infinite;
}

/* Snow: dot tiles of mismatched sizes so the flakes scatter; each layer falls one tile height per loop. */
.hero-card.christmas::before {
  background:
    radial-gradient(circle at 23% 37%, rgba(255,255,255,.75) 0 1.1px, transparent 1.9px),
    radial-gradient(circle at 71% 64%, rgba(255,255,255,.60) 0 1px, transparent 1.8px),
    radial-gradient(circle at 48% 12%, rgba(255,255,255,.85) 0 1.4px, transparent 2.2px);
  background-size: 97px 113px, 131px 149px, 173px 127px;
  animation-name: hero-snow-small;
  animation-duration: 14s;
}

.hero-card.christmas::after {
  background:
    radial-gradient(circle at 33% 41%, rgba(255,255,255,.70) 0 2.4px, transparent 3.6px),
    radial-gradient(circle at 79% 73%, rgba(255,255,255,.55) 0 2px, transparent 3.2px);
  background-size: 211px 233px, 257px 191px;
  animation-name: hero-snow-large;
  animation-duration: 10s;
}

@keyframes hero-snow-small {
  from { background-position: 0 0, 0 0, 0 0; }
  to { background-position: 0 113px, 0 149px, 0 127px; }
}
@keyframes hero-snow-large {
  from { background-position: 0 0, 0 0; }
  to { background-position: 0 233px, 0 191px; }
}

.eyebrow {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid rgba(255,255,255,.20);
  border-radius: 999px;
  background: rgba(255,255,255,.10);
  font-size: 0.82rem;
  font-weight: 700;
}

.hero h1 {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 18px 0 8px;
  font-size: clamp(2.2rem, 5vw, 4.7rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.hero p {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 0;
  color: rgba(255,255,255,.86);
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.8;
}

/* Full songbook PDF download, pinned to the hero card's bottom-right corner. */
.hero-download {
  position: absolute;
  z-index: 1;
  right: 16px;
  bottom: 16px;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(239,228,200,.55);
  border-radius: 14px;
  background: var(--gold-soft);
  color: var(--brand);
  -webkit-tap-highlight-color: transparent;
  transition: .2s ease;
}
.hero-download svg { width: 20px; height: 20px; }
.hero-download:hover {
  background: #fff;
  transform: translateY(-1px);
}

.category-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 22px 2px 6px;
  scrollbar-width: thin;
}

.category-strip a {
  flex: 0 0 auto;
  padding: 10px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #475467;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  font-size: 0.91rem;
  font-weight: 700;
  transition: .2s ease;
}

.category-strip a:hover,
.category-strip a.active {
  border-color: rgba(244,81,45,.30);
  color: var(--brand-dark);
  background: var(--soft);
}

/* In-page category filter (apeGeethikaPotha.html). */
.filter-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 10px 2px 6px;
  margin-bottom: 18px;
  scrollbar-width: thin;
}
.filter-chip {
  flex: 0 0 auto;
  padding: 10px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #475467;
  box-shadow: var(--shadow-sm);
  font-size: 0.91rem;
  font-weight: 700;
  cursor: pointer;
  transition: .2s ease;
  white-space: nowrap;
}
.filter-chip:hover,
.filter-chip.active {
  border-color: rgba(110, 31, 45, .30);
  color: var(--brand-dark);
  background: var(--soft);
}

.content-section { padding-top: 28px; }

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.section-title h2 {
  margin: 0 0 6px;
  font-size: clamp(1.45rem, 3vw, 2rem);
  letter-spacing: -0.025em;
}

.section-title p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 0.94rem;
}

/* Shuffle toggle and search, side by side. */
.song-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 1 418px;
}

.shuffle-btn {
  flex: none;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--muted);
  box-shadow: 0 6px 18px rgba(31,41,55,.04);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: .2s ease;
}
.shuffle-btn svg { width: 20px; height: 20px; }
.shuffle-btn:hover {
  border-color: rgba(177,138,59,.55);
  background: #fffaf1;
  color: var(--brand);
}
/* On: a finished song is followed by a random one instead of the next number. */
.shuffle-btn[aria-pressed="true"] {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}
.shuffle-btn[aria-pressed="true"]:hover { background: var(--brand-dark); }

.search-wrap {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

.search-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 19px;
  height: 19px;
  transform: translateY(-50%);
  color: #98a2b3;
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 48px;
  padding: 0 16px 0 43px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 6px 18px rgba(31,41,55,.04);
  transition: .2s ease;
}

.search-input:focus {
  border-color: rgba(244,81,45,.55);
  box-shadow: 0 0 0 4px rgba(244,81,45,.10);
}

/* Player for the listed songs (naththalSeenu.html): the song playing, shuffle, previous, play/pause, next
   and its progress. Stays in view at the top of the screen while the list scrolls. */
.list-player {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px 22px;
  margin-bottom: 18px;
  padding: 10px 20px 10px 10px;
  border: 1px solid rgba(177,138,59,.40);
  border-radius: 20px;
  color: #fff;
  background: linear-gradient(120deg, #6e1f2d, #4c111d);
  box-shadow: 0 16px 40px rgba(76,17,29,.22);
}
.list-player.christmas {
  background: linear-gradient(120deg, #7d2233 0%, #561422 38%, #1a3024 72%, #0f3a25 100%);
  box-shadow: 0 16px 40px rgba(31,40,30,.26);
}
/* Songs scrolled into view clear the player. */
.list-player ~ .songs .hymn-accordion { scroll-margin-top: 104px; }

/* The song playing: number and title. Brings the song into view and opens it. */
.player-now {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 10px 4px 4px;
  border: 0;
  border-radius: 16px;
  background: none;
  color: inherit;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .2s ease;
}
.player-now:disabled { cursor: default; }
.player-now:not(:disabled):hover { background: rgba(255,255,255,.08); }

.player-number {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(239,228,200,.60);
  border-radius: 50%;
  color: var(--brand-dark);
  background: linear-gradient(145deg, #fffaf0, var(--gold-soft));
  font-family: Georgia, serif;
  font-weight: 700;
}
.player-number svg { width: 20px; height: 20px; }

.player-text { min-width: 0; display: grid; }
.player-status {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #ecd9a4;
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .04em;
}
.player-title {
  overflow: hidden;
  font-size: 1.02rem;
  line-height: 1.6;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Bars that bounce while a song plays. */
.player-eq {
  display: none;
  align-items: end;
  gap: 2px;
  height: 11px;
}
.list-player.is-playing .player-eq { display: inline-flex; }
.player-eq i {
  width: 3px;
  height: 100%;
  border-radius: 2px;
  background: currentColor;
  transform-origin: bottom;
  animation: player-eq .9s ease-in-out infinite alternate;
}
.player-eq i:nth-child(2) { animation-delay: -.5s; }
.player-eq i:nth-child(3) { animation-delay: -.25s; }
@keyframes player-eq {
  from { transform: scaleY(.3); }
  to { transform: scaleY(1); }
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.player-btn {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: .2s ease;
}
.player-btn svg { width: 18px; height: 18px; }
.player-btn:not(:disabled):hover { background: rgba(255,255,255,.18); }
.player-btn:disabled { opacity: .4; cursor: default; }
/* Shuffle on: a finished song is followed by a random one instead of the next number. */
.player-btn[aria-pressed="true"]:not(.player-toggle) {
  border-color: var(--gold-soft);
  background: var(--gold-soft);
  color: var(--brand-dark);
}

.player-toggle {
  width: 52px;
  height: 52px;
  border-color: var(--gold-soft);
  background: var(--gold-soft);
  color: var(--brand-dark);
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
}
.player-toggle svg { width: 22px; height: 22px; }
.player-toggle .icon-play { margin-left: 2px; }
.player-toggle .icon-pause,
.player-toggle[aria-pressed="true"] .icon-play { display: none; }
.player-toggle[aria-pressed="true"] .icon-pause { display: block; }
.player-toggle:not(:disabled):hover { background: #fff; }

.player-now:focus-visible,
.player-btn:focus-visible { outline: 3px solid rgba(239,228,200,.75); outline-offset: 2px; }

.player-progress {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255,255,255,.75);
  font-size: .78rem;
  font-variant-numeric: tabular-nums;
}
.player-progress span { flex: none; min-width: 2.6em; }
.player-progress span:last-child { text-align: right; }

/* Seek bar: the played part (--progress, set by js/hymn-book.js) is filled in gold. */
.player-seek {
  --progress: 0%;
  flex: 1 1 auto;
  min-width: 0;
  height: 20px;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.player-seek:disabled { cursor: default; opacity: .55; }
.player-seek:focus-visible { outline: 2px solid rgba(239,228,200,.75); outline-offset: 4px; border-radius: 4px; }
.player-seek::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold-soft) var(--progress), rgba(255,255,255,.22) var(--progress));
}
.player-seek::-moz-range-track {
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold-soft) var(--progress), rgba(255,255,255,.22) var(--progress));
}
.player-seek::-webkit-slider-thumb {
  width: 14px;
  height: 14px;
  margin-top: -5px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(239,228,200,.35);
  -webkit-appearance: none;
  appearance: none;
}
.player-seek::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(239,228,200,.35);
}

.songs {
  display: grid;
  gap: 16px;
}

.hymn-accordion {
  /* Keeps a song scrolled into view (next song autoplay) clear of the sticky header. */
  scroll-margin-top: 88px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.hymn-accordion > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  cursor: pointer;
  user-select: none;
  transition: background .2s ease;
}

.hymn-accordion > summary::-webkit-details-marker { display: none; }
.hymn-accordion > summary:hover { background: #fffaf1; }
.hymn-accordion[open] > summary {
  background: linear-gradient(180deg, #fffdf9, #fbf6ed);
  border-bottom: 1px solid var(--line);
}

.song-number {
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(177,138,59,.30);
  border-radius: 50%;
  color: var(--brand-dark);
  background: linear-gradient(145deg, #fffaf0, var(--gold-soft));
  font-family: Georgia, serif;
  font-weight: 700;
  font-size: 1rem;
}

.song-name { min-width: 0; flex: 1; }
.song-name span {
  display: block;
  margin-bottom: 4px;
  color: var(--gold);
  font-size: .73rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .10em;
}
.song-name h3 {
  margin: 0;
  color: var(--brand-dark);
  font-size: 1.08rem;
  line-height: 1.65;
}

.accordion-cross {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--brand);
  background: var(--soft);
  font-size: 1rem;
  transition: transform .25s ease, background .2s ease;
}
.hymn-accordion[open] .accordion-cross {
  transform: rotate(45deg);
  background: var(--gold-soft);
}

/* Play button right after a song's title (naththalSeenu.html): plays the song without opening it. */
.hymn-accordion > summary:has(.song-play:not([hidden])) .song-name { flex: 0 1 auto; }
.song-play {
  flex: 0 0 auto;
  margin-right: auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(110,31,45,.25);
  border-radius: 50%;
  background: #fff;
  color: var(--brand);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: .2s ease;
}
.song-play svg { width: 18px; height: 18px; }
.song-play .icon-play { margin-left: 2px; }
.song-play .icon-pause,
.song-play[aria-pressed="true"] .icon-play { display: none; }
.song-play[aria-pressed="true"] .icon-pause { display: block; }
.song-play:hover,
.song-play[aria-pressed="true"] {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}
.song-play[aria-pressed="true"]:hover { background: var(--brand-dark); }
.song-play:focus-visible { outline: 3px solid rgba(177,138,59,.55); outline-offset: 2px; }
.song-card.is-playing .song-play { animation: song-play-pulse 1.8s ease-out infinite; }
@keyframes song-play-pulse {
  from { box-shadow: 0 0 0 0 rgba(110,31,45,.35); }
  to { box-shadow: 0 0 0 10px rgba(110,31,45,0); }
}

/* The song playing, or the last one played, when songs play in the list (naththalSeenu.html). */
.song-card.is-current {
  border-color: rgba(110,31,45,.45);
  box-shadow: 0 0 0 3px rgba(177,138,59,.22), var(--shadow-sm);
}
.song-card.is-current > summary { background: #fffaf1; }
.song-card.is-current .song-number {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.accordion-body {
  padding: 22px;
  background: #fffdf9;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.player-block,
.resource-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.player-block label,
.resource-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: #5d5548;
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}

audio {
  display: block;
  width: 100%;
  min-width: 0;
  height: 42px;
}

.resource-accordions {
  display: grid;
  gap: 12px;
}

.resource-accordion {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.resource-accordion > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  color: #403b33;
  font-weight: 750;
  background: #fff;
}
.resource-accordion > summary::-webkit-details-marker { display: none; }
.resource-accordion[open] > summary {
  color: var(--brand-dark);
  background: #fbf6ed;
  border-bottom: 1px solid var(--line);
}

.resource-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: var(--brand);
  background: var(--soft);
}
.resource-icon svg { width: 18px; height: 18px; }
.resource-title { flex: 1; }
.resource-title small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-weight: 500;
  font-size: .76rem;
}
.resource-chevron {
  width: 18px;
  height: 18px;
  transition: transform .2s ease;
}
.resource-accordion[open] .resource-chevron { transform: rotate(180deg); }

.resource-content { padding: 16px; }
.pdf-viewer {
  display: grid;
  gap: 10px;
}
.pdf-zoom-bar {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pdf-zoom-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: #4c453b;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.pdf-zoom-btn:active {
  background: #fffaf1;
  border-color: rgba(177,138,59,.55);
  color: var(--brand-dark);
}
.pdf-zoom-btn[disabled] {
  opacity: .45;
  cursor: default;
}
.pdf-zoom-label {
  min-width: 56px;
  text-align: center;
  font-size: .86rem;
  font-weight: 750;
  color: #4c453b;
}
.pdf-stage {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f3f0e9;
  -webkit-overflow-scrolling: touch;
}
.pdf-scale-wrap {
  position: relative;
  width: 100%;
  height: 100%;
}
.pdf-frame {
  width: 100%;
  height: min(72vh, 720px);
  min-height: 440px;
  border: 0;
  border-radius: 12px;
  background: #f3f0e9;
  display: block;
}
.pdf-actions { margin-top: 12px; }

.lyrics-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.lyrics-toolbar-label {
  /* Pushes the buttons (A / A, PDF download) to the right. */
  margin-right: auto;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 700;
}
.font-size-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.font-size-btn {
  min-width: 42px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--brand-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: .2s ease;
}
.font-size-btn.smaller { font-size: .85rem; }
.font-size-btn.larger { font-size: 1.25rem; }
.font-size-btn:hover:not([disabled]),
.pdf-download:hover {
  border-color: rgba(177,138,59,.55);
  background: #fffaf1;
}
/* Lyrics sheet download (NN.pdf), same size as the A / A buttons. */
.pdf-download {
  width: 42px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--brand);
  -webkit-tap-highlight-color: transparent;
  transition: .2s ease;
}
.pdf-download svg { width: 19px; height: 19px; }
.font-size-btn[disabled] {
  opacity: .4;
  cursor: default;
}
.lyrics {
  --lyrics-size: 1.05rem;
  color: var(--ink);
  font-size: calc(var(--lyrics-size) * var(--lyrics-scale, 1));
  line-height: 1.9;
  text-align: center;
  overflow-wrap: anywhere;
}
.lyrics p { margin: 0 0 1.25em; }
.lyrics p:last-child { margin-bottom: 0; }
.lyrics + .resource-accordions { margin-top: 24px; }
/* Lyrics are optional: without them the PDF/MIDI sections follow the players directly. */
.lyrics[hidden] + .resource-accordions { margin-top: 0; }
.media-empty {
  margin: 0;
  color: var(--muted);
  font-size: .9rem;
  text-align: center;
}

.midi-files {
  display: grid;
  gap: 10px;
}
.midi-file {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.midi-file-name {
  min-width: 70px;
  color: #5d5548;
  font-size: .86rem;
  font-weight: 750;
}
/* Music & MIDI section (නත්තල් සීනු): one row per arrangement number, its music player next to its MIDI download. */
.track-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.track-row + .track-row {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.track-row audio { flex: 1 1 240px; }
/* Keeps the MIDI button on the right in a row without a music player. */
.track-row .action-link { margin-left: auto; }
.track-number {
  flex: none;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(177,138,59,.30);
  border-radius: 50%;
  color: var(--brand-dark);
  background: linear-gradient(145deg, #fffaf0, var(--gold-soft));
  font-family: Georgia, serif;
  font-size: .82rem;
  font-weight: 700;
}

.lyrics .lyrics-status {
  color: var(--muted);
  font-size: .9rem;
}
.lyrics .repeat {
  color: var(--gold);
  font-weight: 700;
  white-space: nowrap;
}

.resource-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.resource-note {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.7;
  font-size: .9rem;
}

.action-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: #4c453b;
  text-decoration: none;
  font-size: .86rem;
  font-weight: 750;
  transition: .2s ease;
}
.action-link:hover {
  transform: translateY(-1px);
  border-color: rgba(177,138,59,.55);
  color: var(--brand-dark);
  background: #fffaf1;
}
.action-link.primary {
  border-color: var(--brand);
  color: #fff;
  background: var(--brand);
}
.action-link.primary:hover { color: #fff; background: var(--brand-dark); }
.action-link svg { width: 17px; height: 17px; }

.empty-state,
.songs-status {
  display: none;
  padding: 38px 22px;
  border: 1px dashed #d0d5dd;
  border-radius: var(--radius);
  color: var(--muted);
  background: #fff;
  text-align: center;
}
/* Shown in the song list while it loads from the CSV, or if it can't be loaded. */
.songs-status {
  display: block;
  margin: 0;
}

footer {
  margin-top: 46px;
  color: #fff;
  background: #1f2937;
}

.footer-inner {
  min-height: 106px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  padding: 24px 0;
}

.footer-blessing,
.footer-tagline {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.65;
}

.footer-tagline {
  color: #d0d5dd;
  text-align: center;
}

.socials {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}

.socials a {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 11px;
  color: #fff;
  background: rgba(255,255,255,.06);
  text-decoration: none;
  transition: .2s ease;
}

.socials a:hover {
  border-color: rgba(255,255,255,.28);
  background: rgba(255,255,255,.12);
  transform: translateY(-1px);
}

.socials svg { width: 18px; height: 18px; fill: currentColor; }

@media (max-width: 1050px) {
  .nav-toggle { display: grid; place-items: center; }

  .nav-menu {
    display: none;
    position: absolute;
    top: 72px;
    left: 16px;
    right: 16px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    box-shadow: var(--shadow);
    align-items: stretch;
    flex-direction: column;
  }

  .nav-menu.open { display: flex; }
  .nav-item { width: 100%; }
  .nav-link, .nav-button { width: 100%; justify-content: space-between; }
  .dropdown { position: static; margin: 4px 0 8px; max-height: 300px; box-shadow: none; border-radius: 12px; background: #fafafa; }

  .media-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .container { width: min(calc(100% - 22px), var(--container)); }
  .hero { padding: 30px 0 18px; }
  .hero-card { border-radius: 24px; }
  .hero-card:has(.hero-download) { padding-bottom: 72px; }
  .hero-download { right: 12px; bottom: 12px; }
  .section-head { align-items: stretch; flex-direction: column; }
  .song-tools { flex-basis: auto; }
  /* Player: the song and its buttons on one row, the progress below. */
  .list-player {
    top: 8px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 8px;
    padding: 8px 10px 6px 6px;
    border-radius: 18px;
  }
  .list-player ~ .songs .hymn-accordion { scroll-margin-top: 108px; }
  .player-now { gap: 9px; padding-right: 4px; }
  .player-number { width: 36px; height: 36px; font-size: .85rem; }
  .player-number svg { width: 17px; height: 17px; }
  .player-title { font-size: .95rem; }
  .player-controls { gap: 4px; }
  .player-btn { width: 34px; height: 34px; }
  .player-btn svg { width: 16px; height: 16px; }
  .player-toggle { width: 44px; height: 44px; }
  .player-toggle svg { width: 20px; height: 20px; }
  .player-progress { grid-column: 1 / -1; padding: 0 6px 0 8px; }
  .hymn-accordion > summary { padding: 16px; gap: 12px; }
  .song-number { width: 46px; height: 46px; font-size: .9rem; }
  .song-play { width: 36px; height: 36px; }
  .accordion-body { padding: 16px; }
  .media-grid { grid-template-columns: 1fr; }
  .lyrics { --lyrics-size: 1rem; }
  .pdf-zoom-bar { display: flex; }
  .pdf-stage {
    overflow: auto;
    height: 58vh;
    min-height: 360px;
    overscroll-behavior: contain;
    touch-action: pan-x pan-y;
  }
  .pdf-frame {
    min-height: 0;
    height: 58vh;
    border-radius: 0;
    transform-origin: 0 0;
  }
  .action-link { flex: 1 1 150px; justify-content: center; }
  .footer-inner { grid-template-columns: 1fr; text-align: center; }
  .footer-tagline { order: 2; }
  .socials { justify-content: center; order: 3; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
  .song-card.is-playing .song-play { animation: none; }
  .player-eq i { animation: none; }
  .hero-card.christmas::before,
  .hero-card.christmas::after { animation: none; }
}
