/* ==========================================================================
   Beruwela — main styles
   ========================================================================== */

/* Fonts (self-hosted, Latin + Latin Extended incl. Hungarian) */
@font-face {
	font-family: "Marcellus";
	src: url("../fonts/Marcellus-Regular.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "EB Garamond";
	src: url("../fonts/EBGaramond-Variable.woff2") format("woff2");
	font-weight: 400 800;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "EB Garamond";
	src: url("../fonts/EBGaramond-Italic-Variable.woff2") format("woff2");
	font-weight: 400 800;
	font-style: italic;
	font-display: swap;
}

:root {
	--sand: #f0ebe3;
	--sand-deep: #e6dfd4;
	--white: #ffffff;
	--ink: #1c1a16;
	--ink-soft: #4b463e;
	--line: #d8d1c5;
	--teal: #264556;
	--teal-deep: #1a3240;
	--stone: #ebe8e3;
	--earth: #4a4030;
	--earth-soft: #5d5241;

	--font-display: "Marcellus", "Cormorant Garamond", "Times New Roman", serif;
	--font-body: "EB Garamond", Garamond, "Times New Roman", serif;

	--container: 1240px;
	--gutter: clamp(1.25rem, 4vw, 2.75rem);
	--section: clamp(4rem, 9vw, 7.5rem);
	--radius: 6px;
	--radius-btn: 4px;
	--header-h: 72px;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 1rem); }

body {
	margin: 0;
	background: var(--white);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: 1.125rem;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

img, svg, video { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
ul { padding: 0; }
h1, h2, h3, h4 { margin: 0 0 .5em; }

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

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link {
	position: absolute; left: 1rem; top: -4rem; z-index: 1000;
	background: var(--teal); color: #fff; padding: .6rem 1rem; border-radius: var(--radius-btn);
}
.skip-link:focus { top: 1rem; }

/* Layout ----------------------------------------------------------------- */
.container { width: 100%; max-width: calc(var(--container) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow { max-width: calc(820px + var(--gutter) * 2); }
.container--content { max-width: calc(760px + var(--gutter) * 2); }
.text-center { text-align: center; }

.section { padding-block: var(--section); background: var(--white); }
.section--sand { background: var(--sand); }
.section--white { background: var(--white); }
.section--dark { background: var(--earth); color: #fff; }
.section--flush-top { padding-top: 0; }

.grid { display: grid; gap: clamp(1.75rem, 3vw, 2.5rem); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2.5rem, 6vw, 6rem); }
.split--center { align-items: center; }
.split__text > p:not(.eyebrow) { max-width: 36em; }

/* Typography ------------------------------------------------------------- */
.h-display {
	font-family: var(--font-display);
	font-weight: 400;
	text-transform: uppercase;
	letter-spacing: .015em;
	line-height: 1.06;
	font-size: clamp(2.1rem, 4.2vw, 3.5rem);
	color: inherit;
	margin: 0 0 .55em;
	overflow-wrap: normal;
	hyphens: manual;
}
.h-display--xl { font-size: clamp(2.6rem, 6.2vw, 4.75rem); }
.h-display--hero { font-size: clamp(2.5rem, 5.6vw, 4.6rem); line-height: 1.04; }
.h-display--sm { font-size: clamp(1.3rem, 1.8vw, 1.6rem); line-height: 1.12; margin-bottom: .6em; }

.eyebrow {
	font-size: .9rem;
	font-weight: 700;
	letter-spacing: .01em;
	margin: 0 0 1rem;
}
.lead { font-size: 1.15rem; max-width: 42em; margin-inline: auto; }

.entry-content h2 { font-family: var(--font-display); font-weight: 400; text-transform: uppercase; font-size: 1.9rem; line-height: 1.1; margin-top: 2em; }
.entry-content h3 { font-family: var(--font-display); font-weight: 400; font-size: 1.35rem; margin-top: 1.6em; }
.entry-content ul, .entry-content ol { padding-left: 1.3em; margin: 0 0 1em; }
.entry-content a { color: var(--teal); }

/* Buttons ---------------------------------------------------------------- */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
	min-height: 44px; padding: .55rem 1.2rem;
	border: 1px solid transparent; border-radius: var(--radius-btn);
	font-family: var(--font-body); font-size: 1rem; font-weight: 500; line-height: 1.2;
	text-decoration: none; cursor: pointer;
	transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.btn--small { min-height: 38px; padding: .4rem 1rem; font-size: .95rem; }
.btn--primary { background: var(--teal); color: #fff; border-color: var(--teal-deep); box-shadow: inset 0 1px 0 rgba(255,255,255,.12); }
.btn--primary:hover { background: var(--teal-deep); }
.btn--secondary { background: var(--stone); color: var(--ink); box-shadow: 0 1px 2px rgba(40,32,20,.08); }
.btn--secondary:hover { background: var(--sand-deep); }
.btn--link { padding-inline: .5rem; background: none; color: var(--ink); }
.btn--link:hover .icon { transform: translateX(3px); }
.btn--link .icon { transition: transform .2s ease; }
.btn--light { background: #f4f2ee; color: var(--ink); }
.btn--light:hover { background: #fff; }
.btn--dark { background: var(--earth-soft); color: #fff; border-color: rgba(255,255,255,.1); }
.btn--dark:hover { background: #6b5f4c; }
.btn--glass { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.4); backdrop-filter: blur(6px); }
.btn--glass:hover { background: rgba(255,255,255,.28); }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-top: 2rem; }
.actions--center { justify-content: center; }

/* Media ------------------------------------------------------------------ */
.media { width: 100%; object-fit: cover; border-radius: var(--radius); background: var(--sand-deep); }
.media--square { aspect-ratio: 1 / 1; }
.media--portrait { aspect-ratio: 4 / 5; }
.media--wide { aspect-ratio: 4 / 3; }
.media--landscape { aspect-ratio: 3 / 2; }

/* Header ----------------------------------------------------------------- */
.site-header {
	position: sticky; top: 0; z-index: 100;
	background: var(--sand);
	border-bottom: 1px solid transparent;
	transition: border-color .2s ease;
}
.admin-bar .site-header { top: 32px; }
.site-header.is-scrolled { border-bottom-color: var(--line); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; min-height: var(--header-h); }
.site-header__logo { flex: 0 0 auto; }
.site-logo { font-family: var(--font-display); font-size: 1.45rem; letter-spacing: .04em; text-decoration: none; text-transform: uppercase; }
.custom-logo { max-height: 44px; width: auto; }
.site-header__actions { display: flex; align-items: center; gap: .75rem; }

.site-nav .menu { list-style: none; margin: 0; display: flex; align-items: center; gap: 2rem; }
.site-nav .menu > li { position: relative; }
.site-nav .menu a { display: inline-flex; align-items: center; gap: .3rem; text-decoration: none; font-size: 1rem; padding: .5rem 0; }
.site-nav .menu a:hover,
.site-nav .current-menu-item > a,
.site-nav .current-menu-ancestor > a { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.site-nav .sub-menu {
	list-style: none; margin: 0; padding: .5rem;
	position: absolute; left: -1rem; top: 100%; min-width: 250px;
	background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
	box-shadow: 0 12px 30px rgba(40, 32, 20, .12);
	opacity: 0; visibility: hidden; transform: translateY(6px);
	transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.site-nav .menu-item-has-children:hover > .sub-menu,
.site-nav .menu-item-has-children:focus-within > .sub-menu,
.site-nav .menu-item-has-children.is-open > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.site-nav .sub-menu a { display: block; padding: .55rem .75rem; border-radius: 4px; }
.site-nav .sub-menu a:hover { background: var(--sand); text-decoration: none; }
.site-nav__contact-mobile { display: none; }


.nav-toggle { display: none; background: none; border: 0; padding: .4rem; cursor: pointer; color: var(--ink); }
.nav-toggle__close { display: none; }

/* Page hero -------------------------------------------------------------- */
.page-hero { padding-block: clamp(3.5rem, 8vw, 6.5rem) clamp(4.5rem, 10vw, 8rem); }
.page-hero .lead { font-size: 1.1rem; }

/* Home hero */
.home-hero {
	position: relative; display: grid; place-items: center;
	min-height: min(88vh, 860px); padding-block: 6rem;
	color: #fff;
	background: var(--earth) var(--hero-image) center / cover no-repeat;
	isolation: isolate;
}
.home-hero::before {
	content: ""; position: absolute; inset: 0; z-index: -1;
	background: linear-gradient(180deg, rgba(28, 26, 22, .06) 0%, rgba(28, 26, 22, .16) 100%);
}
.home-hero__inner { width: 100%; max-width: calc(940px + var(--gutter) * 2); }
.home-hero__panel {
	color: var(--ink);
	background: rgba(246, 243, 238, var(--panel-alpha, .45));
	-webkit-backdrop-filter: blur(7px) saturate(1.05);
	backdrop-filter: blur(7px) saturate(1.05);
	border: 1px solid rgba(255, 255, 255, .45);
	border-radius: 18px;
	box-shadow: 0 20px 50px rgba(40, 32, 20, .08);
	padding: clamp(2rem, 4.5vw, 3.5rem) clamp(1.5rem, 5vw, 4rem);
}
.home-hero__panel .lead { color: var(--ink); }
.home-hero__panel .actions { margin-top: 1.75rem; }
/* Browsers without backdrop blur get a more solid panel. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	.home-hero__panel { background: rgba(246, 243, 238, max(var(--panel-alpha, .45), .85)); }
}

/* Lists ------------------------------------------------------------------ */
.icon-list { list-style: none; margin: 1.75rem 0 0; display: grid; gap: .7rem; font-size: 1rem; }
.icon-list li { display: flex; align-items: center; gap: .75rem; }
.icon-list .icon { flex: none; }

/* Section heads ---------------------------------------------------------- */
.section-head { max-width: 720px; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--split { max-width: none; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.section-head--split > p { padding-top: 2.3rem; max-width: 34em; }

/* Features --------------------------------------------------------------- */
.feature .media { margin-bottom: 1.5rem; }
.feature p { font-size: 1rem; color: var(--ink-soft); }
.feature__link { display: block; text-decoration: none; }
.feature__link:hover h3 { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.feature__icon { display: inline-flex; margin-bottom: 1.25rem; }
.grid + .actions { margin-top: clamp(2.5rem, 5vw, 3.5rem); }

/* Manufacturing (home) --------------------------------------------------- */
.mfg {
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
	grid-template-areas: "head ." "small large" "text large";
	column-gap: clamp(2.5rem, 6vw, 5rem);
	row-gap: 2.5rem;
}
.mfg__head { grid-area: head; }
.mfg__head .h-display { margin-bottom: 0; }
.mfg__small { grid-area: small; max-width: 300px; }
.mfg__large { grid-area: large; align-self: start; }
.mfg__text { grid-area: text; align-self: end; }

/* Development (home) ----------------------------------------------------- */
.dev {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	grid-template-areas: "media head" "media media2" "text media2";
	column-gap: clamp(2.5rem, 6vw, 5rem);
	row-gap: 2.5rem;
}
.dev__media { grid-area: media; }
.dev__head { grid-area: head; }
.dev__head .h-display { margin-bottom: 0; }
.dev__text { grid-area: text; align-self: end; }
.dev__media2 { grid-area: media2; max-width: 440px; justify-self: start; width: 100%; }

/* Collections ------------------------------------------------------------ */
.step { padding-block: 1.5rem clamp(4rem, 8vw, 6.5rem); border-top: 1px solid var(--line); }
.step__label { display: flex; gap: .9rem; font-size: .95rem; font-weight: 600; margin: 0 0 clamp(2rem, 5vw, 3.5rem); }
.step__num { font-variant-numeric: tabular-nums; }

.topicals__row {
	display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
	gap: clamp(2rem, 6vw, 5rem); align-items: center;
}
.topicals__row + .topicals__row { margin-top: clamp(3rem, 6vw, 5rem); }
.topicals__media { max-width: 460px; }
.topicals__text--bottom { align-self: end; max-width: 30em; }
.topicals__text--bottom p { color: var(--ink-soft); }

.admin-note { padding: 1rem 1.25rem; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--sand); font-size: 1rem; }

.cta-light { border-top: 1px solid var(--line); }

/* CTA -------------------------------------------------------------------- */
.cta { padding-block: clamp(5rem, 11vw, 9rem); }
.cta .lead { color: rgba(255,255,255,.85); }

/* Contact ---------------------------------------------------------------- */
.contact-cards { padding-bottom: clamp(1rem, 3vw, 2rem); }
.contact-card .icon { margin-bottom: 1.25rem; }
.contact-card p { font-size: 1rem; color: var(--ink-soft); }
.contact-card a { font-size: 1rem; text-underline-offset: 3px; }

.split--form { align-items: start; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
.contact-list { list-style: none; margin: 2rem 0 0; display: grid; gap: .8rem; font-size: 1rem; }
.contact-list li { display: flex; align-items: center; gap: .8rem; }
.contact-list a { text-underline-offset: 3px; }

/* Contact Form 7 --------------------------------------------------------- */
.bf { display: grid; gap: 1.6rem; }
.bf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem; }
.bf-field { display: block; margin: 0; padding: 0; border: 0; min-width: 0; }
.bf-label { display: block; margin-bottom: .45rem; font-size: .95rem; padding: 0; }
.bf input[type="text"],
.bf input[type="email"],
.bf input[type="tel"],
.bf select,
.bf textarea {
	width: 100%;
	font: inherit; font-size: 1rem; color: var(--ink);
	background: var(--white);
	border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
	padding: .65rem .1rem;
	transition: border-color .2s ease;
}
.bf input:focus, .bf select:focus, .bf textarea:focus { outline: none; border-bottom-color: var(--teal); box-shadow: 0 1px 0 var(--teal); }
.bf select {
	appearance: none; -webkit-appearance: none; cursor: pointer;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%231c1a16' stroke-width='1.6' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat; background-position: right .3rem center; padding-right: 2rem;
}
.bf textarea { min-height: 180px; resize: vertical; border: 1px solid var(--line); padding: .8rem; border-radius: 2px; }
.bf textarea:focus { border-color: var(--teal); box-shadow: none; }
.bf ::placeholder { color: #8b857b; }

.bf-choices .wpcf7-radio { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem 1.5rem; margin-top: .3rem; }
.bf-choices .wpcf7-list-item { margin: 0; }
.bf-choices .wpcf7-list-item label,
.bf-terms label { display: inline-flex; align-items: center; gap: .6rem; cursor: pointer; font-size: 1rem; }
.bf input[type="radio"], .bf input[type="checkbox"] { width: 18px; height: 18px; margin: 0; accent-color: var(--teal); }
.bf-terms .wpcf7-list-item { margin: 0; }
.bf-submit { position: relative; display: flex; align-items: center; gap: 1rem; }
.bf .wpcf7-submit { border: 1px solid var(--teal-deep); font-family: var(--font-body); }
.bf .wpcf7-submit:disabled { opacity: .55; cursor: not-allowed; }
.wpcf7-not-valid-tip { font-size: .9rem; color: #9b2c1f; margin-top: .35rem; }
.wpcf7 form .wpcf7-response-output { margin: 1.5rem 0 0; padding: .9rem 1.1rem; border-radius: var(--radius); font-size: 1rem; }
.wpcf7 form.sent .wpcf7-response-output { border-color: #3c6e57; background: #eef5f0; }
.wpcf7 form.invalid .wpcf7-response-output,
.wpcf7 form.unaccepted .wpcf7-response-output { border-color: #c79a3a; background: #fbf5e8; }
.wpcf7 form.failed .wpcf7-response-output,
.wpcf7 form.spam .wpcf7-response-output { border-color: #9b2c1f; background: #fbeeec; }
.wpcf7-spinner { margin: 0; }
.form-fallback { padding: 1.5rem; background: var(--sand); border-radius: var(--radius); }

/* Posts ------------------------------------------------------------------ */
.post-list { display: grid; gap: 3rem; }
.post-card h2 a { text-decoration: none; }
.post-card__meta { font-size: .95rem; color: var(--ink-soft); }
.nav-links { display: flex; gap: .5rem; margin-top: 3rem; }
.nav-links .page-numbers { padding: .4rem .8rem; border-radius: var(--radius-btn); background: var(--stone); text-decoration: none; }
.nav-links .current { background: var(--teal); color: #fff; }

/* Footer ----------------------------------------------------------------- */
.site-footer { background: var(--earth); color: #fff; padding-block: clamp(3.5rem, 7vw, 5rem) 2.5rem; }
.site-footer a { color: #fff; }
.site-footer__top { display: grid; justify-items: center; gap: 1.5rem; padding-bottom: clamp(3rem, 6vw, 4.5rem); }
.site-logo--footer { color: #fff; }
.footer-nav .menu,
.legal-nav .menu { list-style: none; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.6rem; }
.footer-nav a { text-decoration: none; font-weight: 600; font-size: .95rem; }
.footer-nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.site-footer__bottom {
	display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem;
	padding-top: 2rem; border-top: 1px solid rgba(255,255,255,.2); font-size: .9rem;
}
.site-footer__copy { margin: 0; }
.legal-nav a { text-underline-offset: 3px; }

/* Responsive ------------------------------------------------------------- */
@media (max-width: 1080px) {
	.grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.site-nav .menu { gap: 1.4rem; }
}

@media (max-width: 900px) {
	:root { --header-h: 64px; }

	.nav-toggle { display: inline-flex; }
	.site-header__contact { display: none; }
	.site-nav {
		position: fixed; inset: var(--header-h) 0 0 0; z-index: 99;
		background: var(--sand);
		padding: 1.5rem var(--gutter) 3rem;
		overflow-y: auto;
		display: none;
	}
	.admin-bar .site-nav { top: calc(var(--header-h) + 46px); }
	.nav-open .site-nav { display: block; }
	.nav-open .nav-toggle__open { display: none; }
	.nav-open .nav-toggle__close { display: inline; }
	.nav-open { overflow: hidden; }
	.site-nav .menu { flex-direction: column; align-items: stretch; gap: 0; }
	.site-nav .menu > li { border-bottom: 1px solid var(--line); }
	.site-nav .menu a { font-family: var(--font-display); text-transform: uppercase; font-size: 1.35rem; padding: 1rem 0; }
	.site-nav .menu a .icon { display: none; }
	.site-nav .sub-menu {
		position: static; opacity: 1; visibility: visible; transform: none;
		border: 0; box-shadow: none; background: none; padding: 0 0 1rem 1rem; min-width: 0;
	}
	.site-nav .sub-menu a { font-family: var(--font-body); text-transform: none; font-size: 1.1rem; padding: .4rem 0; }
	.site-nav__contact-mobile { display: inline-flex; margin-top: 2rem; width: 100%; }

	.split,
	.split--form,
	.section-head--split { grid-template-columns: minmax(0, 1fr); }
	.section-head--split > p { padding-top: 0; }

	.mfg { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "large" "text"; }
	.mfg__small { display: none; }

	.dev { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "media" "text"; }
	.dev__media2 { display: none; }

	.topicals__row { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
	.topicals__media { max-width: none; }
	.topicals__row:not(.topicals__row--intro) { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); align-items: center; }
}

@media (max-width: 782px) {
	.admin-bar .site-header { top: 46px; }
}
@media (max-width: 600px) {
	.admin-bar .site-header { top: 0; }
}

@media (max-width: 600px) {
	body { font-size: 1.0625rem; }
	.grid--4 { grid-template-columns: minmax(0, 1fr); }
	.bf-row { grid-template-columns: minmax(0, 1fr); }
	.bf-choices .wpcf7-radio { grid-template-columns: minmax(0, 1fr); }
	.topicals__row:not(.topicals__row--intro) { grid-template-columns: minmax(0, 1fr); }
	.site-footer__bottom { flex-direction: column; text-align: center; }
	.home-hero { padding-block: 2.5rem; min-height: 0; }
	.home-hero__inner { padding-inline: .9rem; }
	.home-hero__panel { border-radius: 14px; padding: 1.9rem 1.1rem; }
	.home-hero .h-display--hero { font-size: clamp(1.6rem, 8.2vw, 2.4rem); }
	.home-hero .lead { font-size: 1.02rem; }
	.actions .btn:not(.btn--link) { flex: 1 1 auto; }
}

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