/*
Theme Name: Vere
Description: Vere Models theme. Child of Twenty Twenty-Four; templates live in files, models come from the Vere Core plugin.
Author: Vere Models
Version: 1.2.0
Template: twentytwentyfour
Requires at least: 6.4
Text Domain: vere
*/

/* ---------- Base ---------- */

html {
	color-scheme: dark;
}

/*
 * Mouse/trackpad browsers: vere.js adds .vere-has-scrollbar, hides the native page
 * scrollbar (it takes width and has a grey track) and draws an iPhone-style thin bar
 * that floats over the page. Touch devices keep their own overlay bar.
 */
html.vere-has-scrollbar {
	scrollbar-width: none;
}

html.vere-has-scrollbar::-webkit-scrollbar {
	display: none;
}

/* Scroll areas inside the page (mobile menu, form fields) get a thin dark bar. */
* {
	scrollbar-width: thin;
	scrollbar-color: rgba(244, 242, 238, 0.25) transparent;
}

.vere-scrollbar-zone {
	position: fixed;
	z-index: 99990;
	top: 0;
	right: 0;
	bottom: 0;
	width: 14px;
}

.vere-scrollbar {
	position: fixed;
	z-index: 99991;
	top: 0;
	right: 3px;
	width: 5px;
	min-height: 32px;
	border-radius: 5px;
	background: rgba(244, 242, 238, 0.42);
	box-shadow: 0 0 0 1px rgba(14, 14, 14, 0.25);
	opacity: 0;
	transition: opacity 0.45s ease, width 0.15s ease, background-color 0.15s ease;
	touch-action: none;
}

.vere-scrollbar.is-visible {
	opacity: 1;
	transition-duration: 0.15s, 0.15s, 0.15s;
}

.vere-scrollbar.is-active {
	width: 8px;
	background: rgba(244, 242, 238, 0.7);
}

@media (prefers-reduced-motion: reduce) {
	.vere-scrollbar {
		transition: none;
	}
}

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	/* Never scroll sideways, even if something is a pixel too wide on a tiny screen.
	   clip (not hidden) keeps the sticky header working. */
	overflow-x: clip;
}

::selection {
	background: var(--wp--preset--color--paper);
	color: var(--wp--preset--color--ink);
}

:where(.wp-site-blocks) > main {
	min-height: 60vh;
}

/* Smooth page-to-page transitions (Safari 18.2+, Chrome 126+). The model photo
   carries a view-transition-name from the board into the profile. */
@view-transition {
	navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
	animation-duration: 0.35s;
}

::view-transition-group(*) {
	animation-duration: 0.45s;
	animation-timing-function: cubic-bezier(0.2, 0.6, 0.2, 1);
}

@media (prefers-reduced-motion: reduce) {
	@view-transition {
		navigation: none;
	}
}

/* ---------- Wordmark (logo B: Bodoni Moda, spaced capitals) ---------- */

.vere-wordmark {
	margin: 0;
	line-height: 1;
	white-space: nowrap;
}

.vere-wordmark a {
	display: inline-block;
	/* Letter-spacing adds space after the last letter too; pull it back so the logo stays optically centred. */
	margin-right: -0.26em;
	color: var(--wp--preset--color--paper);
	font-family: var(--wp--preset--font-family--logo);
	/* Shrinks on very narrow phones (Galaxy Fold, 280px) so it never runs into the menu button. */
	font-size: clamp(0.8rem, 4.4vw, 1.15rem);
	font-weight: 400;
	letter-spacing: clamp(0.16em, 1.2vw, 0.26em);
	text-transform: uppercase;
	text-decoration: none;
}

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

.vere-header {
	gap: 16px;
	position: sticky;
	top: 0;
	z-index: 50;
	min-height: 72px;
	box-sizing: border-box;
	padding: 14px var(--vere-gutter, 24px);
	border-bottom: 1px solid rgba(244, 242, 238, 0.1);
	align-items: center;
}

/*
 * The blur lives on a pseudo-element: backdrop-filter on the header itself would
 * become the containing block for the fixed mobile-menu overlay and trap it
 * inside the 70px header bar.
 */
.vere-header::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: rgba(14, 14, 14, 0.86);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
}

.admin-bar .vere-header {
	top: var(--wp-admin--admin-bar--height, 0);
}

.vere-header .wp-block-navigation {
	--navigation-layout-gap: 32px;
	gap: 32px;
	font-size: 0.6875rem;
	font-weight: 500;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.vere-header .wp-block-navigation a {
	text-decoration: none;
}

.vere-header .wp-block-navigation__container {
	gap: 32px;
}

.vere-header .wp-block-navigation .wp-block-navigation-item__content {
	position: relative;
}

.vere-header .wp-block-navigation .wp-block-navigation-item__content:hover,
.vere-header .wp-block-navigation .wp-block-navigation-item__content:focus,
.vere-header .wp-block-navigation .wp-block-navigation-item__content:active,
.vere-header .wp-block-navigation .current-menu-item > .wp-block-navigation-item__content {
	text-decoration: underline;
	text-underline-offset: 6px;
	text-decoration-thickness: 1px;
}

.vere-header .wp-block-navigation__submenu-container {
	min-width: 240px !important;
	padding: 10px 0;
	border: 1px solid rgba(244, 242, 238, 0.12) !important;
	background: var(--wp--preset--color--ink) !important;
}

.vere-header .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	padding: 10px 18px !important;
}

/* Fashion and Commercial & Beauty belong to Women: keep Women marked in the menu there. */
.parent-pageid-80 .vere-header .wp-block-navigation a[href$="/women/"] {
	text-decoration: underline;
	text-underline-offset: 6px;
	text-decoration-thickness: 1px;
}

/* Mobile menu overlay: solid, full screen, left aligned, big serif. */
.vere-header .wp-block-navigation__responsive-container.is-menu-open {
	position: fixed;
	inset: 0;
	overflow-x: hidden;
	overflow-y: auto;
	padding: 24px var(--vere-gutter, 24px) max(24px, env(safe-area-inset-bottom));
	background: var(--wp--preset--color--ink) !important;
	color: var(--wp--preset--color--paper) !important;
	animation: none;
}

.vere-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content,
.vere-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container,
.vere-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item,
.vere-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container {
	align-items: flex-start !important;
	justify-content: flex-start !important;
	text-align: left;
}

.vere-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	padding-top: 72px;
}

.vere-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	gap: 14px;
	font-family: var(--wp--preset--font-family--heading);
	/* Scales with the screen so "Become a model" stays on one line, even at 280px. */
	font-size: clamp(1.75rem, 10vw, 2.6rem);
	font-weight: 500;
	line-height: 1.1;
	letter-spacing: -0.01em;
	text-transform: none;
}

.vere-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container {
	gap: 12px;
	padding: 12px 0 6px 2px !important;
	border: 0 !important;
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.75rem;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

.vere-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	padding: 0 !important;
	color: var(--wp--preset--color--stone);
}

.vere-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	max-width: 100%;
	white-space: normal;
	overflow-wrap: anywhere;
}

/*
 * Open menu: no browser focus boxes. When the menu opens, WordPress moves focus into
 * it and iOS Safari draws a white box around the first group/link. Keyboard users
 * still get a quiet underline on the focused link.
 */
.vere-header .wp-block-navigation__responsive-container.is-menu-open :focus,
.vere-header .wp-block-navigation__responsive-container.is-menu-open :focus-visible {
	outline: none !important;
	box-shadow: none !important;
}

.vere-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content:focus-visible {
	text-decoration: underline;
	text-underline-offset: 6px;
	text-decoration-thickness: 1px;
}

/* Tap feedback: no grey iOS flash, a quick dim under the finger instead. */
a,
button {
	-webkit-tap-highlight-color: transparent;
}

/*
 * Touch screens: no focus rings. After a tap, or when coming back to a board, Safari
 * leaves focus on the tapped card and draws a white box around it. Keyboard users
 * on computers (with a mouse/trackpad) keep their focus rings.
 */
@media (hover: none) {
	a:focus,
	a:focus-visible,
	button:focus,
	button:focus-visible,
	[tabindex]:focus,
	[tabindex]:focus-visible {
		outline: none !important;
	}
}

.vere-header .wp-block-navigation-item__content,
.vere-header .wp-block-navigation__responsive-container-open,
.vere-header .wp-block-navigation__responsive-container-close {
	transition: opacity 0.15s ease;
}

.vere-header .wp-block-navigation-item__content:active,
.vere-header .wp-block-navigation__responsive-container-open:active,
.vere-header .wp-block-navigation__responsive-container-close:active {
	opacity: 0.45;
}

/* After a tap in the open menu: the chosen item stays lit and underlined, the rest fade,
   until the next page appears. Shows the tap "took" even while the server responds. */
.vere-header .wp-block-navigation__responsive-container.vere-is-leaving .wp-block-navigation-item__content {
	opacity: 0.28;
	transition: opacity 0.25s ease;
}

.vere-header .wp-block-navigation__responsive-container.vere-is-leaving .wp-block-navigation-item__content.vere-is-chosen {
	opacity: 1;
	text-decoration: underline;
	text-underline-offset: 8px;
	text-decoration-thickness: 1px;
}

/* Touch screens: a tap leaves a "sticky" hover/focus on iOS, so only the current page is underlined. */
@media (hover: none) {
	.vere-header .wp-block-navigation .wp-block-navigation-item__content:hover,
	.vere-header .wp-block-navigation .wp-block-navigation-item__content:focus,
	.vere-header .wp-block-navigation .wp-block-navigation-item__content:active {
		text-decoration: none;
	}

	.vere-header .wp-block-navigation .current-menu-item > .wp-block-navigation-item__content {
		text-decoration: underline;
	}
}

.vere-header .wp-block-navigation__responsive-container-close {
	top: 22px;
	right: var(--vere-gutter, 24px);
}

/* Homepage: the header floats over the hero. */
.home .vere-header {
	position: fixed;
	left: 0;
	right: 0;
	border-bottom-color: transparent;
}

.home .vere-header::before {
	background: linear-gradient(180deg, rgba(14, 14, 14, 0.5), rgba(14, 14, 14, 0));
	-webkit-backdrop-filter: none;
	backdrop-filter: none;
}

/* On the homepage the hero already shows the big wordmark; the header one fades in once past it. */
.home .vere-header .vere-wordmark {
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.4s ease;
}

.vere-past-hero .home .vere-header .vere-wordmark {
	opacity: 1;
	pointer-events: auto;
}

.vere-past-hero .home .vere-header::before {
	background: rgba(14, 14, 14, 0.86);
	-webkit-backdrop-filter: blur(12px);
	backdrop-filter: blur(12px);
}

/* ---------- Page title (boards, contact, forms) ---------- */

.vere-page-title {
	max-width: 1440px;
	margin: clamp(32px, 6vw, 88px) auto clamp(14px, 2vw, 20px) !important;
	padding: 0 var(--vere-gutter, 24px);
	box-sizing: border-box;
	font-size: clamp(3rem, 8vw, 6.5rem) !important;
	line-height: 0.92;
	letter-spacing: -0.015em;
	text-align: left !important;
}

/* Phones: scale with the screen so a long word like "Commercial" never breaks in two. */
@media (max-width: 599px) {
	.vere-page-title {
		font-size: clamp(1.9rem, 11.5vw, 3rem) !important;
	}
}

/* Room between the page title and what follows (board, form, contact). */
.vere-page-title + .entry-content > :first-child {
	margin-top: clamp(20px, 3vw, 40px);
}

/* ---------- Intro (homepage) ---------- */

.vere-intro {
	display: grid;
	gap: 8px;
	max-width: 1440px;
	margin: clamp(72px, 12vw, 160px) auto 0;
	padding: 0 var(--vere-gutter, 24px);
	box-sizing: border-box;
}

@media (min-width: 900px) {
	.vere-intro {
		grid-template-columns: 1fr 2fr;
		gap: 40px;
	}
}

.vere-intro__body {
	display: grid;
	gap: 16px;
}

.vere-intro__text {
	max-width: 18em;
	margin: 0;
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 500;
	/* Phones: a confident line, not a wall of text. Desktop: a big statement. */
	font-size: clamp(1.6rem, 6.2vw, 3.2rem);
	line-height: 1.12;
	text-wrap: balance;
}

.vere-intro__sub {
	max-width: 34em;
	margin: 0;
	color: #c9c6c0;
	font-size: 0.9375rem;
	line-height: 1.7;
}

/* ---------- Category tiles (Women page) ---------- */

/*
 * Both categories side by side on every screen, sized so the two photos and their
 * names fit on the first screen (column width capped by the viewport height).
 */
.vere-tiles {
	--vere-tile-w: min(calc((100% - 12px) / 2), calc((100svh - 330px) * 0.75));
	display: grid;
	grid-template-columns: repeat(2, var(--vere-tile-w));
	justify-content: center;
	gap: 12px;
	max-width: 1440px;
	margin: 0 auto;
	padding: 0 var(--vere-gutter, 24px);
	box-sizing: border-box;
}

@media (min-width: 700px) {
	.vere-tiles {
		--vere-tile-w: min(calc((100% - 24px) / 2), calc((100svh - 330px) * 0.75));
		gap: 24px;
	}
}

.vere-tiles .wp-block-image {
	margin: 0;
	aspect-ratio: 3 / 4;
	overflow: hidden;
}

.vere-tiles .wp-block-image a {
	display: block;
	height: 100%;
}

.vere-tiles .wp-block-image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 1.2s cubic-bezier(0.2, 0.6, 0.2, 1);
}

@media (hover: hover) and (pointer: fine) {
	.vere-tiles .wp-block-image a:hover img,
	.vere-tiles .wp-block-image a:focus img {
		transform: scale(1.015);
	}
}

.vere-tiles p {
	margin: 14px 0 0;
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 500;
	font-size: clamp(1.8rem, 3vw, 2.6rem);
	line-height: 1;
}

.vere-tiles p a {
	text-decoration: none;
}

/* ---------- Contact ---------- */

.vere-contact {
	display: grid;
	gap: 36px;
	max-width: 1440px;
	margin: 0 auto;
	padding: 0 var(--vere-gutter, 24px);
	box-sizing: border-box;
}

@media (min-width: 700px) {
	.vere-contact {
		grid-template-columns: repeat(3, 1fr);
	}
}

.vere-contact h2 {
	margin: 0 0 10px;
	color: var(--wp--preset--color--stone);
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.6875rem;
	font-weight: 500;
	letter-spacing: 0.18em;
	text-transform: uppercase;
}

.vere-contact p {
	margin: 0;
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 500;
	font-size: clamp(1.6rem, 2.6vw, 2.2rem);
	line-height: 1.1;
}

.vere-contact a {
	text-decoration: none;
}

.vere-contact a:hover,
.vere-contact a:focus,
.vere-contact a:active {
	text-decoration: underline;
	text-underline-offset: 6px;
	text-decoration-thickness: 1px;
}

.vere-about {
	display: grid;
	gap: 40px;
	max-width: 1440px;
	margin: clamp(56px, 10vw, 120px) auto 0;
	padding: 40px var(--vere-gutter, 24px) 0;
	box-sizing: border-box;
	border-top: 1px solid rgba(244, 242, 238, 0.12);
}

@media (min-width: 700px) {
	.vere-about {
		grid-template-columns: 1fr 1fr;
	}
}

.vere-about h2 {
	margin: 0 0 14px;
	font-size: clamp(2rem, 3vw, 2.6rem);
}

.vere-about p {
	max-width: 34em;
	margin: 0;
	color: #c9c6c0;
	line-height: 1.7;
}

/* ---------- Long-form text (privacy policy) ---------- */

.vere-prose {
	max-width: 720px;
	margin: 0 auto;
	padding: 0 var(--vere-gutter, 24px);
	color: #c9c6c0;
	line-height: 1.75;
}

.vere-prose h2 {
	margin: 2.2em 0 0.5em;
	color: var(--wp--preset--color--paper);
	font-size: 1.8rem;
}

.vere-prose p,
.vere-prose ul {
	margin: 0 0 1em;
}

.vere-prose a {
	text-underline-offset: 4px;
}

/* ---------- 404 ---------- */

.vere-404 {
	max-width: 1440px;
	margin: 0 auto;
	padding: clamp(72px, 14vw, 180px) var(--vere-gutter, 24px) 0;
	box-sizing: border-box;
}

.vere-404 h1 {
	margin: 0 0 32px;
	font-size: clamp(3rem, 8vw, 6.5rem);
	line-height: 0.95;
}

.vere-404 p:last-child {
	display: flex;
	gap: 24px;
}

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

.vere-footer {
	margin-top: clamp(96px, 14vw, 200px);
	padding: 56px var(--vere-gutter, 24px) max(28px, env(safe-area-inset-bottom));
	border-top: 1px solid rgba(244, 242, 238, 0.12);
}

.vere-footer__top {
	display: grid;
	gap: 40px;
	max-width: 1440px;
	margin: 0 auto;
}

@media (min-width: 900px) {
	.vere-footer__top {
		grid-template-columns: 1fr 2fr;
	}
}

.vere-footer .vere-wordmark a {
	font-size: clamp(1.3rem, 2.4vw, 1.75rem);
}

.vere-footer__cols {
	display: grid;
	grid-template-columns: 1fr;
	gap: 28px;
}

/* Phones: each group's links sit in a row and wrap as whole links, never mid-label. */
.vere-footer .vere-footer__links {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 22px;
	line-height: 1.6;
}

.vere-footer__links a {
	white-space: nowrap;
}

@media (min-width: 700px) {
	.vere-footer .vere-footer__links {
		flex-direction: column;
		gap: 4px;
	}
}

@media (min-width: 700px) {
	.vere-footer__cols {
		grid-template-columns: repeat(3, 1fr);
	}
}

.vere-footer h2 {
	margin: 0 0 12px;
	color: var(--wp--preset--color--stone);
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.6875rem;
	font-weight: 500;
	letter-spacing: 0.18em;
	text-transform: uppercase;
}

.vere-footer p {
	margin: 0;
	font-size: 0.875rem;
	line-height: 2;
}

.vere-footer a {
	text-decoration: none;
}

.vere-footer a:hover,
.vere-footer a:focus,
.vere-footer a:active {
	text-decoration: underline;
	text-underline-offset: 5px;
}

.vere-footer .vere-footer__legal {
	max-width: 1440px;
	margin: 56px auto 0;
	color: var(--wp--preset--color--stone);
	font-size: 0.6875rem;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}
