/*
Theme Name: Harjavalta
Description: Harjavallan helluntaiseurakunnan teema. Tiedotteet näytetään julisteseinänä (kuva riittää, otsikko on valinnainen) ja Wordista liitetty viikko-ohjelma muotoillaan automaattisesti.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.0
Text Domain: harjavalta
License: GPL-2.0-or-later
*/

:root {
	--c-paper: #faf6f0;
	--c-surface: #ffffff;
	--c-soft: #f2ebe1;
	--c-line: #e8e0d4;
	--c-ink: #2b2420;
	--c-muted: #5c5049;
	--c-deep: #1f2c47;
	--c-deep-2: #182136;
	--c-flame: #b8431a;
	--c-flame-ink: #a33a15;
	--c-flame-soft: #fbe6da;
	--c-peach: #f2b48f;

	--f-display: "Source Serif 4", Georgia, "Times New Roman", serif;
	--f-body: "Work Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

	--radius: 14px;
	--radius-sm: 8px;
	--shadow: 0 1px 2px rgb(29 34 48 / 6%), 0 6px 20px -6px rgb(29 34 48 / 14%);
	--shadow-lift: 0 2px 4px rgb(29 34 48 / 8%), 0 18px 40px -12px rgb(29 34 48 / 28%);
	--gutter: clamp(1rem, 4vw, 2rem);
	--wrap: 1180px;
	--wrap-narrow: 780px;
}

/* ---------- Perusta ---------- */

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
	margin: 0;
	background: var(--c-paper);
	color: var(--c-ink);
	font: 400 1.0625rem/1.6 var(--f-body);
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}

img, svg, video, iframe { max-width: 100%; }
img { height: auto; display: block; }

a { color: var(--c-flame-ink); text-underline-offset: 0.18em; }
a:hover { color: var(--c-ink); }

:focus-visible { outline: 3px solid var(--c-flame); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3, h4, h5, h6 {
	font-family: var(--f-display);
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: -0.01em;
	margin: 1.6em 0 0.5em;
	text-wrap: balance;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.skip-link {
	position: absolute;
	left: 1rem; top: -4rem;
	z-index: 100;
	padding: 0.6rem 1rem;
	background: var(--c-ink);
	color: #fff;
	border-radius: var(--radius-sm);
}
.skip-link:focus { top: 1rem; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.wrap--narrow { width: min(100% - 2 * var(--gutter), var(--wrap-narrow)); }

.icon { flex: none; }

.eyebrow {
	margin: 0 0 0.5rem;
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--c-flame-ink);
}

.button {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.75rem 1.375rem;
	border: 1px solid var(--c-flame);
	border-radius: 999px;
	background: var(--c-flame);
	color: #fff;
	font-size: 0.9375rem;
	font-weight: 600;
	text-decoration: none;
	transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.button:hover { background: var(--c-flame-ink); border-color: var(--c-flame-ink); color: #fff; }
.button--ghost { background: transparent; border-color: rgb(255 255 255 / 45%); }
.button--ghost:hover { background: rgb(255 255 255 / 12%); border-color: #fff; }

.badge {
	display: inline-block;
	padding: 0.15rem 0.6rem;
	border-radius: 999px;
	background: var(--c-flame);
	color: #fff;
	font: 700 0.72rem/1.5 var(--f-body);
	letter-spacing: 0.06em;
	text-transform: uppercase;
	white-space: nowrap;
}
.badge--muted { background: var(--c-line); color: var(--c-muted); }

/* ---------- Yläosa ---------- */

.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgb(250 246 240 / 94%);
	backdrop-filter: saturate(1.4) blur(10px);
	border-bottom: 1px solid var(--c-line);
}
.admin-bar .site-header { top: var(--wp-admin--admin-bar--height, 32px); }

.site-header__inner {
	display: flex;
	align-items: center;
	gap: 1rem;
	min-height: 4.4rem;
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 0.75rem;
	margin-right: auto;
	color: var(--c-deep);
	text-decoration: none;
}
.brand__logo { width: auto; max-height: 3rem; }
.brand__name {
	font: 600 1.0625rem/1.15 var(--f-display);
	max-width: 15ch;
}
.brand--light { color: #fff; }

.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav .menu { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.site-nav a {
	display: block;
	padding: 0.5rem 0.75rem;
	border-radius: 999px;
	color: var(--c-deep);
	font-weight: 500;
	font-size: 0.875rem;
	text-decoration: none;
}
.site-nav a:hover { background: var(--c-soft); }
.site-nav .current-menu-item > a,
.site-nav .current_page_item > a { background: var(--c-deep); color: #fff; }

.site-nav .menu-item-has-children { position: relative; }
.site-nav .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 13rem;
	padding: 0.4rem;
	background: var(--c-surface);
	border-radius: var(--radius-sm);
	box-shadow: var(--shadow-lift);
	visibility: hidden;
	opacity: 0;
	transition: opacity 0.15s;
}
.site-nav .menu-item-has-children:is(:hover, :focus-within) > .sub-menu { visibility: visible; opacity: 1; }

.nav-toggle {
	display: none;
	align-items: center;
	gap: 0.4rem;
	padding: 0.55rem 0.9rem;
	border: 1px solid var(--c-line);
	border-radius: 999px;
	background: var(--c-surface);
	color: var(--c-ink);
	font: 600 1rem var(--f-body);
	cursor: pointer;
}

@media (max-width: 960px) {
	.nav-toggle { display: inline-flex; }
	.site-nav {
		position: absolute;
		inset: 100% 0 auto;
		display: none;
		padding: 0.75rem var(--gutter) 1.25rem;
		background: var(--c-paper);
		border-bottom: 1px solid var(--c-line);
		box-shadow: 0 20px 30px -20px rgb(29 34 48 / 30%);
	}
	.site-nav.is-open { display: block; }
	.site-nav .menu { flex-direction: column; gap: 0.1rem; }
	.site-nav a { padding: 0.8rem 1rem; font-size: 1.1rem; }
	.site-nav .sub-menu { position: static; visibility: visible; opacity: 1; box-shadow: none; background: none; padding: 0 0 0 1rem; }
}

/* ---------- Etusivun banneri ---------- */

.hero {
	position: relative;
	display: flex;
	align-items: flex-end;
	min-height: min(500px, 80vh);
	padding: 4rem 0;
	overflow: hidden;
	background: var(--c-deep-2);
	color: var(--c-paper);
}
.hero__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center 40%;
}
.hero::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(90deg, rgb(24 33 54 / 82%) 0%, rgb(24 33 54 / 60%) 55%, rgb(24 33 54 / 45%) 100%);
}
.hero__grid {
	position: relative;
	z-index: 2;
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 2rem 3rem;
}
.hero__text { max-width: 35rem; }
.hero .eyebrow { margin-bottom: 1.1rem; font-size: 0.8125rem; letter-spacing: 0.18em; color: var(--c-peach); }
.hero__title {
	margin: 0;
	font-size: clamp(2.4rem, 5.5vw, 3.5rem);
	font-weight: 600;
	line-height: 1.05;
	letter-spacing: -0.01em;
	text-wrap: pretty;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

.button--light { background: var(--c-paper); border-color: var(--c-paper); color: var(--c-deep); }
.button--light:hover { background: #fff; border-color: #fff; color: var(--c-deep); }
.button--ghost { background: transparent; border: 1px solid rgb(250 246 240 / 60%); color: var(--c-paper); font-weight: 500; }
.button--ghost:hover { background: rgb(250 246 240 / 12%); border-color: var(--c-paper); color: var(--c-paper); }

.next {
	display: flex;
	flex-direction: column;
	gap: 0.9rem;
	width: 21.25rem;
	max-width: 100%;
	padding: 1.6rem 1.75rem;
	border-radius: var(--radius);
	background: var(--c-paper);
	color: var(--c-deep);
	box-shadow: 0 20px 50px -20px rgb(0 0 0 / 45%);
}
.next__eyebrow {
	margin: 0;
	font: 600 0.75rem var(--f-body);
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--c-flame);
}
.next__head { display: flex; align-items: center; gap: 0.9rem; }
.next__tile,
.date-tile {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 3.25rem;
	height: 3.25rem;
	border-radius: 10px;
	background: var(--c-deep);
	color: var(--c-paper);
	line-height: 1;
}
.next__tile strong,
.date-tile strong { font: 600 1.3rem var(--f-display); }
.next__tile span,
.date-tile span { margin-top: 3px; font-size: 0.6875rem; letter-spacing: 0.08em; text-transform: uppercase; }
.next__title { margin: 0; font: 600 1.3rem/1.15 var(--f-display); }
.next .events { display: flex; flex-direction: column; gap: 0.35rem; }
.next .event { grid-template-columns: 3.9rem minmax(0, 1fr); gap: 0.6rem; padding: 0; font-size: 0.875rem; }
.next .event__time { color: var(--c-deep); font-weight: 600; }
.next .event__text { color: var(--c-muted); }
.next__more {
	padding-top: 0.9rem;
	border-top: 1px solid var(--c-line);
	color: var(--c-flame);
	font-size: 0.875rem;
	font-weight: 600;
	text-decoration: none;
}
.next__more:hover { color: var(--c-deep); }

@media (max-width: 720px) {
	.hero { min-height: 0; padding: 3rem 0 var(--gutter); }
	.next { width: 100%; }
}

/* ---------- Tulossa: lähipäivät ja uusin puhe ---------- */

/* Tulossa-sivun julisteet videon vieressä: kaksi rinnakkain, yksi kapeampana. */
.upcoming .posters { columns: 2 14rem; }
.upcoming .posters--one { columns: 1; max-width: 26rem; }
.upcoming {
	display: grid;
	grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
	gap: clamp(1.5rem, 4vw, 3rem);
	align-items: start;
}
.upcoming--single { grid-template-columns: minmax(0, 1fr); max-width: 44rem; }
/* Pelkkä video (ei julisteita eikä tulevia ohjelmapäiviä): isompana. */
.upcoming--single:has(> .latest-video:only-child) { max-width: 56rem; }
.upcoming--single > .latest-video:only-child .video__title { font: 600 1.35rem/1.3 var(--f-display); }

.day-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.day-card {
	display: flex;
	gap: 1rem;
	padding: 1rem 1.25rem;
	border-radius: var(--radius);
	background: var(--c-surface);
	box-shadow: var(--shadow);
}
.day-card.day--su { background: var(--c-surface); box-shadow: var(--shadow), inset 4px 0 0 var(--c-flame); }
.day-card__title { margin: 0.1rem 0 0.4rem; font: 600 1.15rem var(--f-display); color: var(--c-deep); }
.day-card .event { grid-template-columns: 4.6rem minmax(0, 1fr); font-size: 0.95rem; }
.day-card .event__text { color: var(--c-muted); }

.latest-video { display: flex; flex-direction: column; gap: 0.9rem; }
.latest-video__title { margin: 0; font-size: 1.35rem; }
.video { margin: 0; }
.video__player {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	border-radius: var(--radius);
	background: var(--c-deep);
	box-shadow: var(--shadow);
}
.video__player img,
.video__player iframe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border: 0; }
.video__play {
	position: absolute;
	inset: 50% auto auto 50%;
	width: 4.25rem;
	height: 4.25rem;
	translate: -50% -50%;
	border-radius: 50%;
	background: rgb(24 33 54 / 78%) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 7v10l8-5z' fill='white'/%3E%3C/svg%3E") center / 55% no-repeat;
	transition: background-color 0.15s, scale 0.15s;
}
.video__player:hover .video__play { background-color: var(--c-flame); scale: 1.06; }
.video__caption { display: flex; flex-direction: column; gap: 0.15rem; margin-top: 0.75rem; }
.video__title { font-weight: 600; line-height: 1.35; }
.video__date { color: var(--c-muted); font-size: 0.9rem; }

@media (max-width: 820px) {
	.upcoming { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Tapahtumarivit (etusivu ja ohjelma) ---------- */

.events { list-style: none; margin: 0; padding: 0; }
.event {
	display: grid;
	grid-template-columns: 5.6rem 1fr;
	gap: 0.75rem;
	padding: 0.2rem 0;
	line-height: 1.45;
}
.event--note .event__text { color: var(--c-muted); font-style: italic; }
.event__time {
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	color: var(--c-deep);
	white-space: nowrap;
}

/* ---------- Osiot ---------- */

.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section--tight { padding-top: 0; }
.section--soft { background: var(--c-soft); }

.section__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.5rem 1rem;
	margin-bottom: 1.75rem;
}
.section__title { margin: 0; font-size: clamp(1.8rem, 4vw, 2.5rem); }
.section__link {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	font-weight: 700;
	text-decoration: none;
}

.page-head { padding: clamp(2rem, 6vw, 3.5rem) 0 clamp(1.25rem, 3vw, 2rem); }
.page-head__title { margin: 0; font-size: clamp(2rem, 5vw, 3.2rem); }

/* ---------- Julisteseinä ---------- */

/* Palstat säilyttävät julisteiden oman kuvasuhteen (pysty/vaaka) ilman rajausta. */
.posters {
	columns: 3 18rem;
	column-gap: clamp(1rem, 2.5vw, 1.5rem);
}
.poster {
	break-inside: avoid;
	margin: 0 0 clamp(1rem, 2.5vw, 1.5rem);
	overflow: hidden;
	border-radius: var(--radius);
	background: var(--c-surface);
	box-shadow: var(--shadow);
}
.poster__link {
	display: block;
	color: var(--c-ink);
	text-decoration: none;
}
.poster__link:hover { color: var(--c-flame); }
.poster__link:hover img { opacity: 0.92; }
.poster__media { display: block; position: relative; background: var(--c-soft); }
.poster__media img { width: 100%; transition: opacity 0.15s; }
.poster__media--video::after {
	content: "";
	position: absolute;
	inset: 50% auto auto 50%;
	width: 4rem; height: 4rem;
	translate: -50% -50%;
	border-radius: 50%;
	background: rgb(0 0 0 / 60%) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 7v10l8-5z' fill='white'/%3E%3C/svg%3E") center / 60% no-repeat;
}
.poster__body { display: block; padding: 1rem 1.15rem 0; }
.poster__body:last-child { padding-bottom: 1.15rem; }
.poster__title { display: block; font: 600 1.2rem/1.25 var(--f-display); }
/* Tiedotteen teksti näkyy kokonaan kortissa. */
.poster__text { padding: 1rem 1.15rem 1.15rem; font-size: 1rem; line-height: 1.55; overflow-wrap: anywhere; }
.poster__text > :first-child { margin-top: 0; }
.poster__text > :last-child { margin-bottom: 0; }
.poster__text p { margin: 0 0 0.75em; }
.poster__text figure { margin: 0.75rem 0; }
.poster--text { border-top: 4px solid var(--c-flame); }
.poster__excerpt { display: block; margin-top: 0.4rem; padding-bottom: 1.15rem; color: var(--c-muted); font-size: 1rem; }

.pagination { margin-top: 2rem; }
.nav-links { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; }
.page-numbers {
	padding: 0.5rem 0.95rem;
	border-radius: 999px;
	background: var(--c-surface);
	box-shadow: var(--shadow);
	text-decoration: none;
	font-weight: 700;
}
.page-numbers.current { background: var(--c-deep); color: #fff; }

.empty { color: var(--c-muted); }

/* ---------- Yksittäinen tiedote ---------- */

.single-poster { padding-bottom: clamp(2.5rem, 6vw, 4rem); }
.single-poster__head { padding: clamp(1.5rem, 4vw, 2.5rem) 0 1.25rem; }
.single-poster__head .page-head__title { margin-bottom: 0.25rem; }

.entry-content--poster .wp-block-image img,
.single-poster > .wrap > .wp-block-image img {
	margin-inline: auto;
	border-radius: var(--radius);
	box-shadow: var(--shadow-lift);
}

.post-nav {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
	margin-top: 3rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--c-line);
}
.post-nav__link {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	color: var(--c-ink);
	text-decoration: none;
	font-weight: 600;
}
.post-nav__link span { color: var(--c-flame-ink); font-size: 0.9rem; font-weight: 700; }
.post-nav__link--prev { grid-column: 2; text-align: right; }

/* ---------- Sisältö ---------- */

.entry-content > :first-child { margin-top: 0; }
.entry-content h2 { font-size: 1.8rem; }
.entry-content h3 { font-size: 1.45rem; }
.entry-content h4 { font-size: 1.2rem; }
.entry-content h5, .entry-content h6 { font-size: 1.05rem; }

.entry-content figure { margin: 1.75rem 0; }
.entry-content .wp-block-image img { border-radius: var(--radius-sm); }
.entry-content figcaption { margin-top: 0.5rem; color: var(--c-muted); font-size: 0.95rem; text-align: center; }
.entry-content .aligncenter { margin-inline: auto; }
.entry-content .alignwide { width: min(100vw - 2 * var(--gutter), var(--wrap)); margin-inline: calc(50% - min(50vw - var(--gutter), var(--wrap) / 2)); }
.entry-content .alignfull { width: 100vw; margin-inline: calc(50% - 50vw); }

.entry-content .wp-block-gallery { gap: 1rem; }

.entry-content blockquote {
	margin: 2rem 0;
	padding: 0.25rem 0 0.25rem 1.25rem;
	border-left: 4px solid var(--c-flame);
	font: italic 1.25rem/1.5 var(--f-display);
}

.entry-content hr,
.wp-block-separator {
	margin: 2.5rem auto;
	border: 0;
	border-top: 1px solid var(--c-line);
}

.entry-content table { width: 100%; border-collapse: collapse; font-size: 1rem; }
.entry-content th,
.entry-content td { padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--c-line); text-align: left; vertical-align: top; }

/* Wordista liitetty teksti päätyy usein Esimuotoiltu-lohkoon: näytetään leipätekstinä. */
.entry-content pre,
.wp-block-preformatted {
	font: inherit;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	background: none;
	padding: 0;
	margin: 0 0 1.5rem;
}
.entry-content code { font-size: 0.9em; }

.wp-block-embed { margin: 2rem 0; }
.wp-block-embed iframe { border-radius: var(--radius-sm); }
.entry-content iframe[src*="google.com/maps"] { width: 100%; border-radius: var(--radius); }

.wp-block-button__link { border-radius: 999px; background: var(--c-flame); font-weight: 700; }

/* ---------- Ohjelma ---------- */

.ohjelma__month {
	margin: -0.5rem 0 1.5rem;
	font: 600 1.3rem var(--f-display);
	color: var(--c-flame-ink);
}

.ohjelma__intro,
.ohjelma__outro {
	margin-bottom: 2rem;
	padding: 1.1rem 1.35rem;
	border-radius: var(--radius);
	background: var(--c-soft);
	font-size: 1rem;
}
.ohjelma__intro p,
.ohjelma__outro p { margin: 0.35rem 0; }
.ohjelma__outro { margin: 2rem 0 0; text-align: center; background: var(--c-deep); color: #fff; }
.ohjelma__outro p { font: 600 1.15rem var(--f-display); }
.ohjelma__outro p.is-welcome { margin: 0.25rem 0 0.75rem; font-size: 1.6rem; color: var(--c-peach); }
.ohjelma__outro p.is-welcome:last-child { margin-bottom: 0.25rem; }

.is-caps { letter-spacing: 0.02em; }

.week {
	margin-bottom: 1.25rem;
	border-radius: var(--radius);
	background: var(--c-surface);
	box-shadow: var(--shadow);
	overflow: hidden;
}
.week.is-current { outline: 2px solid var(--c-flame); }
.week__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem 0.75rem;
	padding: 1rem 1.35rem;
	cursor: pointer;
	list-style: none;
	border-bottom: 1px solid var(--c-line);
}
.week__head::-webkit-details-marker { display: none; }
.week__head::after {
	content: "";
	width: 0.6rem; height: 0.6rem;
	margin-left: auto;
	border-right: 2px solid var(--c-muted);
	border-bottom: 2px solid var(--c-muted);
	rotate: 45deg;
	translate: 0 -0.15rem;
	transition: rotate 0.15s;
	order: 3;
}
.week:not([open]) .week__head { border-bottom: 0; }
.week:not([open]) .week__head::after { rotate: -45deg; translate: 0 0; }
.week__label { font: 600 1.35rem var(--f-display); order: 1; }
.week__head .badge { order: 2; }
.week__meta { flex-basis: 100%; order: 4; color: var(--c-muted); font-size: 0.95rem; }
.week.is-past .week__label { color: var(--c-muted); }

.week__notes { padding: 0.75rem 1.35rem; background: var(--c-flame-soft); font-size: 1rem; }
.week__notes p { margin: 0.2rem 0; }

.days { list-style: none; margin: 0; padding: 0; }
.day {
	display: grid;
	grid-template-columns: 5.5rem 1fr;
	gap: 1rem;
	padding: 0.85rem 1.35rem;
	border-top: 1px solid var(--c-line);
}
.day:first-child { border-top: 0; }
.day__date { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; }
.day__wd { font: 600 1.15rem var(--f-display); }
.day__date time { color: var(--c-muted); font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.day__date .badge { margin-top: 0.35rem; }
.day .event { grid-template-columns: 5.6rem 1fr; }

.day--su { background: linear-gradient(90deg, var(--c-flame-soft), transparent 70%); }
.day--su .day__wd { color: var(--c-flame-ink); }
.day.is-past { opacity: 0.5; }
.day.is-today { background: var(--c-flame-soft); box-shadow: inset 4px 0 0 var(--c-flame); }

.ohjelma-raw pre { font-size: 1.05rem; }

.ohjelma__extra { margin-bottom: 2rem; }
.ohjelma__download { margin: 1.25rem 0 0; text-align: center; font-weight: 700; }
.ohjelma__download + .ohjelma,
.ohjelma + .ohjelma { margin-top: 3.5rem; padding-top: 2.5rem; border-top: 1px solid var(--c-line); }

@media (max-width: 560px) {
	.day { grid-template-columns: 1fr; gap: 0.35rem; }
	.day__date { flex-direction: row; align-items: baseline; gap: 0.5rem; }
	.day__date .badge { margin: 0; }
	.event,
	.day .event { grid-template-columns: 4.9rem 1fr; gap: 0.5rem; }
}

/* ---------- Alaosa ---------- */

.site-footer {
	padding: clamp(2.5rem, 6vw, 4rem) 0 1.5rem;
	background: var(--c-deep-2);
	color: rgb(255 255 255 / 80%);
	font-size: 1rem;
}
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--c-peach); }
.site-footer__grid {
	display: grid;
	grid-template-columns: 1.4fr repeat(3, 1fr);
	gap: 2rem;
}
.site-footer__brand p { max-width: 22rem; margin: 1rem 0 0; }
.site-footer__title {
	margin: 0 0 0.9rem;
	font: 700 0.8rem var(--f-body);
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--c-peach);
}
.contact-list { list-style: none; margin: 0; padding: 0; }
.contact-list li { display: flex; gap: 0.6rem; margin-bottom: 0.65rem; line-height: 1.45; }
.contact-list .icon { margin-top: 0.1rem; opacity: 0.7; }
.contact-list a { text-decoration: none; }
.footer-menu { list-style: none; margin: 1rem 0 0; padding: 0; }
.footer-menu li { margin-bottom: 0.4rem; }
.site-footer__bottom {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0.5rem 1.5rem;
	margin-top: 2.5rem;
	padding-top: 1.25rem;
	border-top: 1px solid rgb(255 255 255 / 12%);
	font-size: 0.9rem;
	color: rgb(255 255 255 / 60%);
}

@media (max-width: 900px) {
	.site-footer__grid { grid-template-columns: 1fr 1fr; }
	.site-footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
	.site-footer__grid { grid-template-columns: 1fr; }
}

/* ---------- Kuvan suurennos ---------- */

.lightbox {
	width: 100vw;
	max-width: none;
	height: 100dvh;
	max-height: none;
	margin: 0;
	padding: clamp(0.75rem, 3vw, 2rem);
	border: 0;
	background: rgb(12 16 26 / 94%);
	color: #fff;
}
.lightbox::backdrop { background: transparent; }
.lightbox[open] { display: grid; place-items: center; }
.lightbox__figure {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.9rem;
	max-height: 100%;
	margin: 0;
}
.lightbox__img {
	max-width: min(100%, 1100px);
	max-height: calc(100dvh - 7rem);
	width: auto;
	object-fit: contain;
	border-radius: var(--radius-sm);
	box-shadow: 0 30px 80px rgb(0 0 0 / 50%);
}
.lightbox__caption { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; align-items: center; justify-content: center; }
.lightbox__title { font: 600 1.15rem var(--f-display); }
.lightbox__more {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.45rem 1rem;
	border-radius: 999px;
	background: var(--c-flame);
	color: #fff;
	font-weight: 700;
	text-decoration: none;
}
.lightbox__more:hover { background: var(--c-flame-ink); color: #fff; }
.lightbox__more[hidden] { display: none; }
.lightbox__close {
	position: fixed;
	top: 1rem;
	right: 1rem;
	display: grid;
	place-items: center;
	width: 3rem;
	height: 3rem;
	border: 0;
	border-radius: 50%;
	background: rgb(255 255 255 / 14%);
	color: #fff;
	cursor: pointer;
}
.lightbox__close:hover { background: rgb(255 255 255 / 26%); }
.lightbox__close .icon { width: 1.5rem; height: 1.5rem; }

/* ---------- Haku ---------- */

.search-form { display: flex; gap: 0.5rem; max-width: 28rem; }
.search-field {
	flex: 1;
	padding: 0.7rem 1rem;
	border: 1px solid var(--c-line);
	border-radius: 999px;
	font: inherit;
}
.search-submit {
	padding: 0.7rem 1.2rem;
	border: 0;
	border-radius: 999px;
	background: var(--c-deep);
	color: #fff;
	font: 700 1rem var(--f-body);
	cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { transition: none !important; }
}

@media print {
	.site-header, .site-footer, .hero__actions, .post-nav { display: none; }
	body { background: #fff; font-size: 11pt; }
	.week { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
	.week:not([open]) > :not(summary) { display: block; }
	.day.is-past { opacity: 1; }
}
