/* ═══════════════════════════════════════════════════════════════════
   ÜS Liivika – peamine stiilileht (kontseptsioon A „Lipukiri“)
   Öine tumesinine, hõbe ja vapi kuldkollane. Cormorant Garamond + Manrope.
   ═══════════════════════════════════════════════════════════════════ */

/* ─── Disainimärgid ────────────────────────────────────────────────── */

:root {
  --bg:          #0c1626;   /* öine tumesinine – lehe taust */
  --bg-2:        #0f1b2e;   /* vahelduvad sektsioonid */
  --plate:       #101d31;   /* paneelid, sõrmuse plaat */
  --ink:         #e8ebef;   /* põhitekst */
  --ink-2:       #c9d0d9;   /* sisutekst */
  --muted:       #a7b1bf;   /* abitekst */
  --silver:      #c7cdd5;   /* hõbe – lipu teine värv */
  --gold:        #ffc72c;   /* vapi kuldkollane */
  --gold-hover:  #ffd966;
  --flag-navy:   #1b2e52;
  --flag-silver: #a9b1bb;
  --line:        rgba(214, 220, 228, 0.14);
  --line-strong: rgba(214, 220, 228, 0.35);
  --gold-line:   rgba(255, 199, 44, 0.45);

  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans:  'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --wrap:     1240px;
  --gutter:   40px;
  --header-h: 80px;
  --section:  104px;
  color-scheme: dark;
}

/* ─── Põhi ─────────────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--ink); }
a:hover { color: #ffffff; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
h1, h2, h3, p, figure, blockquote, dl, dd, ol, ul { margin: 0; }
h1, h2, h3 { text-wrap: balance; }

[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

.serif { font-family: var(--serif); }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.24em; text-transform: uppercase; color: var(--muted); }
.eyebrow-gold { color: var(--gold); }
.h-display { font-family: var(--serif); font-weight: 500; font-size: clamp(40px, 4.6vw, 64px); line-height: 1.04; }
.h-display em, .h-hero em { color: var(--gold); font-style: italic; font-weight: 500; }
.lede { font-size: 18px; line-height: 1.75; color: var(--ink-2); }
.muted { color: var(--muted); }

/* ─── Nupud ───────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 24px; border-radius: 999px;
  font-family: var(--sans); font-weight: 600; font-size: 15px; text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.btn svg { flex: 0 0 auto; }
.btn-gold { background: var(--gold); color: var(--bg); }
.btn-gold:hover { background: var(--gold-hover); color: var(--bg); }
.btn-ghost { border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); color: #ffffff; }
.btn-sm { min-height: 44px; padding: 0 20px; font-size: 14px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }

/* ─── Päis ja menüü ───────────────────────────────────────────────── */

/* Hägune taust on pseudo-elemendil: backdrop-filter päisel endal teeks sellest
   fikseeritud mobiilimenüü konteineri ja menüü ei kataks ekraani. */
.site-header { position: sticky; top: 0; z-index: 50; border-bottom: 1px solid var(--line); }
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(12, 22, 38, 0.86);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: background 0.2s;
}
.site-header.scrolled::before { background: rgba(12, 22, 38, 0.97); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: var(--header-h); }

.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; flex: 0 0 auto; }
.brand img { width: 52px; height: 52px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-small { font-size: 10px; letter-spacing: 0.28em; text-transform: uppercase; color: var(--muted); }
.brand-name { font-family: var(--serif); font-size: 26px; font-weight: 600; letter-spacing: 0.02em; color: var(--ink); }

.site-nav { display: flex; align-items: center; gap: 28px; }
.nav-links { display: flex; align-items: center; gap: 26px; list-style: none; padding: 0; }
.nav-link {
  display: inline-block; padding: 12px 2px; font-size: 14px; color: #c3cbd5; text-decoration: none;
  border-bottom: 1px solid transparent; transition: color 0.2s, border-color 0.2s;
}
.nav-link:hover, .nav-links .active .nav-link { color: #ffffff; border-bottom-color: var(--gold); }

.nav-toggle {
  display: none; align-items: center; gap: 10px; min-height: 44px; padding: 0 18px;
  border-radius: 999px; border: 1px solid var(--line-strong); background: transparent;
  color: var(--ink); font: 600 14px var(--sans); cursor: pointer;
}

@media (max-width: 1100px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none; position: fixed; inset: var(--header-h) 0 0 0; z-index: 49;
    flex-direction: column; align-items: stretch; gap: 8px; overflow-y: auto;
    padding: 16px var(--gutter) 40px; background: var(--bg); border-top: 1px solid var(--line);
  }
  .site-nav.open { display: flex; }
  .nav-links { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-link { display: block; padding: 16px 0; font-size: 19px; border-bottom: 1px solid var(--line); }
  .site-nav .btn { margin-top: 20px; }
}

/* Päise konto: „Sisene“ või kasutaja menüü (site-auth.js) */
.account { position: relative; flex: 0 0 auto; order: 3; }
.account-login {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 4px;
  color: var(--muted); font-size: 13px; text-decoration: none; transition: color 0.2s;
}
.account-login:hover, .account-login:focus-visible { color: var(--ink); }
.account-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 10px 4px 4px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: transparent; color: var(--ink);
  font: 600 13px var(--sans); cursor: pointer;
}
.account-chip:hover, .account-chip[aria-expanded="true"] { border-color: var(--gold); }
.account-avatar {
  width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; object-fit: cover;
  background: var(--gold); color: var(--bg); font-size: 12px; font-weight: 700;
}
.account-name { max-width: 12ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 60; width: min(280px, calc(100vw - 32px));
  padding: 8px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--plate);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}
.account-head { display: grid; gap: 2px; padding: 10px 12px 12px; border-bottom: 1px solid var(--line); }
.account-head strong { font-size: 15px; }
.account-head span { color: var(--muted); font-size: 13px; word-break: break-all; }
.account-role {
  justify-self: start; margin-top: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-style: normal; font-weight: 600;
  background: rgba(255, 255, 255, 0.07); color: var(--ink-2);
}
.account-role.is-admin { background: var(--gold); color: var(--bg); }
.account-role.is-none { color: var(--muted); }
.account-links { display: grid; padding: 6px 0; border-bottom: 1px solid var(--line); }
.account-links a { padding: 9px 12px; border-radius: 8px; color: var(--ink-2); font-size: 14px; text-decoration: none; }
.account-links a:hover { background: rgba(255, 255, 255, 0.05); color: var(--ink); }
.account-logout {
  width: 100%; margin-top: 6px; padding: 9px 12px; border: 0; border-radius: 8px; background: none; text-align: left;
  color: var(--muted); font: 500 14px var(--sans); cursor: pointer;
}
.account-logout:hover { background: rgba(255, 255, 255, 0.05); color: var(--ink); }
.site-nav { order: 2; }
.nav-toggle { order: 4; }
.brand { margin-right: auto; }
@media (max-width: 1100px) {
  .header-inner { gap: 12px; }
  /* kontonupp on „Menüü“ kõrval – menüü joondub ekraani paremasse serva, mitte nupu alla */
  .account-menu { position: fixed; top: calc(var(--header-h) - 4px); right: 16px; }
}
@media (max-width: 520px) {
  .account-name, .account-chip > svg { display: none; }
  .account-chip { padding: 4px; }
  .account-login span { display: none; }
}

/* ─── Avaplokk ────────────────────────────────────────────────────── */

.hero { padding-block: 80px 56px; }
.hero-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 56px; align-items: center; }
.h-hero { font-family: var(--serif); font-weight: 500; font-size: clamp(56px, 8.4vw, 116px); line-height: 0.95; letter-spacing: -0.01em; margin-top: 28px; }
.hero .lede { max-width: 520px; margin-top: 36px; font-size: 19px; }
.hero .btn-row { margin-top: 40px; }

.ring { position: relative; width: min(100%, 470px); aspect-ratio: 1 / 1; margin-inline: auto; }
.ring svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.ring-line { fill: none; stroke: rgba(199, 205, 213, 0.22); stroke-width: 1; }
.ring-line.faint { stroke: rgba(199, 205, 213, 0.14); }
.ring-plate { fill: var(--plate); stroke: rgba(199, 205, 213, 0.22); stroke-width: 1; }
.ring-text { fill: var(--silver); font: 500 14px var(--sans); letter-spacing: 6px; }
.ring-spin { transform-origin: 200px 200px; animation: ring-spin 90s linear infinite; }
.ring-vapp { position: absolute; left: 50%; top: 50%; width: 46%; height: auto; transform: translate(-50%, -50%); }
@keyframes ring-spin {
  to { transform: rotate(360deg); }
}

/* ─── Fotod ───────────────────────────────────────────────────────── */

.photo { margin: 0; }
.photo img { width: 100%; height: 100%; object-fit: cover; border: 1px solid var(--line); background: var(--plate); }
.photo figcaption { margin-top: 12px; font-size: 13px; color: var(--muted); }
.band img { height: clamp(260px, 38vw, 540px); object-position: center 62%; }
.photo-bw img { filter: grayscale(1) contrast(1.05); }

/* ─── Sektsioonid ─────────────────────────────────────────────────── */

.section { padding-block: var(--section); }
.section-alt { background: var(--bg-2); border-block: 1px solid var(--line); }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 56px; }
.section-head .eyebrow { margin-bottom: 24px; }
.section-head > p { max-width: 420px; color: var(--muted); font-size: 16px; line-height: 1.7; }
.split { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 64px; }
.stack > * + * { margin-top: 20px; }
.text-link { display: inline-flex; align-items: center; gap: 8px; color: var(--gold); text-decoration: none; font-weight: 600; font-size: 15px; }
.text-link:hover { color: var(--gold-hover); }

.motto-quote { margin-top: 72px; padding-block: 44px; border-block: 1px solid var(--line); text-align: center; }
.motto-quote p { font-family: var(--serif); font-style: italic; font-size: clamp(34px, 4.4vw, 60px); line-height: 1.12; }
.motto-quote footer { margin-top: 22px; }

.stats { margin-top: 56px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 40px; }
.stats dt { font-family: var(--serif); font-size: 60px; line-height: 1; color: var(--gold); font-variant-numeric: lining-nums; }
.stats dd { margin-top: 12px; color: var(--muted); font-size: 15px; line-height: 1.5; }

/* Põhimõtted */
.principles { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr)); column-gap: 64px; }
.principle { display: flex; gap: 28px; padding-block: 26px; border-top: 1px solid var(--line); }
.principle .num { flex: 0 0 56px; font-family: var(--serif); font-size: 34px; font-style: italic; color: var(--gold); line-height: 1; }
.principle h3 { font-family: var(--serif); font-size: 30px; font-weight: 600; line-height: 1.15; margin-bottom: 10px; }
.principle p { color: var(--muted); line-height: 1.7; }

/* Ajalugu */
/* Arhiivifotod keritava galeriina ühel real (kõik mustvalged ja ühekõrgused).
   main.js liigutab rida aeglaselt edasi; kasutaja saab kerida, lohistada, libistada või nooli kasutada. */
.gallery-wrap { --gallery-h: clamp(200px, 26vw, 360px); position: relative; margin-bottom: 56px; }
.gallery {
  overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; cursor: grab;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}
.gallery::-webkit-scrollbar { display: none; }
.gallery.is-dragging { cursor: grabbing; }
.gallery:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.gallery-track { display: flex; align-items: flex-end; gap: 20px; width: max-content; }
.gallery .photo { flex: 0 0 auto; }
.gallery .photo img { width: auto; height: var(--gallery-h); -webkit-user-drag: none; user-select: none; }
.gallery-btn {
  position: absolute; top: calc(var(--gallery-h) / 2 - 22px); z-index: 1;
  width: 44px; height: 44px; display: grid; place-items: center; padding: 0;
  border: 1px solid var(--line-strong); border-radius: 50%; background: rgba(12, 22, 38, 0.8); color: var(--ink); cursor: pointer;
}
.gallery-btn:hover, .gallery-btn:focus-visible { border-color: var(--gold); color: var(--gold); }
.gallery-prev { left: 8px; }
.gallery-prev svg { transform: rotate(180deg); }
.gallery-next { right: 8px; }
/* Ajastute tahvel: iga ajastu on veerg, kuldne joon seob need üheks ajajooneks. Kõik on korraga näha. */
.eras { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.era { position: relative; padding: 34px 28px 8px; border-top: 1px solid var(--gold-line); }
.era + .era { border-left: 1px solid var(--line); }
.era::before { content: ""; position: absolute; top: -6px; left: 28px; width: 11px; height: 11px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 5px var(--bg); }
.era-span { font-family: var(--serif); font-size: 32px; line-height: 1; color: var(--gold); }
.era-name { margin-top: 10px; }
.era-events { list-style: none; padding: 0; margin-top: 30px; display: grid; gap: 4px; }
.era-events li { padding: 18px 0; border-top: 1px solid var(--line); transition: background 0.2s; }
.ev-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.ev-year { font-family: var(--serif); font-size: 38px; line-height: 1; color: var(--ink); }
.ev-date { font-size: 13px; color: var(--gold); }
.ev-text { margin-top: 10px; font-size: 15px; line-height: 1.65; color: var(--ink-2); }
@media (max-width: 1100px) {
  .era:nth-child(odd) { border-left: 0; }
}
@media (max-width: 640px) {
  .era { padding-inline: 0 0; padding-left: 26px; border-left: 0 !important; border-top: 0; }
  .era::before { left: 0; top: 4px; }
  .eras { border-left: 1px solid var(--gold-line); margin-left: 5px; }
  .era { margin-top: 8px; }
}

/* Seltsielu */
.activities { margin-top: 64px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 48px 40px; }
.activity { border-top: 1px solid var(--gold); padding-top: 20px; }
.activity h3 { font-family: var(--serif); font-size: 26px; font-weight: 600; margin-bottom: 8px; }
.activity p { color: var(--muted); line-height: 1.7; }

/* Sümboolika */
.plate-ring { width: min(100%, 440px); aspect-ratio: 1 / 1; margin-inline: auto; border-radius: 50%; border: 1px solid var(--silver); padding: 18px; }
.plate-ring > div { width: 100%; height: 100%; border-radius: 50%; border: 1px dashed rgba(199, 205, 213, 0.45); background: var(--plate); display: flex; align-items: center; justify-content: center; }
.plate-ring > div { background: radial-gradient(circle at 50% 42%, #18294a, var(--plate) 68%); }
.plate-ring img { width: 62%; height: auto; }
.plate-ring img.plate-vapp { width: 58%; filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.45)); }
/* Sõrmuse foto on väikesest originaalist suurendatud, seepärast kuvatakse see tagasihoidlikult. */
.symbol-media .ring-photo { width: auto; height: auto; max-width: 56%; max-height: 150px; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.55)); }
.symbol-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 32px; margin-top: 36px; }
.symbol-list div { border-top: 1px solid var(--line); padding-top: 14px; }
.symbol-list dt { font-weight: 600; }
.symbol-list dd { margin-top: 4px; color: var(--muted); }
.symbol-cards { margin-top: 56px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 20px; }
.symbol-card { display: flex; flex-direction: column; gap: 22px; padding: 28px; border: 1px solid var(--line); }
.symbol-card h3 { font-family: var(--serif); font-size: 26px; font-weight: 600; margin-bottom: 6px; }
.symbol-card p { color: var(--muted); font-size: 15px; line-height: 1.6; }
.symbol-media { height: 230px; display: flex; align-items: center; justify-content: center; overflow: hidden; background: var(--plate); border: 1px solid var(--line); }
.symbol-media .flag-art { width: auto; max-width: 92%; height: 100%; max-height: 210px; }
.symbol-media .cap-photo { width: 72%; max-width: 266px; height: auto; filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.6)); }

/* Liiviklased */
.members { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr)); column-gap: 64px; }
.members li { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; padding-block: 20px; border-top: 1px solid var(--line); }
.members .name { font-family: var(--serif); font-size: 26px; font-weight: 600; white-space: nowrap; }
.members .role { color: var(--muted); font-size: 14px; text-align: right; line-height: 1.5; }

/* Laulik ja sugupuu */
.treasures { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 20px; }
.treasure {
  position: relative; display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 28px; align-items: center;
  padding: 28px; border: 1px solid var(--line); background: var(--plate); text-decoration: none; color: var(--ink);
  transition: border-color 0.25s, transform 0.25s;
}
.treasure:hover { border-color: var(--gold-line); transform: translateY(-3px); color: var(--ink); }
.treasure-art { width: 150px; aspect-ratio: 782 / 1105; object-fit: cover; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45); }
.treasure-art.fan { aspect-ratio: auto; height: auto; box-shadow: none; }
.treasure h3 { font-family: var(--serif); font-size: 32px; font-weight: 600; line-height: 1.1; margin: 10px 0 10px; }
.treasure p { color: var(--muted); font-size: 15px; line-height: 1.6; }
.treasure .text-link { margin-top: 16px; }
@media (max-width: 520px) {
  .treasure { grid-template-columns: 1fr; }
  .treasure-art { width: 120px; }
}

/* Noorliikme teaser */
.join-panel {
  padding: clamp(32px, 5vw, 64px); border: 1px solid var(--gold-line); background: var(--plate);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 56px; align-items: center;
}
.join-panel .eyebrow { margin-bottom: 24px; }
.join-panel .h-display { margin-bottom: 20px; }
.join-panel .lede { margin-bottom: 32px; font-size: 17px; }
.mini-steps { list-style: none; padding: 0; }
.mini-steps li { display: flex; gap: 24px; padding-block: 22px; border-top: 1px solid var(--line); }
.mini-steps li:last-child { border-bottom: 1px solid var(--line); }
.mini-steps .num { flex: 0 0 40px; font-family: var(--serif); font-size: 30px; font-style: italic; color: var(--gold); line-height: 1.1; }
.mini-steps strong { font-size: 18px; }
.mini-steps p { margin-top: 4px; color: var(--muted); font-size: 15px; }

/* ─── Alamlehed ───────────────────────────────────────────────────── */

.page-hero { padding-block: 88px 64px; border-bottom: 1px solid var(--line); }
.page-hero .eyebrow { margin-bottom: 24px; }
.page-hero h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(48px, 6.4vw, 92px); line-height: 0.98; }
.page-hero .lede { margin-top: 24px; max-width: 640px; }

.prose { max-width: 760px; padding-block: 72px 104px; color: var(--ink-2); font-size: 18px; line-height: 1.8; }
.prose > * + * { margin-top: 20px; }
.prose h2 { margin-top: 64px; font-family: var(--serif); font-weight: 600; font-size: clamp(32px, 3.4vw, 44px); line-height: 1.1; color: var(--ink); }
.prose h3 { margin-top: 40px; font-family: var(--serif); font-weight: 600; font-size: 28px; line-height: 1.2; color: var(--ink); }
.prose h2 + *, .prose h3 + * { margin-top: 14px; }
.prose strong { color: var(--ink); }
.prose a { color: var(--gold); }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li + li { margin-top: 8px; }
.prose li::marker { color: var(--gold); }
.prose blockquote { padding: 28px 0; border-block: 1px solid var(--line); font-family: var(--serif); font-style: italic; font-size: 32px; line-height: 1.25; color: var(--ink); text-align: center; }
.prose hr { margin-block: 64px; border: 0; border-top: 1px solid var(--line); }

/* Noorliikme leht */
.join-hero { padding-block: 80px 64px; }
.join-hero .h-hero { font-size: clamp(54px, 7.4vw, 104px); }
.join-hero .photo img { aspect-ratio: 4 / 5; max-height: 620px; }
.facts { margin-top: 72px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); border-block: 1px solid var(--line); }
.facts div { padding: 28px 24px 28px 0; }
.facts dd { margin-top: 10px; font-family: var(--serif); font-size: 26px; font-weight: 600; }
.fact-note { display: block; margin-top: 4px; font-family: var(--sans); font-size: 14px; font-weight: 400; color: var(--muted); }
.benefits { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 56px 48px; }
.benefit .num { display: block; margin-bottom: 14px; font-family: var(--serif); font-size: 22px; font-style: italic; color: var(--gold); }
.benefit h3 { font-family: var(--serif); font-size: 30px; font-weight: 600; margin-bottom: 10px; }
.benefit p { color: var(--muted); line-height: 1.7; }

.steps-wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr)); gap: 64px; align-items: start; }
.steps-intro { position: sticky; top: calc(var(--header-h) + 40px); }
.steps { list-style: none; padding: 0 0 0 36px; border-left: 1px solid var(--gold-line); }
.steps li { position: relative; padding-bottom: 48px; }
.steps li:last-child { padding-bottom: 0; }
.steps li::before {
  content: ""; position: absolute; left: -43px; top: 5px; width: 13px; height: 13px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--gold);
}
.steps li.is-member::before { background: var(--gold); }
.steps h3 { margin: 8px 0 10px; font-family: var(--serif); font-size: 32px; font-weight: 600; }
.steps p { color: var(--ink-2); line-height: 1.7; }

.next-step { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 40px; align-items: center; }
.next-step .btn-row { justify-content: flex-start; }

.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding-block: 26px; list-style: none; cursor: pointer; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary h3 { font-family: var(--serif); font-size: 26px; font-weight: 600; }
.faq summary:hover h3 { color: #ffffff; }
.faq .plus { flex: 0 0 22px; color: var(--gold); transition: transform 0.25s; }
.faq details[open] .plus { transform: rotate(45deg); }
.faq p { max-width: 620px; padding-bottom: 28px; color: var(--muted); line-height: 1.7; }

.cta-box { padding: clamp(36px, 6vw, 72px); border: 1px solid var(--gold-line); background: var(--plate); text-align: center; }
.cta-box .eyebrow { margin-bottom: 20px; }
.cta-box .h-display { margin-bottom: 18px; }
.cta-box p { max-width: 540px; margin: 0 auto 32px; color: var(--ink-2); }
.cta-box .btn-row { justify-content: center; }

/* Kontakt */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 56px; padding-block: 72px 104px; }
.contact-org + .contact-org { margin-top: 56px; }
.contact-org h2 { font-family: var(--serif); font-size: 36px; font-weight: 600; margin-bottom: 20px; }
.contact-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; padding-block: 14px; border-top: 1px solid var(--line); }
.contact-row:last-child { border-bottom: 1px solid var(--line); }
.contact-label { color: var(--muted); font-size: 14px; }
.contact-row address { font-style: normal; }
.contact-row a { color: var(--gold); }
/* Joonistatud asukohakaart; kuldne ring Liivika maja ümber hingab aeglaselt. */
.map-wrapper { margin: 0; border: 1px solid var(--line); background: var(--plate); }
.map-art { display: block; width: 100%; height: auto; }
.map-pulse { transform-box: fill-box; transform-origin: center; animation: map-pulse 2.8s ease-out infinite; }
@keyframes map-pulse {
  from { transform: scale(0.7); opacity: 0.9; }
  to { transform: scale(2.1); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .map-pulse { animation: none; opacity: 0.5; }
}
.map-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 16px; color: var(--gold); font-weight: 600; font-size: 15px; text-decoration: none; }
.map-link:hover { color: #ffffff; }

/* Admin: rakendus külgmenüü ja nelja lehega (ülevaade, laulik, sugupuu, kasutajad) */
.page-admin .site-footer { display: none; }
.admin { min-height: calc(100vh - var(--header-h)); }
.admin-gate { max-width: 460px; margin: 0 auto; padding: 72px 16px 104px; }
.admin-gate > .admin-muted { text-align: center; }
.admin-app { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: calc(100vh - var(--header-h)); }
.admin-side {
  position: sticky; top: var(--header-h); align-self: start; height: calc(100vh - var(--header-h));
  display: flex; flex-direction: column; gap: 28px; padding: 28px 16px;
  background: var(--plate); border-right: 1px solid var(--line);
}
.admin-brand { display: flex; align-items: center; gap: 12px; padding: 0 12px; }
.admin-brand div { display: grid; line-height: 1.15; }
.admin-brand span { color: var(--muted); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; }
.admin-brand strong { font-family: var(--serif); font-size: 28px; font-weight: 600; }
.admin-nav { display: grid; gap: 4px; }
.admin-nav a {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 8px;
  border-left: 2px solid transparent; color: var(--ink-2); font-size: 15px; font-weight: 600; text-decoration: none;
}
.admin-nav a:hover { background: rgba(255, 255, 255, 0.04); color: var(--ink); }
.admin-nav a[aria-current="page"] { background: rgba(255, 199, 44, 0.08); border-left-color: var(--gold); color: var(--ink); }
.admin-nav a[aria-current="page"] svg { color: var(--gold); }
.admin-nav em {
  margin-left: auto; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.06);
  color: var(--muted); font-size: 12px; font-style: normal; font-weight: 600;
}
.admin-nav em:empty { display: none; }
.admin-nav em.is-alert, .admin-count.is-alert { background: var(--gold); color: var(--bg); }
.admin-requests { border-color: rgba(255, 199, 44, 0.45); }
.admin-request-list { list-style: none; margin: 16px 0 0; padding: 0; }
.admin-request { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 16px 0; border-top: 1px solid var(--line); }
.admin-request > div:first-child { display: grid; gap: 2px; min-width: 0; }
.admin-request strong { font-size: 16px; }
.admin-request .admin-email { color: var(--ink-2); font-weight: 500; }
.admin-request p { margin-top: 6px; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.admin-request small { color: var(--muted); font-size: 13px; }
/* Allikad */
.admin-drop-gap { margin-top: 16px; }
.admin-source-group + .admin-source-group { margin-top: 28px; }
.admin-source-group h3 { margin-bottom: 4px; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.admin-source { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.admin-type { width: 52px; height: 52px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; color: var(--gold); font-size: 11px; font-weight: 700; letter-spacing: 0.06em; }
.admin-source strong { display: block; font-size: 16px; }
.admin-source p { margin-top: 2px; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.admin-source small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; word-break: break-word; }
@media (max-width: 640px) {
  .admin-source { grid-template-columns: 44px minmax(0, 1fr); }
  .admin-source .admin-actions { grid-column: 2; text-align: left; }
  .admin-type { width: 44px; height: 44px; }
}
.admin-session { margin-top: auto; padding: 14px 12px 0; border-top: 1px solid var(--line); flex-direction: column; align-items: flex-start; gap: 6px; }
.admin-content { width: 100%; max-width: 1120px; padding: 48px clamp(16px, 4vw, 56px) 104px; }
.admin-head { margin-bottom: 32px; }
.admin-head h1 { margin: 8px 0 12px; font-family: var(--serif); font-size: clamp(36px, 4.4vw, 52px); font-weight: 600; line-height: 1.05; }
.admin-lede { max-width: 62ch; color: var(--muted); line-height: 1.7; }
.admin-lede strong { color: var(--ink-2); }
.admin-card { margin-bottom: 20px; padding: 28px; background: var(--plate); border: 1px solid var(--line); border-radius: 12px; }
.admin-card h2 { margin-bottom: 16px; font-family: var(--serif); font-size: 26px; font-weight: 600; }
.admin-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-bottom: 12px; }
.admin-card-head h2 { margin: 0; }
.admin-count {
  padding: 2px 10px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); vertical-align: middle;
  color: var(--muted); font-family: var(--sans); font-size: 14px; font-weight: 600;
}
.admin-count:empty { display: none; }
.admin-tools { display: flex; flex-wrap: wrap; gap: 10px; }
.admin-muted { color: var(--muted); font-size: 15px; line-height: 1.6; }

/* Ülevaade */
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 16px; margin-bottom: 20px; }
.admin-stat {
  display: grid; gap: 6px; padding: 24px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--plate); color: var(--ink); text-decoration: none; transition: border-color 0.2s, transform 0.2s;
}
.admin-stat:hover { border-color: var(--gold); transform: translateY(-2px); }
.admin-stat-icon { width: 44px; height: 44px; display: grid; place-items: center; margin-bottom: 8px; border-radius: 10px; background: rgba(255, 199, 44, 0.1); color: var(--gold); }
.admin-stat-label { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; }
.admin-stat strong { font-family: var(--serif); font-size: 32px; font-weight: 600; line-height: 1.1; font-variant-numeric: lining-nums; }
.admin-stat-sub { color: var(--muted); font-size: 14px; }
.admin-link-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* Nähtavus: kaks valikukaarti */
.admin-access { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 12px; margin: 0; padding: 0; border: 0; }
.admin-access label {
  position: relative; display: flex; align-items: center; gap: 14px; padding: 18px;
  border: 1px solid var(--line); border-radius: 10px; cursor: pointer; transition: border-color 0.2s, background 0.2s;
}
.admin-access label:hover { border-color: var(--line-strong); }
.admin-access input { position: absolute; opacity: 0; pointer-events: none; }
.admin-access label:has(input:checked) { border-color: var(--gold); background: rgba(255, 199, 44, 0.07); }
.admin-access label:has(input:focus-visible) { outline: 2px solid var(--gold); outline-offset: 2px; }
.admin-access-icon { flex: 0 0 auto; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, 0.05); color: var(--muted); }
.admin-access label:has(input:checked) .admin-access-icon { background: var(--gold); color: var(--bg); }
.admin-access strong { display: block; font-size: 16px; }
.admin-access small { display: block; margin-top: 2px; color: var(--muted); font-size: 14px; }

/* Lauliku PDF */
.admin-file { margin-bottom: 16px; color: var(--ink-2); }
.admin-drop {
  display: grid; justify-items: center; gap: 6px; padding: 36px 20px; text-align: center;
  border: 1.5px dashed var(--line-strong); border-radius: 12px; color: var(--muted); cursor: pointer; transition: border-color 0.2s, background 0.2s;
}
.admin-drop svg { margin-bottom: 6px; color: var(--gold); }
.admin-drop strong { color: var(--ink); font-size: 16px; }
.admin-drop:hover, .admin-drop.is-over { border-color: var(--gold); background: rgba(255, 199, 44, 0.05); }
.admin-drop.is-busy { opacity: 0.6; pointer-events: none; }
.admin-progress { height: 6px; margin-top: 16px; overflow: hidden; border-radius: 999px; background: var(--line); }
.admin-progress span { display: block; width: 0; height: 100%; background: var(--gold); transition: width 0.2s; }

/* Vormid ja tabelid */
.admin-add { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.admin-add label { display: grid; gap: 6px; color: var(--muted); font-size: 13px; }
.admin-add .admin-grow, .admin-person label:first-child { flex: 1 1 200px; }
.admin-add input, .admin-add select, .admin-search, .admin-table input, .admin-table select {
  min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--ink); font: 15px var(--sans);
}
.admin-add input[name="pyear"] { width: 110px; }
.admin-add input:focus, .admin-add select:focus, .admin-search:focus, .admin-table input:focus, .admin-table select:focus {
  outline: 2px solid var(--gold); outline-offset: 0; border-color: transparent;
}
.admin-search { min-width: min(100%, 260px); }
.admin-import {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 16px; padding: 18px; border: 1px dashed var(--line-strong); border-radius: 10px; color: var(--ink-2);
}
.admin-scroll { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.admin-table th {
  padding: 10px 10px 10px 0; border-bottom: 1px solid var(--line); text-align: left;
  color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
}
.admin-table td { padding: 6px 10px 6px 0; border-bottom: 1px solid var(--line); vertical-align: middle; }
.admin-table tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
.admin-table tr.is-dirty td:first-child { box-shadow: inset 2px 0 0 var(--gold); }
/* Sorteeritavad veerud: päis on nupp, aktiivse veeru juures nool */
.admin-sort {
  display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none;
  color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer;
}
.admin-sort:hover, [aria-sort] > .admin-sort { color: var(--ink); }
.admin-sort:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 2px; }
.admin-sort-icon { width: 0; height: 0; border-inline: 4px solid transparent; opacity: 0; }
.admin-sort:hover .admin-sort-icon { border-top: 5px solid currentColor; opacity: 0.4; }
[aria-sort] .admin-sort-icon, [aria-sort] .admin-sort:hover .admin-sort-icon { opacity: 1; color: var(--gold); }
[aria-sort="descending"] .admin-sort-icon { border-top: 5px solid currentColor; border-bottom: 0; }
[aria-sort="ascending"] .admin-sort-icon { border-bottom: 5px solid currentColor; border-top: 0; }
/* Sugupuu tabel näeb välja nagu tabel, kuid iga lahter on muudetav */
.admin-tree input, .admin-tree select { background: transparent; border-color: transparent; }
.admin-tree input:hover, .admin-tree select:hover { border-color: var(--line); }
.admin-tree input { width: 100%; min-width: 120px; }
.admin-tree input[type="number"] { min-width: 0; width: 88px; }
.admin-email { font-weight: 600; word-break: break-all; }
.admin-role.is-admin { border-color: rgba(255, 199, 44, 0.4); color: var(--gold); }
.admin-actions { text-align: right; white-space: nowrap; }
.admin-actions > * + * { margin-left: 12px; }
.admin-actions .auth-link { margin: 0; }
.admin-small { min-height: 36px; padding: 0 14px; font-size: 14px; }
.admin-empty { padding: 24px 0 !important; color: var(--muted); text-align: center; }
.admin-note { margin-top: 16px; color: var(--muted); font-size: 13px; }

/* Hüpikteade */
.admin-toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 200; transform: translateX(-50%);
  max-width: calc(100% - 32px); padding: 12px 20px; border-radius: 999px;
  background: #e8ebef; color: #0c1626; font-size: 14px; font-weight: 600; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.admin-toast.is-error { background: #ffb4a8; }

@media (max-width: 900px) {
  .admin-app { grid-template-columns: minmax(0, 1fr); }
  .admin-side { position: static; height: auto; gap: 12px; padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--line); }
  .admin-brand { display: none; }
  .admin-nav { display: flex; gap: 4px; overflow-x: auto; }
  .admin-nav a { flex: 0 0 auto; border-left: 0; border-bottom: 2px solid transparent; border-radius: 8px 8px 0 0; }
  .admin-nav a[aria-current="page"] { border-bottom-color: var(--gold); }
  .admin-session { margin-top: 0; padding: 8px 0 0; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .admin-content { padding-top: 32px; }
  .admin-card { padding: 20px; }
}

/* ─── Jalus ───────────────────────────────────────────────────────── */

.site-footer { border-top: 1px solid var(--line); padding-block: 80px 40px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 48px; }
.footer-brand { display: flex; flex-direction: column; align-items: center; width: fit-content; text-align: center; }
.footer-brand img { width: 84px; height: 84px; margin-bottom: 14px; }
.footer-brand .name { font-family: var(--serif); font-size: 34px; font-weight: 600; line-height: 1; }
/* padding-left tasakaalustab rea lõppu jääva tähevahe, et tekst oleks täpselt keskel */
.footer-brand .eyebrow { display: block; margin-top: 12px; padding-left: 0.18em; line-height: 1.8; letter-spacing: 0.18em; }
.footer-col h3 { margin-bottom: 16px; }
.footer-col p, .footer-col address { font-style: normal; line-height: 1.8; color: var(--ink-2); }
.footer-col ul { list-style: none; padding: 0; line-height: 1.9; }
.footer-col a { color: var(--ink-2); }
.footer-col a:hover { color: #ffffff; }
.footer-bottom { margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); }
/* Sisene: vasakul tervitus, paremal sisselogimise kaart */
.member-page { min-height: calc(100vh - var(--header-h)); background: radial-gradient(ellipse 80% 70% at 15% 0%, #15284a 0%, var(--bg) 60%); }
.member-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); align-items: center; gap: 72px; padding-block: 72px 104px; }
.member-vapp { width: 88px; height: 88px; margin-bottom: 28px; }
.member-intro h1 { margin: 16px 0 14px; font-family: var(--serif); font-size: clamp(40px, 5vw, 64px); font-weight: 500; line-height: 1.02; }
.member-lede { max-width: 40ch; color: var(--ink-2); font-size: 18px; line-height: 1.6; }
.member-perks { display: grid; gap: 18px; margin: 36px 0 0; padding: 0; list-style: none; }
.member-perks li { display: flex; align-items: flex-start; gap: 16px; }
.member-perk-icon { flex: 0 0 auto; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; background: rgba(255, 199, 44, 0.1); color: var(--gold); }
.member-perks strong { display: block; font-size: 16px; }
.member-perks span { color: var(--muted); font-size: 15px; line-height: 1.5; }
.member-motto { margin-top: 44px; color: var(--silver); font-family: var(--serif); font-size: 18px; font-style: italic; letter-spacing: 0.04em; opacity: 0.8; }
.member-card .auth-panel { max-width: none; padding: 32px; border-radius: 16px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35); }
@media (max-width: 900px) {
  .member-grid { grid-template-columns: minmax(0, 1fr); gap: 40px; padding-block: 40px 72px; }
  .member-card { order: -1; }
  .member-vapp { display: none; }
  .member-intro h1 { font-size: 36px; }
  .member-motto { display: none; }
  .member-card .auth-panel { padding: 24px; }
}

/* ─── Kitsas ekraan ja liikumine ──────────────────────────────────── */

@media (max-width: 640px) {
  :root { --gutter: 20px; --section: 72px; }
  body { font-size: 16px; }
  .hero { padding-block: 48px 40px; }
  .principle { gap: 18px; }
  .principle .num { flex-basis: 40px; }
  .members li { flex-direction: column; gap: 4px; }
  .members .role { text-align: left; }
  .contact-row { grid-template-columns: 1fr; gap: 4px; }
  .symbol-media { height: 190px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ring-spin { animation: none; }
  .treasure, .btn, .faq .plus { transition: none; }
}
.admin-session a[href="/admin/"] { display: none; }
