/* ==========================================================================
   LAYOUT — container, sections, grids, header, footer.
   ========================================================================== */

/* Containers & sections ---------------------------------------------------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow { max-width: var(--container-narrow); }

.section { padding-block: var(--section-y); }
.section--compact { padding-block: clamp(48px, 6vw, 80px); }
.section--tint { background: var(--c-mint-50); }
.section--dark {
	position: relative; overflow: hidden; color: var(--c-white);
	background: linear-gradient(135deg, var(--c-brand-600) 0%, var(--c-brand-800) 55%, var(--c-brand-900) 100%);
}
.section--dark__watermark {
	position: absolute; right: -80px; bottom: -60px; width: 620px; max-width: none;
	opacity: 0.07; pointer-events: none;
}

.section-head { display: flex; flex-direction: column; gap: 14px; max-width: 680px; margin-bottom: var(--gap-lg); }
.section-head--center { text-align: center; align-items: center; margin-inline: auto; }
/* Wide head: title runs across the container (each designed line on one row). */
.section-head--wide { max-width: none; }
.section-head--wide .section-lead { max-width: 46em; }

/* Grids --------------------------------------------------------------------- */
.grid { display: grid; gap: var(--gap); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.split {
	position: relative; display: grid; align-items: center; gap: clamp(40px, 5vw, 72px);
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
}

/* Header ---------------------------------------------------------------------- */
.site-header {
	position: sticky; top: 0; z-index: 50;
	background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(10px);
	border-bottom: 1px solid var(--c-line);
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar .site-header { top: 0; } }

.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--gap); padding-block: 14px; }
.site-header__logo { display: flex; align-items: center; flex-shrink: 0; }
.site-header__logo .logo { height: 44px; width: auto; }

.site-nav-wrap { display: contents; }
.site-nav { display: flex; align-items: center; gap: 32px; }
.site-nav__list { display: flex; gap: 32px; }
.site-nav__list a { color: var(--c-ink-soft); font-family: var(--font-head); font-weight: 500; text-decoration: none; }
.site-nav__list a:hover { color: var(--c-brand-600); }
.site-nav__actions { display: flex; align-items: center; gap: 12px; }
/* Header buttons: calm hover — colour change only, a hairline shadow, no lift. */
.site-nav__actions .btn:hover { transform: none; box-shadow: 0 2px 8px rgba(15, 73, 65, 0.08); }

.site-header__toggle {
	display: none; width: 44px; height: 44px; align-items: center; justify-content: center;
	border: 1px solid var(--c-line-strong); border-radius: var(--r-sm); background: var(--c-white); color: var(--c-ink); cursor: pointer;
}
.site-header__toggle-close { display: none; }

/* Mobile menu: a panel that slides in from the right (about 80% of the screen,
   max 380px) over a dimmed page. The header's toggle button stays on top of the
   panel and becomes the close (X) button. Tap the dim area / Esc / a link → closes. */
@media (max-width: 900px) {
	.site-header__toggle { display: inline-flex; position: relative; z-index: 3; }

	/* Dim layer (part of the header so it sits above the page). */
	.site-header::before {
		content: ""; position: fixed; inset: 0; z-index: 1;
		background: var(--c-overlay);
		opacity: 0; visibility: hidden;
		transition: opacity var(--dur) var(--ease), visibility 0s linear var(--dur);
	}
	/* backdrop-filter would make the fixed panel stick to the header box. */
	.menu-open .site-header { backdrop-filter: none; background: var(--c-white); }
	.menu-open .site-header::before { opacity: 1; visibility: visible; transition: opacity var(--dur) var(--ease); }
	.menu-open body { overflow: hidden; } /* lock page scroll (on body, so the sticky header keeps working) */

	/* Viewport-sized box that clips the closed panel (no sideways scroll). */
	.site-nav-wrap { display: block; position: fixed; inset: 0; z-index: 2; overflow: hidden; pointer-events: none; }
	.site-nav {
		position: absolute; top: 0; right: 0; bottom: 0; pointer-events: auto;
		width: min(80%, 380px); overflow-y: auto; overscroll-behavior: contain;
		flex-direction: column; align-items: stretch; gap: 0;
		padding: 88px 24px 32px;
		background: var(--c-white); border-radius: var(--r-lg) 0 0 var(--r-lg);
		box-shadow: var(--shadow-drawer);
		transform: translateX(105%); visibility: hidden;
		transition: transform var(--dur) var(--ease), visibility 0s linear var(--dur);
	}
	.menu-open .site-nav { transform: none; visibility: visible; transition: transform var(--dur) var(--ease); }

	.site-nav__list { flex-direction: column; gap: 0; }
	.site-nav__list a { display: block; padding: 15px 4px; font-size: 1.125rem; border-bottom: 1px solid var(--c-line); }
	.site-nav__actions { flex-direction: column; align-items: stretch; gap: 10px; margin-top: 24px; }
	.site-nav__actions .btn { min-height: 52px; font-size: 1.125rem; } /* same size as the menu links above */

	.menu-open .site-header__toggle-open { display: none; }
	.menu-open .site-header__toggle-close { display: inline; }
}
@media (max-width: 900px) { .admin-bar .site-nav-wrap { top: 32px; } }
@media (max-width: 782px) { .admin-bar .site-nav-wrap { top: 46px; } }
@media (max-width: 900px) and (prefers-reduced-motion: reduce) {
	.site-nav, .site-header::before { transition: none !important; }
}

/* Footer ---------------------------------------------------------------------- */
.site-footer { background: var(--c-brand-900); color: var(--c-footer-text); font-size: var(--fs-sm); }
.site-footer a { color: var(--c-footer-text); text-decoration: none; }
.site-footer a:hover { color: var(--c-white); }
.site-footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 32px; padding-block: 56px 36px; }
.site-footer__brand { display: flex; flex-direction: column; gap: 16px; max-width: 360px; }
.site-footer__logo { height: 52px; width: auto; }
.site-footer__cols { display: flex; flex-wrap: wrap; gap: 56px; }
.site-footer__col { display: flex; flex-direction: column; gap: 12px; }
.site-footer__heading { font-size: var(--fs-sm); color: var(--c-white); }
.site-footer__list { display: flex; flex-direction: column; gap: 10px; }
.site-footer__bottom { border-top: 1px solid rgba(255, 255, 255, 0.14); padding-block: 22px 32px; color: var(--c-footer-muted); }
