/*
 * Plan My Wed: base styles. Mobile first (written for 390 px), widened with min-width queries.
 * Tokens live in tokens.css. Section styles live in sections.css.
 */

/* ---------- Reset ---------- */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--header-total) + var(--space-4));
	/* A focused control scrolled into view must never end up under the sticky bar (WCAG 2.4.11). */
	scroll-padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom, 0px) + var(--space-4));
}

body {
	margin: 0;
	background: var(--cream);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: var(--text-md);
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

img,
picture,
svg {
	display: block;
	max-width: 100%;
}

img {
	height: auto;
}

h1,
h2,
h3 {
	margin: 0;
	font-family: var(--font-display);
	font-weight: 400;
	letter-spacing: var(--tracking-display);
	line-height: 0.98;
	text-wrap: balance;
}

h1 {
	font-size: var(--display-1);
}

h2 {
	font-size: var(--display-2);
}

h3 {
	font-size: var(--display-3);
}

em {
	font-style: italic;
}

p {
	margin: 0 0 var(--space-4);
	text-wrap: pretty;
}

ul {
	margin: 0;
	padding: 0;
}

a {
	color: inherit;
}

button {
	font: inherit;
}

/* ---------- Focus and motion ---------- */

:focus-visible {
	outline: 3px solid var(--focus-ring);
	outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

/* ---------- Surfaces: paper and maroon, each with film grain and a soft feather swirl ---------- */

.surface-maroon,
.surface-cream {
	position: relative;
	isolation: isolate;
}

.surface-maroon {
	--focus-ring: var(--gold);
	background: var(--maroon);
	color: var(--cream);
}

.surface-cream {
	--focus-ring: var(--maroon-deep); /* the gold ring is 1.5:1 on cream, so cream surfaces draw a maroon one */
	background: var(--cream);
	color: var(--ink);
}

.surface-maroon::before,
.surface-cream::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background-repeat: no-repeat;
	background-position: center;
	background-size: cover;
}

.surface-maroon::before {
	background-image: var(--swirl-light);
}

.surface-cream::before {
	background-image: var(--swirl-dark);
}

.surface-maroon::after,
.surface-cream::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background-size: 240px 240px;
	opacity: 0.13;
}

.surface-maroon::after {
	background-image: var(--grain-light);
}

.surface-cream::after {
	background-image: var(--grain-dark);
	opacity: 0.08;
}

/* ---------- Type helpers ---------- */

.eyebrow {
	margin: 0 0 var(--space-4);
	color: var(--gold);
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: var(--tracking-eyebrow);
	line-height: 1.3;
	text-transform: uppercase;
}

.eyebrow--ink {
	color: var(--ink-soft);
}

.lede {
	max-width: 34rem;
	color: var(--cream-soft);
	font-size: var(--text-lg);
	line-height: 1.5;
}

.visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* The peacock is a currentColor SVG, so it only works as a mask. Decorative: mark it aria-hidden. */
.peacock {
	display: block;
	aspect-ratio: 357 / 705;
	background-color: currentColor;
	-webkit-mask: var(--peacock-mask) center / contain no-repeat;
	mask: var(--peacock-mask) center / contain no-repeat;
}

/* ---------- Buttons ---------- */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	min-height: 3rem;
	padding: 0.75rem 1.5rem;
	border: 1.5px solid transparent;
	border-radius: var(--radius-pill);
	font-family: var(--font-body);
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.1;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	transition: transform 0.25s var(--ease), background-color 0.25s var(--ease), color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.btn .icon {
	flex: none;
	width: 1.375rem;
	height: 1.375rem;
}

.btn:active {
	transform: translateY(1px) scale(0.99);
}

.btn--gold {
	background: var(--gold);
	color: var(--ink);
}

.btn--maroon {
	background: var(--maroon);
	color: var(--cream);
}

.btn--outline {
	border-color: currentColor;
	background: transparent;
	color: var(--ink);
}

.btn--sm {
	min-height: 2.75rem;
	padding: 0.5rem 1.05rem;
	font-size: 0.9375rem;
}

@media (hover: hover) {
	.btn--gold:hover {
		background: var(--gold-bright);
		transform: translateY(-1px);
	}

	.btn--maroon:hover {
		background: var(--maroon-deep);
		transform: translateY(-1px);
	}

	.btn--outline:hover {
		background: var(--ink);
		color: var(--cream);
	}
}

/* ---------- Skip link ---------- */

.skip-link {
	position: absolute;
	top: -5rem;
	left: var(--space-4);
	z-index: 100;
	padding: 0.75rem 1.25rem;
	border-radius: var(--radius-pill);
	background: var(--gold);
	color: var(--ink);
	font-weight: 600;
	text-decoration: none;
}

.skip-link:focus {
	top: var(--space-3);
}

.skip-link:focus-visible {
	outline-color: var(--cream);
}

/* ---------- Header ---------- */

.site-header {
	--focus-ring: var(--gold);
	position: sticky;
	top: 0;
	z-index: 50;
	padding-top: env(safe-area-inset-top, 0px); /* maroon runs up under the notch; the bar below it is --header-h tall */
	background: var(--maroon);
	color: var(--cream);
	border-bottom: 1px solid var(--line-light);
	transition: box-shadow 0.3s var(--ease);
}

.site-header.is-scrolled {
	box-shadow: var(--shadow-header);
}

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-4);
	max-width: calc(var(--wrap) + 2 * var(--gutter));
	height: var(--header-h);
	margin: 0 auto;
	padding: 0 var(--gutter);
}

.site-header__actions {
	display: flex;
	align-items: center;
	gap: var(--space-2);
}

/* Instagram and Facebook: round icon buttons, 44 px, beside the WhatsApp button. */
.site-header .btn {
	white-space: nowrap;
}

/* On the narrowest phones the button just says WhatsApp, so the logo, two icons and the button all fit. */
@media (max-width: 379px) {
	.site-header__us {
		display: none;
	}

	.site-header__inner {
		gap: var(--space-2);
	}

	.site-header__actions {
		gap: 0.375rem;
	}

	.site-header .btn {
		padding-inline: 0.875rem;
	}
}

.site-header__social {
	display: grid;
	place-items: center;
	width: 2.75rem;
	height: 2.75rem;
	border: 1px solid var(--line-light);
	border-radius: 50%;
	color: var(--cream);
	transition: background-color 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease);
}

.site-header__social .icon {
	width: 1.25rem;
	height: 1.25rem;
}

.site-header__social:active,
.site-header__social:focus-visible {
	background: var(--gold);
	border-color: var(--gold);
	color: var(--ink);
}

@media (hover: hover) {
	.site-header__social:hover {
		background: var(--gold);
		border-color: var(--gold);
		color: var(--ink);
	}
}

.site-header__brand {
	display: flex;
	align-items: center;
	min-width: 2.75rem;
	min-height: 2.75rem;
}

.site-header__logo {
	width: auto;
	height: calc(var(--header-h) - 1rem);
}

/* ---------- Footer ---------- */

.site-footer {
	/* The sticky bar sits over the bottom of the page: reserve its height so it never covers footer text. */
	padding: var(--space-7) var(--gutter) calc(var(--space-5) + var(--bar-h) + env(safe-area-inset-bottom, 0px));
}

.site-footer__inner {
	display: grid;
	gap: var(--space-6);
	max-width: var(--wrap);
	margin: 0 auto;
}

.site-footer__brand {
	display: grid;
	gap: var(--space-4);
	justify-items: start;
}

.site-footer__logo {
	width: auto;
	height: 7.5rem;
}

.site-footer__sister {
	display: inline-flex;
	align-items: center;
	min-height: 2.75rem;
	max-width: 26rem;
	color: var(--cream-soft);
	line-height: 1.4;
	text-decoration: none;
}

.site-footer__sister strong {
	color: var(--cream);
	font-weight: 600;
	text-decoration: underline;
	text-decoration-color: var(--gold);
	text-underline-offset: 0.2em;
}

.site-footer__links ul {
	display: grid;
	gap: var(--space-1);
	list-style: none;
}

.site-footer__links a {
	display: inline-flex;
	align-items: center;
	gap: var(--space-3);
	min-width: 2.75rem; /* the icon-less Blog link is still a full-size touch target */
	min-height: 2.75rem;
	text-decoration: none;
}

.site-footer__links .icon {
	flex: none;
	width: 1.5rem;
	height: 1.5rem;
	color: var(--gold);
}

.site-footer__links a:hover span {
	text-decoration: underline;
	text-decoration-color: var(--gold);
	text-underline-offset: 0.2em;
}

.site-footer__credit {
	display: block;
	margin-top: var(--space-1);
}

.site-footer__credit a {
	display: inline-flex;
	align-items: center;
	min-height: 2.75rem;
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.site-footer__legal {
	margin: 0;
	padding-top: var(--space-5);
	border-top: 1px solid var(--line-light);
	color: var(--cream-soft);
	font-size: var(--text-sm);
}

@media (min-width: 768px) {
	.site-footer__inner {
		grid-template-columns: 1fr auto;
		align-items: start;
		column-gap: var(--space-8);
	}

	.site-footer__legal {
		grid-column: 1 / -1;
	}
}

/* ---------- Sticky WhatsApp: a full-width bar on phones, a small floating button on desktop ---------- */

/* The pill floats over cream and over maroon, so its focus ring is two rings: a dark one against the button
 * and a gold one outside it. On cream the dark ring shows; on maroon the gold one does. */
.wa-bar {
	--focus-ring: var(--gold);
	--focus-halo: var(--maroon-deep);
	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 60;
	padding: 0.625rem var(--gutter) calc(0.625rem + env(safe-area-inset-bottom, 0px));
	border-top: 1px solid var(--line-light);
	background: var(--bar-bg);
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	transition: opacity 0.3s var(--ease), transform 0.3s var(--ease);
}

/* While the final call to action is on screen the bar steps aside (main.js sets this, together with inert,
 * so it is also out of the tab order and out of reach of a tap). Without script it never applies. */
.wa-bar.is-hidden {
	opacity: 0;
	transform: translateY(100%);
	pointer-events: none;
}

.wa-bar .btn {
	width: 100%;
	min-height: 3.25rem;
	font-size: 1.0625rem;
}

.wa-bar .btn:focus-visible {
	box-shadow: 0 0 0 3px var(--focus-halo);
}

@media (min-width: 900px) {
	.wa-bar {
		right: calc(var(--space-5) + env(safe-area-inset-right, 0px));
		bottom: calc(var(--space-5) + env(safe-area-inset-bottom, 0px));
		left: auto;
		padding: 0;
		border: 0;
		background: none;
		-webkit-backdrop-filter: none;
		backdrop-filter: none;
	}

	.wa-bar .btn {
		width: auto;
		box-shadow: var(--shadow-pill);
	}

	.wa-bar .btn:focus-visible {
		box-shadow: 0 0 0 3px var(--focus-halo), var(--shadow-pill-drop);
	}

	.site-footer {
		padding-bottom: calc(var(--space-5) + 5.5rem);
	}

	.wa-bar.is-hidden {
		transform: translateY(calc(100% + var(--space-5)));
	}

	/* The floating pill takes about 5.5rem at the bottom right. */
	html {
		scroll-padding-bottom: 7rem;
	}
}

/* ---------- Plain template (index.php fallback) ---------- */

.plain__inner {
	max-width: 40rem;
	min-height: 50vh;
	margin: 0 auto;
	padding: var(--space-7) var(--gutter);
}

.plain h1 {
	margin-bottom: var(--space-5);
	font-size: var(--display-2);
}


/* The 404 page has no sticky WhatsApp bar (footer.php), so the footer keeps no room for one. */
.error404 .site-footer {
	padding-bottom: calc(var(--space-5) + env(safe-area-inset-bottom, 0px));
}
