/*
Theme Name: Kiviojan Ponitalli
Description: Kevyt, mobiiliystävällinen teema Kiviojan Ponitallille. Ei ulkoisia fontteja tai skriptejä.
Version: 1.1.0
Requires at least: 6.4
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: kiviojan-ponitalli
*/

/* ---------- Perusasetukset ---------- */

:root {
	--bg: #f7f4ee;
	--surface: #ffffff;
	--surface-alt: #efeadf;
	--ink: #1f2b25;
	--muted: #56645c;
	--line: #e2dccf;
	--green: #2d5240;
	--green-dark: #1f3b2e;
	--green-soft: #e4ece6;
	--accent: #9a5b1f;
	--radius: 14px;
	--radius-sm: 8px;
	--shadow: 0 1px 2px rgba(31, 43, 37, .06), 0 10px 28px rgba(31, 43, 37, .07);
	--serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
	--sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--wrap: 1160px;
	--narrow: 760px;
	--header-h: 64px;
}

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

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--header-h) + 16px);
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { transition: none !important; }
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--sans);
	font-size: 1.0625rem;
	line-height: 1.65;
	overflow-x: hidden;
}

img,
video,
iframe,
embed,
object {
	max-width: 100%;
}

img {
	height: auto;
	display: block;
}

a {
	color: var(--green);
	text-underline-offset: .18em;
	text-decoration-thickness: 1px;
}

a:hover {
	color: var(--accent);
}

:focus-visible {
	outline: 3px solid var(--accent);
	outline-offset: 2px;
	border-radius: 4px;
}

h1, h2, h3, h4 {
	font-family: var(--serif);
	line-height: 1.2;
	color: var(--green-dark);
	font-weight: 700;
	text-wrap: balance;
}

.wrap {
	width: 100%;
	max-width: var(--wrap);
	margin-inline: auto;
	padding-inline: 16px;
}

.wrap.narrow {
	max-width: calc(var(--narrow) + 32px);
}

.section {
	padding-block: 40px;
}

.section-alt {
	background: var(--surface-alt);
}

.screen-reader-text,
.skip-link:not(:focus) {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.skip-link:focus {
	position: fixed;
	z-index: 1000;
	top: 8px;
	left: 8px;
	padding: 10px 16px;
	background: var(--surface);
	box-shadow: var(--shadow);
}

/* ---------- Ylätunniste ja valikko ---------- */

.site-header {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 100;
	background: rgba(255, 255, 255, .96);
	backdrop-filter: saturate(1.4) blur(8px);
	border-bottom: 1px solid var(--line);
}

@media (max-width: 600px) {
	.admin-bar .site-header { top: 0; }
}

.header-inner {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: var(--header-h);
}

.brand {
	display: flex;
	align-items: center;
	gap: 10px;
	color: var(--green-dark);
	text-decoration: none;
	margin-right: auto;
}

.brand:hover {
	color: var(--green-dark);
}

.brand-mark {
	width: 30px;
	height: 30px;
	color: var(--accent);
	fill: var(--accent);
	flex: none;
}

.brand-name {
	font-family: var(--serif);
	font-size: 1.3rem;
	font-weight: 700;
	letter-spacing: .01em;
}

.menu-toggle {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	padding: 8px 14px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--surface);
	color: var(--green-dark);
	font: 600 .95rem var(--sans);
	cursor: pointer;
}

.menu-toggle-bars,
.menu-toggle-bars::before,
.menu-toggle-bars::after {
	display: block;
	width: 18px;
	height: 2px;
	background: currentColor;
	border-radius: 2px;
	transition: transform .2s ease, opacity .2s ease;
}

.menu-toggle-bars {
	position: relative;
}

.menu-toggle-bars::before,
.menu-toggle-bars::after {
	content: "";
	position: absolute;
	left: 0;
}

.menu-toggle-bars::before { top: -6px; }
.menu-toggle-bars::after { top: 6px; }

.nav-open .menu-toggle-bars { background: transparent; }
.nav-open .menu-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.nav-open .menu-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

.main-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.main-nav a {
	display: block;
	color: var(--ink);
	text-decoration: none;
	font-weight: 600;
}

.main-nav .current_page_item > a,
.main-nav .current-menu-item > a,
.main-nav .current_page_ancestor > a,
.main-nav .current-menu-ancestor > a {
	color: var(--accent);
}

.sub-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--muted);
	cursor: pointer;
	border-radius: var(--radius-sm);
}

.sub-toggle svg {
	width: 20px;
	height: 20px;
	transition: transform .2s ease;
}

.sub-toggle[aria-expanded="true"] svg {
	transform: rotate(180deg);
}

/* Mobiilivalikko */
@media (max-width: 1199.98px) {
	.js .main-nav {
		display: none;
	}

	.js.nav-open .main-nav,
	.nav-open .main-nav {
		display: block;
	}

	.main-nav {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		max-height: calc(100dvh - var(--header-h) - var(--wp-admin--admin-bar--height, 0px));
		overflow-y: auto;
		background: var(--surface);
		border-bottom: 1px solid var(--line);
		box-shadow: 0 18px 30px rgba(31, 43, 37, .12);
		padding: 8px 16px 20px;
	}

	.main-nav .menu > li {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		border-bottom: 1px solid var(--line);
	}

	.main-nav .menu > li > a {
		flex: 1;
		padding: 13px 4px;
		font-size: 1.08rem;
	}

	.main-nav li > ul {
		flex-basis: 100%;
		display: none;
		padding: 0 0 12px 4px;
	}

	.main-nav li.sub-open > ul,
	html:not(.js) .main-nav li > ul {
		display: grid;
		grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
		gap: 2px 12px;
	}

	.main-nav li > ul a {
		padding: 9px 4px;
		font-weight: 500;
		color: var(--muted);
	}
}

/* Työpöytävalikko */
@media (min-width: 1200px) {
	.menu-toggle {
		display: none;
	}

	.main-nav .menu {
		display: flex;
		align-items: center;
		gap: 2px;
	}

	.main-nav .menu > li {
		position: relative;
		display: flex;
		align-items: center;
	}

	.main-nav .menu > li > a {
		padding: 8px 10px;
		border-radius: var(--radius-sm);
		font-size: .98rem;
	}

	.main-nav .menu > li > a:hover {
		background: var(--green-soft);
		color: var(--green-dark);
	}

	.main-nav .has-sub > a {
		padding-right: 2px;
	}

	.main-nav .sub-toggle {
		width: 28px;
		height: 36px;
	}

	.main-nav li > ul {
		position: absolute;
		top: calc(100% + 6px);
		left: 0;
		min-width: 220px;
		padding: 8px;
		background: var(--surface);
		border: 1px solid var(--line);
		border-radius: var(--radius);
		box-shadow: var(--shadow);
		opacity: 0;
		visibility: hidden;
		transform: translateY(-4px);
		transition: opacity .15s ease, transform .15s ease, visibility .15s;
	}

	.main-nav li > ul:has(> li:nth-child(9)) {
		display: grid;
		grid-template-columns: repeat(2, minmax(150px, 1fr));
		min-width: 340px;
	}

	.main-nav li:last-child > ul,
	.main-nav li:nth-last-child(2) > ul {
		left: auto;
		right: 0;
	}

	.main-nav li:hover > ul,
	.main-nav li:focus-within > ul,
	.main-nav li.sub-open > ul {
		opacity: 1;
		visibility: visible;
		transform: none;
	}

	.main-nav li > ul a {
		padding: 8px 12px;
		border-radius: var(--radius-sm);
		font-weight: 500;
		font-size: .95rem;
	}

	.main-nav li > ul a:hover {
		background: var(--green-soft);
	}
}

/* Ota yhteyttä -nappi valikossa */
.main-nav .nav-cta > a {
	background: var(--green);
	color: #fff;
	border-radius: 999px;
	text-align: center;
}

.main-nav .nav-cta > a:hover,
.main-nav .nav-cta.current_page_item > a {
	background: var(--green-dark);
	color: #fff;
}

@media (max-width: 1199.98px) {
	.main-nav .menu > li.nav-cta {
		border-bottom: 0;
		padding-top: 16px;
	}

	.main-nav .menu > li.nav-cta > a {
		padding: 13px 20px;
	}
}

.brand-name,
.main-nav a {
	white-space: nowrap;
}

@media (min-width: 1200px) {
	.main-nav .menu > li.menu-home {
		display: none;
	}

	.main-nav .menu > li > a {
		padding-inline: 8px;
	}

	.main-nav .menu > li.nav-cta {
		margin-left: 8px;
	}

	.main-nav .menu > li.nav-cta > a {
		padding: 9px 18px;
	}
}

/* ---------- Etusivun hero ---------- */

.hero {
	position: relative;
	isolation: isolate;
	display: flex;
	align-items: flex-end;
	min-height: clamp(380px, 68vh, 620px);
	color: #fff;
	background: var(--green-dark);
	overflow: hidden;
}

.hero-img {
	position: absolute;
	inset: 0;
	z-index: -2;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: 50% 45%;
}

.hero::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(180deg, rgba(20, 34, 27, 0) 25%, rgba(20, 34, 27, .55) 60%, rgba(20, 34, 27, .85) 100%);
}

.hero-inner {
	padding-block: 48px 40px;
}

.eyebrow {
	margin: 0 0 6px;
	font-size: .82rem;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	opacity: .9;
}

.hero-title {
	margin: 0;
	color: #fff;
	font-size: clamp(2.3rem, 7vw, 4.2rem);
	text-shadow: 0 2px 18px rgba(0, 0, 0, .25);
}

.hero-lead {
	max-width: 36em;
	margin: 12px 0 24px;
	font-size: clamp(1.05rem, 2.4vw, 1.25rem);
	line-height: 1.5;
}

.hero-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 12px 22px;
	border-radius: 999px;
	font-weight: 700;
	text-decoration: none;
	transition: background-color .15s ease, color .15s ease;
}

.btn-primary {
	background: var(--accent);
	color: #fff;
}

.btn-primary:hover {
	background: #7f4a17;
	color: #fff;
}

.btn-light {
	background: rgba(255, 255, 255, .95);
	color: var(--green-dark);
}

.btn-light:hover {
	background: #fff;
	color: var(--accent);
}

/* ---------- Osiot ja kortit ---------- */

.section-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px 16px;
	margin-bottom: 20px;
}

.section-head h2 {
	margin: 0;
	font-size: clamp(1.6rem, 4vw, 2.1rem);
}

.more-link {
	font-weight: 700;
	text-decoration: none;
}

.card-grid,
.news-list {
	display: grid;
	gap: 16px;
}

@media (min-width: 700px) {
	.card-grid {
		grid-template-columns: repeat(3, 1fr);
	}

	.news-list {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 1000px) {
	.news-list {
		grid-template-columns: repeat(3, 1fr);
	}
}

.card {
	display: flex;
	flex-direction: column;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	overflow: hidden;
	box-shadow: var(--shadow);
}

.card-media {
	display: block;
	aspect-ratio: 3 / 2;
	background: var(--surface-alt);
}

.card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.card-body {
	padding: 16px 18px 18px;
}

.card-meta {
	margin: 0 0 4px;
	color: var(--muted);
	font-size: .88rem;
	font-weight: 600;
}

.card-title {
	margin: 0;
	font-size: 1.2rem;
}

.card-title a {
	color: var(--green-dark);
	text-decoration: none;
}

.card-title a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.card {
	position: relative;
}

.card:hover .card-title a {
	color: var(--accent);
}

.card-text {
	margin: 8px 0 0;
	color: var(--muted);
	font-size: .97rem;
	line-height: 1.55;
}

.tile-grid {
	display: grid;
	gap: 14px;
}

@media (min-width: 700px) {
	.tile-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

.tile {
	position: relative;
	display: flex;
	align-items: flex-end;
	min-height: 180px;
	aspect-ratio: 4 / 3;
	border-radius: var(--radius);
	overflow: hidden;
	background: var(--green);
	color: #fff;
	text-decoration: none;
	box-shadow: var(--shadow);
}

@media (max-width: 699.98px) {
	.tile { aspect-ratio: 16 / 9; }
}

.tile img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .4s ease;
}

.tile::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(20, 34, 27, 0) 40%, rgba(20, 34, 27, .78) 100%);
}

.tile:hover img {
	transform: scale(1.04);
}

.tile:hover {
	color: #fff;
}

.tile-label {
	position: relative;
	z-index: 1;
	padding: 16px 18px;
	font-family: var(--serif);
	font-size: 1.4rem;
	font-weight: 700;
}

/* ---------- Sivut ja artikkelit ---------- */

.page-header {
	margin-bottom: 24px;
}

.page-title {
	margin: 0;
	font-size: clamp(1.9rem, 5vw, 2.7rem);
	overflow-wrap: anywhere;
}

.crumb {
	margin: 0 0 8px;
	font-size: .95rem;
	font-weight: 600;
}

.crumb a {
	text-decoration: none;
}

.post-meta {
	margin: 8px 0 0;
	color: var(--muted);
	font-weight: 600;
}

.chip-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.chip {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	padding: 8px 14px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--surface);
	color: var(--green-dark);
	font-weight: 600;
	font-size: .95rem;
	text-decoration: none;
}

.chip:hover {
	border-color: var(--green);
	color: var(--green-dark);
	background: var(--green-soft);
}

.chip.is-current {
	background: var(--green);
	border-color: var(--green);
	color: #fff;
}

.subpages {
	margin-bottom: 28px;
}

.subpages-end {
	margin: 40px 0 0;
	padding-top: 24px;
	border-top: 1px solid var(--line);
}

.subpages-title {
	margin: 0 0 12px;
	font-size: 1.25rem;
}

.edit-link {
	margin-top: 32px;
	font-size: .9rem;
}

/* Sisältö (vanhat sivut) */
.entry-content {
	overflow-wrap: break-word;
}

.entry-content > *:first-child {
	margin-top: 0;
}

.entry-content h2 { font-size: 1.6rem; margin: 1.8em 0 .5em; }
.entry-content h3 { font-size: 1.3rem; margin: 1.6em 0 .4em; }
.entry-content h4 { font-size: 1.1rem; margin: 1.4em 0 .4em; }

.entry-content p,
.entry-content ul,
.entry-content ol {
	margin: 0 0 1.1em;
}

.entry-content img {
	border-radius: var(--radius-sm);
}

.entry-content .aligncenter,
.entry-content img.aligncenter {
	margin: 1.4em auto;
}

.entry-content .alignleft,
.entry-content .alignright {
	margin: 1.2em 0;
}

@media (min-width: 640px) {
	.entry-content .alignleft {
		float: left;
		margin: .3em 1.4em 1em 0;
		max-width: 50%;
	}

	.entry-content .alignright {
		float: right;
		margin: .3em 0 1em 1.4em;
		max-width: 50%;
	}
}

.entry-content::after {
	content: "";
	display: table;
	clear: both;
}

.entry-content .wp-caption {
	width: auto !important;
	max-width: 100%;
	margin-block: 1.4em;
}

.entry-content .wp-caption.aligncenter img {
	margin-inline: auto;
}

.entry-content .wp-caption-text,
.entry-content figcaption {
	margin-top: 8px;
	color: var(--muted);
	font-size: .9rem;
	text-align: center;
}

.entry-content table {
	display: block;
	max-width: 100%;
	overflow-x: auto;
	border-collapse: collapse;
	margin: 1.4em 0;
	font-size: .95rem;
}

.entry-content th,
.entry-content td {
	padding: 8px 10px;
	border: 1px solid var(--line);
	text-align: left;
	vertical-align: top;
}

.entry-content iframe {
	width: 100%;
	border: 0;
	border-radius: var(--radius-sm);
}

.entry-content hr {
	border: 0;
	border-top: 1px solid var(--line);
	margin: 2em 0;
}

.entry-content blockquote {
	margin: 1.5em 0;
	padding: 4px 0 4px 18px;
	border-left: 4px solid var(--accent);
	color: var(--muted);
}

.intro .entry-content {
	font-size: 1.1rem;
}

/* Edellinen / seuraava */
.post-navigation {
	margin-top: 40px;
	padding-top: 20px;
	border-top: 1px solid var(--line);
}

.post-navigation .nav-links {
	display: grid;
	gap: 12px;
}

@media (min-width: 640px) {
	.post-navigation .nav-links {
		grid-template-columns: 1fr 1fr;
	}

	.post-navigation .nav-next {
		text-align: right;
		grid-column: 2;
	}
}

.post-navigation a {
	display: block;
	text-decoration: none;
}

.nav-label {
	display: block;
	color: var(--muted);
	font-size: .85rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .06em;
}

.nav-title {
	font-weight: 600;
}

/* Sivutus */
.pagination {
	margin-top: 32px;
}

.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
}

.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0 12px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--surface);
	text-decoration: none;
	font-weight: 600;
}

.pagination .page-numbers.current {
	background: var(--green);
	border-color: var(--green);
	color: #fff;
}

.pagination .page-numbers.dots {
	border: 0;
	background: none;
}

/* ---------- Myynti ---------- */

.btn-small {
	min-height: 44px;
	padding: 10px 18px;
	background: var(--green);
	color: #fff;
	font-size: .95rem;
}

.btn-small:hover {
	background: var(--green-dark);
	color: #fff;
}

.badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: .78rem;
	font-weight: 800;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.badge-sold {
	background: #7a2e22;
	color: #fff;
}

/* Myytävänä-sivu: leveämpi kuin tavallinen tekstisivu */
.page-template-default .sales {
	margin-inline: calc(50% - min(50vw, 560px) + 16px);
}

@media (max-width: 1150px) {
	.page-template-default .sales {
		margin-inline: 0;
	}
}

.sales-intro {
	padding: 14px 18px;
	margin-bottom: 20px;
	background: var(--green-soft);
	border-radius: var(--radius-sm);
	color: var(--green-dark);
}

.sales-intro p {
	margin: 0;
}

.breed-nav {
	margin-bottom: 8px;
}

.breed-title {
	margin: 40px 0 16px !important;
	padding-bottom: 8px;
	border-bottom: 2px solid var(--line);
	font-size: 1.6rem !important;
	scroll-margin-top: calc(var(--header-h) + 16px);
}

.pony-card {
	display: grid;
	margin-bottom: 20px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	overflow: hidden;
	scroll-margin-top: calc(var(--header-h) + 16px);
}

.pony-media {
	background: var(--surface-alt);
}

.pony-media figure,
.pony-media p {
	margin: 0 !important;
	width: 100% !important;
}

.pony-media img {
	width: 100%;
	height: 100%;
	max-height: 520px;
	object-fit: cover;
	border-radius: 0 !important;
	margin: 0 !important;
}

.pony-media figcaption {
	margin: 0 !important;
	padding: 6px 12px;
	font-size: .8rem !important;
	text-align: left !important;
}

.pony-body {
	display: flex;
	flex-direction: column;
	padding: 18px 20px 20px;
}

.pony-head {
	margin-bottom: 12px;
}

.pony-head .badge {
	margin-bottom: 8px;
}

.pony-name {
	margin: 0 !important;
	font-size: 1.5rem !important;
}

.pony-born {
	margin: 2px 0 0 !important;
	color: var(--muted);
	font-weight: 600;
}

.pony-pedigree {
	display: grid;
	gap: 4px;
	margin: 0 0 14px;
	padding: 12px 14px;
	background: var(--bg);
	border-radius: var(--radius-sm);
	font-size: .95rem;
}

.pony-pedigree div {
	display: grid;
	grid-template-columns: 5.5em 1fr;
	gap: 8px;
}

.pony-pedigree dt {
	color: var(--muted);
	font-weight: 700;
}

.pony-pedigree dd {
	margin: 0;
}

.pony-text p:last-child {
	margin-bottom: 0;
}

.pony-foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 20px;
	margin-top: auto;
	padding-top: 16px;
}

.pony-price {
	margin: 0 !important;
	line-height: 1.3;
}

.price-main {
	display: block;
	font-family: var(--serif);
	font-size: 1.6rem;
	font-weight: 700;
	color: var(--accent);
}

.price-note {
	color: var(--muted);
	font-size: .88rem;
}

.pony-card.is-sold .pony-media img {
	filter: grayscale(.6);
	opacity: .85;
}

@media (min-width: 820px) {
	.pony-card {
		grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
	}

	.pony-card.no-media {
		grid-template-columns: 1fr;
	}

	.pony-body {
		padding: 24px 28px;
	}
}

/* Etusivun myyntikortit */
.sale-grid {
	display: grid;
	gap: 16px;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
}

.sale-card .card-media {
	aspect-ratio: 4 / 3;
}

/* Puhelimella pyyhkäistävä rivi */
@media (max-width: 699.98px) {
	.sale-grid {
		display: flex;
		gap: 12px;
		margin-inline: -16px;
		padding: 4px 16px 14px;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		scroll-padding-inline: 16px;
		-webkit-overflow-scrolling: touch;
	}

	.sale-grid > .sale-card {
		flex: 0 0 78%;
		scroll-snap-align: start;
	}

	.sale-card .card-body {
		padding: 12px 14px 14px;
	}
}

.card-price {
	margin: 8px 0 0;
	font-family: var(--serif);
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--accent);
}

.link-cards {
	display: grid;
	gap: 14px;
	margin-top: 24px;
}

@media (min-width: 700px) {
	.link-cards {
		grid-template-columns: 1fr 1fr;
	}
}

.link-card {
	position: relative;
	display: block;
	padding: 18px 52px 18px 20px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	color: var(--ink);
	text-decoration: none;
}

.link-card:hover {
	border-color: var(--green);
	background: var(--green-soft);
	color: var(--ink);
}

.link-card-title {
	display: block;
	font-family: var(--serif);
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--green-dark);
}

.link-card-text {
	display: block;
	color: var(--muted);
	font-size: .95rem;
}

.link-card-arrow {
	position: absolute;
	right: 20px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 1.3rem;
	color: var(--accent);
}

/* Myydyt */
.sold-years {
	display: grid;
	gap: 16px;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr));
}

.sold-year {
	padding: 14px 18px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
}

.sold-year h3 {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: 0 0 8px !important;
	font-size: 1.3rem !important;
}

.sold-count {
	padding: 2px 9px;
	background: var(--green-soft);
	border-radius: 999px;
	color: var(--green-dark);
	font-family: var(--sans);
	font-size: .8rem;
	font-weight: 700;
}

.sold-year ul {
	margin: 0 !important;
	padding: 0;
	list-style: none;
}

.sold-year li {
	padding: 3px 0;
	border-bottom: 1px dashed var(--line);
	font-size: .95rem;
}

.sold-year li:last-child {
	border-bottom: 0;
}

/* ---------- Lomakkeet ---------- */

input[type="text"],
input[type="email"],
input[type="search"],
input[type="tel"],
input[type="url"],
textarea,
select {
	width: 100%;
	max-width: 100%;
	min-height: 48px;
	padding: 10px 14px;
	border: 1px solid #cfc7b8;
	border-radius: var(--radius-sm);
	background: #fff;
	color: var(--ink);
	font: inherit;
	font-size: 1rem;
}

textarea {
	min-height: 140px;
}

input:focus,
textarea:focus,
select:focus {
	border-color: var(--green);
	outline: 3px solid rgba(45, 82, 64, .2);
	outline-offset: 0;
}

input[type="submit"],
button[type="submit"],
.wpcf7-submit {
	min-height: 48px;
	padding: 12px 26px;
	border: 0;
	border-radius: 999px;
	background: var(--green);
	color: #fff;
	font: 700 1rem var(--sans);
	cursor: pointer;
}

input[type="submit"]:hover,
button[type="submit"]:hover,
.wpcf7-submit:hover {
	background: var(--green-dark);
}

.wpcf7 label {
	display: block;
	font-weight: 600;
}

.wpcf7 p {
	margin-bottom: 1em;
}

.search-form {
	display: flex;
	gap: 8px;
	margin-top: 16px;
}

.search-form label {
	flex: 1;
}

.search-form .search-submit {
	flex: none;
}

/* ---------- Kommentit ---------- */

.comments {
	padding-bottom: 40px;
}

.comment-list {
	padding-left: 1.2em;
}

.comment-body {
	margin-bottom: 1.4em;
}

.comment-meta {
	font-size: .9rem;
	color: var(--muted);
}

/* ---------- Alatunniste ---------- */

.site-footer {
	margin-top: 40px;
	background: var(--green-dark);
	color: #e6eee8;
}

.site-footer a {
	color: #fff;
}

.site-footer a:hover {
	color: #f2c792;
}

.footer-grid {
	display: grid;
	gap: 32px;
	padding-block: 44px 28px;
}

@media (min-width: 760px) {
	.footer-grid {
		grid-template-columns: 1.4fr 1fr 1fr;
	}
}

.site-footer h2 {
	margin: 0 0 14px;
	color: #fff;
	font-size: 1.3rem;
}

.contact-list,
.link-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.contact-list li {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	padding: 6px 0;
}

.contact-list a {
	overflow-wrap: anywhere;
}

.icon {
	flex: none;
	width: 20px;
	height: 20px;
	margin-top: 3px;
	fill: #f2c792;
}

.link-list li {
	padding: 4px 0;
}

.link-list a {
	text-decoration: none;
}

.link-list a:hover {
	text-decoration: underline;
}

.footer-bottom {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 8px 24px;
	padding-block: 18px 28px;
	border-top: 1px solid rgba(255, 255, 255, .14);
	font-size: .9rem;
	color: #b9c8be;
}

.footer-bottom p {
	margin: 0;
}

.footer-bottom a {
	color: #b9c8be;
}

/* ---------- Suuremmat näytöt ---------- */

@media (min-width: 760px) {
	.section {
		padding-block: 64px;
	}

	.wrap {
		padding-inline: 24px;
	}

	.wrap.narrow {
		max-width: calc(var(--narrow) + 48px);
	}

	.hero-inner {
		padding-block: 72px 64px;
	}
}
