/*
Theme Name: HuoltoLate
Theme URI: https://www.huoltolate.com/
Author: Joel Tauriainen
Description: HuoltoLaten oma lohkoteema: tumma asfalttipohja, logon keltainen ja oranssi, vinot raidat ja painikkeet. Yhteystiedot, aukioloajat ja tiedotteet muokataan yhdestä paikasta (HuoltoLate-asetukset), ja teemassa on valmis ajanvarauspyyntölomake.
Version: 1.0.0
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
License: Proprietary – tehty HuoltoLatelle (Ekatoka Oy)
Text Domain: huoltolate
*/

/* =========================================================
   Perusasiat
   ========================================================= */
:root {
	--hl-vino: var(--wp--custom--vino, -12deg);
	--hl-raitakulma: var(--wp--custom--raita-kulma, -14deg);
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

:where(a, button, input, select, textarea, summary):focus-visible {
	outline: 3px solid var(--wp--preset--color--keltainen);
	outline-offset: 3px;
}

::selection { background: var(--wp--preset--color--keltainen); color: var(--wp--preset--color--musta); }

/* Keltainen/oranssi korostus otsikoissa (<mark>) ilman taustaa */
mark.has-inline-color { background: transparent; }

/* =========================================================
   Ylätunniste: tarttuu ylös rullatessa
   ========================================================= */
.wp-site-blocks > header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 100;
}
.admin-bar .wp-site-blocks > header.wp-block-template-part { top: var(--wp-admin--admin-bar--height, 32px); }
@media (max-width: 600px) {
	.admin-bar .wp-site-blocks > header.wp-block-template-part { top: 0; }
}

.hl-header { border-bottom: 1px solid var(--wp--preset--color--grafiitti); }
.hl-header .hl-logo img { width: clamp(170px, 20vw, 270px); height: auto; display: block; }
.hl-header .hl-header-soita .wp-block-button__link { padding: 12px 20px; font-size: 16px; }

@media (max-width: 781px) {
	/* Mobiilissa soittopainike näkyy pelkkänä numerona, valikko hampurilaisen takana */
	.hl-header .hl-header-soita .wp-block-button__link { padding: 10px 14px; font-size: 15px; }
}
@media (max-width: 600px) {
	/* Puhelimella soittopainike pysyy näkyvissä: pienempi logo ja välit */
	.hl-header .hl-logo img { width: 132px; }
	.hl-header .wp-block-group.is-layout-flex { gap: 12px; }
	.hl-header .hl-header-soita .wp-block-button__link { padding: 9px 12px; font-size: 14px; }
}

/* Alavalikot ja mobiilivalikko */
.wp-block-navigation .wp-block-navigation__submenu-container {
	background-color: var(--wp--preset--color--hiili) !important;
	color: var(--wp--preset--color--luu) !important;
	border: 1px solid var(--wp--preset--color--grafiitti) !important;
	min-width: 280px !important;
	padding: 8px 0;
}
.wp-block-navigation .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	padding: 10px 20px;
	text-transform: none;
	letter-spacing: 0;
	font-weight: 600;
}
.wp-block-navigation .wp-block-navigation-item__content:hover,
.wp-block-navigation .wp-block-navigation-item__content:focus { color: var(--wp--preset--color--keltainen); }
.wp-block-navigation .current-menu-item > .wp-block-navigation-item__content { color: var(--wp--preset--color--keltainen); }

.wp-block-navigation__responsive-container.is-menu-open {
	background-color: var(--wp--preset--color--musta) !important;
	color: var(--wp--preset--color--luu) !important;
	padding: 24px clamp(20px, 4vw, 64px);
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	font-size: 24px;
	gap: 18px;
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container {
	border: 0 !important;
	background: transparent !important;
	padding: 4px 0 0 16px;
	font-size: 18px;
}

/* =========================================================
   Tiedotepalkki
   ========================================================= */
.hl-tiedote p { margin: 0; }
.hl-tiedote a { color: inherit; font-weight: 800; }

/* =========================================================
   Painikkeet: vino suunnikas
   ========================================================= */
.wp-block-button__link,
.wp-element-button {
	transform: skewX(var(--hl-vino));
	transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.wp-block-search__button { transform: none; }

.wp-block-button.is-style-outline > .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--luu);
	border: 2px solid currentColor;
	padding: 15px 30px;
}
.wp-block-button.is-style-outline > .wp-block-button__link:hover,
.wp-block-button.is-style-outline > .wp-block-button__link:focus-visible {
	background: var(--wp--preset--color--luu);
	color: var(--wp--preset--color--musta);
	border-color: var(--wp--preset--color--luu);
}

.wp-block-button.is-style-hl-tumma > .wp-block-button__link {
	background: var(--wp--preset--color--musta);
	color: var(--wp--preset--color--luu);
}
.wp-block-button.is-style-hl-tumma > .wp-block-button__link:hover,
.wp-block-button.is-style-hl-tumma > .wp-block-button__link:focus-visible {
	background: var(--wp--preset--color--syva);
	color: var(--wp--preset--color--keltainen);
}

/* Tekstilinkki-painike: "Lue lisää →", sähköposti yms. */
.wp-block-button.is-style-hl-teksti > .wp-block-button__link {
	transform: none;
	background: transparent;
	color: var(--wp--preset--color--keltainen);
	padding: 0;
	text-transform: none;
	letter-spacing: 0;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}
.wp-block-button.is-style-hl-teksti > .wp-block-button__link:hover { color: var(--wp--preset--color--luu); background: transparent; }

/* =========================================================
   Tekstityylit
   ========================================================= */
/* Vino merkki ("TÖIHIN MEILLE!", hintalaput) */
p.is-style-hl-merkki {
	display: table;
	width: auto;
	background: var(--wp--preset--color--keltainen);
	color: var(--wp--preset--color--musta);
	font-weight: 900;
	font-style: italic;
	text-transform: uppercase;
	letter-spacing: .06em;
	line-height: 1.2;
	padding: 8px 20px;
	transform: skewX(var(--hl-raitakulma));
}
p.is-style-hl-merkki.has-text-align-right { margin-left: auto; }

/* Yläotsikko (kicker) */
p.is-style-hl-yliotsikko {
	color: var(--wp--preset--color--oranssi);
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: .12em;
	font-size: 16px;
	line-height: 1.3;
}

/* Iso numero korteissa */
p.hl-numero {
	color: var(--wp--preset--color--oranssi);
	font-size: 40px;
	font-weight: 900;
	font-style: italic;
	line-height: 1;
	margin: 0;
}

/* Iso puhelinnumero */
.hl-iso-numero .wp-block-button__link,
p.hl-iso-numero {
	font-weight: 900;
	font-style: italic;
	letter-spacing: -0.01em;
}
.hl-iso-numero.wp-block-button .wp-block-button__link {
	transform: none;
	background: transparent;
	color: var(--wp--preset--color--keltainen);
	padding: 0;
	font-size: clamp(24px, 2.2vw, 34px);
	text-transform: none;
	font-style: italic;
	white-space: nowrap;
	text-align: left;
}
.hl-iso-numero.wp-block-button .wp-block-button__link:hover { color: var(--wp--preset--color--luu); background: transparent; }

/* =========================================================
   Luettelo vinoilla neliöillä
   ========================================================= */
ul.is-style-hl-vino { list-style: none; padding-left: 0; }
ul.is-style-hl-vino > li { position: relative; padding-left: 30px; margin-bottom: 12px; }
ul.is-style-hl-vino > li::before {
	content: "";
	position: absolute;
	left: 2px;
	top: .5em;
	width: 13px;
	height: 13px;
	background: var(--wp--preset--color--keltainen);
	transform: skewX(var(--hl-raitakulma));
}
.has-keltainen-background-color ul.is-style-hl-vino > li::before { background: var(--wp--preset--color--musta); }

/* =========================================================
   Kortti
   ========================================================= */
.is-style-hl-kortti {
	position: relative;
	background: var(--wp--preset--color--hiili);
	border: 1px solid var(--wp--preset--color--grafiitti);
	padding: 28px;
	transition: border-color .15s ease, transform .15s ease;
}
.is-style-hl-kortti:has(.hl-lisaa a):hover { border-color: var(--wp--preset--color--keltainen); }
.is-style-hl-kortti .hl-lisaa { margin-top: auto; }
.is-style-hl-kortti .hl-lisaa a {
	color: var(--wp--preset--color--keltainen);
	text-decoration: none;
	font-weight: 800;
	font-size: 14px;
	text-transform: uppercase;
	letter-spacing: .1em;
}
/* Koko kortti klikattavaksi */
.is-style-hl-kortti .hl-lisaa a::before { content: ""; position: absolute; inset: 0; }
.is-style-hl-kortti h3 a { color: inherit; text-decoration: none; }

/* Palvelukortin hintalappu kortin yläkulmassa */
.hl-hinta-rivi { flex-wrap: nowrap !important; }
.hl-hinta-rivi p.is-style-hl-merkki { font-size: 16px; padding: 6px 14px; margin: 0 6px 0 0; white-space: nowrap; }
p.hl-kysy {
	border: 2px solid #4A4A4A;
	color: var(--wp--preset--color--harmaa);
	font-size: 14px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: .06em;
	padding: 5px 12px;
	margin: 0;
}

/* =========================================================
   Raidat (vinot keltainen + oranssi raita oikeassa reunassa)
   ========================================================= */
.is-style-hl-raidat {
	--hl-r1: var(--wp--preset--color--keltainen);
	--hl-r2: var(--wp--preset--color--oranssi);
	--hl-paneeli: #1A1A1A;
	position: relative;
	overflow: hidden;
	isolation: isolate;
}
.is-style-hl-raidat::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	right: -160px;
	width: 520px;
	z-index: -1;
	pointer-events: none;
	background: linear-gradient(90deg,
		var(--hl-paneeli) 0 4px,
		var(--hl-r1) 4px 30px,
		var(--hl-paneeli) 30px 60px,
		var(--hl-r2) 60px 86px,
		var(--hl-paneeli) 86px);
	transform: skewX(var(--hl-raitakulma));
}
.is-style-hl-raidat.has-keltainen-background-color {
	--hl-r1: var(--wp--preset--color--musta);
	--hl-paneeli: transparent;
}
@media (max-width: 781px) {
	.is-style-hl-raidat::before { width: 210px; right: -150px; }
}

/* =========================================================
   Kuvan paikka (kunnes oikea kuva lisätään)
   ========================================================= */
.hl-kuvapaikka {
	background: repeating-linear-gradient(-55deg, #222 0 18px, #1C1C1C 18px 36px);
	border: 1px solid #333;
	aspect-ratio: 4 / 3;
	position: relative;
}
.hl-kuvapaikka::after {
	content: "";
	position: absolute;
	left: -12px;
	bottom: -12px;
	width: 120px;
	height: 12px;
	background: var(--wp--preset--color--keltainen);
}
.wp-block-image.hl-korjaamokuva { position: relative; margin: 0; }
.wp-block-image.hl-korjaamokuva img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.wp-block-image.hl-korjaamokuva::after {
	content: "";
	position: absolute;
	left: -12px;
	bottom: -12px;
	width: 120px;
	height: 12px;
	background: var(--wp--preset--color--keltainen);
}

/* Kartta-laatikko */
.hl-kartta {
	background: repeating-linear-gradient(0deg, #1A1A1A 0 39px, #232323 39px 40px), #1A1A1A;
	border: 1px solid var(--wp--preset--color--grafiitti);
	min-height: 320px;
}

/* =========================================================
   Hinnasto (taulukkotyyli)
   ========================================================= */
.wp-block-table.is-style-hl-hinnasto table { border-collapse: collapse; width: 100%; }
.wp-block-table.is-style-hl-hinnasto td,
.wp-block-table.is-style-hl-hinnasto th {
	border: 0;
	border-bottom: 1px solid var(--wp--preset--color--grafiitti);
	padding: 18px 8px;
	text-align: left;
	vertical-align: top;
}
.wp-block-table.is-style-hl-hinnasto thead th {
	color: var(--wp--preset--color--oranssi);
	text-transform: uppercase;
	letter-spacing: .1em;
	font-size: 14px;
	font-weight: 800;
	border-bottom: 2px solid var(--wp--preset--color--keltainen);
}
.wp-block-table.is-style-hl-hinnasto td:last-child,
.wp-block-table.is-style-hl-hinnasto th:last-child {
	text-align: right;
	white-space: nowrap;
}
.wp-block-table.is-style-hl-hinnasto tbody td:last-child {
	color: var(--wp--preset--color--keltainen);
	font-weight: 900;
	font-style: italic;
	font-size: 20px;
}
.wp-block-table.is-style-hl-hinnasto tbody td:first-child { font-weight: 700; }

/* =========================================================
   Ajanvarauslomake
   ========================================================= */
.hl-lomake { display: grid; gap: 18px; }
.hl-lomake .hl-rivi { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.hl-lomake label { display: block; font-weight: 700; font-size: 15px; margin-bottom: 6px; color: var(--wp--preset--color--luu); }
.hl-lomake label .hl-pakollinen { color: var(--wp--preset--color--keltainen); }
.hl-lomake input[type="text"],
.hl-lomake input[type="tel"],
.hl-lomake input[type="email"],
.hl-lomake input[type="date"],
.hl-lomake select,
.hl-lomake textarea {
	width: 100%;
	box-sizing: border-box;
	background: var(--wp--preset--color--musta);
	color: var(--wp--preset--color--luu);
	border: 1px solid #4A4A4A;
	border-radius: 0;
	padding: 13px 14px;
	font: inherit;
	font-size: 17px;
	min-height: 48px;
}
.hl-lomake textarea { min-height: 120px; resize: vertical; }
.hl-lomake input:focus,
.hl-lomake select:focus,
.hl-lomake textarea:focus { border-color: var(--wp--preset--color--keltainen); outline: none; box-shadow: 0 0 0 2px var(--wp--preset--color--keltainen); }
.hl-lomake .hl-suostumus { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; color: var(--wp--preset--color--harmaa); }
.hl-lomake .hl-suostumus input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--wp--preset--color--keltainen); flex: none; }
.hl-lomake .hl-suostumus label { font-weight: 400; margin: 0; color: inherit; }
.hl-lomake .hl-ansa { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.hl-lomake button { justify-self: start; cursor: pointer; border: 0; font-family: inherit; }
.hl-ilmoitus { padding: 16px 20px; font-weight: 700; margin-bottom: 18px; }
.hl-ilmoitus--ok { background: var(--wp--preset--color--keltainen); color: var(--wp--preset--color--musta); }
.hl-ilmoitus--virhe { background: #5A1A12; color: #FFE3DC; border: 1px solid #C2412D; }

/* =========================================================
   Alatunniste
   ========================================================= */
.hl-footer a { color: var(--wp--preset--color--harmaa); }
.hl-footer a:hover { color: var(--wp--preset--color--keltainen); }
.hl-footer .hl-logo img { width: 200px; height: auto; }
.hl-tekija { opacity: .9; }
.hl-tekija strong { color: var(--wp--preset--color--luu); font-weight: 700; }

/* =========================================================
   Pienet säädöt
   ========================================================= */
.wp-block-post-content > *:first-child { margin-top: 0; }
.hl-ei-marginaalia { margin-top: 0 !important; }

/* =========================================================
   Ikonit (CSS-maskit, värit tulevat teemasta)
   ========================================================= */
.hl-ikoni { position: relative; padding-left: 36px; }
.hl-ikoni::before {
	content: "";
	position: absolute;
	left: 0;
	top: .2em;
	width: 22px;
	height: 22px;
	background: var(--wp--preset--color--oranssi);
	-webkit-mask: var(--hl-ik) no-repeat center / contain;
	mask: var(--hl-ik) no-repeat center / contain;
}
.has-keltainen-background-color .hl-ikoni::before { background: var(--wp--preset--color--musta); }
.hl-ikoni--kello { --hl-ik: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 6v6l4 2'/%3E%3C/svg%3E"); }
.hl-ikoni--paikka { --hl-ik: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0z'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E"); }
.hl-ikoni--posti { --hl-ik: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='4' width='20' height='16' rx='2'/%3E%3Cpath d='m22 7-10 6L2 7'/%3E%3C/svg%3E"); }
.hl-ikoni--puhelin { --hl-ik: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 16.9v3a2 2 0 0 1-2.2 2 19.8 19.8 0 0 1-8.6-3.1 19.5 19.5 0 0 1-6-6A19.8 19.8 0 0 1 2.1 4.2 2 2 0 0 1 4.1 2h3a2 2 0 0 1 2 1.7c.1.9.4 1.8.7 2.7a2 2 0 0 1-.5 2.1L8 9.8a16 16 0 0 0 6 6l1.3-1.3a2 2 0 0 1 2.1-.4c.9.3 1.8.6 2.7.7a2 2 0 0 1 1.7 2z'/%3E%3C/svg%3E"); }
.hl-ikoni--nuoli { --hl-ik: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E"); }

/* Nuoli linkkien perään (.hl-lisaa ja .hl-nuoli) */
.hl-lisaa a, .hl-nuoli a { display: inline-flex; align-items: center; gap: 8px; }
.hl-lisaa a::after, .hl-nuoli a::after {
	--hl-ik: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E");
	content: "";
	width: 16px;
	height: 16px;
	flex: none;
	background: currentColor;
	-webkit-mask: var(--hl-ik) no-repeat center / contain;
	mask: var(--hl-ik) no-repeat center / contain;
}
.wp-site-blocks > * + * { margin-block-start: 0; }

/* Etusivun pääotsikko: ensimmäinen rivi pienempi ja valkoinen */
.hl-hero-otsikko .hl-pieni { display: block; font-size: .62em; color: var(--wp--preset--color--luu); margin-bottom: .08em; }
.hl-hero-otsikko { hyphens: manual; overflow-wrap: normal !important; word-break: normal !important; }

/* Pitkät suomenkieliset sanat eivät saa koskaan levittää sivua */
h1, h2, h3, h4, .wp-block-post-title { overflow-wrap: break-word; }

/* Sivupohjat: tekstipalsta vasempaan reunaan otsikon linjaan, luettava rivinpituus */
.hl-sivusisalto.is-layout-constrained > :is(p, ul, ol, h2, h3, h4, h5, h6, blockquote, .wp-block-table, .wp-block-quote):not(.alignwide):not(.alignfull) {
	max-width: min(820px, 100%) !important;
	margin-left: max(0px, calc((100% - 1280px) / 2)) !important;
	margin-right: auto !important;
}
/* Jos sivu päättyy täysleveään nostoon, ei tyhjää kaistaa ennen alatunnistetta */
.hl-sivusisalto > .alignfull:last-child { margin-bottom: calc(var(--wp--preset--spacing--70) * -1); }

/* Mobiilivalikko: vasemmalle, isot kursivoidut linkit */
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content,
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container,
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item {
	align-items: flex-start !important;
	text-align: left;
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content { padding-top: 56px; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content {
	font-size: 28px;
	font-style: italic;
	font-weight: 900;
	letter-spacing: 0;
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	font-size: 18px;
	padding: 6px 0;
	color: var(--wp--preset--color--harmaa);
}
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover { color: var(--wp--preset--color--keltainen); }
.wp-block-navigation__responsive-container-open svg,
.wp-block-navigation__responsive-container-close svg { width: 32px; height: 32px; }
