/*
Theme Name: Tobox
Theme URI: https://tobox.fi
Description: Tobox tuuletuskotelot -sivuston teema. Vastaa ulkoasultaan tobox.fi-sivustoa.
Version: 1.0.0
Requires at least: 6.3
Requires PHP: 7.4
Text Domain: tobox
License: GNU General Public License v2 or later
*/

:root {
	--navy: #152642;        /* otsikot, hero-laatikko, footer */
	--navy-deep: #000e44;   /* navigaatio, numerolaatikot */
	--btn: #203647;         /* painikkeet */
	--blue: #3c76cd;        /* linkit, alaotsikot */
	--slate: #2c3b55;       /* tumma korttiosio */
	--light: #eef9ff;       /* vaaleat laatikot */
	--text: #444;
	--yellow: #ffe7a8;
	--bottom: #04070d;
	--container: 1200px;
	--font-head: "Lexend Deca", system-ui, sans-serif;
	--font-body: "Jost", system-ui, sans-serif;
	--font-hero: "Quicksand", system-ui, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	background: #fff;
	color: var(--text);
	font-family: var(--font-body);
	font-size: 18px;
	line-height: 1.45;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-head);
	font-weight: 700;
	color: var(--navy);
	line-height: 1.25;
	margin: 0 0 .4em;
}

h1 { font-size: 72px; line-height: 1.25; }
h2 { font-size: 48px; }
h3 { font-size: 35px; }
h4 { font-size: 22px; }

p { margin: 0 0 26px; }
p:last-child { margin-bottom: 0; }

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

.skip-link:focus {
	clip: auto; width: auto; height: auto;
	top: 8px; left: 8px; z-index: 1000;
	background: #fff; padding: 10px 16px;
}

.container {
	width: 100%;
	max-width: calc(var(--container) + 40px);
	margin: 0 auto;
	padding: 0 20px;
}

/* ---------- Painikkeet ---------- */

.btn,
.wp-block-button__link,
.wp-element-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 250px;
	min-height: 43px;
	padding: 8px 24px;
	border: 0;
	border-radius: 12px;
	background: var(--btn);
	color: #fff;
	font-family: var(--font-head);
	font-size: 18px;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .2s, color .2s;
}

.btn:hover,
.wp-block-button__link:hover,
.wp-element-button:hover {
	background: var(--blue);
	color: #fff;
	text-decoration: none;
}

.btn--upper,
.is-style-upper .wp-block-button__link { text-transform: uppercase; }

.btn--outline,
.is-style-outline-light .wp-block-button__link {
	min-width: 200px;
	background: transparent;
	border: 2px solid #fff;
	text-transform: uppercase;
}

.btn--outline:hover,
.is-style-outline-light .wp-block-button__link:hover {
	background: #fff;
	color: var(--slate);
}

/* ---------- Header ---------- */

.site-header {
	position: relative;
	z-index: 50;
	background: #fff;
	height: 127px;
}

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 100%;
	padding: 0 50px 0 47px;
}

.site-logo { flex-shrink: 0; }

.site-logo img {
	width: 292px;
	height: auto;
}

.main-nav ul {
	display: flex;
	gap: 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.main-nav a {
	position: relative;
	display: block;
	padding: 10px 0;
	color: var(--navy-deep);
	font-family: var(--font-body);
	font-size: 20px;
	font-weight: 700;
	letter-spacing: .72px;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
}

.main-nav a::after {
	content: "";
	position: absolute;
	left: 0; right: 0; bottom: -6px;
	height: 4px;
	background: var(--blue);
	transform: scaleX(0);
	transition: transform .2s;
}

.main-nav a:hover::after,
.main-nav .current-menu-item > a::after,
.main-nav .current_page_item > a::after { transform: scaleX(1); }

.main-nav__phone { display: none; }

.nav-toggle {
	display: none;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	background: var(--navy-deep);
	cursor: pointer;
}

.nav-toggle span,
.nav-toggle span::before,
.nav-toggle span::after {
	display: block;
	position: relative;
	width: 20px;
	height: 2px;
	margin: 0 auto;
	background: #fff;
	transition: transform .2s;
}

.nav-toggle span::before,
.nav-toggle span::after { content: ""; position: absolute; left: 0; }
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }

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

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

.hero {
	position: relative;
	min-height: 659px;
	padding: 380px 0 40px;
	background: var(--hero-image, none) center / cover no-repeat;
}

.hero::before,
.page-banner::before {
	content: "";
	position: absolute;
	inset: 0;
	background: #c6deff;
	opacity: .6;
}

.hero__box {
	position: relative;
	max-width: var(--container);
	margin: 0 auto;
	padding: 50px 250px 30px;
	border-radius: 20px;
	background: var(--navy);
	color: #fff;
	text-align: center;
}

.hero__text {
	margin: 0 0 30px;
	font-family: var(--font-hero);
	font-size: 34px;
	font-weight: 400;
	line-height: 1.3;
	color: #fff;
}

.hero__image {
	position: absolute;
	top: -14px;
	right: 40px;
	width: 186px;
	height: 186px;
	border-radius: 50%;
	overflow: hidden;
	background: #fff;
}

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

/* ---------- Alasivujen banneri ---------- */

.page-banner {
	position: relative;
	height: 340px;
	background: var(--banner-image, none) center / cover no-repeat;
}

/* ---------- Sivun otsikko ---------- */

.page-intro { padding: 70px 0 60px; }
.page-intro h1 { margin: 0; }

.page-intro__subtitle {
	margin: 0 0 30px;
	color: var(--blue);
	font-family: var(--font-head);
	font-size: 30px;
	font-weight: 700;
	line-height: 1.25;
}

/* ---------- Sisältö ---------- */

.entry-content { padding: 0 20px 60px; }
.entry-content:has(> .alignfull:last-child) { padding-bottom: 0; }
.entry-content > * { max-width: var(--container); margin: 0 auto 60px; }
.entry-content > *:last-child { margin-bottom: 0; }
.entry-content > .alignfull { margin-left: -20px; margin-right: -20px; }
.entry-content .tobox-h2-large { font-size: 48px; margin-bottom: 60px; }
.entry-content > .alignfull { max-width: none; }
.entry-content > .alignwide { max-width: var(--container); }

.entry-content h2 { font-size: 35px; margin-bottom: 18px; }
.entry-content h3 { font-size: 22px; margin-bottom: 18px; }
.entry-content ul, .entry-content ol { margin: 0 0 26px; padding-left: 36px; }
.entry-content li { margin-bottom: 0; }
.entry-content .wp-block-buttons { margin-top: 0; margin-bottom: 0; }

.wp-block-columns { gap: 2em 60px; }
.wp-block-column > .wp-block-columns,
.wp-block-group .wp-block-columns { margin-bottom: 0; }

@media (min-width: 782px) {
	.wp-block-columns { flex-wrap: nowrap !important; }
}

/* Vaalea laatikko (Jälleenmyyjät, tuotetiedot, otteet) */
.is-style-tobox-light,
.tobox-light {
	background: var(--light);
	padding: 50px 30px 40px;
}

.is-style-tobox-light h2 { font-size: 35px; }

/* Tumma täysleveä osio */
.is-style-tobox-dark,
.tobox-dark {
	background: var(--slate);
	color: #fff;
	padding: 100px 20px;
}

.is-style-tobox-dark h2,
.is-style-tobox-dark h3,
.is-style-tobox-dark h4 { color: #fff; }

.is-style-tobox-dark > * { max-width: var(--container); margin-left: auto; margin-right: auto; }

/* Tummansininen laatikko (asennusohje) */
.is-style-tobox-navy {
	background: var(--navy-deep);
	color: #fff;
	padding: 45px 20px;
	font-size: 17px;
	line-height: 1.65;
}

.is-style-tobox-navy p { margin-bottom: 28px; }
.is-style-tobox-navy strong { color: #fff; }

/* Etusivun kortit */
.tobox-cards { gap: 60px !important; }
.tobox-cards + .tobox-cards { margin-top: 60px; }
.tobox-card { text-align: center; }
.tobox-card .wp-block-buttons { justify-content: center; }
.tobox-card h3 { margin: 0 0 12px; font-size: 22px; color: #fff; }
.tobox-card p { margin: 0 0 12px; font-size: 18px; line-height: 1.45; }
.tobox-card__icon {
	display: block;
	width: 34px;
	height: 34px;
	margin: 0 auto 30px;
	color: #fff;
}

/* Numeroidut kohdat (asennusohje, edut) */
/* Klassisissa teemoissa ryhmälohko saa sisäkääreen: ohitetaan se asettelussa. */
.tobox-steps > .wp-block-group__inner-container,
.tobox-step > .wp-block-group__inner-container,
.tobox-step__text > .wp-block-group__inner-container { display: contents; }

.tobox-steps {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 60px 48px;
}

.tobox-steps > .tobox-step { margin: 0; }

.tobox-step {
	display: grid;
	grid-template-columns: 53px 1fr;
	gap: 24px;
	align-items: start;
	padding-left: 23px;
}

.tobox-step .tobox-step__num { margin: 4px 0 0; }

.tobox-step__num {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 53px;
	height: 53px;
	margin-top: 4px;
	background: var(--navy-deep);
	color: #fff;
	font-family: var(--font-head);
	font-size: 35px;
	font-weight: 700;
	line-height: 1;
}

.is-style-tobox-dark .tobox-step__num { background: #fff; color: var(--navy-deep); }

.tobox-step__text { font-size: 18px; line-height: 1.45; }
.tobox-step__text p { margin-bottom: 26px; }

/* Keltainen ympyrä */
.tobox-circle {
	margin-top: -130px !important;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 354px;
	height: 354px;
	margin: 0 auto 50px;
	border-radius: 50%;
	background: var(--yellow);
	color: #fff;
	font-family: var(--font-head);
	font-size: 34px;
	font-weight: 700;
	line-height: 1.3;
	text-align: center;
}

/* Värit-ympyrät */
.tobox-colors {
	display: flex;
	flex-wrap: nowrap;
	gap: 0;
	margin: 0 0 20px !important;
}

.tobox-colors img { flex: 1 1 0; min-width: 0; max-width: 92.5px; height: auto; }

/* Logorivi */
.tobox-logos { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; padding-left: 20px; }
.tobox-logos img { height: 60px; width: auto; }

.tobox-contact-icons { display: flex; gap: 250px; flex-wrap: wrap; }
.tobox-contact-icons svg { display: block; width: 48px; height: 48px; margin: 0 0 12px 6px; color: var(--blue); }
.tobox-contact-icons a { color: var(--text); }

/* Tietosuojaseloste */
.entry-content table { border-collapse: collapse; width: 100%; margin: 0 auto 26px; font-size: 16px; }
.entry-content th, .entry-content td { border: 1px solid #ccd; padding: 8px 12px; text-align: left; vertical-align: top; }

/* ---------- Yhteydenotto-osio ---------- */

.contact-section {
	position: relative;
	overflow: hidden;
	padding: 100px 0 110px;
	background: var(--light);
}

.contact-section::before {
	content: "";
	position: absolute;
	inset: 0;
	background: url("assets/images/saumatausta.svg") center / cover no-repeat;
	opacity: .55;
	pointer-events: none;
}

.contact-section__inner {
	position: relative;
	display: grid;
	grid-template-columns: 505px 1fr;
	gap: 32px;
}

.contact-section h2 {
	margin: 0 0 12px;
	color: var(--blue);
	font-size: 48px;
	line-height: 1.25;
	max-width: 400px;
}

.contact-section p { margin: 0 0 12px; font-size: 18px; }

.contact-form__grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px 34px;
	padding: 0 17px 0 2px;
}

.contact-form__field--wide { grid-column: 1 / -1; }

.contact-form label {
	display: block;
	margin-bottom: 8px;
	font-size: 18px;
	color: var(--text);
}

.contact-form input,
.contact-form textarea {
	display: block;
	width: 100%;
	height: 40px;
	padding: 0 10px;
	border: 0;
	border-bottom: 4px solid var(--navy-deep);
	border-radius: 0;
	background: transparent;
	color: var(--text);
	font: inherit;
	font-size: 16px;
}

.contact-form textarea { height: 90px; padding-top: 8px; resize: vertical; }

.contact-form input:focus,
.contact-form textarea:focus { outline: none; border-bottom-color: var(--blue); }

.contact-form__hp { position: absolute; left: -9999px; }

.contact-form__submit { margin-top: 110px; }
.contact-form__submit .btn { width: 280px; text-transform: uppercase; }

.contact-form__notice {
	margin: 0 17px 20px 2px;
	padding: 12px 16px;
	border-radius: 8px;
	font-size: 16px;
}

.contact-form__notice--ok { background: #dff3e4; color: #1d5a2e; }
.contact-form__notice--error { background: #fde2e2; color: #8a1f1f; }

/* ---------- Footer ---------- */

.site-footer {
	background: var(--navy);
	color: #fff;
	padding: 90px 0 90px;
}

.site-footer__inner {
	display: grid;
	grid-template-columns: 1fr 490px;
	gap: 30px;
	padding-left: 30px;
}

.site-footer__title {
	margin: 0;
	color: #fff;
	font-size: 35px;
}

.site-footer h4 { margin: 0 0 10px; color: #fff; font-size: 22px; }

.site-footer .btn {
	display: flex;
	width: 280px;
	margin-bottom: 10px;
	font-size: 18px;
}

.site-bottom {
	background: var(--bottom);
	border-top: 1px solid #2a3348;
	color: #fff;
	font-size: 14px;
}

.site-bottom__inner {
	display: flex;
	justify-content: space-between;
	align-items: center;
	min-height: 58px;
}

.site-bottom ul { display: flex; gap: 24px; margin: 0; padding: 0; list-style: none; }
.site-bottom a { color: #fff; }

/* ---------- 404 ---------- */

.error-404 { padding: 80px 0 120px; }
.error-404 h1 { font-size: 160px; line-height: 1; }

/* ---------- Responsiivisuus ---------- */

@media (max-width: 1280px) {
	.site-header__inner { padding: 0 20px; }
	.site-logo img { width: 240px; }
	.main-nav ul { gap: 16px; }
	.main-nav a { font-size: 17px; }
}

@media (max-width: 1024px) {
	h1 { font-size: 56px; }
	.hero__box { padding: 50px 220px 30px 40px; }
	.contact-section__inner { grid-template-columns: 1fr; }
	.site-footer__inner { grid-template-columns: 1fr; }
	.tobox-contact-icons { gap: 80px; }
}

@media (max-width: 960px) {
	.site-header { height: 100px; box-shadow: 0 2px 10px rgba(0,0,0,.08); }
	.site-logo img { width: 200px; }
	.nav-toggle { display: block; }

	.main-nav {
		position: fixed;
		top: 0; right: 0; bottom: 0;
		width: min(340px, 85vw);
		padding: 110px 40px 40px;
		background: #fff;
		transform: translateX(100%);
		visibility: hidden;
		transition: transform .25s, visibility .25s;
		overflow-y: auto;
	}

	.nav-open .main-nav { transform: none; visibility: visible; box-shadow: -4px 0 20px rgba(0,0,0,.15); }
	.nav-toggle { position: relative; z-index: 2; }

	.main-nav ul { flex-direction: column; gap: 26px; }
	.main-nav a { font-size: 24px; white-space: normal; display: inline-block; }
	.main-nav__phone { display: block; margin-top: 40px; }
	.main-nav .main-nav__phone .btn {
		display: flex;
		min-width: 0;
		width: 100%;
		padding: 8px 24px;
		color: #fff;
		font-family: var(--font-head);
		font-size: 18px;
		letter-spacing: normal;
		line-height: 1.2;
	}
	.main-nav .main-nav__phone .btn::after { display: none; }
}

@media (max-width: 781px) {
	body { font-size: 17px; }
	h1 { font-size: 44px; }
	.entry-content h2 { font-size: 30px; }
	.page-banner { height: 200px; }
	.page-intro { padding: 40px 0 30px; }
	.page-intro__subtitle { font-size: 22px; }

	.hero { padding: 120px 20px 40px; min-height: 0; }
	.hero__box { padding: 190px 24px 30px; }
	.hero__text { font-size: 26px; }
	.hero__image { top: 20px; left: 50%; right: auto; width: 150px; height: 150px; transform: translateX(-50%); }

	.tobox-circle { width: 280px; height: 280px; font-size: 26px; margin-top: 0 !important; }
	.tobox-step { padding-left: 0; }
	.tobox-steps { grid-template-columns: 1fr; gap: 36px; }
	.entry-content .tobox-h2-large { font-size: 34px; margin-bottom: 36px; }
	.is-style-tobox-dark { padding: 60px 20px; }

	.contact-section { padding: 60px 0; }
	.contact-section h2 { font-size: 38px; }
	.contact-form__grid { grid-template-columns: 1fr; padding: 0; }
	.contact-form__submit { margin-top: 40px; }

	.site-footer { padding: 60px 0; }
	.site-footer__title { font-size: 28px; }
	.site-bottom__inner { flex-direction: column; gap: 8px; padding: 16px 20px; }
	.error-404 h1 { font-size: 100px; }
}

/* ---------- Sisältökuvat ---------- */

.tobox-side-image img,
.tobox-partner-logo img { margin: 0 auto; }
.tobox-side-image { margin: 0; }
.tobox-side-image.is-rounded-soft img { border-radius: 8px; }
.tobox-partner-logo { max-width: 272px; margin: 0 auto 70px; }
.tobox-install-image { margin: 0; padding: 0 0 0 38px; }
.tobox-install-image img { width: 100%; max-width: 315px; }
.tobox-install { align-items: flex-start; }
.tobox-small { font-size: 16px; }
.tobox-resellers { margin-bottom: 30px !important; }
.tobox-resellers p { font-size: 18px; }
.tobox-resellers strong a { font-family: var(--font-head); color: var(--blue); }
.tobox-specs .wp-block-columns + .wp-block-columns { margin-top: 30px; }
.tobox-quotes h3 { font-size: 22px; }
.entry-content h2:not(:first-child) { margin-top: 0; }
