/* =============================================================
   Web-only additions layered on top of the print songbook CSS.
   Kept minimal so the page still reads as the printed defter.
   ============================================================= */

html { scroll-behavior: smooth; }

/* Anchored songs shouldn't hide under the top edge when jumped to. */
.sheet[id] { scroll-margin-top: 24px; }

/* ---- Table-of-contents links ------------------------------- */
.toc a {
  display: flex;
  align-items: baseline;
  gap: 12px;
  width: 100%;
  text-decoration: none;
  color: inherit;
  transition: opacity .18s ease;
}
.toc li { padding: 0; }                 /* let the <a> own the padding */
.toc a { padding: 9px 2px; }
.toc a:hover { opacity: .62; }
.toc a:hover .tt { color: var(--sage-deep); }
.toc a:focus-visible {
  outline: 2px solid var(--sage);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ---- Back-to-top ------------------------------------------- */
.toplink {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--cream);
  color: var(--sage-deep);
  border: 1px solid var(--line);
  box-shadow: 0 6px 18px rgba(74, 68, 60, 0.12);
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
  z-index: 10;
}
/* Reveal the button once the page has scrolled a little. */
body.scrolled .toplink { opacity: .9; pointer-events: auto; }
.toplink:hover { opacity: 1; }

/* On small screens keep it modest. */
@media (max-width: 720px) {
  .toplink { right: 14px; bottom: 14px; width: 38px; height: 38px; }
}

/* Respect reduced-motion preferences. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .toplink, .toc a { transition: none; }
}

/* ---- Şarkı Defteri per-song pages: topbar + prev/next ------ */
.topbar { display: flex; align-items: center; justify-content: flex-start;
  max-width: var(--sheet-max); margin: 0 auto; padding: 22px 28px 0; }
.topbar .home { font-family: var(--font-script); font-size: 22px; color: var(--ink); text-decoration: none; }
.topbar .home:hover { color: var(--gold); }
.pn { max-width: var(--sheet-max); margin: 6px auto 46px; display: flex; align-items: baseline;
  gap: 14px; padding: 0 28px; font-family: var(--font-sans); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.pn .pn-prev { flex: 1; text-align: left; }
.pn .pn-next { flex: 1; text-align: right; }
.pn .pn-toc { flex: 0 0 auto; text-align: center; color: var(--sage-deep); }
.pn .pn-toc:hover { color: var(--gold); }
.pn a { color: var(--ink-soft); text-decoration: none; }
.pn a:hover { color: var(--gold); }
@media (max-width: 600px) { .topbar, .pn { padding-left: 18px; padding-right: 18px; } }

/* Daisy pages: never scroll sideways; keep the parchment filling the viewport */
html { background: var(--cream); }
html, body { max-width: 100%; overflow-x: hidden; }
img, svg { max-width: 100%; height: auto; }
.stanza, .song-title, .toc .tt, .credit { overflow-wrap: break-word; }
