/*
Theme Name: DigiSilta perussivu
Description: Kevyt artikkelisivuston teema Silta AI:n testisivustoille.
Author: DigiSilta Oy
Template: hello-elementor
Version: 1.0.1
Text Domain: ds-perussivu
*/

:root {
	--ds-vari: #1f5f4a;
	--ds-tumma: #173f33;
	--ds-tausta: #f6f3ec;
	--ds-teksti: #1d1d1b;
	--ds-himmea: #5f5d57;
	--ds-pohja: #ffffff;
	--ds-fontti: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--ds-leveys: 1180px;
}

body.ds {
	margin: 0;
	background: var(--ds-pohja);
	color: var(--ds-teksti);
	font-family: var(--ds-fontti);
	font-size: 17px;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

.ds .sisalto { flex: 1 0 auto; }

body.ds h1, body.ds h2, body.ds h3, body.ds h4 {
	font-family: var(--ds-fontti);
	color: var(--ds-teksti);
	font-weight: 700;
	letter-spacing: -0.015em;
	line-height: 1.2;
	margin: 0 0 0.5em;
	text-transform: none;
}

body.ds a { color: var(--ds-vari); }
body.ds a:focus-visible, body.ds button:focus-visible, body.ds input:focus-visible { outline: 2px solid var(--ds-vari); outline-offset: 3px; }

.ds .leveys { max-width: var(--ds-leveys); margin: 0 auto; padding: 0 24px; box-sizing: border-box; }
.ds .kapea { max-width: 760px; }

.ds .skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 100; background: #fff; padding: 8px 12px; clip: auto; width: auto; height: auto; }

/* Otsake */
.ds .otsake { background: var(--ds-pohja); position: sticky; top: 0; z-index: 20; box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06); }
.admin-bar.ds .otsake { top: 32px; }
.ds .otsake-rivi { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 72px; }
.ds .merkki { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ds-teksti); }
.ds .merkki-kirjain { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--ds-vari); color: #fff; font-weight: 700; font-size: 18px; line-height: 1; }
.ds .merkki-nimi { font-weight: 700; font-size: 19px; letter-spacing: -0.01em; }
.ds .valikko { list-style: none; margin: 0; padding: 0; display: flex; gap: 28px; }
.ds .valikko a { color: var(--ds-teksti); text-decoration: none; font-weight: 500; font-size: 16px; padding: 6px 0; }
.ds .valikko a:hover, .ds .valikko .current-menu-item > a, .ds .valikko .current_page_parent > a { color: var(--ds-vari); }

/* Hero ja sivujen otsakkeet */
.ds .hero { background: var(--ds-tausta); padding: 96px 0 88px; }
.ds .hero-sisalto { max-width: 860px; margin-left: auto; margin-right: auto; text-align: center; }
body.ds .hero h1 { font-size: clamp(34px, 5vw, 54px); margin-bottom: 18px; }
.ds .hero-teksti { font-size: 19px; color: var(--ds-himmea); margin: 0 auto 36px; max-width: 620px; }
.ds .sivu-otsake { background: var(--ds-tausta); padding: 64px 0 56px; }
body.ds .sivu-otsake h1 { font-size: clamp(30px, 4vw, 44px); margin-bottom: 12px; }
.ds .sivu-ingressi { color: var(--ds-himmea); margin: 0 0 24px; }

/* Haku */
.ds .haku { display: flex; gap: 8px; max-width: 560px; }
.ds .haku-hero { margin: 0 auto; }
.ds .haku-sivu { margin-top: 24px; }
.ds .haku input[type="search"] { flex: 1; min-width: 0; height: 52px; padding: 0 18px; border: 1px solid rgba(0, 0, 0, 0.14); border-radius: 8px; background: #fff; font: inherit; font-size: 16px; color: var(--ds-teksti); box-sizing: border-box; }
.ds .haku input[type="search"]:focus { border-color: var(--ds-vari); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ds-vari) 20%, transparent); }
body.ds .haku button { height: 52px; padding: 0 26px; border: 0; border-radius: 8px; background: var(--ds-vari); color: #fff; font: inherit; font-weight: 600; font-size: 16px; cursor: pointer; transition: background-color 0.15s ease; }
body.ds .haku button:hover { background: var(--ds-tumma); }

/* Osiot */
.ds .osio { padding: 80px 0; }
.ds .osio-lista { padding-top: 56px; }
.ds .osio-otsake { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 40px; }
body.ds .osio-otsake h2 { font-size: clamp(26px, 3vw, 32px); margin: 0; }
.ds .teksti-linkki { font-weight: 600; text-decoration: none; white-space: nowrap; }
.ds .teksti-linkki::after { content: " →"; }
.ds .teksti-linkki:hover { text-decoration: underline; text-underline-offset: 4px; }
.ds .osio-tietoa { background: var(--ds-tausta); text-align: center; }
body.ds .osio-tietoa h2 { font-size: 28px; }
.ds .osio-tietoa p { color: var(--ds-himmea); font-size: 18px; margin: 0; }
.ds .osio-lisaa { background: var(--ds-tausta); }
.ds .tyhja { color: var(--ds-himmea); }

/* Artikkelikortit */
.ds .ruudukko { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 56px 48px; }
.ds .kortti-linkki { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit; }
.ds .kortti-kuva { display: block; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 10px; background: var(--ds-tausta); margin-bottom: 6px; }
.ds .kortti-kuva img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s ease; }
.ds .kortti-linkki:hover .kortti-kuva img { transform: scale(1.03); }
.ds .kortti-meta { font-size: 14px; color: var(--ds-vari); font-weight: 600; font-variant-numeric: tabular-nums; }
body.ds .kortti-otsikko { font-size: 21px; line-height: 1.3; margin: 0; transition: color 0.15s ease; }
.ds .kortti-linkki:hover .kortti-otsikko { color: var(--ds-vari); }
.ds .kortti-ote { margin: 0; color: var(--ds-himmea); font-size: 16px; line-height: 1.6; }

/* Sivutus */
.ds .pagination { margin-top: 64px; }
.ds .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.ds .page-numbers { display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 12px; border-radius: 8px; text-decoration: none; color: var(--ds-teksti); font-weight: 500; box-sizing: border-box; font-variant-numeric: tabular-nums; }
.ds a.page-numbers:hover { background: var(--ds-tausta); color: var(--ds-vari); }
.ds .page-numbers.current { background: var(--ds-vari); color: #fff; }
.ds .page-numbers.dots { min-width: 24px; padding: 0; }

/* Artikkeli */
.ds .artikkeli { padding: 64px 0 24px; }
.ds .artikkeli-otsake { margin-bottom: 40px; }
.ds .paluu { display: inline-block; font-weight: 600; font-size: 15px; text-decoration: none; margin-bottom: 20px; }
.ds .paluu::before { content: "← "; }
body.ds .artikkeli-otsake h1 { font-size: clamp(30px, 4.2vw, 46px); line-height: 1.15; margin-bottom: 16px; }
.ds .artikkeli-meta { color: var(--ds-himmea); font-size: 15px; margin: 0; display: flex; gap: 10px; font-variant-numeric: tabular-nums; }
.ds .artikkeli-kuva { margin: 0 auto 48px; max-width: 1000px; }
.ds .artikkeli-kuva img { width: 100%; height: auto; border-radius: 12px; display: block; }

.ds .teksti { font-size: 18px; line-height: 1.75; padding-bottom: 56px; }
.ds .teksti > * { margin-top: 0; margin-bottom: 1.1em; }
body.ds .teksti h2 { font-size: 28px; margin-top: 1.8em; margin-bottom: 0.6em; }
body.ds .teksti h3 { font-size: 22px; margin-top: 1.6em; margin-bottom: 0.5em; }
body.ds .teksti h4 { font-size: 19px; margin-top: 1.4em; }
.ds .teksti ul, .ds .teksti ol { padding-left: 1.3em; }
.ds .teksti li { margin-bottom: 0.4em; }
.ds .teksti li > p { margin: 0; }
.ds .teksti hr { border: 0; height: 0; margin: 2.2em 0; }
.ds .teksti img { max-width: 100%; height: auto; border-radius: 10px; }
.ds .teksti blockquote { margin: 1.6em 0; padding: 4px 0 4px 24px; box-shadow: inset 3px 0 0 var(--ds-vari); color: var(--ds-himmea); font-size: 19px; }
.ds .teksti table { width: 100%; border-collapse: collapse; font-size: 16px; }
.ds .teksti th, .ds .teksti td { padding: 10px 12px; text-align: left; background: var(--ds-tausta); }
.ds .teksti tr:nth-child(even) td { background: #fff; }
.ds .teksti a { text-underline-offset: 3px; }

/* Alatunniste */
.ds .alatunniste { background: var(--ds-tumma); color: rgba(255, 255, 255, 0.78); padding: 64px 0 32px; font-size: 16px; }
.ds .alatunniste-rivi { display: flex; justify-content: space-between; gap: 48px; flex-wrap: wrap; }
.ds .alatunniste-tiedot { max-width: 460px; }
.ds .alatunniste-tiedot p { margin: 16px 0 0; }
.ds .merkki-vaalea, .ds .merkki-vaalea .merkki-nimi { color: #fff; }
.ds .merkki-vaalea .merkki-kirjain { background: #fff; color: var(--ds-tumma); }
.ds .valikko-ala a { color: #fff; }
.ds .valikko-ala a:hover, .ds .valikko-ala .current-menu-item > a, .ds .valikko-ala .current_page_parent > a { color: #fff; text-decoration: underline; text-underline-offset: 4px; }
.ds .alatunniste-pohja { margin-top: 48px; font-size: 14px; color: rgba(255, 255, 255, 0.6); }
.ds .alatunniste-pohja p { margin: 0; }

@media (max-width: 1024px) {
	.ds .ruudukko { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px 36px; }
}

@media (max-width: 680px) {
	body.ds { font-size: 16px; }
	.ds .leveys { padding: 0 20px; }
	.ds .otsake { position: static; }
	.ds .otsake-rivi { flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px 20px 10px; min-height: 0; }
	.ds .valikko { gap: 22px; }
	.ds .hero { padding: 56px 0 52px; }
	.ds .hero-sisalto { text-align: left; }
	.ds .hero-teksti { font-size: 17px; margin-bottom: 28px; }
	.ds .haku input[type="search"], body.ds .haku button { height: 48px; }
	body.ds .haku button { padding: 0 18px; }
	.ds .sivu-otsake { padding: 44px 0 40px; }
	.ds .osio { padding: 56px 0; }
	.ds .osio-otsake { margin-bottom: 28px; flex-direction: column; gap: 8px; }
	.ds .osio-tietoa { text-align: left; }
	.ds .ruudukko { grid-template-columns: 1fr; gap: 40px; }
	body.ds .kortti-otsikko { font-size: 20px; }
	.ds .artikkeli { padding-top: 40px; }
	.ds .teksti { font-size: 17px; }
	body.ds .teksti h2 { font-size: 24px; }
	body.ds .teksti h3 { font-size: 20px; }
	.ds .alatunniste-rivi { flex-direction: column; gap: 28px; }
}

@media (prefers-reduced-motion: reduce) {
	.ds * { transition: none !important; }
}
