/**
 * Scheda titolo (lettore) — layout /record.
 * Solo superficie OPAC: niente link staff (Koha SSO, SBN, JSON debug).
 */
.dl-scheda-page {
  --scheda-max: 68rem;
  --scheda-cover-w: 11.5rem;
  flex: 1;
  background:
    radial-gradient(ellipse 80% 50% at 10% 0%, rgba(230, 236, 250, 0.9), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 20%, rgba(234, 217, 182, 0.35), transparent 50%),
    linear-gradient(180deg, #f7f5f0 0%, #fff 42%, #f4f6fb 100%);
}

.dl-scheda {
  max-width: var(--scheda-max);
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3.5rem;
  animation: scheda-in 0.45s ease-out both;
}

@keyframes scheda-in {
  from {
    opacity: 0;
    transform: translateY(0.6rem);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.dl-scheda-empty {
  max-width: 28rem;
  margin: 3rem auto;
  padding: 1.5rem 0;
  text-align: center;
  color: var(--dl-muted);
  line-height: 1.5;
}

.dl-scheda-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 1.35rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--scrinio-blue);
  text-decoration: none;
}

.dl-scheda-back:hover {
  text-decoration: underline;
}

.dl-scheda-layout {
  display: grid;
  grid-template-columns: var(--scheda-cover-w) minmax(0, 1fr);
  gap: 1.75rem 2.25rem;
  align-items: start;
}

.dl-scheda-cover {
  position: relative;
  margin: 0;
  width: var(--scheda-cover-w);
  aspect-ratio: 2 / 3;
  border-radius: 6px;
  overflow: hidden;
  background: linear-gradient(160deg, var(--scrinio-blue-deep), var(--scrinio-blue) 55%, #3a5a9a);
  box-shadow: 0 12px 28px rgba(8, 38, 79, 0.22);
}

.dl-scheda-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dl-scheda-cover-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.dl-scheda-cover-fallback img {
  width: 58%;
  height: auto;
  object-fit: contain;
  opacity: 0.92;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.35));
}

.dl-scheda-cover.is-loaded .dl-scheda-cover-fallback {
  display: none;
}

.dl-scheda-main {
  min-width: 0;
}

.dl-scheda-kicker {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--scrinio-brown);
}

.dl-scheda-title {
  margin: 0 0 0.4rem;
  font-family: var(--dl-font-display);
  font-size: clamp(1.55rem, 3.2vw, 2.15rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--scrinio-blue-deep);
}

.dl-scheda-author {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  color: var(--dl-muted);
  line-height: 1.4;
}

.dl-scheda-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.65rem;
  margin: 0 0 1.35rem;
  padding: 0;
  list-style: none;
}

.dl-scheda-meta li {
  font-size: 0.82rem;
  color: var(--dl-muted);
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: rgba(12, 53, 114, 0.06);
  border: 1px solid rgba(12, 53, 114, 0.08);
}

.dl-scheda-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 0 0 1.5rem;
}

.dl-scheda-btn {
  appearance: none;
  border: 0;
  border-radius: var(--dl-radius);
  padding: 0.7rem 1.35rem;
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: filter 0.15s, transform 0.15s, background 0.15s;
}

.dl-scheda-btn:hover:not(:disabled) {
  filter: brightness(1.05);
}

.dl-scheda-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.dl-scheda-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.dl-scheda-btn--primary {
  background: var(--scrinio-blue);
  color: #fff;
}

.dl-scheda-btn--secondary {
  background: transparent;
  color: var(--scrinio-blue);
  border: 1.5px solid rgba(12, 53, 114, 0.28);
}

.dl-scheda-btn--secondary:hover:not(:disabled) {
  background: rgba(12, 53, 114, 0.05);
}

.dl-scheda-panel {
  margin: 0 0 1.15rem;
  padding: 1.15rem 1.2rem 1.25rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(12, 53, 114, 0.1);
  box-shadow: 0 4px 18px rgba(8, 38, 79, 0.05);
}

.dl-scheda-panel h2 {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--scrinio-blue-deep);
  letter-spacing: 0.01em;
}

.dl-scheda-avail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.85rem;
  margin: 0 0 0.75rem;
}

.dl-scheda-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.dl-scheda-pill--ok {
  background: #e7f5ec;
  color: #1a6b3c;
}

.dl-scheda-pill--no {
  background: #f8ecec;
  color: #8a3030;
}

.dl-scheda-pill--wait {
  background: #f3efe4;
  color: #6b5420;
}

.dl-scheda-avail-text {
  margin: 0;
  font-size: 0.9rem;
  color: var(--dl-muted);
}

.dl-scheda-holdings {
  margin: 0;
  padding: 0;
  list-style: none;
}

.dl-scheda-holdings li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  padding: 0.55rem 0;
  border-top: 1px solid rgba(12, 53, 114, 0.08);
  font-size: 0.9rem;
}

.dl-scheda-holdings li:first-child {
  border-top: 0;
  padding-top: 0.15rem;
}

.dl-scheda-holdings .loc {
  color: var(--dl-ink);
  font-weight: 600;
}

.dl-scheda-holdings .call {
  color: var(--dl-muted);
  font-size: 0.82rem;
}

.dl-scheda-holdings .st {
  font-size: 0.78rem;
  font-weight: 700;
  color: #1a6b3c;
}

.dl-scheda-holdings .st.is-out {
  color: #8a3030;
}

.dl-hold-msg {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
}

.dl-hold-msg--ok {
  color: #1a6b3c;
}

.dl-hold-msg--err {
  color: #a33;
}

/* Modale prenotazione — overlay a tutta pagina */
body.dl-modal-open {
  overflow: hidden;
}

/* Sopra header/footer chrome (z-index fino a ~2000); montata su body. */
.dl-hold-modal {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: 1rem;
  pointer-events: auto;
}

.dl-hold-modal[hidden] {
  display: none !important;
}

.dl-hold-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 38, 79, 0.55);
  backdrop-filter: blur(2px);
}

.dl-hold-modal-card {
  position: relative;
  z-index: 1;
  width: min(100%, 26rem);
  padding: 1.35rem 1.35rem 1.25rem;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 20px 48px rgba(8, 38, 79, 0.28);
  animation: scheda-modal-in 0.22s ease-out;
}

.dl-hold-modal-body {
  margin-top: 0.15rem;
}

@keyframes scheda-modal-in {
  from {
    opacity: 0;
    transform: translateY(0.5rem) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.dl-hold-modal-x {
  position: absolute;
  top: 0.55rem;
  right: 0.65rem;
  border: 0;
  background: transparent;
  font-size: 1.45rem;
  line-height: 1;
  color: var(--dl-muted);
  cursor: pointer;
  padding: 0.25rem 0.4rem;
}

.dl-hold-modal-x:hover {
  color: var(--scrinio-blue-deep);
}

.dl-hold-modal-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--scrinio-brown);
}

.dl-hold-modal-card h2 {
  margin: 0 0 0.25rem;
  font-size: 1.2rem;
  color: var(--scrinio-blue-deep);
  padding-right: 1.5rem;
}

.dl-hold-modal-sub {
  margin: 0 0 1rem;
  font-size: 0.92rem;
  color: var(--dl-muted);
  line-height: 1.4;
}

.dl-hold-modal .lead {
  margin: 0 0 0.85rem;
  font-size: 0.9rem;
  color: var(--dl-muted);
  line-height: 1.45;
}

.dl-reg-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0;
}

.dl-reg-field {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  margin: 0;
}

.dl-reg-form label {
  display: block;
  margin: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--dl-ink);
}

.dl-reg-form input {
  display: block;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  padding: 0.55rem 0.7rem;
  border: 1px solid #c9c4bc;
  border-radius: var(--dl-radius);
  font: inherit;
  background: #fff;
  order: unset;
}

.dl-reg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.dl-reg-form button[type="submit"] {
  border: 0;
  border-radius: var(--dl-radius);
  padding: 0.55rem 1rem;
  background: var(--scrinio-blue);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.dl-reg-cancel {
  border: 1px solid #c9c4bc;
  border-radius: var(--dl-radius);
  padding: 0.55rem 1rem;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.dl-reg-msg {
  margin-top: 0.75rem;
  padding: 0.65rem 0.8rem;
  border-radius: var(--dl-radius);
  font-size: 0.88rem;
}

.dl-reg-msg.err {
  background: #f8ecec;
  border-left: 3px solid #a33;
}

.dl-reg-msg.ok {
  background: #eef6ee;
  border-left: 3px solid #2a7;
}

.dl-reg-foot {
  margin: 0.85rem 0 0;
  font-size: 0.88rem;
}

.dl-scheda-cite {
  margin: 1.25rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(12, 53, 114, 0.1);
  font-size: 0.82rem;
  color: var(--dl-muted);
}

.dl-scheda-cite a {
  color: var(--scrinio-blue);
  text-decoration: none;
  font-weight: 600;
}

.dl-scheda-cite a:hover {
  text-decoration: underline;
}

@media (max-width: 720px) {
  .dl-scheda-layout {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .dl-scheda-main {
    width: 100%;
  }

  .dl-scheda-meta,
  .dl-scheda-actions,
  .dl-scheda-avail {
    justify-content: center;
  }

  .dl-scheda-holdings li {
    justify-content: center;
    text-align: center;
  }

  .dl-reg-form input {
    max-width: none;
  }
}
