/*
Theme Name: Andi
Theme URI: https://wp.andi.ee
Author: Andi
Description: Custom Andi theme. Köögimööbel otse tootjalt.
Version: 0.1.0
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: andi
*/

/* Base reset — carried over from the mockup's inline <helmet> styles so the
   inline-styled layouts render as designed. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
	font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
	background: #fff;
	color: oklch(9% 0.008 45);
	overflow-x: hidden;
}
img { max-width: 100%; }

/* Hero scroll indicator animation (was in the mockup helmet). */
@keyframes andiScrollPulse {
	0%   { opacity: 0; transform: scaleY(0); transform-origin: top; }
	40%  { opacity: 1; transform: scaleY(1); transform-origin: top; }
	80%  { opacity: 0; transform: scaleY(1); transform-origin: bottom; }
	100% { opacity: 0; }
}

/* The navbar is position:fixed (68px tall). Offset the fallback content area
   so it — and the footer — are not hidden underneath it. Full-bleed page
   templates (e.g. the home hero) opt out with their own top spacing. */
.site-main {
	padding-top: 68px;
	min-height: calc(100vh - 68px);
}

/* Primary nav (header "Main" menu) — matches the mockup's inline-styled links,
   with an active-page highlight the hardcoded version lacked. */
.andi-nav__menu {
	list-style: none;
	margin: 0 auto;
	padding: 0;
	display: flex;
	gap: 44px;
}
.andi-nav__menu li {
	margin: 0;
}
.andi-nav__menu a {
	font-size: 12px;
	font-weight: 400;
	letter-spacing: 0.06em;
	text-decoration: none;
	color: oklch(9% 0.008 45);
	opacity: 0.5;
	transition: opacity 0.2s ease;
}
.andi-nav__menu a:hover,
.andi-nav__menu .current-menu-item > a,
.andi-nav__menu .current_page_item > a,
.andi-nav__menu .current-menu-ancestor > a {
	opacity: 1;
}

/* Footer nav (same "Main" menu, muted footer styling). */
.andi-foot__menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: 36px;
	justify-content: center;
}
.andi-foot__menu li {
	margin: 0;
}
.andi-foot__menu a {
	font-size: 11px;
	letter-spacing: 0.05em;
	text-decoration: none;
	color: oklch(60% 0.008 45);
	transition: color 0.15s;
}
.andi-foot__menu a:hover,
.andi-foot__menu .current-menu-item > a,
.andi-foot__menu .current_page_item > a {
	color: oklch(9% 0.008 45);
}

/* Hamburger toggle — hidden on desktop, shown on mobile via the query below. */
.andi-nav__toggle {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
}
.andi-nav__toggle span {
	display: block;
	width: 22px;
	height: 2px;
	margin: 0 auto;
	background: oklch(9% 0.008 45);
	transition: transform 0.25s ease, opacity 0.2s ease;
}

/* ---- Mobile: header & footer ---- */
@media (max-width: 860px) {
	#site-nav {
		padding-left: 20px !important;
		padding-right: 20px !important;
	}
	.andi-nav__toggle {
		display: flex;
	}
	/* Turn the horizontal menu into a dropdown panel below the fixed bar. */
	.andi-nav__menu {
		position: absolute;
		top: 68px;
		left: 0;
		right: 0;
		flex-direction: column;
		gap: 0;
		margin: 0;
		padding: 4px 20px 12px;
		background: rgba(255, 255, 255, 0.98);
		backdrop-filter: blur(8px);
		border-bottom: 1px solid oklch(93% 0.004 55);
		box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
		display: none;
	}
	#site-nav.is-open .andi-nav__menu {
		display: flex;
	}
	.andi-nav__menu li {
		border-bottom: 1px solid oklch(95% 0.004 55);
	}
	.andi-nav__menu li:last-child {
		border-bottom: 0;
	}
	.andi-nav__menu a {
		display: block;
		opacity: 1;
		font-size: 15px;
		letter-spacing: 0.04em;
		padding: 14px 2px;
	}
	/* Animate hamburger into a close (X). */
	#site-nav.is-open .andi-nav__toggle span:nth-child(1) {
		transform: translateY(7px) rotate(45deg);
	}
	#site-nav.is-open .andi-nav__toggle span:nth-child(2) {
		opacity: 0;
	}
	#site-nav.is-open .andi-nav__toggle span:nth-child(3) {
		transform: translateY(-7px) rotate(-45deg);
	}

	/* Footer: stack into one centered column. */
	.andi-foot {
		grid-template-columns: 1fr !important;
		justify-items: center;
		text-align: center;
		gap: 22px !important;
		padding: 32px 24px !important;
	}
	.andi-foot__menu {
		flex-wrap: wrap;
		gap: 14px 26px;
	}
}

@media (max-width: 420px) {
	.andi-nav__cta {
		padding: 9px 14px !important;
		font-size: 10px !important;
	}
}

/* ---- Mobile: front page blocks ---- */
@media (max-width: 900px) {
	/* Editorial intro: stack, and give the image a real height (was min-height:0). */
	.andi-editorial {
		grid-template-columns: 1fr !important;
	}
	.andi-editorial__text {
		padding: 72px 24px !important;
		border-right: 0 !important;
		border-bottom: 1px solid oklch(93% 0.004 55);
	}
	.andi-editorial__media {
		min-height: 60vw !important;
	}

	/* Stats: 4 → 2 columns. */
	.andi-stats {
		grid-template-columns: repeat(2, 1fr) !important;
	}
	.andi-stats > div {
		padding: 44px 18px !important;
	}

	/* Production caption padding. */
	.andi-prod__caption {
		padding: 36px 24px !important;
	}

	/* Portfolio: 3 → 2 columns, tighter side padding, wrapping header. */
	.andi-portfolio {
		padding: 48px 24px 64px !important;
	}
	.andi-portfolio__head {
		flex-wrap: wrap;
		gap: 14px;
	}
	.andi-portfolio__grid {
		grid-template-columns: repeat(2, 1fr) !important;
	}

	/* CTA/contact: stack columns. */
	.andi-cta {
		grid-template-columns: 1fr !important;
	}
	.andi-cta__text {
		padding: 64px 24px !important;
		border-right: 0 !important;
	}
	.andi-cta__media {
		min-height: 320px !important;
	}
}

@media (max-width: 560px) {
	/* Hero: pull insets in and let the headline shrink. */
	.andi-hero__tag {
		top: 90px !important;
		left: 24px !important;
	}
	.andi-hero__headline {
		left: 24px !important;
		right: 24px !important;
		bottom: 56px !important;
		max-width: none !important;
	}
	.andi-hero__headline h1 {
		font-size: clamp(2.9rem, 15vw, 4rem) !important;
	}
	.andi-hero__est {
		top: 90px !important;
		bottom: auto !important;
		right: 24px !important;
	}

	/* Portfolio: single column on the narrowest screens; big tile no longer spans 2. */
	.andi-portfolio__grid {
		grid-template-columns: 1fr !important;
	}
	.andi-portfolio__grid > a {
		grid-column: auto !important;
	}
}

/* ---- Mobile: Firmast (about) page ---- */
@media (max-width: 900px) {
	/* Header: reduce insets, stack title and the "2002" badge. */
	.andi-about-head {
		padding: 116px 24px 0 !important;
	}
	.andi-about-head__top {
		flex-direction: column !important;
		align-items: flex-start !important;
		gap: 28px !important;
	}
	.andi-about-head__est {
		text-align: left !important;
	}
	.andi-about-head__stats {
		gap: 40px !important;
		flex-wrap: wrap;
	}

	/* Story: single column, tighter padding. */
	.andi-about-story {
		padding: 64px 24px !important;
	}
	.andi-about-story__cols {
		grid-template-columns: 1fr !important;
		gap: 28px !important;
	}

	/* Manufacturing: stack photo over text, give the photo real height. */
	.andi-about-mfg {
		grid-template-columns: 1fr !important;
		min-height: 0 !important;
	}
	.andi-about-mfg__media {
		min-height: 62vw !important;
	}
	.andi-about-mfg__text {
		padding: 56px 24px !important;
		border-left: 0 !important;
	}

	/* Quote overlay: pull side padding in. */
	.andi-about-quote__inner {
		padding: 40px 24px !important;
	}

	/* Video section padding. */
	.andi-about-video {
		padding: 64px 24px !important;
	}

	/* Values: 3 → 1 column; drop the inner side borders. */
	.andi-about-values {
		grid-template-columns: 1fr !important;
		min-height: 0 !important;
	}
	.andi-about-values__card {
		min-height: 72vw !important;
		border-left: 0 !important;
		border-right: 0 !important;
		border-bottom: 1px solid oklch(93% 0.004 55);
	}

	/* Promise + team: stack, drop the divider, shrink the team placeholder. */
	.andi-about-promise {
		grid-template-columns: 1fr !important;
	}
	.andi-about-promise__text {
		padding: 56px 24px !important;
		border-right: 0 !important;
	}
	.andi-about-promise__team {
		min-height: 300px !important;
	}

	/* Awards padding. */
	.andi-about-awards {
		padding: 64px 24px !important;
	}

	/* CTA: stack columns, tighten gap and padding. */
	.andi-about-cta {
		grid-template-columns: 1fr !important;
		gap: 40px !important;
		padding: 64px 24px !important;
	}
}

@media (max-width: 560px) {
	/* Film strip: shorter on the narrowest screens. */
	.andi-about-strip {
		height: 200px !important;
	}
	/* Stats: 3 across gets cramped — 2 columns. */
	.andi-about-head__stats {
		gap: 28px 40px !important;
	}
	.andi-about-head__stats > div {
		flex: 0 0 40%;
	}
}

/* ---- Mobile: Materjalid (catalog) page ---- */
@media (max-width: 900px) {
	/* Header: reduce insets, stack title and the "100+" badge. */
	.andi-cat-head {
		padding: 116px 24px 56px !important;
		flex-direction: column !important;
		align-items: flex-start !important;
		gap: 28px !important;
	}
	.andi-cat-head__count {
		text-align: left !important;
	}

	/* Section padding. */
	.andi-cat-intro,
	.andi-cat-worktops,
	.andi-cat-fronts {
		padding: 56px 24px !important;
	}

	/* Swatch grids: down to 3 columns. */
	.andi-cat-swatches {
		grid-template-columns: repeat(3, 1fr) !important;
	}

	/* In-context photo overlays: pull side padding in. */
	.andi-cat-photo__inner {
		padding: 0 24px !important;
	}

	/* CTA: stack columns, tighten gap and padding. */
	.andi-cat-cta {
		grid-template-columns: 1fr !important;
		gap: 40px !important;
		padding: 56px 24px !important;
	}
}

@media (max-width: 560px) {
	/* Swatch grids: 2 columns on the narrowest screens. */
	.andi-cat-swatches {
		grid-template-columns: repeat(2, 1fr) !important;
	}
}

/* ---- Mobile: Tehtud tööd (works grid) page ---- */
/* The works grid itself is responsive via the plugin (782px / 480px);
   here we only adapt the page chrome. */
@media (max-width: 900px) {
	/* Header: reduce insets, stack title and the project-count badge. */
	.andi-works-head {
		padding: 116px 24px 56px !important;
		flex-direction: column !important;
		align-items: flex-start !important;
		gap: 24px !important;
	}
	.andi-works-head__count {
		text-align: left !important;
	}
	/* Filter bar + grid: pull side padding in. */
	.andi-works-filterbar {
		padding: 14px 24px !important;
	}
	.andi-works-main {
		padding: 28px 24px 88px !important;
	}
}

