/* Giuliett Production — base structure & typography.
   Colours, fonts and copy are placeholders; refine later. */

:root {
	/* Palette (approx — to be finalised) */
	--gp-cream: #f5f3ef;
	--gp-ink: #1e1c19;
	--gp-white: #ffffff;
	--gp-line: #e4e0d8;
	--gp-muted: #8a8478;

	/* Type */
	--gp-font-script: "Pinyon Script", "Mrs Saint Delafield", "Parisienne", cursive;
	--gp-font-body: "Jost", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

	/* Grid */
	--gp-gap: 14px;
	--gp-cols: 3;
	--gp-maxw: 1600px;

	/* Outer frame — identical space on all four sides of the grid and as the
	   horizontal padding of the header / footer bars. */
	--gp-edge: clamp(1.5rem, 5vw, 3.5rem);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	/* Sticky footer: fill the viewport, stack in a column, let .gp-main grow. */
	min-height: 100vh;
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
	font-family: var(--gp-font-body);
	font-weight: 300;
	color: var(--gp-ink);
	background: var(--gp-cream);
	line-height: 1.6;
}

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

a { color: inherit; }

/* ---------- Header (compact bar) ---------- */

.gp-header {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 1rem;
	width: 100%;
	flex-shrink: 0;
	/* Compact bar: content box hugs the logo (border-box → 96 - 2×6). */
	min-height: 96px;
	padding: 6px var(--gp-edge);
	background: var(--gp-white);
}

.gp-header__spacer { display: block; }

.gp-logo,
.gp-header .custom-logo-link {
	grid-column: 2;
	display: inline-flex;
	align-items: center;
	justify-self: center;
	line-height: 0;
}

.gp-logo__img,
.gp-header .custom-logo {
	display: block;
	width: auto;
	height: 84px;
	max-width: 100%;
}

.gp-header__nav {
	grid-column: 3;
	justify-self: end;
	display: flex;
	align-items: center;
}

.gp-header__link {
	font-family: "Helvetica Now Text", Helvetica, Arial, sans-serif;
	font-size: 0.95rem;
	color: var(--gp-ink);
	text-decoration: none;
}

.gp-header__link:hover { text-decoration: underline; }

.gp-header__link.is-current {
	color: var(--gp-muted);
	cursor: default;
}

/* ---------- Main ---------- */

.gp-main {
	flex: 1 0 auto;
	width: 100%;
	max-width: var(--gp-maxw);
	margin: 0 auto;
}

/* ---------- Grid ---------- */

.gp-grid {
	display: grid;
	grid-template-columns: repeat(var(--gp-cols), 1fr);
	/* start = don't stretch tiles to the row height, so the fixed
	   aspect-ratio below is respected even next to a tall text tile. */
	align-items: start;
	gap: var(--gp-gap);
	/* Equal frame on all four sides; the top value is the space between the
	   header bar and the first row, the bottom is the space before the footer. */
	padding: var(--gp-edge);
}

.gp-item {
	position: relative;
	margin: 0;
	overflow: hidden;
	background: var(--gp-white);
}

/* Every tile is one column, fixed 4:5 — identical cell size across the grid. */
.gp-item--photo,
.gp-item--video,
.gp-item--text {
	aspect-ratio: 4 / 5;
}

.gp-item--photo { background: var(--gp-cream); }
.gp-item--video { background: #171717; }

.gp-item__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.gp-item__caption {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 0.6rem 0.8rem;
	font-size: 0.72rem;
	letter-spacing: 0.06em;
	color: var(--gp-white);
	background: linear-gradient(to top, rgba(0, 0, 0, 0.45), transparent);
	opacity: 0;
	transition: opacity 0.25s ease;
}

.gp-item--photo:hover .gp-item__caption { opacity: 1; }

/* Video tile */
.gp-item__video {
	display: block;
	width: 100%;
	height: 100%;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
}

.gp-item__play {
	position: absolute;
	inset: 0;
	margin: auto;
	width: 72px;
	height: 72px;
	border-radius: 50%;
	background: var(--gp-white);
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
	transition: transform 0.2s ease, background 0.2s ease;
}

.gp-item__play::after {
	content: "";
	position: absolute;
	inset: 0;
	margin: auto;
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 12px 0 12px 20px;
	border-color: transparent transparent transparent var(--gp-ink);
	transform: translateX(3px);
}

.gp-item__video:hover .gp-item__play {
	transform: scale(1.08);
	background: var(--gp-white);
}

/* Text tile */
.gp-item--text {
	display: flex;
	background: var(--gp-white);
}

.gp-item__text {
	padding: clamp(1.5rem, 4vw, 2.75rem);
	margin: auto 0;
	width: 100%;
}

.gp-item__text--center { text-align: center; }

.gp-item__title {
	font-family: var(--gp-font-script);
	font-weight: 400;
	font-size: clamp(1.8rem, 4vw, 2.6rem);
	line-height: 1.1;
	margin: 0 0 0.75rem;
}

.gp-item__text p { margin: 0 0 1rem; }
.gp-item__text p:last-child { margin-bottom: 0; }

.gp-grid-empty,
.gp-empty {
	padding: 3rem 1.5rem;
	text-align: center;
	color: var(--gp-muted);
}

/* ---------- Contacts ---------- */

.gp-contacts__title {
	font-family: var(--gp-font-body);
	font-weight: 700;
	font-size: clamp(1.6rem, 2.6vw, 2rem);
	line-height: 1.15;
	margin: 0 0 1.25rem;
	text-align: center;
}

.gp-contact {
	display: grid;
	grid-template-columns: minmax(0, 440px) minmax(0, 1fr);
	gap: clamp(1.5rem, 4vw, 3rem);
	align-items: start;
	max-width: 1180px;
	margin: 0 auto;
	padding: clamp(1.25rem, 3vw, 2rem);
}

.gp-contact__media {
	position: relative;
	overflow: hidden;
	aspect-ratio: 4 / 5;   /* same fixed ratio as the Home grid tiles */
	background: var(--gp-cream);
}

.gp-contact__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.gp-contact__panel {
	display: flex;
	flex-direction: column;
	gap: clamp(1rem, 2vw, 1.5rem);
}

.gp-contact__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1.5rem;
}

.gp-contact .gp-contacts__title {
	margin: 0;
	text-align: left;
}

.gp-contact__social {
	display: flex;
	align-items: center;
	gap: 1.1rem;
	list-style: none;
	margin: 0.5rem 0 0;
	padding: 0;
	flex: 0 0 auto;
}

.gp-contact__social a {
	display: inline-flex;
	color: var(--gp-ink);
}

.gp-contact__social svg { display: block; }
.gp-contact__social a:hover { color: var(--gp-muted); }

/* ----- Contact Form 7, minimal underline style ----- */

.gp-contact__form .gp-field { margin-bottom: 1rem; }

.gp-contact__form .gp-field__label {
	display: block;
	margin-bottom: 0.3rem;
	font-family: var(--gp-font-body);
	font-size: 0.9rem;
	font-weight: 500;
	color: var(--gp-ink);
}

.gp-contact__form .gp-field__req {
	font-weight: 400;
	color: var(--gp-muted);
}

.gp-contact__form .gp-field-group {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: clamp(1rem, 3vw, 1.75rem);
}

.gp-contact__form .wpcf7-form-control-wrap { display: block; }

.gp-contact__form input.gp-input,
.gp-contact__form textarea.gp-input {
	width: 100%;
	padding: 0.35rem 0;
	border: 0;
	border-bottom: 1px solid var(--gp-ink);
	border-radius: 0;
	background: transparent;
	font-family: var(--gp-font-body);
	font-size: 0.95rem;
	color: var(--gp-ink);
	-webkit-appearance: none;
	appearance: none;
}

.gp-contact__form input.gp-input:focus,
.gp-contact__form textarea.gp-input:focus {
	outline: none;
	border-bottom-width: 2px;
}

.gp-contact__form textarea.gp-input {
	/* Explicit height overrides CF7's default rows="10"; still user-resizable. */
	height: 84px;
	min-height: 84px;
	resize: vertical;
	line-height: 1.5;
}

.gp-contact__form .gp-submit,
.gp-contact__form input.gp-submit,
.gp-contact__form .wpcf7-submit {
	display: inline-block;
	margin-top: 0.25rem;
	padding: 0.7rem 1.6rem;
	border: 1px solid var(--gp-ink);
	border-radius: 0;
	background: var(--gp-white);
	color: var(--gp-ink);
	font-family: var(--gp-font-body);
	font-size: 0.95rem;
	letter-spacing: 0.02em;
	cursor: pointer;
	transition: background 0.18s ease, color 0.18s ease;
	-webkit-appearance: none;
	appearance: none;
}

.gp-contact__form .gp-submit:hover,
.gp-contact__form input.gp-submit:hover,
.gp-contact__form .wpcf7-submit:hover {
	background: var(--gp-ink);
	color: var(--gp-white);
}

.gp-contact__form .wpcf7-spinner { margin: 0 0 0 0.75rem; }

.gp-contact__form .wpcf7-response-output {
	margin: 0.85rem 0 0;
	padding: 0.6rem 0.9rem;
	border: 1px solid var(--gp-line);
	font-size: 0.85rem;
}

.gp-contact__form .wpcf7-not-valid-tip {
	margin-top: 0.35rem;
	font-size: 0.8rem;
	color: #b00020;
}

.gp-contact__form input.wpcf7-not-valid,
.gp-contact__form textarea.wpcf7-not-valid {
	border-bottom-color: #b00020;
}

/* ---------- Generic article ---------- */

.gp-article {
	max-width: 42rem;
	margin: 0 auto;
	padding: clamp(2rem, 6vw, 4rem) 1.5rem;
}

.gp-article__title {
	font-family: var(--gp-font-script);
	font-weight: 400;
	font-size: clamp(2.2rem, 6vw, 3.5rem);
	margin: 0 0 1.5rem;
}

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

.gp-footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	flex-shrink: 0;
	/* Same white full-width bar as the header: same horizontal padding, and the
	   space above it (grid bottom padding = --gp-edge) mirrors header ↔ grid. */
	padding: 1.75rem var(--gp-edge);
	font-size: 0.78rem;
	letter-spacing: 0.06em;
	color: var(--gp-muted);
	background: var(--gp-white);
}

.gp-footer p { margin: 0; }
.gp-footer a { text-decoration: none; }
.gp-footer a:hover { color: var(--gp-ink); }

.gp-footer__contact {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	margin: 0;
	padding: 0;
	list-style: none;
	text-align: right;
}

/* ---------- Lightbox ---------- */

.gp-lightbox {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 4vmin;
	background: rgba(15, 14, 12, 0.92);
}

.gp-lightbox[hidden] { display: none; }

.gp-lightbox__frame {
	position: relative;
	width: min(1100px, 100%);
	aspect-ratio: 16 / 9;
	background: #000;
}

/* The media fills the frame at full brightness — no background tint or opacity
   here. The dark backdrop lives only on .gp-lightbox, behind the frame. */
.gp-lightbox__media,
.gp-lightbox__frame iframe,
.gp-lightbox__frame video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
	z-index: 1;
}

.gp-lightbox__close {
	position: absolute;
	top: -2.75rem;
	right: 0;
	z-index: 3;
	width: 2.25rem;
	height: 2.25rem;
	border: 0;
	background: none;
	color: #fff;
	font-size: 1.75rem;
	line-height: 1;
	cursor: pointer;
}

/* Shown only if a browser blocks unmuted autoplay — never a silent muted play. */
.gp-lightbox__hint {
	position: absolute;
	left: 50%;
	bottom: 4.25rem;
	transform: translateX(-50%);
	z-index: 3;
	padding: 0.6rem 1.15rem;
	border: 0;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.96);
	color: #111;
	font-family: var(--gp-font-body);
	font-size: 0.85rem;
	letter-spacing: 0.02em;
	cursor: pointer;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

.gp-lightbox__hint[hidden] { display: none; }

/* Custom control bar — a discrete floating pill, NOT an overlay on the video.
   Native <video> / provider controls are disabled, so nothing tints the video
   on hover. */
.gp-lightbox__controls {
	position: absolute;
	left: 50%;
	bottom: 0.9rem;
	transform: translateX(-50%);
	z-index: 2;
	display: flex;
	align-items: center;
	gap: 0.8rem;
	width: min(92%, 620px);
	padding: 0.5rem 0.95rem;
	border-radius: 999px;
	background: rgba(18, 16, 14, 0.72);
	color: var(--gp-cream);
}

.gp-lightbox__controls[hidden] { display: none; }

.gp-lightbox__play {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	cursor: pointer;
}

.gp-lightbox__play .gp-ic {
	width: 1.4rem;
	height: 1.4rem;
	display: block;
	fill: currentColor;
}

.gp-lightbox__play .gp-ic-pause { display: none; }
.gp-lightbox__controls.is-playing .gp-ic-play { display: none; }
.gp-lightbox__controls.is-playing .gp-ic-pause { display: block; }

.gp-lightbox__seek {
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	height: 1.25rem;
	cursor: pointer;
}

.gp-lightbox__seek:focus-visible {
	outline: 2px solid var(--gp-cream);
	outline-offset: 4px;
	border-radius: 4px;
}

.gp-lightbox__bar {
	position: relative;
	width: 100%;
	height: 3px;
	border-radius: 2px;
	background: rgba(255, 255, 255, 0.28);
}

.gp-lightbox__bar-fill {
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 0;
	border-radius: 2px;
	background: var(--gp-cream);
	transition: width 0.15s linear;
}

/* Lightbox — true full screen on mobile (desktop behaviour untouched). */
@media (max-width: 640px) {
	.gp-lightbox {
		width: 100%;
		height: 100%;
		padding: 0;
		background: #000;
	}

	/* Fill the whole viewport; the media keeps its own ratio (residual black
	   bars are expected and kept minimal by maximising the frame). */
	.gp-lightbox__frame {
		width: 100%;
		height: 100%;
		max-width: none;
		aspect-ratio: auto;
	}

	.gp-lightbox__media,
	.gp-lightbox__frame iframe,
	.gp-lightbox__frame video {
		object-fit: contain;
	}

	/* Close button: pinned to the viewport's top-right, clear of iOS safe areas. */
	.gp-lightbox__close {
		position: fixed;
		top: calc(env(safe-area-inset-top, 0px) + 0.5rem);
		right: calc(env(safe-area-inset-right, 0px) + 0.5rem);
		z-index: 4;
		display: flex;
		align-items: center;
		justify-content: center;
		width: 2.75rem;
		height: 2.75rem;
		border-radius: 50%;
		background: rgba(0, 0, 0, 0.5);
		font-size: 1.5rem;
	}

	/* Controls pill: near full width, above the bottom system bar / home bar. */
	.gp-lightbox__controls {
		left: 0.6rem;
		right: 0.6rem;
		bottom: calc(env(safe-area-inset-bottom, 0px) + 0.6rem);
		width: auto;
		transform: none;
		gap: 0.6rem;
		padding: 0.45rem 0.7rem;
	}

	.gp-lightbox__hint {
		bottom: calc(env(safe-area-inset-bottom, 0px) + 3.6rem);
	}
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
	:root { --gp-cols: 2; }
}

/* Contacts: stack image over form. */
@media (max-width: 860px) {
	.gp-contact {
		grid-template-columns: 1fr;
		gap: clamp(1.25rem, 5vw, 2rem);
	}

	/* Stacked above the form. The <img> is position:absolute, so the box has no
	   intrinsic width — cancelling the grid stretch (which auto margins do) would
	   collapse it to zero. min()/calc give a DEFINITE width (never `auto`), so it
	   stays visible; margin-inline:auto then centres it; 4:5 comes from the base
	   rule and the width cap keeps its height within ~60vh. No justify-self here. */
	.gp-contact__media {
		width: min(100%, calc(60vh * 4 / 5));
		margin-inline: auto;
	}

	.gp-contact__head {
		flex-wrap: wrap;
	}

	.gp-contact__form .gp-field-group {
		grid-template-columns: 1fr;
		gap: 0;
	}

	.gp-contact__form .gp-field-group .gp-field {
		margin-bottom: 1rem;
	}
}

/* Mobile keeps 2 columns (not 1). */
@media (max-width: 640px) {
	/* Thinner gutter between tiles on small screens. */
	.gp-grid { gap: 7px; }

	/* One row, smaller logo. Centred-logo grid is dropped for a simple
	   logo-left / link-right bar so nothing can overflow on narrow screens;
	   the link wraps under the logo only if it truly can't fit. */
	.gp-header {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		justify-content: space-between;
		min-height: 76px;
		gap: 0.35rem 1rem;
	}

	.gp-header__spacer { display: none; }

	.gp-logo,
	.gp-header .custom-logo-link,
	.gp-header__nav {
		grid-column: auto;
		justify-self: auto;
	}

	/* Big logo, tight bar (76 - 2×6 = 64). */
	.gp-logo__img,
	.gp-header .custom-logo { height: 64px; }

	.gp-footer {
		flex-direction: column;
		text-align: center;
	}

	.gp-footer__contact {
		align-items: center;
		text-align: center;
	}
}
