/*
Theme Name: Πειραματική Σκηνή Μήλου
Theme URI: https://milostheater.blogspot.com/
Description: Block theme for the Milos Experimental Stage (Πειραματική Σκηνή Μήλου). Bilingual (Greek/English via Polylang), built for productions, events and galleries.
Version: 1.0.0
Requires at least: 6.6
Requires PHP: 8.0
License: GPL-2.0-or-later
Text Domain: psm
*/

/* ---------------------------------------------------------------------------
   Base
--------------------------------------------------------------------------- */
:root {
	--psm-radius: 14px;
	--psm-shadow: 0 1px 2px rgb(20 12 8 / 6%), 0 8px 24px -12px rgb(20 12 8 / 25%);
	--psm-surface: var(--wp--preset--color--white);
	--psm-line: color-mix(in srgb, var(--wp--preset--color--ink) 12%, transparent);
}

@media (prefers-color-scheme: dark) {
	:root {
		--wp--preset--color--paper: #16120f;
		--wp--preset--color--sand: #241e19;
		--wp--preset--color--ink: #efe8de;
		--wp--preset--color--muted: #b3a89c;
		--wp--preset--color--curtain: #e27b6e;
		--wp--preset--color--aegean: #1d4e70;
		--psm-surface: #201a16;
		--psm-shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 8px 24px -12px rgb(0 0 0 / 60%);
	}
	.wp-element-button,
	.wp-block-button__link {
		background-color: #b33a30 !important;
	}
}

body {
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
}

img {
	height: auto;
}

:where(.wp-site-blocks) :focus-visible {
	outline: 3px solid var(--wp--preset--color--spotlight);
	outline-offset: 3px;
	border-radius: 4px;
}

.screen-reader-text {
	border: 0;
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	white-space: nowrap;
}

.skip-link:focus {
	clip-path: none;
	width: auto;
	height: auto;
	z-index: 1000;
}

.is-style-lead {
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.5;
	color: var(--wp--preset--color--muted);
}

.psm-kicker {
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--wp--preset--color--spotlight);
	margin: 0;
}

/* ---------------------------------------------------------------------------
   Header & navigation
--------------------------------------------------------------------------- */
.psm-header {
	background: var(--wp--preset--color--stage);
	color: #f4ede4;
	position: sticky;
	top: 0;
	z-index: 50;
	border-bottom: 1px solid rgb(255 255 255 / 8%);
}

.admin-bar .psm-header {
	top: var(--wp-admin--admin-bar--height, 0);
}

.psm-header__inner {
	display: flex;
	align-items: center;
	gap: 1.25rem;
	max-width: var(--wp--style--global--wide-size);
	margin-inline: auto;
	min-height: 68px;
}

.psm-brand {
	display: flex;
	align-items: center;
	gap: 0.7rem;
	color: inherit;
	text-decoration: none;
	margin-right: auto;
	line-height: 1.1;
}

.psm-brand:hover {
	color: var(--wp--preset--color--spotlight);
}

.psm-brand__mark {
	width: 34px;
	height: 34px;
	flex: none;
}

.psm-brand__name {
	font-family: var(--wp--preset--font-family--serif);
	font-weight: 700;
	font-size: 1.2rem;
}

.psm-brand__sub {
	display: block;
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.72rem;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	opacity: 0.7;
}

.psm-nav__toggle {
	display: none;
	cursor: pointer;
	color: inherit;
	background: transparent;
	font: inherit;
}

.psm-nav__list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.15rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.psm-nav__list a {
	display: block;
	padding: 0.45rem 0.7rem;
	border-radius: 999px;
	color: #f4ede4;
	text-decoration: none;
	font-size: 0.93rem;
	font-weight: 500;
}

.psm-nav__list a:hover {
	background: rgb(255 255 255 / 8%);
	color: #fff;
}

.psm-nav__list a[aria-current] {
	color: var(--wp--preset--color--spotlight);
}

.psm-lang {
	display: flex;
	gap: 0.25rem;
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 0.8rem;
	font-weight: 600;
}

.psm-lang a {
	display: block;
	padding: 0.3rem 0.55rem;
	border: 1px solid rgb(255 255 255 / 25%);
	border-radius: 6px;
	color: #f4ede4;
	text-decoration: none;
}

.psm-lang a[aria-current] {
	background: var(--wp--preset--color--spotlight);
	border-color: var(--wp--preset--color--spotlight);
	color: var(--wp--preset--color--stage);
}

@media (max-width: 1080px) {
	.psm-nav {
		order: 3;
	}

	.psm-nav__toggle {
		display: grid;
		place-items: center;
		width: 44px;
		height: 44px;
		border-radius: 10px;
		border: 1px solid rgb(255 255 255 / 20%);
	}

	.psm-nav__icon,
	.psm-nav__icon::before,
	.psm-nav__icon::after {
		display: block;
		width: 20px;
		height: 2px;
		background: currentColor;
		border-radius: 2px;
		position: relative;
		transition: transform 0.2s ease;
	}

	.psm-nav__icon::before,
	.psm-nav__icon::after {
		content: "";
		position: absolute;
	}

	.psm-nav__icon::before {
		top: -6px;
	}

	.psm-nav__icon::after {
		top: 6px;
	}

	.psm-nav.is-open .psm-nav__icon {
		background: transparent;
	}

	.psm-nav.is-open .psm-nav__icon::before {
		transform: translateY(6px) rotate(45deg);
	}

	.psm-nav.is-open .psm-nav__icon::after {
		transform: translateY(-6px) rotate(-45deg);
	}

	.psm-nav__list {
		position: absolute;
		left: 0;
		right: 0;
		top: 100%;
		flex-direction: column;
		padding: 0.75rem clamp(1rem, 4vw, 2.5rem) 1.25rem;
		background: var(--wp--preset--color--stage);
		border-bottom: 1px solid rgb(255 255 255 / 10%);
		box-shadow: 0 20px 30px -20px rgb(0 0 0 / 60%);
	}

	/* Without JS the list stays visible; with JS it opens from the toggle. */
	.js .psm-nav:not(.is-open) .psm-nav__list {
		display: none;
	}

	html:not(.js) .psm-nav__toggle {
		display: none;
	}

	html:not(.js) .psm-nav__list {
		position: static;
		flex-direction: row;
		padding: 0.5rem 0;
		box-shadow: none;
		border: 0;
	}

	html:not(.js) .psm-header__inner {
		flex-wrap: wrap;
	}

	.psm-nav__list a {
		padding: 0.75rem 0.5rem;
		border-radius: 8px;
		font-size: 1.05rem;
	}
}

@media (max-width: 480px) {
	.psm-brand__sub {
		display: none;
	}
}

/* ---------------------------------------------------------------------------
   Page headers
--------------------------------------------------------------------------- */
.psm-page-header {
	background:
		radial-gradient(ellipse 60% 120% at 50% -20%, rgb(224 174 87 / 22%), transparent 60%),
		var(--wp--preset--color--stage);
	color: #f4ede4;
}

.psm-page-header :where(h1, .wp-block-post-title, .wp-block-query-title) {
	color: #fff;
	margin: 0;
}

.psm-page-header .wp-block-post-excerpt__excerpt,
.psm-page-header p:not(.psm-kicker) {
	color: rgb(244 237 228 / 80%);
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.5;
}

.psm-page-header a {
	color: var(--wp--preset--color--spotlight);
}

/* ---------------------------------------------------------------------------
   Home
--------------------------------------------------------------------------- */
.psm-hero {
	min-height: min(82vh, 760px);
}

.psm-hero .wp-block-cover__inner-container {
	max-width: var(--wp--style--global--wide-size);
}

.psm-hero .wp-block-cover__inner-container {
	padding-inline: clamp(1rem, 4vw, 2.5rem);
	margin-inline: auto;
}

.psm-hero h1 {
	font-size: clamp(2.6rem, 6.5vw, 5.25rem);
	line-height: 1.02;
	max-width: 13ch;
	text-wrap: balance;
	color: #fff;
}

.psm-hero p {
	max-width: 36rem;
	font-size: var(--wp--preset--font-size--large);
	color: rgb(255 255 255 / 88%);
}

.psm-hero .is-style-outline .wp-block-button__link {
	color: #fff;
	border-color: rgb(255 255 255 / 60%);
	background: transparent !important;
}

.psm-facts {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 1.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.psm-facts li {
	border-top: 2px solid var(--wp--preset--color--curtain);
	padding-top: 1rem;
}

.psm-facts strong {
	display: block;
	font-family: var(--wp--preset--font-family--serif);
	font-size: clamp(1.4rem, 2.2vw, 1.75rem);
	line-height: 1.15;
	margin-bottom: 0.3rem;
	color: var(--wp--preset--color--curtain);
}

.psm-facts span {
	color: var(--wp--preset--color--muted);
}

.psm-section-head {
	display: flex;
	align-items: end;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
}

.psm-section-head h2 {
	margin: 0;
}

.psm-more {
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

.psm-more::after {
	content: " →";
}

.psm-band-aegean {
	background:
		radial-gradient(circle at 85% 20%, rgb(255 255 255 / 14%), transparent 40%),
		var(--wp--preset--color--aegean);
	color: #fff;
}

.psm-band-aegean :where(h2, p, a:not(.wp-block-button__link)) {
	color: #fff;
}

.psm-band-aegean .wp-block-button__link {
	background: #fff !important;
	color: var(--wp--preset--color--aegean) !important;
}

.psm-band-aegean img {
	border-radius: var(--psm-radius);
	box-shadow: 0 20px 40px -20px rgb(0 0 0 / 50%);
}

.psm-quote {
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.3;
	font-style: italic;
	text-wrap: balance;
}

/* ---------------------------------------------------------------------------
   Cards & grids
--------------------------------------------------------------------------- */
.psm-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(calc(50% - 0.5rem), 250px), 1fr));
	gap: clamp(1rem, 2.5vw, 1.75rem);
}

.psm-card {
	background: var(--psm-surface);
	border-radius: var(--psm-radius);
	overflow: hidden;
	box-shadow: var(--psm-shadow);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.psm-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 1px 2px rgb(20 12 8 / 8%), 0 18px 36px -16px rgb(20 12 8 / 35%);
}

.psm-card__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	color: inherit;
	text-decoration: none;
}

.psm-card__media {
	aspect-ratio: 4 / 5;
	background: var(--wp--preset--color--sand);
	overflow: hidden;
}

.psm-grid--gallery .psm-card__media,
.psm-posts .psm-card__media {
	aspect-ratio: 4 / 3;
}

.psm-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
}

.psm-card:hover .psm-card__media img {
	transform: scale(1.03);
}

.psm-card__placeholder {
	display: block;
	height: 100%;
	background:
		radial-gradient(ellipse at 50% 0%, rgb(224 174 87 / 35%), transparent 60%),
		var(--wp--preset--color--stage);
}

.psm-card__body {
	padding: clamp(0.7rem, 2vw, 1rem) clamp(0.75rem, 2vw, 1.1rem) 1.2rem;
}

.psm-card__kicker {
	display: block;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--curtain);
	margin-bottom: 0.35rem;
}

.psm-card__title {
	font-size: clamp(1rem, 2.6vw, 1.2rem);
	margin: 0;
	text-wrap: balance;
}

.psm-card__sub {
	margin: 0.35rem 0 0;
	font-size: 0.9rem;
	color: var(--wp--preset--color--muted);
}

.psm-decade + .psm-decade {
	margin-top: var(--wp--preset--spacing--60);
}

.psm-decade__title {
	display: flex;
	align-items: center;
	gap: 1rem;
	font-size: var(--wp--preset--font-size--x-large);
	margin: 0 0 1.5rem;
}

.psm-decade__title::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--psm-line);
}

/* Post query grid (news / category archives) */
.psm-posts .wp-block-post-template {
	gap: clamp(1rem, 2.5vw, 1.75rem);
}

.psm-posts .wp-block-post {
	background: var(--psm-surface);
	border-radius: var(--psm-radius);
	overflow: hidden;
	box-shadow: var(--psm-shadow);
	display: flex;
	flex-direction: column;
}

.psm-posts .wp-block-post-featured-image {
	margin: 0;
	aspect-ratio: 4 / 3;
	background: var(--wp--preset--color--sand);
}

.psm-posts .wp-block-post-featured-image img {
	height: 100%;
	object-fit: cover;
}

.psm-posts .psm-post-body {
	padding: 1rem 1.1rem 1.25rem;
}

.psm-posts .wp-block-post-title {
	font-size: 1.2rem;
	margin: 0.3rem 0 0;
}

.psm-posts .wp-block-post-title a {
	color: inherit;
	text-decoration: none;
}

.psm-posts .wp-block-post-title a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.psm-posts .wp-block-post {
	position: relative;
}

.psm-posts .wp-block-post-terms a,
.psm-cats a {
	position: relative;
	z-index: 1;
}

.psm-posts .wp-block-post-date,
.psm-posts .wp-block-post-terms {
	font-size: 0.8rem;
	color: var(--wp--preset--color--muted);
}

.psm-cats {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	list-style: none;
	padding: 0;
	margin: 0;
}

.psm-cats a {
	display: block;
	padding: 0.4rem 0.9rem;
	border: 1px solid var(--psm-line);
	border-radius: 999px;
	text-decoration: none;
	color: var(--wp--preset--color--ink);
	font-size: 0.9rem;
}

.psm-cats a:hover,
.psm-cats .current-cat a {
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--paper);
}

.wp-block-query-pagination {
	margin-top: var(--wp--preset--spacing--50);
	gap: 0.5rem;
}

/* ---------------------------------------------------------------------------
   Single production
--------------------------------------------------------------------------- */
.psm-production {
	display: grid;
	grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
	gap: clamp(1.5rem, 5vw, 4rem);
	align-items: start;
}

.psm-production__aside {
	position: sticky;
	top: 96px;
}

.psm-production__aside .wp-block-post-featured-image img {
	border-radius: var(--psm-radius);
	box-shadow: var(--psm-shadow);
}

@media (max-width: 820px) {
	.psm-production {
		grid-template-columns: 1fr;
	}

	.psm-production__aside {
		position: static;
		max-width: 420px;
	}
}

.psm-meta {
	margin: 1.5rem 0 0;
	display: grid;
	gap: 0.9rem;
}

.psm-meta div {
	border-top: 1px solid var(--psm-line);
	padding-top: 0.7rem;
}

.psm-meta dt {
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--muted);
}

.psm-meta dd {
	margin: 0.15rem 0 0;
	font-weight: 500;
}

.psm-subtitle {
	color: var(--wp--preset--color--spotlight);
	font-family: var(--wp--preset--font-family--serif);
	font-style: italic;
	font-size: var(--wp--preset--font-size--large);
}

/* ---------------------------------------------------------------------------
   Content blocks
--------------------------------------------------------------------------- */
.entry-content > h3 {
	margin-top: 2.5rem;
	padding-bottom: 0.4rem;
	border-bottom: 2px solid var(--wp--preset--color--spotlight);
	display: inline-block;
}

.entry-content > h3 + * {
	margin-top: 1rem;
}

.psm-credits table {
	border-collapse: collapse;
	width: 100%;
	font-size: 0.95rem;
}

.psm-credits td {
	border: 0;
	border-bottom: 1px solid var(--psm-line);
	padding: 0.55rem 0.5rem 0.55rem 0;
	vertical-align: top;
}

.psm-credits td:first-child {
	width: 40%;
	color: var(--wp--preset--color--muted);
	font-size: 0.85rem;
	font-weight: 500;
	padding-top: 0.65rem;
}

.psm-credits td:last-child {
	font-weight: 500;
}

.entry-content .wp-block-gallery {
	margin-block: 2rem;
}

.entry-content .wp-block-gallery .wp-block-image img,
.entry-content > .wp-block-image img {
	border-radius: 8px;
}

.entry-content > .wp-block-image {
	margin-block: 2rem;
}

.entry-content > .wp-block-image img {
	max-height: 80vh;
	width: auto;
	margin-inline: auto;
	display: block;
}

/* History timeline */
.psm-timeline-item {
	position: relative;
	padding-left: clamp(4.5rem, 12vw, 7rem);
	padding-bottom: 1.5rem;
	margin-block: 0 !important;
}

.psm-timeline-item::before {
	content: "";
	position: absolute;
	left: calc(clamp(4.5rem, 12vw, 7rem) - 1.35rem);
	top: 0.55rem;
	bottom: -0.6rem;
	width: 2px;
	background: var(--psm-line);
}

.psm-timeline-item::after {
	content: "";
	position: absolute;
	left: calc(clamp(4.5rem, 12vw, 7rem) - 1.35rem - 5px);
	top: 0.5rem;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background: var(--wp--preset--color--curtain);
	box-shadow: 0 0 0 4px var(--wp--preset--color--paper);
}

.psm-timeline-item .psm-timeline-year {
	position: absolute;
	left: 0;
	top: 0;
	margin: 0;
	border: 0;
	font-size: 1.35rem;
	color: var(--wp--preset--color--curtain);
}

.psm-timeline-item p {
	margin-top: 0;
}

.psm-timeline-outro {
	margin-block-start: 2rem !important;
	padding: 1.5rem 1.75rem;
	background: var(--wp--preset--color--sand);
	border-radius: var(--psm-radius);
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.55;
}

/* Post navigation */
.psm-postnav {
	border-top: 1px solid var(--psm-line);
	padding-top: 1.5rem;
}

.psm-postnav a {
	text-decoration: none;
	font-weight: 600;
}

/* ---------------------------------------------------------------------------
   Footer
--------------------------------------------------------------------------- */
.psm-footer {
	background: var(--wp--preset--color--stage);
	color: rgb(244 237 228 / 80%);
	font-size: 0.95rem;
}

.psm-footer h2 {
	font-size: 1.05rem;
	color: #fff;
	margin: 0 0 0.75rem;
	font-family: var(--wp--preset--font-family--sans);
	font-weight: 600;
	letter-spacing: 0.04em;
}

.psm-footer a {
	color: #f4ede4;
}

.psm-footer a:hover {
	color: var(--wp--preset--color--spotlight);
}

.psm-footer ul {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	gap: 0.35rem;
}

.psm-footer__grid {
	display: grid;
	grid-template-columns: 1.4fr 1fr 1fr;
	gap: 2.5rem;
	max-width: var(--wp--style--global--wide-size);
	margin-inline: auto;
}

@media (max-width: 760px) {
	.psm-footer__grid {
		grid-template-columns: 1fr;
		gap: 1.75rem;
	}
}

.psm-footer__bottom {
	max-width: var(--wp--style--global--wide-size);
	margin: 2.5rem auto 0;
	padding-top: 1.25rem;
	border-top: 1px solid rgb(255 255 255 / 10%);
	font-size: 0.82rem;
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0.5rem;
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		transition: none !important;
		animation: none !important;
	}
}

/* Posts without a featured image get the stage-light placeholder. */
.psm-posts .wp-block-post:not(:has(.wp-block-post-featured-image))::before {
	content: "";
	display: block;
	aspect-ratio: 4 / 3;
	background:
		radial-gradient(ellipse at 50% 0%, rgb(224 174 87 / 35%), transparent 60%),
		var(--wp--preset--color--stage);
}
