/*
Theme Name: Kaader
Description: Custom bilingual (Estonian / English) theme for a portrait, wedding and concert photographer. Built for Polylang and Portfolio Filter Gallery. No page builder, no jQuery, one small script.
Version: 1.0.0
Requires at least: 6.3
Requires PHP: 7.4
Text Domain: kaader
*/

/* ---------- Tokens ---------- */
:root {
	--fog: #E4E8E5;
	--paper: #F3F5F2;
	--spruce: #14221E;
	--moss: #46564F;
	--amber: #F0A91B;
	--line: rgba(20, 34, 30, .18);
	--max: 78rem;
	--gut: clamp(1.25rem, 4vw, 3rem);
	--header-h: 4.25rem;
	--font: "Archivo", "Helvetica Neue", Arial, system-ui, sans-serif;
	--ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--fog);
	color: var(--spruce);
	font-family: var(--font);
	font-size: 1.0625rem;
	font-weight: 400;
	font-stretch: 100%;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration-color: var(--amber); text-decoration-thickness: .14em; text-underline-offset: .2em; }
a:hover { text-decoration-thickness: .22em; }
:focus-visible { outline: 3px solid var(--spruce); outline-offset: 3px; }
.on-dark :focus-visible { outline-color: var(--amber); }

h1, h2, h3, h4 {
	margin: 0 0 .6em;
	font-weight: 800;
	font-stretch: 110%;
	line-height: 1.06;
	letter-spacing: -.02em;
	text-wrap: balance;
	hyphens: auto;
	overflow-wrap: break-word;
}
h1 { font-size: clamp(1.75rem, .9rem + 3.8vw, 3.6rem); }
h2 { font-size: clamp(1.35rem, 1rem + 1.2vw, 2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1.1em; }

.skip { position: absolute; left: -9999px; top: 0; z-index: 100; padding: .75rem 1rem; background: var(--spruce); color: var(--paper); }
.skip:focus { left: 0; }

.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gut); }
.section { padding-block: clamp(3rem, 7vw, 6rem); }
.lead { color: var(--moss); font-size: 1.15rem; max-width: 46ch; }

.btn {
	display: inline-block;
	padding: .9em 1.7em;
	background: var(--amber);
	color: var(--spruce);
	font-weight: 700;
	text-decoration: none;
	border: 0;
	border-radius: 2px;
	cursor: pointer;
	font: inherit;
	font-weight: 700;
	transition: background-color .2s;
}
.btn:hover { background: #fff; }

/* ---------- Header ---------- */
.site-header {
	position: sticky; top: 0; z-index: 50;
	display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
	height: var(--header-h);
	padding-inline: max(var(--gut), calc((100% - var(--max)) / 2 + var(--gut)));
	background: var(--fog);
	border-bottom: 1px solid var(--line);
}
.brand { font-size: 1.15rem; font-weight: 800; font-stretch: 118%; letter-spacing: -.01em; text-decoration: none; }
.brand-logo { display: flex; align-items: center; }
.brand-logo img { height: 2.5rem; width: auto; max-width: 60vw; object-fit: contain; }
.site-nav { display: flex; align-items: center; gap: 2rem; }
.site-nav .menu { display: flex; gap: 1.75rem; margin: 0; padding: 0; list-style: none; }
.site-nav .menu a { font-weight: 500; text-decoration: none; }
.site-nav .menu a:hover,
.site-nav .menu .current-menu-item > a,
.site-nav .menu .current_page_item > a { text-decoration: underline; text-decoration-color: var(--amber); text-decoration-thickness: .18em; text-underline-offset: .35em; }
.lang { display: flex; gap: .25rem; margin: 0; padding: 0; list-style: none; font-size: .9rem; font-weight: 600; }
.lang a { display: block; padding: .3rem .6rem; border-radius: 2px; text-decoration: none; }
.lang a[aria-current] { background: var(--spruce); color: var(--paper); }
.nav-toggle { display: none; }

@media (max-width: 55.99rem) {
	.nav-toggle { display: block; padding: .5rem .9rem; font: inherit; font-weight: 600; color: inherit; background: none; border: 1px solid var(--spruce); border-radius: 2px; cursor: pointer; }
	.site-nav {
		display: none;
		position: absolute; top: var(--header-h); left: 0; right: 0;
		flex-direction: column; align-items: flex-start; gap: 1.5rem;
		padding: 1.5rem var(--gut) 2rem;
		background: var(--fog);
		border-bottom: 1px solid var(--line);
	}
	.site-nav.is-open { display: flex; }
	.site-nav .menu { flex-direction: column; gap: 1rem; font-size: 1.25rem; }
}

/* ---------- Home: hero ---------- */
.hero-text {
	display: grid; gap: 1.25rem 3rem;
	padding-block: clamp(2rem, 5vw, 4rem) clamp(1.5rem, 3vw, 2.5rem);
}
.hero-text h1 { margin: 0; }
.hero-text .lead { margin: 0; }
@media (min-width: 56rem) {
	.hero-text { grid-template-columns: 1fr minmax(16rem, 23rem); align-items: end; }
}

.triptych { display: flex; height: clamp(24rem, 58svh, 44rem); background: var(--spruce); }
.panel {
	position: relative; isolation: isolate;
	display: flex; align-items: flex-end;
	flex: 1 1 0; min-width: 0; overflow: hidden;
	padding: 1.5rem 1.25rem;
	color: #fff; text-decoration: none;
	transition: flex-grow .6s var(--ease);
}
.panel::after {
	content: ""; position: absolute; inset: 0; z-index: -1;
	background: linear-gradient(to top, rgba(8, 16, 13, .74), rgba(8, 16, 13, 0) 58%);
}
.panel-img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
/* Placeholder tones, shown until a photo is chosen in the Customizer */
.panel-portrait { background: linear-gradient(160deg, #B7C2BB, #8A9890); }
.panel-wedding { background: linear-gradient(160deg, #D5D6CC, #A9AE9F); }
.panel-concert { background: radial-gradient(circle at 70% 20%, rgba(240, 169, 27, .55), transparent 45%), linear-gradient(170deg, #1E302A, #0F1A17 75%); }
.panel-hint { position: absolute; top: 1rem; left: 1.25rem; right: 1.25rem; font-size: .85rem; opacity: .85; }
.panel-text { display: block; }
.panel-title { display: block; margin-bottom: .4rem; font-size: clamp(1.5rem, .8rem + 2vw, 2.6rem); font-weight: 800; font-stretch: 112%; line-height: 1; letter-spacing: -.02em; }
.panel-blurb { display: block; max-width: 30ch; font-size: .98rem; line-height: 1.45; }
.panel:focus-visible { outline: 3px solid #fff; outline-offset: -6px; }

@media (min-width: 56rem) { .panel + .panel { margin-left: -1px; } }
@media (hover: hover) and (min-width: 64rem) {
	.triptych:hover .panel, .triptych:focus-within .panel { flex-grow: 1; }
	.triptych .panel:hover, .triptych .panel:focus-visible { flex-grow: 1.7; }
}
@media (max-width: 55.99rem) {
	.triptych { flex-direction: column; height: auto; }
	.panel { flex: none; min-height: 15rem; }
	.panel + .panel { margin-top: -1px; }
}
@media (prefers-reduced-motion: no-preference) {
	.panel { animation: expose .9s var(--ease) backwards; animation-delay: calc(var(--i, 0) * .12s); }
	@keyframes expose { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0); } }
	/* The dark backing that hides sub-pixel seams only switches on after the reveal has finished,
	   so the photos slide in over the normal page background. */
	.triptych { background-color: transparent; animation: seal 0s linear 1.3s forwards; }
	@keyframes seal { to { background-color: var(--spruce); } }
}
@media (prefers-reduced-motion: reduce) { .panel { transition: none; } }

/* ---------- Home: services text + about ---------- */
.services-grid { display: grid; gap: 2.5rem 3rem; }
@media (min-width: 56rem) { .services-grid { grid-template-columns: repeat(3, 1fr); } }
.services-grid p { color: var(--moss); max-width: 42ch; }
.services-grid a { font-weight: 600; }

.about { background: var(--paper); }
.about-grid { display: grid; gap: 2rem 4rem; align-items: center; }
@media (min-width: 56rem) { .about-grid.has-image { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); } }
.about-img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }

/* ---------- CTA + footer ---------- */
.on-dark { background: var(--spruce); color: var(--paper); }
.cta { padding-block: clamp(3.5rem, 8vw, 7rem); }
.cta h2 { font-size: clamp(1.75rem, 1rem + 3.4vw, 3.4rem); max-width: 20ch; }
.cta p { max-width: 44ch; color: #C9D3CD; }

.site-footer { padding-block: 3rem 2rem; border-top: 1px solid rgba(243, 245, 242, .14); font-size: .95rem; }
.footer-grid { display: grid; gap: 2rem 3rem; }
@media (min-width: 48rem) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.footer-brand { font-size: 1.15rem; font-weight: 800; font-stretch: 118%; margin-bottom: .75rem; }
.site-footer address { font-style: normal; }
.site-footer ul { margin: 0; padding: 0; list-style: none; }
.site-footer li { margin-bottom: .4rem; }
.site-footer .lang { margin-top: 1.25rem; }
.site-footer .lang a[aria-current] { background: var(--paper); color: var(--spruce); }
.footer-legal { margin-top: 2.5rem; color: #AEBBB4; font-size: .85rem; }

/* ---------- Inner pages ---------- */
.page-head { padding-block: clamp(2.5rem, 6vw, 5rem) 1.5rem; }
.page-head h1 { margin-bottom: .4em; max-width: 22ch; }
.page-head .meta { color: var(--moss); margin: 0; }
.entry { padding-bottom: clamp(3rem, 7vw, 6rem); }
.entry > :where(p, h2, h3, h4, ul, ol, blockquote) { max-width: 68ch; }
.entry > :where(h2, h3) { margin-top: 1.8em; }
.entry :where(ul, ol) { padding-left: 1.25em; }
.entry .alignwide { max-width: var(--max); }
.hero-img { width: 100%; max-height: 36rem; object-fit: cover; margin-bottom: 2rem; }

.posts { display: grid; gap: 2.5rem; max-width: 46rem; }
.post-item h2 { margin-bottom: .25em; }
.post-item h2 a { text-decoration: none; }
.post-item h2 a:hover { text-decoration: underline; text-decoration-color: var(--amber); }
.pagination { margin-top: 3rem; }
.pagination .page-numbers { display: inline-block; padding: .4rem .8rem; }
.pagination .current { background: var(--spruce); color: var(--paper); }

/* ---------- Contact ---------- */
.contact-grid { display: grid; gap: 3rem; padding-bottom: clamp(3rem, 7vw, 6rem); }
@media (min-width: 56rem) { .contact-grid { grid-template-columns: minmax(14rem, 1fr) minmax(0, 1.7fr); } }
.contact-details { font-style: normal; }
.contact-details dt { margin-top: 1.25rem; font-weight: 700; }
.contact-details dd { margin: 0; }
.form { display: grid; gap: 1.25rem; }
.field label { display: block; margin-bottom: .35rem; font-weight: 600; }
.field input, .field select, .field textarea {
	width: 100%; padding: .8rem .9rem;
	font: inherit; color: inherit;
	background: var(--paper);
	border: 1px solid var(--spruce); border-radius: 2px;
}
.field textarea { min-height: 9rem; resize: vertical; }
.field-row { display: grid; gap: 1.25rem; }
@media (min-width: 40rem) { .field-row { grid-template-columns: 1fr 1fr; } }
.form-note { margin: 0; color: var(--moss); font-size: .9rem; }
.hp { position: absolute; left: -9999px; }
.notice { margin-bottom: 2rem; padding: 1rem 1.25rem; background: var(--paper); border-left: 4px solid var(--spruce); }
.notice-ok { border-left-color: var(--amber); }

/* ---------- Pricing packages (block pattern) ---------- */
.packages { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); margin-block: 2rem; }
.packages > .package { margin: 0; }
.package { display: flex; flex-direction: column; padding: 1.75rem; background: var(--paper); border-top: 4px solid var(--spruce); }
.package > * { margin-block: 0; }
.package h3 { margin-bottom: .25rem; }
.package .price { margin-bottom: 1rem; font-size: 1.9rem; font-weight: 800; font-stretch: 110%; letter-spacing: -.02em; line-height: 1.1; }
.package p { margin-bottom: 1rem; }
.package ul { margin-bottom: 1.5rem; padding: 0; list-style: none; }
.package li { padding: .55rem 0; border-top: 1px solid var(--line); }
.package .wp-block-buttons { margin-top: auto; }
.wp-block-button__link {
	display: inline-block; padding: .9em 1.7em;
	background: var(--amber); color: var(--spruce);
	font-weight: 700; text-decoration: none; border-radius: 2px;
	transition: background-color .2s, color .2s;
}
.wp-block-button__link:hover { background: var(--spruce); color: var(--paper); }
.price-note { color: var(--moss); font-size: .95rem; }

/* ---------- Small overrides (kept last on purpose) ---------- */
.entry > :first-child { margin-top: 0; }
.about .entry { padding-bottom: 0; }
.contact-grid .entry { padding-bottom: 0; margin-top: 2.5rem; }
