/*
Theme Name: The Linden
Description: One-page site for an apartment building: hero, building overview, gallery, available residences and a viewing request form.
Version: 1.11.0
Author: David Hayes
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: linden-house
*/

:root {
	--paper: #f6f7f5;
	--white: #ffffff;
	/* Near-black for text, footer and photo overlays, tinted by the primary color. */
	--ink: color-mix(in srgb, var(--spruce) 30%, #121212);
	/* --spruce is the Customizer's Primary color; the shades below follow it. */
	--spruce: #2f4a43;
	--spruce-dark: color-mix(in srgb, var(--spruce) 78%, #000);
	--leaf: color-mix(in srgb, var(--spruce) 45%, #fff);
	/* Borders and secondary text, tinted by the primary color. */
	--stone: color-mix(in srgb, var(--spruce) 8%, #ebebeb);
	--field-border: color-mix(in srgb, var(--spruce) 12%, #d8d8d8);
	--slate: color-mix(in srgb, var(--spruce) 25%, #6a6a6a);

	--font: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
	--font-serif: "Source Serif 4", Georgia, serif;
	--font-script: "Pinyon Script", "Snell Roundhand", cursive;
	--wrap: 76rem;
	--gutter: clamp(1rem, 4vw, 2.5rem);
	--section: clamp(4.5rem, 10vw, 8.5rem);
	/* --logo-h is set inline when a logo is uploaded; the header grows to fit it. */
	--header-h: max(4.5rem, calc(var(--logo-h, 0px) + 1.75rem));
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + var(--wpbar, 0px)); }

/* Logged-in users: the header sits below the WordPress admin bar instead of under it. */
:root:has(body.admin-bar) { --wpbar: 32px; }
@media (max-width: 782px) {
	:root:has(body.admin-bar) { --wpbar: 46px; }
}
@media (max-width: 600px) {
	/* WordPress lets the bar scroll away on phones; keep it fixed so the header never slides under it. */
	body.admin-bar #wpadminbar { position: fixed; }
}

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--font);
	font-size: 1.0625rem;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

a { color: var(--spruce); text-underline-offset: 0.2em; }
a:hover { color: var(--ink); }

h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }

/* Fonts picked in Customizer > Building page > Fonts (body classes from lh_font_classes()). */
.lh-heading-serif h1,
.lh-heading-serif h2,
.lh-heading-serif h3 { font-family: var(--font-serif); letter-spacing: -0.01em; }
.lh-heading-serif .lh-hero__title { letter-spacing: -0.02em; }
.lh-name-serif .lh-logo__text { font-family: var(--font-serif); letter-spacing: -0.01em; }
.lh-name-script .lh-logo__text { font-family: var(--font-script); font-weight: 400; letter-spacing: 0; line-height: 1.2; }
.lh-name-script .lh-logo .lh-logo__text { font-size: 2.6rem; }
.lh-name-script .lh-footer__name .lh-logo__text { font-size: 3rem; }
h2 { font-size: clamp(2rem, 4.2vw, 3.25rem); }
p { margin: 0 0 1em; }

:focus-visible { outline: 2px solid var(--spruce); outline-offset: 3px; }

.lh-wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

.screen-reader-text,
.lh-hp {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.lh-skip {
	position: absolute; left: 1rem; top: -4rem; z-index: 100;
	padding: 0.6rem 1rem; background: var(--ink); color: var(--white);
}
.lh-skip:focus { top: 1rem; }

/* Buttons */
.lh-btn {
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 3rem; padding: 0.75rem 1.5rem;
	border: 1px solid var(--spruce); border-radius: 999px;
	background: var(--spruce); color: var(--white);
	font: 500 1rem/1 var(--font); text-decoration: none; white-space: nowrap;
	cursor: pointer;
	transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.lh-btn:hover { background: var(--spruce-dark); border-color: var(--spruce-dark); color: var(--white); }
.lh-btn--light { background: var(--white); border-color: var(--white); color: var(--ink); }
.lh-btn--light:hover { background: var(--paper); border-color: var(--paper); color: var(--ink); }
.lh-btn--ghost { background: transparent; border-color: rgba(255, 255, 255, 0.7); color: var(--white); }
.lh-btn--ghost:hover { background: rgba(255, 255, 255, 0.12); border-color: var(--white); }
.lh-btn--block { width: 100%; }

/* Header: transparent over the hero, solid once scrolled */
.lh-header {
	position: sticky; top: var(--wpbar, 0px); z-index: 50;
	height: var(--header-h);
	background: rgba(246, 247, 245, 0.94);
	border-bottom: 1px solid var(--stone);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	transition: background-color 0.3s, border-color 0.3s, color 0.3s;
}
.lh-header.is-over-hero { position: fixed; left: 0; right: 0; }
.lh-header.is-over-hero:not(.is-scrolled) {
	background: transparent; border-bottom-color: transparent;
	-webkit-backdrop-filter: none; backdrop-filter: none;
	color: var(--white);
}
.lh-header__inner {
	display: flex; align-items: center; justify-content: space-between; gap: 2rem;
	height: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter);
}
.lh-logo { display: flex; align-items: center; color: inherit; font-size: 1.375rem; font-weight: 700; letter-spacing: -0.03em; text-decoration: none; }
.lh-logo:hover { color: inherit; }
.lh-logo img,
.lh-footer__logo:is(img) { display: block; height: var(--logo-h, 2.5rem); width: auto; max-width: 60vw; object-fit: contain; object-position: left center; }

/* Over the hero photo the "on dark" version shows; on the solid header the "on light" one does. */
.lh-logo .lh-logo__on-dark { display: none; }
.lh-header.is-over-hero:not(.is-scrolled):not(.is-menu-open) .lh-logo__on-dark { display: block; }
.lh-header.is-over-hero:not(.is-scrolled):not(.is-menu-open) .lh-logo__on-light { display: none; }

.lh-nav { display: flex; align-items: center; gap: 2rem; }
.lh-nav a:not(.lh-btn) { color: inherit; font-weight: 500; text-decoration: none; }
.lh-nav a:not(.lh-btn):hover { text-decoration: underline; }
.lh-btn--nav { min-height: 2.6rem; padding: 0.6rem 1.25rem; }
.lh-header.is-over-hero:not(.is-scrolled) .lh-btn--nav { background: var(--white); border-color: var(--white); color: var(--ink); }

.lh-menu-toggle { display: none; }

@media (max-width: 860px) {
	.lh-menu-toggle {
		display: grid; place-items: center;
		width: 2.75rem; height: 2.75rem; margin-right: -0.5rem;
		background: none; border: 0; color: inherit; cursor: pointer;
	}
	.lh-menu-toggle__bars,
	.lh-menu-toggle__bars::before,
	.lh-menu-toggle__bars::after {
		display: block; width: 1.4rem; height: 2px; background: currentColor;
		transition: transform 0.2s;
	}
	.lh-menu-toggle__bars { position: relative; }
	.lh-menu-toggle__bars::before,
	.lh-menu-toggle__bars::after { content: ""; position: absolute; left: 0; }
	.lh-menu-toggle__bars::before { top: -7px; }
	.lh-menu-toggle__bars::after { top: 7px; }
	.lh-menu-toggle[aria-expanded="true"] .lh-menu-toggle__bars { background: transparent; }
	.lh-menu-toggle[aria-expanded="true"] .lh-menu-toggle__bars::before { transform: translateY(7px) rotate(45deg); }
	.lh-menu-toggle[aria-expanded="true"] .lh-menu-toggle__bars::after { transform: translateY(-7px) rotate(-45deg); }

	.lh-nav {
		position: absolute; top: var(--header-h); left: 0; right: 0;
		flex-direction: column; align-items: stretch; gap: 0;
		padding: 0.5rem var(--gutter) 1.5rem;
		background: var(--paper); color: var(--ink);
		border-bottom: 1px solid var(--stone);
		display: none;
	}
	.lh-nav.is-open { display: flex; }
	.lh-nav a:not(.lh-btn) { padding: 0.9rem 0; border-bottom: 1px solid var(--stone); }
	.lh-btn--nav { margin-top: 1.25rem; min-height: 3rem; }
	.lh-header.is-over-hero:not(.is-scrolled) .lh-btn--nav { background: var(--spruce); border-color: var(--spruce); color: var(--white); }
	/* An open menu always gets the solid header */
	.lh-header.is-menu-open { background: var(--paper) !important; color: var(--ink) !important; border-bottom-color: var(--stone) !important; }
}

/* Hero */
.lh-hero {
	position: relative; isolation: isolate;
	display: flex; align-items: flex-end;
	min-height: 100svh;
	padding: calc(var(--header-h) + 3rem) 0 clamp(2.5rem, 6vw, 4.5rem);
	color: var(--white);
	background: var(--ink);
}
.lh-hero__img {
	position: absolute; inset: 0; z-index: -2;
	width: 100%; height: 100%; object-fit: cover; object-position: center 40%;
}
.lh-hero::before {
	content: ""; position: absolute; inset: 0; z-index: -1;
	background:
		linear-gradient(180deg, color-mix(in srgb, var(--ink) 45%, transparent) 0%, transparent 22%),
		linear-gradient(0deg, color-mix(in srgb, var(--ink) 82%, transparent) 0%, color-mix(in srgb, var(--ink) 35%, transparent) 45%, transparent 70%);
}
.lh-hero__title {
	font-size: clamp(2.9rem, 9vw, 8rem);
	font-weight: 600; line-height: 1; letter-spacing: -0.045em;
	max-width: 12ch;
}
/* Room below each line for descenders (g, j, y) inside the reveal's clip, without adding line spacing. */
.lh-line { display: block; overflow: hidden; padding-bottom: 0.2em; margin-bottom: -0.2em; }
.lh-line > span { display: block; animation: lh-rise 1s cubic-bezier(0.2, 0.7, 0.1, 1) both; }
.lh-line + .lh-line > span { animation-delay: 0.12s; }
@keyframes lh-rise { from { transform: translateY(105%); } to { transform: none; } }

.lh-hero__foot {
	display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.5rem 3rem;
	margin-top: clamp(1.5rem, 3vw, 2.5rem);
	animation: lh-fade 0.8s 0.5s both;
}
@keyframes lh-fade { from { opacity: 0; } to { opacity: 1; } }
.lh-hero__lede { max-width: 34rem; margin: 0; font-size: clamp(1.0625rem, 1.6vw, 1.25rem); line-height: 1.5; color: rgba(255, 255, 255, 0.9); }
.lh-hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* Sections */
.lh-section { padding-block: var(--section); }
.lh-section__head {
	display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.75rem 2rem;
	margin-bottom: clamp(2rem, 4vw, 3rem);
}
.lh-section__head p { margin: 0; color: var(--slate); }

/* About */
.lh-about__grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(2.5rem, 7vw, 7rem); align-items: start; }
.lh-about__text h2 { margin-bottom: 1.75rem; max-width: 14ch; }
.lh-about__text p { max-width: 36rem; color: var(--slate); }
.lh-about__text .lh-about__lede { font-size: clamp(1.2rem, 1.9vw, 1.45rem); line-height: 1.5; color: var(--ink); }

.lh-facts { margin: 0; border-top: 1px solid var(--ink); }
.lh-facts__row {
	display: grid; grid-template-columns: 7.5rem 1fr; gap: 1rem;
	padding: 1rem 0; border-bottom: 1px solid var(--stone);
}
.lh-facts dt { font-weight: 600; }
.lh-facts dd { margin: 0; color: var(--slate); }

/* Gallery */
.lh-gallery { background: var(--white); }
.lh-gallery__grid {
	display: grid; grid-template-columns: repeat(12, 1fr); grid-auto-rows: clamp(9rem, 15vw, 14rem);
	gap: clamp(0.5rem, 1vw, 0.875rem);
	margin: 0; padding: 0; list-style: none;
}
.lh-gallery__item:nth-child(1) { grid-column: span 7; grid-row: span 2; }
.lh-gallery__item:nth-child(2),
.lh-gallery__item:nth-child(3) { grid-column: span 5; }
.lh-gallery__item:nth-child(4),
.lh-gallery__item:nth-child(5),
.lh-gallery__item:nth-child(6) { grid-column: span 4; }
.lh-gallery__item:nth-child(7) { grid-column: span 5; grid-row: span 2; }
.lh-gallery__item:nth-child(8) { grid-column: span 7; grid-row: span 2; }

.lh-gallery__btn {
	display: block; width: 100%; height: 100%; padding: 0; border: 0;
	background: var(--stone); cursor: zoom-in; overflow: hidden;
}
.lh-gallery__btn img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease, opacity 0.3s; }
.lh-gallery__btn:hover img { transform: scale(1.03); }

@media (max-width: 760px) {
	.lh-gallery__grid { grid-template-columns: 1fr 1fr; grid-auto-rows: 10rem; }
	.lh-gallery__grid .lh-gallery__item { grid-column: span 1; grid-row: span 1; }
	.lh-gallery__grid .lh-gallery__item:nth-child(3n + 1) { grid-column: span 2; grid-row: span 2; }
}

/* Lightbox */
.lh-lightbox {
	width: 100%; max-width: none; height: 100%; max-height: none;
	margin: 0; padding: clamp(1rem, 4vw, 3rem);
	border: 0; background: color-mix(in srgb, var(--ink) 95%, transparent); color: var(--white);
}
.lh-lightbox[open] { display: grid; place-items: center; }
.lh-lightbox::backdrop { background: transparent; }
.lh-lightbox figure { margin: 0; display: grid; gap: 0.9rem; justify-items: center; }
.lh-lightbox img { max-width: min(92vw, 1400px); max-height: 80vh; width: auto; object-fit: contain; }
.lh-lightbox figcaption { color: rgba(255, 255, 255, 0.8); }
.lh-lightbox__btn {
	position: absolute; display: grid; place-items: center;
	width: 3rem; height: 3rem; border: 1px solid rgba(255, 255, 255, 0.4); border-radius: 50%;
	background: transparent; color: var(--white); font-size: 1.35rem; cursor: pointer;
}
.lh-lightbox__btn:hover { background: rgba(255, 255, 255, 0.12); }
.lh-lightbox__prev { left: clamp(0.5rem, 2vw, 1.5rem); top: 50%; translate: 0 -50%; }
.lh-lightbox__next { right: clamp(0.5rem, 2vw, 1.5rem); top: 50%; translate: 0 -50%; }
.lh-lightbox__close { right: clamp(0.5rem, 2vw, 1.5rem); top: clamp(0.5rem, 2vw, 1.5rem); }
@media (max-width: 760px) {
	.lh-lightbox__prev,
	.lh-lightbox__next { top: auto; bottom: 1rem; translate: none; }
}

/* Residences: a leasing sheet, one row per apartment */
.lh-units { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--ink); }
.lh-unit {
	display: grid; grid-template-columns: minmax(10rem, 17rem) 1fr auto; gap: clamp(1.25rem, 3vw, 2.5rem); align-items: center;
	padding: clamp(1.25rem, 2.5vw, 1.75rem) 0;
	border-bottom: 1px solid var(--stone);
}
.lh-unit__media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--stone); }
.lh-unit__media img { width: 100%; height: 100%; object-fit: cover; }
.lh-unit__name { font-size: clamp(1.4rem, 2.4vw, 1.85rem); }
.lh-unit__note { margin: 0.35rem 0 0.9rem; color: var(--slate); }
.lh-unit__specs { display: flex; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; font-weight: 500; }
.lh-unit__specs li + li { margin-left: 0.85rem; padding-left: 0.85rem; border-left: 1px solid var(--stone); }
.lh-unit__lease { display: grid; justify-items: end; gap: 0.35rem; text-align: right; }
.lh-unit__rent { margin: 0; font-size: clamp(1.5rem, 2.6vw, 2rem); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.lh-unit__rent span { font-size: 1rem; font-weight: 400; letter-spacing: 0; color: var(--slate); }
.lh-unit__when { display: inline-flex; align-items: center; gap: 0.5rem; margin: 0 0 0.6rem; color: var(--slate); }
.lh-unit__when::before { content: ""; width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--leaf); }

/* Rented: photo faded back with a badge on top, kept on the page as social proof. */
.lh-unit.is-rented .lh-unit__media img { opacity: 0.35; filter: grayscale(0.6); }
.lh-unit__badge {
	position: absolute; left: 50%; top: 50%; translate: -50% -50%;
	display: inline-flex; align-items: center; gap: 0.45rem;
	padding: 0.5rem 0.95rem 0.5rem 0.6rem; border-radius: 999px;
	background: var(--white); color: var(--spruce);
	box-shadow: 0 2px 10px color-mix(in srgb, var(--ink) 18%, transparent);
	font-weight: 600; line-height: 1; white-space: nowrap;
}
.lh-unit__badge svg { flex: none; }
.lh-unit.is-rented .lh-unit__name,
.lh-unit.is-rented .lh-unit__rent { color: var(--slate); }
.lh-unit.is-rented .lh-unit__when { margin-bottom: 0; color: var(--ink); font-weight: 600; }
.lh-unit.is-rented .lh-unit__when::before { background: var(--slate); }

@media (max-width: 860px) {
	.lh-unit { grid-template-columns: 1fr; align-items: start; }
	.lh-unit__lease { justify-items: start; text-align: left; }
}

.lh-empty { padding: 2rem 0; border-top: 1px solid var(--ink); font-size: 1.2rem; }
.lh-empty + .lh-units { border-top-color: var(--stone); }

/* Visit / form */
.lh-visit { background: var(--white); border-top: 1px solid var(--stone); }
.lh-visit__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: clamp(2.5rem, 7vw, 7rem); align-items: start; }
.lh-visit__intro h2 { margin-bottom: 1.25rem; }
.lh-visit__intro > p { max-width: 30rem; color: var(--slate); }
.lh-visit__contact { margin: 2.5rem 0 0; display: grid; gap: 1.5rem; }
.lh-visit__contact dt { font-weight: 600; }
.lh-visit__contact dd { margin: 0.2rem 0 0; color: var(--slate); }
.lh-visit__contact dd + dd { margin-top: 0.75rem; }

.lh-form { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem 1rem; }
.lh-field { grid-column: 1 / -1; display: grid; gap: 0.4rem; }
.lh-field--half { grid-column: span 1; }
.lh-field label { font-weight: 500; }
.lh-field label span { font-weight: 400; color: var(--slate); }
.lh-field input,
.lh-field select,
.lh-field textarea {
	width: 100%; min-height: 3rem; padding: 0.7rem 0.9rem;
	border: 1px solid var(--field-border); border-radius: 6px;
	background: var(--paper); color: var(--ink);
	font: inherit;
	transition: border-color 0.2s, background-color 0.2s;
}
.lh-field textarea { resize: vertical; }
.lh-field input:hover,
.lh-field select:hover,
.lh-field textarea:hover { border-color: var(--slate); }
.lh-field input:focus,
.lh-field select:focus,
.lh-field textarea:focus { outline: 2px solid var(--spruce); outline-offset: 0; border-color: var(--spruce); background: var(--white); }
.lh-form .lh-btn--block { grid-column: 1 / -1; margin-top: 0.5rem; }
.lh-turnstile { grid-column: 1 / -1; min-height: 65px; }

.lh-notice { grid-column: 1 / -1; margin: 0; padding: 1rem 1.15rem; border-radius: 6px; border-left: 4px solid; }
.lh-notice--ok { background: color-mix(in srgb, var(--spruce) 10%, #fff); border-color: var(--spruce); }
.lh-notice--error { background: #f8e9e7; border-color: #a5352a; }

@media (max-width: 860px) {
	.lh-about__grid,
	.lh-visit__grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
	.lh-field--half { grid-column: 1 / -1; }
}

/* Footer */
.lh-footer { background: var(--ink); color: rgba(255, 255, 255, 0.75); padding-top: clamp(3.5rem, 7vw, 5rem); font-size: 0.975rem; }
.lh-footer a { color: var(--white); text-decoration: none; }
.lh-footer a:hover { text-decoration: underline; color: var(--white); }
.lh-footer address { font-style: normal; }
.lh-footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2.5rem; }
.lh-footer__name { margin: 0 0 0.75rem; color: var(--white); font-size: 1.5rem; font-weight: 700; letter-spacing: -0.03em; }
.lh-footer__head { margin-bottom: 0.5rem; color: var(--white); font-weight: 600; }
.lh-footer__nav { display: grid; gap: 0.5rem; align-content: start; }
.lh-footer__base {
	display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem;
	margin-top: clamp(3rem, 6vw, 4.5rem); padding-block: 1.5rem;
	border-top: 1px solid rgba(255, 255, 255, 0.15);
	font-size: 0.875rem; color: rgba(255, 255, 255, 0.55);
}
.lh-footer__base p { margin: 0; }
@media (max-width: 860px) { .lh-footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .lh-footer__grid { grid-template-columns: 1fr; } }

/* Fallback pages */
.lh-page { padding-block: calc(var(--header-h) + 3rem) var(--section); max-width: 46rem; }

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