/*
Theme Name: Teppo Sara
Theme URI: https://tepposara.com
Author: Stoked / Sami
Author URI: https://stoked.fi
Description: Räätälöity lohkoteema Teppo Saran sivustolle.
Version: 0.3.0
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: tepposara
*/

/* Sivukohtainen taustaväri */
body.slug-illustrations {
	background-color: #009dff;
}

::selection {
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}

:where(a:focus-visible, button:focus-visible) {
	outline: 2px solid var(--wp--preset--color--contrast);
	outline-offset: 2px;
}

:root {
	--ts-pad: clamp(0.75rem, 1.5vw, 1.5rem);
	--ts-nav-size: clamp(1.375rem, 2.3vw, 2.75rem);
}

/* --- Koko ruudun korkuinen sivupohja: karuselli venyy, alaosa taittuu ruudun alle --- */

body .wp-site-blocks {
	display: flex;
	flex-direction: column;
	min-height: 100dvh;
}

.ts-main {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-height: 0;
	margin-block-start: 0 !important;
}

.ts-main .entry-content {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-height: 0;
	margin-block-start: 0 !important;
}

.ts-main .entry-content > .ts-carousel {
	flex: 1 1 0px;
	min-height: clamp(240px, 38vh, 60vh);
	container-type: size;
}

.ts-main .entry-content > .ts-carousel .ts-carousel__track,
.ts-main .entry-content > .ts-carousel .ts-carousel__img {
	height: 100%;
	height: 100cqh;
}

/* --- Ylätunniste: logo vasemmalla karusellin päällä, navigaatio ylärivissä --- */

.ts-header {
	position: relative;
	padding: var(--ts-pad) var(--ts-pad) clamp(0.75rem, 2.5vh, 1.75rem);
}

.ts-logo {
	position: absolute;
	top: var(--ts-pad);
	left: var(--ts-pad);
	z-index: 20;
	line-height: 0;
}

.ts-logo img {
	width: clamp(200px, 19vw, 380px);
	height: auto;
}

/* --- Navigaatio: TATTOOS keskellä, ILLUSTRATIONS oikealla --- */

.ts-header .wp-block-navigation {
	font-size: var(--ts-nav-size);
	min-height: calc(var(--ts-nav-size) * 1.4);
}

.ts-header .wp-block-navigation .wp-block-navigation-item:first-child {
	position: absolute;
	left: 50%;
	transform: translateX(-50%);
}

.ts-header .wp-block-navigation-item__content::before {
	content: "";
	display: inline-block;
	width: 0.85em;
	height: 0.74em;
	margin-right: 0.08em;
	background-color: currentColor;
	-webkit-mask: url(assets/img/arrow.svg) no-repeat center / contain;
	mask: url(assets/img/arrow.svg) no-repeat center / contain;
}

.ts-header .current-menu-item .wp-block-navigation-item__content::before {
	transform: rotate(90deg);
}

.ts-header .wp-block-navigation-item__content,
.ts-header .wp-block-navigation-item__content:hover {
	text-decoration: none;
}

.ts-header .current-menu-item .wp-block-navigation-item__label,
.ts-header .wp-block-navigation-item__content:hover .wp-block-navigation-item__label {
	text-decoration: underline;
	text-underline-offset: 0.18em;
	text-decoration-thickness: 0.09em;
}

/* --- Alaosa: intro vasemmalla, yhteystiedot oikealla --- */

.ts-bottom {
	display: grid;
	grid-template-columns: minmax(0, 44rem) auto;
	justify-content: space-between;
	align-items: start;
	gap: 1.5rem 3rem;
	padding: 0.75rem var(--ts-pad) 1.25rem;
}

.ts-intro {
	/* 16px mobiilissa -> 24px työpöydällä (lineaarinen 781-1512px välillä) */
	font-size: clamp(1rem, 0.47rem + 1.1vw, 1.5rem);
	line-height: 1.2;
	margin: 0 0 30px;
}

strong,
b {
	font-weight: 900;
}

.ts-contact {
	text-align: right;
}

.ts-contact h2 {
	font-size: clamp(1.0625rem, 2.2vw, 2.5rem);
	margin: 0 0 0.4em;
}

.ts-contact-list {
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: clamp(0.9375rem, 1.05vw, 1.25rem);
	font-weight: 600;
}

.ts-contact-list li {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 0.5em;
	margin-bottom: 5px;
}

.ts-contact-list li:last-child {
	margin-bottom: 0;
}

.ts-ci {
	flex: none;
	width: 1.1em;
	height: 1.1em;
}

/* --- Muu sisältö (blogi- yms. pohjat) --- */

.ts-main .entry-content > :where(:not(.alignfull)) {
	max-width: none;
	padding-left: var(--ts-pad);
	padding-right: var(--ts-pad);
}

/* --- Mobiili --- */

@media (max-width: 781px) {
	.ts-logo {
		position: static;
	}

	.ts-logo img {
		width: clamp(180px, 53vw, 240px);
	}

	.ts-header .wp-block-navigation {
		margin-top: 0.5rem;
		min-height: 0;
		justify-content: flex-start;
		flex-wrap: nowrap;
		gap: 1rem;
	}

	.ts-header .wp-block-navigation .wp-block-navigation-item:first-child {
		position: static;
		transform: none;
	}

	.ts-header {
		padding-bottom: 0.75rem;
	}

	.ts-bottom {
		display: block;
	}

	.ts-contact {
		margin-top: 1.5rem;
	}
}
