/* ==========================================================================
   Category and all-hadiths pages
   ========================================================================== */

.cat-hero { min-height: 330px; }
.cat-hero .page-hero__inner { padding-bottom: 178px; }

.cat-main { position: relative; z-index: 2; margin-top: -142px; padding-bottom: clamp(36px, 6vw, 70px); }

.cat-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  align-items: start;
  gap: 20px;
  padding: clamp(12px, 2vw, 20px);
  border: 1px solid var(--green-150);
  border-radius: 38px;
  background: var(--surface);
  box-shadow: 0 24px 60px -36px rgba(61, 78, 36, .38);
}
.cat-layout--single { grid-template-columns: minmax(0, 1fr); }
.cat-content { min-width: 0; }

.cat-filter {
  flex: 1 1 240px;
  width: min(100%, 340px);
  max-width: 340px;
  min-height: 44px;
  border-color: var(--green-150);
  background: var(--surface);
}
.cat-filter svg { width: 16px; height: 16px; }
.cat-filter input { height: 40px; font-size: 13px; }

/* Hadith rows inside one bordered list */
.hadith-list {
  margin: 0;
  padding: 0;
  overflow: hidden;
  list-style: none;
  border: 1px solid var(--line-150);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 12px 32px -24px rgba(78, 99, 48, .25);
}
.hadith-row { position: relative; padding: clamp(16px, 2.4vw, 23px); transition: background-color .2s ease; }
.hadith-row:hover { background: var(--green-25); }
.hadith-row + .hadith-row { border-top: 1px solid var(--line-150); }
/* The open "more languages" popover must not be clipped by the next row */
.hadith-row:has(.lang-more[open]) { z-index: 2; }
.hadith-list:has(.lang-more[open]) { overflow: visible; }

.hadith-row__text {
  display: block;
  color: var(--ink-900);
  font-size: clamp(15px, 1.5vw, 17px);
  font-weight: 600;
  line-height: 2;
}
.lang-ar .hadith-row__text { font-family: var(--font-display); }
.hadith-row__text:hover { color: var(--green-800); }
.hadith-row__number { color: var(--green-600); }

.hadith-row__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 11px;
}
.hadith-row__langs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.hadith-row__langs > svg { width: 15px; height: 15px; margin-inline: 2px; color: var(--green-600); }
.hadith-row .lang-chip {
  min-height: 27px;
  padding: 3px 9px;
  border-color: var(--green-150);
  background: var(--surface);
  color: var(--ink-500);
  font-size: 11px;
  font-weight: 600;
}
.hadith-row .lang-chip:hover,
.hadith-row .lang-chip[aria-current="true"] { background: var(--green-50); color: var(--green-800); }

.hadith-row__actions { display: flex; flex: 0 0 auto; align-items: center; gap: 6px; }
.row-btn {
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--green-150);
  border-radius: 10px;
  background: var(--green-25);
  color: var(--green-800);
  cursor: pointer;
}
.row-btn svg { width: 14px; height: 14px; }
.row-btn--share svg { fill: none; stroke-width: 2; }
.row-btn:hover,
.row-btn:focus-visible { border-color: var(--green-800); background: var(--green-800); color: #FFFFFF; }

.cat-empty { padding: 36px 16px; color: var(--ink-300); font-size: 14px; text-align: center; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .cat-hero .page-hero__emblem { display: none; }
  .cat-layout { grid-template-columns: minmax(0, 1fr); border-radius: 28px; }
  .cat-content .list-panel { padding: 14px; border-radius: 22px; }
}

@media (max-width: 559px) {
  .cat-hero { min-height: 275px; }
  .cat-hero .page-hero__inner { padding-top: 14px; padding-bottom: 130px; }
  .cat-hero .page-hero__title { font-size: clamp(27px, 9vw, 38px); }
  .cat-main { margin-top: -104px; padding-inline: 10px; }
  .cat-layout { gap: 14px; padding: 9px; border-radius: 22px; }
  .list-panel__head { align-items: stretch; }
  .list-panel__title { width: 100%; padding-inline: 4px; }
  .cat-filter { width: 100%; max-width: none; }
  .hadith-row { padding: 15px 13px; }
  .hadith-row__text { font-size: 15px; }
  .hadith-row__footer { align-items: flex-end; }
  .hadith-row__langs { flex: 1 1 220px; }
}
