/*
Theme Name: Porvoon Paahtimo
Author: Tuomo Tomperi
Author URI: tuomotomperi.fi
Text Domain: porvoonpaahtimo
*/

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

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

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

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;
}

/* Temporary fix for text-decoration-thickness in Firefox */
@-moz-document url-prefix() {
	a {
		text-decoration-thickness: .1rem !important;
	}
}

/* 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: #fff;
	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;
}

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

a.more-link {
	display: block;
}

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

.wp-block-categories {
	position: relative;
}

/* 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;
}

.row-logos > figure {
	flex-shrink: 1 !important;
}

/* Sticky header */

body:not(.wp-admin) header:has(>.is-position-sticky) {
	position: sticky;
	top: calc( 0px + var( --wp-admin--admin-bar--height, 0px ) );
	z-index: 100;
}

/* Account for admin bar on mobile */

@media (max-width: 600px) {
	header:has(>.is-position-sticky) {
		top: 0;
	}
}

/* Mobile helper classes */

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

	.ollie-unstick-mobile {
		position: static;
	}

	header:has(>.ollie-unstick-mobile) {
		position: static;
	}
}

/* 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;
}

/* */

.has-w {
	background-image: url('assets/images/w.png');
	background-repeat: no-repeat;
	background-size: 123px 88px;
	background-position: 14% -5%;
}

.h-full {
	height: 100% !important;
	align-items: stretch !important;
}



@media (min-width: 600px) {
	.wp-block-media-text {
		min-height: 30rem;
	}
}

@media (max-width: 600px) {
	.wp-block-media-text:not(.has-background) > .wp-block-media-text__content {
		padding-left: 0;
		padding-right: 0;
	}
}

.wp-block-media-text__content {
	padding-bottom: var(--wp--preset--spacing--large) !important;
}

.paahtimo-hero {
	min-height: 70rem;	
	background-color: var(--wp--preset--color--dark) !important;
}

@media (max-width: 1920px) {
	.paahtimo-hero {
		min-height: 50rem;	
	}
}

@media (max-width: 600px) {
	.paahtimo-hero {
		min-height: 60vh;	
	}
}

.paahtimo-hero-sub {
	min-height: 60rem;	
	background-color: var(--wp--preset--color--dark) !important;
}

@media (max-width: 1920px) {
	.paahtimo-hero-sub {
		min-height: 40rem;	
	}
}

@media (max-width: 600px) {
	.paahtimo-hero-sub {
		min-height: 60vh;	
	}
}

.is-style-content-size {
	max-width: var(--wp--style--global--content-size);
}

.stripe {
	display: block;
	width: 10rem;
	height: 0.375rem;
	background: var(--wp--preset--color--primary-accent);
	margin-block-start: var(--wp--preset--spacing--medium);
}

.gs_logo_area,
.wp-block-group__link {
	width: 100% !important;
	max-width: 100% !important;
}

.gs_logo_title {
	display: none !important;
}

.gs_logo_single {
	padding-left: 0 !important;
	padding-right: var(--wp--preset--spacing--medium) !important;
}

.gs_logo_area.carousel_has--dots .gs_logo_container {
	padding-bottom: 0 !important;
}

.logo-grid {
  align-items: center;
}

.wp-block-cover {
	padding-right: var(--wp--style--root--padding-right);
	padding-left: var(--wp--style--root--padding-left);
}

body.single-post footer.site-footer > .wp-block-group,
body.error404 footer.site-footer > .wp-block-group {
	margin-top: 0 !important;
}

.wp-block-media-text {
	overflow: hidden;
}

.wp-block-media-text__media {
	overflow: hidden;
}

.visual-line {
	width: 10rem;
	height: 0.5rem;
	background: var(--wp--preset--color--primary-tint);
	margin-left: auto;
	margin-right: auto;
}

/* Carousel */

.rt-carousel {
	--rt-carousel-gap: var(--wp--preset--spacing--medium) !important;
}

.rt-carousel-dot {
	--rt-carousel-dot-active-color: var(--wp--preset--color--primary-tint);
	--rt-carousel-dot-color: var(--wp--preset--color--base);
}

.rt-carousel-controls {
	gap: var(--wp--preset--spacing--small) !important;
}

.wp-block-rt-carousel-carousel .embla__slide {
	flex: 0 0 80vw;
	max-width: none;
	min-width: 0;
}
@media (min-width: 782px) {
	.wp-block-rt-carousel-carousel .embla__slide {
		flex-basis: 20rem;
	}
}

@media (min-width: 782px) {
	.desktop-hidden {
		display: none !important;
	}
}

@media (max-width: 782px) {
	.mobile-hidden {
		display: none !important;
	}
}

@media (max-width: 782px) {
	.wp-block-rt-carousel-carousel-viewport {
		margin-left: calc(-1 * var(--wp--style--root--padding-left));
		padding-left: calc(1 * var(--wp--style--root--padding-left));
		margin-right: calc(-1 * var(--wp--style--root--padding-right));
		padding-right: calc(1 * var(--wp--style--root--padding-right));
	}
}

/* */

:root :where(.wp-element-button, .wp-block-button__link) {
	display: flex;
	align-items: center;
}

/* */

.footer-vector {
	background-image: url(vector.png);
	background-repeat: no-repeat;
	background-size: 40rem auto;
	background-position: 70% 133%;
}

@media (max-width: 600px) {
	.footer-vector {
		background-size: 30rem auto;
    background-position: -30% 115%;
	}
}

/* Navigation */

@media (min-width: 600px) {
	:root { --header-h: 88px; }

	/* Oletus: tumma, sticky header */
	.site-header {
		position: sticky;
		top: 0;
		z-index: 100;
	}

	.has-hero-cover .site-header {
		position: fixed;
		inset: 0 0 auto;
	}

	.has-hero-cover .site-header:not(.is-scrolled) > .wp-block-group {
		background: transparent !important;
		transition: background-color .3s, backdrop-filter .3s;
	}

	.has-hero-cover .site-header.is-scrolled > .wp-block-group {
		backdrop-filter: blur(8px);
		background: rgb(18 14 13 / 0.9) !important;
	}

	/* Cover alkaa aivan ylhäältä, sisältö ei jää navin alle */
	.has-hero-cover main { margin-block-start: 0; }
	.has-hero-cover .wp-block-post-content > .wp-block-cover:first-child {
		margin-block-start: 0;
		padding-top: calc(var(--header-h) + 2rem);
	}

	/* Admin-palkki */
	.admin-bar .site-header { top: var(--wp-admin--admin-bar--height, 0px); }

	/* Navigaatiolinkit coverin päällä */
	.has-hero-cover .site-header .wp-block-navigation-item__content,
	.has-hero-cover .site-header .wp-block-navigation__responsive-container-open {
		text-shadow: 0 1px 5px rgb(18 14 13 / 0.3);
	}

	/* Varjo pois, kun linkit ovat omalla taustallaan */
	.has-hero-cover .site-header.is-scrolled .wp-block-navigation-item__content,
	.has-hero-cover .site-header .wp-block-navigation__submenu-container .wp-block-navigation-item__content,
	.has-hero-cover .site-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
		text-shadow: none;
	}

	body .wp-block-navigation__responsive-container:not(.is-menu-open) {
		background-color: var(--wp--preset--color--dark) !important;
		color: inherit !important;
	}
}

/* */

.wp-block-media-text>.wp-block-media-text__content {
	padding-top: var(--wp--preset--spacing--medium);
	padding-bottom: var(--wp--preset--spacing--large);
}

.wp-block-media-text>.wp-block-media-text__content > *:first-child {
	padding-top: 0 !important;
	margin-top: 0 !important;
}