*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  font-family: "Spectral", Georgia, serif;
  color: #2a2622;
  background-color: #f7f3ea;
  background-image: radial-gradient(
    rgba(180, 150, 100, 0.05) 1px,
    transparent 1px
  );
  background-size: 22px 22px;
  line-height: 1.6;
  font-size: 18px;
}
a {
  color: #3c6259;
  text-decoration: none;
}
a:hover {
  color: #b23a2e;
}
img {
  max-width: 100%;
}
:focus-visible {
  outline: 2px solid #4e7c73;
  outline-offset: 2px;
  border-radius: 3px;
}
.wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}
.site-header {
  background: linear-gradient(180deg, #3a2e28 0%, #2e241f 100%);
  color: #e6d29b;
  border-bottom: 3px solid #c8a24b;
}
.site-header-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.brand {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: 0.02em;
  color: #f7f3ea;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.brand .brand-mark {
  color: #c8a24b;
}
.brand small {
  display: block;
  font-family: "Spectral", Georgia, serif;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #e6d29b;
  font-weight: 400;
}
.site-nav {
  margin-left: auto;
  display: flex;
  gap: 4px;

  /* Prevent items from stacking on multiple lines */
  flex-wrap: nowrap;

  /* Enable horizontal scrolling on small screens */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;

  /* Hide scrollbar for a cleaner UI */
  scrollbar-width: none;
}

.site-nav::-webkit-scrollbar {
  display: none;
}

.site-nav a {
  color: #e6d29b;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.92rem;
  letter-spacing: 0.02em;

  /* Prevent text inside links from breaking */
  white-space: nowrap;
}
.site-nav a:hover {
  background: hsla(0, 0%, 100%, 0.08);
  color: #f7f3ea;
}
.hero {
  text-align: center;
  padding: 54px 20px 28px;
}
.hero h1 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  font-size: clamp(2.1rem, 6vw, 3.4rem);
  line-height: 1.05;
  margin: 0 0 10px;
  color: #2a2622;
}
.hero h1 .accent {
  color: #b23a2e;
  font-style: italic;
}
.hero p.lede {
  max-width: 560px;
  margin: 0 auto;
  color: #6b6157;
  font-size: 1.08rem;
}
.search-bar {
  max-width: 560px;
  margin: 26px auto 0;
  position: relative;
}
.search-bar input {
  width: 100%;
  font-family: "Spectral", Georgia, serif;
  font-size: 1.1rem;
  padding: 14px 18px 14px 46px;
  border: 1.5px solid #efe7d6;
  border-radius: 999px;
  background: #fff;
  color: #2a2622;
  box-shadow: 0 2px 8px rgba(58, 46, 40, 0.12);
}
.search-bar input:focus {
  border-color: #4e7c73;
  outline: none;
}
.search-bar .search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #6b6157;
  font-size: 1.1rem;
}
.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 18px auto 6px;
  max-width: 640px;
}
.filter-chip {
  font-family: "Spectral", Georgia, serif;
  font-size: 0.9rem;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1.5px solid #efe7d6;
  background: #fff;
  color: #6b6157;
  cursor: pointer;
  transition: all 0.15s;
}
.filter-chip:hover {
  border-color: #4e7c73;
  color: #3c6259;
}
.filter-chip.active {
  background: #4e7c73;
  border-color: #4e7c73;
  color: #fff;
}
#filter-fav.active {
  background: #c8a24b;
  border-color: #c8a24b;
  color: #3a2e28;
}
.result-count {
  text-align: center;
  color: #6b6157;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  margin: 4px 0 18px;
}
.index {
  list-style: none;
  margin: 0 auto 70px;
  padding: 0;
  max-width: 720px;
}
.index-row {
  border-bottom: 1px solid rgba(180, 150, 100, 0.18);
}
.index-link {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  padding: 11px 6px;
  color: #2a2622;
}
.index-link:hover {
  color: #b23a2e;
  background: rgba(200, 162, 75, 0.06);
}
.index-title {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.1rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.index-star {
  color: #c8a24b;
  margin-left: 6px;
  font-size: 0.8em;
}
.index-leader {
  flex: 1;
  border-bottom: 1.5px dotted rgba(122, 108, 96, 0.45);
  transform: translateY(-4px);
  min-width: 16px;
}
.index-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}
.index-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(0, 0, 0, 0.12);
}
.index-title {
  min-width: 0;
  max-width: 100%;
}
/* estratto del testo quando il canto è stato trovato nello spartito */
.index-snippet {
  flex-basis: 100%;
  font-family: "Spectral", Georgia, serif;
  font-style: italic;
  font-size: 0.9rem;
  color: #6b6157;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.index-snippet mark {
  background: rgba(200, 162, 75, 0.3);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}
.index-empty {
  text-align: center;
  color: #6b6157;
  padding: 40px 0;
  font-style: italic;
  list-style: none;
}
.color-white {
  background: #c9c4b8;
}
.color-lightgray {
  background: #9a948a;
}
.color-sandybrown {
  background: #a9742f;
}
.color-limegreen {
  background: #5a9e4f;
}
.color-cadetblue {
  background: #5f8f96;
}
.content-page {
  max-width: 720px;
  margin: 40px auto 70px;
  padding: 0 20px;
}
.content-page h1 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  color: #2a2622;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  margin: 0 0 6px;
}
.content-page .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: #b23a2e;
  font-weight: 600;
  margin-bottom: 4px;
}
.content-page h2 {
  font-family: "Fraunces", Georgia, serif;
  color: #2a2622;
  margin-top: 32px;
  font-size: 1.4rem;
}
.content-page p,
.content-page li {
  color: #2a2622;
}
.content-page hr {
  border: none;
  border-top: 1px solid #e6d29b;
  margin: 28px 0;
}
.site-footer {
  border-top: 1px solid #e6d29b;
  background: #efe7d6;
  color: #6b6157;
  font-size: 0.85rem;
}
.site-footer-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 22px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 26px;
  align-items: center;
}
.site-footer a {
  color: #3c6259;
}
.site-footer .sep {
  color: #c8a24b;
}
.song-page {
  padding-bottom: 140px;
}
.song-paper {
  max-width: 800px;
  margin: 26px auto;
  background: #fffdf8;
  border: 1px solid #efe7d6;
  border-radius: 10px;
  box-shadow: 0 6px 22px rgba(58, 46, 40, 0.14);
  padding: 30px 34px 44px;
}
.song-head {
  margin-bottom: 18px;
}
.song-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: #6b6157;
  font-weight: 600;
}
.song-title {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  color: #b23a2e;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  line-height: 1.05;
  margin: 2px 0 4px;
}
.song-title::first-letter {
  color: #c8a24b;
  font-size: 1.18em;
  line-height: 1;
}
.song-subtitle {
  color: #8f2c22;
  font-style: italic;
  font-size: 1.05rem;
}
.song-altnotes,
.song-barre {
  color: #6b6157;
  font-size: 0.92rem;
  margin-top: 4px;
}
.song-meta-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 10px;
}
.song-color-badge {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(42, 38, 34, 0.12);
}
.song-color-badge.color-white {
  background: #f5f2ec;
  color: #5a5852;
}
.song-color-badge.color-lightgray {
  background: #eceae4;
  color: #45423e;
}
.song-color-badge.color-sandybrown {
  background: #efe4d3;
  color: #4c3415;
}
.song-color-badge.color-limegreen {
  background: #e1ebd9;
  color: #284723;
}
.song-color-badge.color-cadetblue {
  background: #e2e9e6;
  color: #2a4043;
}
.song-rule {
  border: none;
  border-top: 1px solid #e6d29b;
  margin: 16px 0 22px;
}
#song-sheet {
  font-family: "IBM Plex Mono", "Courier New", monospace;
  font-size: 1.05em;
  line-height: 1.35;
}
.song-block {
  display: grid;
  grid-template-columns: 2.4em 1fr auto;
  gap: 0 0.8em;
  align-items: start;
  margin: 0 0 1.5em;
}
.song-speaker {
  font-weight: 700;
  color: #2a2622;
  padding-top: 1.35em;
  font-size: 0.9em;
}
.song-speaker-line {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}
.song-speaker-plus {
  color: #6b6157;
}
.song-lines-outer {
  min-width: 0;
  overflow-x: auto;
}
.song-lines {
  display: inline-block;
}
.song-line {
  margin-bottom: 0.35em;
}
.song-notes {
  white-space: pre;
  color: #b23a2e;
  font-weight: 700;
  min-height: 1.2em;
}
.song-text {
  white-space: pre;
  color: #2a2622;
}
.song-margin {
  color: #6b6157;
  font-style: italic;
  font-size: 0.85em;
  padding-top: 1.35em;
  white-space: nowrap;
}
.chord {
  cursor: pointer;
  border-radius: 3px;
  padding: 0 1px;
  border-bottom: 1.5px dotted rgba(0, 0, 0, 0);
}
.chord.has-diagram {
  border-bottom-color: rgba(178, 58, 46, 0.5);
}
.chord:hover {
  background: rgba(178, 58, 46, 0.1);
}
.song-ast {
  color: #b23a2e;
  font-weight: 700;
  cursor: pointer;
}
.song-util-message {
  color: #6b6157;
  font-style: italic;
  padding-left: 2.4em;
  margin: 0.6em 0;
}
.song-red-util-message {
  color: #b23a2e;
  font-style: italic;
  padding-left: 2.4em;
  margin: 0.6em 0;
}
.song-asset {
  padding: 0.6em 0;
}
.chord-popover {
  position: absolute;
  z-index: 60;
  background: #fffdf8;
  border: 1px solid #efe7d6;
  border-radius: 10px;
  box-shadow: 0 6px 22px rgba(58, 46, 40, 0.14);
  padding: 12px;
  text-align: center;
  font-family: "Spectral", Georgia, serif;
  animation: pop 0.12s ease-out;
}
@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.chord-popover-name {
  font-family: "IBM Plex Mono", "Courier New", monospace;
  font-weight: 700;
  color: #b23a2e;
  font-size: 1.1rem;
  margin-bottom: 6px;
}
.chord-popover {
  cursor: pointer; /* tap sul popover = chiusura */
}
.chord-popover-count {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.8rem;
  color: #6b6157;
  margin-top: 4px;
}
.chord-popover-nav {
  background: none;
  border: 1px solid #efe7d6;
  border-radius: 999px;
  width: 28px;
  height: 28px;
  font-size: 1.1rem;
  line-height: 1;
  color: #b23a2e;
  cursor: pointer;
}
.chord-popover-nav:hover {
  background: rgba(200, 162, 75, 0.12);
}
.chord-popover-approx {
  font-size: 0.75rem;
  font-style: italic;
  color: #6b6157;
  margin: -4px 0 4px;
}
.chord-popover-empty {
  color: #6b6157;
  font-size: 0.85rem;
  font-style: italic;
}
.ast-popover {
  max-width: 260px;
  font-style: italic;
  color: #2a2622;
  font-size: 0.92rem;
}
.chord-diagram-svg {
  width: 116px;
  height: auto;
}
.chord-diagram-svg .cd-line {
  stroke: #cbb98f;
  stroke-width: 1.3;
}
.chord-diagram-svg .cd-nut {
  stroke: #2a2622;
  stroke-width: 4;
}
.chord-diagram-svg .cd-dot {
  fill: #b23a2e;
}
.chord-diagram-svg .cd-open {
  fill: none;
  stroke: #6b6157;
  stroke-width: 1.5;
}
.chord-diagram-svg .cd-mark {
  fill: #6b6157;
  font:
    13px "Spectral",
    Georgia,
    serif;
}
.chord-diagram-svg .cd-barre {
  fill: #b23a2e;
}
.chord-diagram-svg .cd-fretlabel {
  fill: #6b6157;
  font:
    11px "IBM Plex Mono",
    "Courier New",
    monospace;
}
.song-toolbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 18px;
  z-index: 50;
  display: flex;
  gap: 4px;
  align-items: center;
  background: rgba(58, 46, 40, 0.95);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(200, 162, 75, 0.4);
  border-radius: 999px;
  padding: 6px 8px;
  box-shadow: 0 6px 22px rgba(58, 46, 40, 0.14);
  max-width: calc(100vw - 24px);
  overflow-x: auto;
}
.tool-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #e6d29b;
  font-family: "Spectral", Georgia, serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 6px 9px;
  border-radius: 999px;
  min-width: 44px;
  font-size: 0.65rem;
  letter-spacing: 0.03em;
}
a.tool-btn,
a.tool-btn:hover {
  text-decoration: none;
}
.tool-btn .ico {
  font-size: 1.15rem;
  line-height: 1;
}
.tool-btn:hover {
  background: hsla(0, 0%, 100%, 0.1);
  color: #fff;
}
.tool-btn.active {
  color: #c8a24b;
}
.tool-sep {
  width: 1px;
  align-self: stretch;
  background: hsla(0, 0%, 100%, 0.15);
  margin: 4px 2px;
}
.tool-pair {
  display: flex;
  align-items: center;
}
.tone-indicator {
  color: #e6d29b;
  font-size: 0.62rem;
  min-width: 64px;
  text-align: center;
}
#scroll-control {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-left: 4px;
}
#scroll-control .scroll-speed {
  font-family: "IBM Plex Mono", "Courier New", monospace;
  color: #c8a24b;
  min-width: 16px;
  text-align: center;
  font-size: 0.95rem;
}
#scroll-control.running {
  background: rgba(200, 162, 75, 0.18);
  border-radius: 999px;
}
/* scroll in pausa mentre è aperto un popover */
#scroll-control.running.paused {
  animation: scroll-paused 1.2s ease-in-out infinite;
}
@keyframes scroll-paused {
  50% {
    opacity: 0.45;
  }
}
.video-box {
  max-width: 800px;
  margin: 0 auto 20px;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 6px 22px rgba(58, 46, 40, 0.14);
  position: relative;
  aspect-ratio: 16/9;
  background: #000;
}
.video-box iframe {
  width: 100%;
  height: 100%;
  border: 0;
}
.video-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  cursor: pointer;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 1rem;
}
.tuner-frame {
  width: 100%;
  height: 380px;
  border: 1px solid #efe7d6;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(58, 46, 40, 0.12);
}
.notice {
  background: #efe7d6;
  border-left: 3px solid #c8a24b;
  padding: 12px 16px;
  border-radius: 6px;
  color: #6b6157;
  font-size: 0.92rem;
  margin: 16px 0;
}
.btn {
  display: inline-block;
  font-family: "Spectral", Georgia, serif;
  font-size: 1rem;
  padding: 11px 22px;
  border-radius: 999px;
  cursor: pointer;
  border: 1.5px solid #4e7c73;
  background: #4e7c73;
  color: #fff;
}
.btn:hover {
  background: #3c6259;
  border-color: #3c6259;
  color: #fff;
}
.btn.ghost {
  background: rgba(0, 0, 0, 0);
  color: #3c6259;
}
.btn.ghost:hover {
  background: rgba(78, 124, 115, 0.08);
  color: #3c6259;
}
.notfound {
  text-align: center;
  padding: 80px 20px;
}
.notfound .big {
  font-family: "Fraunces", Georgia, serif;
  font-size: 3rem;
  color: #b23a2e;
}
@media (max-width: 640px) {
  /* Decrease base font size for better fit on mobile */
  body {
    font-size: 16px;
  }

  .song-paper {
    padding: 22px 16px 36px;
    margin: 14px 10px;
    border-radius: 6px;
  }
  .song-block {
    grid-template-columns: 1.8em 1fr;
  }
  .song-margin {
    grid-column: 2;
    padding-top: 0;
  }
  .site-nav a {
    padding: 6px 8px;
    font-size: 0.85rem;
  }
  .brand small {
    display: none;
  }

  /* Reduce the spacing in the header to give the nav more room */
  .site-header-inner {
    gap: 10px;
  }

  /* Shrink the specific monospace font of the lyrics and chords by 30% */
  .song-sheet-wrap {
    font-size: 0.735em;
  }
}
@media (prefers-reduced-motion: reduce) {
  .chord-popover {
    animation: none;
  }
}
