/* Afabi – sivuston tyylit.
   Mitat ja värit vastaavat alkuperäistä Arnold-teemaa (mitattu 1400 px ja 375 px leveyksillä).
   Saavutettavuuden vuoksi tehdyt poikkeamat on merkitty kommentilla "A11Y". */

/* ---------- Fontit (Poppins, SIL Open Font License) ---------- */
@font-face { font-family: Poppins; font-style: normal; font-weight: 300; font-display: swap; src: url(../fonts/poppins-latin-300-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Poppins; font-style: normal; font-weight: 300; font-display: swap; src: url(../fonts/poppins-latin-ext-300-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Poppins; font-style: italic; font-weight: 300; font-display: swap; src: url(../fonts/poppins-latin-300-italic.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Poppins; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/poppins-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Poppins; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/poppins-latin-ext-500-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: Poppins; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/poppins-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: Poppins; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/poppins-latin-ext-600-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ---------- Muuttujat ---------- */
:root {
  --c-bg: #ffffff;
  --c-text: #414145;        /* leipäteksti, kontrasti 10,1:1 */
  --c-title: #313139;       /* otsikot ja valikko, 12,6:1 */
  --c-strong: #00010a;
  --c-link: #d10000;        /* A11Y: alkuperäinen #ff0000 (4,0:1) tummennettu, 5,6:1 */
  --c-border: #eeeeee;
  --c-footer: #28282e;
  --c-focus: #00010a;
  --font: Poppins, Arial, Helvetica, sans-serif;
  --pad: 60px;              /* sivun reunatila (container-fluid) */
  --header-h: 360px;
  --col-gap: 40px;
  --grid-gap: 20px;
}
@media (max-width: 767px) {
  :root { --pad: 20px; --header-h: 100px; --grid-gap: 20px; }
}

/* ---------- Perusta ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font);
  font-weight: 300;
  font-size: 1.25rem;       /* 20px */
  line-height: 1.5;
  letter-spacing: 0.5px;
  overflow-wrap: break-word;
}
@media (max-width: 767px) { body { font-size: 1rem; } }
img, svg { max-width: 100%; height: auto; }
img { display: block; }
h1, h2, h3, h4, h5, h6 { color: var(--c-title); font-weight: 600; line-height: 1.2; margin: 0; hyphens: auto; }
p, ul, ol { margin: 0; }
a { color: inherit; text-decoration: none; }
strong, b { font-weight: 600; }
::selection { color: #000; background: #dbd7d2; }
.logo-link { display: inline-block; margin-top: 6px; line-height: 0; }
.logo-link img { display: block; }
/* Näkyy vain näppäimistöfokuksessa (esim. karusellin pysäytyspainike) */
.focus-reveal:not(:focus):not(:focus-visible) { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.container { padding-left: var(--pad); padding-right: var(--pad); }
[hidden] { display: none !important; }

/* A11Y: näkyvä näppäimistöfokus kaikille interaktiivisille elementeille (2.4.7, 2.4.11) */
:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 3px; box-shadow: 0 0 0 6px #fff; border-radius: 1px; }
:focus:not(:focus-visible) { outline: none; }
main:focus { outline: none; }

/* A11Y: ohituslinkki */
.skip-link { position: absolute; left: 12px; top: -200px; z-index: 10001; padding: 12px 20px; background: var(--c-title); color: #fff; font-size: 1rem; font-weight: 500; }
.skip-link:focus { top: 12px; }

/* ---------- Otsake ---------- */
.site-header { position: relative; z-index: 9990; background: var(--c-bg); }
.header-main { display: flex; justify-content: space-between; align-items: center; gap: 20px; min-height: var(--header-h); }
.logo { display: inline-block; flex: 0 1 auto; }
.logo-image { height: 85px; width: auto; max-width: 100%; object-fit: contain; }
.head-meta { display: flex; align-items: center; }
.site-nav .menu { display: flex; list-style: none; padding: 0; }
.site-nav .menu > li { position: relative; margin-left: 40px; white-space: nowrap; }
.site-nav .menu > li:first-child { margin-left: 0; }
.site-nav .menu > li > a {
  position: relative; display: inline-block;
  font-size: 1.125rem; line-height: 1; letter-spacing: 0.5px; color: var(--c-title);
  padding: 4px 0; margin: -4px 0; /* A11Y: kosketusalue ≥ 24 px ilman ulkoasumuutosta */
}
/* Alleviivausefekti (menu-hover-underline1): 2px viiva 9px tekstin alapuolella */
.site-nav .menu > li > a::before {
  content: ""; position: absolute; left: 0; bottom: -5px; height: 2px; width: 100%;
  background: currentColor; transform: scaleX(0); transform-origin: left center; transition: transform .3s;
}
.site-nav .menu > li > a:hover::before,
.site-nav .menu > li.is-current > a::before,
.site-nav .menu > li > a[aria-current]::before { transform: scaleX(1); }
.site-nav .menu > li.is-current > a, .site-nav .menu > li > a[aria-current] { color: var(--c-strong); }

/* Alavalikko: näkyy hiirellä, näppäimistöfokuksella ja Esc sulkee (1.4.13) */
.sub-menu { position: absolute; left: 0; top: 100%; min-width: 200px; margin-left: -20px; padding: 20px 0 10px; list-style: none; background: var(--c-bg); opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .3s, transform .3s, visibility 0s .3s; }
.sub-menu li { padding: 0 20px; line-height: 1.8; }
.sub-menu a { font-size: 1.125rem; white-space: nowrap; color: var(--c-strong); display: inline-block; padding: 2px 0; }
.sub-menu a:hover, .sub-menu a[aria-current] { text-decoration: underline; text-underline-offset: 4px; }
.has-children:hover > .sub-menu, .has-children:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; transition: opacity .3s, transform .3s; }
.has-children.is-dismissed > .sub-menu { opacity: 0; visibility: hidden; }

.search-link { display: inline-flex; align-items: center; justify-content: center; margin-left: 20px; width: 24px; height: 32px; color: var(--c-text); }
.search-link .icon { width: 24px; height: 24px; }

/* Tabletti: logon alue enintään 260 px kuten alkuperäisessä (theme_option_logo_wrap_width) */
@media (max-width: 1199px) and (min-width: 768px) {
  .logo { max-width: 260px; }
  .logo-image { height: auto; width: 100%; }
  .site-nav .menu > li { margin-left: 30px; }
  .site-nav .menu > li > a, .sub-menu a { font-size: 1rem; }
}

/* Mobiilivalikko (alle 768 px) */
.menu-toggle { display: none; align-items: center; gap: 15px; min-height: 44px; padding: 0 4px; margin: 0; border: 0; background: none; color: var(--c-title); font: inherit; font-size: 1rem; line-height: 1; letter-spacing: 0.5px; cursor: pointer; }
.menu-toggle-icon { position: relative; width: 16px; height: 16px; display: inline-block; }
.menu-toggle-icon span { position: absolute; left: 0; width: 16px; height: 2px; background: currentColor; transition: transform .3s, opacity .3s; }
.menu-toggle-icon span:nth-child(1) { top: 1px; }
.menu-toggle-icon span:nth-child(2) { top: 7px; }
.menu-toggle-icon span:nth-child(3) { top: 13px; }
.menu-toggle[aria-expanded="true"] .menu-toggle-icon span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle-icon span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .menu-toggle-icon span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 767px) {
  .logo-image { height: 50px; }
  .header-main { flex-wrap: wrap; }
  /* Ilman JavaScriptiä valikko näkyy otsakkeen alla listana */
  .site-nav { order: 3; width: 100%; }
  .head-meta { flex-wrap: wrap; justify-content: flex-end; }
  .site-nav .menu { flex-wrap: wrap; gap: 8px 20px; padding: 10px 0 20px; }
  .site-nav .menu > li { margin-left: 0; }
  .sub-menu { position: static; opacity: 1; visibility: visible; transform: none; margin: 4px 0 0 0; padding: 0 0 0 12px; min-width: 0; }
  .sub-menu li { padding: 0; }
  .sub-menu a { font-size: 1rem; white-space: normal; }

  .js .menu-toggle { display: inline-flex; padding: 0; }
  .js .header-main { flex-wrap: nowrap; gap: 8px; }
  .js .head-meta { flex-wrap: nowrap; }
  .js .site-nav { display: none; }
  .js.menu-open .site-nav {
    display: flex; position: fixed; inset: 0; z-index: -1; overflow-y: auto;
    align-items: center; justify-content: center; padding: calc(var(--header-h) + 20px) 20px 40px; background: var(--c-bg);
  }
  .js.menu-open .site-nav .menu { flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 0; }
  .js.menu-open .site-nav .menu > li > a { font-size: 1.125rem; font-weight: 300; line-height: 1.35; padding: 6px 0; margin: 0; color: var(--c-title); }
  /* Vain nykyinen sivu lihavoituna; projektisivulla lihavoidaan sen osio */
  .js.menu-open .site-nav a[aria-current],
  .js.menu-open .site-nav .menu li.is-current:not(:has([aria-current])) > a { font-weight: 600; }
  .js.menu-open .site-nav .menu > li > a::before { display: none; }
  .js.menu-open .sub-menu { padding: 0 0 8px; margin: 0; }
  .js.menu-open .sub-menu a { font-size: 1rem; padding: 4px 0; text-decoration: none; }
  .js.menu-open { overflow: hidden; }
  .js.menu-open .header-main { position: relative; z-index: 2; }
  .search-link { margin-left: 10px; }
  .search-link .icon { width: 20px; height: 20px; }
}

/* ---------- Ruudukot (projektilistat) ---------- */
.grid-page { padding-bottom: 0; }
.grid { list-style: none; padding: 0; display: grid; gap: var(--grid-gap); grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 767px) { .grid, .grid-cols-3 { grid-template-columns: minmax(0, 1fr); } }

.card { position: relative; display: flex; flex-direction: column-reverse; }
.card-media { position: relative; overflow: hidden; background: #f8f8f8; aspect-ratio: 4 / 3; }
.card-img { width: 100%; height: 100%; object-fit: cover; }
.card-media::after { content: ""; position: absolute; inset: -1px; background: #000; opacity: 0; transition: opacity .3s; }
.card-text {
  position: absolute; z-index: 9; inset: 0; display: flex; flex-direction: column; justify-content: center;
  padding: 0 20px; text-align: center; color: #fff; opacity: 0; transition: opacity .3s;
}
.card-title { color: #fff; font-size: 1.5rem; font-weight: 600; line-height: 1.5; letter-spacing: 0; }
.card-sub { font-size: 1rem; line-height: 1.5; letter-spacing: 0; }
/* Koko kortti on linkki (venytetty linkki), otsikko on linkin nimi */
.card-link::after { content: ""; position: absolute; inset: 0; z-index: 10; }
.card:focus-within .card-media::after { opacity: .8; }
.card:focus-within .card-text { opacity: 1; }
/* Hover vain laitteilla, joissa on hiiri (kosketusnäytöllä :hover jää muuten "jumiin" napautuksen jälkeen) */
@media (hover: hover) {
  .card:hover .card-media::after { opacity: .8; }
  .card:hover .card-text { opacity: 1; }
  .grid-textcovers .card:hover .card-img { filter: invert(1); }
}
/* A11Y: fokus näkyy koko kortin ympärillä */
.card-link:focus-visible { outline: none; box-shadow: none; }
.card:has(.card-link:focus-visible) { outline: 3px solid var(--c-focus); outline-offset: 4px; }

@media (max-width: 1199px) and (min-width: 768px) { .card-title, .card-sub { font-size: 1rem; } }
@media (max-width: 767px) { .card-title { font-size: 1.5rem; line-height: 1.3; } .card-sub { font-size: 1.125rem; } }
/* Kosketusnäytöillä ei ole hover-tilaa: JavaScript tummentaa kortin ja näyttää nimen, kun kortti on näytön keskellä
   (sama ilme kuin hiirellä). Ilman JavaScriptiä nimi näytetään kuvan alla, jotta se on aina nähtävissä. */
@media (hover: none) {
  .card.is-active .card-media::after { opacity: .8; }
  .card.is-active .card-text { opacity: 1; }
  html:not(.js) .card-text { position: static; display: block; opacity: 1; color: var(--c-title); text-align: left; padding: 10px 0 0; }
  html:not(.js) .card-title { color: var(--c-title); font-size: 1.25rem; line-height: 1.3; }
  html:not(.js) .card-sub { font-size: 1rem; color: var(--c-text); }
  html:not(.js) .grid-textcovers .card-text { position: absolute; opacity: 0; }
}
/* Kansikuvat, joissa nimi on jo kuvassa (menneet hankkeet, tapahtumat): nimeä ei kirjoiteta päälle,
   vaan kuvan värit käännetään. Nimi on silti linkin saavutettava nimi ruudunlukijoille. */
.grid-textcovers .card-text, .grid-textcovers .card:hover .card-text, .grid-textcovers .card:focus-within .card-text, .grid-textcovers .card.is-active .card-text { opacity: 0; }
.grid-textcovers .card-media::after { display: none; }
.grid-textcovers .card-img { transition: filter .3s; }
.grid-textcovers .card:focus-within .card-img, .grid-textcovers .card.is-active .card-img { filter: invert(1); }

/* ---------- Galleria / karuselli ---------- */
/* Alkuperäinen: karuselli (tyyli 3) koko leveys, korkeus 65vh / mobiili 30vh, kuvien väli 40px / 10px,
   keskikuvan molemmin puolin näkyvät viereiset kuvat; yksittäinen kuva (tyyli 1) koko leveys, 80vh, rajattu. */
.gallery { position: relative; margin: 0 calc(var(--pad) * -1); }
.gallery-carousel { margin-bottom: 120px; }
.gallery-single .gallery-img { width: 100%; height: 80vh; min-height: 240px; object-fit: cover; }
.carousel-track {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: 40px; height: 65vh; min-height: 240px;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scrollbar-width: none;
}
/* viimeinen kuva näytetään ensimmäisen vasemmalla puolella kuten alkuperäisessä silmukassa (DOM-järjestys säilyy) */
.carousel-track .slide:last-child { order: -1; }
.carousel-track::before, .carousel-track::after { content: ""; flex: 0 0 50%; }
.carousel-track::before { order: -2; }
.carousel-track::-webkit-scrollbar { display: none; }
/* JavaScriptin silmukka: kopiot täyttävät reunat, joten välikkeitä ja järjestyksen vaihtoa ei tarvita */
.carousel-track.is-loop::before, .carousel-track.is-loop::after { content: none; }
.carousel-track.is-loop .slide:last-child { order: 0; }
.slide { flex: 0 0 auto; height: 100%; scroll-snap-align: center; }
.slide .gallery-img { height: 100%; width: auto; max-width: none; }
.carousel-btn {
  position: absolute; z-index: 5; display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .9); color: var(--c-title); cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
}
.carousel-btn:hover { background: #fff; }
.carousel-prev, .carousel-next { top: 50%; transform: translateY(-50%); }
.carousel-prev { left: var(--pad); }
.carousel-next { right: var(--pad); }
.carousel-controls { position: absolute; z-index: 6; right: var(--pad); bottom: 16px; }
.carousel-pause { position: static; width: 44px; height: 44px; }
.carousel-pause .icon-play { display: none; }
.carousel-pause[aria-pressed="true"] .icon-play { display: block; }
.carousel-pause[aria-pressed="true"] .icon-pause { display: none; }
.gallery-carousel + .rows > .row:first-child { padding-top: 0; }
@media (max-width: 767px) {
  .gallery-carousel { margin-bottom: 50px; }
  .carousel-track { height: 30vh; gap: 10px; }
  .gallery-single .gallery-img { height: 60vh; }
  .carousel-btn { width: 44px; height: 44px; }
  .carousel-prev { left: 8px; } .carousel-next { right: 8px; }
  .carousel-controls { right: 8px; bottom: 8px; }
}

/* ---------- Sivun rivit (otsikko vasemmalla, teksti oikealla) ---------- */
.rows { padding-bottom: 60px; }
.row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--col-gap); padding-top: 80px; }
.row + .row { padding-top: 60px; }
.col-full { grid-column: 1 / -1; }
/* rowLayout: right – otsikko ja teksti oikeassa palstassa (Yhdistys-sivu) */
.row-right .col-text { grid-column: 2; }
.row-title + .row-right { padding-top: 110px; }
/* alkuperäisessä otsikkomoduulin yläreuna oli -10px */
.row-title .col-heading { margin-top: -10px; }
.gallery-carousel + .rows .row-title .col-heading { margin-top: 0; }
.row-right + .row-right { padding-top: 0; }
.row-right .row-heading { margin-bottom: 20px; }
.row-right .text, .row-right { padding-bottom: 0; }
.row-right .col-text > :last-child { margin-bottom: 1.5em; }
.heading-large { font-size: 4.375rem; line-height: 1.2; }          /* h1 70px */
.heading-fluid { font-size: max(2.125rem, 3.4vw); line-height: 1.2; } /* alkuperäinen 3.4vw, mobiilissa 34px */
.heading-h2 { font-size: 2.875rem; line-height: 1.2; }             /* 46px */
.heading-h5 { font-size: 1.375rem; line-height: 1.2; }             /* 22px */
.lead { margin-top: 30px; color: var(--c-title); font-size: 1.625rem; font-weight: 600; line-height: 1.2; }
@media (max-width: 767px) {
  .row { grid-template-columns: minmax(0, 1fr); padding-top: 40px; row-gap: 20px; }
  .row + .row { padding-top: 30px; }
  .row-right .col-text { grid-column: 1; }
  .row-title + .row-right { padding-top: 40px; }
  .row-title .col-heading { margin-top: 0; }
  .rows { padding-bottom: 30px; }
  .heading-large { font-size: 2.125rem; }
  .heading-h2 { font-size: 1.75rem; }
  .lead { font-size: 1.25rem; margin-top: 16px; }
}

/* Leipätekstin muotoilu */
.text p, .text ul, .text ol, .text blockquote, .text .media { margin: 0 0 1.5em; }
.text > :last-child { margin-bottom: 0; }
.text h2:not([class]), .text h3:not([class]), .text h4:not([class]) { margin: 1.5em 0 .75em; }
.text h2:not([class]) { font-size: 1.625rem; }
.text h3:not([class]) { font-size: 1.375rem; }
.text h4:not([class]) { font-size: 1.125rem; }
.text > h2:first-child, .text > h3:first-child, .text > h4:first-child { margin-top: 0; }
.text ul, .text ol { padding-left: 1.4em; }
.dash-lists .text ul { list-style-type: "-  "; }
.text blockquote { padding-left: 1em; border-left: 3px solid var(--c-border); }
.text em { font-style: italic; }
/* A11Y: tekstin sisäiset linkit alleviivataan, koska punainen ei erotu riittävästi tekstistä pelkällä värillä (1.4.1) */
.text a, .archive-des a { color: var(--c-link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.text a:hover { text-decoration-thickness: 2px; }
.file-type { font-size: .8em; white-space: nowrap; }
.img-inline { display: inline-block; height: auto; }

/* ---------- Edellinen / seuraava ---------- */
.post-navi { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--col-gap); padding: 20px 0 40px; }
.post-navi a { display: inline-flex; flex-direction: column; gap: 4px; color: var(--c-title); padding: 4px 0; }
.post-navi-next { text-align: right; justify-self: end; }
.post-navi-label { font-size: .875rem; letter-spacing: 1px; text-transform: uppercase; }
.post-navi-title { font-size: 1.125rem; font-weight: 600; line-height: 1.3; }
.post-navi a:hover .post-navi-title { text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 767px) { .post-navi { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 20px 0 40px; } .post-navi-next { justify-self: start; text-align: left; } }

/* ---------- Arkisto / blogi ---------- */
.title-wrap { margin-top: 50px; padding-bottom: 140px; }
.title-wrap-tit { font-size: 2.625rem; line-height: 1.4; margin: 20px 0 10px; padding: 10px 0; }
.archive-des, .article-meta { font-size: 1rem; line-height: 1.5; }
.sidebar-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; column-gap: 80px; }
.archive-list { list-style: none; padding: 0; }
.archive-item + .archive-item { margin-top: 100px; }
.archive-tit { font-size: 1.625rem; margin: 20px 0 10px; }
.archive-tit a { color: var(--c-title); }
.archive-tit a:hover, .archive-more a:hover, .widget-list a:hover { text-decoration: underline; text-underline-offset: 4px; }
.archive-meta { font-size: 1rem; }
.archive-more a { display: inline-block; color: var(--c-title); padding: 2px 0; }
.pagenums { margin-top: 80px; }
.pagenums ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.page-numbers { display: inline-block; min-width: 32px; padding: 2px 6px; text-align: center; color: var(--c-link); }
a.page-numbers:hover { text-decoration: underline; }
.page-numbers.current { color: var(--c-title); font-weight: 600; border-bottom: 2px solid currentColor; }
.sidebar { font-size: 1rem; }
.widget-title { margin: 20px 0; text-align: center; font-size: 1.125rem; font-weight: 500; line-height: 40px; color: var(--c-text); border-bottom: 1px solid currentColor; }
.widget-title span { display: inline-block; padding: 0 20px; }
.widget-list { list-style: none; padding: 0; }
.widget-list li { padding: 10px 0; border-bottom: 1px solid var(--c-border); }
.widget-list a { display: inline-block; line-height: 20px; color: var(--c-text); padding: 2px 0; }
.widget-list a[aria-current] { font-weight: 500; text-decoration: underline; text-underline-offset: 4px; }
.archive { padding-bottom: 80px; }
@media (max-width: 991px) { .sidebar-layout { grid-template-columns: minmax(0, 1fr); } .sidebar { margin-top: 80px; } }
@media (max-width: 767px) {
  .title-wrap { margin-top: 50px; padding-bottom: 60px; }
  .title-wrap-tit { margin-top: 0; padding-top: 0; line-height: 1.3; }
  .archive-tit { font-size: 1.75rem; }
  .archive-item + .archive-item { margin-top: 40px; }
  .pagenums { margin-top: 40px; }
}

/* Yksittäinen kirjoitus */
.single-post { max-width: calc(970px + var(--pad) * 2); margin: 0 auto; padding-bottom: 40px; }
.single-post .title-wrap { padding-bottom: 60px; }
.single-post .post-navi { margin-top: 80px; border-top: 1px solid var(--c-border); }

/* Haku */
.search-form label { display: block; font-size: 1rem; font-weight: 500; margin-bottom: 8px; color: var(--c-title); }
.search-row { display: flex; gap: 10px; flex-wrap: wrap; }
.search-form input { flex: 1 1 260px; min-height: 48px; padding: 8px 12px; font: inherit; font-size: 1.125rem; color: var(--c-title); border: 2px solid #767676; border-radius: 0; background: #fff; }
.search-form button { min-height: 48px; padding: 8px 24px; font: inherit; font-size: 1.125rem; font-weight: 500; color: #fff; background: var(--c-title); border: 2px solid var(--c-title); cursor: pointer; }
.search-form button:hover { background: #fff; color: var(--c-title); }
.search-status { margin: 30px 0 40px; font-size: 1rem; }
.search-results .archive-item + .archive-item { margin-top: 50px; }

/* ---------- Alatunniste ---------- */
.site-footer { padding: 60px 0; text-align: center; color: var(--c-footer); font-size: .75rem; font-weight: 500; line-height: 1.5; }
.footer-social { list-style: none; padding: 0; display: flex; justify-content: center; gap: 20px; }
.social-link { display: inline-block; font-size: .875rem; font-weight: 500; line-height: 1; color: var(--c-footer); padding: 5px 4px; }
.social-link:hover, .footer-meta a:hover { text-decoration: underline; text-underline-offset: 4px; }
.footer-meta { margin-top: 8px; }
.footer-meta a { display: inline-block; padding: 4px 0; color: var(--c-footer); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 767px) { .site-footer { padding: 30px 0; } }

.back-top { position: fixed; z-index: 999; right: var(--pad); bottom: 72px; width: 40px; height: 60px; color: var(--c-title); display: flex; align-items: center; justify-content: center; }
.back-top .icon { width: 40px; height: 60px; transition: transform .3s; }
.back-top:hover .icon { transform: translateY(-6px); }
@media (max-width: 767px) { .back-top { display: none !important; } }

/* ---------- Liikkeen vähentäminen (2.3.3) ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; animation-iteration-count: 1 !important; }
  .carousel-track { scroll-behavior: auto; }
}

/* ---------- Windowsin suurikontrastitila ---------- */
@media (forced-colors: active) {
  .card-text { opacity: 1; position: static; display: block; }
  .card-title, .card-sub { color: CanvasText; }
  .carousel-btn, .search-form button { border: 1px solid ButtonText; }
  .site-nav .menu > li > a::before { background: CanvasText; }
}
