@charset "UTF-8";
/* Merikarvian Into – sivuston tyylit
   Ilme: metsävihreä #1B4332 / #081C15 + lime/kulta #C6F91F, paperi #F7F9F7
*/
:root {
  --hi-ink: #1A2E24;
  --hi-ink-soft: #3D5248;
  --hi-forest: #1B4332;
  --hi-forest-deep: #081C15;
  --hi-mint: #C6F91F;
  --hi-sand: #E8EFE8;
  --hi-sand-deep: #D4E0D6;
  --hi-paper: #F7F9F7;
  --hi-white: #ffffff;
  --hi-accent: #C6F91F;
  --hi-sky: #2D6A4F;
  --hi-sky-soft: #40916C;
  --hi-orange: #C6F91F;
  --hi-orange-hot: #B5E01A;
  --hi-line: rgba(27, 67, 50, 0.14);
  --hi-shadow: 0 12px 40px rgba(8, 28, 21, 0.1);
  --hi-radius: 0.35rem;
  --hi-font: "Source Sans 3", Arial, system-ui, sans-serif;
  --hi-display: "Montserrat", Arial, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--hi-font);
  color: var(--hi-ink);
  background:
    radial-gradient(1100px 560px at 8% -10%, rgba(198, 249, 31, 0.18), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(27, 67, 50, 0.12), transparent 50%),
    linear-gradient(180deg, #E8EFE8 0%, var(--hi-paper) 30%, var(--hi-paper) 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.skip-link {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 2000;
}

/* ---- Top bar ---- */
.hi-topbar {
  background: rgba(247, 249, 247, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hi-line);
  position: sticky;
  top: 0;
  z-index: 1030;
}

.hi-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none !important;
  color: var(--hi-ink) !important;
  padding: 0.15rem 0;
}

.hi-brand-logo {
  display: block;
  height: 3.25rem;
  width: auto;
  max-width: min(72px, 22vw);
  object-fit: contain;
  object-position: left center;
  flex-shrink: 0;
}

.hi-brand-copy {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
  line-height: 1.15;
}

.hi-brand-name {
  font-family: var(--hi-display);
  font-size: clamp(0.95rem, 2.2vw, 1.15rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--hi-forest-deep);
}

.hi-brand-tagline {
  font-size: clamp(0.72rem, 1.6vw, 0.85rem);
  font-weight: 500;
  color: var(--hi-ink-soft);
  max-width: 16rem;
}

.hi-brand-mark {
  width: 2rem;
  height: 2rem;
  border-radius: 0.4rem;
  background:
    linear-gradient(135deg, #081C15 0%, #1B4332 45%, #C6F91F 100%);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.2);
}

.hi-brand-text {
  font-family: var(--hi-display);
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.hi-brand-text strong { font-weight: 700; }
.hi-brand-light { font-weight: 600; opacity: 0.72; margin-left: 0.15em; }

.navbar-toggler {
  border-color: var(--hi-line);
}
.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(15, 28, 36, 0.85)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.hi-topnav .nav-link {
  color: var(--hi-ink-soft) !important;
  font-weight: 500;
  padding: 0.45rem 0.75rem !important;
  border-radius: var(--hi-radius);
}
.hi-topnav .nav-link:hover,
.hi-topnav .nav-link.active {
  color: var(--hi-forest-deep) !important;
  background: rgba(198, 249, 31, 0.28);
}

.hi-search {
  gap: 0.35rem;
  max-width: 16rem;
}
.hi-search .form-control {
  border-color: var(--hi-line);
  background: var(--hi-white);
}
.hi-btn-search {
  background: var(--hi-forest-deep);
  color: var(--hi-mint);
  border: none;
  white-space: nowrap;
}
.hi-btn-search:hover { background: var(--hi-forest); color: var(--hi-mint); }

.hi-editbar {
  background: var(--hi-forest);
  color: #f0f5f2;
  font-size: 0.875rem;
  padding: 0.45rem 0;
}

.hi-settings-card {
  max-width: 36rem;
  background: var(--hi-paper);
  border: 1px solid var(--hi-line);
  border-radius: var(--hi-radius);
  padding: 1.25rem 1.35rem;
}
.hi-settings-dl {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 0.35rem 1rem;
  margin: 0;
}
.hi-settings-dl dt {
  font-weight: 600;
  color: var(--hi-ink-soft);
}
.hi-settings-dl dd {
  margin: 0;
}
.hi-usage-bar {
  height: 0.85rem;
  background: rgba(15, 28, 36, 0.08);
}
.hi-usage-bar .progress-bar {
  min-width: 0.35rem;
}

/* ---- Korostettu tiedotebanneri ---- */
.hi-alert-banner {
  background: #fff5f5;
  border-bottom: 1px solid #f0c4c4;
  padding: 0.7rem 0;
  position: relative;
  z-index: 1040;
}
.hi-alert-banner .container {
  display: flex;
  align-items: center;
  min-height: 1.5rem;
}
.hi-alert-link {
  color: #c1121f;
  font-weight: 600;
  text-decoration: none;
  line-height: 1.4;
  display: inline;
}
.hi-alert-link:hover,
.hi-alert-link:focus-visible {
  color: #8a0c15;
  text-decoration: underline;
}
.hi-typewriter-text {
  white-space: pre-wrap;
}
.hi-alert-cta {
  font-weight: 500;
  opacity: 0.78;
  white-space: nowrap;
}
.hi-typewriter-cursor {
  display: inline-block;
  width: 0.55ch;
  margin-left: 1px;
  border-right: 2px solid #c1121f;
  animation: hi-cursor-blink 0.85s steps(1) infinite;
  vertical-align: -0.05em;
  height: 1.05em;
}
@keyframes hi-cursor-blink {
  0%, 45% { border-color: #c1121f; }
  46%, 100% { border-color: transparent; }
}
@media (prefers-reduced-motion: reduce) {
  .hi-typewriter-cursor { animation: none; border-color: #c1121f; }
}

/* ---- Shell ---- */
.hi-shell {
  flex: 1;
  padding: 1.75rem 0 3rem;
}

.hi-main {
  background: var(--hi-white);
  border: 1px solid var(--hi-line);
  border-radius: 0.75rem;
  padding: 1.5rem 1.35rem 2rem;
  box-shadow: var(--hi-shadow);
  animation: hiFadeUp 0.45s ease both;
}

@media (min-width: 992px) {
  .hi-main { padding: 2rem 2.25rem 2.5rem; }
}

@keyframes hiFadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.hi-page-title {
  font-family: var(--hi-display);
  font-weight: 700;
  font-size: clamp(1.75rem, 3vw, 2.35rem);
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
  color: var(--hi-ink);
}

.hi-page-lead {
  margin: 0 0 1.5rem;
}
.hi-page-lead-figure {
  margin: 0 0 1rem;
}
.hi-page-lead-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--hi-radius);
}
.hi-page-ingress {
  font-size: 1.15rem;
  line-height: 1.55;
  color: var(--hi-ink-soft);
  font-weight: 500;
  max-width: 42rem;
}
.hi-page-lead-compact .hi-page-ingress {
  font-size: 1.05rem;
  max-width: none;
}
.hi-page-lead-compact .hi-child-thumb {
  flex-basis: 11rem;
  pointer-events: none;
}
.hi-page-lead-compact .hi-child-thumb img {
  height: 8rem;
}
@media (max-width: 575.98px) {
  .hi-page-lead-compact .hi-child-thumb {
    flex-basis: 7.5rem;
  }
  .hi-page-lead-compact .hi-child-thumb img {
    height: 5.5rem;
  }
}


.hi-child-item-inner {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.hi-child-thumb {
  flex: 0 0 7.5rem;
  display: block;
  overflow: hidden;
  border-radius: var(--hi-radius);
  background: var(--hi-sand);
}
.hi-child-thumb img {
  display: block;
  width: 100%;
  height: 5.5rem;
  object-fit: cover;
}
.hi-child-body {
  min-width: 0;
  flex: 1 1 auto;
}
.hi-child-ingress {
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
  line-height: 1.45;
  color: #5a6b73;
}
@media (max-width: 575.98px) {
  .hi-child-thumb {
    flex-basis: 5.5rem;
  }
  .hi-child-thumb img {
    height: 4.25rem;
  }
}

.hi-page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.hi-page-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--hi-line);
  font-size: 0.925rem;
}
.hi-page-meta-left,
.hi-page-meta-right {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 0.85rem;
  align-items: center;
}
.hi-page-meta-right {
  margin-left: auto;
  justify-content: flex-end;
}
.hi-page-meta-right .hi-updated {
  color: #5a6b73;
  white-space: nowrap;
}

.hi-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border-radius: 0.25rem;
  background: var(--hi-sand-deep);
  color: var(--hi-ink-soft);
}
.hi-badge-tiedote { background: #E8F9A8; color: var(--hi-forest-deep); }
.hi-badge-tapahtuma { background: #E8F9A8; color: var(--hi-forest-deep); }
.hi-badge-perus { background: #dfe6ea; color: #2a3a44; }
.hi-badge-valiotsikko { background: #e4eaf0; color: #2a3a44; }
.hi-badge-teksti { background: #E8F9A8; color: var(--hi-forest-deep); }
.hi-badge-kuva { background: #E8F9A8; color: var(--hi-forest-deep); }
.hi-badge-wysiwyg { background: #e8e4f0; color: #3d3460; }
.hi-badge-youtube { background: #fde8e8; color: #8a1f1f; }
.hi-badge-karttaupotus { background: #e6f3e9; color: #1a5a32; }
.hi-badge-alisivutkartalla { background: #e8f4ea; color: #1a5a32; }

.hi-youtube {
  position: relative;
  width: 100%;
  margin: 1.25rem 0 1.5rem;
  aspect-ratio: 16 / 9;
  background: #0f1c24;
  border-radius: 0.5rem;
  overflow: hidden;
  border: 1px solid var(--hi-line);
}
.hi-youtube iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.hi-map {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 1.25rem 0 1.5rem;
  width: 100%;
}
.hi-map[hidden] {
  display: none !important;
}
.hi-map-editor .hi-map {
  margin-top: 1rem;
  margin-bottom: 0;
}
.hi-map-toolbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.55rem;
}
.hi-map-links {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  line-height: 1.45;
}
.hi-map-links a {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--hi-mint, #0a7a5c);
  text-decoration: none;
}
.hi-map-links a:hover {
  text-decoration: underline;
}
@media (min-width: 768px) {
  .hi-map-toolbar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem 1rem;
  }
  .hi-map-links {
    flex-direction: row;
    align-items: center;
    gap: 0.9rem;
  }
}
.hi-map-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.hi-map-tab {
  appearance: none;
  border: 1px solid rgba(18, 50, 75, 0.22);
  background: #fff;
  color: var(--hi-ink, #1a2a33);
  border-radius: 999px;
  min-height: 2.1rem;
  padding: 0.25rem 0.85rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 650;
  cursor: pointer;
}
.hi-map-tab:hover {
  border-color: var(--hi-mint, #0a7a5c);
  color: var(--hi-mint, #0a7a5c);
}
.hi-map-tab.is-active {
  background: var(--hi-forest, #005A2E);
  border-color: var(--hi-forest, #005A2E);
  color: #fff;
}
.hi-map-frame {
  position: relative;
  border: 1px solid var(--hi-line, #d5dee4);
  border-radius: 0.5rem;
  overflow: hidden;
  background: #e8eef4;
  aspect-ratio: 16 / 9;
  min-height: 220px;
}
.hi-leaflet,
.hi-map-gframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.hi-leaflet {
  z-index: 0;
  min-height: 0;
}
.hi-map-gframe[hidden],
.hi-leaflet[hidden] {
  display: none !important;
}
.hi-leaflet-popup-links {
  line-height: 1.55;
}
.hi-leaflet-popup-link {
  font-weight: 650;
  color: #0b57a4;
  text-decoration: none;
}
.hi-leaflet-popup-link:hover {
  text-decoration: underline;
}
.leaflet-container a.hi-leaflet-popup-link {
  color: #0b57a4;
}
.hi-map-caption {
  margin: 0;
  font-size: 0.95rem;
  color: var(--hi-ink-soft, #5a6b73);
}
.hi-geocode-status.is-error {
  color: #9b1c2c;
}
.hi-map-pin-list {
  list-style: none;
  margin: 0.35rem 0 1.5rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
}
.hi-map-pin-list a {
  font-weight: 600;
  color: var(--hi-mint, #0a7a5c);
  text-decoration: none;
}
.hi-map-pin-list a:hover {
  text-decoration: underline;
}

.hi-subhead {
  font-family: var(--hi-display);
  font-size: 1.45rem;
  margin: 1.75rem 0 0.75rem;
  color: var(--hi-forest-deep);
}

.hi-text {
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 42rem;
}
.hi-text p { margin: 0 0 0.85rem; }
.hi-text p:last-child { margin-bottom: 0; }
.hi-text-h3 {
  font-family: var(--hi-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--hi-forest-deep);
  margin: 1.15rem 0 0.45rem;
  line-height: 1.35;
}
.hi-text-h3:first-child {
  margin-top: 0;
}
.hi-text strong { font-weight: 700; }
.hi-text em { font-style: italic; }
.hi-text del { text-decoration: line-through; opacity: 0.85; }
.hi-text a {
  color: var(--hi-forest);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}
.hi-text a:hover { color: var(--hi-forest-deep); }
.hi-text code {
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", Consolas, monospace;
  font-size: 0.9em;
  background: var(--hi-sand);
  padding: 0.1em 0.35em;
  border-radius: 0.25rem;
}
.hi-codeblock {
  margin: 0.75rem 0;
  padding: 0.85rem 1rem;
  background: #1a242b;
  color: #e8f0f3;
  border-radius: 0.4rem;
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.45;
}
.hi-codeblock code {
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", Consolas, monospace;
  background: transparent;
  padding: 0;
  color: inherit;
}
.hi-quote {
  margin: 0.75rem 0;
  padding: 0.35rem 0 0.35rem 0.9rem;
  border-left: 3px solid var(--hi-mint);
  color: var(--hi-ink-soft);
}
.hi-text-list,
.hi-tasklist {
  margin: 0.5rem 0 0.85rem;
  padding-left: 1.35rem;
}
.hi-tasklist {
  list-style: none;
  padding-left: 0;
}
.hi-tasklist li {
  margin: 0.25rem 0;
  padding-left: 0.15rem;
}
.hi-task-box {
  font-family: ui-monospace, Consolas, monospace;
  color: var(--hi-forest);
}
.hi-task-done {
  opacity: 0.72;
  text-decoration: line-through;
}

.hi-wysiwyg {
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 46rem;
}
.hi-wysiwyg p { margin-bottom: 1rem; }
.hi-wysiwyg a { color: var(--hi-forest); }
.hi-wysiwyg ul, .hi-wysiwyg ol { padding-left: 1.25rem; }
.hi-wysiwyg iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
  margin: 1rem 0;
  border-radius: 0.5rem;
}

.hi-figure {
  margin: 1.5rem 0;
  width: 100%;
  max-width: 100%;
}
.hi-figure-inline {
  margin: 0;
}
.hi-figure img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  border: 1px solid var(--hi-line);
}
/* Partnerilogot: ei kehystä */
.hi-figure img[src*="purolomat_logo" i],
.hi-wysiwyg img[src*="purolomat_logo" i],
.hi-figure img[src*="Eumer_minttu" i],
.hi-wysiwyg img[src*="Eumer_minttu" i],
.hi-figure img[src*="eumer" i],
.hi-wysiwyg img[src*="eumer" i],
.hi-figure img[src$=".svg" i],
.hi-wysiwyg img[src$=".svg" i] {
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
.hi-figure figcaption {
  font-size: 0.9rem;
  color: #5a6b73;
  margin-top: 0.55rem;
  line-height: 1.45;
}
.hi-figure-link {
  display: block;
  line-height: 0;
}
.hi-figure-link:hover img {
  opacity: 0.92;
}
.hi-image-with-text {
  display: grid;
  gap: 1.25rem;
  margin: 1.25rem 0 1.5rem;
  align-items: start;
}
.hi-image-with-text-body {
  max-width: none;
}
@media (min-width: 768px) {
  .hi-image-with-text {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1.75rem;
  }
  .hi-image-vasen .hi-image-with-text-media { order: 1; }
  .hi-image-vasen .hi-image-with-text-body { order: 2; }
  .hi-image-oikea .hi-image-with-text-media { order: 2; }
  .hi-image-oikea .hi-image-with-text-body { order: 1; }
}

.breadcrumb {
  /* \203A = › — escape, ettei IIS/latin1-CSS hajota merkkiä */
  --bs-breadcrumb-divider: "\203A";
  font-size: 0.875rem;
}
.breadcrumb a { color: var(--hi-forest); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* ---- Sidebar ---- */
.hi-sidepanel {
  background: rgba(255,255,255,0.72);
  border: 1px solid var(--hi-line);
  border-radius: 0.75rem;
  padding: 1.15rem 1rem;
  position: sticky;
  top: 5.5rem;
  animation: hiFadeUp 0.55s ease both;
}

.hi-side-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #5a6b73;
  margin: 0 0 0.65rem;
  font-weight: 700;
}

.hi-sidenav {
  list-style: none;
  margin: 0;
  padding: 0;
}
.hi-sidenav li { margin: 0; }
.hi-sidenav a {
  display: block;
  padding: 0.4rem 0.55rem;
  color: var(--hi-ink-soft);
  text-decoration: none;
  border-radius: var(--hi-radius);
  font-weight: 500;
  font-size: 0.95rem;
}
.hi-sidenav a:hover,
.hi-sidenav a.active {
  background: rgba(198, 249, 31, 0.28);
  color: var(--hi-forest-deep);
}
.hi-sidenav-news a {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.hi-nav-icon {
  flex: 0 0 auto;
  width: 0.95rem;
  height: 0.95rem;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.72;
}
.hi-sidenav a:hover .hi-nav-icon,
.hi-sidenav a.active .hi-nav-icon {
  opacity: 1;
}
.hi-nav-icon-fill {
  fill: currentColor;
  stroke: none;
}
.hi-sidenav-nested {
  margin-left: 0.75rem;
  border-left: 2px solid var(--hi-sand-deep);
  padding-left: 0.25rem;
  margin-bottom: 0.35rem;
}

/* ---- Lists / cards for news & events ---- */
.hi-list-year {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--hi-forest);
  margin: 2rem 0 0.25rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--hi-line);
}
.hi-list-year:first-of-type {
  margin-top: 1rem;
}
.hi-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.hi-list-item {
  padding: 0.25rem 0;
}
.hi-list-item:first-child { padding-top: 0; }
.hi-list-item a {
  color: var(--hi-ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
}
.hi-list-item a:hover { color: var(--hi-forest); }
.hi-list-meta {
  font-size: 0.875rem;
  color: #5a6b73;
  margin-top: 0.25rem;
}

.hi-snippet {
  margin: 0.45rem 0 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--hi-ink-soft);
  max-width: 42rem;
}

.hi-search-table td {
  vertical-align: top;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
}
.hi-search-table .hi-snippet {
  margin-top: 0.35rem;
}

.hi-hit,
mark.hi-hit {
  background: #E8F9A8;
  color: var(--hi-ink);
  padding: 0.05em 0.15em;
  border-radius: 0.15rem;
  font-weight: 600;
}

.hi-search-results .hi-list-item a mark.hi-hit {
  background: #E8F9A8;
}

/* Sivuluettelo: suodatus + lajittelu */
.hi-table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}
.hi-table-toolbar .form-control {
  max-width: 22rem;
  border-color: var(--hi-line);
}
.hi-table-toolbar .form-control:focus {
  border-color: var(--hi-orange-hot);
  box-shadow: 0 0 0 0.2rem rgba(198, 249, 31, 0.35);
}

.hi-sort-btn {
  appearance: none;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  font-weight: 600;
  color: var(--hi-ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.hi-sort-btn:hover,
.hi-sort-btn:focus-visible {
  color: var(--hi-forest);
  outline: none;
}
.hi-sort-ind {
  font-size: 0.65rem;
  color: var(--hi-forest-deep);
  min-width: 0.75rem;
}
.hi-sortable thead th {
  white-space: nowrap;
}

.hi-path-label {
  font-size: 0.75rem;
  line-height: 1.2;
  color: #7a8b93;
  margin-bottom: 0.15rem;
  word-break: break-all;
}
.hi-page-name {
  font-weight: 600;
  color: var(--hi-forest);
  text-decoration: none;
}
.hi-page-name:hover {
  text-decoration: underline;
}

/* Edellinen / Seuraava sisarsivut */
.hi-sibling-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 0 0 1rem;
  padding: 0 0 1rem;
  border-bottom: 1px solid var(--hi-line);
  border-top: 0;
}
.hi-sibling-prev,
.hi-sibling-next {
  min-width: 0;
}
.hi-sibling-next {
  text-align: right;
}
.hi-sibling-nav a {
  display: inline-flex;
  flex-direction: column;
  gap: 0.2rem;
  text-decoration: none;
  color: var(--hi-ink);
  max-width: 100%;
}
.hi-sibling-nav a:hover .hi-sibling-title {
  color: var(--hi-forest);
}
.hi-sibling-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #7a8b93;
  font-weight: 700;
}
.hi-sibling-prev .hi-sibling-label::before { content: "\2190\00A0"; } /* ← */
.hi-sibling-next .hi-sibling-label::after { content: "\00A0\2192"; } /* → */
.hi-sibling-title {
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.35;
  word-break: break-word;
}
@media (max-width: 575.98px) {
  .hi-sibling-nav {
    grid-template-columns: 1fr;
  }
  .hi-sibling-next { text-align: left; }
}

.hi-empty {
  padding: 1.5rem;
  background: var(--hi-sand);
  border-radius: var(--hi-radius);
  color: #5a6b73;
}

/* ---- kuvat.fi upotus ---- */
.hi-kuvat-embed {
  margin: 0.5rem 0 1.5rem;
  min-height: 12rem;
}
.hi-kuvat-embed .pb-folderembed {
  width: 100%;
}

/* Wysiwyg-sivun kapea max-width estää 5 sarakkeen mahtumisen */
.hi-wysiwyg:has(.pb-folderembed) {
  max-width: none;
}

/*
  kuvat.fi käyttää inline-block + %-leveyksiä.
  Elementtien väliset whitespace-merkit kasvattavat rivin leveyttä,
  jolloin viimeinen kuva tippuu seuraavalle riville (esim. 4+1 vs 5).
*/
.pb-folderembed.pb-thumbscale.pb-hascolumns {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  column-gap: 1.5%;
  row-gap: 0.85rem;
}
.pb-folderembed.pb-thumbscale.pb-hascolumns > br {
  display: none;
}
.pb-folderembed.pb-thumbscale.pb-hascolumns .pb-imageobject {
  margin-right: 0 !important;
  margin-bottom: 0 !important;
  box-sizing: border-box;
}
.pb-folderembed.pb-thumbscale.pb-columns2 .pb-imageobject { width: calc((100% - 1.5%) / 2) !important; }
.pb-folderembed.pb-thumbscale.pb-columns3 .pb-imageobject { width: calc((100% - 3%) / 3) !important; }
.pb-folderembed.pb-thumbscale.pb-columns4 .pb-imageobject { width: calc((100% - 4.5%) / 4) !important; }
.pb-folderembed.pb-thumbscale.pb-columns5 .pb-imageobject { width: calc((100% - 6%) / 5) !important; }
.pb-folderembed.pb-thumbscale.pb-columns6 .pb-imageobject { width: calc((100% - 7.5%) / 6) !important; }

/* Kapea näyttö: aina 1 sarake (data-columns-arvosta riippumatta) */
@media (max-width: 575.98px) {
  .pb-folderembed.pb-thumbscale.pb-hascolumns {
    column-gap: 0;
  }
  .pb-folderembed.pb-thumbscale.pb-hascolumns .pb-imageobject {
    width: 100% !important;
  }
}

/* ---- Hero (etusivu) ---- */
.hi-hero {
  margin: -0.25rem 0 1.75rem;
  padding: 1.75rem 1.5rem;
  border-radius: 0.65rem;
  background:
    linear-gradient(120deg, rgba(8, 28, 21, 0.96), rgba(27, 67, 50, 0.9)),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23C6F91F' fill-opacity='0.08'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  color: #F7F9F7;
  animation: hiFadeUp 0.5s ease both;
}
.hi-hero-photo {
  position: relative;
  min-height: 0;
  display: block;
  padding: 0;
  overflow: hidden;
  background: var(--hi-forest);
}
.hi-hero-img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: top;
}
.hi-hero-carousel .carousel {
  position: relative;
  z-index: 0;
}
.hi-hero-carousel .carousel-inner,
.hi-hero-carousel .carousel-item {
  background: var(--hi-forest);
}
.hi-hero-carousel .hi-hero-img {
  width: 100%;
  height: clamp(160px, 26vw, 320px);
  object-fit: cover;
  object-position: center;
}
.hi-hero-carousel .carousel-indicators {
  z-index: 2;
  margin-bottom: 0.85rem;
}
.hi-hero-carousel .carousel-indicators [data-bs-target] {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.55);
  border: 0;
  opacity: 1;
}
.hi-hero-carousel .carousel-indicators .active {
  background-color: var(--hi-mint);
}
.hi-hero-carousel .carousel-control-prev,
.hi-hero-carousel .carousel-control-next {
  z-index: 2;
  width: 3rem;
  opacity: 0.85;
}
.hi-hero-carousel .carousel-control-prev:hover,
.hi-hero-carousel .carousel-control-next:hover {
  opacity: 1;
}
.hi-hero-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, rgba(8, 28, 21, 0.88) 0%, rgba(27, 67, 50, 0.55) 50%, rgba(198, 249, 31, 0.22) 100%);
  pointer-events: none;
  z-index: 1;
}
.hi-hero-inner {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  padding: 1.35rem 1.35rem 1.5rem;
  max-width: 36rem;
  animation: hiFadeUp 0.65s ease both;
  pointer-events: none;
}
.hi-hero-brand {
  font-family: var(--hi-display);
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.25rem;
  color: #fff;
}
.hi-hero-tagline {
  margin: 0 0 0.85rem !important;
  font-size: clamp(0.98rem, 1.8vw, 1.12rem) !important;
  font-weight: 500;
  opacity: 0.94;
  max-width: 28rem;
  line-height: 1.35;
}
.hi-hero-lead {
  margin: 0 0 0.45rem !important;
  font-size: 0.85rem !important;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.72;
}
.hi-hero h1 {
  font-family: var(--hi-display);
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  font-weight: 600;
  margin: 0 0 0.4rem;
  color: #fff;
}
.hi-hero-photo h1 {
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
}
.hi-hero-rotator {
  position: relative;
  min-height: 1.45em;
}
.hi-hero-rotator-text {
  display: inline-block;
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.hi-hero-rotator-text.is-out {
  opacity: 0;
  transform: translateY(0.35rem);
}
.hi-hero-rotator-text.is-in {
  opacity: 1;
  transform: translateY(0);
}
.hi-hero p {
  margin: 0;
  opacity: 0.92;
  max-width: 36rem;
  font-size: 1rem;
}
@media (prefers-reduced-motion: reduce) {
  .hi-hero-rotator-text { transition: none; }
}
@media (min-width: 768px) {
  .hi-hero-inner {
    padding: 1.75rem 2rem 2rem;
  }
}

/* Etusivu: karuselli reunoihin (ei .hi-main-paddingia ympärillä) */
.hi-home .hi-main {
  overflow: hidden;
  padding-top: 0;
}
.hi-home .hi-hero-carousel {
  margin: 0 -1.35rem 1.75rem;
  border-radius: 0;
}
@media (min-width: 992px) {
  .hi-home .hi-hero-carousel {
    margin-left: -2.25rem;
    margin-right: -2.25rem;
  }
}

/* ---- Footer ---- */
.hi-footer {
  background: var(--hi-forest-deep);
  color: #c5d4cb;
  padding: 2.5rem 0 1.5rem;
  margin-top: auto;
}
.hi-footer a { color: #fff; text-decoration: none; }
.hi-footer a:hover { color: var(--hi-mint); text-decoration: underline; }
.hi-footer-brand {
  font-family: var(--hi-display);
  font-size: 1.25rem;
  color: #fff;
  margin-bottom: 0.35rem;
}
.hi-footer-heading {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8aa0ab;
  margin-bottom: 0.65rem;
  font-weight: 700;
}
.hi-footer-links li { margin-bottom: 0.35rem; }
.hi-footer-address {
  line-height: 1.55;
  margin-top: 0.5rem;
}
.hi-footer-contact li {
  margin-bottom: 0.85rem;
}
.hi-footer-contact a {
  display: block;
  line-height: 1.45;
}
.hi-footer-invoice {
  line-height: 1.55;
  font-size: 0.925rem;
}
.hi-footer-muted {
  color: #8aa0ab;
  font-size: 0.875rem;
}
.hi-footer-bottom {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 0.85rem;
  color: #8aa0ab;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  align-items: center;
  justify-content: space-between;
}
.hi-footer-legal {
  color: #8aa0ab;
  text-decoration: none;
}
.hi-footer-legal:hover,
.hi-footer-legal:focus-visible {
  color: #c5d4db;
  text-decoration: underline;
}
.hi-feedback-bar {
  margin: 2.5rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--hi-line);
  text-align: right;
}
.hi-feedback-link {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  font-size: 0.8rem;
  color: #5a6b73;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
  text-align: left;
}
.hi-feedback-link:hover,
.hi-feedback-link:focus-visible {
  color: var(--hi-forest-deep);
}
.hi-feedback-status.is-ok { color: var(--hi-forest-deep); }
.hi-feedback-status.is-err { color: #a33; }

.hi-footer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 1.35rem 1.75rem;
  align-items: center;
  justify-content: center;
  margin-top: 1.75rem;
  padding: 1.35rem 1.25rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.5rem;
}
.hi-footer-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.hi-footer-badge img {
  display: block;
  max-height: 88px;
  max-width: 220px;
  width: auto;
  height: auto;
  object-fit: contain;
}
@media (max-width: 575.98px) {
  .hi-footer-badge img {
    max-height: 64px;
    max-width: 160px;
  }
}

/* ---- Forms / admin ---- */
.hi-contact-form {
  max-width: 36rem;
}
.hi-form .form-label { font-weight: 600; font-size: 0.9rem; }
.hi-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  margin-bottom: 0.35rem;
}
.hi-field-head .form-label { margin-bottom: 0; }
.hi-translate-btn {
  flex: 0 0 auto;
  white-space: nowrap;
}
.hi-translate-status.text-danger {
  color: #b42318;
}
.hi-form .form-control,
.hi-form .form-select {
  border-color: var(--hi-line);
}
.hi-form input[readonly] {
  background: var(--hi-paper);
  color: var(--hi-ink-soft);
  cursor: default;
}
.btn-hi {
  background: var(--hi-mint);
  border-color: var(--hi-mint);
  color: var(--hi-forest-deep);
}
.btn-hi:hover { background: var(--hi-orange-hot); border-color: var(--hi-orange-hot); color: var(--hi-forest-deep); }
.btn-outline-hi {
  border-color: var(--hi-forest);
  color: var(--hi-forest);
}
.btn-outline-hi:hover { background: var(--hi-mint); border-color: var(--hi-mint); color: var(--hi-forest-deep); }

.hi-row-block {
  margin-bottom: 0.25rem;
}
.hi-row-preview .hi-subhead:first-child {
  margin-top: 0.5rem;
}
.hi-row-divider {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  border-top: 1px solid var(--hi-line);
  padding: 0.4rem 0 0.35rem;
  margin: 0.75rem 0 0.15rem;
}
.hi-row-insert-slot {
  background: rgba(15, 28, 36, 0.045);
  border-radius: var(--hi-radius);
  padding: 0 0.75rem;
  margin: 0.4rem 0;
}
.hi-row-insert-divider {
  justify-content: flex-end;
  margin-top: 0.15rem;
  margin-bottom: 0.15rem;
  border-top-color: transparent;
}
.hi-row-insert-divider .dropdown-menu {
  min-width: 10rem;
  font-size: 0.9rem;
}
.hi-row-insert-slot .hi-row-insert-editor {
  padding-bottom: 0.65rem;
}
.hi-row-type {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
}
.hi-row-editor {
  border: 1px solid var(--hi-line);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 0.85rem;
  background: var(--hi-paper);
}
.hi-row-block.is-editing .hi-row-preview,
.hi-row-block.is-editing .hi-row-divider {
  display: none;
}
.hi-page-info-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.hi-page-info-preview .hi-page-meta {
  border-bottom: none;
  margin-bottom: 0.75rem;
  padding-bottom: 0;
}
.hi-page-info-preview .hi-page-meta-right a[href^="/tulosta/"] {
  display: none;
}
.hi-page-info-block .hi-page-title {
  margin-top: 0.35rem;
  margin-bottom: 0;
  font-size: clamp(1.55rem, 2.4vw, 2rem);
  flex: 1 1 auto;
  min-width: 0;
}
.hi-page-status {
  flex: 0 0 auto;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.hi-page-status-published {
  color: var(--hi-forest-deep);
}
.hi-page-status-draft {
  color: var(--hi-forest-deep);
}
.hi-page-info-divider {
  background: rgba(15, 28, 36, 0.045);
  border-top-color: transparent;
  border-radius: var(--hi-radius);
  padding: 0.45rem 0.75rem;
  margin: 0 0 0.35rem;
}
.hi-page-info-path {
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", Consolas, monospace;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--hi-ink-soft);
  word-break: break-all;
}
.hi-page-info-block.is-editing .hi-page-info-preview,
.hi-page-info-block.is-editing .hi-page-info-divider {
  display: none;
}
.hi-page-info-block.is-editing .hi-page-info-editor {
  display: block;
}
.hi-row-editor-new {
  border-color: var(--hi-mint);
}
.hi-image-field .hi-upload-input {
  margin-bottom: 0.35rem;
}
.hi-upload-preview {
  max-height: 160px;
  width: auto;
  border: 1px solid var(--hi-line);
  border-radius: var(--hi-radius);
  background: var(--hi-white);
}

.hi-draft-watermark {
  position: fixed;
  inset: 0;
  z-index: 50;
  pointer-events: none;
  overflow: hidden;
}
.hi-draft-watermark span {
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%) rotate(-28deg);
  font-family: var(--hi-display);
  font-size: clamp(3.5rem, 16vw, 11rem);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(196, 92, 38, 0.11);
  white-space: nowrap;
  user-select: none;
}

.hi-sitemap-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.hi-sitemap ul { list-style: none; padding-left: 1.15rem; margin: 0.2rem 0 0; }
.hi-sitemap > ul { padding-left: 0; }
.hi-sitemap li {
  margin: 0.15rem 0;
}
.hi-sitemap-branch,
.hi-sitemap-leaf {
  position: relative;
}
.hi-sitemap-branch {
  padding-left: 1.35rem;
}
.hi-sitemap-leaf {
  padding-left: 1.35rem;
}
.hi-sitemap-toggle {
  position: absolute;
  left: 0;
  top: 0.15rem;
  width: 1.15rem;
  height: 1.15rem;
  padding: 0;
  border: 1px solid var(--hi-line);
  border-radius: 0.2rem;
  background: var(--hi-white);
  color: var(--hi-ink-soft);
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.hi-sitemap-toggle::before {
  content: "";
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0.28rem 0 0.28rem 0.4rem;
  border-color: transparent transparent transparent currentColor;
  transform: rotate(0deg);
  transition: transform 0.15s ease;
}
.hi-sitemap-branch.is-open > .hi-sitemap-toggle::before {
  transform: rotate(90deg);
}
.hi-sitemap-branch:not(.is-open) > ul {
  display: none;
}
.hi-sitemap-leaf::before {
  content: "";
  position: absolute;
  left: 0.45rem;
  top: 0.7rem;
  width: 0.28rem;
  height: 0.28rem;
  border-radius: 50%;
  background: rgba(15, 28, 36, 0.25);
}
.hi-sitemap a { color: var(--hi-forest); text-decoration: none; }
.hi-sitemap a:hover { text-decoration: underline; }

/* ---- Print ---- */
@media print {
  .hi-draft-watermark { display: none !important; }
  .hi-topbar, .hi-sidebar, .hi-footer, .hi-page-actions, .hi-editbar, .hi-alert-banner, .hi-feedback-bar, .skip-link { display: none !important; }
  .hi-main {
    box-shadow: none;
    border: none;
    padding: 0;
  }
  body { background: #fff; }
  .hi-shell { padding: 0; }
}

body.print-view .hi-topbar,
body.print-view .hi-sidebar,
body.print-view .hi-footer,
body.print-view .hi-page-actions,
body.print-view .hi-alert-banner { display: none !important; }
body.print-view .hi-main {
  box-shadow: none;
  border: none;
  max-width: 800px;
  margin: 0 auto;
}
