/* ================================
   Cântări — stili comuni (index + pagine singole)
   ================================ */

.cantari-hero {
  padding: 6.2rem 0 0rem;
}

.cantari-hero {
  padding-bottom: 0.5rem;
}

.cantari-hero .eyebrow,
.cantari-hero .lead {
  margin: 0;
}

.cantari-hero h1 {
  margin: 0;
  line-height: 1.1;
  font-size: clamp(2.2rem, 5vw, 3.5rem);
}

.cantari-hero .lead {
  margin: 0.6rem auto 0;
  max-width: 44rem;
  line-height: 1.6;
}

.cantari-hero-tags {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.cantari-hero-tags li {
  padding: 0.25rem 0.8rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 12%, #ffffff 88%);
  color: var(--primary-strong);
  font-size: 0.85rem;
  font-weight: 600;
}

/* ── Index alfabetic rapid ── */
.search-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.fav-filter-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.text-search-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.text-search-icon {
  width: 1.25rem;
  height: 1.25rem;
  display: block;
  background: var(--muted);
  -webkit-mask: url('../images/icons/text-filter.svg') no-repeat center / contain;
  mask: url('../images/icons/text-filter.svg') no-repeat center / contain;
  transition: background 0.15s;
}

.text-search-btn:hover {
  border-color: #d4a62e;
}

.text-search-btn:hover .text-search-icon {
  background: #e0b542;
}

.text-search-btn.is-active {
  background: #fdf6e3;
  border-color: #d4a62e;
}

.text-search-btn.is-active .text-search-icon {
  background: #d4a62e;
}


.fav-filter-btn svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.6;
  transition: fill 0.2s, stroke 0.2s;
}

.fav-filter-btn:hover {
  border-color: #d4a62e;
}

.fav-filter-btn:hover svg {
  stroke: #e0b542;
}

.fav-filter-btn.is-active {
  background: #fdf6e3;
  border-color: #d4a62e;
}

.fav-filter-btn.is-active svg {
  fill: #e0b542;
  stroke: #d4a62e;
}

/* ── Add song button (admin only, desktop only) ── */
.add-song-btn {
  appearance: none;
  border: 1.5px solid var(--primary, #7a5c3e);
  background: var(--surface);
  border-radius: 50%;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--primary, #7a5c3e);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.add-song-btn[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .add-song-btn {
    display: none !important;
  }
}

.add-song-btn svg {
  width: 1.15rem;
  height: 1.15rem;
}

.add-song-btn:hover {
  background: var(--primary, #7a5c3e);
  color: #fff;
}

.search-wrap input {
  width: 100%;
  max-width: 480px;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
}

/* X di cancellazione: icona SVG in --primary al posto di quella nativa */
.search-wrap input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  margin-left: 0.5rem;
  cursor: pointer;
  background: var(--primary);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E") center / contain no-repeat;
}

.search-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(122, 92, 62, 0.12);
}

/* ── Alpha nav wrapper ── */
.alpha-nav-toggle {
  display: none;
}

.alpha-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
  margin-bottom: 2.5rem;
}

/* Desktop: căutare + litere într-o coloană sticky în stânga listei */
@media (min-width: 901px) {
  .cantari-layout {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    gap: 2.5rem;
    align-items: start;
  }

  .cantari-main {
    grid-column: 2;
    grid-row: 1;
  }

  .cantari-side {
    grid-column: 1;
    grid-row: 1;
    position: sticky;
    top: 90px;
    align-self: start;
  }

  .cantari-side {
    padding: 1.1rem;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
  }

  .cantari-side .search-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.1rem;
    padding-bottom: 1.1rem;
    border-bottom: 1px solid var(--border);
  }

  .cantari-side .search-wrap input {
    order: -1;
    flex: 1 0 100%;
    max-width: none;
    background: var(--bg, #faf8f4);
  }

  /* pulsanti-unelte: rectangulare, împart lățimea în rând */
  .cantari-side .search-wrap button:not([hidden]) {
    flex: 1 1 0;
    width: auto;
    height: 40px;
    border-radius: 999px;
  }

  .cantari-side .alpha-nav {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin-bottom: 0;
  }

  .cantari-side .alpha-nav a {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    font-size: 1.1rem;
    border-radius: 20px 0px;
  }

  .cantari-side .alpha-nav .fav-filter-btn {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    border-radius: 20px 0px;
  }

  .cantari-side .alpha-nav .fav-filter-btn[hidden] {
    display: none;
  }

  .recent-songs {
    margin-top: 1.1rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--border);
  }

  .recent-songs[hidden] {
    display: none;
  }

  .recent-songs-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
  }

  .recent-songs-title {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted, #8a8078);
  }

  .recent-songs-clear {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-size: 0.75rem;
    color: var(--muted, #8a8078);
    cursor: pointer;
  }

  .recent-songs-clear:hover {
    color: var(--primary);
  }

  .recent-songs-list {
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .recent-songs-list a {
    display: block;
    padding: 0.4rem 0.5rem;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .recent-songs-list a:hover {
    background: var(--bg, #faf8f4);
  }
}

@media (max-width: 900px) {
  .recent-songs {
    display: none;
  }
}

@media (max-width: 900px) {
  .alpha-nav-wrap {
    margin-bottom: 1rem;
  }

  .alpha-nav-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.65rem 1rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    font-family: Inter, system-ui, sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
    cursor: pointer;
    appearance: none;
    transition: border-color 0.15s, background 0.15s;
  }

  .alpha-nav-toggle[aria-expanded="true"] {
    border-color: var(--primary);
  }

  .alpha-nav-toggle-arrow {
    display: inline-block;
    width: 0.75rem;
    height: 0.75rem;
    background: var(--muted);
    -webkit-mask: url('../images/icons/right-arrow.svg') no-repeat center / contain;
    mask: url('../images/icons/right-arrow.svg') no-repeat center / contain;
    transform: rotate(90deg);
    transition: transform 0.2s;
    flex-shrink: 0;
  }

  .alpha-nav-toggle[aria-expanded="true"] .alpha-nav-toggle-arrow {
    transform: rotate(-90deg);
  }

  .alpha-nav {
    display: none;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    margin-bottom: 0;
    padding: 0.75rem;
    border: 1px solid var(--primary);
    border-radius: 20px;
    background: var(--surface);
  }

  .alpha-nav.is-open {
    display: flex;
  }

  .alpha-nav a {
    width: 40px;
    height: 40px;
  }
}

.alpha-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 20px 0px;
  font-family: Inter, system-ui, sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  text-decoration: none;
  background: var(--surface);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.alpha-nav a:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ── Grupuri litere ── */
.alpha-group {
  margin-bottom: 2.2rem;
  scroll-margin-top: 9.5rem;
}

.alpha-letter {
  font-size: 1.6rem;
  color: var(--primary);
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.4rem;
  margin: 0 0 0.85rem;
}

.song-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.song-list-item {
  display: flex;
  align-items: center;
  gap: 0;
}

.fav-star {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0.2rem 0.4rem 0.2rem 0;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fav-star svg {
  width: 1.15rem;
  height: 1.15rem;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.6;
  transition: fill 0.2s, stroke 0.2s, transform 0.2s;
}

.fav-star:hover svg {
  stroke: #e0b542;
  transform: scale(1.12);
}

.fav-star.is-fav svg {
  fill: #e0b542;
  stroke: #d4a62e;
}

.song-yt-badge {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  margin-right: 0.35rem;
  color: #ff0000;
  line-height: 1;
}

.song-yt-badge svg {
  width: 1.1rem;
  height: 1.1rem;
}

.song-list-item a {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
  min-width: 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  font-weight: 600;
  font-size: 0.97rem;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.song-list-item a .sl-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-list-item a .sl-number {
  flex-shrink: 0;
  margin: 0 0.6rem;
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 14%, #ffffff 86%);
  color: var(--primary-strong);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
}

.song-list-item a::after {
  content: "";
  display: inline-block;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  background: var(--muted);
  -webkit-mask: url("../images/icons/right-arrow.svg") no-repeat center / contain;
  mask: url("../images/icons/right-arrow.svg") no-repeat center / contain;
  transition: transform 0.15s;
}

.song-list-item a:hover {
  background: var(--surface-alt);
  border-color: var(--primary);
  transform: translateX(3px);
}

.song-list-item a:hover::after {
  transform: translateX(4px);
}

.no-results {
  color: var(--muted);
  font-size: 1rem;
  padding: 2rem 0;
  text-align: center;
}

.cantari-index-section {
  padding-top: 1rem;
  border-top: none;
}

/* ================================
   Pagina singolo cântec
   ================================ */

.song-page-hero {
  padding: 6.2rem 0 2rem;
  border-bottom: 1px solid var(--border);
}

@media (min-width: 901px) {
  .song-page-hero .container,
  .cantari-hero .container {
    display: grid;
    gap: 0.32rem;
  }

  .cantari-hero .container {
    text-align: center;
  }

  .song-page-hero .container {
    text-align: center;
  }

  .song-body-page,
  .song-pdf-actions {
    margin-left: auto;
    margin-right: auto;
  }

  .song-body-page {
    text-align: center;
  }

  .song-stanza p,
  .stanza-label {
    text-align: center;
  }

  .song-pdf-actions {
    text-align: center;
  }

  .song-page-hero h1 {
    margin-bottom: 0.2rem;
  }
}

.back-link {
  display: none;
}

/* ── Back to top (desktop only) ── */
.back-to-top {
  display: none;
}

@media (min-width: 901px) {
  .back-to-top {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 950;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.12);
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 0.25s, transform 0.25s, background 0.15s, border-color 0.15s;
  }

  .back-to-top.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .back-to-top svg {
    width: 1.25rem;
    height: 1.25rem;
    stroke: var(--primary);
    stroke-width: 2.2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .back-to-top img,
  .back-to-top-icon {
    width: 1.1rem;
    height: 1.1rem;
    display: block;
    transform: rotate(-90deg);
    filter: brightness(0) saturate(100%) invert(36%) sepia(22%) saturate(700%) hue-rotate(357deg) brightness(85%);
  }

  .back-to-top:hover img,
  .back-to-top:hover .back-to-top-icon {
    filter: brightness(0) saturate(100%) invert(36%) sepia(22%) saturate(700%) hue-rotate(357deg) brightness(85%);
  }

  .back-to-top:hover svg {
    stroke: var(--primary);
  }
}

.back-link:hover { color: var(--primary); }

.song-page-hero h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.15;
}

.song-page-logo {
  display: block;
  width: clamp(86px, 11vw, 126px);
  height: auto;
  margin: 0 auto 0.5rem;
}

/* ── YouTube embed / link in song hero ── */
.song-youtube-wrap {
  margin-top: 1.2rem;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  max-width: 680px;
}

.song-youtube-aspect {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(0,0,0,0.15);
}

.song-youtube-aspect iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.song-youtube-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: #c00;
  text-decoration: none;
  padding: 0.4rem 0.9rem;
  border: 1px solid rgba(204,0,0,0.3);
  border-radius: 999px;
  transition: background 0.15s;
}

.song-youtube-link:hover {
  background: rgba(204,0,0,0.07);
}

.song-meta {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.song-tag {
  display: inline-block;
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
}

.song-video-top {
  margin-top: 1.4rem;
  margin-bottom: 0.8rem;
  margin-left: auto;
  margin-right: auto;
  max-width: 680px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #000;
}

.song-video-top iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* ── Corpo testo lirica ── */
.song-body-page {
  padding: 2rem 0 1.4rem;
  max-width: 680px;
}

.song-stanza {
  margin-bottom: 1.65rem;
}

.song-stanza p {
  margin: 0;
  line-height: 1.66;
  font-size: 1.06rem;
  color: var(--text);
  white-space: pre-line;
  text-wrap: pretty;
  overflow-wrap: normal;
}

.stanza-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

/* ── Navigare prev/next ── */
.song-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--border);
}

.snav-link {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.15s, background 0.15s;
}

.snav-link:hover {
  border-color: var(--primary);
  background: var(--surface-alt);
}

.snav-link.next { text-align: right; }

.snav-dir {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.snav-title {
  font-family: Inter, system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
}

/* ── Export PDF ── */
.song-pdf-actions {
  max-width: 680px;
  padding: 0 0 2.2rem;
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-left: auto;
  margin-right: auto;
}

.song-pdf-btn,
.song-slide-btn,
.song-delete-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 999px;
  padding: 0.7rem 1rem;
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s, filter 0.15s;
}

/* Keep button metrics stable across RO/IT labels */
.song-pdf-btn,
.song-slide-btn {
  min-width: 194px;
  justify-content: center;
}

.btn-icon {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
}

.btn-icon-white {
  filter: brightness(0) invert(1);
}

.btn-icon-dark {
  filter: none;
}

.song-pdf-btn,
.song-slide-btn {
  border-radius: 999px;
}

.song-pdf-btn {
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
}

.song-slide-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}

.song-delete-btn {
  border: 1px solid #dc2626;
  background: #dc2626;
  color: #fff;
}

.song-pdf-btn:hover,
.song-slide-btn:hover,
.song-delete-btn:hover {
  transform: translateY(-1px);
  filter: brightness(0.95);
}

.song-pdf-btn:disabled,
.song-slide-btn:disabled,
.song-delete-btn:disabled {
  opacity: 0.7;
  cursor: wait;
  transform: none;
}

/* ── Social share bar ── */
.song-share-bar {
  max-width: 680px;
  margin: 0 auto 2.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.song-share-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-right: 0.2rem;
  min-width: 98px;
}

.song-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--share-color, #888);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.18s, transform 0.18s;
  flex-shrink: 0;
  padding: 0;
}

.song-share-btn svg {
  width: 20px;
  height: 20px;
  display: block;
}

.song-share-btn:hover {
  opacity: 0.85;
  transform: translateY(-2px);
}

.song-share-btn:active {
  transform: scale(0.95);
  opacity: 1;
}

.song-share-copy--done {
  background: #3bba4b !important;
}

.song-share-copy--done svg {
  display: none;
}

.song-share-copy--done::after {
  content: '✓';
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
}

/* ── Active nav ── */
.nav-active {
  color: var(--primary) !important;
  font-weight: 700 !important;
}

/* ── Desktop two-column layout: sticky video left, page-scroll text right ── */
@media (min-width: 901px) {
  body.song-has-youtube {
    --song-sticky-top: 92px;
  }

  body.song-has-youtube main {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 2fr);
    align-items: start;
    max-width: min(1860px, 99vw);
    margin-left: auto;
    margin-right: auto;
    column-gap: 0.8rem;
  }

  body.song-has-youtube .song-page-hero {
    position: sticky;
    top: var(--song-sticky-top);
    max-height: calc(100vh - var(--song-sticky-top));
    overflow-y: auto;
    border-bottom: none;
    border-right: none;
    padding-top: 0.55rem;
    padding-bottom: 1.25rem;
    display: flex;
    align-items: flex-start;
  }

  body.song-has-youtube .song-page-hero .container {
    width: min(860px, 100%);
    min-height: 0;
    margin-top: 0;
    margin-bottom: 0;
    padding-right: 0.9rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0.14rem;
    transform: none;
  }

  body.song-has-youtube .song-youtube-wrap {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    margin-top: 0.7rem;
  }

  body.song-has-youtube .song-page-logo {
    margin-bottom: -0.28rem;
  }

  body.song-has-youtube .song-page-hero h1 {
    margin-top: -0.2rem;
    margin-bottom: 0.02rem;
    line-height: 1.03;
  }

  body.song-has-youtube .song-edit-btn {
    margin-top: 0.05rem;
    margin-bottom: 0.22rem;
  }

  body.song-has-youtube .cantari-index-section,
  body.song-has-youtube .cantari-index-section > .container,
  body.song-has-youtube main > .container {
    position: static;
    top: auto;
    max-height: none;
    overflow: visible;
    display: block;
  }

  body.song-has-youtube .cantari-index-section > .container,
  body.song-has-youtube main > .container {
    width: 100%;
    margin: 0;
    padding-left: 1rem;
    padding-top: calc(var(--song-sticky-top) + 46px);
  }

  body.song-has-youtube.song-right-short .cantari-index-section > .container,
  body.song-has-youtube.song-right-short main > .container {
    padding-top: calc(var(--song-sticky-top) + clamp(56px, 8vh, 112px));
  }

  body.song-has-youtube.song-right-short .song-pdf-actions {
    padding-bottom: 1rem;
  }

  body.song-has-youtube.song-right-short .song-share-bar {
    margin-bottom: 0.9rem;
  }

  body.song-has-youtube .song-body-page {
    text-align: left;
    max-width: calc(100% + 0.8rem);
    margin-left: 0;
    margin-right: -0.8rem;
    margin-top: 0;
    margin-bottom: 1.05rem;
    padding: 1.2rem 1.15rem 1rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
  }

  body.song-has-youtube .song-stanza p,
  body.song-has-youtube .stanza-label {
    text-align: left;
  }

  body.song-has-youtube .song-pdf-actions {
    max-width: 100%;
    justify-content: flex-start;
    margin-top: 0.35rem;
  }

  body.song-has-youtube .song-share-bar {
    max-width: 100%;
    justify-content: flex-start;
  }

  body.song-has-youtube .song-nav {
    max-width: 100%;
  }
}

/* ── FHD (1400–2199px): video più stretto, testo più largo ── */
@media (min-width: 1400px) and (max-width: 2199px) {
  body.song-has-youtube main {
    max-width: min(1540px, 99vw);
    margin-left: auto;
    margin-right: auto;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.7fr);
    column-gap: 1rem;
  }

  body.song-has-youtube .song-page-hero .container {
    width: min(860px, 100%);
  }
}

/* ── 2K e oltre (≥2200px): layout più ampio ── */
@media (min-width: 2200px) {
  body.song-has-youtube main {
    max-width: min(2400px, 99vw);
    margin-left: auto;
    margin-right: auto;
    grid-template-columns: minmax(0, 3fr) minmax(0, 1.1fr);
    column-gap: 1rem;
  }

  body.song-has-youtube .song-page-hero .container {
    width: min(1040px, 100%);
  }
}

@media (max-width: 900px) {
  /* Filtro lettere: pallini invece della forma a foglia del desktop */
  .alpha-nav a {
    border-radius: 50%;
  }

  .cantari-hero,
  .song-page-hero {
    padding-top: 5.6rem;
  }

  .search-wrap input {
    max-width: 100%;
  }

  .song-body-page,
  .song-pdf-actions {
    max-width: 100%;
  }
}

@media (max-width: 600px) {
  /* Intestazione catalogo compatta: colonna singola allineata a sinistra */
  .cantari-hero .container {
    text-align: left;
  }

  .cantari-hero .eyebrow {
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary);
  }

  .cantari-hero h1 {
    font-size: 2rem;
    margin-top: 0.1rem;
  }

  .cantari-hero .lead {
    margin: 0.45rem 0 0;
    max-width: none;
    font-size: 0.95rem;
    line-height: 1.5;
    text-align: left;
  }

  /* Etichette in una sola riga sotto il testo */
  .cantari-hero-tags {
    margin: 0.7rem 0 0;
    justify-content: flex-start;
    gap: 0.35rem;
  }

  .cantari-hero-tags li {
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
  }

  .cantari-hero,
  .song-page-hero {
    padding-top: 5.25rem;
    padding-bottom: 0.5rem;
  }

  .cantari-index-section {
    padding-top: 0.5rem;
    padding-bottom: 1.8rem;
  }

  .search-wrap {
    margin-bottom: 0.6rem;
  }

  .search-wrap.is-sticky {
    position: fixed;
    top: 66px;
    left: 0;
    right: 0;
    z-index: 890;
    /* Senza sfondo né ombra, come l'header: restano visibili solo i tasti e il campo */
    background: transparent;
    padding: 0.55rem 1rem;
    margin-bottom: 0;
    pointer-events: none;
  }

  .search-wrap.is-sticky > * {
    pointer-events: auto;
  }

  /* Placeholder to prevent layout jump when search-wrap becomes fixed */
  .search-wrap-placeholder {
    display: none;
  }

  .search-wrap-placeholder.is-visible {
    display: block;
    height: 58px;
  }

  .cantari-hero h1,
  .song-page-hero h1 {
    line-height: 1.2;
  }

  .alpha-nav {
    gap: 0.34rem;
    margin-bottom: 0.95rem;
  }

  .alpha-group {
    margin-bottom: 1.15rem;
  }

  .alpha-letter {
    margin-bottom: 0.55rem;
    padding-bottom: 0.25rem;
  }

  .alpha-nav a {
    width: 34px;
    height: 34px;
    font-size: 0.92rem;
  }

  .song-list-item a {
    padding: 0.78rem 0.86rem;
    font-size: 0.93rem;
  }

  .song-stanza p {
    font-size: 1rem;
    line-height: 1.52;
    text-align: center;
  }

  .stanza-label {
    text-align: center;
  }

  .song-page-hero h1,
  .song-page-hero .hero-container {
    text-align: center;
  }

  .song-body-page {
    padding-left: 0;
    padding-right: 0;
  }

  body.page-song .container {
    width: min(1120px, calc(92% - 6px));
  }

  .song-nav {
    grid-template-columns: 1fr;
    padding: 1.6rem 0 2.4rem;
  }

  .snav-link.next {
    text-align: left;
  }

  .song-pdf-actions {
    flex-wrap: nowrap;
    flex-direction: row-reverse;
    gap: 0.5rem;
  }

  .song-pdf-btn,
  .song-slide-btn {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    padding: 0.65rem 0.5rem;
    font-size: 0.88rem;
    white-space: nowrap;
  }
}

/* Mobile: lista larga quanto l'header (95% di viewport - 20px di padding), leggermente meno */
@media (max-width: 900px) {
  .cantari-index-section > .container,
  .cantari-hero > .container {
    width: calc((100% - 20px) * 0.95 - 8px);
  }
}

/* Catalog: pagină mai largă ca să încapă coloana laterală */
@media (min-width: 901px) {
  .cantari-index-section > .container {
    width: min(1480px, 95%);
  }
}

/* Nelle pagine dei canti il pulsante donazioni non serve */
.donate-fab { display: none !important; }

/* ── Selettore dimensione testo (locale) ── */
.song-fs-picker {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.25rem;
  margin: 0 auto 0.6rem;
  border-radius: 12px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
}

.song-fs-wrap {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}
.song-fs-wrap .song-fs-picker { margin: 0; border-radius: 999px; }
.song-fs-wrap .song-fs-picker button { border-radius: 999px; }
.song-fs-wrap .song-edit-btn { margin: 0; box-sizing: border-box; justify-content: center; border-radius: 999px; }

.song-fs-picker button {
  min-width: 2.6rem;
  height: 2.4rem;
  padding: 0 0.6rem;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--primary);
  font-family: Inter, system-ui, sans-serif;
  font-weight: 600;
  cursor: pointer;
}

.song-fs-picker button[aria-pressed="true"] {
  background: var(--surface);
  box-shadow: 0 0 0 1.5px var(--primary) inset;
}

.song-body-page .song-stanza p { font-size: calc(1.06rem * var(--song-fs, 1)); }
.song-body-page .stanza-label { font-size: calc(0.78rem * var(--song-fs, 1)); }

@media (max-width: 600px) {
  .song-body-page .song-stanza p { font-size: calc(1rem * var(--song-fs, 1)); }
}

/* ── Sfondo pagine canti (solo desktop) ── */
body:has(.song-page-hero) {
  position: relative;
  background: transparent;
}

body:has(.song-page-hero)::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url("../images/sfondo-cantari.jpg") center / cover no-repeat;
  opacity: 0.4;
  pointer-events: none;
}

body:has(.song-page-hero)::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    to right,
    rgba(250, 248, 245, 0) 0%,
    rgba(250, 248, 245, 0) 12%,
    rgba(250, 248, 245, 0.93) 35%,
    rgba(250, 248, 245, 0.97) 50%,
    rgba(250, 248, 245, 0.93) 65%,
    rgba(250, 248, 245, 0) 88%,
    rgba(250, 248, 245, 0) 100%
  );
  pointer-events: none;
}

@media (max-width: 900px) {
  body:has(.song-page-hero)::before,
  body:has(.song-page-hero)::after {
    display: none;
  }

  body:has(.song-page-hero) {
    background: var(--bg, #faf8f4);
  }
}

/* Tasto WhatsApp: solo mobile */
.song-wa-btn {
  display: none;
  appearance: none;
  align-items: center;
  border: 1px solid #3f6f55;
  background: #4a7c61;
  color: #fff;
  border-radius: 999px;
  padding: 0.7rem 0.5rem;
  font-family: Inter, system-ui, sans-serif;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  justify-content: center;
  text-align: center;
  flex: 0 0 auto;
  width: 3rem;
  height: 3rem;
  padding: 0;
  min-width: 0;
}

.song-wa-btn svg {
  width: 1.5rem;
  height: 1.5rem;
}

@media (max-width: 600px) {
  .song-wa-btn { display: inline-flex; order: 1; }
}

.alpha-group[data-letter="~"] {
  margin-top: 3.5rem;
}

.alpha-fix-separator {
  color: var(--primary);
  border-bottom: 2px dashed var(--primary);
}

/* Anteprima del testo nei risultati di ricerca (3+ parole) */
.song-list-item a .sl-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.song-list-item a .sl-main .sl-title {
  flex: none;
}

.song-list-item a .sl-snippet {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.song-list-item a.has-snippet {
  border-radius: 1.4rem;
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}

/* Titoli dei canti: a capo bilanciato */
.song-page-hero h1 {
  text-wrap: balance;
}
