/* ============================================================
   Directory page
   ============================================================ */

.page-head { padding-block: var(--space-section) var(--space-6); }
.eyebrow {
  text-transform: uppercase; letter-spacing: var(--tracking-caps);
  font-size: var(--text-xs); color: var(--color-gold-deep); margin: 0 0 var(--space-2);
  font-weight: 700;
}
.page-head h1 { font-size: var(--text-xl); margin: 0 0 var(--space-3); }
.page-head__lead { color: var(--color-text-muted); margin: 0; }

/* --- Filters (search toolbar) --------------------------------- */
.filters {
  display: flex; flex-wrap: wrap; gap: var(--space-4) var(--space-6); align-items: end;
  padding: var(--space-4) var(--space-6);
  background: linear-gradient(var(--color-surface-2), var(--color-surface-2)) padding-box,
              linear-gradient(120deg, var(--color-gold-soft), var(--color-surface-line)) border-box;
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  margin-bottom: var(--space-8);
  position: sticky; top: var(--space-2); z-index: 5;
}
.filters__field { display: flex; flex-direction: column; gap: var(--space-2); flex: 0 1 260px; }
.filters__field--grow { flex: 1 1 300px; }
.filters__label {
  font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--color-gold-deep); font-weight: 700;
}

/* Shared control shell */
.control { position: relative; display: flex; align-items: center; }
.control input, .control select {
  font: inherit; width: 100%; color: var(--color-text);
  background: #fff; border: 1.5px solid var(--color-surface-line);
  border-radius: 999px; padding: 0.7rem 1rem; line-height: 1.2;
  transition: border-color var(--duration-fast) var(--ease-standard),
              box-shadow var(--duration-fast) var(--ease-standard);
  appearance: none; -webkit-appearance: none;
}
.control input::placeholder { color: #9aa0ad; }
.control input:hover, .control select:hover { border-color: var(--color-gold-soft); }
.control input:focus-visible, .control select:focus-visible {
  outline: none; border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(201, 162, 74, 0.22);
}
/* search icon sits inside the pill */
.control--search input { padding-left: 2.75rem; }
.control__icon {
  position: absolute; left: 1rem; width: 18px; height: 18px;
  color: var(--color-gold-deep); pointer-events: none;
}
/* clear the native search "x" so our pill stays clean */
.control input[type="search"]::-webkit-search-decoration,
.control input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
/* custom select chevron */
.control--select select { padding-right: 2.75rem; cursor: pointer; }
.control__chevron {
  position: absolute; right: 1rem; width: 18px; height: 18px;
  color: var(--color-gold-deep); pointer-events: none;
}

.filters__count {
  margin: 0 0 0 auto; align-self: center;
  font-size: var(--text-sm); font-weight: 600; color: var(--color-navy);
  background: var(--color-surface); border: 1px solid var(--color-surface-line);
  padding: 0.4rem 0.9rem; border-radius: 999px; white-space: nowrap;
}

@media (max-width: 560px) {
  .filters { padding: var(--space-4); }
  .filters__field { flex-basis: 100%; }
  .filters__count { margin: 0; align-self: stretch; text-align: center; }
}

/* --- List ----------------------------------------------------- */
.marhoom-list { list-style: none; margin: 0 0 var(--space-section); padding: 0; display: grid; gap: var(--space-3); }

.marhoom {
  background: var(--color-surface-2);
  border: 1px solid var(--color-surface-line);
  border-left: 4px solid var(--color-gold);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow var(--duration-fast) var(--ease-standard);
}
.marhoom:hover { box-shadow: var(--shadow-card); }

.marhoom summary {
  display: flex; justify-content: space-between; align-items: center; gap: var(--space-4);
  padding: var(--space-4); cursor: pointer; list-style: none;
}
.marhoom summary::-webkit-details-marker { display: none; }
.marhoom summary::after {
  content: "＋"; color: var(--color-gold-deep); font-size: 1.2rem; flex: 0 0 auto;
  transition: transform var(--duration-fast) var(--ease-standard);
}
.marhoom details[open] summary::after { content: "－"; }

.marhoom__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.marhoom__name { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 600; }
.marhoom__honorific { color: var(--color-gold-deep); font-style: italic; }
.marhoom__relation { font-size: var(--text-sm); color: var(--color-text-muted); }
.marhoom__meta { text-align: right; flex: 0 0 auto; min-width: 200px; display: flex; flex-direction: column; gap: 2px; }
.marhoom__date { font-size: var(--text-sm); font-weight: 600; }
.marhoom__grave { font-size: var(--text-xs); color: var(--color-text-muted); }

.detail { padding: 0 var(--space-4) var(--space-4); border-top: 1px dashed var(--color-surface-line); }
.detail__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--space-4); margin: var(--space-4) 0; }
.detail__grid .detail__full { grid-column: 1 / -1; }
.detail__grid dt { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.08em; color: var(--color-text-muted); margin-bottom: 2px; }
.detail__grid dd { margin: 0; }
.muted { color: var(--color-text-muted); font-size: 0.9em; }

.badge {
  display: inline-block; font-size: 0.7rem; padding: 1px 8px; border-radius: 999px;
  vertical-align: middle;
}
.badge--verify { background: #fbf1d6; color: #8a6b1f; border: 1px solid #e7d19a; }

.detail__maplink {
  display: inline-block; font-weight: 600; color: var(--color-navy);
  text-decoration: none; border-bottom: 2px solid var(--color-gold-soft); padding-bottom: 1px;
}
.detail__maplink:hover { border-color: var(--color-gold); }

.empty { text-align: center; color: var(--color-text-muted); padding: var(--space-8); }

@media (max-width: 520px) {
  .marhoom summary { flex-direction: column; align-items: flex-start; }
  .marhoom__meta { text-align: left; }
}
