/* Kinnisvarakontroll staging — forest green / beige / charcoal */
:root {
  color-scheme: light;
  --green: #1a3d2e;
  --green-mid: #2d5a45;
  --green-soft: #3d6b54;
  --beige: #f5f1e8;
  --beige-dark: #ebe6da;
  --white: #ffffff;
  --text: #1c1c1c;
  --muted: #5a5a5a;
  --border: #d9d3c6;
  --error: #8b2e2e;
  --ok: #1a3d2e;
  --radius: 10px;
  --shadow: 0 8px 24px rgba(26, 61, 46, 0.08);
  --font-serif: "Lora", Georgia, serif;
  --font-sans: "Source Sans 3", system-ui, sans-serif;
  --max: 960px;
}


/* Dark theme — remap surfaces; hero/footer stay forest green */
html[data-theme="dark"] {
  color-scheme: dark;
  --beige: #0f1512;
  --beige-dark: #1a221e;
  --white: #18201c;
  --text: #e7ebe7;
  --muted: #9aa89f;
  --border: #2c3a33;
  --green: #8fbfa4;
  --green-mid: #a3cdb6;
  --green-soft: #6f9a82;
  --error: #e08a8a;
  --ok: #8fbfa4;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
html[data-theme="dark"] .site-header {
  background: var(--white);
  border-bottom-color: var(--border);
}
html[data-theme="dark"] .logo-mark {
  background: #1a3d2e;
  color: #f5f1e8;
}
html[data-theme="dark"] .btn-solid {
  background: #2d5a45;
  color: #f5f1e8;
}
html[data-theme="dark"] .btn-solid:hover {
  background: #3d6b54;
  color: #fff;
}
html[data-theme="dark"] .btn-outline {
  color: var(--green-mid);
  border-color: var(--border);
}
html[data-theme="dark"] .btn-outline:hover {
  background: #2d5a45;
  color: #f5f1e8;
  border-color: #2d5a45;
}
html[data-theme="dark"] .site-footer {
  background: #0d1a14;
  color: rgba(245, 241, 232, 0.9);
}
html[data-theme="dark"] .site-footer .footer-brand strong {
  color: #f5f1e8;
}
html[data-theme="dark"] .site-footer .muted {
  color: rgba(245, 241, 232, 0.7);
}
html[data-theme="dark"] .site-footer a {
  color: #f5f1e8;
}
html[data-theme="dark"] .site-footer a:hover {
  color: #ffffff;
}
html[data-theme="dark"] .site-footer .social-link {
  background: rgba(245, 241, 232, 0.14);
  color: #f5f1e8 !important;
}
html[data-theme="dark"] .site-footer .social-link:hover {
  background: rgba(245, 241, 232, 0.24);
  color: #ffffff !important;
}
html[data-theme="dark"] .site-footer .social-link.is-disabled {
  opacity: 0.55;
  color: rgba(245, 241, 232, 0.75) !important;
}

/* Dark theme: hero/banner titles must stay light (don't use remapped --white) */
html[data-theme="dark"] .hero h1,
html[data-theme="dark"] .page-banner h1 {
  color: #f5f1e8 !important;
}
html[data-theme="dark"] .hero .lead,
html[data-theme="dark"] .page-banner .lead {
  color: rgba(245, 241, 232, 0.92) !important;
}
html[data-theme="dark"] .hero .banner-label,
html[data-theme="dark"] .page-banner .banner-label,
html[data-theme="dark"] .banner-label {
  color: rgba(245, 241, 232, 0.8) !important;
}
html[data-theme="dark"] .hero .btn-primary {
  background: #f5f1e8;
  color: #1a3d2e;
}
html[data-theme="dark"] .hero .btn-primary:hover {
  background: #ffffff;
  color: #1a3d2e;
}
html[data-theme="dark"] .hero .btn-ghost {
  color: #f5f1e8;
  border-color: rgba(245, 241, 232, 0.65);
}
html[data-theme="dark"] .hero .btn-ghost:hover {
  color: #ffffff;
  border-color: #ffffff;
}
html[data-theme="dark"] .flash-success {
  background: #1a2e24;
  border-color: #2d5a45;
  color: #b6dcc6;
}
html[data-theme="dark"] .flash-error {
  background: #2a1818;
  border-color: #8b2e2e;
  color: #e08a8a;
}
html[data-theme="dark"] .price-table th {
  background: var(--beige-dark);
  color: var(--green-mid);
}
html[data-theme="dark"] .price-table td:last-child {
  color: var(--green-mid);
}
html[data-theme="dark"] .nav-toggle span {
  background: var(--green-mid);
}
/* Light = moon (go dark); dark = sun (go light). Only ONE icon visible. */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--beige);
  color: var(--green);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.theme-toggle:hover {
  border-color: var(--green-mid);
  color: var(--green-mid);
}
.theme-toggle svg {
  width: 1.45rem;
  height: 1.45rem;
  flex-shrink: 0;
}
.theme-toggle svg.icon-sun { display: none !important; }
.theme-toggle svg.icon-moon { display: block !important; }
html[data-theme="dark"] .theme-toggle svg.icon-sun { display: block !important; }
html[data-theme="dark"] .theme-toggle svg.icon-moon { display: none !important; }

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--beige);
}

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

a { color: var(--green-mid); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--green); }

.wrap { width: min(100% - 2rem, var(--max)); margin-inline: auto; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--green);
  color: var(--white);
  padding: 0.5rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

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

/* Header */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 4rem;
  flex-wrap: wrap;
}
.header-inner .site-nav {
  margin-left: auto;
}
.header-tools {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.lang-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.lang-switcher a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.15rem 0.1rem;
}
.lang-switcher a:hover,
.lang-switcher a.is-active {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.lang-sep { color: var(--border); user-select: none; }
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--green);
  font-weight: 600;
}
.logo-mark {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 8px;
  background: var(--green);
  color: var(--beige);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}
.logo-text { font-family: var(--font-serif); font-size: 1.05rem; }

.site-nav {
  display: flex;
  gap: 0.25rem 1.25rem;
  flex-wrap: wrap;
}
.site-nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  padding: 0.35rem 0;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 0.5rem;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 1.4rem;
  height: 2px;
  background: var(--green);
  margin: 4px 0;
}

@media (max-width: 700px) {
  .nav-toggle { display: block; }
  .header-inner { position: relative; }
  .header-inner .site-nav { margin-left: 0; }
  .header-tools { margin-left: auto; }
  .site-nav {
    display: none;
    width: 100%;
    order: 3;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.5rem 0 1rem;
    border-top: 1px solid var(--border);
  }
  .site-nav.is-open { display: flex; }
}

/* Typography */
h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.25;
  color: var(--green);
  margin: 0 0 0.75rem;
}
h1 { font-size: clamp(1.75rem, 4vw, 2.35rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.7rem); }
h3 { font-size: 1.15rem; }
.lead { font-size: 1.15rem; color: var(--muted); margin: 0 0 1.5rem; max-width: 36rem; }
.muted { color: var(--muted); }
.page { padding: 2.25rem 0 3rem; }
.section-label {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green-mid);
  margin-bottom: 0.5rem;
}

/* Hero — local photo first; dark gradient fallback if image missing
   Secondary hotlink: https://kinnisvarakontroll.ee/wp-content/uploads/2026/08/kinnisvarakontroll-1024x683.jpg
*/
.hero {
  position: relative;
  background-color: var(--green);
  background-image:
    linear-gradient(160deg, rgba(26, 61, 46, 0.55) 0%, rgba(28, 40, 32, 0.62) 100%),
    url('img/hero.jpg');
  background-size: cover;
  background-position: center;
  color: var(--beige);
  padding: 4rem 0 3.25rem;
  min-height: 20rem;
  display: flex;
  align-items: center;
}
.hero h1 { color: #ffffff; margin-bottom: 0.75rem; }
.hero .lead { color: rgba(245, 241, 232, 0.92); }
.banner-label { color: rgba(245, 241, 232, 0.75) !important; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

/* Page banners (teenused / broneeri / minust / kontakt)
   Secondary hotlink: https://kinnisvarakontroll.ee/wp-content/uploads/2026/08/d881c4542ed6ca5e5559fd77a88bfe8efcd8c972-1024x576.jpg
*/
.page-banner {
  position: relative;
  min-height: 8rem;
  background-color: var(--green);
  background-image:
    linear-gradient(160deg, rgba(26, 61, 46, 0.82) 0%, rgba(28, 40, 32, 0.75) 100%),
    url('img/banner-page.jpg');
  background-size: cover;
  background-position: center;
  color: var(--beige);
  padding: 2rem 0 1.75rem;
}
.page-banner h1 { color: #ffffff; margin-bottom: 0.5rem; }
.page-banner .lead {
  color: rgba(245, 241, 232, 0.9);
  margin-bottom: 0;
}
.page-banner + .page { padding-top: 1.75rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.25rem;
  border-radius: 999px;
  font-weight: 600;
  font-family: inherit;
  font-size: 1rem;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-primary {
  background: var(--beige);
  color: var(--green);
}
.btn-primary:hover { background: var(--white); color: var(--green); }
.btn-ghost {
  background: transparent;
  color: var(--beige);
  border-color: rgba(245, 241, 232, 0.45);
}
.btn-ghost:hover { border-color: var(--beige); color: var(--white); }
.btn-solid {
  background: var(--green);
  color: var(--beige);
}
.btn-solid:hover { background: var(--green-mid); color: var(--white); }
.btn-outline {
  background: transparent;
  color: var(--green);
  border-color: var(--green);
}
.btn-outline:hover { background: var(--green); color: var(--beige); }

/* Cards / grids */
.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: -1.5rem auto 2rem;
  position: relative;
  z-index: 1;
}
.fact {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow);
  text-align: center;
}
.fact strong {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.45rem;
  color: var(--green);
  margin-bottom: 0.2rem;
}
.fact span { color: var(--muted); font-size: 0.95rem; }

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin: 1.25rem 0 2rem;
}
.service-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.service-card .price {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--green);
  font-weight: 600;
}
.service-card .price small {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--muted);
}
.service-card p { margin: 0; color: var(--muted); font-size: 0.95rem; flex: 1; }
.cta-band {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.cta-band p { margin: 0; max-width: 28rem; color: var(--muted); }

@media (max-width: 720px) {
  .facts, .services-grid { grid-template-columns: 1fr; }
  .facts { margin-top: -1rem; }
}

/* Forms */
.form-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  max-width: 36rem;
}
.form-grid {
  display: grid;
  gap: 1rem;
}
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 560px) {
  .form-row-2 { grid-template-columns: 1fr; }
}
label {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 0.35rem;
}
.req::after { content: " *"; color: var(--error); }
input, select, textarea {
  width: 100%;
  font: inherit;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--beige);
  color: var(--text);
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--green-mid);
  outline-offset: 1px;
  border-color: var(--green-mid);
  background: var(--white);
}
textarea { min-height: 6rem; resize: vertical; }
.hp-field {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px; height: 1px;
  overflow: hidden;
}
.form-actions { margin-top: 0.5rem; }
.form-hint { font-size: 0.88rem; color: var(--muted); margin: 0.5rem 0 0; }

.flash {
  margin: 1rem 0 0;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--white);
}
.flash-success { border-color: var(--green-mid); color: var(--ok); background: #eef5f0; }
.flash-error { border-color: var(--error); color: var(--error); background: #faf0f0; }

/* Compact content blocks */
.prose { max-width: 38rem; }
.prose p { margin: 0 0 1rem; }
.contact-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
}
.contact-list li {
  margin-bottom: 0.65rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
}
.contact-list strong { min-width: 5.5rem; color: var(--green); }

.price-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  margin: 1rem 0 1.5rem;
}
.price-table th, .price-table td {
  text-align: left;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
}
.price-table th { background: var(--beige-dark); color: var(--green); font-family: var(--font-serif); }
.price-table tr:last-child td { border-bottom: 0; }
.price-table td:last-child { font-weight: 600; color: var(--green); white-space: nowrap; }

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}
@media (max-width: 720px) {
  .split { grid-template-columns: 1fr; }
}


/* Portrait + contact/about layouts
   Ranel secondary: https://kinnisvarakontroll.ee/wp-content/uploads/2026/08/IMG_5867-768x1024.jpeg
*/
.portrait-card {
  margin: 0 0 1.25rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: linear-gradient(160deg, var(--green) 0%, #24352c 100%);
  max-width: 18rem;
}
.portrait-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center top;
}
.about-layout,
.contact-layout {
  display: grid;
  grid-template-columns: minmax(12rem, 16rem) 1fr;
  gap: 2rem;
  align-items: start;
}
.contact-aside .portrait-card { max-width: 100%; }
@media (max-width: 720px) {
  .about-layout,
  .contact-layout { grid-template-columns: 1fr; }
  .portrait-card { max-width: 14rem; }
}

/* Footer */
.site-footer {
  background: var(--green);
  color: rgba(245, 241, 232, 0.85);
  padding: 2rem 0;
  margin-top: 1rem;
}
.footer-inner {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: 1.4fr 1fr;
}
.footer-brand strong {
  display: block;
  color: var(--white);
  font-family: var(--font-serif);
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
}
.footer-brand p, .footer-note { margin: 0.25rem 0 0; font-size: 0.92rem; }
.site-footer .muted { color: rgba(245, 241, 232, 0.65); }
.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: flex-start;
}
.site-footer a { color: var(--beige); }
.site-footer a:hover { color: var(--white); }
@media (max-width: 600px) {
  .footer-inner { grid-template-columns: 1fr; }
}

.portrait-card figcaption {
  margin: 0;
  padding: 0.65rem 0.85rem;
  background: var(--white);
  color: var(--green);
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1rem;
  text-align: center;
  border-top: 1px solid var(--border);
}

/* Inspection scope */
.scope-block { margin-top: 2rem; }
.scope-list {
  margin: 0.75rem 0 1.25rem;
  padding-left: 1.2rem;
}
.scope-list li {
  margin: 0.55rem 0;
  padding-left: 0.25rem;
}
.scope-list li::marker { color: var(--green-mid); }

/* Footer social */
.footer-social {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.75rem;
}
.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 999px;
  background: rgba(245, 241, 232, 0.12);
  color: var(--beige) !important;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.social-link:hover {
  background: rgba(245, 241, 232, 0.22);
  color: var(--white) !important;
}
.social-link.is-disabled {
  opacity: 0.45;
  cursor: default;
}

/* File upload */
input[type="file"] {
  display: block;
  width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--beige);
  font: inherit;
}
.form-grid .form-hint { margin-top: 0.35rem; }
