/* ==========================================================================
   Urban Eye: front-end styles.
   Values mirror the old Bridge setup (see docs/rebuild-plan.md).
   ========================================================================== */

@font-face { font-family: "PT Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/pt-sans-400.woff2) format("woff2"); }
@font-face { font-family: "PT Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/pt-sans-700.woff2) format("woff2"); }
@font-face { font-family: "PT Sans"; font-style: italic; font-weight: 400; font-display: swap; src: url(../fonts/pt-sans-400-italic.woff2) format("woff2"); }
@font-face { font-family: "PT Sans"; font-style: italic; font-weight: 700; font-display: swap; src: url(../fonts/pt-sans-700-italic.woff2) format("woff2"); }

:root {
	--font: "PT Sans", Arial, sans-serif;
	--bg: #fcfcfc;
	--surface: #fcfcfc;          /* grid captions */
	--text: #747474;          /* was #818181 (3.8:1); lightest passing AA on #fcfcfc */
	--heading: #747474;
	--title: #747474;            /* single project title */
	--link: #000;
	--link-hover: #595959;
	--menu: #747474;
	--menu-active: #303030;
	--menu-size: .875rem;        /* 14px */
	--rule: #e0e0e0;
	--filter-active: #af0d41;
	--filter-hover: #ca5045;
	--social: #047cbd;
	--social-hover: #c96b00;

	--body-size: 1rem;           /* 16px (live was 13px) */
	--body-line: 1.5;
	--container: 1100px;
	--header-h: 120px;
	--logo-h: 90px;

	--grid-gap: 6.5%;            /* 3 × 29% + 2 × 6.5% = 100% */
	--grid-row-gap: 2.4%;

	/* The "expand on hover": Bridge's slow_zoom, exactly (no shade; Miles Watson never had one). */
	--zoom-rest: scale(1.01);
	--zoom-hover: scale(1.1);
	--zoom-in: transform 5s cubic-bezier(.21, 1, .12, 1);   /* Bridge's exact "slow_zoom" timing */
	--zoom-out: transform 2s cubic-bezier(.23, 1, .12, 1);
}

/* Reset ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font: 400 var(--body-size)/1.5 var(--font);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}
/* Footer sits at the bottom of the screen on short pages (About, Contact…). */
body { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.site-main { flex: 1 0 auto; }
body.admin-bar { min-height: calc(100dvh - 32px); }
@media (max-width: 782px) { body.admin-bar { min-height: calc(100dvh - 46px); } }
img, svg, iframe { display: block; max-width: 100%; }
img { height: auto; }
figure { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
ul { margin: 0; padding: 0; list-style: none; }

a { color: var(--link); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 2px solid var(--filter-active); outline-offset: 2px; }

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 1000; background: #fff; padding: 8px 12px; }
.skip-link:focus { top: 8px; }

.container { width: var(--container); max-width: calc(100% - 32px); margin-inline: auto; }

/* Typography ------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 { color: var(--heading); margin: 0; font-weight: 400; }
h1 { font-size: 1.25rem; line-height: 1.3; font-weight: 700; }
h2 { font-size: 1.375rem; line-height: 1.35; letter-spacing: 1px; }
h3 { font-size: 1.125rem; line-height: 1.35; letter-spacing: 1px; }
h4 { font-size: 1rem; line-height: 1.4; font-weight: 700; }
h5, h6 { font-size: .875rem; line-height: 1.5; letter-spacing: 1px; }
p { margin: 0; font-size: var(--body-size); line-height: var(--body-line); }
.entry ul, .entry ol { margin: 0; padding-left: 1.2em; line-height: var(--body-line); }
.entry ul { list-style: disc; }
.entry u { text-underline-offset: 2px; }
.entry img { height: auto; }

/* Header ----------------------------------------------------------------- */
.site-header { background: var(--bg); position: relative; z-index: 50; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }
.site-logo { display: block; flex: none; }
.site-logo img { height: var(--logo-h); width: auto; }
.site-logo__text { font-size: 1.5rem; color: var(--menu); text-transform: uppercase; letter-spacing: 2px; }

.site-nav__list { display: flex; }
.site-nav__list a {
	display: block;
	padding: 0 17px;
	line-height: var(--header-h);
	color: var(--menu);
	font-size: var(--menu-size);
	text-transform: uppercase;
	transition: opacity .3s ease, color .3s ease;
}
.site-nav__list li:last-child a { padding-right: 15px; }
.site-nav__list a:hover { color: var(--menu-active); }
.site-nav__list a[aria-current="page"] { color: var(--menu-active); }

.menu-toggle { display: none; width: 44px; height: 44px; margin-right: -10px; color: #1e1e1e; }

/* Hamburger → cross. */
.menu-toggle__bars { position: relative; display: block; width: 20px; height: 14px; margin: 0 auto; } /* icon smaller; the 44px tap area stays */
.menu-toggle__bars span {
	position: absolute; left: 0; width: 100%; height: 2px; border-radius: 2px; background: currentColor;
	transition: transform .2s cubic-bezier(.4, 0, .2, 1), top .2s cubic-bezier(.4, 0, .2, 1) .05s, opacity .15s ease;
}
.menu-toggle__bars span:nth-child(1) { top: 0; }
.menu-toggle__bars span:nth-child(2) { top: 6px; }
.menu-toggle__bars span:nth-child(3) { top: 12px; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars span { transition: top .2s cubic-bezier(.4, 0, .2, 1), transform .2s cubic-bezier(.4, 0, .2, 1) .05s, opacity .15s ease; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:nth-child(1) { top: 6px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:nth-child(3) { top: 6px; transform: rotate(-45deg); }

/* Zoom (the hover "expand") ------------------------------------------------ */
.zoom { display: block; position: relative; overflow: hidden; }
.zoom img { width: 100%; transform: var(--zoom-rest); transition: var(--zoom-out); backface-visibility: hidden; }
/* Smooth zoom: the browser prepares the picture as soon as the pointer arrives. */
@media (hover: hover) { a:hover > .zoom img { will-change: transform; } }
a:hover > .zoom img, a.zoom:hover img, a:focus-visible > .zoom img { transform: var(--zoom-hover); transition: var(--zoom-in); }

/* Home image: a slow, gentle zoom (2.4s in, 1.2s back out), no shade. */
.zoom--quick img { transform: scale(1) translateZ(0); transition: transform 1.2s cubic-bezier(.22, 1, .36, 1); }
a.zoom--quick:hover img, a.zoom--quick:focus-visible img { transform: scale(1.05) translateZ(0); transition: transform 2.4s cubic-bezier(.22, 1, .36, 1); }

/* Home ------------------------------------------------------------------- */
.home__intro { padding: 0 30px 30px; text-align: center; }
.home__intro h1 { text-align: center; }
.home__hero img { width: 100%; }

/* Pages ------------------------------------------------------------------ */
.page__banner { margin-bottom: 50px; }
.page__banner img { width: 100%; }
.page-article .entry { padding-bottom: 50px; }

/* Block editor content: just the blocks we allow. */
.wp-block-columns { display: flex; gap: 30px; margin: 0; }
.wp-block-column { flex: 1 1 0; min-width: 0; }
.wp-block-columns + .wp-block-columns,
.wp-block-group + .wp-block-columns { margin-top: 0; }
.wp-block-image { margin: 0; }
.wp-block-image img { height: auto; }
.wp-block-separator { border: 0; border-top: 1px solid #d6d6d6; margin: 20px 0; }
.wp-block-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
.wp-block-button__link {
	display: inline-block; padding: .55em 1.6em; line-height: 1.5; border: 1px solid #d6d6d6;
	color: #000; font-size: .875rem; letter-spacing: 2px; text-transform: uppercase;
}
.wp-block-button__link:hover { background: #d6d6d6; color: #fff; }
.is-style-flow-3 { column-count: 3; column-gap: 30px; }
.is-style-flow-3 > * { break-inside: avoid-column; }
.is-style-flow-3 > p { break-inside: auto; }
.has-text-align-center { text-align: center; }
.has-text-align-right { text-align: right; }

/* Projects grid ---------------------------------------------------------- */
.projects__intro { margin-bottom: 10px; }
.filter { display: flex; flex-wrap: wrap; justify-content: center; margin: 0 0 27px; }
.filter__btn {
	margin: 0 20px;
	padding: 0 1px 0 2px;
	color: var(--heading);
	font-size: .875rem;
	line-height: 1.5;
	letter-spacing: 1px;
	text-transform: uppercase;
	border-bottom: 2px solid transparent;
}
.filter__btn:hover { border-bottom-color: var(--filter-hover); }
.filter__btn[aria-pressed="true"] { border-bottom-color: var(--filter-active); }

.grid { display: grid; column-gap: var(--grid-gap); row-gap: 0; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); column-gap: 2%; }
.card { margin-bottom: 26px; }
.card[hidden] { display: none; }
.card__link { display: block; color: var(--heading); }
.card__image img { aspect-ratio: 1; object-fit: cover; }
.card__title {
	display: block;
	padding: 20px 8px 22px;
	background: var(--surface);
	text-align: center;
	font-size: .9375rem;
	line-height: 1.4;
	font-style: italic;
	font-weight: 700;
	color: var(--heading);
}
.card__link:hover .card__title { color: var(--link-hover); }

/* Single project --------------------------------------------------------- */
.project__header { padding: 48px 0 13px; text-align: center; }
.project__title { font-size: 1.5rem; line-height: 1.35; font-weight: 700; color: var(--title); letter-spacing: 1px; }
.project__body { display: flex; padding-top: 20px; }
.project__media { flex: 0 0 66.66%; padding-right: 20px; min-width: 0; }
.project__text { flex: 0 0 33.34%; padding-left: 20px; padding-top: 12px; }
.project__image img,
.slider__slide img { width: min(100%, calc(600px * var(--r, 1.3333))); max-width: 100%; height: auto; margin: 0 auto; cursor: zoom-in; }

.slider { position: relative; display: flex; align-items: center; gap: 4px; }
.slider__track {
	flex: 1;
	display: flex;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	overscroll-behavior-x: contain;
}
.slider__track::-webkit-scrollbar { display: none; }
.slider__slide { flex: 0 0 100%; scroll-snap-align: center; display: flex; align-items: center; justify-content: center; }
.slider__arrow { flex: none; width: 32px; height: 48px; display: grid; place-items: center; color: #8a8a8a; transition: color .2s ease; }
.slider__arrow:hover { color: #000; }
.slider__arrow .icon { width: 26px; height: 26px; }

.share { position: relative; margin-top: 23px; }
.share__toggle { color: #000; font-size: var(--body-size); line-height: var(--body-line); }
.share__toggle:hover { color: var(--link-hover); }
.share__menu { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .875rem; }
.share__menu[hidden] { display: none; }
.share__menu a, .share__menu button { color: var(--title); letter-spacing: .5px; }
.share__menu a:hover, .share__menu button:hover { color: #000; }

.project-nav {
	display: flex;
	justify-content: space-between;
	margin-top: 40px;
	padding: 35px 0 30px;
	border-top: 1px solid var(--rule);
	border-bottom: 1px solid var(--rule);
}
.project-nav__link { display: flex; align-items: center; gap: 22px; color: var(--heading); font-size: .875rem; letter-spacing: 1px; padding: 0 10px; }
.project-nav__link .icon { width: 18px; height: 18px; color: #303030; flex: none; }
.project-nav__link--prev { flex-direction: row-reverse; }
.project-nav__link--next { flex-direction: row-reverse; }

.related__title { padding: 85px 0 55px; text-align: center; font-size: 1rem; letter-spacing: 0; }
.related .card { margin-bottom: 2.5%; }
.related .card__title { font-size: .875rem; letter-spacing: 1px; }

/* Contact ---------------------------------------------------------------- */
.contact { display: flex; padding-bottom: 80px; }
.contact__text { flex: 0 0 50%; padding: 0 50px 50px 0; }
.contact__map { flex: 0 0 50%; }
.contact__map iframe { width: 100%; height: 450px; border: 0; }

/* Footer ----------------------------------------------------------------- */
.site-footer { padding: 20px 0; }
.site-footer__inner { display: flex; align-items: center; justify-content: space-between; }
.social { display: flex; gap: 6px; }
.social a { display: block; color: var(--social); padding: 0 3px; }
.social a:hover { color: var(--social-hover); }
.social svg { width: 34px; height: 40px; } /* Font Awesome 4 glyphs, as on the old site */
.credit { font-size: .875rem; line-height: 1.5; }
.credit a { color: var(--title); }
.credit a:hover { color: #000; }

/* Lightbox --------------------------------------------------------------- */
.lightbox {
	position: fixed; inset: 0; z-index: 1000; width: 100%; height: 100%; max-width: none; max-height: none;
	margin: 0; padding: 50px 20px 20px; border: 0; background: #fff; overflow: auto;
}
.lightbox::backdrop { background: #fff; }
.lightbox img { margin: 0 auto; max-width: none; height: auto; box-shadow: 0 0 50px rgba(0, 0, 0, .1); }
.lightbox__close {
	position: fixed; top: 0; right: 0; width: 44px; height: 44px; display: grid; place-items: center;
	border-left: 1px solid var(--heading); border-bottom: 1px solid var(--heading); background: rgba(255, 255, 255, .9);
}
.lightbox__close .icon { width: 20px; height: 20px; }

/* Responsive (Bridge's breakpoints) --------------------------------------- */
@media (max-width: 1200px) { :root { --container: 950px; } }

@media (max-width: 1000px) {
	:root { --container: 768px; --header-h: 100px; --logo-h: 80px; }
	.site-header__inner { position: relative; justify-content: center; }
	.menu-toggle { display: grid; place-items: center; position: absolute; right: 0; top: 50%; transform: translateY(-50%); }
	.site-logo img { width: auto; height: auto; max-height: var(--logo-h); max-width: calc(100vw - 170px); }

	/* Menu panel: fades in and drops down beneath the header. */
	.site-nav {
		position: absolute; left: calc(50% - 50vw); right: calc(50% - 50vw); top: 100%;
		padding: 8px 0 24px;
		background: var(--bg);
		border-top: 1px solid #eaeaea;
		box-shadow: 0 18px 30px -18px rgba(0, 0, 0, .18);
		opacity: 0; visibility: hidden; transform: translateY(-12px);
		transition: opacity .2s ease, transform .28s cubic-bezier(.22, 1, .36, 1), visibility 0s linear .28s;
	}
	.site-nav.is-open {
		opacity: 1; visibility: visible; transform: none;
		transition: opacity .2s ease, transform .28s cubic-bezier(.22, 1, .36, 1), visibility 0s;
	}
	.site-nav__list { flex-direction: column; width: var(--container); max-width: calc(100% - 32px); margin: 0 auto; }
	.site-nav__list li { opacity: 0; transform: translateY(-8px); transition: opacity .2s ease, transform .28s cubic-bezier(.22, 1, .36, 1); }
	.site-nav.is-open li { opacity: 1; transform: none; }
	.site-nav.is-open li:nth-child(2) { transition-delay: .025s; }
	.site-nav.is-open li:nth-child(3) { transition-delay: .05s; }
	.site-nav.is-open li:nth-child(4) { transition-delay: .075s; }
	.site-nav.is-open li:nth-child(5) { transition-delay: .1s; }
	.site-nav.is-open li:nth-child(6) { transition-delay: .125s; }
	.site-nav__list li + li { border-top: 1px solid #eaeaea; }
	.site-nav__list a, .site-nav__list li:last-child a { padding: 15px 2px; line-height: 1.5; font-size: 1rem; letter-spacing: 1.5px; color: var(--menu-active); }
	.site-nav__list a[aria-current="page"] { color: var(--filter-active); }
	.filter__btn { margin: 0 12px; }
}

@media (max-width: 768px) {
	:root { --container: 600px; }
	.grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
	.project__body, .contact { flex-direction: column; }
	.project__media, .project__text, .contact__text, .contact__map { flex-basis: auto; padding-left: 0; padding-right: 0; }
	.project__text { padding-top: 30px; }
	.project__header { padding: 24px 0 0; }
	.project-nav { margin-top: 30px; padding: 24px 0 20px; }
	.project-nav__link { gap: 10px; padding: 0; }
	.related__title { padding: 50px 0 30px; }
	.card__title { padding: 14px 6px 16px; font-size: .875rem; }
	.wp-block-columns { flex-direction: column; gap: 0; }
	.is-style-flow-3 { column-count: 1; }
}

@media (max-width: 600px) {
	:root { --container: 420px; --logo-h: 70px; }
	.slider__arrow { width: 24px; }
	.slider__arrow .icon { width: 20px; height: 20px; }
}

@media (max-width: 480px) {
	:root { --container: 300px; }
	.grid--3 { column-gap: 6%; }
}

@media (max-width: 460px) { :root { --logo-h: 57px; } }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Block layout wrappers add their own spacing; the old site had none. */
.entry :where(.is-layout-flow, .is-layout-constrained) > * { margin-block: 0; }
/* Section spacing between rows of columns (Publicity). */
.entry > .wp-block-columns:not(:last-child) { margin-bottom: 50px; }
.entry > p + .wp-block-columns { margin-top: 20px; }

/* Per-site variants (switched in functions.php) --------------------------- */
.contact { flex-wrap: wrap; }
.contact__title { flex: 0 0 100%; padding: 66px 0 40px; color: #000; font-size: 1.375rem; line-height: 1.3; }

/* 'side' single layout: no title band, text beside the image, vertically centred. */
.project--side .project__body { align-items: flex-start; padding-top: 20px; }
.project--side .project__media { padding-right: 60px; }
.project--side .project__text { padding: 0 0 0 20px; }
.project--side .project__title { font-size: 1.25rem; font-weight: 400; color: var(--heading); text-align: left; letter-spacing: 1px; margin-bottom: 23px; }
.project__cats { margin-bottom: 23px; }
@media (max-width: 768px) {
	.project--side .project__media { padding-right: 0; }
	.project--side .project__text { padding: 30px 0 0; }
}
.contact__text:last-child { flex-basis: 100%; padding-right: 0; }

/* Accessibility (WCAG 2.2 AA) --------------------------------------------- */
/* Links inside running text are underlined, not colour-only (1.4.1). */
.entry p a, .entry li a, .contact__text a {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}
.entry p a:hover, .entry li a:hover { text-decoration-thickness: 2px; }
/* Minimum 24×24px targets (2.5.8). */
.filter__btn { min-height: 28px; padding-top: 2px; }
.share__toggle { min-height: 24px; }
.share__menu a, .share__menu button { display: inline-block; min-height: 24px; padding: 2px 0; }
/* Visible focus everywhere, including on images inside links (2.4.7, 2.4.13). */
:focus-visible { outline: 2px solid var(--filter-active); outline-offset: 3px; }
.card__link:focus-visible { outline-offset: 4px; }
.gallery-zoom { display: block; width: 100%; padding: 0; cursor: zoom-in; }
.gallery-zoom img { cursor: zoom-in; }
/* Captions sit on the off-white strip: one step darker to keep 4.5:1. */
.card__title { color: #707070; }
.credit a { display: inline-block; padding: 4px 0; }

/* Page-to-page cross-fade (Chrome, Edge, Safari 18.2+; others just navigate). */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .25s; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }

/* Loading: tinted with the image's own colour, then a gentle fade-in. */
.card__image { background-color: var(--ph, transparent); }
/* Gallery: the colour sits behind the picture itself, so the link never needs to
   shrink-wrap the image (Safari can then let the image overflow on iPad). */
.gallery-zoom img { background-color: var(--ph, transparent); }
.gallery-zoom { width: 100%; max-width: 100%; }
.gallery-zoom img { max-width: 100%; height: auto; }
img.is-loading { opacity: 0; }
img.is-loaded { transition: opacity .4s ease; }

/* Phones: centred listing heading, stacked footer, slider arrows at the screen edges. */
@media (max-width: 768px) {
	.projects__intro { text-align: center; }
	.site-footer__inner { flex-direction: column; gap: 14px; text-align: center; }
	.social { justify-content: center; }
	.slider { margin-inline: calc(50% - 50vw); padding-inline: 2px; }
}

/* Breathing room under the header on inner pages (banners, listing, contact). */
.page-article, .projects, .contact { padding-top: 24px; }
@media (max-width: 768px) { .page-article, .projects, .contact { padding-top: 16px; } }
/* A heading that follows a paragraph gets a clear gap (e.g. Partners "Funding partners include"). */
.entry p + h2, .entry p + h3 { margin-top: 1.25em; }

/* The slow image zoom is part of the work's presentation (it was the reason
   for choosing Bridge), and it's gentle and slow, so it keeps animating even
   when a visitor's device asks for reduced motion. Everything else still stops. */
@media (prefers-reduced-motion: reduce) {
	.zoom img { transition: var(--zoom-out) !important; }
	a:hover > .zoom img, a:focus-visible > .zoom img { transition: var(--zoom-in) !important; }
	.zoom--quick img, a.zoom--quick:hover img { transition: transform 1.2s cubic-bezier(.22, 1, .36, 1) !important; }
}

/* Press-and-hold on an image: no link preview pop-up or drag-out window (iPad / iPhone / Safari). */
.card__link, .card__image img, .gallery-zoom, .gallery-zoom img, .home__hero a, .home__hero img {
	-webkit-touch-callout: none;
	-webkit-user-drag: none;
	user-select: none;
}

/* Miles Watson: one column on small phones. */
@media (max-width: 480px) { .grid--3 { grid-template-columns: 1fr; } }
