/* skmt.fi: vanhan Textpattern-saitin (hive-teema) ulkoasu. Mitat ja värit vanhasta css/default.css:stä:
   kehys 940 px, yläreunan 4 px tumma viiva, 86 px:n logorivi, versaalivalikko, 180 px:n otsikkokuva,
   tumma alatunniste. Parannukset vanhaan: kontrasti (aksentti ei ole tekstin väri), tavallinen viewport,
   ei jQueryä eikä ulkoisia fontteja. */

@font-face { font-family: "Open Sans"; font-weight: 300; font-style: normal; font-display: swap; src: url(fonts/open-sans-latin-300-normal.woff2) format("woff2"); }
@font-face { font-family: "Open Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url(fonts/open-sans-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "Open Sans"; font-weight: 400; font-style: italic; font-display: swap; src: url(fonts/open-sans-latin-400-italic.woff2) format("woff2"); }
@font-face { font-family: "Open Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url(fonts/open-sans-latin-600-normal.woff2) format("woff2"); }

:root {
  --tumma: #183d4a;
  --aksentti: #f9a936;
  --linkki: #8f5600; /* aksentin tummennus: 5,9:1 valkoisella */
  --teksti: #686868;
  --otsikko: #444;
}

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

body {
  margin: 0;
  border-top: 4px solid var(--tumma);
  background: #fff;
  color: var(--teksti);
  font: 400 15px/1.6 "Open Sans", Helvetica, Arial, sans-serif;
}

img { max-width: 100%; height: auto; vertical-align: bottom; }
a { color: var(--linkki); transition: color .2s linear; }
a:hover { color: var(--otsikko); }
:focus-visible { outline: 3px solid var(--tumma); outline-offset: 2px; }

h1, h2, h3, h4 { margin: 0 0 12px; color: var(--otsikko); font-weight: 400; line-height: 1.3; }
h2 { font-size: 24px; }
h3 { font-size: 18px; }
p { margin: 0 0 20px; }
strong { font-weight: 600; }

.kehys { max-width: 980px; margin: 0 auto; padding: 0 20px; }
.vain-ruudunlukija { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ohita { position: absolute; left: 8px; top: -60px; z-index: 100; padding: 8px 14px; background: var(--tumma); color: #fff; }
.ohita:focus { top: 8px; }

/* Yläosa */
.ylaosa-rivi { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.logo { display: block; margin: 19px 0; }
.valikko ul { display: flex; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.valikko a {
  display: block; padding: 0 20px; height: 86px; line-height: 86px;
  color: var(--teksti); font-size: 13px; font-weight: 600; text-transform: uppercase; text-decoration: none;
  transition: color .1s linear, background .1s linear;
}
.valikko a:hover, .valikko .aktiivinen > a { background: var(--aksentti); color: var(--tumma); }

/* Sivun otsikkopalkki */
.sivuotsikko { position: relative; margin-bottom: 50px; padding-top: 100px; }
.sivuotsikko::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 180px;
  background: var(--tumma) url(images/sivuotsikko.jpg) center top / auto 100% no-repeat;
}
.sivuotsikko-laatikko { position: relative; min-height: 80px; padding: 18px 30px; background: #fff; box-shadow: 0 0 5px #555; }
.sivuotsikko h1 { margin: 0; font-size: 36px; line-height: 44px; font-weight: 300; }

/* Sisältö */
.sivu-runko { padding-bottom: 50px; }
.sisalto { overflow-wrap: anywhere; } /* yhteystietosivun pitkät laskutussähköpostiosoitteet */
.sisalto::after { content: ""; display: block; clear: both; }
.sisalto a { text-decoration: underline; }
.sisalto img { border-radius: 0; }

.intro { text-align: center; padding: 57px 0 0; }
.intro h2 { font-size: 28px; font-weight: 300; margin-bottom: 16px; }
.intro h2 ~ h2 {
  margin: 40px 0 20px; padding: 0 10px; border-bottom: 1px solid #efefef; background: #f7f7f7;
  font-size: 13px; font-weight: 600; line-height: 26px; text-align: left; text-transform: uppercase;
}
.intro ul { margin: 0; padding: 0; list-style: none; }
.intro li h3 { margin-bottom: 8px; }

/* Slider */
.slider { position: relative; height: clamp(200px, 40vw, 450px); overflow: hidden; background: var(--tumma); }
.slider-diat { margin: 0; padding: 0; list-style: none; }
.dia { position: absolute; inset: 0; opacity: 0; transition: opacity .6s ease; }
.dia img { width: 100%; height: 100%; object-fit: cover; }
.slider:not(.js) .dia:first-child, .dia.aktiivinen { opacity: 1; }
.dia-teksti { position: absolute; left: max(0px, calc((100% - 940px) / 2)); bottom: 100px; max-width: 100%; }
.dia-teksti p { margin: 0; padding: 0 10px; opacity: .9; }
.dia-otsikko { width: fit-content; background: #fff; color: #323232; font-size: 32px; font-weight: 300; line-height: 52px; text-transform: uppercase; }
.dia-rivi { width: fit-content; background: #393939; color: #d0d0d0; font-size: 20px; line-height: 44px; }
.slider-nuoli {
  position: absolute; top: 50%; width: 44px; height: 44px; margin-top: -22px; padding: 0; border: 0;
  background: rgba(24, 61, 74, .7); color: #fff; font-size: 24px; line-height: 44px; cursor: pointer;
}
.slider-nuoli:hover { background: var(--aksentti); color: var(--tumma); }
.slider-edellinen { left: 0; }
.slider-seuraava { right: 0; }
.slider-pallot { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; gap: 10px; margin: 0; padding: 0; list-style: none; }
.slider-pallo { width: 14px; height: 14px; padding: 0; border: 2px solid #fff; border-radius: 50%; background: transparent; cursor: pointer; }
.slider-pallo[aria-current="true"], .slider-pallo:hover { background: var(--aksentti); border-color: var(--aksentti); }
.slider :focus-visible { outline-color: var(--aksentti); }

/* Kalusto: otsikko + kuva -parit sarakkeisiin */
.kalusto { column-count: 3; column-gap: 20px; }
.kalusto h3 { margin: 0 0 8px; break-after: avoid; }
.kalusto p { margin: 0 0 20px; break-inside: avoid; }
.kalusto img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; cursor: zoom-in; }
dialog.suurennus { max-width: 96vw; max-height: 96vh; padding: 0; border: 0; background: transparent; overflow: visible; }
dialog.suurennus::backdrop { background: rgba(0, 0, 0, .85); }
dialog.suurennus img { display: block; max-width: 96vw; max-height: 90vh; width: auto; height: auto; cursor: zoom-out; }
dialog.suurennus button {
  position: absolute; right: 0; top: -40px; padding: 6px 14px; border: 0; background: #fff; color: var(--tumma);
  font: inherit; font-weight: 600; cursor: pointer;
}

/* Yhteystiedot */
.yhteys-tekstit p { margin: 0 0 10px; padding-bottom: 10px; border-bottom: 1px dotted #ddd; }
.yhteys-tekstit p:last-child { border-bottom: 0; }
.yhteys-tekstit h3 { margin-top: 20px; }
.yhteys-tekstit h3:first-child { margin-top: 0; }
.yhteys-lomake { --lomake-kehys-korkeus: 700px; }
.yhteys-lomake h2 { font-size: 18px; }

/* Alatunniste */
.alaosa-ylempi { padding: 40px 0; border-top: 5px solid var(--aksentti); background: var(--tumma); color: #c9d3d7; }
.alaosa-ylempi :focus-visible, .alaosa-alempi :focus-visible { outline-color: var(--aksentti); }
.alaosa-palstat { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.alaosa-ylempi h2 { color: #fff; font-size: 16px; font-weight: 300; }
.alaosa-ylempi a, .alaosa-alempi a { color: #fff; }
.alaosa-ylempi a:hover, .alaosa-alempi a:hover { color: var(--aksentti); }
.alaosa-ylempi p { margin-bottom: 12px; }
.yhteys-tiedot { font-style: normal; }
.alaosa-alempi { padding: 20px 0; background: #252525; color: #b8b8b8; font-size: 12px; }
.alaosa-rivi { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }
.alaosa-rivi p { margin: 0; }
.some { display: flex; gap: 16px; margin: 0; padding: 0; list-style: none; }

@media (max-width: 899px) {
  .kalusto { column-count: 2; }
}

@media (max-width: 767px) {
  .ylaosa-rivi { justify-content: center; }
  .logo { margin: 12px 0 6px; }
  .valikko ul { justify-content: center; }
  .valikko a { height: 44px; padding: 0 12px; line-height: 44px; }
  .sivuotsikko { padding-top: 60px; margin-bottom: 30px; }
  .sivuotsikko::before { height: 120px; }
  .sivuotsikko-laatikko { padding: 12px 20px; min-height: 0; }
  .sivuotsikko h1 { font-size: 26px; line-height: 34px; }
  .intro { padding-top: 30px; }
  .intro h2 { font-size: 24px; }
  .slider { height: auto; aspect-ratio: 1 / 1; max-height: 520px; }
  .dia-teksti { bottom: 36px; }
  .dia-otsikko { font-size: 18px; line-height: 32px; }
  .dia-rivi { font-size: 14px; line-height: 28px; }
  .slider-nuoli { display: none; }
  .yhteys-kaksi { display: grid; grid-template-columns: 1fr; gap: 20px; }
  .alaosa-palstat { grid-template-columns: 1fr; gap: 20px; }
}

@media (min-width: 768px) {
  .yhteys-kaksi { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); gap: 40px; }
}

@media (max-width: 559px) {
  .kalusto { column-count: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .dia, a, .valikko a { transition: none; }
}
