/*
Theme Name:   Tub de Anglemont
Description:  GeneratePress child theme for a vacation rental in Anglemont,
              North Shuswap, BC. Two preview directions (Ridgeline, Four Arms)
              as theme.json style variations; one is deleted when the owners
              choose. Bookings and payment are handled online.
Author:       NovelLogic
Author URI:   https://novellogic.ca
Template:     generatepress
Version:      0.1.0
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 8.1
License:      GPL-2.0-or-later
License URI:  https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  nlv-anglemont
*/

/* ---------------------------------------------------------------------------
 * NO Theme URI HEADER, DELIBERATELY - it would publish the repository host and
 * owner account from a file that ships in the webroot. Do not add one.
 *
 * EVERY COLOUR IS A theme.json PRESET. No hex literal in this file or in
 * assets/css/. The palette slugs are the same in both style variations
 * (styles/*.json), so this file works under either:
 *
 *   ground   page background          surface  bands, cards
 *   ink      body text                soft     secondary text
 *   accent   labels, rules, numbers   rule     hairlines
 *   cta      Book button fill         cta-ink  Book button text
 *
 * SHARED vs DIRECTION. This file is the frame both directions share. Layout
 * that only one direction uses lives in assets/css/direction-a.css or
 * direction-b.css, enqueued for that direction only, so deleting the losing
 * direction is deleting its file (README, "When they pick").
 * ------------------------------------------------------------------------- */

:root {
	--am-ground:  var(--wp--preset--color--ground);
	--am-surface: var(--wp--preset--color--surface);
	--am-ink:     var(--wp--preset--color--ink);
	--am-soft:    var(--wp--preset--color--soft);
	--am-accent:  var(--wp--preset--color--accent);
	--am-rule:    var(--wp--preset--color--rule);
	--am-cta:     var(--wp--preset--color--cta);
	--am-cta-ink: var(--wp--preset--color--cta-ink);
	--am-cta-hover: var(--wp--preset--color--cta-hover);
	--am-on-photo: var(--wp--preset--color--on-photo);

	--am-display: var(--wp--preset--font-family--display);
	--am-body:    var(--wp--preset--font-family--body);

	--am-gutter:  clamp(16px, 4vw, 48px);
	--am-wide:    1240px;
	--am-header:  72px;
}

/* --- GeneratePress frame, out of the way -------------------------------- */

body.am {
	background: var(--am-ground);
	color: var(--am-ink);
	font-family: var(--am-body);
}

body.am .site.grid-container,
body.am .site-content,
body.am .inside-article,
body.am .entry-content {
	max-width: none;
	margin: 0;
	padding: 0;
}

body.am .site-content { display: block; }
body.am .site-main { margin: 0; }
body.am .entry-content > * { margin-block: 0; }

/* GP sets a short colour transition on links and buttons; it shows as a
   mid-state on the dark grounds. */
body.am a,
body.am button { transition: none; }

body.am a { color: inherit; }

/* Every heading is the display face. GeneratePress sets its own heading font,
   so theme.json's element style alone loses on headings without a class of
   ours (fix round A, item 1: the hero h1 rendered in the sans). */
body.am h1,
body.am h2,
body.am h3,
body.am h4 { font-family: var(--am-display); }

body.am :focus-visible {
	outline: 2px solid var(--am-accent);
	outline-offset: 3px;
}

.am-wrap {
	box-sizing: border-box;
	width: 100%;
	max-width: calc(var(--am-wide) + 2 * var(--am-gutter));
	margin-inline: auto;
	padding-inline: var(--am-gutter);
}

.am-sec { padding-block: clamp(36px, 4.5vw, 56px); }
.am-sec--band { background: var(--am-surface); }

.am-label {
	margin: 0 0 16px;
	color: var(--am-accent);
	font: 600 13px/1.3 var(--am-body);
	letter-spacing: .14em;
	text-transform: uppercase;
}

.am-h2 {
	margin: 0 0 24px;
	font-family: var(--am-display);
	font-size: clamp(32px, 4.4vw, 52px);
	line-height: 1.08;
}

.am-lede {
	max-width: 60ch;
	margin: 0 0 24px;
	color: var(--am-soft);
	font-size: clamp(17px, 1.6vw, 19px);
	line-height: 1.6;
}

.am-visually-hidden {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* --- Header -------------------------------------------------------------- */

.am-header {
	position: relative;
	z-index: 10;
	border-bottom: 1px solid var(--am-rule);
}

.am-header__in {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: var(--am-header);
}

.am-wordmark {
	margin-right: auto;
	font-family: var(--am-display);
	font-size: 22px;
	text-decoration: none;
	white-space: nowrap;
}

/* Anchor nav: The house · Hot tub · Explore · FAQ. Under 760px it collapses
   behind the Menu button (assets/js/nav.js); with no script it wraps. */

.am-nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 28px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.am-nav a {
	display: inline-block;
	padding-block: 10px;
	color: var(--am-ink);
	font: 500 15px/1.2 var(--am-body);
	text-decoration: none;
}

.am-nav a:hover,
.am-nav a:focus-visible {
	text-decoration: underline;
	text-underline-offset: 4px;
	text-decoration-color: var(--am-accent);
}

body.am .am-nav-toggle { display: none; }
.am-nav-toggle .am-icon-close,
.am-nav-toggle[aria-expanded="true"] .am-icon-open { display: none; }
.am-nav-toggle[aria-expanded="true"] .am-icon-close { display: block; }

.am-nav a[aria-current="page"] {
	text-decoration: underline;
	text-underline-offset: 4px;
	text-decoration-color: var(--am-accent);
}

/* 761-980px: five links + Book still hold one row (estimated from the fonts:
   about 665px for A, 687px for B, against 701px at 761). */
@media (min-width: 761px) and (max-width: 980px) {
	.am-nav ul { flex-wrap: nowrap; gap: 4px 18px; }
	.am-nav a { font-size: 14px; }
	.am-wordmark { font-size: 19px; }
	body.am .am-header .am-header__book { padding: 10px 18px; font-size: 15px; }
}

.am-more { margin: 24px 0 0; font-weight: 600; }
.am-more a { color: var(--am-accent); text-underline-offset: 4px; }

/* --- Tap targets: at least 44px tall, look unchanged ----------------------
 * Text links get vertical padding cancelled by an equal negative margin, so
 * the hit area grows and the layout doesn't move. The pill grows through a
 * transparent ::after. (Seat2 mobile review: 18-36px before.)
 */
.am-more a,
.am-footer a:not(.am-book-link),
.am-guide__links a,
.am-guide__jump a {
	display: inline-block;
	padding-block: 12px;
	margin-block: -12px;
}
.am-wordmark {
	display: inline-block;
	padding-block: 8px;
	margin-block: -8px;
}
/* The pill itself is 44px tall (round 5: a ::after hit area didn't show up
   in Seat2's box audit, and a real box is simpler). Short links get a 44px
   minimum width. */
body.am .wp-block-button.am-badge .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
}
.am-footer a:not(.am-book-link),
.am-guide__jump a {
	min-width: 44px;
	text-align: center;
}

.am-nowrap { white-space: nowrap; }

/* --- Buttons: Book (core/button with .am-book) and the rating badge ------- */

body.am .wp-block-button.am-book .wp-block-button__link,
body.am .am-book-link {
	display: inline-block;
	padding: 14px 26px;
	border: 0;
	border-radius: 2px;
	background: var(--am-cta);
	color: var(--am-cta-ink);
	font: 600 15px/1.2 var(--am-body);
	letter-spacing: .04em;
	text-decoration: none;
}

body.am .wp-block-button.am-book .wp-block-button__link:hover,
body.am .wp-block-button.am-book .wp-block-button__link:focus-visible,
body.am .am-book-link:hover,
body.am .am-book-link:focus-visible {
	background: var(--am-cta-hover);
	color: var(--am-cta-ink);
	text-decoration: none;
}


/* Book buttons, both directions (round 4: B given A's prominence): min 52px,
   17px/600, wide padding; the header's is 44px. Fill and text are the cta
   tokens (A gold on ink 7.09:1; B turquoise on lake 8.67:1). No display
   change here: the mobile bar's full-width display:block must hold. */
body.am .wp-block-button.am-book .wp-block-button__link,
body.am .am-book-link {
	box-sizing: border-box;
	min-height: 52px;
	padding: 14px 34px;
	border-radius: 3px;
	font: 600 17px/24px var(--am-body);
	letter-spacing: .01em;
}

body.am .am-header .am-header__book { min-height: 44px; padding: 10px 24px; font-size: 16px; }

body.am .wp-block-button.am-badge .wp-block-button__link {
	display: inline-block;
	padding: 8px 14px;
	border: 1px solid var(--am-accent);
	border-radius: 999px;
	background: transparent;
	color: var(--am-ink);
	font: 500 14px/1.3 var(--am-body);
	text-decoration: none;
}

body.am .wp-block-button.am-badge .wp-block-button__link:hover,
body.am .wp-block-button.am-badge .wp-block-button__link:focus-visible {
	background: transparent;
	color: var(--am-ink);
	text-decoration: underline;
}

/* --- Photos: a real image, or a labelled empty frame until Seat2 lands ---- */

.am-photo {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: cover;
}

.am-photo--empty {
	display: grid;
	place-items: center;
	min-height: 240px;
	background: var(--am-surface);
	border: 1px dashed var(--am-rule);
	color: var(--am-soft);
	font: 500 13px/1.3 var(--am-body);
	letter-spacing: .08em;
	text-transform: uppercase;
}

/* --- Booking steps (shared; B restyles it inside the hosts band) --------- */

.am-steps {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: clamp(16px, 3vw, 40px);
	margin: 0;
	padding: 0;
	list-style: none;
	counter-reset: am-step;
}

.am-steps li {
	counter-increment: am-step;
	padding-top: 20px;
	border-top: 1px solid var(--am-rule);
}

.am-steps li::before {
	content: counter(am-step, decimal-leading-zero);
	display: block;
	margin-bottom: 10px;
	color: var(--am-accent);
	font: 500 14px/1 var(--am-body);
	letter-spacing: .12em;
}

.am-steps h3 {
	margin: 0 0 6px;
	font-family: var(--am-display);
	font-size: 24px;
}

.am-steps p { margin: 0; color: var(--am-soft); }

/* --- Meta icons and feature list (house sections) ------------------------- */

.am-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 12px 28px;
	margin: 24px 0;
	padding: 0;
	list-style: none;
}

.am-meta li { display: flex; align-items: center; gap: 10px; }
.am-meta svg { width: 22px; height: 22px; color: var(--am-accent); flex: none; }

.am-features { margin: 0 0 32px; padding: 0; list-style: none; }
.am-features li { padding: 12px 0; border-top: 1px solid var(--am-rule); }

/* Hot tub rules (owner round 1): a quiet note after the features. */
.am-tubrules { margin: 0 0 32px; padding: 16px 18px; background: var(--am-surface); border-left: 3px solid var(--am-accent); }
.am-tubrules__h { margin: 0 0 6px; font-size: 18px; line-height: 1.3; }
.am-tubrules p { margin: 0; font-size: 15px; line-height: 1.6; }

/* --- FAQ teaser (#faq on Home) -------------------------------------------- */

.am-announce p { text-wrap: balance; }

.am-faq-home__in { max-width: calc(760px + 2 * var(--am-gutter)); margin-inline: auto; text-align: center; }
.am-faq-home .am-lede { margin-inline: auto; }

/* --- Footer --------------------------------------------------------------- */

.am-footer {
	padding-block: 48px;
	border-top: 1px solid var(--am-rule);
	color: var(--am-soft);
	font-size: 15px;
}

/* Three columns on one top edge (round 4). The first line of each column is
   trimmed to its cap height (text-box), so the wordmark's caps, the first
   legal line's caps and the top of the Book button share one line. Browsers
   without text-box (Firefox for now) fall back to the plain box tops. */
.am-footer__in {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
	gap: 24px 48px;
	align-items: start;
}

.am-footer p { margin: 0 0 8px; line-height: 1.5; }
.am-footer p:last-child { margin-bottom: 0; }
.am-footer__in > div > :first-child:not(.am-book-link) { text-box: trim-start cap alphabetic; }

body.am .am-footer .am-wordmark {
	display: block;
	margin: 0 0 12px;
	padding: 0;
	color: var(--am-ink);
	font-size: 22px;
	line-height: 1.2;
}

/* --- Page and 404 --------------------------------------------------------- */

.am-page { padding-block: clamp(48px, 8vw, 96px); }
.am-page h1 {
	margin: 0 0 24px;
	font-family: var(--am-display);
	font-size: clamp(36px, 5vw, 60px);
	line-height: 1.05;
}
.am-page__body { max-width: 68ch; line-height: 1.65; }
.am-page__body .am-lede { margin-bottom: 40px; }

/* Field guide */
.am-guide__jump {
	display: flex;
	flex-wrap: wrap;
	gap: 0 20px;
	margin: 0 0 8px;
	padding: 4px 0;
	font-weight: 600;
}
.am-guide__jump a { color: var(--am-accent); text-underline-offset: 4px; }

/* Drive times (owner round 1): a plain two-column table, place | time.
   body.am prefix: core's .wp-block-table .has-fixed-layout (0,2,0) and its
   thead/td borders would otherwise win. */
body.am .am-guide__drives { margin: 0 0 32px; }
body.am .am-guide__drives table { width: 100%; border-collapse: collapse; table-layout: auto; font-size: 16px; }
body.am .am-guide__drives thead { border-bottom: 0; }
body.am .am-guide__drives th,
body.am .am-guide__drives td { padding: 8px 0; border: 0; border-bottom: 1px solid var(--am-rule); text-align: left; vertical-align: top; }
body.am .am-guide__drives th { color: var(--am-soft); font-size: 14px; font-weight: 600; }
body.am .am-guide__drives td:last-child,
body.am .am-guide__drives th:last-child { padding-left: 16px; white-space: nowrap; text-align: right; }

.am-guide__group {
	scroll-margin-top: calc(var(--am-header) + 8px);
	margin: 48px 0 4px;
	padding-top: 16px;
	border-top: 1px solid var(--am-accent);
	font-size: clamp(26px, 3vw, 34px);
}
.am-guide__entry { padding: 16px 0; border-bottom: 1px solid var(--am-rule); }
.am-guide__entry h3 { margin: 0 0 6px; font-size: 22px; }
.am-guide__entry p { margin: 0 0 6px; }
.am-guide__entry p:last-child { margin-bottom: 0; }
.am-guide__meta { color: var(--am-soft); font-size: 15px; }
.am-guide__meta em { font-style: normal; font-weight: 600; color: var(--am-ink); }
.am-guide__links a { color: var(--am-accent); text-underline-offset: 3px; }
.am-guide__note,
.am-guide__closing { color: var(--am-soft); font-style: italic; }
.am-guide__closing { margin: 40px 0 24px; }

/* FAQ (core/details) */
.am-faq { border-bottom: 1px solid var(--am-rule); }
.am-faq:first-of-type { border-top: 1px solid var(--am-rule); }
.am-faq summary {
	padding: 18px 32px 18px 0;
	position: relative;
	cursor: pointer;
	font: 600 18px/1.4 var(--am-body);
	list-style: none;
}
.am-faq summary::-webkit-details-marker { display: none; }
.am-faq summary::after {
	content: "+";
	position: absolute;
	right: 4px;
	top: 16px;
	color: var(--am-accent);
	font-size: 22px;
}
.am-faq[open] summary::after { content: "–"; }
.am-faq p { margin: 0 0 20px; color: var(--am-soft); }
.am-page__body > .wp-block-buttons { margin-top: 40px; }

/* --- Motifs: one class each. Background-only; never content. -------------
 *
 * The motif is a ::before layer under the section's content, at
 * --am-motif-opacity, so its lines never cross text at full strength. A
 * section can lower it further (A's hosts band, which is mostly body text).
 * isolation keeps the z-index:-1 layer above the section's own background.
 */

.am-motif-ridgelines-gold,
.am-motif-lake-arms-cream,
.am-motif-treeline-cream,
.am-motif-treeline-forest {
	position: relative;
	isolation: isolate;
}

.am-motif-ridgelines-gold::before,
.am-motif-lake-arms-cream::before,
.am-motif-treeline-cream::before,
.am-motif-treeline-forest::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background-repeat: no-repeat;
	opacity: var(--am-motif-opacity, .5);
}

.am-motif-ridgelines-gold { --am-motif-opacity: .14; }
.am-motif-ridgelines-gold::before {
	background-image: url("assets/motifs/ridgelines-gold.svg");
	background-position: center top;
	background-size: max(1440px, 100%) auto;
}

.am-motif-lake-arms-cream { --am-motif-opacity: .55; }
.am-motif-lake-arms-cream::before {
	background-image: url("assets/motifs/lake-arms-cream.svg");
	background-position: left center;
	background-size: contain;
}

.am-motif-treeline-cream::before {
	background-image: url("assets/motifs/treeline-cream.svg");
	background-position: center bottom;
	background-size: 100% auto;
}

.am-motif-treeline-forest::before {
	background-image: url("assets/motifs/treeline-forest.svg");
	background-position: center bottom;
	background-size: 100% auto;
}

/* --- Mobile Book bar (shown under 760px only) ---------------------------- */

.am-bookbar { display: none; }

/* --- Phone ----------------------------------------------------------------
 * One header row at 360-430px: wordmark (clamped, never wraps) + a 44px
 * icon-only menu button. No Book link in the header; the bottom bar carries
 * it. The header sticks, and turns solid/blurred once the page has scrolled
 * (nav.js .is-scrolled). Widths measured from the font files: the wordmark
 * is at most 190px at 22px (Fraunces), so it fits beside the button at 360.
 * ------------------------------------------------------------------------- */

@media (max-width: 760px) {
	:root { --am-header: 60px; }

	.am-steps { grid-template-columns: 1fr; }

	.am-header {
		position: sticky;
		top: 0;
		z-index: 20;
	}
	.am-header__in { flex-wrap: nowrap; gap: 12px; min-height: var(--am-header); }
	.am-wordmark {
		min-width: 0;
		overflow: hidden;
		text-overflow: ellipsis;
		font-size: clamp(18px, 5.5vw, 22px);
	}
	/* body.am prefix REQUIRED: body.am .am-book-link (0,2,1) sets display and
	   beat the old (0,2,0) selector, so the header button stayed (Seat2, Pixel). */
	body.am .am-header .am-header__book { display: none; }
	html:not(.am-js) .am-header { background: var(--am-ground); }

	.am-header.is-scrolled,
	.am-header.is-open {
		background: color-mix(in srgb, var(--am-ground) 92%, transparent);
		-webkit-backdrop-filter: blur(10px);
		backdrop-filter: blur(10px);
		border-bottom-color: var(--am-rule);
	}

	/* Anchors land below the sticky header. */
	.am-main [id] { scroll-margin-top: calc(var(--am-header) + 8px); }

	/* No script: the nav takes its own row and wraps. */
	.am-header__in:has(.am-nav) { flex-wrap: wrap; }
	.am-nav { order: 3; flex-basis: 100%; }

	/* Script: one row; the nav is a panel behind the menu button. */
	.am-js .am-header__in { flex-wrap: nowrap; }
	.am-js body.am .am-nav-toggle {
		display: inline-grid;
		place-items: center;
		flex: none;
		width: 44px;
		height: 44px;
		margin-right: -10px;
		padding: 0;
		border: 0;
		border-radius: 2px;
		background: transparent;
		color: var(--am-ink);
	}
	.am-js body.am .am-nav-toggle:hover,
	.am-js body.am .am-nav-toggle:focus-visible { background: transparent; color: var(--am-accent); }
	.am-js .am-nav { display: none; }
	.am-js .am-nav.is-open {
		display: block;
		position: absolute;
		inset: 100% 0 auto;
		padding: 8px var(--am-gutter) 16px;
		background: var(--am-ground);
		border-bottom: 1px solid var(--am-rule);
	}
	/* Open: the header row goes solid too, so the panel never reads over the
	   hero (A home overlays it). */
	.am-header.is-open {
		background: var(--am-ground);
		-webkit-backdrop-filter: none;
		backdrop-filter: none;
	}

	/* The bottom bar carries Book on phones; the footer's copy is a repeat. */
	body.am .am-footer .am-book-link { display: none; }
	.am-footer__in { grid-template-columns: 1fr; gap: 20px; }

	.am-guide__entry h3 { font-size: 20px; }
	.am-guide__group { margin-top: 36px; }
	.am-js .am-nav.is-open ul { flex-direction: column; gap: 0; }
	.am-js .am-nav.is-open a { display: block; padding-block: 14px; border-top: 1px solid var(--am-rule); }

	/* Bottom Book bar. With script it hides over the footer, so no room is
	   reserved (round 5: no gap at the page end). Without script it always
	   shows, so the room is reserved and the start-hidden state is undone. */
	html:not(.am-js) body.am { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
	html:not(.am-js) .am-bookbar.is-hidden { transform: none; visibility: visible; }
	.am-bookbar {
		display: block;
		position: fixed;
		inset: auto 0 0;
		z-index: 30;
		padding: 10px var(--am-gutter) calc(10px + env(safe-area-inset-bottom));
		background: color-mix(in srgb, var(--am-ground) 94%, transparent);
		-webkit-backdrop-filter: blur(10px);
		backdrop-filter: blur(10px);
		border-top: 1px solid var(--am-rule);
		transition: transform .2s ease, visibility .2s;
	}
	body.am .am-bookbar .am-book-link { display: block; text-align: center; }
	.am-bookbar.is-hidden { transform: translateY(100%); visibility: hidden; }
}

@media (max-width: 760px) and (prefers-reduced-motion: reduce) {
	.am-bookbar { transition: none; }
}
