/* ═══════════════════════════════════════════════
   Primi a deporre (#K1) — first-finders board
   Reuses the registro.css base; overrides for the
   picker, per-clue board, and own-entry highlight.
   ═══════════════════════════════════════════════ */

.primi-page {
  background: #2a1f12;
  color: rgba(225, 218, 200, 0.85);
  font-family: 'EB Garamond', Georgia, serif;
  min-height: 100vh;
}

.primi-main {
  max-width: 880px;
  margin: 0 auto;
  padding: 4rem 1.5rem 6rem;
}

.primi-hero {
  text-align: center;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid rgba(180, 140, 60, 0.25);
  margin-bottom: 2.5rem;
}

.primi-stamp {
  width: 56px;
  height: 56px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #d4a64c 0%, #6a4a14 90%);
  box-shadow: 0 0 0 2px rgba(180, 140, 60, 0.35),
              0 4px 18px rgba(0, 0, 0, 0.45);
}

.primi-title {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.625rem, 3.6vw, 2.25rem);
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #f0e4cc;
  margin: 0 0 0.75rem;
}

.primi-subtitle {
  font-style: italic;
  color: rgba(225, 218, 200, 0.82);
  max-width: 540px;
  margin: 0 auto;
  font-size: 1.0625rem;
  line-height: 1.6;
}

/* ── Layout (#285) ──
   Two columns inside the panel: accordion picker on the left,
   board on the right. The picker is sticky-ish (sticks below the
   sidebar offset) so as the visitor opens different source
   accordions the active board stays alongside. On narrow viewports
   the layout collapses to stacked. */
.primi-layout {
  display: grid;
  grid-template-columns: minmax(0, 300px) 1fr;
  gap: 2.5rem;
  align-items: start;
}

@media (max-width: 900px) {
  .primi-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* ── Picker ── */
.primi-picker {
  margin-bottom: 0;
}

.primi-picker-intro {
  font-style: italic;
  color: rgba(225, 218, 200, 0.85);
  margin: 0 0 1rem;
  font-size: 1rem;
}

.primi-picker-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* ── Accordion group (<details>) ── */
.primi-picker-group {
  border: 1px solid rgba(180, 140, 60, 0.22);
  border-radius: 3px;
  background: rgba(246, 239, 224, 0.03);
  overflow: hidden;
}

.primi-picker-group[open] {
  border-color: rgba(180, 140, 60, 0.4);
  background: rgba(246, 239, 224, 0.05);
}

/* The <summary> is the click target for expand/collapse. Native
   <details> handles keyboard (Enter/Space) and announces state to
   screen readers. */
.primi-picker-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(220, 190, 130, 0.95);
  padding: 1rem 1.1rem;
  cursor: pointer;
  list-style: none; /* hide the default disclosure triangle on most browsers */
  user-select: none;
  transition: background 0.18s ease, color 0.18s ease;
  min-height: 44px; /* touch-target floor */
}

/* Remove default disclosure triangle in WebKit (Safari/Chrome). */
.primi-picker-section::-webkit-details-marker { display: none; }

/* Custom chevron drawn with CSS — rotates 90° when the group opens.
   Color matches the gold accent the rest of the page uses. */
.primi-picker-section::before {
  content: '';
  flex: 0 0 auto;
  width: 0.65rem;
  height: 0.65rem;
  border-right: 2px solid rgba(220, 190, 130, 0.7);
  border-bottom: 2px solid rgba(220, 190, 130, 0.7);
  transform: rotate(-45deg);
  transition: transform 0.18s ease;
  margin-right: 0.25rem;
}

.primi-picker-group[open] .primi-picker-section::before {
  transform: rotate(45deg);
}

.primi-picker-section:hover,
.primi-picker-section:focus-visible {
  background: rgba(180, 140, 60, 0.1);
  color: #f6efe0;
  outline: none;
}

.primi-picker-section:focus-visible {
  outline: 2px solid rgba(220, 190, 130, 0.85);
  outline-offset: -2px;
}

.primi-picker-section-label {
  flex: 1 1 auto;
  min-width: 0;
}

.primi-picker-section-count {
  font-family: 'EB Garamond', serif;
  font-size: 0.875rem;
  font-style: italic;
  letter-spacing: 0.04em;
  text-transform: none;
  color: rgba(225, 218, 200, 0.72);
}

/* The clue buttons inside the open group. */
.primi-picker-clues {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.5rem 0.5rem 0.75rem;
  border-top: 1px solid rgba(180, 140, 60, 0.18);
}

.primi-picker-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  text-align: left;
  padding: 0.75rem 0.9rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 2px;
  color: rgba(225, 218, 200, 0.92);
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
  min-height: 44px; /* touch-target floor */
  width: 100%;
}

.primi-picker-btn-label {
  font-family: 'EB Garamond', serif;
  font-size: 1rem;
  line-height: 1.35;
  color: rgba(240, 228, 204, 0.95);
}

.primi-picker-btn-id {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: rgba(225, 218, 200, 0.55);
}

.primi-picker-btn:hover,
.primi-picker-btn:focus-visible {
  background: rgba(180, 140, 60, 0.1);
  border-color: rgba(180, 140, 60, 0.45);
}

.primi-picker-btn:focus-visible {
  outline: 2px solid rgba(220, 190, 130, 0.85);
  outline-offset: 2px;
}

.primi-picker-btn.is-active {
  background: rgba(180, 140, 60, 0.18);
  border-color: rgba(220, 190, 130, 0.7);
}

.primi-picker-btn.is-active .primi-picker-btn-label {
  color: #f6efe0;
}

.primi-picker-btn.is-active .primi-picker-btn-id {
  color: rgba(225, 218, 200, 0.78);
}

/* ── Board wrap (right column) ── */
.primi-board-wrap {
  min-width: 0; /* lets the inner table/list shrink cleanly */
}

.primi-board-placeholder {
  margin: 0;
  padding: 2.5rem 1.5rem;
  text-align: center;
  font-style: italic;
  font-size: 1.0625rem;
  color: rgba(225, 218, 200, 0.78);
  border: 1px dashed rgba(180, 140, 60, 0.3);
  border-radius: 3px;
  background: rgba(246, 239, 224, 0.03);
}

/* ── Board ── */
.primi-board {
  margin-top: 0;
}

.primi-board-head {
  text-align: center;
  margin-bottom: 1.5rem;
}

.primi-board-eyebrow {
  font-family: 'Cinzel', serif;
  font-size: 0.875rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(220, 190, 130, 0.88);
}

.primi-board-title {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 1.25rem;
  color: #f0e4cc;
  margin: 0.5rem 0 0.25rem;
  letter-spacing: 0.04em;
}

.primi-board-source {
  margin: 0;
  font-style: italic;
  color: rgba(225, 218, 200, 0.85);
  font-size: 1rem;
}

.primi-board-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.primi-entry {
  display: grid;
  grid-template-columns: 2.5rem 1fr auto;
  gap: 0.5rem 1rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(180, 140, 60, 0.12);
  align-items: baseline;
}

.primi-entry-pos {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  color: rgba(220, 190, 130, 0.9);
  letter-spacing: 0.06em;
}

.primi-entry-who {
  font-size: 1.125rem;
}

.primi-entry-rank {
  font-family: 'Cinzel', serif;
  font-size: 0.875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(220, 190, 130, 0.92);
  margin-right: 0.5rem;
}

.primi-entry-nomen {
  font-style: italic;
  color: rgba(240, 228, 204, 0.95);
}

.primi-entry-diocese {
  color: rgba(225, 218, 200, 0.85);
  font-size: 1rem;
}

.primi-entry-diocese::before {
  content: ' \00B7 ';
  margin: 0 0.4rem;
  color: rgba(180, 140, 60, 0.4);
}

.primi-entry-when {
  font-family: 'Cinzel', serif;
  font-size: 0.875rem;
  letter-spacing: 0.1em;
  color: rgba(225, 218, 200, 0.82);
  white-space: nowrap;
}

.primi-entry.is-mine {
  border: 1px solid rgba(220, 190, 130, 0.7);
  background: rgba(180, 140, 60, 0.08);
  border-radius: 2px;
  margin: 0.25rem 0;
  box-shadow: 0 0 0 1px rgba(220, 190, 130, 0.15);
}

.primi-entry.is-empty {
  grid-template-columns: 2.5rem 1fr;
  color: rgba(225, 218, 200, 0.25);
  font-style: italic;
}

.primi-board-empty {
  padding: 2rem 0;
  text-align: center;
  font-style: italic;
  font-size: 1rem;
  color: rgba(225, 218, 200, 0.75);
}

.primi-board-position {
  margin-top: 1.25rem;
  text-align: center;
  padding: 0.875rem 1.125rem;
  border: 1px dashed rgba(180, 140, 60, 0.35);
  background: rgba(255, 250, 240, 0.04);
  font-family: 'EB Garamond', serif;
  font-style: italic;
  color: rgba(220, 190, 130, 0.95);
  font-size: 1.0625rem;
}

.primi-legend {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(180, 140, 60, 0.2);
  text-align: center;
  font-size: 1rem;
  font-style: italic;
  color: rgba(225, 218, 200, 0.85);
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.65;
}

@media (prefers-reduced-motion: reduce) {
  .primi-picker-btn,
  .primi-entry {
    transition: none;
  }
}
