/* mazirbe.lv public site. Mobile first. Tokens on :root are reused by admin. */
:root {
  --sand: #f3eee4;
  --sand-deep: #e9e0d0;
  --paper: #fbf8f2;
  --ink: #1d2a29;
  --ink-soft: #4a5755;
  --line: #d8cdb9;
  --pine: #2e5b47;
  --pine-deep: #1e3e31;
  --pine-tint: #dde7df;
  --sea: #2b577a;
  --sea-soft: #7fa3bb;
  --sea-tint: #dbe5ec;
  --accent: #b4532a;
  --accent-deep: #933f1b;
  --ok: #2e5b47;
  --error: #9b2c1f;
  --focus: #1f5f9a;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(29, 42, 41, .06), 0 8px 24px -12px rgba(29, 42, 41, .18);
  --serif: "Literata", Georgia, "Times New Roman", serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: 16px;
  --maxw: 1140px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0;
  background: var(--sand);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--sea); text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--pine-deep); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
main:focus { outline: none; }
[id] { scroll-margin-top: 84px; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 500; line-height: 1.15; letter-spacing: -.01em; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: clamp(2.1rem, 6vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 4vw, 2.3rem); }
h3 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
code { font-size: .9em; background: var(--sand-deep); padding: .1em .35em; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 760px; }
.muted { color: var(--ink-soft); }
.fine { font-size: .875rem; color: var(--ink-soft); }

.skip-link { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: var(--radius-sm); }
.skip-link:focus { top: 8px; color: #fff; }

.eyebrow { font: 600 .78rem/1.3 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--pine); margin: 0 0 .75rem; }
.eyebrow-light { color: #f1e6cf; }
.h-sub { font-size: 1.5rem; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: .7em 1.35em;
  border: 2px solid transparent; border-radius: 999px;
  font: 600 1rem/1.2 var(--sans); text-decoration: none; cursor: pointer;
  transition: background-color .15s, color .15s, border-color .15s, transform .15s;
}
.btn:active { transform: translateY(1px); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-deep); color: #fff; }
.btn-light { background: rgba(255, 253, 248, .92); color: var(--ink); }
.btn-light:hover { background: #fff; color: var(--ink); }
.btn-ghost { background: transparent; color: var(--pine-deep); border-color: var(--pine); }
.btn-ghost:hover { background: var(--pine); color: #fff; }
.btn-block { display: flex; width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }
.btn-row-dark { margin: 2rem 0; }
.link-arrow { font-weight: 600; text-decoration: none; color: var(--pine-deep); display: inline-flex; align-items: center; gap: .4em; }
.link-arrow::after { content: "→"; transition: transform .15s; }
.link-arrow:hover::after { transform: translateX(3px); }
.link-back::after { content: none; }
.link-back::before { content: "←"; }
.more { margin-top: 1.75rem; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(243, 238, 228, .94); backdrop-filter: saturate(1.2) blur(8px); -webkit-backdrop-filter: saturate(1.2) blur(8px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); padding: 8px 0; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-mark .mark-pine { color: var(--pine); fill: var(--pine); }
.brand-mark .mark-wave { stroke: var(--sea); }
.brand-mark .mark-wave2 { stroke: var(--sea-soft); }
.brand-name { font: 600 1.55rem/1 var(--serif); letter-spacing: -.01em; }
.brand-sub { font: 500 .72rem/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); padding-left: 10px; border-left: 1px solid var(--line); display: none; }
@media (min-width: 420px) { .brand-sub { display: inline; } }

.nav-toggle { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.nav-toggle-label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-weight: 600; font-size: .95rem; user-select: none; background: var(--paper); }
.nav-toggle:focus-visible + .nav-toggle-label { outline: 3px solid var(--focus); outline-offset: 2px; }
.burger, .burger::before, .burger::after { display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; position: relative; transition: transform .2s, background-color .2s; }
.burger::before, .burger::after { content: ""; position: absolute; left: 0; }
.burger::before { top: -6px; }
.burger::after { top: 6px; }
.nav-toggle:checked + .nav-toggle-label .burger { background: transparent; }
.nav-toggle:checked + .nav-toggle-label .burger::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle:checked + .nav-toggle-label .burger::after { transform: translateY(-6px) rotate(-45deg); }

.site-nav { display: none; width: 100%; padding: 4px 0 16px; }
.nav-toggle:checked ~ .site-nav { display: block; }
.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav a { display: block; padding: 12px 4px; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 500; font-size: 1.05rem; }
.site-nav a:hover { color: var(--pine); }
.site-nav a.is-active { color: var(--pine-deep); font-weight: 700; }
.site-nav a.is-active::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 10px; vertical-align: middle; }

@media (min-width: 1000px) {
  .nav-toggle-label { display: none; }
  .site-nav { display: block; width: auto; padding: 0; }
  .site-nav ul { display: flex; gap: 2px; }
  .site-nav a { border: 0; padding: 8px 11px; font-size: .95rem; border-radius: 999px; }
  .site-nav a:hover { background: var(--sand-deep); }
  .site-nav a.is-active { background: var(--pine-tint); }
  .site-nav a.is-active::before { content: none; }
}

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 78svh; display: flex; align-items: flex-end; color: #fff; overflow: hidden; background: #3b3a36; }
.hero-img, .cta-img, .nf-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-img { object-position: 18% 50%; }
@media (min-width: 800px) { .hero-img { object-position: 60% 60%; } }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20, 28, 30, .1) 0%, rgba(20, 28, 30, .2) 35%, rgba(20, 28, 30, .75) 100%), linear-gradient(90deg, rgba(20, 28, 30, .45) 0%, rgba(20, 28, 30, 0) 65%); }
.hero-body { position: relative; padding-top: 120px; padding-bottom: 48px; }
.hero-title { color: #fff; font-size: clamp(2.3rem, 7.5vw, 4.4rem); font-weight: 500; max-width: 15ch; margin-bottom: .4em; text-shadow: 0 1px 24px rgba(0, 0, 0, .25); }
.hero-lead { font-size: 1.15rem; max-width: 36ch; color: #f6f1e7; margin-bottom: 1.6rem; }
@media (min-width: 800px) { .hero { min-height: 82vh; } .hero-body { padding-bottom: 80px; } .hero-lead { font-size: 1.25rem; } }

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section-tight { padding: 36px 0; }
.section-sand { background: var(--sand-deep); }
.section-head { display: grid; gap: 8px; margin-bottom: 28px; }
.section-head h2 { margin-bottom: 0; }
.section-lead { color: var(--ink-soft); max-width: 52ch; margin: 0; }
@media (min-width: 800px) {
  .section { padding: 88px 0; }
  .section-tight { padding: 48px 0; }
  .section-head { grid-template-columns: 1fr 1fr; align-items: end; gap: 40px; margin-bottom: 40px; }
}
.empty { background: var(--paper); border: 1px dashed var(--line); border-radius: var(--radius); padding: 28px 20px; text-align: center; }
.empty p { color: var(--ink-soft); }

.page-head { padding: 48px 0 32px; border-bottom: 1px solid var(--line); }
.page-head h1 { margin-bottom: .3em; }
.page-lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 58ch; }
.page-head-photo { position: relative; color: #fff; border: 0; padding: 140px 0 40px; overflow: hidden; background: #3b3a36; }
.page-head-photo > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.page-head-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20, 28, 30, .05), rgba(20, 28, 30, .72)), linear-gradient(90deg, rgba(20, 28, 30, .4), rgba(20, 28, 30, 0) 70%); }
.page-head-photo .wrap { position: relative; }
.page-head-photo h1 { color: #fff; }
.page-head-photo .page-lead { color: #f3ecdf; margin-bottom: 0; }
@media (min-width: 800px) { .page-head { padding: 72px 0 44px; } .page-head-photo { padding: 220px 0 56px; } }

.crumbs { font-size: .9rem; padding: 24px 0 8px; color: var(--ink-soft); }
.crumbs a { color: var(--ink-soft); }
.crumbs a::before { content: "← "; }

/* ---------- Polls ---------- */
.poll-grid { display: grid; gap: 20px; }
@media (min-width: 900px) { .poll-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; align-items: start; } }
.poll { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 18px; box-shadow: var(--shadow); }
@media (min-width: 600px) { .poll { padding: 28px 28px 24px; } }
.poll-title { font-size: 1.45rem; margin-bottom: .35em; }
h1.poll-title { font-size: clamp(1.9rem, 5vw, 2.7rem); }
.poll-title a { color: inherit; text-decoration: none; }
.poll-title a:hover { text-decoration: underline; }
.poll-desc { color: var(--ink-soft); margin-bottom: .75em; }
.poll-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: .88rem; color: var(--ink-soft); margin-bottom: 16px; }
.poll-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--sea-tint); color: var(--sea); font-weight: 600; }
.poll-badge-closed { background: var(--sand-deep); color: var(--ink); }
.poll-form { margin: 0; }
.poll-options { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.poll-btn {
  position: relative; width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 12px;
  padding: 14px 14px; min-height: 56px; text-align: left;
  font: inherit; color: var(--ink); background: #fff; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  cursor: pointer; transition: border-color .15s, background-color .15s;
}
.poll-btn:hover:not(:disabled) { border-color: var(--pine); background: #fdfcf9; }
.poll-btn:disabled { cursor: default; color: var(--ink); }
.poll-btn:has(.poll-thumb) { grid-template-columns: auto auto 1fr auto; }
.poll-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 6px; }
.poll-check { width: 22px; height: 22px; border: 2px solid var(--sea-soft); border-radius: 50%; display: grid; place-items: center; background: #fff; }
.poll[data-kind="multi"] .poll-check { border-radius: 5px; }
.is-mine .poll-check { background: var(--pine); border-color: var(--pine); }
.is-mine .poll-check::after { content: ""; width: 10px; height: 6px; border: solid #fff; border-width: 0 0 2.5px 2.5px; transform: translate(0, -1px) rotate(-45deg); }
.is-mine .poll-btn { border-color: var(--pine); background: #f7faf7; }
.poll-text { display: grid; gap: 2px; min-width: 0; }
.poll-opt-title { font-weight: 600; line-height: 1.3; }
.poll-opt-desc { font-size: .9rem; color: var(--ink-soft); line-height: 1.4; }
.poll-result { display: none; text-align: right; line-height: 1.2; }
.poll-pct { display: block; font: 600 1.15rem/1.1 var(--serif); }
.poll-count { display: block; font-size: .78rem; color: var(--ink-soft); white-space: nowrap; }
.poll-bar { display: none; grid-column: 1 / -1; height: 6px; background: var(--sea-tint); border-radius: 999px; overflow: hidden; margin-top: 6px; }
.poll-bar span { display: block; height: 100%; background: var(--sea); border-radius: 999px; transition: width .5s ease; }
.is-mine .poll-bar span { background: var(--pine); }
.show-results .poll-result, .show-results .poll-bar { display: block; }
.poll.is-busy .poll-btn { opacity: .65; pointer-events: none; }
.poll-error { margin: 12px 0 0; padding: 10px 12px; border-radius: var(--radius-sm); background: #f8e5df; color: var(--error); font-size: .95rem; }
.poll-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; margin: 14px 0 0; font-size: .9rem; color: var(--ink-soft); }
.poll-foot [data-voters] { font-weight: 600; color: var(--ink); }
.after-poll { margin: 24px 0 64px; color: var(--ink-soft); font-size: .95rem; }
.note-row p { margin: 0; color: var(--ink-soft); }

/* ---------- Guide on home ---------- */
.guide-grid { display: grid; gap: 28px; }
@media (min-width: 800px) { .guide-grid { grid-template-columns: repeat(3, 1fr); gap: 28px; } }
.guide-col { display: flex; flex-direction: column; }
.guide-photo { display: block; border-radius: var(--radius); overflow: hidden; aspect-ratio: 3 / 2; margin-bottom: 16px; background: var(--line); }
.guide-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.guide-col:hover .guide-photo img { transform: scale(1.03); }
.guide-title { font-size: 1.6rem; margin-bottom: .2em; }
.guide-title a { color: var(--ink); text-decoration: none; }
.guide-title a:hover { color: var(--pine); }
.guide-lead { color: var(--ink-soft); margin-bottom: .8em; }
.guide-list { list-style: none; margin: 0 0 16px; padding: 0; border-top: 1px solid var(--line); flex: 1; }
.guide-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.guide-list a { font-weight: 600; color: var(--ink); text-decoration: none; }
.guide-list a:hover { color: var(--pine); text-decoration: underline; }
.guide-list span { display: block; font-size: .9rem; color: var(--ink-soft); line-height: 1.45; }

/* ---------- Smart village + series ---------- */
.smart-split { display: grid; gap: 36px; }
@media (min-width: 900px) { .smart-split { grid-template-columns: 5fr 6fr; gap: 64px; align-items: start; } .smart-split-solo { grid-template-columns: minmax(0, 720px); } }
.smart-intro p { max-width: 50ch; }
.series-label { font: 600 .78rem/1.3 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--sea); margin: 0 0 12px; }
.series-path { list-style: none; margin: 0 0 20px; padding: 0; counter-reset: none; }
.series-path li { position: relative; }
.series-path li + li { margin-top: 0; }
.series-path a { display: grid; grid-template-columns: 44px 1fr; gap: 14px; padding: 14px 0; text-decoration: none; color: var(--ink); position: relative; }
.series-path li:not(:last-child) a::after { content: ""; position: absolute; left: 21px; top: 58px; bottom: -14px; width: 2px; background: var(--sea-tint); }
.series-num { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); border: 2px solid var(--sea-soft); font: 600 1.1rem/1 var(--serif); color: var(--sea); position: relative; z-index: 1; }
.series-text { display: grid; gap: 2px; padding-top: 8px; }
.series-text strong { font: 500 1.2rem/1.25 var(--serif); }
.series-text span { color: var(--ink-soft); font-size: .95rem; }
.series-text em { font-style: normal; font-size: .82rem; color: var(--ink-soft); }
.series-path a:hover .series-num { background: var(--sea); color: #fff; border-color: var(--sea); }
.series-path a:hover strong { text-decoration: underline; text-underline-offset: .15em; }
.series-block { display: grid; gap: 28px; }
@media (min-width: 900px) { .series-block { grid-template-columns: 4fr 7fr; gap: 64px; align-items: start; } .series-intro { position: sticky; top: 96px; } }
.series-intro p { color: var(--ink-soft); }

/* ---------- CTA band ---------- */
.cta-band { position: relative; color: #fff; overflow: hidden; background: #2c3a3c; padding: 96px 0; }
.cta-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(20, 28, 30, .78), rgba(20, 28, 30, .35)); }
.cta-body { position: relative; }
.cta-body h2 { color: #fff; max-width: 18ch; }
.cta-body p { max-width: 44ch; color: #f3ecdf; font-size: 1.1rem; margin-bottom: 1.5rem; }

/* ---------- Place cards ---------- */
.count-line { font-size: .9rem; color: var(--ink-soft); margin-bottom: 16px; }
.card-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; }
@media (min-width: 640px) { .card-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .card-grid { grid-template-columns: repeat(3, 1fr); gap: 24px; } }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; }
.card:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(29, 42, 41, .06), 0 16px 32px -16px rgba(29, 42, 41, .3); }
.card-link { display: flex; flex-direction: column; height: 100%; color: var(--ink); text-decoration: none; }
.card-link:hover { color: var(--ink); }
.card-link:focus-visible { outline-offset: -3px; border-radius: var(--radius); }
.card-photo { display: block; aspect-ratio: 3 / 2; overflow: hidden; background: var(--line); position: relative; }
.photo-note { position: absolute; left: 8px; bottom: 8px; font-size: .72rem; font-weight: 600; background: rgba(251, 248, 242, .88); color: var(--ink-soft); padding: 2px 8px; border-radius: 999px; }
.card-photo img { width: 100%; height: 100%; object-fit: cover; }
.is-fallback img { filter: saturate(.7); }
.card-body { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px 18px; flex: 1; }
.card-title { font: 500 1.35rem/1.2 var(--serif); }
.card-link:hover .card-title { color: var(--pine); text-decoration: underline; text-underline-offset: .15em; text-decoration-thickness: 1px; }
.card-summary { color: var(--ink-soft); font-size: .95rem; line-height: 1.5; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.tag { display: inline-block; font-size: .78rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--pine-tint); color: var(--pine-deep); }
.card-facts { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .85rem; color: var(--ink-soft); margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); }
.card-facts span + span::before { content: "·"; margin-right: 14px; margin-left: -8px; color: var(--line); }
.note-split { display: grid; gap: 20px; align-items: center; }
.note-split p { margin: 0; color: var(--ink-soft); }
.cat-switch { display: flex; flex-wrap: wrap; gap: 10px; }
@media (min-width: 800px) { .note-split { grid-template-columns: 1fr auto; gap: 40px; } }

/* ---------- Place page ---------- */
.place-grid { display: grid; gap: 32px; padding-bottom: 24px; }
@media (min-width: 960px) { .place-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 56px; } .place-side { position: sticky; top: 96px; align-self: start; margin-top: 12px; } }
.place-main h1 { margin-top: 8px; }
.place-photo { margin: 24px 0 20px; border-radius: var(--radius); overflow: hidden; position: relative; aspect-ratio: 3 / 2; background: var(--line); }
.place-photo img { width: 100%; height: 100%; object-fit: cover; }
.place-photo figcaption { position: absolute; left: 10px; bottom: 10px; font-size: .78rem; background: rgba(255, 253, 248, .9); padding: 3px 8px; border-radius: 6px; color: var(--ink-soft); }
.place-main .tags { margin-bottom: 20px; }
.facts { margin: 0 0 16px; display: grid; gap: 0; }
.facts > div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.facts > div:first-child { padding-top: 0; }
.facts dt { font-size: .78rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 2px; }
.facts dd { margin: 0; font-size: 1.02rem; overflow-wrap: anywhere; }
.facts-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 20px 8px; }
.facts-card > div:first-child { padding-top: 0; }
.facts-card > div:last-child { border-bottom: 0; }
.place-side .fine { margin: 12px 0 0; }

/* ---------- Prose ---------- */
.prose { font-size: 1.08rem; line-height: 1.7; }
.prose > * { max-width: 68ch; }
.prose h2 { font-size: 1.7rem; margin-top: 1.8em; }
.prose h3 { font-size: 1.35rem; margin-top: 1.5em; }
.prose h4 { font-size: 1.1rem; margin-top: 1.4em; font-family: var(--sans); font-weight: 700; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .4em; }
.prose li::marker { color: var(--pine); }
.prose blockquote { margin: 1.5em 0; padding: .4em 0 .4em 1.2em; border-left: 3px solid var(--sea-soft); font: italic 400 1.25rem/1.5 var(--serif); color: var(--ink); }
.prose blockquote p { margin: 0; }
.prose-lead { font: 400 1.35rem/1.5 var(--serif); color: var(--ink); }
.steps { list-style: none; padding: 0 !important; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding: 0 0 0 52px; margin-bottom: 1.2em; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: -2px; width: 36px; height: 36px; border-radius: 50%; background: var(--pine); color: #fff; display: grid; place-items: center; font: 600 1rem/1 var(--serif); }

/* ---------- Article ---------- */
.article-head { padding-bottom: 24px; }
.article-head h1 { margin-top: 8px; }
.article-meta { font-size: .92rem; color: var(--ink-soft); }
.article-photo { margin: 0 auto 32px; }
.article-photo img { border-radius: var(--radius); width: 100%; max-height: 560px; object-fit: cover; }
.crumbs span { color: var(--ink-soft); }
.share { margin: 40px 0 24px; padding: 18px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); }
.share label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 8px; }
.share-row { display: flex; gap: 10px; flex-wrap: wrap; }
.share-row input { flex: 1 1 220px; min-width: 0; }
.share-status { margin: 8px 0 0; font-size: .9rem; color: var(--ok); min-height: 1.2em; }
.series-nav { display: grid; gap: 12px; margin: 24px 0; }
@media (min-width: 640px) { .series-nav { grid-template-columns: 1fr 1fr; } }
.series-step { display: grid; gap: 4px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); background: var(--paper); }
.series-step span { font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--sea); }
.series-step strong { font: 500 1.15rem/1.3 var(--serif); }
.series-step:hover { border-color: var(--sea); color: var(--ink); }
.series-next { text-align: right; }
.series-all { margin: 40px 0 16px; padding-top: 28px; border-top: 1px solid var(--line); }
.series-toc { padding-left: 1.4em; margin: 0; }
.series-toc li { padding: 5px 0; }
.series-toc li::marker { color: var(--sea); font-weight: 600; }
.series-toc .is-current span { font-weight: 700; }
.series-toc .is-current span::after { content: "  (šī daļa)"; font-weight: 400; color: var(--ink-soft); font-size: .9em; }
.article + * { margin-top: 0; }
.article .more { margin-bottom: 64px; }

.news-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.news-item a { display: grid; gap: 14px; padding: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); }
@media (min-width: 640px) { .news-item a { grid-template-columns: 200px 1fr; align-items: center; } .news-item a:not(:has(img)) { grid-template-columns: 1fr; } }
.news-item img { aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius-sm); width: 100%; }
.news-text { display: grid; gap: 4px; }
.news-text time { font-size: .82rem; color: var(--ink-soft); }
.news-text strong { font: 500 1.3rem/1.25 var(--serif); }
.news-text span { color: var(--ink-soft); font-size: .95rem; }
.news-item a:hover strong { text-decoration: underline; text-underline-offset: .15em; }

/* ---------- About / contact ---------- */
.about-grid, .contact-grid { display: grid; gap: 36px; padding-top: 40px; padding-bottom: 24px; }
@media (min-width: 960px) {
  .about-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 64px; padding-top: 64px; }
  .about-side { position: sticky; top: 96px; align-self: start; }
  .contact-grid { grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 64px; padding-top: 56px; padding-bottom: 80px; }
  .contact-side { order: 0; }
}
.about-side .btn, .contact-side .btn { margin-top: 12px; }
.contact-photo { border-radius: var(--radius); margin-top: 24px; aspect-ratio: 3 / 2; object-fit: cover; width: 100%; }
.contact-main { order: -1; }
@media (min-width: 960px) { .contact-main { order: 1; } }
.photo-strip { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.photo-strip figure { margin: 0; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4 / 3; }
.photo-strip figure:first-child { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.photo-strip img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 800px) { .photo-strip { grid-template-columns: 2fr 1fr 1fr; } .photo-strip figure:first-child { grid-column: auto; aspect-ratio: auto; } .photo-strip figure { aspect-ratio: 4 / 5; } }

/* ---------- Forms ---------- */
.form { display: grid; gap: 18px; margin-top: 16px; }
.field { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field-row { display: grid; gap: 18px; }
@media (min-width: 640px) { .field-row { grid-template-columns: 1fr 1fr; } }
label, legend { font-weight: 600; font-size: .95rem; }
legend { padding: 0; margin-bottom: 8px; }
.opt { font-weight: 400; color: var(--ink-soft); font-size: .85rem; }
.opt::before { content: "("; } .opt::after { content: ")"; }
input[type="text"], input[type="email"], input[type="tel"], input[type="url"], textarea, select {
  width: 100%; font: inherit; color: var(--ink); background: #fff;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 11px 12px; min-height: 48px;
}
textarea { resize: vertical; min-height: 120px; line-height: 1.5; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
input::placeholder, textarea::placeholder { color: #8a918c; }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: 999px; background: #fff; font-weight: 500; cursor: pointer; }
.choice input:checked + span { background: var(--pine); border-color: var(--pine); color: #fff; }
.choice input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.form .btn { justify-self: start; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-fine { margin: 20px 0 64px; }
.notice { border-radius: var(--radius); padding: 20px 22px; margin: 28px 0 8px; }
.notice h2 { font-size: 1.45rem; margin-bottom: .3em; }
.notice p:last-child { margin-bottom: 0; }
.notice-err { background: #f8e5df; border: 1px solid #e3b9ad; color: var(--error); font-weight: 500; }
.notice-ok { background: var(--pine-tint); border: 1px solid #b9ceBF; }

.tabs { margin-top: 28px; }
.tab-list { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { padding: 12px 16px; margin-bottom: -1px; font-weight: 600; color: var(--ink-soft); text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--pine-deep); border-bottom-color: var(--accent); }
.tab-panel { padding-top: 24px; display: none; }
/* No JS: :target picks the panel, first panel is the default. */
.tab-panel:target { display: block; }
.tabs:not(:has(.tab-panel:target)) .tab-panel:first-of-type { display: block; }
/* With JS: classes decide. */
.js .tabs .tab-panel { display: none; }
.js .tabs .tab-panel.is-active { display: block; }
.tab-panel { scroll-margin-top: 90px; }

/* ---------- 404 ---------- */
.nf { position: relative; min-height: 72svh; display: flex; align-items: flex-end; color: #fff; overflow: hidden; background: #3b3a36; }
.nf-body { position: relative; padding-top: 120px; padding-bottom: 56px; }
.nf h1 { color: #fff; max-width: 16ch; }
.nf p { color: #f3ecdf; font-size: 1.1rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--pine-deep); color: #dfe6df; padding: 56px 0 24px; margin-top: 0; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: #f1e6cf; }
.footer-grid { display: grid; gap: 32px; }
@media (min-width: 800px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; gap: 56px; } }
.brand-footer { color: #fff; margin-bottom: 12px; }
.brand-footer:hover { color: #fff; }
.site-footer .brand-mark .mark-pine { fill: #cfe0d3; color: #cfe0d3; }
.site-footer .brand-mark .mark-wave { stroke: #9fc0d6; }
.site-footer .brand-mark .mark-wave2 { stroke: #5f87a3; }
.footer-about p { max-width: 44ch; }
.footer-liv { font: italic 400 1.05rem/1.4 var(--serif); color: #b9c9bd; }
.footer-h { font: 600 .78rem/1.3 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: #b9c9bd; margin-bottom: 12px; }
.footer-list { list-style: none; margin: 0; padding: 0; }
.footer-list li { padding: 5px 0; }
.footer-list a { text-decoration: none; }
.footer-list a:hover { text-decoration: underline; }
.footer-base { margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, .14); font-size: .85rem; color: #b9c9bd; }
.footer-base p { margin: 0; }
.site-footer :focus-visible { outline-color: #f1e6cf; }
.page-body { padding-top: 40px; padding-bottom: 72px; }
@media (min-width: 800px) { .page-body { padding-top: 56px; padding-bottom: 96px; } }
