/* Hadith and matn corpus (M20). Design tokens from maqraa.css; logical properties only. */
.hadith-text {
  font-family: var(--font-display); font-size: clamp(1.15rem, 2.2vw, 1.35rem); line-height: 2.15;
  white-space: pre-line; text-align: start; margin-block-end: .75rem;
}
.hadith-detail .hadith-text { font-size: clamp(1.25rem, 2.6vw, 1.5rem); }
/* Long English book titles, the checksum and source URLs must wrap instead of widening the page (375px).
   The details grid gets a shrinkable value column; on phones the labels stack above the values. */
.hadith-detail { overflow-wrap: anywhere; }
.hadith-detail dd, .hadith-detail code, .hadith-detail .citation a { overflow-wrap: anywhere; word-break: break-word; min-inline-size: 0; }
.hadith-detail .kv { grid-template-columns: max-content minmax(0, 1fr); }
@media (max-width: 640px) {
  .hadith-detail .kv { grid-template-columns: minmax(0, 1fr); gap: .1rem; }
  .hadith-detail .kv dd { margin-block-end: .45rem; }
}
.hadith-card .card-header h3 { font-size: 1.05rem; }
.gradings { border-inline-start: 3px solid var(--accent); padding-inline-start: .8rem; margin-block: .5rem; }
.grading-list { list-style: none; padding: 0; margin: .3rem 0; display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: .9rem; }
.grading-list .grader { color: var(--text-muted); }
.edition-card h3 { font-size: 1.05rem; }
.edition-card .kv.stacked { grid-template-columns: minmax(0, 1fr); gap: .1rem; }
.edition-card .kv.stacked dd { margin-block-end: .45rem; }
.edition-card dd { overflow-wrap: anywhere; font-weight: 500; }

/* matn reader: verse (nazm) shows the two hemistichs side by side, prose flows */
.matn { font-family: var(--font-display); }
.matn-section {
  text-align: center; font-size: 1.15rem; color: var(--gold-700); margin-block: 1.5rem .7rem;
  padding-block: .3rem; border-block: 1px solid var(--gold-300);
}
.matn-section:first-child { margin-block-start: 0; }
.matn-line { display: grid; grid-template-columns: 2.6rem 1fr; gap: .1rem 1.5rem; align-items: baseline;
  padding: .15rem .4rem; border-radius: 8px; transition: background .15s; }
.matn-line.bayt { grid-template-columns: 2.6rem 1fr 1fr; }
.matn-line .hemistich { text-align: center; }
.matn-line:not(.bayt) .hemistich { text-align: justify; }
.matn-no {
  justify-self: center; font-family: var(--font-ui); font-size: .78rem; color: var(--text-muted);
  min-inline-size: 2rem; text-align: center; border: 1px solid var(--border); border-radius: 999px; line-height: 1.6;
}
.matn-line:target, .matn-line.pointer { background: color-mix(in srgb, var(--gold-300) 40%, transparent); }
.matn-line .w { border-radius: 4px; }
@media (max-width: 640px) {
  .matn-line.bayt { grid-template-columns: 2.2rem 1fr; }
  .matn-line.bayt .hemistich { text-align: start; }
  .matn-line.bayt .hemistich + .hemistich { grid-column: 2; padding-inline-start: 1.5rem; }
}
.matn-result { font-family: var(--font-display); font-size: 1.2rem; line-height: 2; margin-block-end: .2rem; }
mark.hit { background: color-mix(in srgb, var(--gold-300) 75%, transparent); color: inherit; border-radius: 4px; padding-inline: .1em; }
:root[data-theme="dark"] .matn-section { color: var(--gold-300); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .matn-section { color: var(--gold-300); } }
