/*
Theme Name: Pealinna Perearstid
Theme URI: https://pealinnaperearst.ee
Author: Morten Olesk
Description: Custom hand-coded theme for Pealinna Perearstid — fast, accessible, no page builder. Bilingual ET/EN via Polylang.
Version: 0.10.6
Requires PHP: 8.2
Text Domain: pealinnaperearst
*/

/* ==========================================================================
   Design tokens
   ========================================================================== */
:root {
  --c-primary: #317abd;        /* brand blue — large text, UI surfaces */
  --c-primary-dark: #27649c;   /* 4.5:1+ on white — small text links, hovers */
  --c-primary-darker: #1f5182;
  --c-primary-tint: #eaf2f9;
  --c-accent: #bc2425;         /* brand red — CTAs, highlights */
  --c-accent-dark: #9c1d1e;
  --c-text: #333333;
  --c-text-muted: #666666;     /* ≥4.5:1 on white and #f6f6f6 */
  --c-bg: #ffffff;
  --c-bg-alt: #f6f6f6;
  --c-border: #e2e2e2;
  --c-focus: #1f5182;

  --font-sans: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-sm: 0.875rem;   /* 14 */
  --fs-base: 1.0625rem;/* 17 — elderly-friendly */
  --fs-md: 1.1875rem;  /* 19 */
  --fs-lg: 1.375rem;   /* 22 */
  --fs-xl: 1.75rem;    /* 28 */
  --fs-2xl: 2.25rem;   /* 36 */
  --fs-3xl: 2.75rem;   /* 44 */

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 2px rgba(31, 81, 130, 0.06), 0 8px 24px -8px rgba(31, 81, 130, 0.12);
  --shadow-raised: 0 12px 40px -8px rgba(31, 81, 130, 0.22);
  --container: 72rem;
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::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 { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.65;
  color: var(--c-text);
  background: var(--c-bg);
}

img { max-width: 100%; height: auto; }

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 var(--space-4); font-weight: 700; color: var(--c-text); }
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }
@media (min-width: 768px) {
  h1 { font-size: var(--fs-3xl); }
}

p { margin: 0 0 var(--space-4); }

a { color: var(--c-primary-dark); text-underline-offset: 3px; }
a:hover { color: var(--c-primary-darker); }

:focus-visible {
  outline: 3px solid var(--c-focus);
  outline-offset: 2px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000;
  background: var(--c-primary-darker);
  color: #fff;
  padding: var(--space-3) var(--space-5);
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; color: #fff; }

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-4);
}
@media (min-width: 768px) { .container { padding-inline: var(--space-6); } }

.section { padding-block: var(--space-7); }
.section--alt { background: var(--c-bg-alt); }
@media (min-width: 768px) { .section { padding-block: var(--space-8); } }

.section-mark { display: block; margin: 0 auto var(--space-2); width: 56px; height: auto; }
.section-title { text-align: center; margin-bottom: var(--space-6); font-size: clamp(1.75rem, 3vw, 2.25rem); letter-spacing: -0.01em; }
.section-title::after {
  content: "";
  display: block;
  width: 56px;
  height: 4px;
  margin: var(--space-3) auto 0;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--c-accent), var(--c-primary));
}

/* Scroll reveal (JS adds .reveal, then .is-visible; no-JS stays visible) */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; translate: 0 18px; transition: opacity 500ms ease-out, translate 500ms ease-out; }
  .reveal.is-visible { opacity: 1; translate: 0 0; }
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: var(--space-3) var(--space-5);
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  font: 600 var(--fs-base) var(--font-sans);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 200ms ease-out, border-color 200ms ease-out, color 200ms ease-out, translate 200ms ease-out, box-shadow 200ms ease-out;
}
.btn:hover { translate: 0 -2px; box-shadow: var(--shadow-card); }
@media (prefers-reduced-motion: reduce) { .btn:hover { translate: none; } }
.btn svg { width: 1.25em; height: 1.25em; flex-shrink: 0; }
.btn--primary { background: var(--c-primary); color: #fff; }
.btn--primary:hover { background: var(--c-primary-darker); color: #fff; }
.btn--accent { background: var(--c-accent); color: #fff; }
.btn--accent:hover { background: var(--c-accent-dark); color: #fff; }
.btn--outline { background: transparent; border-color: var(--c-primary); color: var(--c-primary-dark); }
.btn--outline:hover { background: var(--c-primary-tint); color: var(--c-primary-darker); }
.btn--sm { min-height: 36px; padding: 0.3rem 0.9rem; font-size: 0.8125rem; }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
  transition: box-shadow 250ms ease-out;
}
.site-header.is-scrolled { box-shadow: 0 6px 24px -8px rgba(31, 81, 130, 0.18); }

.header-topbar {
  background: var(--c-bg-alt);
  border-bottom: 1px solid var(--c-border);
  font-size: var(--fs-sm);
}
.header-topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 48px;
  padding-block: var(--space-1);
}
.header-topbar__right { display: flex; align-items: center; gap: var(--space-3); }
.header-phone {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  font-weight: 700;
  color: var(--c-primary-dark);
  text-decoration: none;
  white-space: nowrap;
}
.header-phone svg { width: 18px; height: 18px; flex-shrink: 0; }
.header-epak { display: inline-flex; }
@media (max-width: 639.98px) {
  .header-topbar__inner { gap: var(--space-2); }
  .header-topbar__right { gap: var(--space-2); }
  .header-phone__label { display: none; }
  .header-epak { min-height: 34px; padding: 0.25rem 0.7rem; font-size: 0.75rem; }
  .lang-switcher a { min-width: 36px; min-height: 34px; }
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-height: 72px;
}
.site-logo { display: inline-flex; align-items: center; flex-shrink: 0; }
.site-logo img { height: 60px; width: auto; }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-left: auto;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: var(--c-bg);
  cursor: pointer;
}
.nav-toggle svg { width: 26px; height: 26px; stroke: var(--c-text); }
.nav-toggle .icon-close, .nav-toggle[aria-expanded="true"] .icon-menu { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

.site-nav { display: none; }
.site-nav.is-open {
  display: block;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
  box-shadow: var(--shadow-raised);
  max-height: calc(100dvh - 130px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
body.menu-open { overflow: hidden; }
.site-nav ul { list-style: none; margin: 0; padding: var(--space-3); }
.site-nav li { position: relative; }
.site-nav a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  color: var(--c-text);
  text-decoration: none;
  font-weight: 500;
}
.site-nav a:hover { background: var(--c-primary-tint); color: var(--c-primary-darker); }
.site-nav .current-menu-item > a,
.site-nav .current-menu-ancestor > a { color: var(--c-primary-dark); font-weight: 700; }
.site-nav .sub-menu { padding: 0 0 0 var(--space-5); }

@media (min-width: 1152px) {
  .nav-toggle { display: none; }
  .site-nav { display: flex; align-items: center; margin-left: auto; }
  .site-nav > ul { display: flex; padding: 0; gap: 0; }
  .site-nav a { min-height: 44px; padding: var(--space-2) 0.7rem; white-space: nowrap; font-size: var(--fs-sm); }
  .site-nav .current-menu-item > a { box-shadow: inset 0 -3px 0 var(--c-accent); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
  .site-nav .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 16rem;
    padding: var(--space-2);
    background: var(--c-bg);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-raised);
  }
  .site-nav li:hover > .sub-menu,
  .site-nav li:focus-within > .sub-menu { display: block; }
}

.nav-epak { padding: var(--space-2) var(--space-4) var(--space-4); }
.nav-epak .btn { width: 100%; }
.site-nav .nav-epak a.btn--accent { color: #fff; background: var(--c-accent); }
.site-nav .nav-epak a.btn--accent:hover { color: #fff; background: var(--c-accent-dark); }
@media (min-width: 1152px) { .nav-epak { display: none; } }

.lang-switcher { display: flex; gap: var(--space-1); list-style: none; margin: 0; padding: 0; }
.lang-switcher a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 38px;
  padding: 0 var(--space-2);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: var(--fs-sm);
  text-transform: uppercase;
  text-decoration: none;
  color: var(--c-text-muted);
  background: var(--c-bg);
}
.lang-switcher .current-lang a { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(100deg, var(--c-primary-darker) 0%, var(--c-primary) 45%);
  color: #fff;
}
.hero h1 { color: #fff; margin-bottom: var(--space-3); font-size: var(--fs-2xl); }
.hero p { font-size: var(--fs-md); max-width: 46ch; }
.hero a { color: #fff; }
.hero .btn--accent { border-color: transparent; }
.hero__content { position: relative; z-index: 1; padding-block: var(--space-7); }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-4); }
.btn--glass {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.5);
  color: #fff;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.btn--glass:hover { background: rgba(255, 255, 255, 0.28); color: #fff; }
.hero__hours { margin: var(--space-4) 0 0; font-weight: 600; opacity: 0.92; font-size: var(--fs-base); }
.hero__bg img { display: block; width: 100%; height: 240px; object-fit: cover; object-position: center 22%; }
@media (min-width: 900px) {
  .hero h1 { font-size: var(--fs-3xl); }
  .hero__content { padding-block: 6.5rem; }
  .hero__content > * { max-width: 44%; }
  .hero__bg {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 55%;
  }
  .hero__bg img { width: 100%; height: 100%; }
  .hero__bg::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(90deg, var(--c-primary) 0%, rgba(49, 122, 189, 0.45) 22%, rgba(49, 122, 189, 0) 55%);
  }
}

/* ==========================================================================
   Notices (teadetetahvel)
   ========================================================================== */
.notices { display: grid; gap: var(--space-4); }
.notice {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-4) var(--space-5);
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-card);
}
.notice h3 { display: flex; align-items: center; gap: var(--space-2); margin: 0; font-size: var(--fs-md); }
.notice h3::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c-accent);
  flex-shrink: 0;
}
.notice :last-child { margin-bottom: 0; }

/* ==========================================================================
   Cards
   ========================================================================== */
.card-grid { display: grid; gap: var(--space-4); }
.card-grid > * { min-width: 0; }
@media (min-width: 640px) { .card-grid--2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 640px) { .card-grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .card-grid--3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .card-grid--4 { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 640px) and (max-width: 899px) { .card-grid--4 { grid-template-columns: repeat(2, 1fr); } }

.card {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: var(--space-5);
  box-shadow: var(--shadow-card);
}
.card h3 { color: var(--c-primary-dark); }

.location-card { display: flex; flex-direction: column; gap: var(--space-2); }
.location-card .btn { margin-top: auto !important; align-self: start; }
.location-card__rows { display: grid; gap: var(--space-2); margin: 0; }
.location-card__rows div { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); align-items: baseline; }
.location-card__rows dt { flex-shrink: 0; font-weight: 600; color: var(--c-text-muted); font-size: var(--fs-sm); min-width: 5.5rem; }
.location-card__rows dd { margin: 0; overflow-wrap: anywhere; font-size: 1rem; }
.location-card .btn { justify-self: start; margin-top: var(--space-3); }

.card { transition: box-shadow 250ms ease-out, border-color 250ms ease-out; }
.card:hover { border-color: rgba(49, 122, 189, 0.35); box-shadow: var(--shadow-raised); }

.service-card { text-align: center; }
.service-card svg {
  width: 64px;
  height: 64px;
  padding: 15px;
  stroke: var(--c-primary);
  background: var(--c-primary-tint);
  border-radius: var(--radius-pill);
  margin-bottom: var(--space-3);
}
.service-card h3 { font-size: var(--fs-md); }
.service-card p { margin: 0; color: var(--c-text-muted); font-size: var(--fs-sm); line-height: 1.6; }

.quicklink-card {
  display: block;
  text-decoration: none;
  border-top: 4px solid var(--c-primary);
  transition: transform 200ms ease-out, box-shadow 200ms ease-out;
}
.quicklink-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-raised); }
.quicklink-card h3 { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); }
.quicklink-card h3 svg { width: 22px; height: 22px; flex-shrink: 0; stroke: var(--c-accent); }
.quicklink-card p { margin: 0; color: var(--c-text-muted); font-size: var(--fs-sm); }

/* ==========================================================================
   Doctor schedules (flagship)
   ========================================================================== */
.schedule-tools { margin-bottom: var(--space-6); }
.schedule-search { position: relative; max-width: 28rem; }
.schedule-search svg {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  translate: 0 -50%;
  width: 22px;
  height: 22px;
  stroke: var(--c-text-muted);
  pointer-events: none;
}
.schedule-search input {
  width: 100%;
  min-height: 52px;
  padding: var(--space-3) var(--space-4) var(--space-3) 3.25rem;
  font: 400 var(--fs-base) var(--font-sans);
  color: var(--c-text);
  border: 2px solid var(--c-border);
  border-radius: var(--radius-pill);
  background: var(--c-bg);
}
.schedule-search input:focus { border-color: var(--c-primary); outline: none; box-shadow: 0 0 0 3px rgba(49, 122, 189, 0.25); }
.schedule-count { margin-top: var(--space-2); font-size: var(--fs-sm); color: var(--c-text-muted); min-height: 1.5em; }

.schedule-layout { display: grid; gap: var(--space-6); align-items: start; }
@media (min-width: 1100px) {
  .schedule-layout { grid-template-columns: minmax(0, 1fr) 21rem; }
  .schedule-aside { position: sticky; top: 8.5rem; }
}
.schedule-aside .reg-info {
  background: var(--c-bg-alt);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: var(--space-5);
}
.schedule-aside .reg-info h2 { font-size: var(--fs-md); }
.schedule-aside .reg-info > h2:first-child { margin-top: 0; }
.schedule-aside .reg-info p { font-size: var(--fs-sm); line-height: 1.6; }
.schedule-aside .reg-info :last-child { margin-bottom: 0; }

.doctor-grid { display: grid; gap: var(--space-4); }
@media (min-width: 700px) { .doctor-grid { grid-template-columns: repeat(2, 1fr); } }
.doctor-card--scheduled .doctor-card__body { min-height: 20rem; }

.doctor-card {
  display: flex;
  flex-direction: column;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.doctor-card.is-hidden { display: none; }

.doctor-card__head {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--c-border);
  background: var(--c-primary-tint);
}
.doctor-card__role { font-size: var(--fs-sm); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--c-primary-dark); }
.doctor-card__name { margin: var(--space-1) 0 0; font-size: var(--fs-lg); }
.doctor-card__flags { display: flex; gap: var(--space-1); margin-top: var(--space-2); }
.flag-chip { display: inline-flex; border-radius: 3px; overflow: hidden; box-shadow: 0 0 0 1px rgba(51, 60, 78, 0.18); }
.flag-chip .flag { display: block; width: 21px; height: 15px; }

.schedule-group-title {
  margin: var(--space-7) 0 var(--space-4);
  padding-top: var(--space-6);
  border-top: 1px solid var(--c-border);
  font-size: var(--fs-lg);
  color: var(--c-primary-dark);
  scroll-margin-top: 6rem;
}
.doctor-grid + .schedule-group-title { margin-top: var(--space-6); }
.doctor-grid--sub { margin-bottom: var(--space-4); }
.doctor-card__meta { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.2;
}
.badge--cabinet { background: var(--c-primary); color: #fff; }
.badge--lang { background: var(--c-bg); border: 1px solid var(--c-border); color: var(--c-text-muted); }
.doctor-card__note { margin: var(--space-3) 0 0; font-size: var(--fs-sm); color: var(--c-accent-dark); font-weight: 600; }
.doctor-card__location { margin: var(--space-3) 0 0; font-size: var(--fs-sm); font-weight: 600; color: var(--c-text); }

.doctor-card__body { padding: var(--space-4) var(--space-5) var(--space-5); flex-grow: 1; display: flex; flex-direction: column; }

.schedule-table { width: 100%; border-collapse: collapse; }
.schedule-table caption {
  text-align: left;
  font-size: var(--fs-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--c-text-muted);
  padding-bottom: var(--space-2);
}
.schedule-table th, .schedule-table td { padding: var(--space-2) var(--space-2); border-bottom: 1px solid var(--c-border); }
.schedule-table th { text-align: left; font-weight: 500; }
.schedule-table td { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.schedule-table tr:last-child th, .schedule-table tr:last-child td { border-bottom: 0; }
.schedule-table tr.is-today th, .schedule-table tr.is-today td {
  background: var(--c-primary-tint);
  color: var(--c-primary-darker);
  font-weight: 700;
}
.schedule-table tr.is-today th { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.schedule-table tr.is-today td { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.doctor-card__nurses {
  margin-top: auto;
  padding-top: var(--space-4);
  font-size: var(--fs-sm);
  color: var(--c-text-muted);
  line-height: 1.6;
}
.doctor-card__nurses strong { color: var(--c-text); }

.schedule-empty { padding: var(--space-6); text-align: center; color: var(--c-text-muted); }

.reg-info { max-width: 52rem; }
.reg-info h2 { margin-top: var(--space-6); }

/* ==========================================================================
   Generic page content
   ========================================================================== */
.page-hero {
  background: linear-gradient(135deg, var(--c-primary-darker) 0%, var(--c-primary) 70%);
  color: #fff;
  padding-block: var(--space-6);
}
.page-hero h1 { color: #fff; margin: 0; }
.page-hero p { margin: var(--space-2) 0 0; font-size: var(--fs-md); }
.page-hero .btn { margin-top: var(--space-3); white-space: normal; }

.entry-content { max-width: 52rem; }
.entry-content img { border-radius: var(--radius); }
.entry-content table { width: 100%; border-collapse: collapse; margin-bottom: var(--space-5); }
.entry-content th, .entry-content td { padding: var(--space-3); border: 1px solid var(--c-border); text-align: left; }
.entry-content th { background: var(--c-bg-alt); }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: #2c3547; color: #d8dce4; margin-top: var(--space-8); }
.site-footer a { color: #fff; }
.site-footer__grid {
  display: grid;
  gap: var(--space-6);
  padding-block: var(--space-7);
}
@media (min-width: 640px) { .site-footer__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .site-footer__grid { grid-template-columns: repeat(4, 1fr); } }
.site-footer h2 { color: #fff; font-size: var(--fs-md); margin-bottom: var(--space-3); }
.site-footer h2 a { text-decoration: none; }
.site-footer h2 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.site-footer__brand {
  display: inline-block;
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-4);
  background: #fff;
  border-radius: var(--radius-sm);
}
.site-footer__brand img { display: block; height: 56px; width: auto; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.site-footer__legal {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-block: var(--space-4);
  font-size: var(--fs-sm);
  color: #b8bfcc;
}

/* ==========================================================================
   Content components (used inside post_content)
   ========================================================================== */
.entry-content .lead { font-size: var(--fs-md); color: var(--c-text); max-width: 60ch; }

.pp-cards { display: grid; gap: var(--space-4); margin: var(--space-5) 0; }
.pp-cards > * { min-width: 0; max-width: 100%; }
@media (min-width: 800px) { .pp-cards { grid-template-columns: repeat(2, 1fr); } }
.pp-card--wide { grid-column: 1 / -1; }
.pp-cards > .pp-figure { margin: 0; height: 100%; }
.pp-cards > .pp-figure img { height: 100%; max-height: none; min-height: 240px; }
.pp-figure--wide { grid-column: 1 / -1; }
.pp-cards > .pp-figure--wide img { min-height: 0; height: 280px; }

/* Pretty bullets inside cards */
.pp-card ul { list-style: none; padding-left: 0; margin: 0 0 var(--space-4); }
.pp-card li { position: relative; padding-left: 1.5rem; margin-bottom: var(--space-2); }
.pp-card li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c-accent), var(--c-primary));
}

/* Content split: main + sticky aside (kontakt pages) */
.pp-split { display: grid; gap: var(--space-5); align-items: start; }
@media (min-width: 1000px) {
  .pp-split { grid-template-columns: minmax(0, 1fr) 20rem; }
  .pp-split__aside { position: sticky; top: 8.5rem; }
}
.pp-split__aside { display: grid; gap: var(--space-4); }
.pp-split__aside .pp-card { background: var(--c-primary-tint); border-color: rgba(49, 122, 189, 0.25); }
.pp-split__aside .pp-card li { padding-left: 0; padding-block: var(--space-2); margin-bottom: 0; border-bottom: 1px solid rgba(49, 122, 189, 0.18); font-size: var(--fs-sm); }
.pp-split__aside .pp-card li::before { display: none; }
.pp-split__aside .pp-card li:last-child { border-bottom: 0; padding-bottom: 0; }
.pp-card {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: var(--space-5);
  box-shadow: var(--shadow-card);
}
.pp-card h2, .pp-card h3 { font-size: var(--fs-lg); color: var(--c-primary-dark); padding-bottom: var(--space-2); border-bottom: 2px solid var(--c-primary-tint); }
.pp-card :last-child { margin-bottom: 0; }
.pp-card p, .pp-card li { font-size: var(--fs-base); }

.pp-links, .pp-files { list-style: none; margin: var(--space-4) 0 var(--space-6); padding: 0; display: grid; gap: var(--space-2); }
@media (min-width: 640px) { .pp-links { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .pp-links { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 640px) { .pp-files { grid-template-columns: repeat(2, 1fr); } }
/* Link list: light, boxless */
.pp-links a {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: var(--space-1) 0;
  text-decoration: none;
  font-weight: 600;
  color: var(--c-primary-dark);
}
.pp-links a::before { content: ""; flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--c-accent); }
.pp-links a:hover { color: var(--c-primary-darker); text-decoration: underline; text-underline-offset: 3px; }

/* File downloads: same light list, square marker */
.pp-files a {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: var(--space-1) 0;
  text-decoration: none;
  font-weight: 600;
  color: var(--c-primary-dark);
}
.pp-files a::before { content: ""; flex-shrink: 0; width: 8px; height: 8px; border-radius: 2px; background: var(--c-accent); }
.pp-files a:hover { color: var(--c-primary-darker); text-decoration: underline; text-underline-offset: 3px; }

.price-nav { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-6); }
.price-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-pill);
  background: var(--c-bg);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-primary-dark);
  text-decoration: none;
  transition: background-color 200ms ease-out, border-color 200ms ease-out, color 200ms ease-out;
}
.price-nav a:hover { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }

.price-block {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: var(--space-5);
  margin-bottom: var(--space-5);
  scroll-margin-top: 9rem;
  overflow-x: auto;
}
.price-block h2 { font-size: var(--fs-lg); color: var(--c-primary-dark); }
.entry-content .price-block table { margin-bottom: 0; }
.entry-content .price-block th, .entry-content .price-block td { border: 0; border-bottom: 1px solid var(--c-border); padding: var(--space-3) var(--space-2); }
.entry-content .price-block thead th { background: none; color: var(--c-text-muted); font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: 0.04em; }
.entry-content .price-block tbody tr:last-child td { border-bottom: 0; }
.entry-content .price-block tbody tr:hover td { background: var(--c-primary-tint); }
.price-block td:last-child { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--c-primary-darker); }
.price-note { font-size: var(--fs-sm); color: var(--c-text-muted); margin-top: var(--space-3); }

/* Mobile: price rows wrap instead of horizontal scrolling */
@media (max-width: 700px) {
  .price-block { overflow-x: visible; }
  .entry-content .price-block table,
  .entry-content .price-block thead,
  .entry-content .price-block tbody { display: block; }
  .entry-content .price-block tr {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: baseline;
    column-gap: var(--space-3);
    border-bottom: 1px solid var(--c-border);
    padding-block: var(--space-2);
  }
  .entry-content .price-block tr:last-child { border-bottom: 0; }
  .entry-content .price-block th,
  .entry-content .price-block td { display: block; border: 0; padding: 0; }
  .entry-content .price-block th:first-child,
  .entry-content .price-block td:first-child { flex: 1 1 62%; white-space: normal; text-align: left; }
  .entry-content .price-block td:last-child { margin-left: auto; }
}

.pp-figure { margin: var(--space-5) 0; }
.pp-figure img { width: 100%; max-height: 380px; object-fit: cover; border-radius: var(--radius); box-shadow: var(--shadow-card); }

.map-embed { margin-top: var(--space-6); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-card); border: 1px solid var(--c-border); }
.map-embed iframe { display: block; width: 100%; min-height: 420px; border: 0; }

.entry-content iframe { max-width: 100%; }

/* Wide content pages (patsiendile, hinnakiri, kontakt) use full container */
.entry-content--wide { max-width: none; }

/* Sidebar CTA block on schedule pages */
.schedule-cta { display: grid; gap: var(--space-3); margin-bottom: var(--space-4); }
.schedule-cta .btn { width: 100%; }
/* Page-hero subtitle + photo hero (location pages) */
.page-hero__subtitle { max-width: 60ch; opacity: 0.95; }
.page-hero--image { position: relative; overflow: hidden; }
.page-hero--image .page-hero__bg { position: absolute; inset: 0; }
.page-hero--image .page-hero__bg img { width: 100%; height: 100%; object-fit: cover; }
.page-hero--image .page-hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(31, 81, 130, 0.92) 0%, rgba(31, 81, 130, 0.72) 45%, rgba(49, 122, 189, 0.35) 100%);
}
.page-hero--image .container { position: relative; z-index: 1; padding-block: var(--space-8); }
.page-hero--image .page-hero__subtitle { font-size: var(--fs-lg); font-weight: 600; }

/* Location page: boxless spec-sheet layout */
.loc-details { display: grid; gap: var(--space-5) var(--space-6); margin: var(--space-4) 0 var(--space-6); }
@media (min-width: 640px) { .loc-details { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .loc-details { grid-template-columns: repeat(4, 1fr); } }
.loc-detail > span {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--c-primary-dark);
  margin-bottom: var(--space-2);
}
.loc-detail > span::before {
  content: "";
  display: block;
  width: 28px;
  height: 3px;
  border-radius: 2px;
  margin-bottom: var(--space-2);
  background: linear-gradient(90deg, var(--c-accent), var(--c-primary));
}
.loc-detail p { margin: 0 0 var(--space-1); font-weight: 500; }

.loc-sections section { padding-block: var(--space-6); border-top: 1px solid var(--c-border); }
.loc-sections h2 { font-size: var(--fs-xl); color: var(--c-primary-dark); }
.loc-sections h2::before,
.loc-topics h3::before {
  content: "";
  display: block;
  width: 28px;
  height: 3px;
  border-radius: 2px;
  margin-bottom: var(--space-2);
  background: linear-gradient(90deg, var(--c-accent), var(--c-primary));
}
.loc-topics { display: grid; gap: var(--space-4) var(--space-7); border-top: 1px solid var(--c-border); padding-block: var(--space-5); }
@media (min-width: 800px) { .loc-topics { grid-template-columns: repeat(2, 1fr); } }
.loc-topics section { border-top: 0; padding-block: var(--space-2); }
.loc-topics h3 { font-size: var(--fs-md); color: var(--c-primary-dark); }
.loc-legal { font-size: var(--fs-sm); color: var(--c-text-muted); border-top: 1px solid var(--c-border); padding-top: var(--space-4); }

/* ==========================================================================
   Cookie consent
   ========================================================================== */
.cookie-consent {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  background: var(--c-bg);
  border-top: 1px solid var(--c-border);
  box-shadow: 0 -8px 32px -12px rgba(31, 81, 130, 0.28);
}
.cookie-consent[hidden] { display: none; }
.cookie-consent__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding-block: var(--space-4);
}
.cookie-consent__text strong { display: block; color: var(--c-primary-dark); margin-bottom: var(--space-1); }
.cookie-consent__text p { margin: 0; font-size: var(--fs-sm); color: var(--c-text-muted); line-height: 1.6; }
.cookie-consent__actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.cookie-consent__actions .btn { flex: 1 1 auto; min-height: 44px; }
@media (min-width: 800px) {
  .cookie-consent__inner { flex-direction: row; align-items: center; }
  .cookie-consent__text { flex: 1; }
  .cookie-consent__text p { max-width: 70ch; }
  .cookie-consent__actions { flex: 0 0 auto; }
  .cookie-consent__actions .btn { flex: 0 0 auto; }
}

/* ==========================================================================
   Utilities
   ========================================================================== */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
