/*
Theme Name: Own the Stage
Theme URI: https://ownthestage.nl
Author: Own the Stage
Description: Block theme for Own the Stage – presentatietrainingen door Xander Straat. Built from the "website" page in the Figma file (homepage, over, programmapagina, artikelpagina).
Requires at least: 6.6
Tested up to: 6.8
Requires PHP: 7.4
Version: 1.1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: own-the-stage
*/

/* ------------------------------------------------------------------
   Tokens that theme.json can't express
------------------------------------------------------------------- */
:root {
	--ots-red: var(--wp--preset--color--red, #ff1100);
	--ots-ink: var(--wp--preset--color--ink, #1e1e1e);
	--ots-accent: var(--ots-red);
	--ots-line: 4px;
	--ots-line-thin: 2px;
}

/* On red surfaces every accent (underlines, swooshes, links) turns white. */
.has-red-background-color {
	--ots-accent: var(--wp--preset--color--white, #fff);
}

::selection {
	background: var(--ots-red);
	color: #fff;
}

:where(a, button, summary, input, textarea, select):focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

/* ------------------------------------------------------------------
   Header
------------------------------------------------------------------- */
/*
 * One header everywhere (homepage design): language left, logo centred,
 * menu right. Fixed to the top; starts large and shrinks once you scroll.
 */
:root {
	--ots-h-pad-top: clamp(24px, 3vw, 40px);
	--ots-h-pad-bottom: clamp(20px, 2.6vw, 34px);
	--ots-logo-w: clamp(200px, 24vw, 360px);
	/* Space reserved under the fixed header = its large height (logo is 266×62). */
	--ots-header-space: calc(var(--ots-h-pad-top) + var(--ots-h-pad-bottom) + var(--ots-logo-w) * 0.2331);
}

body.is-scrolled {
	--ots-h-pad-top: 23px;
	--ots-h-pad-bottom: 16px;
	--ots-logo-w: clamp(150px, 18vw, 266px);
}

.wp-site-blocks > header.wp-block-template-part {
	position: fixed;
	top: var(--wp-admin--admin-bar--height, 0px);
	left: 0;
	right: 0;
	z-index: 100;
}

.wp-site-blocks {
	padding-top: var(--ots-header-space);
}

html {
	scroll-padding-top: calc(110px + var(--wp-admin--admin-bar--height, 0px));
}

.ots-header {
	padding-top: var(--ots-h-pad-top) !important;
	padding-bottom: var(--ots-h-pad-bottom) !important;
}

.ots-header .ots-logo {
	margin: 0;
}

.ots-header .ots-logo img {
	width: var(--ots-logo-w);
	height: auto;
	display: block;
}

.ots-header > .wp-block-group {
	display: grid !important;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
}

.ots-header .ots-header__end {
	justify-self: end;
}

@media (prefers-reduced-motion: no-preference) {
	.ots-header {
		transition: padding 0.3s ease;
	}

	.ots-header .ots-logo img {
		transition: width 0.3s ease;
	}
}

.ots-lang {
	font-family: var(--wp--preset--font-family--etna-condensed);
	font-weight: 600;
	font-size: var(--wp--preset--font-size--large);
	text-transform: uppercase;
	margin: 0;
	white-space: nowrap;
}

.ots-lang a {
	text-decoration: none;
	color: inherit;
}

.ots-lang a[aria-current="true"],
.ots-lang .current-lang a {
	text-decoration: underline;
}

/* Burger button */
.ots-header .wp-block-navigation__responsive-container-open svg {
	width: 39px;
	height: 39px;
}

/*
 * Menu panel (Figma: "hamburger menu"). Slides in from the right.
 * Phones: full width. Tablet and desktop: a third of the screen, with the
 * page dimmed behind it (click the dimmed area to close).
 */
.wp-block-navigation__responsive-container.is-menu-open {
	padding: 0 !important;
	background-color: rgba(30, 30, 30, 0.45) !important;
	animation: ots-menu-fade 0.25s ease-out;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-close {
	width: 100%;
	max-width: none;
	min-height: 100%;
	margin: 0 0 0 auto;
	box-sizing: border-box;
	padding: clamp(24px, 4vw, 40px) clamp(24px, 3vw, 50px);
	background: var(--ots-red);
	animation: ots-menu-slide 0.3s ease-out;
}

@media (min-width: 600px) {
	.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-close {
		width: clamp(380px, 33.333vw, 560px);
	}
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	width: 100%;
	padding-top: 80px;
}

@keyframes ots-menu-slide {
	from { transform: translateX(100%); }
	to { transform: none; }
}

@keyframes ots-menu-fade {
	from { background-color: rgba(30, 30, 30, 0); }
}

@media (prefers-reduced-motion: reduce) {
	.wp-block-navigation__responsive-container.is-menu-open,
	.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-close {
		animation: none;
	}
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	width: 100%;
	gap: 0 !important;
	align-items: stretch !important;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item {
	border-top: var(--ots-line-thin) solid currentColor;
	width: 100%;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item:last-child {
	border-bottom: var(--ots-line-thin) solid currentColor;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	display: block;
	width: 100%;
	padding: 18px 0 !important;
	font-size: var(--wp--preset--font-size--xx-large);
	line-height: 1.1;
	text-decoration: none;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content:hover {
	text-decoration: underline;
}

.wp-block-navigation__responsive-container-close svg {
	width: 32px;
	height: 32px;
}

/* ------------------------------------------------------------------
   Footer
------------------------------------------------------------------- */
.ots-footer .ots-logo img {
	width: clamp(200px, 19vw, 286px);
	height: auto;
	display: block;
}

.ots-footer .ots-logo {
	margin: 0;
}

.ots-footer .wp-block-navigation a {
	text-decoration: none;
}

.ots-footer .wp-block-navigation a:hover {
	text-decoration: underline;
}

@media (min-width: 1100px) {
	/* Menu starts on the same line as the text column, like in Figma */
	.ots-footer__inner {
		display: grid !important;
		grid-template-columns: calc(50% - 346.5px) 1fr;
		align-items: center;
	}
}

/* ------------------------------------------------------------------
   Headings
------------------------------------------------------------------- */

/* "Met streep": short accent line under a section title */
.is-style-underlined::after {
	content: "";
	display: block;
	width: min(211px, 60%);
	height: var(--ots-line);
	margin-top: 15px;
	background: var(--ots-accent);
}

.is-style-underlined.has-text-align-center::after {
	margin-inline: auto;
}

.is-style-underlined.has-text-align-right::after {
	margin-left: auto;
}

/* "Gelinieerd": each line of the hero heading sits on a rule */
.is-style-ruled {
	--ots-rule-lh: 1.151;
	line-height: var(--ots-rule-lh) !important;
	letter-spacing: -0.01em;
	background-image: linear-gradient(to top, var(--ots-ink) var(--ots-line), transparent var(--ots-line));
	background-size: 100% calc(var(--ots-rule-lh) * 1em);
	background-repeat: repeat-y;
	padding-bottom: 0;
}

.is-style-ruled mark {
	background: transparent;
}

/* ------------------------------------------------------------------
   Paragraph styles
------------------------------------------------------------------- */
.is-style-lead {
	font-family: var(--wp--preset--font-family--etna);
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.1;
	color: var(--wp--preset--color--black);
}

.is-style-label {
	font-family: var(--wp--preset--font-family--etna-condensed);
	font-weight: 600;
	font-size: var(--wp--preset--font-size--large);
	text-transform: uppercase;
}

/* ------------------------------------------------------------------
   Buttons
------------------------------------------------------------------- */

/* "Onderstreepte link": uppercase text with a line underneath */
.wp-block-button.is-style-text-link .wp-block-button__link {
	background: transparent !important;
	color: var(--ots-accent);
	padding: 0 0.6em 3px;
	border-radius: 0;
	font-family: var(--wp--preset--font-family--etna-condensed);
	font-weight: 600;
	font-size: var(--wp--preset--font-size--medium);
	text-transform: uppercase;
	text-decoration: none;
	background-image: linear-gradient(currentColor, currentColor) !important;
	background-size: calc(100% - 1.2em) var(--ots-line-thin) !important;
	background-position: center bottom !important;
	background-repeat: no-repeat !important;
}

.wp-block-button.is-style-text-link .wp-block-button__link.has-text-color {
	color: inherit;
}

.wp-block-button.is-style-text-link .wp-block-button__link:hover {
	background-size: 100% var(--ots-line-thin) !important;
}

@media (prefers-reduced-motion: no-preference) {
	.wp-block-button.is-style-text-link .wp-block-button__link {
		transition: background-size 0.2s ease;
	}
}

/* ------------------------------------------------------------------
   Separators
------------------------------------------------------------------- */

/* "Spreekballon-lijn": the speech-bubble line from the logo */
.wp-block-separator.is-style-swoosh {
	border: 0 !important;
	width: 100%;
	height: 21px;
	opacity: 1;
	background-color: var(--ots-accent) !important;
	-webkit-mask:
		url("assets/images/swoosh-notch.svg") left top / 114px 21px no-repeat,
		linear-gradient(#000, #000) 113px 0 / calc(100% - 113px) 3px no-repeat;
	mask:
		url("assets/images/swoosh-notch.svg") left top / 114px 21px no-repeat,
		linear-gradient(#000, #000) 113px 0 / calc(100% - 113px) 3px no-repeat;
}

.wp-block-separator.is-style-swoosh.has-background:not(.has-red-background-color) {
	background-color: currentColor !important;
}

.wp-block-separator.is-style-swoosh.is-short {
	max-width: 253px;
	margin-inline: auto !important;
}

/* ------------------------------------------------------------------
   Quotes
------------------------------------------------------------------- */

/* Testimonial: big centred quote, accent line, attribution */
.wp-block-quote.is-style-testimonial {
	border: 0;
	padding: 0;
	margin-inline: auto;
	text-align: center;
	font-family: var(--wp--preset--font-family--etna-condensed);
	font-size: var(--wp--preset--font-size--quote);
	font-weight: 600;
	line-height: 1.1;
	color: var(--ots-accent);
}

.wp-block-quote.is-style-testimonial p:last-of-type::after {
	content: "";
	display: block;
	width: 137px;
	height: var(--ots-line-thin);
	margin: 15px auto 0;
	background: currentColor;
}

.wp-block-quote.is-style-testimonial cite {
	display: block;
	margin-top: 17px;
	font-family: var(--wp--preset--font-family--etna);
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 400;
	font-style: normal;
	line-height: 1.3;
	color: var(--ots-ink);
}

.has-red-background-color .wp-block-quote.is-style-testimonial cite {
	color: inherit;
}

/* Smaller testimonials inside the slider */
.is-style-slider .wp-block-quote.is-style-testimonial {
	text-align: left;
	font-size: var(--wp--preset--font-size--x-large);
	line-height: 1.2;
}

.is-style-slider .wp-block-quote.is-style-testimonial p:last-of-type::after {
	width: 94px;
	margin-left: 0;
}

.is-style-slider .wp-block-quote.is-style-testimonial cite {
	font-family: var(--wp--preset--font-family--public-sans);
	font-size: var(--wp--preset--font-size--small);
}

/* Pull quote in articles: red, lines above and below */
.wp-block-pullquote {
	text-align: center;
}

.wp-block-pullquote blockquote::before,
.wp-block-pullquote blockquote::after {
	content: "";
	display: block;
	width: 137px;
	height: var(--ots-line-thin);
	margin: 0 auto 15px;
	background: currentColor;
}

.wp-block-pullquote blockquote::after {
	margin: 15px auto 0;
}

.wp-block-pullquote p {
	font-size: inherit;
	line-height: inherit;
}

/* ------------------------------------------------------------------
   FAQ (core/details)
------------------------------------------------------------------- */
.ots-faq .wp-block-details:first-of-type {
	border-top: 3px solid var(--ots-ink);
}

.wp-block-details summary {
	list-style: none;
	cursor: pointer;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 24px;
	font-family: var(--wp--preset--font-family--etna-condensed);
	font-size: var(--wp--preset--font-size--xx-large);
	font-weight: 600;
	line-height: 1.3;
	text-transform: uppercase;
	padding-inline: clamp(0px, 2vw, 26px);
}

.wp-block-details summary::-webkit-details-marker {
	display: none;
}

/* plus icon that turns into a cross */
.wp-block-details summary::after {
	content: "";
	flex: 0 0 29px;
	height: 29px;
	background:
		linear-gradient(var(--ots-ink), var(--ots-ink)) center / 100% 3px no-repeat,
		linear-gradient(var(--ots-ink), var(--ots-ink)) center / 3px 100% no-repeat;
}

.wp-block-details[open] summary {
	color: var(--ots-red);
}

.wp-block-details[open] summary::after {
	transform: rotate(45deg);
}

@media (prefers-reduced-motion: no-preference) {
	.wp-block-details summary::after {
		transition: transform 0.2s ease;
	}
}

.wp-block-details > :not(summary) {
	max-width: 870px;
	margin-inline: auto;
	padding-inline: 20px;
}

.wp-block-details > summary + * {
	margin-top: 26px;
}

/* ------------------------------------------------------------------
   Hero images
------------------------------------------------------------------- */
.ots-hero img {
	width: 100%;
	min-height: 320px;
	max-height: 75vh;
	object-fit: cover;
}

.wp-block-post-featured-image.alignfull {
	min-height: 320px;
}

/* Programme page without a featured image: keep the title off the header */
main > .wp-block-post-title:first-child {
	margin-top: var(--wp--preset--spacing--60);
}

/* ------------------------------------------------------------------
   Training cards (homepage)
------------------------------------------------------------------- */
.ots-cards {
	gap: 22px !important;
}

.ots-card {
	height: 100%;
	padding: 0 !important;
	display: flex;
	flex-direction: column;
}

.ots-card > * {
	margin-block: 0 !important;
}

.ots-card > .wp-block-image img {
	width: 100%;
	aspect-ratio: 454 / 261;
	object-fit: cover;
	display: block;
}

.ots-card__body {
	flex: 1;
	display: flex;
	flex-direction: column;
}

.ots-card__body > .wp-block-buttons {
	margin-top: auto !important;
	padding-top: 30px;
}

.ots-card h3 {
	font-size: clamp(34px, 3.4vw, 55px);
	overflow-wrap: normal;
	word-break: normal;
	hyphens: auto;
	text-transform: uppercase;
	line-height: 0.98;
}

.ots-card .wp-block-list {
	padding-left: 1.3em;
}

/* ------------------------------------------------------------------
   Programme info box
------------------------------------------------------------------- */
.ots-infobox .ots-infobox__row {
	gap: 14px !important;
	align-items: flex-start !important;
}

.ots-infobox .ots-infobox__row .wp-block-image {
	flex: 0 0 26px;
	margin: 0;
	display: flex;
	justify-content: center;
}

.ots-infobox .ots-infobox__row .wp-block-image img {
	width: auto;
	height: 22px;
}

.ots-infobox .ots-infobox__row p {
	margin: 0;
}

/* ------------------------------------------------------------------
   Testimonial slider
------------------------------------------------------------------- */
.ots-slider {
	position: relative;
	padding-inline: clamp(0px, 7vw, 130px);
}

.is-style-slider {
	display: flex !important;
	flex-wrap: nowrap !important;
	gap: clamp(40px, 9vw, 140px) !important;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}

.is-style-slider::-webkit-scrollbar {
	display: none;
}

.is-style-slider > * {
	flex: 0 0 100%;
	scroll-snap-align: start;
	margin: 0 !important;
}

@media (min-width: 900px) {
	.is-style-slider > * {
		flex-basis: calc(50% - clamp(40px, 9vw, 140px) / 2);
	}
}

.ots-slider__btn {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	display: grid;
	place-items: center;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	cursor: pointer;
}

.ots-slider__btn[hidden] {
	display: none;
}

.ots-slider__btn--prev {
	left: 0;
}

.ots-slider__btn--next {
	right: 0;
}

@media (max-width: 700px) {
	.ots-slider {
		padding-bottom: 60px;
	}

	.ots-slider__btn {
		top: auto;
		bottom: 0;
		transform: none;
	}

	.ots-slider__btn--prev {
		left: calc(50% - 54px);
	}

	.ots-slider__btn--next {
		right: calc(50% - 54px);
	}
}

/* ------------------------------------------------------------------
   Post lists ("Andere verhalen", blog index)
------------------------------------------------------------------- */
.ots-post-list .wp-block-post-template {
	border-top: 3px solid var(--ots-ink);
}

.ots-post-list .wp-block-post {
	border-bottom: 3px solid var(--ots-ink);
	padding: 22px clamp(0px, 2vw, 21px);
	margin: 0;
}

.ots-post-list .wp-block-post-title {
	font-size: var(--wp--preset--font-size--xx-large);
	text-transform: uppercase;
	color: var(--ots-ink);
	line-height: 1.3;
	margin: 0;
}

.ots-post-list .wp-block-post-title a {
	text-decoration: none;
}

.ots-post-list .wp-block-post-title a:hover {
	color: var(--ots-red);
}

.ots-post-list .wp-block-post-date {
	font-family: var(--wp--preset--font-family--etna-condensed);
	font-size: var(--wp--preset--font-size--xx-large);
	font-weight: 600;
	text-transform: uppercase;
	line-height: 1.3;
	color: var(--ots-red);
	white-space: nowrap;
}

/* ------------------------------------------------------------------
   Article meta and share link
------------------------------------------------------------------- */
.ots-byline > * {
	margin: 0;
}

.ots-share .wp-block-button.is-style-text-link .wp-block-button__link::after {
	content: "";
	display: inline-block;
	width: 17px;
	height: 18px;
	margin-left: 12px;
	vertical-align: -2px;
	background: url("assets/icons/share.svg") center / contain no-repeat;
}

.ots-share .wp-block-button.is-style-text-link .wp-block-button__link {
	color: var(--wp--preset--color--black) !important;
	font-size: var(--wp--preset--font-size--large) !important;
	padding-left: 0 !important;
	background-image: linear-gradient(var(--ots-red), var(--ots-red)) !important;
	background-size: 100% var(--ots-line-thin) !important;
	background-position: left bottom !important;
}

/* ------------------------------------------------------------------
   Contact form on red (works with Contact Form 7, WPForms, Gravity
   Forms, Fluent Forms and plain core markup)
------------------------------------------------------------------- */
.ots-form {
	max-width: 536px;
	margin-inline: auto;
	color: #fff;
}

.ots-form :is(input[type="text"], input[type="email"], input[type="tel"], textarea, select) {
	width: 100%;
	box-sizing: border-box;
	background: transparent;
	color: #fff;
	border: 2px solid #fff;
	border-radius: 0;
	padding: 10px 15px;
	font: inherit;
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.3;
}

.ots-form :is(input, textarea)::placeholder {
	color: #fff;
	opacity: 0.85;
}

.ots-form textarea {
	min-height: 134px;
}

.ots-form :is(input[type="submit"], button[type="submit"], .wpforms-submit, .gform_button) {
	display: block;
	margin: 24px auto 0;
	background: transparent !important;
	color: #fff !important;
	border: 0 !important;
	border-bottom: 2px solid #fff !important;
	border-radius: 0;
	padding: 0 20px 4px !important;
	font-family: var(--wp--preset--font-family--etna-condensed);
	font-size: var(--wp--preset--font-size--medium);
	text-transform: uppercase;
	cursor: pointer;
}

.ots-form-placeholder {
	border: 2px dashed #fff;
	padding: 24px;
	text-align: center;
}

/* ------------------------------------------------------------------
   Clients list
------------------------------------------------------------------- */
.ots-clients mark {
	background: transparent;
}

/* ------------------------------------------------------------------
   Small screens
------------------------------------------------------------------- */
@media (max-width: 781px) {
	.ots-header .ots-lang {
		font-size: 18px;
	}

	.wp-block-details summary {
		gap: 16px;
	}

	.ots-post-list .wp-block-post > .wp-block-group {
		flex-direction: column;
		align-items: flex-start !important;
		gap: 4px !important;
	}

	.ots-post-list .wp-block-post-date {
		font-size: var(--wp--preset--font-size--large);
	}
}

/* Header, main and footer sit flush against each other */
.wp-site-blocks > * + * {
	margin-block-start: 0;
}
