/*
Theme Name: Joen Energiatalo
Description: Joen Energiatalon oma lohkoteema (Twenty Twenty-Five -lapsiteema). Värit ja fontit on lukittu theme.json-tiedostoon.
Author: Joen Energiatalo
Template: twentytwentyfive
Version: 1.0.2
Requires at least: 6.7
Requires PHP: 8.1
Text Domain: joen-energiatalo
*/

/* Energialuokkaraita (logon värit) */
:root {
	--joen-e-a: #4DAA3A;
	--joen-e-b: #A8C81E;
	--joen-e-c: #FFD500;
	--joen-e-d: #F39200;
	--joen-e-e: #E30613;
	--joen-stripe: linear-gradient(90deg, var(--joen-e-a) 0 20%, var(--joen-e-b) 20% 40%, var(--joen-e-c) 40% 60%, var(--joen-e-d) 60% 80%, var(--joen-e-e) 80% 100%);
	--joen-radius: 16px;
	--joen-section: clamp(64px, 9vw, 104px);
}

/* ---------- Header ---------- */
.site-header {
	border-bottom: 1px solid var(--wp--preset--color--border);
	position: relative;
	padding-top: 22px !important;
	padding-bottom: 16px !important;
}
.site-header::before {
	content: "";
	position: absolute;
	inset: 0 0 auto 0;
	height: 6px;
	background: var(--joen-stripe);
}
.site-header__inner { gap: 16px 28px; }
.site-header .wp-block-site-logo img { height: 56px; width: auto; }
.site-header__actions { gap: 16px; }
.site-header__phone a { color: var(--wp--preset--color--contrast); font-weight: 600; text-decoration: none; }
.site-header__phone a:hover { color: var(--wp--preset--color--primary); }
@media (max-width: 781px) {
	.site-header__phone { display: none; }
	.site-header .wp-block-site-logo img { height: 44px; }
}

/* ---------- Sections ---------- */
.section { padding-top: var(--joen-section) !important; padding-bottom: var(--joen-section) !important; }
.section--tight-top { padding-top: calc(var(--joen-section) * 0.6) !important; }
.section-head { margin-bottom: 40px !important; max-width: 680px; }
.section-head--row { max-width: none; }
.eyebrow {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--primary);
	margin-bottom: 0.25rem;
}
.has-dark-background-color .eyebrow { color: var(--wp--preset--color--lime); }
.lead { font-size: 1.1875rem; color: var(--wp--preset--color--muted); max-width: 580px; }
.has-dark-background-color .lead,
.has-dark-background-color p { color: var(--wp--preset--color--on-dark); }
.has-dark-background-color h2,
.has-dark-background-color h3 { color: var(--wp--preset--color--base); }
.text-muted { color: var(--wp--preset--color--muted); }

/* ---------- Hero ---------- */
.hero__columns { gap: 56px !important; align-items: center !important; }
.hero__image img { width: 100%; height: clamp(320px, 42vw, 520px); object-fit: cover; border-radius: var(--joen-radius); }
.hero__image { margin: 0 !important; }
.stats {
	border-top: 1px solid #DCE5D8;
	padding-top: 24px;
	margin-top: 24px !important;
	max-width: 540px;
}
.stats .stat__value {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 800;
	font-size: 2rem;
	line-height: 1.1;
	color: var(--wp--preset--color--contrast);
	margin: 0;
}
.stats .stat__label { font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--muted); margin: 0; }

/* ---------- Cards ---------- */
.card {
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--joen-radius);
	padding: 32px !important;
	background: var(--wp--preset--color--base);
	transition: border-color .15s ease;
	position: relative;
}
.card:hover { border-color: var(--wp--preset--color--primary); }
.card--featured { border: 2px solid var(--wp--preset--color--primary); padding: 31px !important; }
.card--soft { background: var(--wp--preset--color--surface); }
.card .card__grow { flex-grow: 1; }
.card h3 { margin-top: 0; }
.card p { color: var(--wp--preset--color--muted); }
.card .card__price { color: var(--wp--preset--color--muted); }
.card .card__price strong { color: var(--wp--preset--color--contrast); font-size: 1.25rem; }
.card .card__link a { font-weight: 600; text-decoration: none; }
.card .card__link a::after { content: " →"; }
.badge {
	position: absolute;
	top: -13px;
	left: 30px;
	margin: 0 !important;
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--base) !important;
	font-size: 0.75rem;
	font-weight: 600;
	padding: 4px 10px;
	border-radius: 999px;
	line-height: 1.4;
}
.card .icon-tile {
	width: 52px; height: 52px;
	border-radius: 12px;
	background: #EEF4EA;
	display: flex; align-items: center; justify-content: center;
	margin: 0;
}

/* Price cards */
.price {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 800;
	font-size: 2.5rem;
	line-height: 1.1;
	color: var(--wp--preset--color--contrast) !important;
	margin: 0 !important;
}
.price small { font-size: 1rem; font-weight: 600; color: var(--wp--preset--color--muted); }
.price small:last-child { display: block; margin-top: 4px; }
.price-cards .wp-block-buttons,
.price-cards .wp-block-button,
.price-cards .wp-block-button__link { width: 100%; }

/* ---------- Process steps ---------- */
.steps .step { border-top: 4px solid var(--joen-e-a); padding-top: 24px; }
.steps .step:nth-child(2) { border-top-color: var(--joen-e-b); }
.steps .step:nth-child(3) { border-top-color: var(--joen-e-c); }
.steps .step:nth-child(4) { border-top-color: var(--joen-e-d); }
.steps .step__num {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 800;
	font-size: 0.9375rem;
	color: var(--wp--preset--color--lime) !important;
	margin: 0;
}
.section:not(.has-dark-background-color) .steps .step__num { color: var(--wp--preset--color--primary) !important; }

/* ---------- Check list ---------- */
.check-list { list-style: none; padding-left: 0 !important; }
.check-list li { position: relative; padding-left: 32px; margin-bottom: 10px; }
.check-list li::before {
	content: "";
	position: absolute; left: 0; top: 0.2em;
	width: 20px; height: 20px;
	border-radius: 50%;
	background: var(--wp--preset--color--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center / 12px no-repeat;
}

/* ---------- Articles (query loop) ---------- */
.article-cards .wp-block-post-template { gap: 24px; }
.article-cards .wp-block-post {
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--joen-radius);
	padding: 28px;
	background: var(--wp--preset--color--base);
	display: flex; flex-direction: column; gap: 12px;
	transition: border-color .15s ease;
}
.article-cards .wp-block-post:hover { border-color: var(--wp--preset--color--primary); }
.article-cards .wp-block-post-title { font-size: 1.3125rem; line-height: 1.3; margin: 0; font-weight: 700; }
.article-cards .wp-block-post-excerpt { color: var(--wp--preset--color--muted); font-size: var(--wp--preset--font-size--small); margin: 0; }
.article-cards .wp-block-post-excerpt__more-link { font-weight: 600; text-decoration: none; }

/* ---------- CTA ---------- */
.cta-box { border-radius: 24px; padding: clamp(32px, 5vw, 56px) clamp(24px, 5vw, 48px) !important; }
.cta-box h2 { color: var(--wp--preset--color--base); font-size: clamp(1.75rem, 3vw, 2.375rem); }
.cta-box p { color: #E4F0DC; }
.cta-box .wp-block-button__link { background: var(--wp--preset--color--base); color: var(--wp--preset--color--contrast); }
.cta-box .wp-block-button__link:hover { background: var(--wp--preset--color--surface); color: var(--wp--preset--color--contrast); }
.cta-box .is-style-outline .wp-block-button__link { background: transparent; color: var(--wp--preset--color--base); border-color: rgba(255,255,255,.6); }
.cta-box .is-style-outline .wp-block-button__link:hover { background: rgba(255,255,255,.1); color: var(--wp--preset--color--base); }

/* ---------- Footer ---------- */
.site-footer { color: var(--wp--preset--color--on-dark); }
.site-footer a { color: var(--wp--preset--color--on-dark); text-decoration: none; }
.site-footer a:hover { color: var(--wp--preset--color--base); }
.site-footer h2 { font-family: var(--wp--preset--font-family--body); font-size: 1rem; font-weight: 600; color: var(--wp--preset--color--base); letter-spacing: 0; margin-bottom: 0.5rem; }
.site-footer__logo img { height: 52px; width: auto; }
.site-footer__bottom { border-top: 1px solid #24402C; padding-top: 20px; margin-top: 40px !important; font-size: 0.875rem; color: #9FB2A5; }
.site-footer__list { list-style: none; padding: 0 !important; margin: 0; }
.site-footer__list li { margin-bottom: 8px; }

/* ---------- Single posts ---------- */
.single-post .wp-block-post-content h2 { font-size: var(--wp--preset--font-size--x-large); margin-top: 2.25rem; }
.single-post .wp-block-post-content h3 { font-size: var(--wp--preset--font-size--large); margin-top: 1.75rem; }
.wp-block-post-content img { border-radius: 12px; }

/* Quform popup triggers stay hidden; theme JS opens them */
.quform-popup-link { display: none !important; }

/* ---------- Layout fixes ---------- */
.wp-site-blocks > * + * { margin-block-start: 0; }
.wp-block-post-content > .alignfull { margin-block-start: 0; margin-block-end: 0; }
.wp-block-post-content > .wp-block-quform-form,
.wp-block-post-content > .quform-popup-link { margin: 0; }
.single-post .wp-site-blocks > main,
.page-template-default .wp-site-blocks > main { padding-bottom: var(--joen-section); }

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
	.site-header__actions { display: none !important; }
	.stats .stat__value { font-size: 1.5rem; }
	.stats { gap: 16px !important; }
	h1, h2 { overflow-wrap: break-word; hyphens: auto; }
	.card, .card--featured { padding: 24px !important; }
	.hero .wp-block-button { width: 100%; }
	.hero .wp-block-button__link { width: 100%; box-sizing: border-box; text-align: center; font-size: 0.9375rem; padding-left: 12px; padding-right: 12px; }
}

/* Artikkeleissa sisällön H1 näytetään väliotsikkona (sivun pääotsikko on artikkelin nimi) */
.single-post .wp-block-post-content h1 { font-size: var(--wp--preset--font-size--xx-large); margin-top: 2.5rem; }
.eyebrow a { text-decoration: none; }
