/* ==========================================================================
   Plant and facility photos: gallery page, photo strips, contact photo.
   Uses the colour and font variables from prime.css.
   ========================================================================== */

/* Page header with a real photograph behind it */
.phead--dark.phead--photo .phead__bg { opacity: 0.55; background-position: center 78%; }
.phead--dark.phead--photo::after { background: linear-gradient(180deg, rgba(11, 11, 13, 0.55) 0%, rgba(11, 11, 13, 0.35) 40%, var(--graphite) 100%); }

/* ---------------------------------------------------------------- Gallery */
.fg { padding-top: clamp(28px, 4vw, 56px); }

.fg__bar { position: sticky; top: var(--hdr); z-index: 20; margin: 0 calc(var(--gut) * -1) 0; padding: 14px var(--gut); background: rgba(11, 11, 13, 0.86); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.fg__filters { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.fg__filters::-webkit-scrollbar { display: none; }
.fg__chip { flex: none; display: inline-flex; align-items: center; gap: 0.55rem; padding: 0.6rem 1.15rem; border: 1px solid rgba(255, 255, 255, 0.22); border-radius: 999px; background: none; color: #fff; font-size: 0.95rem; font-weight: 500; white-space: nowrap; transition: background 0.25s, color 0.25s, border-color 0.25s; }
.fg__chip span { font-size: 0.78rem; color: var(--on-dark-muted); transition: color 0.25s; }
.fg__chip:hover { border-color: rgba(255, 255, 255, 0.6); }
.fg__chip[aria-pressed="true"] { background: #fff; border-color: #fff; color: var(--graphite); }
.fg__chip[aria-pressed="true"] span { color: var(--red); }

.fg__meta { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 32px; margin: clamp(24px, 3vw, 40px) 0 clamp(18px, 2.4vw, 28px); }
.fg__intro { max-width: 62ch; color: var(--on-dark-muted); }
.fg__count { font-size: 0.9rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--amber); }

.fg__grid { column-width: 300px; column-gap: 14px; }
.fg__item { break-inside: avoid; margin: 0 0 14px; }
.fg__item[hidden] { display: none; }

/* JS masonry: photos are placed left to right (4 in the first row, next 4 below, ...) */
.fg__grid { position: relative; }
.fg.is-masonry .fg__grid { column-width: auto; }
.fg.is-masonry .fg__item { position: absolute; top: 0; left: 0; margin: 0; transition: top 0.45s var(--ease), left 0.45s var(--ease), opacity 0.3s; }
.fg__btn { position: relative; display: block; width: 100%; padding: 0; border: 0; border-radius: 16px; background: var(--graphite-2); overflow: hidden; text-align: left; }
.fg__btn img { width: 100%; height: auto; transition: transform 0.9s var(--ease), filter 0.5s; }
.fg__btn:hover img, .fg__btn:focus-visible img { transform: scale(1.045); }
.fg__cap { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; gap: 2px; padding: 46px 16px 14px; background: linear-gradient(180deg, transparent, rgba(11, 11, 13, 0.86)); color: #fff; font-size: 0.95rem; line-height: 1.35; opacity: 0; transform: translateY(8px); transition: opacity 0.35s, transform 0.5s var(--ease); pointer-events: none; }
.fg__cap em { font-style: normal; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--amber); }
.fg__btn:hover .fg__cap, .fg__btn:focus-visible .fg__cap { opacity: 1; transform: none; }
@media (min-width: 900px) { .fg__filters { flex-wrap: wrap; overflow: visible; } }
@media (hover: none) { .fg__cap { opacity: 1; transform: none; } }

/* Photographs on the viewer: no white box behind them */
.fg .lightbox__img { background: #0b0b0d; }

@media (max-width: 640px) {
	.fg__grid { column-width: 150px; column-gap: 8px; }
	.fg__item { margin-bottom: 8px; }
	.fg__btn { border-radius: 12px; }
	.fg__cap { padding: 28px 10px 9px; font-size: 0.8rem; }
	.fg__cap em { font-size: 0.64rem; }
	.fg__chip { padding: 0.5rem 0.95rem; font-size: 0.88rem; }
}

/* ------------------------------------------------------------ Photo strip */
.fstrip__text { max-width: 48ch; color: var(--muted); }
.fstrip__grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: clamp(130px, 17vw, 250px); gap: 14px; }
.fstrip__item { overflow: hidden; border-radius: 20px; background: var(--studio); }
.fstrip__item:first-child { grid-column: span 2; grid-row: span 2; }
.fstrip__item a { display: block; height: 100%; }
.fstrip__item img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease); }
.fstrip__item:hover img { transform: scale(1.05); }
.fstrip__more { margin-top: clamp(24px, 3vw, 40px); }
@media (max-width: 760px) {
	.fstrip__grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 120px; gap: 8px; }
	.fstrip__item:first-child { grid-column: span 2; grid-row: span 2; }
	.fstrip__item { border-radius: 14px; }
}

/* ----------------------------------------------------- Contact: plant photo */
.fphoto { position: relative; margin-top: 18px; border-radius: 26px; overflow: hidden; background: var(--graphite); aspect-ratio: 21 / 8; }
.fphoto img { width: 100%; height: 100%; object-fit: cover; object-position: center 40%; }
.fphoto figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 60px clamp(18px, 3vw, 36px) clamp(16px, 2.4vw, 28px); background: linear-gradient(180deg, transparent, rgba(11, 11, 13, 0.82)); color: #fff; }
.fphoto figcaption strong { display: block; font-family: var(--font-display); font-size: clamp(1.15rem, 2vw, 1.7rem); font-weight: 500; }
.fphoto figcaption span { color: var(--on-dark-muted); font-size: 0.95rem; }
@media (max-width: 700px) { .fphoto { aspect-ratio: 4 / 3; border-radius: 18px; } }

@media (prefers-reduced-motion: reduce) {
	.fg__btn img, .fstrip__item img, .fg__cap { transition: none; }
}

.pphoto { padding-top: 0; }
.pphoto .fphoto { margin-top: 0; }