/*
Theme Name: Hi Places
Author: Hi Places
Description: The visitor engagement platform for on-site heritage tours. Custom hybrid theme: classic PHP shell + native Gutenberg blocks.
Version: 0.1.0
Requires at least: 6.8
Requires PHP: 8.2
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: hiplaces
*/

/*
 * Very Vogue (licensed, client-supplied) registered under ONE family name:
 * upright maps to Very Vogue Text, italic to Very Vogue Display Italic —
 * exactly how the design pairs them, so components only toggle font-style.
 * Playfair Display stays as the loaded fallback.
 */
@font-face {
	font-family: "Very Vogue";
	src: url("assets/fonts/very-vogue-text.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Very Vogue";
	src: url("assets/fonts/very-vogue-display-italic.woff2") format("woff2");
	font-weight: 400;
	font-style: italic;
	font-display: swap;
}
/*
 * Secondary Very Vogue families for components whose Figma spec uses a cut the
 * main one-family mapping (upright = Text, italic = Display Italic) can't
 * reach: hero headline = Text Italic, testimonial quote glyphs = Display
 * upright. Registered as separate families so the main mapping stays intact.
 */
@font-face {
	font-family: "Very Vogue Text";
	src: url("assets/fonts/very-vogue-text.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Very Vogue Text";
	src: url("assets/fonts/very-vogue-text-italic.woff2") format("woff2");
	font-weight: 400;
	font-style: italic;
	font-display: swap;
}
@font-face {
	font-family: "Very Vogue Display";
	src: url("assets/fonts/very-vogue-display.woff2") format("woff2");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: "Playfair Display";
	src: url("assets/fonts/playfair-display-variable.woff2") format("woff2");
	font-weight: 400 900;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Playfair Display";
	src: url("assets/fonts/playfair-display-italic-variable.woff2") format("woff2");
	font-weight: 400 900;
	font-style: italic;
	font-display: swap;
}

/*
 * Design tokens extracted from Figma (nodes 4:2 / 2:209).
 * Keep in sync with theme.json palette/fontFamilies.
 */
:root {
	--hp-font-display: "Very Vogue", "Playfair Display", Georgia, serif;
	--hp-font-body: "Helvetica Neue", Helvetica, Arial, sans-serif;
	/*
	 * Emphasis weight for the "strong" lines inside Light (300) body copy
	 * (.hp-intro__strong, .hp-process__strong). The design specified Medium
	 * (500), which only exists as a contrast where Apple's Helvetica Neue is
	 * installed — Windows/Android resolve both 300 and 500 to Arial 400 — and
	 * the client could not see it on an iPhone either (round 2026-10-23, item
	 * 2). Bold is the one weight every fallback family has. The standalone 500
	 * labels (header nav/pill, author names, 404) are not consumers: they are
	 * not a contrast against a Light body.
	 */
	--hp-weight-emphasis: 700;
	--hp-color-ink: #000000;
	--hp-color-paper: #ffffff;
	--hp-color-cream: #f9f4ee; /* warm off-white: pill labels, footer text */
	--hp-color-muted: #7e7975; /* muted gray: placeholders, footer handle */
	--hp-color-teal: #3b5357; /* features & services panel */
	--hp-color-terracotta: #b0543d; /* testimonial circle accent */
	--hp-color-dark: #1a1a1a; /* hover shade over ink */
	/*
	 * Focus indicators (client feedback 2026-09, item 5). The client read the
	 * theme's own per-component rings as Safari's default -- understandably, a
	 * 2px solid outline at a small offset is exactly that. The replacement
	 * keeps the :focus-visible gating but makes the SHAPE follow the element:
	 * an underline on text, an inverted disc on icon buttons, a ring that
	 * traces the box or the pill radius.
	 *
	 * Colour is the surface's own contrast: --hp-focus-color is ink by default
	 * and re-pointed to paper by the dark surfaces (.hp-footer, .hp-hero);
	 * --hp-focus-contrast is its inverse, for the glyph inside an inverted
	 * disc. The tokens live here (not in assets/css/focus.css) because the
	 * block stylesheets consume them and style.css is what reaches the editor
	 * iframe via add_editor_style().
	 *
	 * WCAG: SC 2.4.7 Focus Visible (AA) and SC 1.4.11 Non-text Contrast (AA);
	 * every indicator clears 3:1 against both neighbours. SC 2.4.13 Focus
	 * Appearance is AAA in published WCAG 2.2 and its minimum-area part is not
	 * a target here -- some older comments in this theme call that criterion
	 * "2.4.11", which was its number in the drafts only.
	 */
	--hp-focus-width: 2px;
	--hp-focus-offset: 3px;
	--hp-focus-color: var(--hp-color-ink);
	--hp-focus-contrast: var(--hp-color-paper);
	--hp-focus-underline: 2px;
	--hp-focus-underline-offset: 4px;
	--hp-container-max: 1425px;
	--hp-container-pad: 20px; /* symmetric utility gutter (dialog, drawer); section edges use --hp-pad-left/right */
	/*
	 * Site gutter: left edge = navbar logo left (40px), right edge = navbar CTA
	 * right (52px). Mirrors .hp-header__bar padding (assets/css/site-header.css).
	 */
	--hp-pad-left: 40px;
	--hp-pad-right: 52px;
	/* Motion easings for hovers and short interaction feedback. */
	--hp-ease-out: cubic-bezier(0.22, 1, 0.36, 1);
	--hp-ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
	/*
	 * Scroll-reveal tempo, taken from animate.css (animate.style): its
	 * --animate-duration is 1s and its keyframes declare no timing function,
	 * so fadeInLeft/fadeInRight and friends run on the CSS default `ease`.
	 *
	 * The curve is the substance of this, not the duration. --hp-ease-out is
	 * easeOutQuint: it covers 40% of the travel in the first 10% of the time
	 * and 83% by 30%, so a 0.7s reveal is perceptually finished at ~330ms and
	 * reads as a blink. `ease` is near-linear through the middle (51% of the
	 * travel at 30% of the time) and stays legible for ~720ms of its second —
	 * more than double the visible motion.
	 *
	 * --hp-ease-out is deliberately NOT changed: for a 200-300ms hover, that
	 * front-loading is exactly the responsiveness you want. Only reveals move.
	 */
	--hp-reveal-duration: 1s;
	--hp-reveal-ease: cubic-bezier(0.25, 0.1, 0.25, 1); /* the CSS `ease` keyword, spelled out */
	/* Hairline rules draw slower than the copy they underline, as before (0.9s : 0.7s). */
	--hp-reveal-line-duration: 1.3s;
}

/* Matches the navbar's breakpoint (site-header.css ≤1023px → padding-inline 20px). */
@media (max-width: 1023px) {
	:root {
		--hp-pad-left: 20px;
		--hp-pad-right: 20px;
	}
}

body {
	margin: 0;
	font-family: var(--hp-font-body);
	font-weight: 300;
	color: var(--hp-color-ink);
	background-color: var(--hp-color-paper);
	-webkit-font-smoothing: antialiased;
}

.hp-container {
	max-width: var(--hp-container-max);
	margin-inline: auto;
	padding-left: var(--hp-pad-left);
	padding-right: var(--hp-pad-right);
}

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

/*
 * Responsive heading copy (client feedback 2026-09, item 1: headline line
 * breaks must be adjustable for mobile separately from desktop).
 *
 * A heading with a mobile wording ships BOTH variants and shows one per
 * breakpoint; a heading without one ships no spans at all, so existing content
 * is untouched. 768px is the theme's type breakpoint -- every heading that
 * changes size does so at max-width: 768px.
 *
 * `display: none` rather than clipping: it keeps the hidden variant out of the
 * accessibility tree, so a screen reader never reads the headline twice.
 * Lives in style.css (not assets/css/focus.css) so the editor's device-preview
 * toggle shows the right variant inside the ServerSideRender canvas.
 */
.hp-copy--mobile {
	display: none;
}

@media (max-width: 768px) {
	.hp-copy--desktop {
		display: none;
	}

	.hp-copy--mobile {
		display: inline;
	}

	/*
	 * Authored line breaks are dropped on phones so the copy re-flows to the
	 * narrow measure. A break tuned to balance a 1425px column stranded an
	 * orphan at 375px instead — the Home statement rendered as four lines with
	 * "platform" and "tours." alone, which is what the client photographed.
	 * The renderer emits a trailing space after each of these, so the joined
	 * lines never run together (see hiplaces_heading_lines_html()).
	 *
	 * Breaks inside .hp-copy--mobile are NOT dropped: those were authored for
	 * the phone, and the renderer gives them a plain <br> for that reason.
	 */
	.hp-copy-br {
		display: none;
	}
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.skip-link:focus {
	position: fixed;
	top: 8px;
	left: 8px;
	z-index: 100000;
	width: auto;
	height: auto;
	clip-path: none;
	padding: 12px 20px;
	background: var(--hp-color-ink);
	color: var(--hp-color-paper);
	/*
	 * An explicit ring, so this is never the one element left showing the
	 * browser's own (client feedback 2026-09, item 5). Paper and INSET: the
	 * chip is ink, so an ink ring would be invisible on it and an outward one
	 * would sit on whatever page content is behind. This is :focus rather than
	 * :focus-visible to match the rule it lives in — the chip only ever appears
	 * on focus anyway.
	 */
	outline: var(--hp-focus-width) solid var(--hp-color-paper);
	outline-offset: calc(-2 * var(--hp-focus-width));
}

/* ----- 404 ------------------------------------------------------------------
   Its own template (404.php) because index.php's post loop renders nothing when
   there are no posts, which left the page blank. */
.hp-404 {
	padding: 120px var(--hp-pad-right) 140px var(--hp-pad-left);
}

.hp-404__inner {
	max-width: 620px;
	margin-inline: auto;
	text-align: center;
}

.hp-404__eyebrow {
	margin: 0 0 20px;
	color: var(--hp-color-muted);
	font-family: var(--hp-font-body);
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.16em;
}

.hp-404__heading {
	margin: 0 0 20px;
	font-family: var(--hp-font-display);
	font-size: clamp(32px, 5vw, 56px);
	font-style: italic;
	font-weight: 400;
	line-height: 1.15;
}

.hp-404__body {
	margin: 0 0 36px;
	color: var(--hp-color-muted);
	font-family: var(--hp-font-body);
	font-size: 18px;
	font-weight: 300;
	line-height: 1.55;
}

/*
 * .hp-button contributes ONLY colour and hover (see assets/css/buttons.css) --
 * every context supplies its own metrics. Without them this rendered as bare
 * inline text: the ink ::after hugged the glyphs, and because `overflow: hidden`
 * does not apply to a non-replaced inline box, the cream sweep layer parked at
 * translateY(101%) sat visible below the label instead of being clipped.
 * Metrics mirror .hp-cta__button so both pills read as the same component.
 */
.hp-404__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-width: 209px;
	height: 54px;
	padding: 0 40px;
	border-radius: 27px;
	font-family: var(--hp-font-body);
	font-size: 20px;
	font-weight: 400;
	line-height: 1;
	text-decoration: none;
}

/* Focus ring: the shared pill rule in assets/css/buttons.css owns it. */

@media (max-width: 1024px) {
	.hp-404__button {
		height: 48px;
		padding: 0 36px;
		border-radius: 24px;
		font-size: 18px;
	}
}

.hp-404__suggestions {
	margin-top: 64px;
}

.hp-404__suggestions-title {
	margin: 0 0 16px;
	font-family: var(--hp-font-body);
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--hp-color-muted);
}

.hp-404__list {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px 28px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.hp-404__list a {
	color: inherit;
	font-family: var(--hp-font-display);
	font-size: 20px;
	font-style: italic;
	/* Underline offset rather than a border: keeps the descenders legible. */
	text-underline-offset: 4px;
}

/*
 * Prose links: the indicator is the link's own underline, thickened and
 * dropped further clear of the descenders — no box (client feedback 2026-09,
 * item 5). Neither of these had a focus rule before, so both fell back to the
 * browser ring.
 *
 * 7px, not the 4px token: these links are ALREADY underlined at 4px at rest,
 * so matching the token would leave a ~1px thickness change as the entire
 * focus indicator.
 */
.hp-404__list a:focus-visible,
.hp-legal a:focus-visible {
	outline: none;
	text-decoration: underline;
	text-decoration-color: currentcolor;
	text-decoration-thickness: 3px;
	text-underline-offset: 7px;
}

/*
 * Legal pages (Privacy / Terms — client request 2026-09): plain core-block
 * prose rendered by the index.php loop, constrained to a reading measure.
 * The pages carry a wp:group.hp-legal wrapper in their content; the
 * .hp-legal__placeholder callout marks copy the client/counsel must replace.
 */
.hp-legal {
	max-width: 760px;
	margin-inline: auto;
	padding: 96px var(--hp-pad-right) 120px var(--hp-pad-left);
	color: var(--hp-color-ink);
}

.hp-legal h1 {
	margin: 0 0 12px;
	font-family: var(--hp-font-display);
	font-style: normal;
	font-weight: 400;
	font-size: 48px;
	line-height: 1.1;
}

.hp-legal h2 {
	margin: 40px 0 12px;
	font-family: var(--hp-font-display);
	font-weight: 400;
	font-size: 26px;
	line-height: 1.25;
}

.hp-legal p,
.hp-legal li {
	margin: 0 0 14px;
	font-family: var(--hp-font-body);
	font-weight: 300;
	font-size: 16px;
	line-height: 26px;
}

.hp-legal ul {
	margin: 0 0 14px;
	padding-left: 22px;
}

.hp-legal .hp-legal__placeholder {
	padding: 12px 16px;
	background: var(--hp-color-cream);
	border-left: 3px solid var(--hp-color-terracotta);
	font-style: italic;
}

@media (max-width: 768px) {
	.hp-legal {
		padding: 64px var(--hp-pad-right) 80px var(--hp-pad-left);
	}

	.hp-legal h1 {
		font-size: 36px;
	}
}
