/* ==========================================================================
   Koby's Legacy — Memorial Website Stylesheet
   --------------------------------------------------------------------------
   A dignified, warm, calm memorial for the Sephardic Jewish liturgical
   recordings of Koby Benlolo ז״ל.

   Design notes:
   - Mobile-first: base styles target small screens; media queries enhance
     for wider viewports.
   - No web fonts / @font-face / external assets — fully offline, works on
     both file:// and a normal web server.
   - All theme colors live in :root custom properties so the family can
     re-theme the whole site from one place.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Theme tokens
   -------------------------------------------------------------------------- */
:root {
  /* Palette */
  --color-bg: #f6f1e7;          /* parchment / cream background */
  --color-surface: #fffdf8;     /* slightly lighter card/surface */
  --color-surface-alt: #efe8d8; /* alternating / hover surface */
  --color-text: #23314e;        /* deep navy / charcoal text */
  --color-text-soft: #5a6378;   /* muted secondary text */
  --color-gold: #b3924f;        /* muted gold accent */
  --color-gold-soft: #cdb37e;   /* lighter gold for borders/hover */
  --color-border: #e0d6c2;      /* soft warm border */
  --color-border-strong: #cdbfa3;
  --color-focus: #6f87bf;       /* visible focus ring (cool, calm) */
  --color-playing-bg: #f0ead9;  /* highlight for now-playing row */

  /* Typography */
  --font-serif: Georgia, 'Cormorant Garamond', 'Times New Roman', serif;
  --font-sans: -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* Spacing / sizing */
  --max-width: 1180px;
  --player-height: 132px;       /* reserved space so content isn't hidden */
  --radius: 8px;
  --shadow-soft: 0 1px 3px rgba(35, 49, 78, 0.08);
  --shadow-raised: 0 -2px 14px rgba(35, 49, 78, 0.12);
}

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

html {
  /* Smooth in-page anchoring without jarring jumps */
  scroll-behavior: smooth;
}

body {
  margin: 0;
  /* Bottom padding reserves room for the fixed player bar so the last
     recordings are never hidden behind it. */
  padding-bottom: calc(var(--player-height) + 1rem);
  /* Layered, warm parchment background (pure CSS — no images, works offline).
     A soft light highlight + a faint gold glow near the top give gentle depth,
     over a subtle vertical cream gradient. Fixed so it stays calm on scroll. */
  background-color: var(--color-bg);
  background-image:
    radial-gradient(1200px 620px at 50% -8%, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 62%),
    radial-gradient(1000px 560px at 50% 2%, rgba(179, 146, 79, 0.07), rgba(179, 146, 79, 0) 70%),
    linear-gradient(180deg, #f9f4ec 0%, #f4eddf 55%, #f0e8d6 100%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.2;
  color: var(--color-text);
}

a {
  color: var(--color-gold);
}

/* Container helper used by header and main */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* --------------------------------------------------------------------------
   Accessibility helpers
   -------------------------------------------------------------------------- */

/* Visually hidden but available to screen readers. */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Skip link: hidden until focused, then slides into view. */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 1000;
  background: var(--color-text);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  text-decoration: none;
  transition: top 0.15s ease-in-out;
}
.skip-link:focus {
  top: 1rem;
}

/* Consistent, clearly visible focus indicator for keyboard users. */
:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
  border-radius: 4px;
}

/* --------------------------------------------------------------------------
   Header / hero
   -------------------------------------------------------------------------- */
.site-header {
  /* A gentle luminous wash at the very top, fading into the page, with a
     hairline gold accent under the header to lift it from the parchment. */
  background:
    radial-gradient(720px 280px at 50% -40%, rgba(179, 146, 79, 0.10), rgba(179, 146, 79, 0) 70%),
    linear-gradient(180deg, rgba(255, 253, 248, 0.75) 0%, rgba(246, 241, 231, 0) 100%);
  border-bottom: 1px solid var(--color-gold-soft);
  box-shadow: 0 1px 0 rgba(179, 146, 79, 0.18);
  text-align: center;
  padding: 2.75rem 0 2.25rem;
}

.hero-motif {
  /* The inline-SVG candle/flame motif. */
  display: block;
  margin: 0 auto 0.75rem;
  width: 46px;
  height: 64px;
}
.hero-motif .flame {
  /* Gentle, slow flicker — disabled for users who prefer reduced motion. */
  transform-origin: center bottom;
  animation: flicker 3.2s ease-in-out infinite;
}

@keyframes flicker {
  0%, 100% { opacity: 0.95; transform: scaleY(1); }
  50%      { opacity: 1;    transform: scaleY(1.06); }
}

.hero-title {
  margin: 0.25rem 0 0.35rem;
  font-size: 2.6rem;
  letter-spacing: 0.5px;
}

.hero-subtitle {
  margin: 0 0 1.25rem;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--color-text-soft);
}

/* Ornamental divider: a hairline with a centered gold diamond. */
.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 1.25rem auto;
  max-width: 360px;
  color: var(--color-gold);
}
.ornament::before,
.ornament::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-gold-soft), transparent);
}
.ornament .diamond {
  width: 9px;
  height: 9px;
  transform: rotate(45deg);
  background: var(--color-gold);
  flex: 0 0 auto;
}

.dedication {
  max-width: 640px;
  margin: 0 auto 1.5rem;
  font-size: 1.05rem;
  color: var(--color-text-soft);
  line-height: 1.7;
}

/* Hero stats (total recordings + total listening time). */
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 0.5rem;
}
.hero-stats .stat {
  min-width: 120px;
}
.hero-stats .stat-number {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.7rem;
  color: var(--color-gold);
  line-height: 1.1;
}
.hero-stats .stat-label {
  display: block;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-soft);
}

/* --------------------------------------------------------------------------
   Layout: nav + main content
   -------------------------------------------------------------------------- */
.layout {
  display: block;
  margin-top: 1.5rem;
}

/* Mobile nav toggle (hamburger). Hidden on wider screens. */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding: 0.6rem 0.9rem;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}
.nav-toggle:hover {
  background: var(--color-surface-alt);
}
.nav-toggle .bars {
  display: inline-block;
  width: 18px;
  height: 12px;
  position: relative;
}
.nav-toggle .bars,
.nav-toggle .bars::before,
.nav-toggle .bars::after {
  border-top: 2px solid currentColor;
}
.nav-toggle .bars::before,
.nav-toggle .bars::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
}
.nav-toggle .bars::before { top: 4px; }
.nav-toggle .bars::after  { top: 9px; }

/* Category navigation panel */
.category-nav {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.75rem;
  box-shadow: var(--shadow-soft);
  margin-bottom: 1.5rem;
}
.category-nav h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-text-soft);
  margin: 0.25rem 0.5rem 0.75rem;
}

.category-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.category-list li {
  margin: 0;
}

/* Buttons used as category / subcategory selectors. */
.cat-btn,
.subcat-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--color-text);
  font: inherit;
  padding: 0.55rem 0.65rem;
  cursor: pointer;
  line-height: 1.3;
}
.cat-btn:hover,
.subcat-btn:hover {
  background: var(--color-surface-alt);
}

/* The active (selected) category/subcategory. */
.cat-btn.is-active,
.subcat-btn.is-active {
  background: var(--color-surface-alt);
  color: var(--color-text);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--color-gold);
}

.cat-btn .label,
.subcat-btn .label {
  flex: 1 1 auto;
}

/* The little count pill next to each category. */
.count-pill {
  flex: 0 0 auto;
  background: var(--color-bg);
  border: 1px solid var(--color-border-strong);
  color: var(--color-text-soft);
  font-size: 0.78rem;
  line-height: 1;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
}
.cat-btn.is-active .count-pill,
.subcat-btn.is-active .count-pill {
  border-color: var(--color-gold-soft);
  color: var(--color-gold);
}

/* Sub-list under "Holidays". Collapsed by default via [hidden]. */
.subcat-list {
  list-style: none;
  margin: 0.15rem 0 0.4rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--color-border);
}
.subcat-btn {
  font-size: 0.95rem;
  padding: 0.45rem 0.6rem;
}

/* Caret indicator for the expandable Holidays item. */
.caret {
  display: inline-block;
  margin-left: 0.4rem;
  transition: transform 0.15s ease;
  color: var(--color-text-soft);
  flex: 0 0 auto;
}
.cat-btn[aria-expanded="true"] .caret {
  transform: rotate(90deg);
}

/* --------------------------------------------------------------------------
   Search
   -------------------------------------------------------------------------- */
.search-area {
  margin-bottom: 1.25rem;
}
.search-field {
  position: relative;
  display: flex;
  align-items: center;
}
.search-field .search-icon {
  position: absolute;
  left: 0.75rem;
  color: var(--color-text-soft);
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 0.7rem 0.9rem 0.7rem 2.4rem;
  font: inherit;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
}
.search-input::placeholder {
  color: var(--color-text-soft);
}
.search-clear {
  position: absolute;
  right: 0.4rem;
  background: transparent;
  border: none;
  color: var(--color-text-soft);
  font-size: 1.2rem;
  line-height: 1;
  padding: 0.3rem 0.5rem;
  cursor: pointer;
  border-radius: 6px;
}
.search-clear:hover {
  background: var(--color-surface-alt);
  color: var(--color-text);
}

/* --------------------------------------------------------------------------
   Main content / recording list
   -------------------------------------------------------------------------- */
.content-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--color-border);
}
.content-title {
  font-size: 1.55rem;
  margin: 0;
}
.content-meta {
  color: var(--color-text-soft);
  font-size: 0.95rem;
}

/* Friendly state messages (empty catalog / no search results). */
.notice {
  background: var(--color-surface);
  border: 1px dashed var(--color-border-strong);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--color-text-soft);
  font-size: 1.05rem;
}

/* The recordings list. */
.recording-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
}

/* Each recording list item is a flex row: the play button grows, the
   copy-link button sits at the trailing edge. */
.recording-list li {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--color-border);
}
.recording-list li:last-child {
  border-bottom: none;
}

.recording-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex: 1 1 auto;
  padding: 0.7rem 0.9rem;
  border: none;
  background: transparent;
  color: var(--color-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.recording-row:hover {
  background: var(--color-surface-alt);
}

/* Copy-link button: a clearly-visible gold "share" control at the row's
   trailing edge, so it's easy to find on every device. */
.copy-link {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  border: none;
  border-left: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-gold);
  cursor: pointer;
  opacity: 0.9;
  transition: opacity 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.copy-link svg {
  width: 18px;
  height: 18px;
}
/* The link icon is the default; the checkmark appears only after a copy.
   (SVG elements ignore the HTML [hidden] attribute, so toggle the two via CSS.) */
.copy-link .icon-check,
.player-share .icon-check { display: none; }
.copy-link.is-copied .icon-link,
.player-share.is-copied .icon-link { display: none; }
.copy-link.is-copied .icon-check,
.player-share.is-copied .icon-check { display: inline-block; }
.copy-link:hover,
.copy-link:focus-visible {
  opacity: 1;
  color: var(--color-gold);
  background: var(--color-surface-alt);
}
.recording-list li:hover .copy-link,
.recording-list li:focus-within .copy-link {
  opacity: 1;
}
.copy-link.is-copied,
.player-share.is-copied {
  color: var(--color-gold);
  opacity: 1;
}
@media (hover: none), (max-width: 560px) {
  .copy-link {
    opacity: 1;
  }
}

/* Currently-playing row highlight. */
.recording-row.is-playing {
  background: var(--color-playing-bg);
  box-shadow: inset 3px 0 0 var(--color-gold);
}

/* Small play/now-playing glyph at the start of each row. */
.row-icon {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-gold);
}
.recording-row.is-playing .row-icon {
  color: var(--color-gold);
}

.row-main {
  flex: 1 1 auto;
  min-width: 0; /* allow text-overflow to work inside flex */
}
.row-title {
  display: block;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.row-category {
  display: block;
  font-size: 0.82rem;
  color: var(--color-text-soft);
}
.row-duration {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  color: var(--color-text-soft);
  font-size: 0.92rem;
}

/* The animated "playing" bars shown on the active row. */
.equalizer {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 16px;
}
.equalizer span {
  width: 3px;
  background: var(--color-gold);
  animation: eq 1s ease-in-out infinite;
}
.equalizer span:nth-child(1) { height: 6px;  animation-delay: 0s;    }
.equalizer span:nth-child(2) { height: 14px; animation-delay: 0.2s;  }
.equalizer span:nth-child(3) { height: 9px;  animation-delay: 0.4s;  }
@keyframes eq {
  0%, 100% { transform: scaleY(0.5); }
  50%      { transform: scaleY(1); }
}

/* --------------------------------------------------------------------------
   Player bar (fixed at bottom)
   -------------------------------------------------------------------------- */
.player-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  background: var(--color-surface);
  border-top: 1px solid var(--color-border-strong);
  box-shadow: var(--shadow-raised);
  padding: 0.6rem 1rem;
}

.player-inner {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem 1rem;
  align-items: center;
}

/* Now-playing text block. */
.player-now {
  min-width: 0;
}
.player-track-title {
  display: block;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-track-cat {
  display: block;
  font-size: 0.82rem;
  color: var(--color-text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Transport buttons (prev / play / next). */
.player-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.player-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--color-border-strong);
  border-radius: 50%;
  background: var(--color-bg);
  color: var(--color-text);
  cursor: pointer;
}
.player-btn:hover:not(:disabled) {
  background: var(--color-surface-alt);
  border-color: var(--color-gold-soft);
}
.player-btn:disabled {
  opacity: 0.45;
  cursor: default;
}
.player-btn svg {
  width: 18px;
  height: 18px;
}
/* The main play/pause button is a touch larger and gold-accented. */
.player-btn.play-pause {
  width: 50px;
  height: 50px;
  background: var(--color-gold);
  border-color: var(--color-gold);
  color: #fff;
}
.player-btn.play-pause:hover:not(:disabled) {
  background: #a3823f;
  border-color: #a3823f;
}
.player-btn.play-pause svg {
  width: 22px;
  height: 22px;
}

/* Seek / progress area. */
.player-progress {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.time {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
  color: var(--color-text-soft);
  min-width: 3.2em;
  text-align: center;
}

/* Range inputs: seek + volume. Kept simple and accessible. */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--color-border);
  cursor: pointer;
  margin: 0;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-gold);
  border: 2px solid var(--color-surface);
  box-shadow: 0 0 0 1px var(--color-gold-soft);
}
input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 2px solid var(--color-surface);
  border-radius: 50%;
  background: var(--color-gold);
}
input[type="range"]:disabled {
  opacity: 0.5;
  cursor: default;
}
.seek-slider {
  flex: 1 1 auto;
}

/* Volume control. */
.player-volume {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
}
.player-volume svg {
  width: 18px;
  height: 18px;
  color: var(--color-text-soft);
  flex: 0 0 auto;
}
.volume-slider {
  width: 100px;
  flex: 0 0 auto;
}

/* Right-side auxiliary cluster: volume + autoplay toggle share the last cell. */
.player-aux {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem 1.1rem;
}

/* Autoplay on/off switch (role="switch"). */
.player-autoplay {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.autoplay-label {
  font-size: 0.82rem;
  color: var(--color-text-soft);
  white-space: nowrap;
}
.switch {
  position: relative;
  width: 42px;
  height: 23px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  flex: 0 0 auto;
}
.switch-track {
  display: block;
  width: 42px;
  height: 23px;
  border-radius: 999px;
  background: var(--color-border-strong);
  transition: background 0.15s ease;
}
.switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(35, 49, 78, 0.3);
  transition: left 0.15s ease;
}
.switch[aria-checked="true"] .switch-track {
  background: var(--color-gold);
}
.switch[aria-checked="true"] .switch-thumb {
  left: 22px;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  text-align: center;
  padding: 2.5rem 1rem 1.5rem;
  color: var(--color-text-soft);
  border-top: 1px solid var(--color-border);
  margin-top: 2rem;
}
.footer-hebrew {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: var(--color-text);
  margin: 0 0 0.25rem;
}
.footer-translation {
  font-style: italic;
  margin: 0 0 1rem;
}
.footer-note {
  font-size: 0.9rem;
  margin: 0.25rem 0;
}

/* --------------------------------------------------------------------------
   Responsive enhancements
   -------------------------------------------------------------------------- */

/* On narrow screens the nav is collapsed by default and toggled by the
   hamburger. The [hidden] attribute (set by JS) fully hides it. */
@media (max-width: 819px) {
  .category-nav.is-collapsed {
    display: none;
  }
}

/* Tablet / desktop: two-column layout, persistent nav, richer player. */
@media (min-width: 820px) {
  /* Hide the hamburger; nav is always visible. */
  .nav-toggle {
    display: none;
  }

  .layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    align-items: start;
  }

  /* Keep nav in view while scrolling the recordings. */
  .category-nav {
    position: sticky;
    top: 1rem;
    margin-bottom: 0;
    max-height: calc(100vh - var(--player-height) - 2rem);
    overflow-y: auto;
  }

  /* Player bar lays out as a single row with proportional regions. */
  .player-inner {
    grid-template-columns: minmax(160px, 1fr) auto minmax(220px, 2fr) auto;
    gap: 1.25rem;
  }
  .player-progress {
    grid-column: auto;
  }
}

/* Reserve a bit less bottom space on wide screens where the player is shorter. */
@media (min-width: 820px) {
  :root {
    --player-height: 92px;
  }
}

/* Respect users who prefer reduced motion. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-motif .flame,
  .equalizer span {
    animation: none;
  }
  .skip-link,
  .caret {
    transition: none;
  }
}

/* ==========================================================================
   LAUNCH ADDITIONS — donation link, light-a-candle, dedication, footer
   ========================================================================== */

:root {
  --color-gold-deep: #8f7440; /* darker gold for small text / buttons */
}

/* --------------------------------------------------------------------------
   Donation link (hero pill + footer text link)
   -------------------------------------------------------------------------- */
.hero-donate {
  margin: 0 0 1.5rem;
}
.btn-donate {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  border: 1.5px solid var(--color-gold);
  border-radius: 999px;
  background: transparent;
  color: var(--color-gold-deep);
  font-family: var(--font-sans);
  font-size: 1rem;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.btn-donate:hover,
.btn-donate:focus-visible {
  background: rgba(179, 146, 79, 0.10);
}
.footer-donate-link,
.footer-page-link {
  color: var(--color-gold-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Hero dedication excerpt "read more" link
   -------------------------------------------------------------------------- */
.dedication-more {
  margin: -0.75rem 0 1.5rem;
}
.read-more {
  font-size: 0.98rem;
  color: var(--color-gold-deep);
  text-decoration: none;
  border-bottom: 1px solid var(--color-gold-soft);
  padding-bottom: 1px;
}
.read-more:hover,
.read-more:focus-visible {
  border-bottom-color: var(--color-gold-deep);
}

/* --------------------------------------------------------------------------
   Dedication tab in the category nav (above the category buttons)
   -------------------------------------------------------------------------- */
.nav-dedication {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.1rem 0 0.75rem;
  padding: 0.55rem 0.65rem 0.8rem;
  border: none;
  border-bottom: 1px solid var(--color-border);
  border-radius: 6px 6px 0 0;
  color: var(--color-gold-deep);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  line-height: 1.3;
}
.nav-dedication:hover,
.nav-dedication:focus-visible {
  background: var(--color-surface-alt);
}
.nav-dedication .nav-dedication-icon {
  flex: 0 0 auto;
  font-size: 1.05rem;
  line-height: 1;
}
.nav-dedication .label {
  flex: 1 1 auto;
}

/* --------------------------------------------------------------------------
   Light-a-candle (hero section, backed by candle.php)
   -------------------------------------------------------------------------- */
.candle-section {
  margin: 1.75rem auto 0;
  max-width: 620px;
  text-align: center;
}
.candle-wall {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 0.9rem 1.1rem;
  max-width: 560px;
  margin: 0 auto 1rem;
  padding: 1.35rem 1.25rem 1rem;
  background: linear-gradient(180deg, #f4eddf 0%, #efe7d4 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  min-height: 84px;
}
.wall-candle {
  display: inline-flex;
  width: 24px;
  height: 34px;
}
.wall-candle svg {
  width: 100%;
  height: 100%;
}
.wall-candle .flame {
  /* De-synchronized inline delays/durations are set by app.js. */
  transform-origin: center bottom;
  animation: flicker 3.2s ease-in-out infinite;
}
.wall-candle.is-new {
  animation: candle-in 1.4s ease both;
}
@keyframes candle-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.wall-more {
  align-self: center;
  font-size: 0.88rem;
  color: var(--color-text-soft);
  white-space: nowrap;
}
.candle-counter {
  font-family: var(--font-serif);
  font-size: 1.12rem;
  color: var(--color-text);
  margin: 0 0 1rem;
}
.candle-counter .count {
  color: var(--color-gold-deep);
  font-size: 1.25rem;
}
.btn-light {
  display: inline-block;
  padding: 0.7rem 1.7rem;
  border: 1.5px solid var(--color-gold);
  border-radius: 999px;
  background: var(--color-gold);
  color: #fffdf8;
  font-family: var(--font-sans);
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.btn-light:hover:not(:disabled),
.btn-light:focus-visible:not(:disabled) {
  background: #a3823f;
  border-color: #a3823f;
}
.btn-light:disabled {
  background: transparent;
  border-color: var(--color-border-strong);
  color: var(--color-text-soft);
  cursor: default;
  font-style: italic;
}

/* --------------------------------------------------------------------------
   Footer: Spanish saying + Shabbat notice
   -------------------------------------------------------------------------- */
.footer-saying {
  margin: 0 auto 1.5rem;
  max-width: 46ch;
}
.saying-intro {
  font-size: 0.88rem;
  color: var(--color-text-soft);
  margin: 0 0 0.6rem;
}
.saying-es {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--color-text);
  margin: 0 0 0.6rem;
}
.saying-en {
  font-size: 0.88rem;
  color: var(--color-text-soft);
  line-height: 1.65;
  margin: 0;
}
.shabbat-notice {
  display: inline-block;
  margin: 0 auto 1.75rem;
  padding: 0.6rem 1.15rem;
  border: 1px solid var(--color-gold-soft);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 0.95rem;
}

/* --------------------------------------------------------------------------
   Dedication page (dedication.html)
   -------------------------------------------------------------------------- */
.page-dedication {
  /* No fixed player bar on this page — no reserved bottom space needed. */
  padding-bottom: 1rem;
}

/* Compact header variant for secondary pages. */
.header-compact {
  padding: 2rem 0 1.5rem;
}
.header-compact .hero-motif {
  width: 36px;
  height: 50px;
}
.header-compact .hero-title {
  font-size: 2rem;
}
.header-compact .hero-subtitle {
  margin-bottom: 0.9rem;
  font-size: 1.1rem;
}

.back-line {
  margin: 0.25rem 0 0;
}
.back-link {
  font-size: 0.95rem;
  color: var(--color-gold-deep);
  text-decoration: none;
  border-bottom: 1px solid var(--color-gold-soft);
  padding-bottom: 1px;
}
.back-link:hover,
.back-link:focus-visible {
  border-bottom-color: var(--color-gold-deep);
}

.dedication-article {
  padding: 2.75rem 0 3rem;
}
.dedication-inner {
  max-width: 65ch;
  margin: 0 auto;
}
.bh-opener {
  text-align: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.05rem;
  color: var(--color-text-soft);
  margin: 0 0 1.75rem;
  letter-spacing: 0.04em;
}
.dedication-title {
  text-align: center;
  font-size: 1.9rem;
  margin: 0 0 0.4rem;
}
.dedication-subtitle {
  text-align: center;
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--color-text-soft);
  margin: 0 0 0.5rem;
}
.dedication-body p {
  font-size: 1.02rem;
  line-height: 1.85;
  color: var(--color-text);
  margin: 0 0 1.35rem;
}
.dedication-body p.request {
  font-style: italic;
  color: var(--color-text-soft);
}
.dedicated-by {
  text-align: center;
  margin: 2.25rem 0;
}
.dedicated-by h3 {
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-gold-deep);
  margin: 0 0 0.6rem;
  font-family: var(--font-sans);
  font-weight: 600;
}
.dedicated-by p {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  line-height: 1.9;
  margin: 0 0 1.25rem;
}
.closing-line {
  text-align: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--color-text-soft);
  max-width: 52ch;
  margin: 0 auto;
}
.dedication-article .back-bottom {
  text-align: center;
  margin-top: 2.5rem;
}

/* Print-friendly dedication page. */
@media print {
  .page-dedication {
    background: #fff;
    color: #000;
    padding-bottom: 0;
  }
  .page-dedication .site-header {
    background: #fff;
    box-shadow: none;
  }
  .page-dedication .hero-motif .flame { animation: none; }
  .page-dedication .back-line,
  .page-dedication .back-bottom,
  .page-dedication .skip-link {
    display: none;
  }
  .page-dedication .site-footer {
    border-top: 1px solid #000;
  }
  .page-dedication a {
    color: inherit;
    text-decoration: none;
  }
  .page-dedication .shabbat-notice {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* Reduced motion: still the candle wall too. */
@media (prefers-reduced-motion: reduce) {
  .wall-candle .flame,
  .wall-candle.is-new {
    animation: none;
  }
}

/* Hide the candle wall frame until at least one candle is lit. */
.candle-wall:empty { display: none; }

/* ==========================================================================
   ALL-CANDLES PAGE (candles.html) + "See all candles" links
   ========================================================================== */

/* "See all candles →" link under the hero candle button (index.html). */
.see-all-line {
  margin: 1rem 0 0;
}
.see-all-link {
  font-size: 0.95rem;
  color: var(--color-gold-deep);
  text-decoration: none;
  border-bottom: 1px solid var(--color-gold-soft);
  padding-bottom: 1px;
}
.see-all-link:hover,
.see-all-link:focus-visible {
  border-bottom-color: var(--color-gold-deep);
}

/* The hero wall's "+N more" note may be a link to candles.html. */
a.wall-more {
  color: var(--color-gold-deep);
  text-decoration: none;
  border-bottom: 1px solid var(--color-gold-soft);
  padding-bottom: 1px;
}
a.wall-more:hover,
a.wall-more:focus-visible {
  border-bottom-color: var(--color-gold-deep);
}

/* --------------------------------------------------------------------------
   candles.html — the full wall of candles
   -------------------------------------------------------------------------- */
.page-candles {
  /* No fixed player bar on this page — no reserved bottom space needed. */
  padding-bottom: 1rem;
}

.candles-article {
  padding: 2.25rem 0 3rem;
  text-align: center;
}

/* Counter headline: slightly larger than the hero counter. */
.candles-headline {
  font-size: 1.35rem;
  margin: 0 0 1.5rem;
}

/* Gentle degraded state (endpoint unreachable / file://). */
.candles-resting {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--color-text-soft);
  margin: 1rem auto 2rem;
  max-width: 46ch;
}

/* Warm invitation when no candle has been lit yet. */
.candles-empty {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  color: var(--color-text);
  margin: 1rem auto 1.5rem;
  max-width: 46ch;
}

/* The full wall: centered, wider than the hero wall, candles bottom-aligned
   (flex-wrap + align-items are inherited from .candle-wall). Per-candle size
   and gap are set by the page script via CSS custom properties so the whole
   wall re-sizes without a DOM rebuild. */
.candle-wall.all-candles {
  max-width: 900px;
  margin: 0 auto 1.75rem;
  gap: var(--candle-gap, 0.9rem);
}
.candle-wall.all-candles .wall-candle {
  width: var(--candle-size, 24px);
  height: calc(var(--candle-size, 24px) * 1.4);
}

/* The "+N more" safety-valve line sits on its own row under the candles. */
.candle-wall.all-candles .wall-more-line {
  flex-basis: 100%;
  margin-top: 0.5rem;
}

.candles-actions {
  margin: 0 0 2rem;
}

