/* Dictionary of Hymnology — shared list & detail styles */

.dict-page {
  --dict-ink: #0f172a;
  --dict-muted: #64748b;
  --dict-border: #e2e8f0;
  --dict-surface: #ffffff;
  --dict-soft: #f8fafc;
  --dict-accent: #1d4ed8;
  --dict-accent-soft: #eef2ff;
}

/* ── List page ── */
.dict-hero {
  position: relative;
  border-radius: 20px;
  padding: 2.25rem 2rem;
  margin-bottom: 2rem;
  color: #f8fafc;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(96,165,250,0.28), transparent 55%),
    radial-gradient(circle at bottom right, rgba(99,102,241,0.22), transparent 55%),
    linear-gradient(135deg, #020617 0%, #0f172a 48%, #111827 100%);
  box-shadow: 0 22px 60px rgba(15,23,42,0.22);
}
.dict-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top, rgba(248,250,252,0.08), transparent 62%);
  pointer-events: none;
}
.dict-hero-inner { position: relative; z-index: 1; }
.dict-hero h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2rem, 3.2vw, 2.75rem);
  margin-bottom: 0.5rem;
}
.dict-hero-lead {
  color: rgba(226,232,240,0.9);
  max-width: 640px;
  margin-bottom: 1.25rem;
}
.dict-search-wrap { max-width: 560px; }
.dict-search-wrap .form-control {
  border: 0;
  border-radius: 12px 0 0 12px;
  min-height: 52px;
}
.dict-search-wrap .btn {
  border-radius: 0 12px 12px 0;
  min-height: 52px;
  padding-inline: 1.1rem;
}

.dict-spotlight-section {
  margin-bottom: 2rem;
}
.dict-spotlight-heading {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dict-muted);
  margin-bottom: 0.85rem;
}
.dict-spotlight-list {
  display: grid;
  gap: 0.15rem;
}
.dict-spotlight-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--dict-border);
  text-decoration: none;
  color: inherit;
  transition: color 0.15s ease, padding-left 0.15s ease;
}
.dict-spotlight-item:hover {
  color: var(--dict-accent);
  padding-left: 0.2rem;
}
.dict-spotlight-item:last-child {
  border-bottom: 0;
}
.dict-spotlight-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--dict-ink);
}
.dict-spotlight-item:hover .dict-spotlight-title {
  color: var(--dict-accent);
}
.dict-spotlight-item .dict-entry-meta {
  flex: 0 0 auto;
  white-space: nowrap;
}
@media (max-width: 575.98px) {
  .dict-spotlight-item {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.15rem;
  }
}
.dict-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}
/* List page: sidebar left, entries right */
.dict-layout-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}
@media (min-width: 992px) {
  .dict-layout-list { grid-template-columns: 280px minmax(0, 1fr); }
}
/* Detail page: article left (wide), sidebar right */
.dict-layout-detail {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: start;
}
@media (min-width: 992px) {
  .dict-layout-detail { grid-template-columns: minmax(0, 1fr) 300px; }
}
.dict-layout-detail > article,
.dict-layout-list > .dict-main-panel {
  min-width: 0;
}
.dict-main-panel {
  border: 1px solid var(--dict-border);
  border-radius: 18px;
  background: var(--dict-surface);
  padding: 1.25rem;
  box-shadow: 0 8px 24px rgba(15,23,42,0.05);
}
.dict-sort-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--dict-border);
}
.dict-sort-bar .btn.active {
  background: var(--dict-accent);
  color: #fff;
  border-color: var(--dict-accent);
}
.dict-entry-row {
  display: block;
  border-radius: 14px;
  border: 1px solid #edf2f7;
  padding: 1rem 1.15rem;
  margin-bottom: 0.75rem;
  background: var(--dict-soft);
  text-decoration: none;
  color: inherit;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.dict-entry-row:hover {
  background: #fff;
  box-shadow: 0 8px 22px rgba(15,23,42,0.07);
  transform: translateY(-1px);
  color: inherit;
}
.dict-entry-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.18rem;
  font-weight: 700;
  color: var(--dict-ink);
}
.dict-category-badge {
  font-size: 0.72rem;
  border-radius: 999px;
  padding: 0.22rem 0.6rem;
  background: var(--dict-accent-soft);
  color: #3730a3;
  font-weight: 600;
}
.dict-entry-meta {
  font-size: 0.82rem;
  color: var(--dict-muted);
}

/* ── Detail page ── */
.dict-detail-header {
  margin-bottom: 1.25rem;
}
.dict-detail-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2rem, 3.2vw, 2.65rem);
  color: var(--dict-ink);
  margin-bottom: 0.75rem;
  line-height: 1.15;
}
.dict-stats-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
}
.dict-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--dict-border);
  background: var(--dict-soft);
  font-size: 0.86rem;
  color: #475569;
}
.dict-content-panel {
  border: 1px solid var(--dict-border);
  border-radius: 18px;
  background: #fff;
  padding: 1.35rem;
  margin-bottom: 2rem;
  box-shadow: 0 10px 28px rgba(15,23,42,0.05);
}
.dict-feature-carousel {
  position: relative;
}
.dict-feature-stage {
  position: relative;
  min-height: 220px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--dict-border);
  background: var(--dict-soft);
  box-shadow: 0 12px 30px rgba(15,23,42,0.08);
}
.dict-feature-slide {
  display: none;
  margin: 0;
}
.dict-feature-slide.is-active {
  display: block;
}
.dict-feature-slide img {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  background: #fff;
}
.dict-feature-link {
  display: block;
}
.dict-feature-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--dict-border);
  background: #fff;
  font-size: 0.92rem;
}
.dict-feature-kind {
  color: #64748b;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.dict-feature-title {
  color: var(--dict-accent, #1d4ed8);
  font-weight: 600;
  text-decoration: none;
}
.dict-feature-title:hover {
  text-decoration: underline;
}
.dict-feature-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--dict-border);
  background: rgba(255,255,255,0.95);
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(15,23,42,0.08);
  transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}
.dict-feature-prev { left: 0.75rem; }
.dict-feature-next { right: 0.75rem; }
.dict-feature-nav:hover:not(:disabled) {
  background: var(--dict-accent, #1d4ed8);
  color: #fff;
}
.dict-feature-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.dict-feature-counter {
  position: absolute;
  right: 0.85rem;
  bottom: 4.25rem;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: rgba(15,23,42,0.72);
  color: #fff;
  font-size: 0.78rem;
  pointer-events: none;
  z-index: 2;
}
@media (max-width: 575.98px) {
  .dict-feature-prev { left: 0.5rem; }
  .dict-feature-next { right: 0.5rem; }
  .dict-feature-counter {
    bottom: 4rem;
    right: 0.75rem;
  }
}
.dict-body {
  font-size: 1.08rem;
  line-height: 1.9;
  color: #334155;
  text-align: left;
  min-width: 0;
  overflow-wrap: anywhere;
  word-wrap: break-word;
}
.dict-body p { margin-bottom: 1rem; max-width: none; }
.dict-body h2, .dict-body h3, .dict-body h4 {
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--dict-ink);
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  max-width: none;
}
.dict-body ul, .dict-body ol { padding-left: 1.25rem; max-width: none; }
.dict-body img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}
/* Override CKEditor inline widths/floats that squeeze text */
.dict-body > div,
.dict-body > p,
.dict-body table,
.dict-body figure {
  max-width: 100% !important;
  width: auto !important;
  float: none !important;
}
.dict-body table { display: block; overflow-x: auto; }
.dict-ad-slot {
  border-radius: 14px;
  overflow: hidden;
  margin: 1.5rem 0;
  min-height: 90px;
}
.dict-section-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.35rem;
  color: var(--dict-ink);
  margin-bottom: 0.35rem;
}
.dict-section-lead {
  color: var(--dict-muted);
  font-size: 0.92rem;
  margin-bottom: 1rem;
}

/* Sheet carousel — 3 visible at a time; user scrolls through all */
.dict-sheet-carousel {
  position: relative;
  padding: 0 2.75rem;
}
.dict-sheet-track {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  padding: 0.35rem 0.2rem 1rem;
}
.dict-sheet-track::-webkit-scrollbar {
  height: 6px;
}
.dict-sheet-track::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}
.dict-sheet-card {
  /* Exactly 3 cards visible in the viewport; extra cards scroll into view */
  flex: 0 0 calc((100% - 2rem) / 3);
  width: calc((100% - 2rem) / 3);
  min-width: calc((100% - 2rem) / 3);
  max-width: calc((100% - 2rem) / 3);
  scroll-snap-align: start;
}
@media (max-width: 991.98px) {
  .dict-sheet-card {
    flex: 0 0 calc((100% - 1rem) / 2);
    width: calc((100% - 1rem) / 2);
    min-width: calc((100% - 1rem) / 2);
    max-width: calc((100% - 1rem) / 2);
  }
}
@media (max-width: 575.98px) {
  .dict-sheet-card {
    flex: 0 0 82%;
    width: 82%;
    min-width: 82%;
    max-width: 82%;
  }
}
.dict-sheet-nav:disabled {
  opacity: 0.35;
  cursor: default;
}
.dict-sheet-status {
  font-size: 0.82rem;
  color: var(--dict-muted);
  text-align: center;
  margin-top: 0.25rem;
}
.dict-sheet-preview {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: #fff;
  color: inherit;
  text-align: left;
  box-shadow: 0 8px 24px rgba(15,23,42,0.1);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.dict-sheet-preview:hover,
.dict-sheet-preview:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 14px 34px rgba(15,23,42,0.16);
}
.dict-related-thumb {
  overflow: hidden;
  aspect-ratio: 3/4;
  background: #f1f5f9;
}
.dict-related-thumb img { width: 100%; height: 100%; object-fit: cover; }
.dict-sheet-caption { min-height: 72px; padding: 0.75rem 0.85rem; }
.dict-sheet-nav {
  position: absolute;
  top: 42%;
  z-index: 2;
  width: 2.35rem;
  height: 2.35rem;
  border: 0;
  border-radius: 50%;
  background: #0f172a;
  color: #fff;
  box-shadow: 0 5px 16px rgba(15,23,42,0.24);
}
.dict-sheet-nav:hover { background: var(--dict-accent); }
.dict-sheet-prev { left: 0; }
.dict-sheet-next { right: 0; }

.dict-author-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem;
  border-radius: 14px;
  border: 1px solid var(--dict-border);
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s ease;
  height: 100%;
}
.dict-author-card:hover {
  box-shadow: 0 8px 22px rgba(15,23,42,0.08);
  color: inherit;
}
.dict-author-thumb {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  overflow: hidden;
  background: #e2e8f0;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #64748b;
}
.dict-author-thumb img { width: 100%; height: 100%; object-fit: cover; }

.dict-sheet-modal .modal-content {
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  background: #101827;
  color: #fff;
}
.dict-sheet-modal .modal-header,
.dict-sheet-modal .modal-footer { border-color: rgba(255,255,255,0.12); }
.dict-sheet-modal-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 55vh;
  padding: 1rem 3.5rem;
  background: radial-gradient(circle at center, #334155 0%, #0f172a 72%);
}
.dict-sheet-modal-image {
  display: block;
  max-width: 100%;
  max-height: 72vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(0,0,0,0.45);
}
.dict-sheet-modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 50%;
  background: rgba(15,23,42,0.78);
  color: #fff;
}
.dict-sheet-modal-prev { left: 0.75rem; }
.dict-sheet-modal-next { right: 0.75rem; }

.hymnology-sidebar .card {
  border-radius: 14px;
  border-color: var(--dict-border);
}
.hymnology-sidebar .card-header {
  background: linear-gradient(180deg, #fff 0%, var(--dict-soft) 100%);
}

@media (max-width: 575.98px) {
  .dict-sheet-carousel { padding: 0 2.25rem; }
  .dict-sheet-modal-stage { min-height: 45vh; padding: 0.75rem 2.75rem; }
  .dict-content-panel { padding: 1rem; }
}
