/*
 * Phoslinc — extras.css
 *
 * Only contains what cannot be expressed inline on Gutenberg blocks:
 *   - Hero diagonal pattern (CSS pseudo-element)
 *   - Entrance animations (CSS keyframes)
 *   - Hover, focus, and active state effects (CSS pseudo-classes)
 *   - 3-column grid override (Gutenberg uses flex by default)
 *   - Stat strip flex overrides (defeat Gutenberg defaults)
 *   - Navigation underline animation
 *   - Image placeholder visuals
 *   - Spec table refinement
 *   - Responsive overrides
 *
 * Everything else (color, size, weight, spacing, border, radius) is set
 * on the blocks themselves via the editor sidebar.
 */

/* ────────────────────────────────────────────────────────────────────── */
/* -1. Palette variable overrides (defeat stale theme.json values until   */
/*     the theme zip is re-uploaded; harmless once it is)                 */
/* ────────────────────────────────────────────────────────────────────── */
:root {
	--wp--preset--color--orange:    #973e16;
	--wp--preset--color--dark:      #161210;
	--wp--preset--color--body:      #4a3f37;
	--wp--preset--color--muted:     #8a7c6e;
	--wp--preset--color--orange-hot:#ff8a2b;
}

/* ────────────────────────────────────────────────────────────────────── */
/* -1. Skip-to-content link — visually hidden until keyboard-focused      */
/* ────────────────────────────────────────────────────────────────────── */
.ph-skip-link {
	position: absolute;
	left: 1rem;
	top: -3rem;
	z-index: 200;
	background: #e07530;
	color: #161210;
	padding: 0.75rem 1.25rem;
	font-family: Barlow, sans-serif;
	font-size: 0.875rem;
	font-weight: 600;
	text-decoration: none;
	border-radius: 6px;
	transition: top .2s cubic-bezier(.22,.61,.36,1);
}
.ph-skip-link:focus,
.ph-skip-link:focus-visible {
	top: 1rem;
	outline: 2px solid #ff8a2b;
	outline-offset: 3px;
}

/* ────────────────────────────────────────────────────────────────────── */
/* 0. Universal focus indicator — keyboard accessibility                  */
/* ────────────────────────────────────────────────────────────────────── */
:focus { outline: none; }
:focus-visible {
	outline: 2px solid #973e16;
	outline-offset: 3px;
	border-radius: 4px;
}
.wp-block-button__link:focus-visible {
	outline: 2px solid #973e16;
	outline-offset: 3px;
}
/* Focus indicator that works on dark sections too — brighter ring */
.ph-hero a:focus-visible,
header a:focus-visible,
footer a:focus-visible {
	outline: 2px solid #ff8a2b;
	outline-offset: 3px;
}

/* ────────────────────────────────────────────────────────────────────── */
/* 1. Hero overlay — dark wash + diagonal line pattern                    */
/*                                                                        */
/* Two stacked backgrounds on a single ::before:                          */
/*   - top:  repeating diagonal lines (very faint, decorative)            */
/*   - bottom: vertical dark gradient that darkens any hero bg image so   */
/*             white/orange text on top stays legible.                    */
/*                                                                        */
/* The dark wash is weighted: 75% at top (under H1), 55% mid, 75% bottom  */
/* (under the stat strip). Pure cover gradient if no bg image is set.     */
/* ────────────────────────────────────────────────────────────────────── */
.ph-hero { position: relative; overflow: hidden; }
.ph-hero > * { position: relative; z-index: 1; }
.ph-hero::before {
	content: '';
	position: absolute;
	inset: 0;
	background:
		repeating-linear-gradient(
			-55deg,
			transparent,
			transparent 42px,
			rgba(255,255,255,.045) 42px,
			rgba(255,255,255,.045) 43px
		),
		linear-gradient(
			180deg,
			rgba(22,18,16,0.78) 0%,
			rgba(22,18,16,0.55) 55%,
			rgba(22,18,16,0.78) 100%
		);
	pointer-events: none;
	z-index: 0;
}

/* ────────────────────────────────────────────────────────────────────── */
/* 2. Entrance animations (ease-out-quart for natural deceleration)       */
/* ────────────────────────────────────────────────────────────────────── */
@keyframes ph-rise {
	from { opacity: 0; transform: translateY(24px); }
	to   { opacity: 1; transform: translateY(0); }
}
.ph-a1 { animation: ph-rise .6s cubic-bezier(.22,.61,.36,1) both; }
.ph-a2 { animation: ph-rise .6s .08s cubic-bezier(.22,.61,.36,1) both; }
.ph-a3 { animation: ph-rise .6s .16s cubic-bezier(.22,.61,.36,1) both; }
.ph-a4 { animation: ph-rise .6s .24s cubic-bezier(.22,.61,.36,1) both; }

@media (prefers-reduced-motion: reduce) {
	.ph-a1, .ph-a2, .ph-a3, .ph-a4 { animation: none; opacity: 1; transform: none; }
	.ph-card, .wp-block-button__link { transition: none !important; }
}

/* ────────────────────────────────────────────────────────────────────── */
/* 3. Card hover lift                                                     */
/* ────────────────────────────────────────────────────────────────────── */
.ph-card {
	transition: transform .25s cubic-bezier(.22,.61,.36,1),
	            box-shadow .25s cubic-bezier(.22,.61,.36,1);
}
@media (hover: hover) {
	.ph-card:hover {
		transform: translateY(-4px);
		box-shadow: 0 14px 36px rgba(22,18,16,.10);
	}
}

/* ────────────────────────────────────────────────────────────────────── */
/* 4. Button micro-interactions                                           */
/* ──                                                                     */
/* Three button styles, each with a distinct hover state:                 */
/*   1. Primary orange — bg darkens to #6e2d10, text stays dark           */
/*   2. Ghost (on dark) — bg gets a faint off-white tint, text stays      */
/*   3. Outline blue   — bg gets a faint blue tint, text stays blue       */
/* Inline styles on the anchor must be defeated with !important.          */
/* ────────────────────────────────────────────────────────────────────── */
.wp-block-button__link {
	transition: background-color .2s cubic-bezier(.22,.61,.36,1),
	            color .2s cubic-bezier(.22,.61,.36,1),
	            transform .12s cubic-bezier(.22,.61,.36,1),
	            box-shadow .25s cubic-bezier(.22,.61,.36,1),
	            border-color .2s ease;
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}
.wp-block-button__link:active {
	transform: scale(.97);
}

/* 4a. Primary orange button — darken-on-hover; text stays dark           */
/* (matches every button that isn't ghost or outline)                     */
.wp-block-button:not(.is-style-outline):not(.ph-btn-ghost) .wp-block-button__link:hover,
.wp-block-button:not(.is-style-outline):not(.ph-btn-ghost) .wp-block-button__link:focus-visible {
	background-color: #6e2d10 !important;
	color: #161210 !important;
	box-shadow: 0 8px 22px rgba(151,62,22,.28) !important;
	filter: none !important;
}

/* 4b. Ghost button on dark backgrounds — keep off-white text             */
.ph-btn-ghost .wp-block-button__link:hover,
.ph-btn-ghost .wp-block-button__link:focus-visible {
	background-color: rgba(248,247,244,0.10) !important;
	color: #F8F7F4 !important;
	border-color: rgba(248,247,244,0.65) !important;
	box-shadow: none !important;
	filter: none !important;
}

/* 4c. Outline (blue spec-sheet) buttons — keep blue text, blue-tint bg   */
.is-style-outline .wp-block-button__link:hover,
.is-style-outline .wp-block-button__link:focus-visible {
	background-color: rgba(43,108,176,0.08) !important;
	color: #2b6cb0 !important;
	border-color: #2b6cb0 !important;
	box-shadow: 0 6px 18px rgba(43,108,176,.18) !important;
	filter: none !important;
}

/* ────────────────────────────────────────────────────────────────────── */
/* 5a. Two-column equal grid (used in spec-page gallery)                  */
/* ────────────────────────────────────────────────────────────────────── */
@media (min-width: 800px) {
	.wp-block-columns.ph-grid-2 {
		display: grid !important;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 1.5rem;
	}
	.wp-block-columns.ph-grid-2 > .wp-block-column {
		flex: none !important;
		margin: 0 !important;
		min-width: 0 !important;
	}
}

/* ────────────────────────────────────────────────────────────────────── */
/* 5. Three-column grid (replace Gutenberg's flex with CSS grid)          */
/* ────────────────────────────────────────────────────────────────────── */
@media (min-width: 800px) {
	.wp-block-columns.ph-grid {
		display: grid !important;
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 1.5rem;
	}
	.wp-block-columns.ph-grid > .wp-block-column {
		flex: none !important;
		margin: 0 !important;
		min-width: 0 !important;
	}
}

/* ────────────────────────────────────────────────────────────────────── */
/* 6. Stat strip — labels bumped from 40% to 60% opacity for legibility   */
/* ────────────────────────────────────────────────────────────────────── */
.wp-block-columns.ph-stats {
	flex-wrap: nowrap !important;
	gap: 0 !important;
	align-items: stretch;
}
.wp-block-column.ph-stat {
	flex: 1 1 0 !important;
	min-width: 0 !important;
	margin-bottom: 0 !important;
	border-right: 1px solid rgba(248,247,244,0.10);
}
.wp-block-column.ph-stat:last-child {
	border-right: 0;
}
/* Bump stat label legibility (40% → 60%) */
.wp-block-column.ph-stat p {
	color: rgba(248,247,244,0.6) !important;
}

/* ────────────────────────────────────────────────────────────────────── */
/* 7. Header navigation — sliding underline on hover/focus                */
/* ────────────────────────────────────────────────────────────────────── */
header .ph-nav a {
	color: inherit;
	text-decoration: none;
	position: relative;
	padding-bottom: 4px;
	transition: color .18s ease;
}
header .ph-nav a::after {
	content: '';
	position: absolute;
	left: 0; right: 100%;
	bottom: 0;
	height: 2px;
	background: #e07530;
	transition: right .24s cubic-bezier(.22,.61,.36,1);
}
header .ph-nav a:hover,
header .ph-nav a:focus-visible {
	color: #ffffff;
}
header .ph-nav a:hover::after,
header .ph-nav a:focus-visible::after {
	right: 0;
}
header .wp-block-site-title a {
	text-decoration: none;
	color: inherit;
	transition: color .18s ease;
}
header .wp-block-site-title a:hover {
	color: #e07530;
}

/* ── Logo image — header & footer ────────────────────────────────────── */
.ph-logo {
	margin: 0;
	line-height: 0;
}
.ph-logo a {
	display: inline-block;
	transition: opacity .18s ease;
}
.ph-logo a:hover {
	opacity: 0.78;
}
.ph-logo img {
	display: block;
	height: auto;
	max-width: 100%;
}
/* Header logo: ~142px wide × 80px tall (16:9 source, aspect-locked) */
header .ph-logo-h img {
	max-height: 80px;
	width: 100%;
}
footer .ph-logo-stacked img {
	max-height: 160px;
}

/* ────────────────────────────────────────────────────────────────────── */
/* Sticky scroll-direction header                                         */
/*                                                                        */
/* - Header is fixed at the top                                           */
/* - On scroll-down: header translates off-screen (transform Y -100%)     */
/* - On scroll-up: header pops back into view                             */
/* - At the very top of the page: always visible                          */
/*                                                                        */
/* JS toggles the .ph-header-hidden class on the <header> element.        */
/* The CSS var --ph-header-h tracks actual rendered header height so we   */
/* can offset body content correctly (no white gap between header and    */
/* hero — body padding-top exactly equals header height).                 */
/* ────────────────────────────────────────────────────────────────────── */
:root {
	--ph-header-h: 120px;
}
body {
	margin: 0;
	padding-top: var(--ph-header-h);
}
html {
	scroll-padding-top: calc(var(--ph-header-h) + 1rem);
}

/* Kill the layout-flow block-gap between top-level sections so there's
   no visible strip between header and main / main and footer. */
.wp-site-blocks > * + *,
body > .wp-site-blocks > * {
	margin-block-start: 0 !important;
}

header.wp-block-group {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	width: 100%;
	z-index: 100;
	transform: translateY(0);
	transition: transform .35s cubic-bezier(.22,.61,.36,1);
	box-shadow: 0 1px 0 rgba(248,247,244,0.04);
}
header.wp-block-group.ph-header-hidden {
	transform: translateY(-100%);
}

/* Print: header restores to normal flow */
@media print {
	header.wp-block-group {
		position: static !important;
		transform: none !important;
	}
	body { padding-top: 0 !important; }
}

/* Hero & footer plain-text link hover — EXCLUDE button anchors so we don't
   set button text to orange (which equals the orange button bg = invisible). */
.ph-hero a:not(.wp-block-button__link):not(.wp-element-button),
footer  a:not(.wp-block-button__link):not(.wp-element-button) {
	transition: color .18s ease;
}
.ph-hero a:not(.wp-block-button__link):not(.wp-element-button):hover,
footer  a:not(.wp-block-button__link):not(.wp-element-button):hover {
	color: #e07530;
}

/* ────────────────────────────────────────────────────────────────────── */
/* 8. Long-word safety on big display text                                */
/* ────────────────────────────────────────────────────────────────────── */
.ph-hero h1,
.ph-hero h2 {
	overflow-wrap: break-word;
	hyphens: none;
}

/* ────────────────────────────────────────────────────────────────────── */
/* 8b. Hero H1 size override — defeats over-large inline clamp values     */
/* ────────────────────────────────────────────────────────────────────── */
.ph-hero h1 {
	font-size: clamp(2.25rem, 6vw, 5.25rem) !important;
	letter-spacing: -0.03em !important;
	line-height: 1 !important;
}

/* ────────────────────────────────────────────────────────────────────── */
/* 8c. Image placeholder — gray box for empty <wp:image /> blocks         */
/* ────────────────────────────────────────────────────────────────────── */
figure.ph-image-placeholder {
	position: relative;
	margin: 0;
	background: #ECEAE0;
	border-radius: 8px;
	overflow: hidden;
	aspect-ratio: 4 / 3;
	display: flex;
	align-items: center;
	justify-content: center;
}
figure.ph-image-placeholder img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
figure.ph-image-placeholder img:not([src]),
figure.ph-image-placeholder img[src=""] {
	display: none;
}
figure.ph-image-placeholder:has(img:not([src])),
figure.ph-image-placeholder:has(img[src=""]),
figure.ph-image-placeholder:not(:has(img[src])) {
	background-color: #ECEAE0;
	background-image:
		linear-gradient(135deg, transparent 46%, rgba(22,18,16,0.06) 46% 54%, transparent 54%),
		linear-gradient(45deg,  transparent 46%, rgba(22,18,16,0.06) 46% 54%, transparent 54%);
}
figure.ph-image-placeholder:has(img:not([src]))::after,
figure.ph-image-placeholder:has(img[src=""])::after,
figure.ph-image-placeholder:not(:has(img[src]))::after {
	content: "Product image";
	position: absolute;
	font-family: Barlow, sans-serif;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: #8a7c6e;
}

/* Card-specific placeholder */
figure.ph-card-image {
	aspect-ratio: 16 / 9;
	border-radius: 8px 8px 0 0 !important;
}

/* ────────────────────────────────────────────────────────────────────── */
/* 8d. Spec table — warm-tinted neutrals, row hover                       */
/* ────────────────────────────────────────────────────────────────────── */
.ph-spec-table {
	overflow: hidden;
}
.ph-spec-table table {
	border-collapse: collapse;
	width: 100%;
	font-family: Barlow, sans-serif;
	font-size: 0.95rem;
}
.ph-spec-table td,
.ph-spec-table th {
	padding: 0.95rem 1.25rem;
	border-bottom: 1px solid #E8E6DE;
	text-align: left;
	vertical-align: top;
	transition: background-color .15s ease;
}
.ph-spec-table tr:last-child td,
.ph-spec-table tr:last-child th {
	border-bottom: 0;
}
.ph-spec-table td:first-child,
.ph-spec-table th:first-child {
	width: 42%;
	color: #161210;
	background: #FAFAF8;
	font-weight: 600;
}
.ph-spec-table td:not(:first-child) {
	color: #4a3f37;
}
.ph-spec-table tr:nth-child(even) td:first-child {
	background: #F5F4EE;
}
.ph-spec-table tr:hover td {
	background-color: rgba(151,62,22,0.04);
}

/* ────────────────────────────────────────────────────────────────────── */
/* 9. Section transitions — subtle bottom border between sections         */
/* (only between same-color sections, keeps the eye moving down)          */
/* ────────────────────────────────────────────────────────────────────── */
main > .wp-block-group.has-background + .wp-block-group.has-background {
	position: relative;
}

/* ────────────────────────────────────────────────────────────────────── */
/* 10. Selection color — brand-tinted                                     */
/* ────────────────────────────────────────────────────────────────────── */
::selection {
	background: rgba(151,62,22,0.85);
	color: #ffffff;
}

/* ────────────────────────────────────────────────────────────────────── */
/* 11. Responsive: tablet (≤ 1024px)                                      */
/* ────────────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
	.ph-hero,
	.wp-block-group[class*="has-background"] {
		padding-left: 1.25rem !important;
		padding-right: 1.25rem !important;
	}
}

/* ────────────────────────────────────────────────────────────────────── */
/* 12. Responsive: mobile (≤ 800px)                                       */
/* ────────────────────────────────────────────────────────────────────── */
@media (max-width: 799px) {

	/* Tighter outer padding on every section */
	.ph-hero,
	main > .wp-block-group {
		padding-top: 3rem !important;
		padding-bottom: 3rem !important;
		padding-left: 1rem !important;
		padding-right: 1rem !important;
	}

	/* Hero H1 sized for thumb-width screens */
	.ph-hero h1 {
		font-size: clamp(2rem, 9vw, 2.75rem) !important;
		letter-spacing: -0.02em !important;
		line-height: 1.05 !important;
	}

	/* Section H2 sized for mobile */
	.wp-block-group h2 {
		font-size: clamp(1.5rem, 6vw, 2rem) !important;
	}

	/* Hero subhead smaller */
	.ph-hero p {
		font-size: 1rem !important;
	}

	/* Buttons row stacks and full-width */
	.wp-block-buttons {
		flex-direction: column !important;
		align-items: stretch !important;
		width: 100%;
		gap: 0.75rem !important;
	}
	.wp-block-buttons .wp-block-button {
		width: 100% !important;
		margin: 0 !important;
	}
	.wp-block-buttons .wp-block-button__link {
		display: flex;
		text-align: center;
		width: 100%;
		box-sizing: border-box;
	}

	/* Stat strip → 2x2 grid */
	.wp-block-columns.ph-stats {
		flex-wrap: wrap !important;
		gap: 0 !important;
	}
	.wp-block-column.ph-stat {
		flex: 0 0 50% !important;
		max-width: 50%;
		padding: 1.25rem 0.75rem !important;
		border-right: 1px solid rgba(248,247,244,0.10);
		border-bottom: 1px solid rgba(248,247,244,0.10);
	}
	.wp-block-column.ph-stat:nth-child(2n) { border-right: 0; }
	.wp-block-column.ph-stat:nth-last-child(-n+2) { border-bottom: 0; }
	.wp-block-column.ph-stat h3 { font-size: 1.5rem !important; }

	/* 3-column grid → single column */
	.wp-block-columns.ph-grid {
		display: flex !important;
		flex-direction: column !important;
		gap: 1rem !important;
	}
	.wp-block-columns.ph-grid > .wp-block-column {
		flex-basis: 100% !important;
		margin: 0 !important;
		min-width: 0 !important;
	}

	/* Generic 2-column splits (e.g. about page 60/40) stack */
	.wp-block-columns:not(.ph-stats):not(.ph-grid) {
		flex-direction: column !important;
		gap: 1.5rem !important;
	}
	.wp-block-columns:not(.ph-stats):not(.ph-grid) > .wp-block-column {
		flex-basis: 100% !important;
	}

	/* Card padding shrinks */
	.ph-card {
		padding: 1.5rem !important;
	}

	/* Footer columns stack */
	footer .wp-block-columns {
		flex-direction: column !important;
		gap: 2rem !important;
	}
	footer .wp-block-columns > .wp-block-column {
		flex-basis: 100% !important;
	}

	/* Header: logo above nav, centered */
	header .wp-block-group {
		flex-direction: column !important;
		align-items: center !important;
		gap: 0.75rem !important;
	}
	header .ph-nav {
		gap: 1.25rem !important;
		justify-content: center !important;
	}
	header .ph-logo-h {
		width: 110px !important;
	}
	header .ph-logo-h img {
		max-height: 62px;
	}
	footer .ph-logo-stacked {
		width: 90px !important;
	}
	footer .ph-logo-stacked img {
		max-height: 130px;
	}

	/* Quicker animations on mobile */
	.ph-a1, .ph-a2, .ph-a3, .ph-a4 {
		animation-duration: 0.4s !important;
		animation-delay: 0s !important;
	}

	/* Spec table — tighten padding */
	.ph-spec-table table { font-size: 0.875rem; }
	.ph-spec-table td,
	.ph-spec-table th { padding: 0.7rem 0.9rem; }

	/* Spec page gallery */
	figure.ph-image-placeholder { aspect-ratio: 16 / 10; }
}

/* ────────────────────────────────────────────────────────────────────── */
/* 13. Very small phones (≤ 380px)                                        */
/* ────────────────────────────────────────────────────────────────────── */
@media (max-width: 380px) {
	.ph-hero h1 {
		font-size: 1.75rem !important;
	}
	.wp-block-column.ph-stat {
		flex: 0 0 100% !important;
		max-width: 100%;
		border-right: 0;
	}
	.wp-block-column.ph-stat:nth-last-child(-n+1) { border-bottom: 0; }
}
