/* Project page (/galereya/<slug>, renderProject in build.mjs). Blocks follow the order set in the admin;
   an empty block is not rendered. Site palette: ink #605c52, sand #e4d9c9, soft #a7a192; Playfair Display for headings.

   Spacing — one scale for the whole page:
     --gutter     page side margins (the site's 9.75rem on desktop)
     --space-xl   between major sections on white
     --space-l    between related blocks
     --space-m    inside a block (label → heading → text)
   Full-width sections (Результат, before/after, dark and sand bands, invitation) sit edge to edge. */

.pj-page {
  --ink: #605c52; --sand: #e4d9c9; --soft: #a7a192; --deep: #2c2a25;
  --gutter: 9.75rem;
  /* the site's own rhythm (the «наші роботи» block on the home page): 3.75rem around a section, rem follows the screen */
  --space-xl: 3.75rem;
  --space-l: 3rem;
  --space-m: 1.5rem;
  --cols: repeat(12, minmax(0, 1fr));
  --gap: clamp(1rem, 2vw, 2rem);
}
@media screen and (max-width: 991px) { .pj-page { --gutter: 2rem; } }
@media screen and (max-width: 767px) { .pj-page { --gutter: 1.25rem; } }

/* Full-width sections are 100vw wide; clip keeps them from adding a horizontal scroll */
html:has(body.pj-page), body.pj-page { overflow-x: clip; }
.pj-page .pj-full { width: 100vw; margin-left: calc(50% - 50vw); }

.pj-page .pj-eyebrow { margin-bottom: var(--space-m); }
.pj-page .pj-eyebrow .badge h4 { margin: 0; }
.pj-page h2, .pj-page h3 { font-family: "Playfair Display", serif; font-weight: 400; }

/* 1. Cover: full screen, mood line + name, facts along the bottom */
.pj-page .pj-hero { position: relative; width: 100vw; margin-left: calc(50% - 50vw); height: 100vh; height: 100svh; min-height: 34rem; overflow: hidden; background: var(--deep); }
.pj-page .pj-hero-img { position: absolute; inset: -6% 0; width: 100%; height: 112%; object-fit: cover; transform: scale(1.12); will-change: transform; }
.pj-page .pj-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(30, 28, 24, .45) 0%, rgba(30, 28, 24, 0) 26%, rgba(30, 28, 24, 0) 45%, rgba(30, 28, 24, .78) 100%); }
.pj-page .pj-hero-text { position: absolute; left: var(--gutter); right: var(--gutter); bottom: calc(var(--space-l) + 3rem); z-index: 1; color: #fff; }
.pj-page .pj-hero-mood { font-size: 1.05rem; letter-spacing: .12em; text-transform: uppercase; opacity: .85; }
.pj-page .pj-hero-title { margin: 1rem 0 0; color: #fff; font-family: "Playfair Display", serif; font-weight: 400; font-size: clamp(2.6rem, 6.2vw, 6.5rem); line-height: 1.02; text-shadow: 0 2px 30px rgba(0, 0, 0, .25); }
.pj-page .pj-hero-facts { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 2.5rem; z-index: 1; display: flex; flex-wrap: wrap; gap: .5rem 2.5rem; padding-top: 1.25rem; border-top: 1px solid rgba(255, 255, 255, .35); color: rgba(255, 255, 255, .85); font-size: .95rem; }

.pj-page .pj-result-media { position: relative; overflow: hidden; }
.pj-page .pj-result-media > img { position: absolute; inset: -8% 0; width: 100%; height: 116%; object-fit: cover; will-change: transform; }
.pj-page .pj-result-text h3 { margin: 0 0 var(--space-m); color: var(--ink); font-size: clamp(2.1rem, 3.2vw, 3.2rem); line-height: 1.1; }
.pj-page .pj-result-text p { margin: 0; color: #3b3b34; font-size: 1.1rem; line-height: 1.85; }
.pj-page .pj-card { background: #fff; padding: clamp(1.75rem, 3vw, 3rem); box-shadow: 0 24px 60px rgba(44, 42, 37, .08); }

/* Результат: a wide photo with the card over it; it runs straight into the before/after band */
.pj-page .pj-result { position: relative; display: block; width: 100vw; margin-left: calc(50% - 50vw); }
.pj-page .pj-result .pj-result-media { height: 85vh; min-height: 32rem; }
.pj-page .pj-result .pj-result-text { position: absolute; right: var(--gutter); bottom: var(--space-l); max-width: 30rem; background: rgba(255, 255, 255, .95); backdrop-filter: blur(6px); }

/* 3. Before/after over the blurred «after» photo */
.pj-page .pj-band { position: relative; width: 100vw; margin: 0 0 0 calc(50% - 50vw); padding: var(--space-xl) var(--gutter); overflow: hidden; background: var(--deep); }
.pj-page .pj-band-bg { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(28px) saturate(1.1); opacity: .55; }
.pj-page .pj-band::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(90deg, rgba(30, 28, 24, .55), rgba(30, 28, 24, .82)); }
.pj-page .pj-band-grid { position: relative; z-index: 2; display: grid !important; grid-template-columns: auto 1fr; gap: var(--space-l); align-items: center; border: 0; }
.pj-page .pj-band .beer-slider > img, .pj-page .pj-band .beer-reveal > img { max-height: 80vh; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.pj-page .pj-band-text { color: #fff; max-width: 30rem; }
.pj-page .pj-band-text h2 { margin: 0; color: #fff; font-size: clamp(2.1rem, 3.4vw, 3.4rem); line-height: 1.12; }
.pj-page .pj-band-text p { margin: var(--space-m) 0; color: rgba(255, 255, 255, .75); font-size: 1.05rem; line-height: 1.7; }
.pj-page .pj-band-text dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 1rem 1.5rem; padding-top: var(--space-m); border-top: 1px solid rgba(255, 255, 255, .25); }
.pj-page .pj-band-text dt { color: var(--sand); font-family: "Playfair Display", serif; font-size: 1.15rem; }
.pj-page .pj-band-text dd { margin: 0; color: rgba(255, 255, 255, .85); line-height: 1.6; }
/* Landscape pair: the words go on one row above, the slider takes the full width */
.pj-page .pj-band.is-landscape .pj-band-grid { grid-template-columns: 1fr; gap: var(--space-m); }
.pj-page .pj-band.is-landscape .pj-band-text { order: -1; max-width: none; display: grid; grid-template-columns: 1.2fr 1fr; gap: 1rem var(--space-l); align-items: end; }
.pj-page .pj-band.is-landscape .pj-band-text p { margin: var(--space-m) 0 0; }
.pj-page .pj-band.is-landscape .pj-band-text dl { grid-column: 2; grid-row: 1 / 3; align-self: end; }
.pj-page .pj-band.is-landscape .image-wrapper, .pj-page .pj-band.is-landscape .beer-slider { display: block; width: 100%; }
.pj-page .pj-band.is-landscape .beer-slider > img { width: 100%; max-height: 78vh; object-fit: cover; }
/* «Було» / «Стало» on the photos; the page script builds the slider with English labels. The revealed (left) photo is «before». */
.pj-page .pj-band .beer-slider[data-beer-label]::after, .pj-page .pj-band .beer-reveal[data-beer-label]::after {
  content: "Стало"; position: absolute; top: 1rem; padding: .35rem .9rem; background: rgba(30, 28, 24, .55); color: #fff;
  font-size: .9rem; letter-spacing: .04em; border-radius: 2rem; opacity: 1; transform: none;
}
.pj-page .pj-band .beer-slider[data-beer-label]::after { right: 1rem; left: auto; }
.pj-page .pj-band .beer-reveal[data-beer-label]::after { content: "Було"; left: 1rem; right: auto; }
/* «Було» always covers exactly the frame of «Стало»: the two photos often differ in proportions */
.pj-page .pj-band .beer-reveal > img { height: 100% !important; max-height: none !important; object-fit: cover; box-shadow: none; }

/* 4. Mosaic on a 6-column grid, repeating every six photos: one large with two beside it, then three equal.
   !important: Webflow places grid items with #w-node-… rules, and ids outrank classes. */
.pj-page .pj-mosaic { padding: var(--space-xl) 0; }
.pj-page .pj-mosaic .gallery_list { grid-template-columns: repeat(6, 1fr); grid-template-rows: none; grid-auto-rows: clamp(10rem, 15vw, 16.5rem); gap: var(--gap); }
.pj-page .pj-mosaic .gallery_list > * { min-height: 0; overflow: hidden; grid-area: auto !important; }
.pj-page .pj-mosaic .lightbox-link { height: 100%; }
@media screen and (min-width: 768px) {
  .pj-page .pj-mosaic .gallery_list > * { grid-column: span 2 !important; }
  .pj-page .pj-mosaic .gallery_list > :nth-child(6n+1) { grid-column: span 4 !important; grid-row: span 2 !important; }
  /* a last row of two (twice as tall, so they are not panoramas) or one fills the width */
  .pj-page .pj-mosaic .gallery_list > :nth-child(6n+4):nth-last-child(2),
  .pj-page .pj-mosaic .gallery_list > :nth-child(6n+5):last-child { grid-column: span 3 !important; grid-row: span 2 !important; }
  .pj-page .pj-mosaic .gallery_list > :nth-child(6n+4):last-child { grid-column: span 6 !important; }
}

/* 5. Invitation over a full-width photo */
.pj-page .pj-cta { position: relative; width: 100vw; margin: var(--space-xl) 0 0 calc(50% - 50vw); padding: var(--space-xl) 0; min-height: 80vh; display: flex; align-items: center; overflow: hidden; background: var(--deep); }
.pj-page .pj-cta-bg { position: absolute; inset: 0; overflow: hidden; }
.pj-page .pj-cta-bg img { position: absolute; inset: -10% 0; width: 100%; height: 120%; object-fit: cover; will-change: transform; }
.pj-page .pj-cta::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(30, 28, 24, .82) 0%, rgba(30, 28, 24, .55) 55%, rgba(30, 28, 24, .2) 100%); }
.pj-page .pj-cta-in { position: relative; z-index: 1; max-width: 40rem; margin: 0 var(--gutter); color: #fff; }
.pj-page .pj-cta-eyebrow { color: var(--sand); letter-spacing: .12em; text-transform: uppercase; font-size: .95rem; }
.pj-page .pj-cta h2 { margin: var(--space-m) 0 0; color: #fff; font-size: clamp(2.2rem, 4.2vw, 4.2rem); line-height: 1.1; }
.pj-page .pj-cta p { margin: var(--space-m) 0 calc(var(--space-m) * 1.25); max-width: 32rem; color: rgba(255, 255, 255, .82); font-size: 1.12rem; line-height: 1.75; }
.pj-page .pj-cta-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem 2.25rem; }
.pj-page .pj-cta-btn { display: inline-flex; padding: 1.1rem 2.2rem; background: #fff; color: var(--ink); text-decoration: none; font-size: 1.05rem; transition: background .3s, transform .3s; }
.pj-page .pj-cta-btn:hover { background: var(--sand); transform: translateY(-2px); }
.pj-page .pj-cta-link { color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255, 255, 255, .45); padding-bottom: .2rem; transition: border-color .3s; }
.pj-page .pj-cta-link:hover { border-color: #fff; }

/* 6. Three other projects in a row */
.pj-page .galleries_list { margin-top: var(--space-xl); }
.pj-page .galleries_list .gallry_list_main { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.pj-page .galleries_list .cover_thumb { height: 18rem; }

/* Fade-up as sections come into view (only when the script runs) */
.pj-js [data-reveal] { opacity: 0; transform: translateY(36px); transition: opacity 1.1s ease, transform 1.1s cubic-bezier(.2, .6, .2, 1); }
.pj-js [data-reveal].is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .pj-js [data-reveal] { opacity: 1; transform: none; transition: none; } }

/* Tablet: one column, cards overlap the photo from below */
@media screen and (max-width: 991px) {
  .pj-page .pj-result .pj-result-text { position: relative; right: auto; bottom: auto; max-width: none; margin: calc(var(--space-l) * -1) var(--gutter) 0; }
  .pj-page .pj-band-grid { grid-template-columns: 1fr; justify-items: center; }
  .pj-page .pj-band.is-landscape .pj-band-text { grid-template-columns: 1fr; }
  .pj-page .pj-band.is-landscape .pj-band-text dl { grid-column: 1; grid-row: auto; }
}
@media screen and (max-width: 767px) {
  .pj-page .pj-hero-facts { gap: .35rem 1.25rem; font-size: .82rem; bottom: 1.5rem; }
  .pj-page .pj-hero-mood { font-size: .8rem; }
  .pj-page .pj-result .pj-result-media { height: 62vh; min-height: 22rem; }
  .pj-page .pj-result .pj-result-text { margin: -2.5rem 1rem 0; }
  .pj-page .pj-band .beer-slider > img, .pj-page .pj-band .beer-reveal > img { max-height: 70vh; }
  .pj-page .pj-mosaic .gallery_list { grid-template-columns: 1fr 1fr; grid-auto-rows: 9.5rem; }
  .pj-page .pj-mosaic .gallery_list > :nth-child(3n+1) { grid-column: span 2 !important; grid-row: span 2 !important; }
  .pj-page .pj-mosaic .gallery_list > :nth-child(3n+2):last-child { grid-column: span 2 !important; }
  .pj-page .pj-cta { min-height: 75vh; }
  .pj-page .pj-cta::after { background: rgba(30, 28, 24, .68); }
  .pj-page .galleries_list .gallry_list_main { grid-template-columns: 1fr; }
}


/* ======== Concept blocks: zones, plan, day/night, stages, plants, stories ======== */
.pj-page h2 { margin: 0 0 var(--space-m); color: var(--ink); font-size: clamp(2.1rem, 3.4vw, 3.4rem); line-height: 1.1; }
.pj-page section > div > p, .pj-plan-text p { margin: 0; color: #3b3b34; font-size: 1.1rem !important; line-height: 1.8 !important; }

/* ---------- About + zones ---------- */
.pj-about { padding: var(--space-xl) 0; }
.pj-about-text { max-width: 58rem; }
.pj-page .pj-statement { margin: 0; color: var(--ink) !important; font-family: "Playfair Display", serif; font-size: clamp(1.9rem, 3.2vw, 3.2rem) !important; line-height: 1.22 !important; }
.pj-page .pj-intro p { margin: 0 0 1em; color: #3b3b34; font-size: 1.1rem !important; line-height: 1.8 !important; }
.pj-page .pj-intro p:last-child { margin-bottom: 0; }
/* no big line: the description itself leads, larger and in the heading face */
.pj-page .pj-intro.is-lead { padding: 0; border: 0; max-width: 52rem; }
.pj-page .pj-intro.is-lead p { color: var(--ink); font-family: "Playfair Display", serif; font-size: clamp(1.4rem, 2.1vw, 2rem) !important; line-height: 1.45 !important; }
.pj-page .pj-intro { max-width: 40rem; margin-top: var(--space-m) !important; padding-left: 1.25rem; border-left: 1px solid var(--sand); }
.pj-zones-head { display: flex; justify-content: space-between; align-items: baseline; margin: var(--space-l) 0 1.5rem; padding-top: 1.25rem; border-top: 1px solid rgba(96, 92, 82, .15); color: var(--ink); font-family: "Playfair Display", serif; font-size: 1.35rem; }
.pj-zones-tip { color: var(--soft); font-family: inherit; font-size: .9rem; }
.pj-zones { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--gap); }
.pj-zone { display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: 0; border: 0; background: none; color: var(--ink); text-align: center; cursor: pointer; }
/* the ring: sand → ink gradient like an unseen story; the photo zooms on hover */
.pj-zone-ring { display: block; width: 100%; max-width: 9.5rem; aspect-ratio: 1; margin-bottom: .6rem; padding: 4px; border-radius: 50%; background: conic-gradient(from 210deg, var(--sand), var(--soft), var(--ink), var(--sand)); transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.pj-zone-ring img { display: block; width: 100%; height: 100%; border: 4px solid #fff; border-radius: 50%; object-fit: cover; transition: transform 1s cubic-bezier(.2, .6, .2, 1); }
.pj-zone:hover .pj-zone-ring { transform: translateY(-4px); }
.pj-zone-title { font-family: "Playfair Display", serif; font-size: 1.05rem; line-height: 1.2; }
.pj-zone-hint { color: var(--soft); font-size: .82rem; line-height: 1.35; }

/* ---------- Plan with points ---------- */
.pj-plan { display: grid; grid-template-columns: var(--cols); gap: var(--gap); align-items: start; width: 100vw; margin-left: calc(50% - 50vw); padding: var(--space-xl) var(--gutter); background: #f3efe8; }
.pj-plan-text { grid-column: 1 / 6; }
/* the plan is tall: it fits the screen height, centred in its columns */
.pj-plan-map { position: relative; grid-column: 7 / 13; justify-self: center; width: min(100%, calc((100vh - 9rem) * var(--ratio, .734))); margin: 0; }
/* the plan keeps its shape before the image loads, so the points never collapse */
.pj-plan-map img { aspect-ratio: var(--ratio, .734); object-fit: contain; }
.pj-plan-map img { display: block; width: 100%; box-shadow: 0 30px 80px rgba(44, 42, 37, .12); }
.pj-legend { margin: var(--space-m) 0 0; padding: 0; list-style: none; columns: 2; column-gap: 1.5rem; }
.pj-legend li { break-inside: avoid; }
.pj-legend button { display: flex; align-items: center; gap: .75rem; width: 100%; padding: .55rem 0; border: 0; border-bottom: 1px solid rgba(96, 92, 82, .12); background: none; color: var(--ink); font-size: 1rem; text-align: left; cursor: pointer; transition: color .3s; }
.pj-legend button span { flex: none; display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--ink); color: #fff; font-size: .78rem; }
.pj-legend button:hover { color: #000; }
.pj-pin { position: absolute; z-index: 1; width: 2.1rem; height: 2.1rem; margin: -1.05rem 0 0 -1.05rem; padding: 0; border: 0; border-radius: 50%; background: var(--ink); color: #fff; font-size: .8rem; cursor: pointer; box-shadow: 0 0 0 4px rgba(255, 255, 255, .85), 0 6px 18px rgba(0, 0, 0, .25); }
/* a soft pulse so the points read as something to touch */
.pj-pin::before { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .9); animation: pj-pulse 2.6s ease-out infinite; }
@keyframes pj-pulse { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(1.9); opacity: 0; } }
.pj-pin-n { position: relative; }
.pj-tip { position: absolute; left: 50%; bottom: calc(100% + 12px); display: grid; gap: .2rem; width: 13.5rem; padding: .9rem 1rem; background: #fff; color: #3b3b34; font-size: .85rem; line-height: 1.4; text-align: left; box-shadow: 0 18px 40px rgba(44, 42, 37, .18); opacity: 0; pointer-events: none; transform: translate(-50%, 6px); transition: opacity .25s, transform .25s; }
.pj-tip b { color: var(--ink); font-family: "Playfair Display", serif; font-size: 1.05rem; font-weight: 400; }
.pj-tip em { margin-top: .3rem; color: var(--soft); font-style: normal; }
.pj-pin:hover, .pj-pin.is-open, .pj-pin:focus-visible { z-index: 2; }
.pj-pin:hover .pj-tip, .pj-pin.is-open .pj-tip, .pj-pin:focus-visible .pj-tip { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Day / night ---------- */
.pj-dn { padding: var(--space-xl) 0 0; }
.pj-dn-head { display: grid; grid-template-columns: var(--cols); gap: 0 var(--gap); margin-bottom: var(--space-m); }
.pj-dn-head > * { grid-column: 1 / 9; }
.pj-dn-frame { position: relative; width: 100vw; margin-left: calc(50% - 50vw); overflow: hidden; background: #6d6f7a; }
.pj-dn-frame img { display: block; width: 100%; height: auto; }
.pj-dn-night { position: absolute; inset: 0; height: 100% !important; object-fit: cover; clip-path: inset(0 0 0 var(--p)); }
.pj-dn-handle { position: absolute; top: 0; bottom: 0; left: var(--p); width: 2px; margin-left: -1px; background: #fff; pointer-events: none; }
.pj-dn-handle::after { content: "↔"; position: absolute; top: 50%; left: 50%; display: grid; place-items: center; width: 3.25rem; height: 3.25rem; border-radius: 50%; background: #fff; color: var(--ink); font-size: 1.2rem; transform: translate(-50%, -50%); box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.pj-dn-l, .pj-dn-r { position: absolute; top: 1.5rem; padding: .4rem .9rem; border-radius: 2rem; background: rgba(30, 28, 24, .55); color: #fff; font-size: .85rem; pointer-events: none; }
.pj-dn-l { left: var(--gutter); }
.pj-dn-r { right: var(--gutter); }
.pj-dn-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }

/* ---------- How the project grew ---------- */
.pj-stages { width: 100vw; margin-left: calc(50% - 50vw); padding: var(--space-xl) var(--gutter); background: var(--deep); color: #fff; }
.pj-stages-head h2 { margin-bottom: var(--space-m); }
.pj-stages-head .pj-eyebrow { margin-bottom: 1rem; }
.pj-stages h2 { color: #fff; }
.pj-stages .pj-eyebrow h4 { color: var(--sand); }
.pj-stages-frame { position: relative; height: clamp(20rem, calc(100vh - 22rem), 44rem); overflow: hidden; background: #1f1d19; }
.pj-stage { position: absolute; inset: 0; margin: 0; opacity: 0; transition: opacity .9s ease; }
.pj-stage img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.04); transition: transform 7s ease-out; }
.pj-stage.is-on { opacity: 1; }
.pj-stage.is-on img { transform: scale(1); }
.pj-stage.is-contain { background: #fff; }
.pj-stage.is-contain img { object-fit: contain; padding: 2rem; transform: none; }
.pj-stages-prev, .pj-stages-next { position: absolute; top: 50%; z-index: 1; width: 3.25rem; height: 3.25rem; margin-top: -1.6rem; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .92); color: var(--ink); font-size: 1.2rem; cursor: pointer; transition: transform .3s; }
.pj-stages-prev { left: 1.25rem; }
.pj-stages-next { right: 1.25rem; }
.pj-stages-prev:hover, .pj-stages-next:hover { transform: scale(1.08); }
.pj-stages-text { display: grid; margin-top: 1.5rem; min-height: 3.6em; }
.pj-stages-text p { grid-area: 1 / 1; max-width: 44rem; margin: 0; color: rgba(255, 255, 255, .85) !important; opacity: 0; transition: opacity .6s; }
.pj-stages-text p.is-on { opacity: 1; }
.pj-stages-text b { margin-right: 1rem; color: var(--sand); font-family: "Playfair Display", serif; font-weight: 400; }
/* timeline: a thin line that fills up to the current step */
.pj-timeline { position: relative; display: flex; justify-content: space-between; margin: 1.5rem 0 0; padding: 0; list-style: none; }
.pj-timeline::before, .pj-timeline::after { content: ""; position: absolute; left: .45rem; right: .45rem; top: .45rem; height: 1px; background: rgba(255, 255, 255, .25); }
.pj-timeline::after { right: auto; width: calc((100% - .9rem) * var(--k, 0)); background: var(--sand); transition: width .6s ease; }
.pj-timeline button { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: .7rem; padding: 0; border: 0; background: none; color: rgba(255, 255, 255, .55); font-size: .95rem; cursor: pointer; transition: color .3s; }
.pj-timeline li:first-child button { align-items: flex-start; }
.pj-timeline li:last-child button { align-items: flex-end; }
.pj-timeline button span { width: .9rem; height: .9rem; border-radius: 50%; background: var(--deep); border: 1px solid rgba(255, 255, 255, .5); transition: background .3s, transform .3s; }
.pj-timeline button.is-on { color: #fff; }
.pj-timeline button.is-on span { background: var(--sand); border-color: var(--sand); transform: scale(1.3); }

/* ---------- Plants ---------- */
.pj-plants { padding: var(--space-xl) 0; }
.pj-plants-head { max-width: 46rem; }
.pj-chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.5rem 0 2rem; }
.pj-chips button { padding: .55rem 1.1rem; border: 1px solid rgba(96, 92, 82, .3); border-radius: 2rem; background: none; color: var(--ink); font-size: .95rem; cursor: pointer; transition: background .3s, color .3s; }
.pj-chips button.is-on, .pj-chips button:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.pj-plant-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2rem var(--gap); }
/* two rows, the rest behind «show all» */
.pj-plants:not(.is-all) .pj-plant.is-more { display: none; }
@media screen and (max-width: 991px) { .pj-plants:not(.is-all) .pj-plant.is-more-m { display: none; } }
@media screen and (max-width: 767px) { .pj-plants:not(.is-all) .pj-plant.is-more-s { display: none; } }
.pj-more { display: block; margin: 2rem auto 0; padding: .8rem 1.6rem; border: 1px solid var(--ink); border-radius: 2rem; background: none; color: var(--ink); font-size: 1rem; cursor: pointer; transition: background .3s, color .3s; }
.pj-more:hover { background: var(--ink); color: #fff; }
.pj-plants.is-all .pj-more { display: none; }
.pj-plant[hidden] { display: none; }
.pj-plant-img { aspect-ratio: 1; overflow: hidden; margin-bottom: .8rem; background: var(--sand); }
.pj-plant-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s cubic-bezier(.2, .6, .2, 1); }
.pj-plant:hover .pj-plant-img img { transform: scale(1.05); }
.pj-plant h3 { margin: 0; color: var(--ink); font-size: 1.15rem; line-height: 1.2; }
.pj-latin { display: block; margin-top: .25rem; color: var(--soft); font-size: .88rem; font-style: italic; }
.pj-plant dl { display: grid; grid-template-columns: auto 1fr; gap: .2rem .8rem; margin: .7rem 0 0; padding-top: .6rem; border-top: 1px solid rgba(96, 92, 82, .12); font-size: .88rem; }
.pj-plant dt { color: var(--soft); }
.pj-plant dd { margin: 0; color: #3b3b34; }

/* ---------- Stories viewer ---------- */
html.pj-story-open { overflow: hidden; }
.pj-story { --gutter: 1.25rem; position: fixed; inset: 0; z-index: 20000; display: flex; flex-direction: column; background: rgba(20, 19, 16, .97); color: #fff; touch-action: none; user-select: none; }
/* on wide screens the story is a centred column, not the whole window */
.pj-story > :not(button) { width: 100%; max-width: 76rem; margin-left: auto; margin-right: auto; }
.pj-story > .pj-story-media { width: calc(100% - 2.5rem); max-width: 73.5rem; }
.pj-story[hidden] { display: none; }
.pj-story-bars { display: flex; gap: 4px; padding: 1rem var(--gutter) 0; }
.pj-story-bars span { flex: 1; height: 3px; overflow: hidden; border-radius: 2px; background: rgba(255, 255, 255, .25); }
.pj-story-bars i { display: block; width: 0; height: 100%; background: #fff; }
.pj-story-bars .is-done i { width: 100% !important; transition: none !important; }
.pj-story-head { display: flex; align-items: center; gap: .8rem; padding: .9rem var(--gutter); }
.pj-story-n { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--sand); color: var(--ink); font-size: .8rem; }
.pj-story-head b { font-family: "Playfair Display", serif; font-size: 1.25rem; font-weight: 400; }
.pj-story-head small { color: rgba(255, 255, 255, .55); }
.pj-story-close { position: relative; z-index: 3; margin-left: auto; width: 2.5rem; height: 2.5rem; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; font-size: 1rem; cursor: pointer; }
.pj-story-media { position: relative; flex: 1; min-height: 0; margin: 0 var(--gutter); }
.pj-story-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: pj-in .6s ease both, pj-zoom 6.5s ease-out both; }
.pj-story-media.is-contain { background: #fff; }
.pj-story-media.is-contain img { object-fit: contain; padding: 1.5rem; animation: pj-in .6s ease both; }
@keyframes pj-in { from { opacity: 0; } }
@keyframes pj-zoom { from { transform: scale(1.06); } }
.pj-story-text { padding: 1.25rem var(--gutter) .5rem; }
.pj-story-text p { max-width: 44rem; margin: 0; font-size: 1.15rem; line-height: 1.6; animation: pj-in .8s .15s ease both; }
.pj-story-prev, .pj-story-next { position: absolute; top: 5rem; bottom: 4rem; z-index: 2; width: 35%; border: 0; background: none; cursor: pointer; }
.pj-story-prev { left: 0; cursor: w-resize; }
.pj-story-next { right: 0; cursor: e-resize; }
.pj-story-zones { position: relative; z-index: 3; display: flex; gap: .5rem; padding: .75rem var(--gutter) 1.25rem; overflow-x: auto; scrollbar-width: none; }
.pj-story-zones button { flex: none; padding: .45rem .9rem; border: 1px solid rgba(255, 255, 255, .25); border-radius: 2rem; background: none; color: rgba(255, 255, 255, .7); font-size: .85rem; cursor: pointer; }
.pj-story-zones button.is-on { background: #fff; color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  .pj-pin::before, .pj-story-media img { animation: none; }
}

/* ---------- Tablet ---------- */
@media screen and (max-width: 991px) {
  .pj-zones { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 7.5rem; margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter) .5rem; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); scrollbar-width: none; }
  .pj-zone { scroll-snap-align: start; }
  .pj-plan-text, .pj-plan-map { grid-column: 1 / 13; }
  .pj-plan-map { margin-top: var(--space-l); }
  .pj-dn-head > * { grid-column: 1 / 13; }
  .pj-plant-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pj-stages-frame { height: clamp(18rem, 60vh, 36rem); }
}

/* ---------- Phone ---------- */
@media screen and (max-width: 767px) {
  .pj-zones { grid-auto-columns: 6.25rem; }
  .pj-zones-tip { display: none; }
  .pj-zone-title { font-size: .95rem; }
  .pj-zone-hint { display: none; }
  .pj-legend { columns: 1; }
  .pj-pin { width: 1.8rem; height: 1.8rem; margin: -.9rem 0 0 -.9rem; font-size: .72rem; }
  .pj-tip { width: 11rem; }
  .pj-pin[style*="left:7"] .pj-tip { left: auto; right: -1rem; transform: none; }
  .pj-pin[style*="left:2"] .pj-tip { left: -1rem; transform: none; }
  .pj-dn-frame img:first-child { height: 62vh; object-fit: cover; }
  .pj-dn-l, .pj-dn-r { top: 1rem; }
  .pj-stages-frame { height: 50vh; margin: 0 calc(var(--gutter) * -1); }
  .pj-stages-head h2 { margin-bottom: 1.25rem; }
  /* other projects: a row to swipe instead of three tall cards */
  .pj-page .galleries_list .gallry_list_main { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 78%; margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter); overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); scrollbar-width: none; }
  .pj-page .galleries_list .gallry_list_main > * { scroll-snap-align: start; }
  .pj-page .galleries_list .cover_thumb { height: 15rem; }
  .pj-stages-prev, .pj-stages-next { top: auto; bottom: 1rem; margin: 0; width: 2.75rem; height: 2.75rem; }
  .pj-timeline button { font-size: .78rem; }
  .pj-plant-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-m) .9rem; }
  .pj-plant h3 { font-size: 1.05rem; }
  .pj-plant dl { gap: .15rem .6rem; font-size: .78rem; }
  .pj-latin { font-size: .78rem; }
  .pj-chips { flex-wrap: nowrap; margin-left: calc(var(--gutter) * -1); margin-right: calc(var(--gutter) * -1); padding: 0 var(--gutter); overflow-x: auto; scrollbar-width: none; }
  .pj-chips button { flex: none; }
  .pj-story > .pj-story-media { width: 100%; }
  .pj-story-text p { font-size: 1.05rem; }
}

/* The invitation follows white sections directly: no double gap */
.pj-page .pj-cta { margin-top: 0; }

/* ---------- Home: the latest articles and the invitation (inside .pj-page.pj-home) ---------- */
html:has(.pj-home), body:has(.pj-home) { overflow-x: clip; }
.pj-home { padding: 0 var(--gutter); }
.pj-page .pj-blog { padding: var(--space-xl) 0; }
.pj-blog-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: var(--space-m); }
.pj-blog-head h2 { margin: 0 !important; }
.pj-blog-all { flex: none; color: var(--ink); text-decoration: none; border-bottom: 1px solid currentColor; padding-bottom: .15rem; }
.pj-blog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.pj-post { display: block; color: inherit; text-decoration: none; }
.pj-post-img { position: relative; aspect-ratio: 4 / 3; overflow: hidden; margin-bottom: 1rem; background: var(--sand); }
.pj-post-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s cubic-bezier(.2, .6, .2, 1); }
.pj-post:hover .pj-post-img img { transform: scale(1.05); }
.pj-post-date { color: var(--soft); font-size: .85rem; }
.pj-page .pj-post h3 { margin: .35rem 0 .5rem; color: var(--ink); font-size: clamp(1.25rem, 1.6vw, 1.5rem); line-height: 1.25; }
.pj-page .pj-post p { margin: 0; color: #3b3b34; font-size: .98rem !important; line-height: 1.65 !important; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pj-home .pj-cta { margin-top: 0; }
@media screen and (max-width: 991px) {
  .pj-blog-grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 70%; margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter); overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gutter); scrollbar-width: none; }
  .pj-post { scroll-snap-align: start; }
}
@media screen and (max-width: 767px) {
  .pj-blog-grid { grid-auto-columns: 82%; }
  .pj-blog-head { flex-direction: column; align-items: flex-start; }
}
