/*
Theme Name: Luotsi 3
Theme URI: 
Author: Team Robin by Medialuotsi
Author URI: https://teamrobin.com/fi/
Description: Medialuotsin lohkoteema.
Requires at least: 7.1
Tested up to: 7.1
Requires PHP: 8.1
Version: 3.0.0
License: GNU General Public License v3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Text Domain: luotsi3

Luotsi 3 WordPress Theme, (C) 2026 Team Robin by Medialuotsi.
Luotsi 3 is distributed under the terms of the GNU GPL.
*/

/* CSS Reset
---------------------------------------------------------------------------- */

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

html {
	box-sizing: border-box;
	-moz-osx-font-smoothing: grayscale;
	-webkit-font-smoothing: antialiased;
}

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

b,
strong {
	font-weight: var(--wp--custom--font-weight--semi-bold);
}

ol,
ul {
	padding: 0;
}

ol:where(:not([class*="wp-block"])),
ol:where(.wp-block-list),
ul:where(:not([class*="wp-block"])),
ul:where(.wp-block-list) {
	padding-inline-start: var(--wp--preset--spacing--medium);
}

div[class*="wp-block-"] figcaption {
	color: var(--wp--preset--color--secondary);
	font-size: var(--wp--preset--font-size--x-small);
	margin-bottom: 0;
	margin-top: 20px;
	text-align: center;
}

img,
figure {
	max-width: 100%;
	height: auto;
}

/* Pitkät suomenkieliset sanat (esim. "asiantuntijalla") tavutetaan otsikoissa
 * kapealla näytöllä, jottei yksittäinen kirjain putoa seuraavalle riville.
 * Tavutus perustuu sivun kieleen (lang="fi"). */
@media (max-width: 781px) {
	:where(h1, h2, h3, h4, h5, h6) {
		hyphens: auto;
		hyphenate-limit-chars: 10 4 4;
	}
}

/* Standardize form styling
--------------------------------------------- */

input,
button,
textarea,
select {
	font: inherit;
}

input[type="button"],
input[type="email"],
input[type="search"],
input[type="submit"],
input[type="text"],
textarea {
	-webkit-appearance: none;
	appearance: none;
}

input:not([type="submit"]):not([type="radio"]),
select,
textarea,
.wp-block-post-comments-form input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]),
.wp-block-post-comments-form textarea {
	color: var(--wp--preset--color--main);
	border-radius: 5px;
	border: solid 1px color-mix(in srgb, var(--wp--preset--color--tertiary) 100%, var(--wp--preset--color--main) 20%);
	padding: .5em 1em;
	font-size: var(--wp--preset--font-size--small);
	background-color: var(--wp--preset--color--base);
	box-shadow:
		0 1px 2px rgba(0, 0, 0, 0.02),
		0 0.5px 1px rgba(0, 0, 0, 0.04);
}

input:focus-visible,
textarea:focus-visible,
select:focus-visible {
	outline-color: var(--wp--preset--color--main);
	outline-offset: 1px;
}

input[type="checkbox"],
input[type="image"],
input[type="radio"] {
	width: auto;
}

select {
	-webkit-appearance: none;
	appearance: none;
	background: var(--wp--preset--color--base) url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJmZWF0aGVyIGZlYXRoZXItY2hldnJvbi1kb3duIj48cG9seWxpbmUgcG9pbnRzPSI2IDkgMTIgMTUgMTggOSI+PC9wb2x5bGluZT48L3N2Zz4=) no-repeat;
	background-size: 16px;
	background-position: calc(100% - 12px) 50%;
	padding-right: 2.2em;
}

label {
	width: 100%;
	display: block;
}

::placeholder {
	color: var(--wp--preset--color--secondary);
	font-size: var(--wp--preset--font-size--small);
	opacity: 0.75;
}

/* Content spacing
 * In post and page content, wide/full-width blocks and interactive components
 * get more room than running text. Margins set in the editor (inline styles)
 * still win, and full-width pattern sections set their own margins to 0.
---------------------------------------------------------------------------- */

.wp-block-post-content> :is(.alignwide, .alignfull) {
	margin-block: var(--wp--preset--spacing--x-large);
}

.wp-block-post-content> :is(.wp-block-accordion, .wp-block-tabs):not(.alignwide, .alignfull) {
	margin-block: var(--wp--preset--spacing--large);
}

/* No extra space at the very start or end (an empty paragraph there does not count). */
.wp-block-post-content> :is(.alignwide, .alignfull, .wp-block-accordion, .wp-block-tabs):first-child,
.wp-block-post-content>p:empty:first-child+ :is(.alignwide, .alignfull, .wp-block-accordion, .wp-block-tabs) {
	margin-block-start: 0;
}

.wp-block-post-content> :is(.alignwide, .alignfull, .wp-block-accordion, .wp-block-tabs):last-child,
.wp-block-post-content> :is(.alignwide, .alignfull, .wp-block-accordion, .wp-block-tabs):has(+ p:empty:last-child) {
	margin-block-end: 0;
}

/* Page without title (template "page-no-title")
 * Content gets the same top/bottom space as the titled page template, except
 * when the first or last block is full width: then it sits against the
 * header or footer (heroes, banners, colored sections).
---------------------------------------------------------------------------- */

.site-content--no-title>.wp-block-post-content {
	padding-block: var(--wp--preset--spacing--xx-large);
}

/* Empty paragraphs left at the start or end of the content are ignored. */
.site-content--no-title>.wp-block-post-content>p:empty:is(:first-child, :last-child) {
	display: none;
}

.site-content--no-title>.wp-block-post-content:has(> .alignfull:first-child, > p:empty:first-child + .alignfull) {
	padding-top: 0;
}

.site-content--no-title>.wp-block-post-content:has(> .alignfull:last-child, > .alignfull + p:empty:last-child) {
	padding-bottom: 0;
}

/* Linkkikortti (lohkotyyli Ryhmälle ja Sarakkeelle)
 * Koko kortti on linkki: kortin painikkeen linkki (tai jos painiketta ei ole,
 * otsikon linkki) venytetään kortin kokoiseksi (stretched link). Kortissa on
 * yksi oikea linkki, joten ruudunlukija lukee sen kerran. Tekstin muut linkit
 * pysyvät klikattavina. Editorissa linkkiä ei venytetä, jotta sisältöä voi muokata.
---------------------------------------------------------------------------- */

.is-style-link-card {
	position: relative;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

:where(body:not(.editor-styles-wrapper)) .is-style-link-card .wp-block-button:not(.has-arrow) .wp-block-button__link::after,
:where(body:not(.editor-styles-wrapper)) .is-style-link-card:not(:has(.wp-block-button__link)) :is(h2, h3, h4, h5, h6) a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

.is-style-link-card :is(p, li, figcaption) a {
	position: relative;
	z-index: 2;
}

:where(body:not(.editor-styles-wrapper)) .is-style-link-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--wp--preset--shadow--medium-light);
}

.is-style-link-card:has(a:focus-visible) {
	outline: 2px solid var(--wp--preset--color--primary);
	outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
	.is-style-link-card {
		transition: none;
	}

	:where(body:not(.editor-styles-wrapper)) .is-style-link-card:hover {
		transform: none;
	}
}

/* Helper styles
---------------------------------------------------------------------------- */

/* Yhteystiedot (henkilökortit): pitkä sähköpostiosoite rivittyy kapeassa
 * kortissa, ja kuvake pysyy tekstin vieressä. */
.luotsi3-contact-links a,
a[href^="mailto:"] {
	overflow-wrap: anywhere;
}

.luotsi3-contact-links p {
	min-width: 0;
	margin: 0;
}

.luotsi3-contact-links .wp-block-icon {
	flex-shrink: 0;
}

/* Inline code */
*:not(.wp-block-code)>code {
	background-color: var(--wp--preset--color--tertiary);
	padding: 3px 5px;
	position: relative;
	border-radius: 3px;
}

/* Remove margin on term description on archive pages */
.wp-block-term-description p:last-child {
	margin-bottom: 0;
}

/* Remove last separator on post list */
.remove-border-and-padding .wp-block-post-template li:last-child .wp-block-separator {
	display: none;
}

/* Hide post meta div if no tags assigned */
.single .wp-block-group:has(> .post-meta:empty) {
	display: none;
}

.wp-block-group:empty:has(+ .comment-respond) {
	display: none;
}

/* Mobile helper classes */

@media (max-width: 781px) {
	.luotsi3-hide-on-mobile {
		display: none;
	}
}

/* Table
--------------------------------------------- */

.wp-block-table table {
	background: var(--wp--preset--color--base);
	border-radius: 5px;
	border: solid 1px var(--wp--preset--color--border-light);
	font-size: var(--wp--preset--font-size--x-small);
}

.wp-block-table.is-style-stripes {
	border-bottom: none;
}

.wp-block-table.is-style-stripes tbody tr:nth-child(odd) {
	background-color: var(--wp--preset--color--tertiary);
}

.wp-block-table td,
.wp-block-table th,
.wp-block-table thead {
	border: none;
	border-bottom: solid 1px color-mix(in srgb, var(--wp--preset--color--border-light) 50%, var(--wp--preset--color--base) 5%);
}

.wp-block-table th,
.wp-block-table tfoot {
	text-align: left;
	background-color: color-mix(in srgb, var(--wp--preset--color--tertiary) 75%, var(--wp--preset--color--base) 5%);
}

.wp-block-table td,
.wp-block-table th {
	padding: .8em 1em;
}

.wp-block-table tfoot {
	border-top: solid 1px var(--wp--preset--color--border-light);
}

.wp-block-table tfoot td {
	border-bottom: none;
}