/* ==========================================================================
   The Fat Farmer — main styles
   ========================================================================== */

:root {
	--tff-cream: #f4f0ea;
	--tff-sand: #e7dfd3;
	--tff-ink: #1c1a17;
	--tff-muted: #857c71;
	--tff-line: rgba(28, 26, 23, 0.16);
	--tff-serif: "Fraunces", "Cooper", Georgia, "Times New Roman", serif;
	--tff-sans: "Jost", "Futura", "Helvetica Neue", Arial, sans-serif;
	--tff-pad: clamp(20px, 4vw, 56px);
	--tff-header: 128px;
	--tff-logo-h: 104px;
	--tff-admin: 0px;
	--tff-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

.admin-bar { --tff-admin: 32px; }
@media (max-width: 782px) { .admin-bar { --tff-admin: 46px; } }

*, *::before, *::after { box-sizing: border-box; }

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

body {
	margin: 0;
	background: var(--tff-cream);
	color: var(--tff-ink);
	font-family: var(--tff-sans);
	font-weight: 300;
	font-size: 17px;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration: none; transition: opacity 0.3s, color 0.3s; }
a:hover { opacity: 0.65; }

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

/* Quick repeated taps count as taps, not double-tap-to-zoom (pinch-zoom still works). */
html, a, button, .tff-viewer__stage, .tff-slider__controls { touch-action: manipulation; }

:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }

.tff-skip {
	position: absolute; left: -9999px; top: 0; z-index: 999;
	background: var(--tff-ink); color: var(--tff-cream); padding: 10px 16px;
}
.tff-skip:focus { left: 10px; top: 10px; }

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}

/* Photo protection: no dragging or long-press saving of images. */
.tff-protect img {
	-webkit-user-drag: none;
	user-select: none; -webkit-user-select: none;
	-webkit-touch-callout: none;
}
/* No long-press link menu (copy link / open in new tab) on phones, incl. the menu. */
.tff-protect a { -webkit-touch-callout: none; -webkit-user-drag: none; }
.tff-protect .tff-nav, .tff-protect .tff-header { user-select: none; -webkit-user-select: none; }

/* ---------- Type helpers ---------- */

.tff-eyebrow {
	margin: 0 0 14px;
	font-family: var(--tff-sans);
	font-size: 11px;
	font-weight: 400;
	letter-spacing: 0.32em;
	text-transform: uppercase;
	color: var(--tff-muted);
}

.tff-title {
	margin: 0;
	font-family: var(--tff-serif);
	font-weight: 400;
	font-size: clamp(42px, 6vw, 88px);
	line-height: 1;
	letter-spacing: -0.02em;
	font-variation-settings: "opsz" 144;
	text-transform: lowercase;
}

.tff-link-line {
	display: inline-block;
	font-size: 12px;
	letter-spacing: 0.28em;
	text-transform: uppercase;
	padding-bottom: 6px;
	border-bottom: 1px solid currentColor;
}

.tff-button {
	display: inline-block;
	margin-top: 8px;
	padding: 17px 38px;
	border: 1px solid var(--tff-ink);
	font-family: var(--tff-sans);
	font-size: 12px;
	font-weight: 400;
	letter-spacing: 0.28em;
	text-transform: uppercase;
	color: var(--tff-ink);
	background: transparent;
	transition: background 0.35s var(--tff-ease), color 0.35s var(--tff-ease);
}
.tff-button:hover { background: var(--tff-ink); color: var(--tff-cream); opacity: 1; }

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

.tff-header {
	position: fixed;
	top: var(--tff-admin);
	left: 0; right: 0;
	z-index: 100;
	height: var(--tff-header);
	padding: 0 var(--tff-pad);
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	background: var(--tff-cream);
	color: var(--tff-ink);
	transition: background 0.4s, color 0.4s, box-shadow 0.4s, height 0.4s var(--tff-ease);
}
.tff-header.is-scrolled { box-shadow: 0 1px 0 var(--tff-line); height: 80px; --tff-logo-h: 62px; }

.tff-header--overlay { background: transparent; color: #fff; }
.tff-nav-open .tff-header { background: transparent; color: var(--tff-ink); box-shadow: none; }

.tff-menu-toggle {
	justify-self: start;
	display: inline-flex;
	align-items: center;
	gap: 14px;
	font-size: 12px;
	font-weight: 400;
	letter-spacing: 0.3em;
	text-transform: uppercase;
}
.tff-menu-toggle__lines { position: relative; width: 26px; height: 9px; }
.tff-menu-toggle__lines span {
	position: absolute; left: 0; width: 100%; height: 1px; background: currentColor;
	transition: transform 0.4s var(--tff-ease), top 0.4s var(--tff-ease);
}
.tff-menu-toggle__lines span:first-child { top: 0; }
.tff-menu-toggle__lines span:last-child { top: 8px; }
.tff-nav-open .tff-menu-toggle__lines span:first-child { top: 4px; transform: rotate(45deg); }
.tff-nav-open .tff-menu-toggle__lines span:last-child { top: 4px; transform: rotate(-45deg); }

.tff-header__logo { justify-self: center; text-align: center; }

.tff-logo--text {
	font-family: var(--tff-serif);
	font-size: clamp(22px, 2.4vw, 30px);
	font-weight: 400;
	letter-spacing: 0.06em;
	white-space: nowrap;
}
.tff-logo { display: block; }
.tff-logo__img { height: var(--tff-logo-h); width: auto; max-width: 46vw; object-fit: contain; transition: height 0.4s var(--tff-ease); }
.tff-header--overlay .tff-logo__img { filter: drop-shadow(0 1px 8px rgba(0, 0, 0, 0.25)); }
.tff-logo--invert .tff-logo__img { filter: brightness(0) invert(1); }
.tff-nav-open .tff-header--overlay .tff-logo__img { filter: brightness(0) opacity(0.9); }

.tff-header__end { justify-self: end; }
.tff-header__cta {
	font-size: 12px;
	font-weight: 400;
	letter-spacing: 0.28em;
	text-transform: uppercase;
}

@media (max-width: 640px) {
	:root { --tff-header: 96px; --tff-logo-h: 76px; }
	.tff-header.is-scrolled { height: 68px; --tff-logo-h: 52px; }
	.tff-header__cta { display: none; }
	.tff-menu-toggle__label { display: none; }
}

/* ---------- Menu overlay ---------- */

.tff-nav {
	position: fixed;
	inset: 0;
	z-index: 90;
	background: var(--tff-cream);
	color: var(--tff-ink);
	overflow-y: auto;
	opacity: 0;
	transition: opacity 0.5s var(--tff-ease);
}
.tff-nav.is-open { opacity: 1; }

.tff-nav__inner {
	min-height: 100%;
	padding: calc(var(--tff-header) + var(--tff-admin) + 40px) var(--tff-pad) 48px;
	display: grid;
	grid-template-columns: 1fr;
	gap: 48px;
	align-content: center;
}
@media (min-width: 900px) {
	.tff-nav__inner { grid-template-columns: 2fr 1fr; align-items: end; }
}

.tff-menu { list-style: none; margin: 0; padding: 0; }
.tff-menu > li { overflow: hidden; }
.tff-menu > li > a {
	display: inline-block;
	font-family: var(--tff-serif);
	font-weight: 300;
	font-size: clamp(42px, 7vw, 96px);
	line-height: 1.12;
	letter-spacing: -0.02em;
	text-transform: lowercase;
	transform: translateY(105%);
	transition: transform 0.8s var(--tff-ease), opacity 0.3s;
}
.tff-nav.is-open .tff-menu > li > a { transform: none; }
.tff-nav.is-open .tff-menu > li:nth-child(2) > a { transition-delay: 0.06s; }
.tff-nav.is-open .tff-menu > li:nth-child(3) > a { transition-delay: 0.12s; }
.tff-nav.is-open .tff-menu > li:nth-child(4) > a { transition-delay: 0.18s; }
.tff-nav.is-open .tff-menu > li:nth-child(5) > a { transition-delay: 0.24s; }
.tff-nav.is-open .tff-menu > li:nth-child(6) > a { transition-delay: 0.30s; }
.tff-menu > li > a:hover { font-style: italic; opacity: 1; }
.tff-menu .current-menu-item > a { font-style: italic; }

/* Sub-menu (e.g. the portfolio categories under "Portfolio"). */
.tff-menu .sub-menu { list-style: none; margin: 0; padding: 0; }
.tff-menu .sub-menu a {
	display: inline-block;
	font-size: 13px; font-weight: 400; letter-spacing: 0.26em; text-transform: uppercase;
	line-height: 2.1;
}
.tff-menu .sub-menu .current-menu-item > a { border-bottom: 1px solid currentColor; line-height: 1.6; }

/* Wide screens with a mouse: the sub-menu appears beside the word on hover. */
@media (hover: hover) and (min-width: 900px) {
	.tff-menu > li.menu-item-has-children { display: flex; align-items: center; gap: clamp(28px, 4vw, 64px); }
	.tff-menu > li.menu-item-has-children > .sub-menu {
		display: grid; grid-auto-flow: column; grid-template-rows: repeat(4, auto); column-gap: 40px;
		opacity: 0; visibility: hidden; transform: translateX(-12px);
		transition: opacity 0.35s var(--tff-ease), transform 0.35s var(--tff-ease), visibility 0s linear 0.35s;
	}
	.tff-menu > li.menu-item-has-children:hover > .sub-menu,
	.tff-menu > li.menu-item-has-children:focus-within > .sub-menu {
		opacity: 1; visibility: visible; transform: none;
		transition: opacity 0.35s var(--tff-ease), transform 0.35s var(--tff-ease), visibility 0s;
	}
}

/* Phones and touch screens: the sub-menu is always shown under the word. */
@media (hover: none), (max-width: 899px) {
	.tff-menu .sub-menu { display: flex; flex-wrap: wrap; gap: 0 24px; margin: 2px 0 14px 4px; }
}

.tff-nav__aside p { margin: 0 0 6px; }
.tff-nav__aside .tff-social { margin-top: 22px; }

/* ---------- Social ---------- */

.tff-social { list-style: none; margin: 0; padding: 0; display: flex; gap: 18px; }
.tff-social a { display: inline-flex; }

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

.tff-main { padding-top: calc(var(--tff-header) + var(--tff-admin)); }
.tff-is-home .tff-main { padding-top: 0; }

/* ---------- Home slider ---------- */

.tff-slider {
	position: relative;
	height: calc(100vh - var(--tff-admin));
	height: calc(100svh - var(--tff-admin));
	min-height: 480px;
	overflow: hidden;
	background: #141210;
	color: #fff;
	touch-action: pan-y;
}
.tff-slider::before,
.tff-slider::after {
	content: "";
	position: absolute; left: 0; right: 0; z-index: 2; pointer-events: none;
}
.tff-slider::before { top: 0; height: 180px; background: linear-gradient(rgba(0,0,0,0.42), transparent); }
.tff-slider::after { bottom: 0; height: 240px; background: linear-gradient(transparent, rgba(0,0,0,0.5)); }

.tff-slider__track, .tff-slide { position: absolute; inset: 0; }
.tff-slide {
	margin: 0;
	opacity: 0;
	visibility: hidden;
	transition: opacity 1.6s var(--tff-ease), visibility 0s linear 1.6s;
}
.tff-slide.is-active { opacity: 1; visibility: visible; transition: opacity 1.6s var(--tff-ease), visibility 0s; z-index: 1; }

/* Each photo ("shot") fills its slide by default. */
.tff-shot { position: absolute; inset: 0; margin: 0; overflow: hidden; }

.tff-shot__img {
	position: relative;
	width: 100%; height: 100%;
	object-fit: cover;
	object-position: var(--tff-focus, 50% 50%);
	transform: scale(1.001);
	transition: transform 9s linear;
}
.tff-slide.is-active .tff-shot__img { transform: scale(1.07); }

/* Blurred copy of the photo, used behind photos shown whole. */
.tff-shot__bg {
	display: none;
	position: absolute; inset: -60px;
	width: calc(100% + 120px); height: calc(100% + 120px); max-width: none;
	object-fit: cover;
	filter: blur(40px) brightness(0.55) saturate(1.1);
}

/* Whole photo, no crop (full height for portraits), with borders at the sides. */
.tff-slide--whole .tff-shot__img,
.tff-slide--whole.is-active .tff-shot__img { object-fit: contain; transform: none; }
/* Keep whole photos clear of the logo (top) and, on phones, of the controls (bottom). */
.tff-slide--whole .tff-shot__img {
	position: absolute;
	left: 0; right: 0;
	top: var(--tff-header);
	height: calc(100% - var(--tff-header) - var(--tff-whole-bottom, 0px));
}
.tff-slider[data-bg="blur"] .tff-slide--whole .tff-shot__bg { display: block; }

/* Captions */
.tff-shot__caption {
	position: absolute; z-index: 3;
	left: 50%; bottom: 44px; transform: translateX(-50%);
	font-family: var(--tff-serif); font-style: italic; font-weight: 300; font-size: 19px;
	white-space: nowrap;
	text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}

.tff-slide--placeholder { background: linear-gradient(135deg, #3b342d, #191613); }
.tff-slide__empty {
	position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 10px; padding: 24px;
	font-family: var(--tff-serif); font-size: 24px;
}
.tff-slide__empty p { margin: 0; }
.tff-slide__empty a { font-family: var(--tff-sans); font-size: 13px; letter-spacing: 0.12em; border-bottom: 1px solid; justify-self: center; }

.tff-slider__intro {
	position: absolute; z-index: 3;
	left: var(--tff-pad); bottom: 40px;
}
.tff-slider__intro .tff-eyebrow { color: rgba(255,255,255,0.82); }

.tff-slider__controls {
	position: absolute; z-index: 3;
	right: var(--tff-pad); bottom: 34px;
	display: flex; align-items: center; gap: 18px;
	font-size: 12px; letter-spacing: 0.24em;
}
.tff-slider__btn {
	width: 44px; height: 44px; border-radius: 50%;
	border: 1px solid rgba(255,255,255,0.45);
	display: grid; place-items: center;
	transition: background 0.3s, border-color 0.3s;
}
.tff-slider__btn:hover { background: rgba(255,255,255,0.14); border-color: #fff; }

.tff-slider__progress { position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(255,255,255,0.18); }
.tff-slider__progress span { display: block; height: 100%; width: 0; background: rgba(255,255,255,0.85); }
.tff-slider__progress span.is-running { width: 100%; transition: width var(--tff-dur, 6s) linear; }

.tff-slider__social { position: absolute; z-index: 3; right: var(--tff-pad); top: 50%; transform: translateY(-50%); }
.tff-slider__social .tff-social { flex-direction: column; gap: 20px; }

@media (max-width: 700px) {
	.tff-slider { --tff-whole-bottom: 150px; }
	.tff-shot__caption { left: var(--tff-pad); transform: none; bottom: 112px; font-size: 18px; white-space: normal; max-width: calc(100% - 2 * var(--tff-pad)); }
	.tff-slider__intro { bottom: 32px; }
	.tff-slider__controls { bottom: 26px; gap: 10px; }
	.tff-slider__count { display: none; }
	.tff-slider__social { display: none; }
}

/* ---------- Page header ---------- */

.tff-page-head {
	padding: clamp(48px, 8vw, 110px) var(--tff-pad) clamp(32px, 5vw, 64px);
	text-align: center;
}
.tff-page-head__intro { max-width: 620px; margin: 24px auto 0; color: var(--tff-muted); }
.tff-page-head__intro p:last-child { margin-bottom: 0; }

/* Photo pages: get to the photos sooner. */
.tff-page-head--compact { padding: clamp(12px, 2.2vw, 32px) var(--tff-pad) clamp(22px, 2.6vw, 36px); }
.tff-page-head--compact .tff-eyebrow { margin-bottom: 8px; }
.tff-page-head--compact .tff-title { font-size: clamp(36px, 4.2vw, 60px); }
.tff-page-head--compact .tff-page-head__intro { margin-top: 14px; }

/* ---------- Content ---------- */

.tff-content > *:first-child { margin-top: 0; }
.tff-content p { margin: 0 0 1.3em; }
.tff-content h2, .tff-content h3, .tff-content h4 {
	font-family: var(--tff-serif); font-weight: 400; text-transform: lowercase; line-height: 1.1;
	margin: 1.6em 0 0.4em;
}
.tff-content h2 { font-size: clamp(32px, 4vw, 48px); }
.tff-content h3 { font-size: clamp(26px, 3vw, 34px); }
.tff-content a { border-bottom: 1px solid var(--tff-line); }
.tff-content blockquote { margin: 1.6em 0; padding: 0; border: 0; font-family: var(--tff-serif); font-style: italic; font-size: 28px; line-height: 1.3; }
.tff-content figure { margin: 0 0 16px; }
.tff-content figcaption { font-size: 13px; color: var(--tff-muted); margin-top: 8px; text-align: center; }
.tff-lead, .tff-content .tff-lead { font-family: var(--tff-serif); font-size: clamp(22px, 2.3vw, 28px); line-height: 1.35; font-weight: 300; }

.tff-content--narrow { max-width: 760px; margin: 0 auto; padding: 0 var(--tff-pad) 80px; }
.tff-content--narrow .alignwide { margin-left: calc(-1 * min(12vw, 200px)); margin-right: calc(-1 * min(12vw, 200px)); }
.tff-content--narrow .alignfull { margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); max-width: 100vw; }

.tff-page__hero { margin: 0 0 64px; }
.tff-page__hero img { width: 100%; max-height: 80vh; object-fit: cover; }

[data-lightbox] img { cursor: zoom-in; }

/* Gallery blocks */
.tff-content .wp-block-gallery.has-nested-images { gap: 14px; }
.tff-content .wp-block-gallery.has-nested-images figure.wp-block-image { margin: 0; }

/* ---------- Portfolio filter & grid ---------- */

.tff-filter {
	display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 34px;
	padding: 0 var(--tff-pad) 44px;
}
.tff-filter__btn {
	font-family: var(--tff-serif); font-size: 22px; font-style: italic; font-weight: 300;
	color: var(--tff-muted); padding-bottom: 2px; border-bottom: 1px solid transparent;
	transition: color 0.3s, border-color 0.3s;
}
.tff-filter__btn:hover { color: var(--tff-ink); }
.tff-filter__btn.is-active { color: var(--tff-ink); border-bottom-color: var(--tff-ink); }

.tff-grid {
	--gap: clamp(10px, 1.4vw, 18px);
	padding: 0 var(--tff-pad) 96px;
	columns: 1;
	column-gap: var(--gap);
}
@media (min-width: 640px) { .tff-grid { columns: 2; } }
@media (min-width: 1100px) { .tff-grid { columns: 3; } }

.tff-grid__item {
	break-inside: avoid;
	margin-bottom: var(--gap);
	animation: tff-fade 0.6s var(--tff-ease) both;
}
.tff-grid__item.is-hidden { display: none; }

.tff-grid__link { position: relative; display: block; overflow: hidden; }
.tff-grid__link:hover { opacity: 1; }
.tff-grid__img { width: 100%; transition: transform 1.2s var(--tff-ease); }
.tff-grid__img--empty { display: block; aspect-ratio: 4 / 5; background: var(--tff-sand); }
.tff-grid__link:hover .tff-grid__img { transform: scale(1.04); }

.tff-grid__meta {
	position: absolute; inset: auto 0 0 0;
	padding: 60px 24px 22px;
	background: linear-gradient(transparent, rgba(0,0,0,0.55));
	color: #fff;
	display: flex; flex-direction: column; gap: 2px;
	opacity: 0; transform: translateY(8px);
	transition: opacity 0.5s var(--tff-ease), transform 0.5s var(--tff-ease);
}
.tff-grid__link:hover .tff-grid__meta,
.tff-grid__link:focus-visible .tff-grid__meta { opacity: 1; transform: none; }
.tff-grid__cat { font-size: 10px; letter-spacing: 0.3em; text-transform: uppercase; opacity: 0.85; }
.tff-grid__title { font-family: var(--tff-serif); font-size: 25px; line-height: 1.15; text-transform: lowercase; }

@media (hover: none) {
	.tff-grid__meta { position: static; opacity: 1; transform: none; background: none; color: var(--tff-ink); padding: 12px 2px 6px; }
}
.tff-grid__meta--static { position: static; opacity: 1; transform: none; background: none; color: var(--tff-ink); padding: 12px 2px 6px; }

.tff-empty { text-align: center; padding: 20px var(--tff-pad) 120px; color: var(--tff-muted); font-family: var(--tff-serif); font-size: 24px; }
.tff-empty a { font-family: var(--tff-sans); font-size: 14px; border-bottom: 1px solid; }

@keyframes tff-fade { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- Single project ---------- */

.tff-project__content { max-width: 1400px; margin: 0 auto; padding: 0 var(--tff-pad); }
.tff-project__content > p { max-width: 720px; margin-left: auto; margin-right: auto; }
.tff-project__content .wp-block-image img { width: 100%; }

.tff-project__nav {
	max-width: 1400px; margin: 0 auto;
	padding: 56px var(--tff-pad);
	display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px; align-items: center;
	font-size: 12px; letter-spacing: 0.24em; text-transform: uppercase;
}
.tff-project__next { text-align: right; }
.tff-project__all { border-bottom: 1px solid; padding-bottom: 4px; }

.tff-cta { text-align: center; padding: 72px var(--tff-pad) 110px; border-top: 1px solid var(--tff-line); }
.tff-cta__title { font-family: var(--tff-serif); font-size: clamp(34px, 4.5vw, 58px); font-weight: 400; letter-spacing: -0.02em; margin: 0 0 26px; line-height: 1; }

/* ---------- Category photo wall (equal-height rows) ---------- */

.tff-wall {
	--h: clamp(120px, 19vw, 320px);
	--gap: clamp(6px, 0.9vw, 14px);
	display: flex; flex-wrap: wrap; gap: var(--gap);
	padding: 0 var(--tff-pad) clamp(48px, 6vw, 80px);
}
/* Keeps the last row from stretching. */
.tff-wall::after { content: ""; flex-grow: 999999; }

.tff-wall__item {
	/* --r is each photo's width ÷ height, so every photo in a row gets the same height. */
	flex-grow: calc(var(--r) * 100);
	flex-basis: calc(var(--r) * var(--h));
	max-width: 100%;
	display: block; overflow: hidden;
	background: var(--tff-sand);
}
.tff-wall__item:hover { opacity: 1; }
.tff-wall__img {
	display: block; width: 100%; height: 100%;
	aspect-ratio: var(--r); object-fit: cover;
	transition: transform 1s var(--tff-ease), opacity 0.4s;
}
.tff-wall__item:hover .tff-wall__img { transform: scale(1.03); opacity: 0.92; }
.tff-wall__others { padding-bottom: clamp(56px, 8vw, 96px); }

@media (max-width: 640px) {
	.tff-wall { --h: 118px; --gap: 6px; }
}

/* ---------- Portfolio landing: one tile per category ---------- */

.tff-cats {
	display: grid; grid-template-columns: 1fr;
	gap: clamp(36px, 4vw, 56px) clamp(16px, 2vw, 28px);
	padding: 0 var(--tff-pad) clamp(64px, 8vw, 110px);
}
@media (min-width: 640px) { .tff-cats { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .tff-cats { grid-template-columns: repeat(3, 1fr); } }

.tff-cats__item { display: block; }
.tff-cats__item:hover { opacity: 1; }
.tff-cats__photo { display: block; aspect-ratio: 4 / 5; overflow: hidden; background: var(--tff-sand); margin-bottom: 18px; }
.tff-cats__img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--tff-ease); }
.tff-cats__item:hover .tff-cats__img { transform: scale(1.04); }
.tff-cats__name {
	display: block;
	font-family: var(--tff-serif); font-weight: 400;
	font-size: clamp(28px, 2.6vw, 38px); line-height: 1.1; letter-spacing: -0.01em;
}
.tff-cats__count {
	display: block; margin-top: 8px;
	font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--tff-muted);
}

/* ---------- Project viewer (one photo at a time) ---------- */

.tff-viewer {
	--tff-stage-h: calc(100vh - var(--tff-header) - var(--tff-admin) - 112px);
	padding: clamp(4px, 1.5vw, 20px) var(--tff-pad) 0;
}
@supports (height: 100svh) {
	.tff-viewer { --tff-stage-h: calc(100svh - var(--tff-header) - var(--tff-admin) - 112px); }
}

.tff-viewer__stage { position: relative; }
/* "js" is set on <html> before the page draws, so only photo 1 is ever shown at first. */
.js .tff-viewer__stage { height: var(--tff-stage-h); min-height: 300px; }

.tff-viewer__slide {
	margin: 0;
	height: var(--tff-stage-h); min-height: 300px;
	display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.js .tff-viewer__slide {
	position: absolute; inset: 0; height: auto;
	opacity: 0; visibility: hidden;
}
.js .tff-viewer__slide.is-active { opacity: 1; visibility: visible; }

/* Fades are switched on only after the first photo is in place. */
.tff-viewer.is-animated .tff-viewer__slide { transition: opacity 0.5s var(--tff-ease), visibility 0s linear 0.5s; }
.tff-viewer.is-animated .tff-viewer__slide.is-active { transition: opacity 0.5s var(--tff-ease), visibility 0s; }
.tff-viewer__img { max-width: 100%; max-height: 100%; width: auto; height: auto; min-height: 0; object-fit: contain; }
.tff-viewer__slide:has(.tff-viewer__caption) .tff-viewer__img { max-height: calc(100% - 30px); }
.tff-viewer__caption { flex: none; margin-top: 10px; text-align: center; font-size: 13px; color: var(--tff-muted); }

/* Click the left / right half of the photo to go back / forward. */
.tff-viewer__hit {
	position: absolute; top: 0; bottom: 0; z-index: 2; width: 50%;
	background: none; -webkit-tap-highlight-color: transparent;
}
.tff-viewer__hit--prev { left: 0; cursor: w-resize; }
.tff-viewer__hit--next { right: 0; cursor: e-resize; }
.tff-viewer__hit:focus-visible { outline-offset: -6px; }

.tff-viewer__bar {
	display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
	padding: 34px 0 26px;
	font-size: 15px;
}
.tff-viewer__back a { color: var(--tff-muted); }
.tff-viewer__back a:hover { color: var(--tff-ink); opacity: 1; }
.tff-viewer__pager { display: flex; align-items: center; gap: 10px; font-size: 17px; }
.tff-viewer__pager button { padding: 12px 14px; margin: -12px -6px; min-height: 44px; transition: opacity 0.3s; }
.tff-viewer__pager button:hover { opacity: 0.55; }
.tff-viewer__pager span { color: var(--tff-muted); }
.tff-viewer__info { justify-self: end; display: flex; align-items: baseline; gap: 14px; text-align: right; }
.tff-viewer__title { font-family: var(--tff-serif); font-size: 19px; }
.tff-viewer__count { font-size: 12px; letter-spacing: 0.2em; color: var(--tff-muted); white-space: nowrap; }

.tff-viewer__more {
	max-width: 640px; margin: 24px auto 0; padding: 0 0 clamp(56px, 8vw, 96px);
	text-align: center;
}
.tff-viewer__note { margin: 0 0 24px; color: var(--tff-muted); }
.tff-viewer__nextproject { margin: 0; }
.tff-viewer__nextproject a {
	font-size: 12px; letter-spacing: 0.24em; text-transform: uppercase;
	padding-bottom: 4px; border-bottom: 1px solid currentColor;
}

@media (max-width: 700px) {
	.tff-viewer { --tff-stage-h: calc(100svh - var(--tff-header) - var(--tff-admin) - 150px); }
	.tff-viewer__bar { grid-template-columns: 1fr 1fr; row-gap: 18px; padding-top: 26px; }
	.tff-viewer__pager { grid-column: 1 / -1; order: -1; justify-content: center; font-size: 18px; }
	.tff-viewer__title { display: none; }
	.tff-viewer.is-animated .tff-viewer__stage { transition: height 0.35s var(--tff-ease); }
}

/* ---------- About ---------- */

.tff-about {
	display: grid;
	grid-template-columns: 1fr;
	gap: clamp(40px, 6vw, 110px);
	padding: clamp(32px, 5vw, 72px) var(--tff-pad) clamp(56px, 8vw, 110px);
	max-width: 1500px; margin: 0 auto;
}
@media (min-width: 900px) {
	.tff-about { grid-template-columns: 1fr 1fr; align-items: start; }
	.tff-about__media { position: sticky; top: calc(var(--tff-header) + var(--tff-admin) + 24px); }
}
.tff-about__img { width: 100%; max-height: 82vh; object-fit: cover; }
.tff-about__img--empty { aspect-ratio: 4 / 5; background: var(--tff-sand); }
.tff-about__text { max-width: 580px; padding-top: 2vw; }
.tff-about__text .tff-title { margin-bottom: 36px; }
.tff-about__text .tff-button { margin-top: 24px; }

/* Story only (no photo column): one centred column, comfortable to read. */
.tff-about--single { display: block; max-width: 820px; }
.tff-about--single .tff-about__text { max-width: none; padding-top: 0; }
.tff-about--single .tff-about__text > .tff-eyebrow,
.tff-about--single .tff-about__text > .tff-title { text-align: center; }
.tff-about--single .tff-content { font-size: 18px; line-height: 1.85; }
.tff-about--single .tff-content > p.tff-lead:first-child { text-align: center; margin-bottom: 1.6em; }

/* ---------- Team (About page) ---------- */

.tff-team {
	max-width: 1500px; margin: 0 auto;
	padding: clamp(56px, 8vw, 110px) var(--tff-pad) clamp(64px, 8vw, 110px);
	border-top: 1px solid var(--tff-line);
}
.tff-team__head { text-align: center; margin-bottom: clamp(40px, 5vw, 72px); }
.tff-team__title { font-size: clamp(38px, 5vw, 72px); }

.tff-team__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: clamp(40px, 4vw, 56px) clamp(20px, 2.4vw, 36px);
}
@media (min-width: 560px) { .tff-team__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .tff-team__grid { grid-template-columns: repeat(4, 1fr); } }

.tff-member__photo {
	aspect-ratio: 4 / 5;
	overflow: hidden;
	background: var(--tff-sand);
	display: grid; place-items: center;
	margin-bottom: 22px;
}
.tff-member__img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--tff-ease); }
.tff-member:hover .tff-member__img { transform: scale(1.03); }
.tff-member__placeholder { width: 34%; height: auto; fill: none; stroke: var(--tff-muted); stroke-width: 1.2; stroke-linecap: round; opacity: 0.55; }

.tff-member__name {
	margin: 0;
	font-family: var(--tff-serif); font-weight: 400;
	font-size: clamp(28px, 2.4vw, 36px); line-height: 1.1;
	letter-spacing: -0.01em; text-transform: none;
}
.tff-member__role {
	margin: 8px 0 14px;
	font-size: 11px; font-weight: 400; letter-spacing: 0.3em; text-transform: uppercase; color: var(--tff-muted);
}
.tff-member__bio { font-size: 16px; line-height: 1.7; }
.tff-member__bio p { margin: 0 0 1em; }
.tff-member__bio p:last-child { margin-bottom: 0; }
.tff-member__photo { cursor: pointer; }
.tff-member__photo:hover { opacity: 1; }
.tff-member__name a:hover { opacity: 0.6; }
.tff-member__toggle {
	display: inline-block;
	margin-top: 16px;
	font-size: 11px; font-weight: 400; letter-spacing: 0.3em; text-transform: uppercase;
	padding-bottom: 4px; border-bottom: 1px solid currentColor;
}

/* ---------- Team member page ---------- */

.tff-person {
	display: grid;
	grid-template-columns: 1fr;
	gap: clamp(36px, 6vw, 110px);
	max-width: 1400px; margin: 0 auto;
	padding: clamp(28px, 5vw, 72px) var(--tff-pad) clamp(56px, 8vw, 110px);
}
@media (min-width: 960px) {
	.tff-person { grid-template-columns: 5fr 6fr; align-items: start; }
	.tff-person__media { position: sticky; top: calc(var(--tff-header) + var(--tff-admin) + 24px); }
}
.tff-person__img {
	width: 100%;
	aspect-ratio: 4 / 5;
	object-fit: cover;
	max-height: calc(100vh - var(--tff-header) - var(--tff-admin) - 48px);
}
.tff-person__img--empty { background: var(--tff-sand); display: grid; place-items: center; }

.tff-person__text { max-width: 660px; }
.tff-person__back {
	display: inline-block; margin-bottom: clamp(28px, 4vw, 48px);
	font-size: 11px; font-weight: 400; letter-spacing: 0.3em; text-transform: uppercase; color: var(--tff-muted);
}
.tff-person__name { text-transform: none; margin-bottom: clamp(28px, 3vw, 40px); }

/* Long-form reading: comfortable size, line length and spacing. */
.tff-person__bio { font-size: 18px; line-height: 1.85; max-width: 62ch; }
.tff-person__bio p { margin-bottom: 1.5em; }
.tff-person__bio > p:first-child {
	font-family: var(--tff-serif); font-weight: 300;
	font-size: clamp(21px, 2vw, 25px); line-height: 1.5;
	margin-bottom: 1.4em;
}
.tff-person .tff-button { margin-top: 24px; }
.tff-person__nav { border-top: 1px solid var(--tff-line); }

@media (max-width: 959px) {
	.tff-person__img { max-height: 70vh; }
	.tff-person__bio { font-size: 17px; }
}

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

.tff-contact {
	display: grid;
	grid-template-columns: 1fr;
	gap: clamp(48px, 7vw, 120px);
	padding: clamp(32px, 5vw, 72px) var(--tff-pad) 110px;
	max-width: 1400px; margin: 0 auto;
}
@media (min-width: 960px) { .tff-contact { grid-template-columns: 5fr 7fr; } }

.tff-contact__intro .tff-title { margin-bottom: 32px; }
.tff-contact__intro .tff-content { max-width: 440px; }

.tff-details { margin: 36px 0 30px; display: grid; grid-template-columns: auto 1fr; gap: 10px 28px; }
.tff-details dt { font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--tff-muted); padding-top: 5px; }
.tff-details dd { margin: 0; }

.tff-form { display: grid; gap: 30px; }
.tff-form__row { display: grid; gap: 30px; }
@media (min-width: 640px) { .tff-form__row { grid-template-columns: 1fr 1fr; } }

.tff-field { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.tff-field > span, .tff-field legend {
	font-size: 11px; font-weight: 400; letter-spacing: 0.3em; text-transform: uppercase; color: var(--tff-muted);
	padding: 0;
}
.tff-field input, .tff-field textarea {
	width: 100%;
	font: inherit; font-size: 17px; color: var(--tff-ink);
	background: transparent;
	border: 0; border-bottom: 1px solid var(--tff-line); border-radius: 0;
	padding: 10px 0;
	transition: border-color 0.3s;
	-webkit-appearance: none; appearance: none;
}
.tff-field input[type="date"] { min-height: 46px; }
.tff-field textarea { resize: vertical; min-height: 140px; }
.tff-field input:focus, .tff-field textarea:focus { outline: none; border-bottom-color: var(--tff-ink); }

.tff-field--choices { display: flex; flex-wrap: wrap; gap: 10px; }
.tff-field--choices legend { margin-bottom: 14px; }
.tff-choice { position: relative; }
.tff-choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.tff-choice span {
	display: inline-block; padding: 9px 20px;
	border: 1px solid var(--tff-line); border-radius: 40px;
	font-size: 14px; transition: all 0.3s;
}
.tff-choice input:checked + span { background: var(--tff-ink); border-color: var(--tff-ink); color: var(--tff-cream); }
.tff-choice input:focus-visible + span { outline: 1px solid var(--tff-ink); outline-offset: 3px; }

.tff-form .tff-button { justify-self: start; cursor: pointer; }

.tff-hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.tff-notice { padding: 18px 22px; margin-bottom: 30px; font-size: 15px; }
.tff-notice--success { background: var(--tff-sand); }
.tff-notice--error { border: 1px solid #a5412f; color: #8a3324; }

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

.tff-footer { border-top: 1px solid var(--tff-line); padding: 36px var(--tff-pad) 32px; }
.tff-footer__inner { display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; }
.tff-footer__copy { margin: 0; font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--tff-muted); }

/* ---------- Pagination ---------- */

.tff-pagination { text-align: center; padding: 0 var(--tff-pad) 80px; }
.tff-pagination .nav-links { display: flex; justify-content: center; gap: 18px; }

.tff-404 { min-height: 50vh; display: grid; place-content: center; }

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

.tff-lightbox {
	position: fixed; inset: 0; z-index: 300;
	background: rgba(18, 16, 14, 0.97);
	display: grid; place-items: center;
	opacity: 0; transition: opacity 0.4s var(--tff-ease);
	color: #fff;
}
.tff-lightbox.is-open { opacity: 1; }
.tff-lightbox__img { max-width: 92vw; max-height: 88vh; width: auto; height: auto; object-fit: contain; user-select: none; }
.tff-lightbox__btn {
	position: absolute; width: 52px; height: 52px; display: grid; place-items: center;
	border-radius: 50%; transition: background 0.3s;
}
.tff-lightbox__btn:hover { background: rgba(255,255,255,0.1); }
.tff-lightbox__close { top: 18px; right: 18px; }
.tff-lightbox__prev { left: 14px; top: 50%; transform: translateY(-50%); }
.tff-lightbox__next { right: 14px; top: 50%; transform: translateY(-50%); }
.tff-lightbox__count { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); font-size: 12px; letter-spacing: 0.24em; }

/* ---------- Motion preferences ---------- */

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
	.tff-slide.is-active .tff-shot__img { transform: none; }
}

