/* Loaded only on the Eesti Vabariik homepage. */
:root {
  --ink: #131b23;
  --sea: #075994;
  --paper: #fff;
  --line: #d0dfe6;
  --flag-blue: #0072ce;
  --action-blue: #0064ac;
}
header { border-top: 3px solid var(--flag-blue); border-bottom-color: #d6e3eb }
.brand b { color: var(--flag-blue) }
.bar nav a { color: var(--ink) }
.bar nav a:hover, .links a:hover { color: var(--action-blue) }
.national-hero {
  border-bottom: 1px solid #d1e3d7;
  background-color: #f0f8fb;
  background-image: linear-gradient(160deg, #e4f4ff 0%, #f5fbff 46%, #f3f9ee 80%, #e4f1dc 100%);
}
.bar { min-height: 3.25rem }
.bar nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--sea); text-decoration: underline }
.national-layout {
  display: grid;
  grid-template-columns: minmax(17rem, .72fr) minmax(0, 1.4fr);
  align-items: start;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  padding-block: clamp(1rem, 2.5vw, 2.25rem);
}
.national-lead, .national-main { min-width: 0 }
.national-main { display: grid; gap: 1.25rem }
.national-lead .eyebrow {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: #34536b;
  font-size: .8125rem;
  letter-spacing: .07em;
}
.national-lead .eyebrow::before {
  content: "";
  flex: none;
  width: 1.7rem;
  aspect-ratio: 11 / 7;
  background: linear-gradient(to bottom, #0072ce 0 33.333%, #101216 33.333% 66.667%, #fff 66.667%);
  box-shadow: 0 0 0 1px #153b5824;
}
.national-lead h1 {
  margin: .45rem 0 .9rem;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1.07;
  letter-spacing: -.035em;
  color: #101820;
}
.national-lead h1 span { color: #0068b7 }
#riigikorraldus, .home-map-links { margin-top: 1.45rem }
.national-lead nav h2 { font-size: 1.55rem; margin-bottom: .55rem }
.home-state-links {
  display: grid;
  border: 1px solid #b9ceda;
  border-radius: .55rem;
  background: white;
  overflow: hidden;
}
.home-state-links a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: .55rem 1rem;
  color: #133d58;
  font-weight: 650;
  text-decoration: none;
}
.home-state-links a + a { border-top: 1px solid #dce6eb }
.home-state-links a:hover, .home-state-links a:focus-visible { background: #e8f4fc; text-decoration: underline }
.home-state-links a:focus-visible { outline-offset: -3px }
.map-link-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 1rem }
.map-link-grid a, .home-map-links summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding-block: .4rem;
  color: var(--sea);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}
.map-link-grid a { border-bottom: 1px solid #c6d9e1; overflow-wrap: anywhere }
.home-map-links summary { display: list-item; align-content: center; cursor: pointer; width: fit-content }
.map-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: .45rem .85rem;
  background: var(--action-blue);
  border: 1px solid var(--action-blue);
  border-radius: .35rem;
  color: white;
  font-weight: 650;
  text-decoration: none;
}
.map-open:hover { background: #004b82; color: white }
.map-open[hidden] { display: none }
.mapframe {
  min-width: 0;
  border: 1px solid #bad3de;
  border-radius: .8rem;
  background: white;
}
.mapframe.map-ready {
  display: grid;
  grid-template-columns: min-content minmax(0, 1fr);
  grid-template-areas: "tools surface" "open open" "search search" "caption caption";
  border: 1px solid #bad3de;
  border-radius: .8rem;
  background: white;
}
.map-search { grid-area: search }
.map-surface { grid-area: surface; min-width: 0 }
.map-open { grid-area: open; justify-self: start; margin: .4rem .55rem 0; max-width: calc(100% - 1.1rem) }
.mapframe figcaption { grid-area: caption }
.map-search { padding: .75rem .95rem .85rem }
.map-search-title { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: .1rem .5rem; margin-bottom: .35rem }
.map-search label { color: var(--ink); margin: 0; font-size: 1rem }
.map-search-title span { color: #52687b; font-size: .875rem }
.map-search input { border-color: #89a4b7; border-radius: .35rem }
.map-search form { position: relative }
#map-results { left: 0; right: 0; top: 100%; z-index: 1; border-color: #91aac0 }
#map-results button:hover, #map-results button:focus { background: #e4f2ff }
.mapframe .map-surface {
  background: #e4f4fc;
  border-block: 1px solid #c9dfe4;
  min-height: clamp(320px, 35vw, 470px);
  height: auto;
}
.map-surface > svg { height: 100%; max-height: none }
.mapframe .leaflet-overlay-pane svg.leaflet-image-layer { max-height: none; max-width: none }
.mapframe svg .water { fill: #376780 }
.mapframe .map-surface a path { fill: #a3ce91; stroke: #53835e; stroke-width: .75 }
.mapframe .map-surface a:hover path, .mapframe .map-surface a:focus path,
.mapframe .map-surface a.selected path { fill: #0072ce; stroke: #094a7a; stroke-width: 1.6 }
.map-surface .map-name { background: #17364bea }
.map-surface .map-name.chosen { background: #004d86; color: white }
.map-tools {
  grid-area: tools;
  align-items: start;
  padding: .4rem 0 .4rem .4rem;
  background: #e4f4fc;
  border-block: 1px solid #c9dfe4;
}
.map-zoom { flex-direction: column; gap: .2rem; width: 3.4rem }
.map-zoom button { padding: .15rem .25rem; line-height: 1.1 }
.map-zoom [data-reset] { font-size: .875rem }
.map-zoom button {
  background: white;
  color: #13466a;
  border-color: #acbfce;
  border-radius: .3rem;
}
.map-zoom button:enabled:hover { background: #e2f1ff }
.map-ready figcaption, .mapframe figcaption {
  text-align: left;
  color: #516674;
  font-size: .875rem;
  line-height: 1.4;
  padding: .3rem .65rem .4rem;
}
.section { margin-block: clamp(.75rem, 1.6vw, 1.4rem) }
.section h2 { font-size: clamp(1.45rem, 2.5vw, 2rem); margin-bottom: .7rem }
.topic-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem }
.topic-links a {
  display: grid;
  align-content: center;
  min-height: 44px;
  padding: .65rem .85rem;
  border: 1px solid var(--line);
  border-radius: .4rem;
  color: var(--sea);
  background: white;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.25;
}
.topic-links a:hover { background: #eff7ff; border-color: #82aac3 }
.state-explainer { margin-top: .25rem; color: #354f60 }
.state-explainer summary { width: fit-content; padding-block: .65rem; min-height: 44px; cursor: pointer; color: var(--sea); font-size: .9375rem }
.state-explainer p { max-width: 64ch; margin-bottom: .3rem }
.state-explainer a { display: inline-flex; align-items: center; min-height: 44px }
footer { background: #eff6fa; color: #3d5265 }
@media (max-width: 900px) {
  .topic-links { grid-template-columns: repeat(2, minmax(0, 1fr)) }
}
@media (max-width: 700px) {
  .wrap { width: calc(100% - 1.25rem) }
  .national-layout { grid-template-columns: minmax(0, 1fr); gap: 1.25rem; padding-block: 1rem }
  .national-lead .eyebrow { display: none }
  .national-lead h1::before { content: ""; display: inline-block; width: .85em; aspect-ratio: 11 / 7; margin-right: .25em; background: linear-gradient(to bottom, #0072ce 0 33.333%, #101216 33.333% 66.667%, white 66.667%); box-shadow: 0 0 0 1px #153b5824 }
  .bar nav { gap: .65rem }
  .section h2 { margin-bottom: .4rem }
  .topic-links { gap: .3rem }
  .state-explainer { margin-top: 0 }
  .national-lead h1 { margin: .3rem 0 .6rem }
  .mapframe .map-surface { min-height: clamp(14.5rem, 70vw, 22rem) }
  .map-search { padding: .55rem .65rem }
}
@media (max-width: 32rem) {
  .bar .portal-section { display: none }
}
@media (max-width: 22rem) {
  .bar .portal-section { display: none }
  .topic-links a { overflow-wrap: anywhere }
}
.map-query-row { display: flex; align-items: stretch; gap: .5rem }
.map-query-row input { flex: 1 1 12rem; width: auto; min-width: 0 }
.map-locate {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  flex: none; min-height: 44px; padding: .45rem .7rem;
  border: 1px solid #94bad4; border-radius: .35rem; background: #eff7ff;
  color: #104f80; text-decoration: none; font: 650 .9rem/1.25 Inter, Arial, sans-serif; cursor: pointer;
}
.map-locate::before {
  content: ""; width: .85rem; height: .85rem; border: 1.5px solid currentColor; border-radius: 50%;
  background: radial-gradient(circle, currentColor 0 23%, transparent 28%);
}
.map-locate:hover { background: #dfedfa }
.map-locate:disabled { opacity: .65; cursor: wait }
.location-status { color: #345268; font-size: .9rem; margin-top: .45rem }
.location-status:empty { margin: 0 }
.device-location { border: 3px solid white; border-radius: 50%; background: #174fda; box-shadow: 0 0 0 2px #163774 }
@media(max-width: 530px) {
  .map-query-row { flex-wrap: wrap; gap: .4rem }
  .map-query-row input { flex: 1 1 7.5rem }
  .map-query-row .map-locate { max-width: 100% }
  .map-locate { min-height: 44px }
}

.location-recovery:not([hidden]) { display: flex; align-items: center; flex-wrap: wrap; gap: .15rem .85rem }
.location-recovery a, .location-recovery button {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0;
  color: #075994; background: none; border: 0; font: 650 .9rem/1.3 Inter, Arial, sans-serif;
  text-decoration: underline; cursor: pointer;
}
.location-recovery [hidden] { display: none }

.map-copy-result { flex-basis: 100%; min-width: 0; color: #345268; font-size: .9rem }
.map-copy-result input { display: block; width: 100%; margin-top: .3rem }
