/* ═══════════════════════════════════════════════
   Registri della Causa (#168) — consolidated tabs
   chrome over /registro/, /primi-a-deporre/, and
   /passaggi-notati-da-pochi/. Each tab panel
   inherits the existing per-page CSS files; this
   file only owns the page wrapper and the tab
   navigation.
   ═══════════════════════════════════════════════ */

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

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

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

.registri-stamp {
  display: block;
  width: 56px;
  height: 56px;
  margin: 0 auto 1.25rem;
  color: rgba(220, 190, 130, 0.85);
}

.registri-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;
}

.registri-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 (#284): sidebar tabs + content column ── */
.registri-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 3rem;
  align-items: start;
}

/* ── Sidebar tabs ── */
.registri-tabs {
  display: flex;
  flex-direction: column;
  gap: 0;
  /* Sticky so the active tab is always reachable while the visitor
     reads a long panel. 80px clears the back-bar — same convention
     as the Ettore timeline-progress. */
  position: sticky;
  top: 80px;
  border-right: 1px solid rgba(180, 140, 60, 0.25);
  padding-right: 0;
}

.registri-tab {
  display: block;
  text-align: left;
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  line-height: 1.4;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(225, 218, 200, 0.82);
  background: none;
  border: 0;
  /* Active marker on the right edge so it joins the sidebar's
     vertical rule rather than competing with it. */
  border-right: 2px solid transparent;
  margin-right: -1px;
  padding: 1.1rem 1.25rem;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  /* 44×44 touch-target floor — line-height 1.4 × 16 + padding 17.6 × 2 ≈ 57px. */
}

.registri-tab:hover,
.registri-tab:focus-visible {
  color: rgba(240, 228, 204, 0.95);
  background: rgba(180, 140, 60, 0.08);
}

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

.registri-tab.is-active,
.registri-tab[aria-selected='true'] {
  color: #f0e4cc;
  border-right-color: rgba(220, 190, 130, 0.85);
  background: rgba(180, 140, 60, 0.06);
}

/* ── Content column ── */
.registri-content {
  min-width: 0; /* lets the inner tables/lists shrink correctly */
}

/* ── Panels ── */
.registri-panel[hidden] {
  display: none;
}

.registri-panel {
  /* Each panel relies on its respective per-page CSS for inner styles.
     The wrapper just provides the layout slot. */
}

/* ── Narrow viewports: stack the sidebar above the content as a
   horizontal strip so the layout remains usable on tablets/phones.
   The desktop sticky behaviour is dropped here — at this width the
   strip itself stays at the top of the document flow. ── */
@media (max-width: 768px) {
  .registri-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .registri-tabs {
    flex-direction: row;
    flex-wrap: wrap;
    position: static;
    border-right: 0;
    border-bottom: 1px solid rgba(180, 140, 60, 0.25);
    padding-right: 0;
  }
  .registri-tab {
    flex: 1 1 auto;
    text-align: center;
    border-right: 0;
    margin-right: 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
  }
  .registri-tab.is-active,
  .registri-tab[aria-selected='true'] {
    border-right-color: transparent;
    border-bottom-color: rgba(220, 190, 130, 0.85);
  }
}

/* The legend lines come from the existing registro/primi/passaggi
   stylesheets but their max-width centring assumes no extra
   container; we want them centred under the panel, so re-affirm. */
.registri-panel .registro-legend,
.registri-panel .primi-legend,
.registri-panel .passaggi-legend {
  margin-left: auto;
  margin-right: auto;
}

/* The hero of each sub-page is suppressed since the registri-hero
   already provides the page title. The existing per-page CSS files
   anchor by .registro-hero / .primi-hero / .passaggi-hero — we don't
   render those wrappers in /registri/, so nothing to suppress. */

@media (prefers-reduced-motion: reduce) {
  .registri-tab {
    transition: none;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}
