/**
 * PROM navigation & contact. Only on pages using a PROM navigation (body.prom-nav, set by class-prom-nav.php).
 * Semplice styles the bar, logo and both buttons and makes the bar sticky; this file adds
 * the dropdowns, the MENU label roll and the mobile + / ×. Also the page layout that keeps the footer at the bottom
 * of short pages (it applies to the same pages).
 */

body.prom-nav {
	--prom-nav-yellow: #E8D475;
	--prom-nav-cream: #FAF6E3;
	--prom-nav-brown: #474038;
	--prom-nav-pad: 1.4444444444444444rem; /* the bar's side padding in Semplice (26px) */
}

/* The sticky bar: Semplice clips its nav sections (overflow: hidden), which would cut off the menu below it.
   No backdrop (PROM-12: the frosted strip isn't wanted); the logo changes colour over dark content instead. */
body.prom-nav .semplice-header #navbar-top {
	overflow: visible;
	transition: background-color 300ms ease;
}

/* While the contact panel is open the bar turns solid yellow (the panel hangs from it). */
body.prom-nav.prom-contact-open .semplice-header #navbar-top { background-color: var(--prom-nav-yellow); }

/* Logo over dark content (PROM-12, Entropico reference): it turns cream. nav.js checks what's under the logo and sets
   body.prom-nav-dark; it also gives the logo's link the image as --prom-logo-mask. The cream copy is the logo's shape
   (mask) filled with cream, laid over the image and cross-faded, so the colour is exact and the change is smooth.
   A blend mode (Entropico's `difference`) can't reach the page through Semplice's fixed header, and it would give
   brown only over cream. */
body.prom-nav #navbar-top .image-link[style*="--prom-logo-mask"] { position: relative; display: inline-block; }
body.prom-nav #navbar-top .image-link[style*="--prom-logo-mask"] img { transition: opacity 250ms ease; }
body.prom-nav #navbar-top .image-link[style*="--prom-logo-mask"]::after {
	content: '';
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: var(--prom-nav-cream);
	-webkit-mask: var(--prom-logo-mask) center / 100% 100% no-repeat;
	mask: var(--prom-logo-mask) center / 100% 100% no-repeat;
	opacity: 0;
	transition: opacity 250ms ease;
}
body.prom-nav.prom-nav-dark #navbar-top .image-link[style*="--prom-logo-mask"] img { opacity: 0; }
body.prom-nav.prom-nav-dark #navbar-top .image-link[style*="--prom-logo-mask"]::after { opacity: 1; }

/* Buttons (Figma "Navigation"): 100 × 32, text centred. Font, size, colours, radius and side padding are the
   navigation's own button settings in Semplice; it has no fixed width or height, so those are here. */
body.prom-nav #navbar-top .smp-nav-button {
	box-sizing: border-box;
	min-width: 100px;
	height: 32px;
	align-items: center;
	justify-content: center;
}

/* Open state (Figma "Dropdown Menu"): the open button is cream, the other one cream at 60% while a panel is open.
   Beats Semplice's `.nav_<id> #<module> button` (one ID, one class, one element). */
body.prom-nav #navbar-top .smp-nav-button.is-open { background: var(--prom-nav-cream); }
body.prom-nav:is(.prom-contact-open, .prom-menu-open) #navbar-top .smp-nav-button:not(.is-open) { background: rgba(250, 246, 227, 0.6); }
body.prom-nav #navbar-top .smp-nav-button { transition: background-color 200ms ease, transform 160ms ease-out; }
body.prom-nav #navbar-top .smp-nav-button:active { transform: scale(0.97); }
body.prom-nav #navbar-top .smp-nav-button:focus-visible { outline: 1px solid var(--prom-nav-brown); outline-offset: 3px; }

/* MENU ↔ CLOSE label roll: .text is a one-line window that clips; .prom-roll holds both labels stacked and
   nav.js moves it up by half its height. */
body.prom-nav #navbar-top .prom-roll {
	display: block;
	text-align: center;
	will-change: transform;
}
body.prom-nav #navbar-top .prom-roll > span { display: block; height: 1.2em; line-height: 1.2em; }
body.prom-nav #navbar-top .smp-nav-button .text:has(.prom-roll) {
	display: inline-block;
	height: 1.2em;
	overflow: hidden;
	vertical-align: middle;
}
body.prom-nav #navbar-top .prom-visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Mobile: MENU becomes a + button that turns into ×. Figma ("Contact Menu - Mobile"): 34 × 32 (the same height as
   CONTACT; the label is only made invisible) and a 12px plus with a 2px stroke. */
@media screen and (max-width: 543.98px) {
	body.prom-nav #navbar-top .smp-nav-button[data-href$="#prom-menu"] {
		position: relative;
		min-width: 0;
		width: 34px;
		padding-left: 0;
		padding-right: 0;
		overflow: hidden; /* the invisible MENU label is wider than the button */
	}
	/* Invisible here, but its line box sets the height: one normal line, like CONTACT's (the roll window is 1.2em). */
	body.prom-nav #navbar-top .smp-nav-button[data-href$="#prom-menu"] .text { opacity: 0; height: 1lh; }
	body.prom-nav #navbar-top .smp-nav-button[data-href$="#prom-menu"]::before,
	body.prom-nav #navbar-top .smp-nav-button[data-href$="#prom-menu"]::after {
		content: '';
		position: absolute;
		top: 50%;
		left: 50%;
		width: 12px;
		height: 2px;
		margin: -1px 0 0 -6px;
		background: var(--prom-nav-brown);
		transition: transform 300ms cubic-bezier(0.23, 1, 0.32, 1);
	}
	body.prom-nav #navbar-top .smp-nav-button[data-href$="#prom-menu"]::after { transform: rotate(90deg); }
	body.prom-nav #navbar-top .smp-nav-button.is-open[data-href$="#prom-menu"]::before { transform: rotate(45deg); }
	body.prom-nav #navbar-top .smp-nav-button.is-open[data-href$="#prom-menu"]::after { transform: rotate(135deg); }
}

/* The menu: a list hanging under the buttons inside the sticky bar, no scroll lock, no background. Like the logo,
   each link turns cream over dark content (nav.js checks what's under it and sets .is-dark), so the links stay
   readable over films (PROM-12, dev 2026-11-13: "colour change like the PROM logo, not the whole background"; the
   yellow panel of 0.12.0 was removed). */
.prom-menu {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	z-index: 1;
	overflow: hidden; /* the links slide in from the panel's edge */
	padding: 0 var(--prom-nav-pad) 1.6667rem;
	/* No background since 0.13.0, so the full-width panel is invisible: let clicks through it to the page ("Back to
	   Directors" under it couldn't be clicked with the menu open). Only the links take the pointer. */
	pointer-events: none;
}
.prom-menu[hidden] { display: none; }
.prom-menu__list {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 0.2em;
	margin: 0;
	padding: 0;
	list-style: none;
}
.prom-menu__list li {
	font-family: "NeulisAlt-SemiBold-1", sans-serif;
	font-size: clamp(1.25rem, 1.9vw, 1.75rem); /* 20–28px; nav.js grows the hovered one */
	line-height: 0.95;
	text-align: right;
	text-transform: uppercase;
}
.prom-menu__list a {
	pointer-events: auto;
	color: var(--prom-nav-brown);
	text-decoration: none;
	transition: color 250ms ease; /* as the logo's cross-fade */
}
.prom-menu__list li.is-dark a { color: var(--prom-nav-cream); }
.prom-menu__list a:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }
@media screen and (max-width: 543.98px) {
	.prom-menu__list li { font-size: 1.25rem; }
}

/* Contact panel: Semplice-rendered content, hanging just below the sticky bar. */
.prom-contact {
	position: fixed;
	top: var(--prom-nav-bottom, 80px);
	left: 0;
	right: 0;
	z-index: 251; /* under Semplice's sticky bar */
	max-height: calc(100dvh - var(--prom-nav-bottom, 80px));
	overflow: hidden auto;
	overscroll-behavior: contain;
}
.prom-contact[hidden] { display: none; }
.prom-contact__inner { will-change: transform; }
.prom-contact a:focus-visible { outline: 1px solid var(--prom-nav-yellow); outline-offset: 3px; }
/* Full-width ("fluid") sections in the panel, as on the page (PROM-11: the panel's content lined up with a 1480px
   column on wide screens). Semplice's own fluid rules are scoped to #content-holder, which the panel is outside of:
   `#content-holder [data-layout=fluid] smp-container { width: 100%; max-width: 100% }` and `… smp-row { margin: 0 }`. */
.prom-contact [data-layout=fluid] smp-container { width: 100%; max-width: 100%; }
.prom-contact [data-layout=fluid] smp-container smp-row { margin: 0; }
/* Vertical alignment (PROM-12: "LET'S WORK TOGETHER." sits at the bottom of the panel): Semplice's section
   alignment rules are scoped to #content-holder too. Its module CSS needs nothing: class-prom-nav.php rewrites it. */
.prom-contact [data-valign=bottom] smp-container smp-row { align-items: flex-end; }
.prom-contact [data-valign=center] smp-container smp-row { align-items: center; }
/* LinkedIn as in Figma: the boxed "in" (Semplice's icon is a bare "in", and its icons aren't replaceable). The
   module's own icon is hidden and the boxed mark drawn in its place, same size and colour (currentColor = the
   cream fill set below). */
.prom-contact [data-module=socialprofiles] .social-profile-linkedin a { color: var(--prom-nav-cream); transition: color 0.2s ease-out; }
.prom-contact [data-module=socialprofiles] .social-profile-linkedin a:hover { color: var(--prom-nav-yellow); }
.prom-contact [data-module=socialprofiles] .social-profile-linkedin svg { visibility: hidden; }
.prom-contact [data-module=socialprofiles] .social-profile-linkedin a { position: relative; }
.prom-contact [data-module=socialprofiles] .social-profile-linkedin a::before {
	content: '';
	position: absolute;
	top: 0;
	bottom: 0;
	left: 50%;
	aspect-ratio: 1;
	transform: translateX(-50%);
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M22.22 0H1.77C.79 0 0 .77 0 1.73v20.54C0 23.23.79 24 1.77 24h20.45c.98 0 1.78-.77 1.78-1.73V1.73C24 .77 23.2 0 22.22 0zM7.12 20.45H3.56V9h3.56v11.45zM5.34 7.43a2.06 2.06 0 1 1 0-4.13 2.06 2.06 0 0 1 0 4.13zm15.11 13.02h-3.55v-5.57c0-1.33-.03-3.04-1.85-3.04-1.85 0-2.14 1.45-2.14 2.94v5.67H9.35V9h3.41v1.56h.05c.48-.9 1.64-1.85 3.37-1.85 3.6 0 4.27 2.37 4.27 5.46v6.28z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M22.22 0H1.77C.79 0 0 .77 0 1.73v20.54C0 23.23.79 24 1.77 24h20.45c.98 0 1.78-.77 1.78-1.73V1.73C24 .77 23.2 0 22.22 0zM7.12 20.45H3.56V9h3.56v11.45zM5.34 7.43a2.06 2.06 0 1 1 0-4.13 2.06 2.06 0 0 1 0 4.13zm15.11 13.02h-3.55v-5.57c0-1.33-.03-3.04-1.85-3.04-1.85 0-2.14 1.45-2.14 2.94v5.67H9.35V9h3.41v1.56h.05c.48-.9 1.64-1.85 3.37-1.85 3.6 0 4.27 2.37 4.27 5.46v6.28z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Phones (Figma "Contact Menu - Mobile"): one column, "Follow us" and the icons on the left like everything else.
   Semplice's alignments have no per-breakpoint value: the icons' is an option, "Follow us"'s an inline style written
   by its text editor (hence !important; the module has the class prom-contact-follow). */
@media screen and (max-width: 767.98px) {
	.prom-contact [data-module=socialprofiles] [data-align=right] ul { justify-content: flex-start; }
	.prom-contact .prom-contact-follow p { text-align: left !important; }
}

/* Page edges = the header's edges, at every width (PROM-12: "content should align with the left edge of the PROM logo
   and the right edge of the Menu button"). Semplice puts a section's content at its container's outer padding (20px
   desktop, a Customize › Grid setting; 30px tablet and 20px phone, fixed in the theme) and, in fluid sections, half
   a gutter further in: their rows lose the negative margin that grid sections' rows have. So it sat at 30 / 40 / 30px
   while the header sits at 26px. Here every container takes the header's padding, and fluid rows get their negative
   margin back (Semplice's own gutter variables, defined on rows), so content starts exactly at the header's edge. */
body.prom-nav #content-holder smp-container,
body.prom-nav .prom-contact smp-container {
	padding-left: var(--prom-nav-pad);
	padding-right: var(--prom-nav-pad);
}
body.prom-nav :is(#content-holder, .prom-contact) [data-layout=fluid] smp-container smp-row {
	margin-left: calc(var(--smp-grid-gap-desktop) / -2);
	margin-right: calc(var(--smp-grid-gap-desktop) / -2);
}
@media (max-width: 991.98px) {
	body.prom-nav :is(#content-holder, .prom-contact) [data-layout=fluid] smp-container smp-row {
		margin-left: calc(var(--smp-grid-gap-mobile) / -2);
		margin-right: calc(var(--smp-grid-gap-mobile) / -2);
	}
}

/* Text links (PROM-12). Text modules in Semplice; these classes are set on the module (Semplice › module › CSS class).
   "See more work" (home and director page), Figma "Text link": muted, the arrow 3px after the text; on hover the
   text goes to full colour and the arrow slides 6px right. Resting colour: brown at 80%, about as strong as Figma's grey (Figma's hover variant: gap 3 → 9). The arrow is drawn
   here, so the text stays plain in Semplice. Figma's grey/black are library colours; PROM's brown is used here. */
body.prom-nav #content-holder .prom-more-link a {
	color: rgba(71, 64, 56, 0.8);
	text-decoration: none;
	transition: color 250ms ease;
}
/* The arrows are drawn, not typed: Figma's is short, about cap-height tall, with a stroke as heavy as the text's.
   No font's arrow matched by eye (Inter's is long and thin, Neulis's short and heavy). Matched visually to the
   Figma (dev, 2026-11-13), in the text colour via a mask. */
body.prom-nav #content-holder .prom-more-link a::after,
body.prom-nav #content-holder .prom-back-link a::before {
	content: '';
	display: inline-block;
	width: 0.72em;
	height: 0.72em;
	background: currentColor;
	-webkit-mask: var(--prom-arrow) center / contain no-repeat;
	mask: var(--prom-arrow) center / contain no-repeat;
}
body.prom-nav #content-holder :is(.prom-more-link, .prom-back-link) {
	--prom-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23000' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1.5 8h13M8.5 2l6 6-6 6'/%3E%3C/svg%3E");
}
body.prom-nav #content-holder .prom-more-link a::after {
	margin-left: 0.3em;
	transition: transform 300ms cubic-bezier(0.23, 1, 0.32, 1);
}
body.prom-nav #content-holder .prom-more-link a:is(:hover, :focus-visible) { color: var(--prom-nav-brown); }
body.prom-nav #content-holder .prom-more-link a:is(:hover, :focus-visible)::after { transform: translateX(6px); }

/* "← Back to Directors" (director page): no underline at rest; on hover one draws in from the left under the words
   only, not the arrow (Figma). The words are the link's span; the arrow is drawn here. */
body.prom-nav #content-holder .prom-back-link a {
	color: var(--prom-nav-brown);
	text-decoration: none;
}
body.prom-nav #content-holder .prom-back-link a::before {
	margin-right: 0.3em;
	transform: scaleX(-1); /* the same arrow, pointing back */
}
body.prom-nav #content-holder .prom-back-link a span {
	background: linear-gradient(currentColor, currentColor) left bottom / 0% 1px no-repeat;
	padding-bottom: 1px;
	transition: background-size 350ms cubic-bezier(0.23, 1, 0.32, 1);
}
body.prom-nav #content-holder .prom-back-link a:is(:hover, :focus-visible) span { background-size: 100% 1px; }
@media (prefers-reduced-motion: reduce) {
	body.prom-nav #content-holder .prom-more-link a,
	body.prom-nav #content-holder .prom-more-link a::after,
	body.prom-nav #content-holder .prom-back-link a span { transition: none; }
}

/* Footer at the bottom of short pages (Figma; a filtered Work page or the Directors list used to leave it
   mid-screen). Semplice's .content-container is already at least one screen tall: its wrappers grow to fill it,
   and the footer (its section has the class `prom-site-footer`, set in Semplice › Footers) takes the space left
   above it. Pages without that class are unchanged. Sections never shrink below their own height. */
body.prom-nav .content-container.active-content,
body.prom-nav .content-container.active-content > .transition-wrap,
body.prom-nav .content-container.active-content > .transition-wrap > .sections {
	display: flex;
	flex-direction: column;
}
body.prom-nav .content-container.active-content > .transition-wrap,
body.prom-nav .content-container.active-content > .transition-wrap > .sections {
	flex: 1 0 auto;
}
body.prom-nav .content-container.active-content > .transition-wrap > .sections > * { flex-shrink: 0; }
body.prom-nav .content-container.active-content > .transition-wrap > .sections > .prom-site-footer { margin-top: auto; }
