/* koirametsat.fi */
:root {
  --bg: #F3F5EF;
  --surface: #FFFFFF;
  --surface-2: #EAF0E6;
  --ink: #17251C;
  --muted: #4F5E54;
  --line: #DCE5D8;
  --line-strong: #CBD9C7;
  --forest: #173D2A;
  --forest-2: #1F4D36;
  --on-forest: #FFFFFF;
  --on-forest-muted: #CFE0D2;
  --chip: #E7F0E4;
  --chip-ink: #1F4D36;
  --accent: #B4501A;
  --accent-ink: #FFFFFF;
  --gold: #E8A33D;
  --star: #C98712;
  --warn-bg: #FBEDE3;
  --warn-ink: #8A3D12;
  --ok-bg: #E3F1E4;
  --ok-ink: #1C5B33;
  --shadow: 0 24px 60px rgba(23, 37, 28, .16);
  --radius: 18px;
  --display: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --body: 'Figtree', 'Segoe UI', system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0F1712; --surface: #17221B; --surface-2: #131D17; --ink: #E8EFE9; --muted: #A8B8AD;
    --line: #2A3A30; --line-strong: #34483B; --forest: #0E2A1C; --forest-2: #2E6B4A;
    --chip: #213528; --chip-ink: #BFE0C8; --accent: #D9692C; --accent-ink: #160A03; --star: #E8A33D;
    --warn-bg: #3A2214; --warn-ink: #F6C7A6; --ok-bg: #173622; --ok-ink: #B6E4C3;
    --shadow: 0 24px 60px rgba(0, 0, 0, .45); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0F1712; --surface: #17221B; --surface-2: #131D17; --ink: #E8EFE9; --muted: #A8B8AD;
  --line: #2A3A30; --line-strong: #34483B; --forest: #0E2A1C; --forest-2: #2E6B4A;
  --chip: #213528; --chip-ink: #BFE0C8; --accent: #D9692C; --accent-ink: #160A03; --star: #E8A33D;
  --warn-bg: #3A2214; --warn-ink: #F6C7A6; --ok-bg: #173622; --ok-ink: #B6E4C3;
  --shadow: 0 24px 60px rgba(0, 0, 0, .45); color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--forest-2); }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.02em; line-height: 1.12; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .wrap { padding: 0 24px; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* demo-palkki */
.demo-bar { background: var(--gold); color: #2B1A00; font-size: 14px; font-weight: 600; text-align: center; padding: 8px 16px; }
.demo-bar a { color: #2B1A00; }

/* ylätunniste */
.hero { background: var(--forest); color: var(--on-forest); position: relative; overflow: hidden; }
.topbar { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; padding-top: 20px; position: relative; z-index: 2; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--on-forest); font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: -0.02em; }
.logo b { color: var(--gold); font-weight: 800; }
.nav { display: flex; flex-wrap: wrap; gap: 6px 22px; align-items: center; font-weight: 600; font-size: 15px; }
.nav a { color: #E6EFE6; text-decoration: none; }
.nav a:hover { color: #fff; }
.nav .nav-cta { background: #fff; color: #173D2A; padding: 10px 16px; border-radius: 999px; }
.hero-body { padding: 64px 0 150px; position: relative; z-index: 2; }
.pill { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.22); padding: 7px 14px; border-radius: 999px; font-size: 14px; font-weight: 600; color: #E6EFE6; }
.hero h1 { font-weight: 800; font-size: clamp(38px, 6vw, 74px); line-height: 1.03; letter-spacing: -0.035em; margin: 20px 0 16px; max-width: 840px; }
.hero p.lead { font-size: 19px; color: var(--on-forest-muted); max-width: 640px; margin: 0; }
.treeline { position: absolute; left: 0; bottom: -1px; width: 100%; height: 190px; z-index: 1; display: block; }

/* hakupaneeli */
.search { position: relative; z-index: 3; margin-top: -96px; }
.panel { background: var(--surface); border-radius: 24px; box-shadow: var(--shadow); padding: 22px; display: flex; flex-direction: column; gap: 18px; }
@media (min-width: 640px) { .panel { padding: 28px; } }
.search-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 300px; min-width: 0; }
.field label, .label { font-weight: 700; font-size: 15px; }
.select-wrap { position: relative; }
.select-wrap svg { position: absolute; top: 50%; transform: translateY(-50%); pointer-events: none; }
.select-wrap .ico-l { left: 16px; color: var(--forest-2); }
.select-wrap .ico-r { right: 16px; color: var(--ink); }
.big-select { width: 100%; appearance: none; -webkit-appearance: none; font: inherit; font-size: 18px; font-weight: 600; color: var(--ink); background: var(--bg); border: 2px solid var(--line); border-radius: 14px; height: 58px; padding: 0 44px 0 50px; cursor: pointer; }
.or { font-weight: 600; color: var(--muted); padding: 0 4px 16px; }
@media (max-width: 640px) {
  .or { display: none; }
  .search-row .btn-accent { flex: 1 1 100%; }
  .chips .divider { display: none; }
}
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 2px solid transparent; font: inherit; font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer; transition: transform .15s ease, background .15s ease, border-color .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn[disabled] { opacity: .6; cursor: wait; transform: none; }
.btn-accent { background: var(--accent); color: var(--accent-ink); height: 58px; padding: 0 24px; font-size: 17px; border-radius: 14px; box-shadow: 0 8px 20px rgba(180,80,26,.28); }
.btn-dark { background: var(--forest); color: #fff; }
:root[data-theme="dark"] .btn-dark { background: var(--forest-2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-dark { background: var(--forest-2); } }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--forest-2); }
.btn-gold { background: var(--gold); color: #1E1300; }
.btn-line-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.45); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chips .label { font-size: 14px; color: var(--muted); margin-right: 4px; }
.chip { font: inherit; font-size: 14px; font-weight: 600; min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--surface); color: var(--ink); border: 2px solid var(--line); cursor: pointer; }
.chip:hover { border-color: var(--forest-2); }
.chip[aria-pressed="true"] { background: var(--forest-2); color: #fff; border-color: var(--forest-2); }
.divider { width: 1px; height: 28px; background: var(--line); margin: 0 4px; }
.small-select { font: inherit; font-size: 14px; font-weight: 600; min-height: 44px; padding: 0 12px; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); }
.note { margin: 0; font-size: 14px; color: var(--warn-ink); background: var(--warn-bg); padding: 10px 14px; border-radius: 10px; }

/* tulokset */
.section { padding: 56px 0 24px; }
.section-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section h2 { font-weight: 800; font-size: clamp(28px, 3.4vw, 36px); margin: 0; }
.subtle { margin: 6px 0 0; color: var(--muted); font-weight: 600; }
.results-grid { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.results-list { flex: 999 1 540px; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.map-col { flex: 1 1 360px; min-width: 0; position: sticky; top: 16px; }
@media (max-width: 960px) { .map-col { position: static; order: -1; } }
.map { height: 560px; border-radius: 22px; overflow: hidden; border: 1px solid var(--line-strong); background: var(--surface-2); }
@media (max-width: 960px) { .map { height: 340px; } }
.map-note { font-size: 13px; color: var(--muted); margin: 8px 4px 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; gap: 16px; align-items: flex-start; transition: box-shadow .2s ease, transform .2s ease; }
.card:hover { box-shadow: 0 14px 34px rgba(23,37,28,.12); transform: translateY(-2px); }
.num { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 13px; background: var(--forest); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 800; font-size: 19px; }
.num.plain { background: #4F7A60; }
.card-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.card-top { display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: space-between; align-items: baseline; }
.card h3 { margin: 0; font-size: 20px; font-weight: 700; }
.card h3 button { all: unset; cursor: pointer; }
.card h3 button:hover { text-decoration: underline; }
.card h3 button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
.dist { font-weight: 800; font-size: 17px; color: var(--forest-2); white-space: nowrap; }
.meta { font-size: 15px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; }
.stars { display: inline-flex; align-items: center; gap: 4px; color: var(--star); font-weight: 700; }
.stars span { color: var(--muted); font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; align-items: center; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--chip-ink); background: var(--chip); padding: 6px 10px; border-radius: 999px; }
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font-size: 13px; font-weight: 600; background: var(--chip); color: var(--chip-ink); padding: 5px 10px; border-radius: 999px; }
.empty { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.more { min-height: 52px; border-radius: 14px; border: 2px dashed var(--line-strong); background: transparent; color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }

/* kartta-pinnit */
.pin { width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--forest); border: 2px solid #fff; box-shadow: 0 3px 8px rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; }
.pin span { transform: rotate(45deg); color: #fff; font: 800 12px var(--body); }
.pin.plain { background: #4F7A60; }
.origin-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); border: 4px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.3); }

/* maakunnat */
.regions { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.region { font: inherit; text-align: left; display: flex; flex-direction: column; gap: 2px; min-height: 62px; padding: 12px 16px; border-radius: 14px; font-weight: 700; font-size: 16px; background: var(--surface); color: var(--ink); border: 2px solid var(--line); cursor: pointer; }
.region small { font-size: 13px; font-weight: 600; color: var(--muted); }
.region:hover { border-color: var(--forest-2); }
.region[aria-pressed="true"] { background: var(--forest-2); color: #fff; border-color: var(--forest-2); }
.region[aria-pressed="true"] small { color: #E3EFE5; }

/* artikkeli */
.article { padding: 56px 0; }
.article-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; }
@media (min-width: 1000px) { .article-grid { grid-template-columns: 260px minmax(0, 1fr); } }
.toc { position: sticky; top: 16px; align-self: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; font-size: 15px; }
@media (max-width: 999px) { .toc { position: static; } }
.toc ol { margin: 8px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.prose { max-width: 760px; }
.prose h2 { font-size: clamp(26px, 3vw, 34px); font-weight: 800; margin: 48px 0 14px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { font-size: 21px; margin: 28px 0 8px; }
.prose p, .prose li { color: var(--ink); }
.prose p { margin: 0 0 14px; }
.prose ul, .prose ol { padding-left: 22px; margin: 0 0 16px; }
.prose li { margin-bottom: 6px; }
.callout { background: var(--chip); border-radius: 16px; padding: 18px 20px; margin: 18px 0; }
.callout p:last-child { margin: 0; }
.table-box { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; margin: 16px 0 20px; background: var(--surface); }
table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 15px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface-2); font-weight: 700; }
tr:last-child td { border-bottom: none; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 4px 18px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 700; padding: 14px 0; list-style-position: outside; }
.faq details p { margin: 0 0 14px; }

/* lisää-osio */
.cta { background: var(--forest); color: #fff; border-radius: 28px; padding: 32px; display: flex; flex-wrap: wrap; gap: 32px; align-items: center; margin-bottom: 72px; }
@media (min-width: 640px) { .cta { padding: 44px; } }
.cta h2 { font-size: clamp(28px, 3.4vw, 38px); font-weight: 800; margin: 0 0 12px; }
.cta p { color: var(--on-forest-muted); font-size: 18px; margin: 0 0 20px; }
.cta strong { color: #fff; }
.cta-main { flex: 1 1 400px; min-width: 0; }
.code-box { flex: 1 1 320px; min-width: 0; background: rgba(0,0,0,.25); border: 1px solid rgba(255,255,255,.14); border-radius: 18px; padding: 20px; }
.code-box pre { margin: 12px 0 0; white-space: pre-wrap; word-break: break-all; font: 13px/1.55 ui-monospace, Menlo, Consolas, monospace; color: var(--on-forest-muted); }
.footer { border-top: 1px solid var(--line); background: var(--surface-2); }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 14px; justify-content: space-between; align-items: center; padding-top: 28px; padding-bottom: 28px; font-size: 14px; color: var(--muted); }

/* dialogit */
dialog { border: none; padding: 0; border-radius: 22px; width: min(720px, calc(100vw - 24px)); max-height: calc(100vh - 32px); background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px rgba(0,0,0,.35); }
dialog::backdrop { background: rgba(10, 20, 14, .55); }
.dlg-head { position: sticky; top: 0; background: var(--surface); padding: 20px 22px 14px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; z-index: 2; }
.dlg-head h2 { margin: 0; font-size: 26px; font-weight: 800; }
.dlg-body { padding: 18px 22px 24px; display: flex; flex-direction: column; gap: 18px; }
.icon-btn { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.form { display: flex; flex-direction: column; gap: 14px; }
.form .row { display: flex; flex-wrap: wrap; gap: 12px; }
.form .row > .f { flex: 1 1 200px; min-width: 0; }
.f { display: flex; flex-direction: column; gap: 6px; }
.f label { font-weight: 700; font-size: 14px; }
.f .hint { font-size: 13px; color: var(--muted); }
input[type=text], input[type=email], input[type=url], input[type=month], input[type=number], select.inp, textarea { font: inherit; font-size: 16px; color: var(--ink); background: var(--bg); border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; min-height: 46px; width: 100%; }
textarea { min-height: 130px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--forest-2); outline: none; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 12px; }
.checks label { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 15px; min-height: 36px; }
.checks input { width: 18px; height: 18px; accent-color: var(--forest-2); }
.star-input { border: none; margin: 0; padding: 0; }
.star-input legend { font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.star-row { display: inline-flex; flex-direction: row-reverse; gap: 2px; }
.star-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.star-row label { cursor: pointer; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; color: var(--line-strong); }
.star-row label svg { width: 34px; height: 34px; }
.star-row input:checked ~ label, .star-row label:hover, .star-row label:hover ~ label { color: var(--star); }
.star-row input:focus-visible + label { outline: 3px solid var(--gold); border-radius: 8px; }
.counter { font-size: 13px; font-weight: 700; color: var(--warn-ink); }
.counter.ok { color: var(--ok-ink); }
.msg { padding: 12px 14px; border-radius: 12px; font-weight: 600; font-size: 15px; }
.msg.ok { background: var(--ok-bg); color: var(--ok-ink); }
.msg.err { background: var(--warn-bg); color: var(--warn-ink); }
.review { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.review-head { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-size: 14px; color: var(--muted); }
.review-head strong { color: var(--ink); font-size: 15px; }
.review p { margin: 0; white-space: pre-line; }
.reply { background: var(--surface-2); border-radius: 12px; padding: 10px 14px; font-size: 15px; }
.rating-sum { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; background: var(--surface-2); border-radius: 16px; padding: 14px 16px; }
.rating-big { font-family: var(--display); font-size: 40px; font-weight: 800; line-height: 1; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--forest); color: #fff; padding: 14px 20px; border-radius: 14px; font-weight: 600; box-shadow: var(--shadow); z-index: 9999; max-width: calc(100vw - 32px); }
.honey { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
