/* ═══════════════════════════════════════════════════════════
   Regia Vniversalis Academia — The Midnight Loggia
   Atlas Universalis — Global University Directory
   Aesthetic: Midnight Navy + Antique Gold, echoing the seal
   Fonts: Cinzel (classical caps) + EB Garamond (body italic)
   Palette anchored to the RUA seal:
     - Shield family: #0A1230 (navy base), #08091f (darkest)
     - Gold: #d5a865 (antique), #7b5a31 (shadow), #E8C55A (hover)
     - Parchment body: #EAE4D3
   ═══════════════════════════════════════════════════════════ */

/* ── DESIGN TOKENS ─────────────────────────────────────── */
:root {
  /* Midnight navy — seal shield family */
  --navy:         #0A1230;
  --navy-deep:    #08091f;
  --navy-mid:     #111830;
  --navy-rim:     #1a2545;
  --navy-surface: #0f1a38;
  --navy-card:    #13203e;
  --navy-hover:   #182a52;

  /* Antique gold — seal rim family */
  --gold:         #d5a865;
  --gold-bright:  #E8C55A;
  --gold-dim:     #a07a3e;
  --gold-shadow:  #7b5a31;
  --gold-glow:    rgba(213,168,101,.13);
  --gold-ring:    rgba(213,168,101,.30);
  --gold-veil:    rgba(213,168,101,.07);

  /* Parchment text — warm ivory against midnight */
  --parchment:    #EAE4D3;
  --parchment-dim:#c8c0a8;
  --parchment-faint: rgba(234,228,211,.40);

  /* Page */
  --page-bg:      var(--navy);
  --page-bg-alt:  var(--navy-deep);

  /* Status */
  --alive-bg:     rgba(16,185,129,.12);
  --alive-text:   #6ee7b7;
  --dead-bg:      rgba(239,68,68,.1);
  --dead-text:    #fca5a5;

  /* Layout */
  --max:          1240px;
  --gutter:       clamp(1rem, 4vw, 2.5rem);
  --r-sm:         4px;
  --r-md:         8px;
  --r-lg:         14px;
  --r-xl:         28px;

  /* Type scale */
  --t-xs:    0.70rem;
  --t-sm:    0.83rem;
  --t-base:  1rem;
  --t-lg:    1.125rem;
  --t-xl:    1.35rem;
  --t-2xl:   1.7rem;
  --t-3xl:   2.2rem;
  --t-4xl:   clamp(2.2rem, 4.5vw, 3.2rem);
  --t-hero:  clamp(2.6rem, 6vw, 4.4rem);

  /* Motion */
  --ease-spring: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast:    160ms;
  --dur-base:    280ms;
  --dur-slow:    500ms;
}

/* ── RESET ─────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'EB Garamond', Georgia, serif;
  background: var(--page-bg);
  color: var(--parchment);
  line-height: 1.7;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ── TYPOGRAPHY BASE ───────────────────────────────────── */
h1, h2, h3, h4, h5 {
  font-family: 'Cinzel', 'EB Garamond', serif;
  color: var(--parchment);
  line-height: 1.18;
  letter-spacing: 0.02em;
  font-weight: 600;
}

h1 { font-size: var(--t-4xl); font-weight: 700; margin-bottom: 0.5rem; }
h2 { font-size: var(--t-2xl); font-weight: 600; margin: 2.5rem 0 1rem; }
h3 { font-size: var(--t-xl);  font-weight: 600; margin: 1.5rem 0 0.5rem; }
h4 { font-size: var(--t-lg);  font-weight: 600; }

p { margin-bottom: 0.85rem; max-width: 68ch; color: var(--parchment-dim); }
a { color: var(--gold); text-underline-offset: 3px; transition: color var(--dur-fast) var(--ease-out); }
a:hover { color: var(--gold-bright); }

/* ── GREEK-KEY MEANDER ORNAMENT ───────────────────────── */
/* Echoes the seal's rim — used as structural dividers */
.meander-divider {
  width: 100%;
  height: 12px;
  background-image:
    repeating-linear-gradient(
      90deg,
      var(--gold-shadow) 0px, var(--gold-shadow) 2px,
      transparent 2px, transparent 10px,
      var(--gold-shadow) 10px, var(--gold-shadow) 12px
    ),
    repeating-linear-gradient(
      0deg,
      var(--gold-shadow) 0px, var(--gold-shadow) 2px,
      transparent 2px, transparent 10px,
      var(--gold-shadow) 10px, var(--gold-shadow) 12px
    );
  opacity: 0.35;
  margin: 0;
}

/* ── SITE HEADER ───────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 9, 31, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(213,168,101,.14);
  height: 68px;
  display: flex;
  align-items: center;
}

/* Faint meander line at header bottom */
.site-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: repeating-linear-gradient(
    90deg,
    var(--gold-shadow) 0px, var(--gold-shadow) 4px,
    transparent 4px, transparent 12px,
    var(--gold-shadow) 12px, var(--gold-shadow) 16px,
    transparent 16px, transparent 24px
  );
  opacity: 0.22;
}

.site-header .inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Logo */
.site-logo {
  font-family: 'Cinzel', serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--parchment);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
  letter-spacing: 0.05em;
  transition: opacity var(--dur-fast) var(--ease-out);
}
.site-logo:hover { color: var(--parchment); opacity: 0.82; }

.logo-seal {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--gold-ring);
  flex-shrink: 0;
  object-fit: cover;
  filter: drop-shadow(0 0 6px rgba(213,168,101,.18));
}

.logo-name {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}
.logo-primary {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.08em;
  color: var(--gold);
}
.logo-sub {
  font-family: 'EB Garamond', serif;
  font-size: 0.62rem;
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.06em;
  color: var(--parchment-faint);
  margin-top: 1px;
  text-transform: none;
}

/* Header search */
.header-search {
  flex: 1;
  max-width: 440px;
  margin-left: auto;
  display: flex;
  gap: 0;
  background: rgba(213,168,101,.05);
  border: 1px solid rgba(213,168,101,.18);
  border-radius: var(--r-xl);
  overflow: hidden;
  transition: border-color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
}
.header-search:focus-within {
  border-color: var(--gold-ring);
  background: rgba(213,168,101,.09);
}

.header-search input {
  flex: 1;
  padding: 0.5rem 1rem;
  background: transparent;
  border: none;
  color: var(--parchment);
  font-size: var(--t-sm);
  font-family: 'EB Garamond', serif;
  font-style: italic;
  min-width: 0;
}
.header-search input::placeholder { color: var(--parchment-faint); }
.header-search input:focus { outline: none; }

.header-search button {
  padding: 0.5rem 1.1rem;
  background: var(--gold-shadow);
  color: var(--parchment);
  border: none;
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--dur-fast) var(--ease-out);
}
.header-search button:hover { background: var(--gold-dim); }
.header-search button:active { transform: scale(0.98); }

/* ── MAIN CONTENT ──────────────────────────────────────── */
main {
  flex: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: 3rem var(--gutter) 5rem;
  width: 100%;
}

/* ── FOOTER ────────────────────────────────────────────── */
.site-footer {
  background: var(--navy-deep);
  color: var(--parchment-faint);
  padding: 3rem var(--gutter) 2.5rem;
  border-top: 1px solid rgba(213,168,101,.12);
  position: relative;
}

/* Faint meander at footer top */
.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: repeating-linear-gradient(
    90deg,
    var(--gold-shadow) 0px, var(--gold-shadow) 4px,
    transparent 4px, transparent 12px,
    var(--gold-shadow) 12px, var(--gold-shadow) 16px,
    transparent 16px, transparent 24px
  );
  opacity: 0.28;
}

.site-footer .footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-seal-block {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.footer-seal {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(213,168,101,.22);
  filter: drop-shadow(0 0 8px rgba(213,168,101,.12));
  flex-shrink: 0;
  object-fit: cover;
}

.footer-brand-block {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.footer-brand {
  font-family: 'Cinzel', serif;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--gold);
}

.footer-lore {
  font-family: 'EB Garamond', serif;
  font-size: 0.78rem;
  font-style: italic;
  color: var(--parchment-faint);
  line-height: 1.5;
}

.site-footer .footer-links {
  display: flex;
  gap: 1.75rem;
  font-family: 'Cinzel', serif;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding-top: 0.25rem;
}
.site-footer a { color: var(--parchment-faint); text-decoration: none; }
.site-footer a:hover { color: var(--gold); }

.site-footer .footer-sources {
  font-size: 0.72rem;
  font-family: 'EB Garamond', serif;
  font-style: italic;
  letter-spacing: 0.01em;
  width: 100%;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(213,168,101,.08);
  margin-top: 0.5rem;
  color: rgba(234,228,211,.25);
}

/* ── HERO (home page) ──────────────────────────────────── */
.hero {
  background: var(--navy-surface);
  border: 1px solid rgba(213,168,101,.18);
  border-radius: var(--r-lg);
  padding: clamp(3rem, 7vw, 5.5rem) clamp(2rem, 5vw, 4.5rem);
  margin-bottom: 4rem;
  position: relative;
  overflow: hidden;
  /* Double-bezel outer shell feel */
  box-shadow:
    0 0 0 1px rgba(213,168,101,.06) inset,
    0 1px 2px rgba(213,168,101,.08) inset,
    0 32px 80px rgba(8,9,31,.6);
}

/* Constellation dot-field — subtle star pattern */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(213,168,101,.25) 1px, transparent 1px);
  background-size: 52px 52px;
  opacity: 0.18;
  pointer-events: none;
}

/* Gold veil glow at upper-right */
.hero::after {
  content: '';
  position: absolute;
  right: -60px;
  top: -60px;
  width: 440px;
  height: 440px;
  background: radial-gradient(circle, rgba(213,168,101,.08) 0%, transparent 68%);
  pointer-events: none;
}

/* Meander border at hero top */
.hero-meander-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: repeating-linear-gradient(
    90deg,
    var(--gold-shadow) 0px, var(--gold-shadow) 6px,
    transparent 6px, transparent 14px,
    var(--gold-shadow) 14px, var(--gold-shadow) 20px,
    transparent 20px, transparent 28px
  );
  opacity: 0.48;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3rem;
  align-items: center;
  position: relative;
}

.hero-content {
  max-width: 680px;
}

.hero-seal-display {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hero-seal-img {
  width: clamp(140px, 18vw, 220px);
  height: clamp(140px, 18vw, 220px);
  border-radius: 50%;
  object-fit: cover;
  /* Antique gold glow ring echoing seal rim */
  box-shadow:
    0 0 0 2px rgba(213,168,101,.20),
    0 0 0 8px rgba(213,168,101,.06),
    0 0 40px rgba(213,168,101,.12),
    0 0 80px rgba(213,168,101,.06);
  animation: seal-pulse 6s ease-in-out infinite;
}

@keyframes seal-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(213,168,101,.20), 0 0 0 8px rgba(213,168,101,.06), 0 0 40px rgba(213,168,101,.12), 0 0 80px rgba(213,168,101,.06); }
  50% { box-shadow: 0 0 0 2px rgba(213,168,101,.30), 0 0 0 12px rgba(213,168,101,.08), 0 0 60px rgba(213,168,101,.16), 0 0 100px rgba(213,168,101,.08); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-seal-img { animation: none; }
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: 'Cinzel', serif;
  font-size: 0.63rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 1.5rem;
}

/* Small meander ornament as eyebrow prefix */
.hero-eyebrow::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 8px;
  background-image: repeating-linear-gradient(
    90deg,
    var(--gold-shadow) 0px, var(--gold-shadow) 2px,
    transparent 2px, transparent 6px,
    var(--gold-shadow) 6px, var(--gold-shadow) 8px
  );
  opacity: 0.7;
  flex-shrink: 0;
}

.hero h1 {
  color: var(--parchment);
  font-family: 'Cinzel', serif;
  font-size: var(--t-hero);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.08;
  margin-bottom: 0.85rem;
  position: relative;
}

.hero h1 .accent-word {
  color: var(--gold);
}

.hero .lore-line {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  color: var(--gold-dim);
  margin-bottom: 0.6rem;
  line-height: 1.5;
  letter-spacing: 0.01em;
}

.hero .tagline {
  color: var(--parchment-dim);
  font-family: 'EB Garamond', serif;
  font-size: clamp(0.98rem, 2vw, 1.13rem);
  font-weight: 400;
  max-width: 56ch;
  line-height: 1.65;
  margin-bottom: 2.5rem;
  position: relative;
}

/* ── STAT BAND ─────────────────────────────────────────── */
.stats-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid rgba(213,168,101,.16);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 2.5rem;
  position: relative;
  background: rgba(213,168,101,.03);
}

.stat-cell {
  padding: 1.1rem 1.4rem;
  border-right: 1px solid rgba(213,168,101,.1);
  transition: background var(--dur-base) var(--ease-out);
}
.stat-cell:last-child { border-right: none; }
.stat-cell:hover { background: rgba(213,168,101,.06); }

.stat-cell .num {
  display: block;
  font-family: 'Cinzel', serif;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 0.3rem;
}
.stat-cell .lbl {
  font-family: 'EB Garamond', serif;
  font-size: var(--t-xs);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0.03em;
  color: var(--parchment-faint);
}

/* ── HERO SEARCH ───────────────────────────────────────── */
.hero-search {
  display: flex;
  gap: 0;
  /* Outer bezel */
  background: rgba(213,168,101,.04);
  border: 1px solid rgba(213,168,101,.22);
  border-radius: var(--r-xl);
  overflow: hidden;
  max-width: 600px;
  position: relative;
  box-shadow: 0 1px 0 rgba(213,168,101,.06) inset;
  transition: border-color var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
}
.hero-search:focus-within {
  border-color: var(--gold-ring);
  box-shadow: 0 0 0 3px rgba(213,168,101,.08), 0 1px 0 rgba(213,168,101,.08) inset;
}

.hero-search input {
  flex: 1;
  padding: 0.9rem 1.4rem;
  background: transparent;
  border: none;
  color: var(--parchment);
  font-size: 1rem;
  font-family: 'EB Garamond', serif;
  font-style: italic;
  min-width: 0;
}
.hero-search input::placeholder { color: var(--parchment-faint); }
.hero-search input:focus { outline: none; }

.hero-search button {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.8rem 1.6rem;
  background: var(--gold-shadow);
  color: var(--parchment);
  border: none;
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
  white-space: nowrap;
}
.hero-search button:hover { background: var(--gold-dim); }
.hero-search button:active { transform: scale(0.98); }

/* ── BROWSE SECTION ────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.section-title {
  font-family: 'Cinzel', serif;
  font-size: var(--t-2xl);
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--parchment);
}
.section-count {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: var(--t-sm);
  color: var(--parchment-faint);
  font-weight: 400;
}

/* ── CONTINENT GRID ────────────────────────────────────── */
.continent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-bottom: 3rem;
}

.continent-card {
  background: var(--navy-card);
  border: 1px solid rgba(213,168,101,.14);
  border-radius: var(--r-lg);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transition:
    border-color var(--dur-base) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-out);
}

/* Inner highlight — machined feel */
.continent-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(213,168,101,.10);
  pointer-events: none;
}

.continent-card:hover {
  border-color: rgba(213,168,101,.30);
  box-shadow: 0 6px 28px rgba(213,168,101,.08), 0 1px 4px rgba(0,0,0,.3);
  transform: translateY(-2px);
}

.continent-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.continent-card h3 {
  font-family: 'Cinzel', serif;
  font-size: var(--t-lg);
  font-weight: 600;
  letter-spacing: 0.04em;
  margin: 0;
  color: var(--parchment);
}
.continent-card .cnt {
  font-family: 'Cinzel', serif;
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-dim);
  background: rgba(213,168,101,.08);
  border: 1px solid rgba(213,168,101,.16);
  padding: 0.18rem 0.6rem;
  border-radius: 20px;
}

.country-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.chip {
  display: inline-block;
  background: rgba(213,168,101,.06);
  border: 1px solid rgba(213,168,101,.14);
  border-radius: 20px;
  padding: 0.2rem 0.7rem;
  font-family: 'EB Garamond', serif;
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--parchment-dim);
  text-decoration: none;
  transition:
    background var(--dur-fast) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out);
}
.chip:hover {
  background: rgba(213,168,101,.12);
  border-color: var(--gold-ring);
  color: var(--parchment);
}
.chip strong {
  color: var(--gold-dim);
  font-weight: 600;
  margin-left: 0.25rem;
  font-size: 0.82rem;
}
.chip-more {
  background: transparent;
  color: var(--parchment-faint);
  border-color: rgba(213,168,101,.08);
}

/* ── BREADCRUMBS ───────────────────────────────────────── */
.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-family: 'EB Garamond', serif;
  font-size: var(--t-sm);
  font-style: italic;
  color: var(--parchment-faint);
  margin-bottom: 2rem;
}
.breadcrumbs a {
  color: var(--parchment-faint);
  text-decoration: none;
  font-weight: 400;
  transition: color var(--dur-fast) var(--ease-out);
}
.breadcrumbs a:hover { color: var(--gold); }
.breadcrumbs .sep {
  color: rgba(213,168,101,.25);
  font-size: 0.75rem;
  font-style: normal;
}
.breadcrumbs .current {
  color: var(--parchment-dim);
  font-weight: 500;
}

/* ── PAGE TITLE BLOCK ──────────────────────────────────── */
.page-title-block {
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(213,168,101,.12);
}
.page-title-block h1 {
  margin-bottom: 0.3rem;
}
.page-subtitle {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: var(--t-lg);
  color: var(--gold-dim);
  font-weight: 400;
  margin-bottom: 0;
}

/* ── INFO DOSSIER (university page) ───────────────────── */
.dossier {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 0;
  border: 1px solid rgba(213,168,101,.16);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 2.5rem;
  background: var(--navy-card);
  box-shadow: inset 0 1px 0 rgba(213,168,101,.08);
}

.dossier-row {
  display: contents;
}

.dossier-label {
  background: rgba(213,168,101,.06);
  padding: 0.75rem 1.25rem;
  font-family: 'Cinzel', serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-dim);
  border-bottom: 1px solid rgba(213,168,101,.08);
  display: flex;
  align-items: center;
}
.dossier-label:last-of-type { border-bottom: none; }

.dossier-value {
  padding: 0.75rem 1.25rem;
  font-family: 'EB Garamond', serif;
  font-size: var(--t-base);
  color: var(--parchment-dim);
  border-bottom: 1px solid rgba(213,168,101,.08);
  border-left: 1px solid rgba(213,168,101,.08);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  word-break: break-all;
}
.dossier-value:last-child { border-bottom: none; }
.dossier-value a { color: var(--gold); font-weight: 500; word-break: break-all; }
.dossier-value a:hover { color: var(--gold-bright); }

/* ── STATUS BADGES ─────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.65rem;
  border-radius: 20px;
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
}
.badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}
.badge-alive  { background: var(--alive-bg);  color: var(--alive-text); border: 1px solid rgba(110,231,183,.2); }
.badge-alive::before  { background: var(--alive-text); }
.badge-dead   { background: var(--dead-bg);   color: var(--dead-text); border: 1px solid rgba(252,165,165,.2); }
.badge-dead::before   { background: var(--dead-text); }
.badge-unknown {
  background: rgba(213,168,101,.06);
  color: var(--parchment-faint);
  border: 1px solid rgba(213,168,101,.12);
}
.badge-unknown::before { background: var(--parchment-faint); }
.badge-level {
  background: rgba(213,168,101,.10);
  color: var(--gold-dim);
  border: 1px solid rgba(213,168,101,.20);
}
.badge-level::before { display: none; }

.check-note {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: var(--t-xs);
  color: var(--parchment-faint);
}

/* ── PROGRAMS TABLE ────────────────────────────────────── */
.programs-section { margin-bottom: 2.5rem; }

.programs-section h2 {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.programs-count {
  font-family: 'EB Garamond', serif;
  font-size: var(--t-sm);
  font-weight: 400;
  font-style: italic;
  color: var(--parchment-faint);
  letter-spacing: 0;
}

.table-scroll {
  overflow-x: auto;
  border-radius: var(--r-lg);
  border: 1px solid rgba(213,168,101,.14);
}

.programs-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'EB Garamond', serif;
  font-size: var(--t-sm);
  background: var(--navy-card);
}
.programs-table thead th {
  background: rgba(213,168,101,.08);
  color: var(--gold-dim);
  padding: 0.65rem 1rem;
  text-align: left;
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  white-space: nowrap;
  border-bottom: 1px solid rgba(213,168,101,.14);
}

.programs-table tbody tr {
  border-bottom: 1px solid rgba(213,168,101,.07);
  transition: background var(--dur-fast) var(--ease-out);
}
.programs-table tbody tr:last-child { border-bottom: none; }
.programs-table tbody tr:hover { background: rgba(213,168,101,.04); }

.programs-table tbody td {
  padding: 0.6rem 1rem;
  color: var(--parchment-dim);
  vertical-align: middle;
}
.programs-table tbody td a { color: var(--gold); font-weight: 500; }
.programs-table tbody td a:hover { color: var(--gold-bright); }

/* ── COUNTRY PAGE — institutions list ──────────────────── */
.city-section { margin-bottom: 2.5rem; }

.city-label {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.9rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(213,168,101,.14);
}
.city-label h3 {
  font-family: 'Cinzel', serif;
  font-size: var(--t-xl);
  font-weight: 600;
  letter-spacing: 0.03em;
  margin: 0;
}
.city-label h3 a { text-decoration: none; color: var(--parchment); }
.city-label h3 a:hover { color: var(--gold); }
.city-label .cnt {
  font-family: 'Cinzel', serif;
  font-size: var(--t-xs);
  color: var(--parchment-faint);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(213,168,101,.06);
  border: 1px solid rgba(213,168,101,.12);
  padding: 0.18rem 0.6rem;
  border-radius: 20px;
}

.inst-list { list-style: none; }

.inst-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(213,168,101,.07);
  transition: background var(--dur-fast) var(--ease-out);
}
.inst-item:last-child { border-bottom: none; }

.inst-item a {
  font-family: 'EB Garamond', serif;
  font-weight: 500;
  font-size: var(--t-base);
  text-decoration: none;
  color: var(--parchment-dim);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color var(--dur-fast) var(--ease-out);
}
.inst-item a:hover { color: var(--gold); }
.inst-item .meta {
  font-family: 'EB Garamond', serif;
  font-size: var(--t-xs);
  font-style: italic;
  color: var(--parchment-faint);
  font-weight: 400;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── SEARCH PAGE ───────────────────────────────────────── */
.search-form {
  display: flex;
  gap: 0;
  background: var(--navy-card);
  border: 1px solid rgba(213,168,101,.22);
  border-radius: var(--r-xl);
  overflow: hidden;
  max-width: 580px;
  margin-bottom: 2.5rem;
  box-shadow: inset 0 1px 0 rgba(213,168,101,.06);
  transition: border-color var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
}
.search-form:focus-within {
  border-color: var(--gold-ring);
  box-shadow: 0 0 0 3px rgba(213,168,101,.07), inset 0 1px 0 rgba(213,168,101,.08);
}

.search-form input {
  flex: 1;
  padding: 0.85rem 1.25rem;
  background: transparent;
  border: none;
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 1.05rem;
  color: var(--parchment);
  min-width: 0;
}
.search-form input::placeholder { color: var(--parchment-faint); }
.search-form input:focus { outline: none; }

.search-form button {
  padding: 0.75rem 1.5rem;
  background: var(--gold-shadow);
  color: var(--parchment);
  border: none;
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--dur-fast) var(--ease-out);
}
.search-form button:hover { background: var(--gold-dim); }
.search-form button:active { transform: scale(0.98); }

.results-count {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: var(--t-sm);
  color: var(--parchment-faint);
  margin-bottom: 1.25rem;
  font-weight: 400;
}
.results-count strong {
  color: var(--gold);
  font-weight: 600;
  font-style: normal;
}

.result-list { list-style: none; }
.result-item {
  padding: 1rem 0;
  border-bottom: 1px solid rgba(213,168,101,.08);
  transition: background var(--dur-fast) var(--ease-out);
}
.result-item:last-child { border-bottom: none; }

.result-item a {
  font-family: 'Cinzel', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--parchment);
  text-decoration: none;
  letter-spacing: 0.02em;
  display: block;
  margin-bottom: 0.2rem;
  transition: color var(--dur-fast) var(--ease-out);
}
.result-item a:hover { color: var(--gold); }
.result-meta {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: var(--t-sm);
  color: var(--parchment-faint);
}

/* ── COUNTRY PROFILE — meta table ──────────────────────── */
.country-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0;
  border: 1px solid rgba(213,168,101,.14);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 2.5rem;
  background: var(--navy-card);
  max-width: 520px;
  box-shadow: inset 0 1px 0 rgba(213,168,101,.08);
}
.country-meta dt {
  background: rgba(213,168,101,.06);
  padding: 0.65rem 1.25rem;
  font-family: 'Cinzel', serif;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-dim);
  border-bottom: 1px solid rgba(213,168,101,.08);
  display: flex;
  align-items: center;
}
.country-meta dt:last-of-type { border-bottom: none; }
.country-meta dd {
  padding: 0.65rem 1.25rem;
  font-family: 'EB Garamond', serif;
  font-size: var(--t-base);
  color: var(--parchment-dim);
  border-bottom: 1px solid rgba(213,168,101,.08);
  border-left: 1px solid rgba(213,168,101,.08);
  display: flex;
  align-items: center;
}
.country-meta dd:last-child { border-bottom: none; }

/* ── PAGINATION ────────────────────────────────────────── */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 3rem 0;
  flex-wrap: wrap;
}
.pager-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.55rem 1.2rem;
  border: 1px solid rgba(213,168,101,.20);
  border-radius: var(--r-xl);
  text-decoration: none;
  font-family: 'Cinzel', serif;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--parchment-dim);
  background: var(--navy-card);
  transition:
    border-color var(--dur-fast) var(--ease-out),
    background var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out);
}
.pager-btn:hover {
  border-color: var(--gold-ring);
  background: rgba(213,168,101,.08);
  color: var(--gold);
}
.pager-info {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: var(--t-sm);
  color: var(--parchment-faint);
  padding: 0 0.5rem;
}

/* ── NOTICE / EMPTY / ERROR ────────────────────────────── */
.notice {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: rgba(213,168,101,.05);
  border: 1px solid rgba(213,168,101,.14);
  border-radius: var(--r-md);
  padding: 1rem 1.25rem;
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: var(--t-sm);
  color: var(--parchment-faint);
  margin: 1rem 0;
}
.notice.info  { background: rgba(59,130,246,.06); border-color: rgba(59,130,246,.18); color: #93c5fd; }
.notice.warn  { background: rgba(245,158,11,.06); border-color: rgba(245,158,11,.18); color: #fcd34d; }

/* ── SOURCES LINE ──────────────────────────────────────── */
.sources-line {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: var(--t-xs);
  color: var(--parchment-faint);
  border-top: 1px solid rgba(213,168,101,.08);
  margin-top: 3rem;
  padding-top: 1rem;
  letter-spacing: 0.01em;
}

/* ── SCROLL-REVEAL ANIMATION ───────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  .reveal {
    opacity: 0;
    transform: translateY(18px);
    transition:
      opacity var(--dur-slow) var(--ease-out),
      transform var(--dur-slow) var(--ease-out);
  }
  .reveal.visible {
    opacity: 1;
    transform: translateY(0);
  }
  .reveal-delay-1 { transition-delay: 80ms; }
  .reveal-delay-2 { transition-delay: 160ms; }
  .reveal-delay-3 { transition-delay: 240ms; }
  .reveal-delay-4 { transition-delay: 320ms; }
}

/* ── MOBILE RESPONSIVE ─────────────────────────────────── */
@media (max-width: 768px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .hero-seal-display {
    order: -1;
  }
  .hero-seal-img {
    width: 120px;
    height: 120px;
  }

  .stats-band {
    grid-template-columns: repeat(2, 1fr);
  }
  .stat-cell:nth-child(2) { border-right: none; }
  .stat-cell:nth-child(1),
  .stat-cell:nth-child(2) {
    border-bottom: 1px solid rgba(213,168,101,.1);
  }

  .continent-grid {
    grid-template-columns: 1fr;
  }

  .dossier {
    grid-template-columns: 1fr;
  }
  .dossier-label {
    border-bottom: none;
    padding-bottom: 0.2rem;
  }
  .dossier-value {
    border-left: none;
    padding-top: 0.3rem;
    border-bottom: 1px solid rgba(213,168,101,.08);
  }

  .country-meta {
    grid-template-columns: 1fr;
    max-width: 100%;
  }
  .country-meta dt { border-bottom: none; padding-bottom: 0.2rem; }
  .country-meta dd { border-left: none; padding-top: 0.3rem; }

  .header-search { display: none; }

  .section-header { flex-direction: column; gap: 0.25rem; }

  .footer-inner { flex-direction: column; gap: 1.5rem; }
  .footer-links { flex-wrap: wrap; gap: 1rem; }
}

@media (max-width: 480px) {
  .stats-band { grid-template-columns: 1fr 1fr; }
  .hero {
    padding: 2.5rem 1.5rem 2.5rem;
    border-radius: var(--r-md);
  }
  .hero-search { max-width: 100%; }
  main { padding-top: 2rem; }
}

/* ── Live search suggestions (typeahead) ─────────────────────── */
.suggest-host { position: relative; }
.search-suggest {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 400;
  background: #0d1536;
  border: 1px solid rgba(213, 168, 101, 0.45);
  border-radius: 6px;
  box-shadow: 0 18px 48px rgba(4, 6, 18, 0.75), inset 0 1px 0 rgba(213, 168, 101, 0.12);
  max-height: min(420px, 60vh);
  overflow-y: auto;
  padding: 0.35rem 0;
}
.suggest-label {
  font-family: 'Cinzel', serif;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #d5a865;
  padding: 0.55rem 0.9rem 0.25rem;
  border-bottom: 1px solid rgba(213, 168, 101, 0.15);
  margin-bottom: 0.15rem;
}
.suggest-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.9rem;
  text-decoration: none;
  color: #EAE4D3;
  font-family: 'EB Garamond', serif;
  font-size: 0.98rem;
  line-height: 1.3;
}
.suggest-item .s-main { flex: 1 1 auto; }
.suggest-item .s-meta {
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-style: italic;
  color: rgba(234, 228, 211, 0.55);
  white-space: nowrap;
  max-width: 40%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.suggest-item:hover, .suggest-item.is-active {
  background: rgba(213, 168, 101, 0.12);
  color: #E8C55A;
}
.suggest-item:hover .s-meta, .suggest-item.is-active .s-meta { color: rgba(232, 197, 90, 0.7); }
.suggest-all {
  display: block;
  padding: 0.55rem 0.9rem;
  margin-top: 0.2rem;
  border-top: 1px solid rgba(213, 168, 101, 0.2);
  font-family: 'Cinzel', serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #d5a865;
  text-decoration: none;
  text-align: center;
}
.suggest-all:hover { color: #E8C55A; background: rgba(213, 168, 101, 0.08); }
@media (max-width: 768px) {
  .search-suggest { max-height: 50vh; }
}

/* Typeahead fix: the pill forms clip children (overflow:hidden shapes the pill);
   the suggest panel must escape — restore visible overflow and re-round the pill
   ends on the controls themselves so the look survives. */
.suggest-host.header-search, .suggest-host.hero-search { overflow: visible; }
.suggest-host.header-search input, .suggest-host.hero-search input {
  border-radius: 999px 0 0 999px;
}
.suggest-host.header-search button, .suggest-host.hero-search button {
  border-radius: 0 999px 999px 0;
}

/* ── MAPPA MUNDI ACADEMICA ─────────────────────────────────── */
.mappa-mundi-section {
  margin-bottom: 3rem;
  margin-top: 2.5rem;
}

.mappa-header {
  margin-bottom: 1.25rem;
}

.mappa-wrap {
  position: relative;
  border: 1px solid rgba(213,168,101,.18);
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #08091f;
  box-shadow:
    0 0 0 1px rgba(213,168,101,.06) inset,
    0 24px 64px rgba(8,9,31,.55);
}

/* Meander top accent line */
.mappa-wrap::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: repeating-linear-gradient(
    90deg,
    var(--gold-shadow) 0px, var(--gold-shadow) 6px,
    transparent 6px, transparent 14px,
    var(--gold-shadow) 14px, var(--gold-shadow) 20px,
    transparent 20px, transparent 28px
  );
  opacity: 0.40;
  z-index: 2;
  pointer-events: none;
}

#mappa-canvas {
  width: 100%;
  display: block;
  cursor: default;
}

.mappa-note {
  position: absolute;
  bottom: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'EB Garamond', Georgia, serif;
  font-style: italic;
  font-size: 0.78rem;
  color: rgba(213,168,101,.32);
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}

@media (max-width: 600px) {
  .mappa-note { font-size: 0.68rem; }
}
