/* Casa Tierra — projects pages (/projects and /projects/<slug>), and "Seen in" on product pages.
   Loaded by those views only.
   Colours come from the site theme variables, so the pages follow the theme and dark mode;
   the photo hero and the olive bands keep fixed light type because they sit on photos or deep colour. */

.pjx { --pjx-muted: var(--muted); --pjx-ink: #2A201A; --pjx-cream: #F6F1EA; --pjx-cream-2: #E4D9C9; --pjx-sand-2: #CDBBA6; }
html[data-theme="terra"]:not([data-mode="dark"]) .pjx { --pjx-muted: #75614F; }
:where(.pjx) a { color: inherit; }
html[dir="rtl"] .pjx * { letter-spacing: 0 !important; }
html[dir="rtl"] .pjx-arrow { transform: scaleX(-1); }

/* type */
.pjx-eyebrow { margin: 0; font-size: 12px; font-weight: 400; letter-spacing: .22em; text-transform: uppercase; color: var(--walnut-2); }
.pjx-script { margin: 0; font-family: var(--f-script); font-size: clamp(30px, 3.2vw, 42px); font-weight: 400; line-height: 1.05; letter-spacing: 0; text-transform: none; color: var(--walnut-2); }
html[dir="rtl"] .pjx-script { font-family: "IBM Plex Sans Arabic", var(--f-sans); font-size: clamp(22px, 2.2vw, 30px); font-weight: 300; line-height: 1.4; }
.pjx-display { margin: 0; font-weight: 300; font-size: clamp(40px, 6.4vw, 92px); line-height: 1.02; letter-spacing: .02em; text-transform: uppercase; max-width: 14ch; text-wrap: balance; }
.pjx-h2 { margin: 0; font-weight: 300; font-size: clamp(32px, 4vw, 56px); line-height: 1.05; letter-spacing: .04em; text-transform: uppercase; color: var(--walnut); }
.pjx-h2 a, .pjx-h3 a { text-decoration: none; }
.pjx-h3 { margin: 0; font-weight: 300; font-size: clamp(28px, 3.2vw, 44px); line-height: 1.05; letter-spacing: .04em; text-transform: uppercase; color: var(--walnut); }
.pjx-label { margin: 0; font-size: 11px; font-weight: 400; letter-spacing: .2em; text-transform: uppercase; color: var(--pjx-muted); }
.pjx-meta { margin: 0; font-size: 13px; font-weight: 400; letter-spacing: .12em; text-transform: uppercase; color: var(--pjx-muted); }
.pjx-muted { color: var(--pjx-muted); }
.pjx-text { margin: 0; font-size: 18px; line-height: 1.6; color: var(--text); }
.pjx-link { font-size: 13px; font-weight: 400; letter-spacing: .14em; text-transform: uppercase; text-decoration: underline; text-underline-offset: 5px; }
.pjx-draft { display: inline-block; margin-inline-start: 8px; padding: 2px 9px; border-radius: 999px; background: #A2412B; color: #fff; font-size: 10px; font-weight: 500; letter-spacing: .14em; line-height: 1.6; vertical-align: middle; }
.pjx-preview-note { margin: 0; padding: 10px var(--gutter); background: #A2412B; color: #fff; text-align: center; font-size: 12px; font-weight: 400; letter-spacing: .1em; text-transform: uppercase; }

/* ---------- /projects: hero ---------- */
.pjx-hero { position: relative; display: flex; min-height: 760px; overflow: hidden; background: var(--pjx-ink); color: var(--pjx-cream); }
.pjx-hero-media { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); grid-auto-rows: 100%; gap: 2px; background: var(--pjx-ink); }
.pjx-hero-panel { position: relative; margin: 0; overflow: hidden; background: var(--pjx-ink); }
.pjx-hero-panel img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 58%; }
.pjx-hero-panel::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(0deg, rgba(42, 32, 26, .8) 0%, rgba(42, 32, 26, .6) 30%, rgba(42, 32, 26, .6) 72%, rgba(42, 32, 26, .38) 100%); }
.pjx-hero-panel figcaption { position: absolute; z-index: 2; inset-inline: clamp(16px, 2vw, 28px); bottom: 22px; font-size: 12px; font-weight: 400; letter-spacing: .16em; text-transform: uppercase; }
.pjx-hero-panel figcaption a { color: var(--pjx-cream); text-decoration: none; }
.pjx-hero-panel figcaption a:hover { text-decoration: underline; text-underline-offset: 5px; }
.pjx-hero-copy { position: relative; z-index: 1; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  padding-block: clamp(72px, 8vw, 112px); text-align: center; pointer-events: none; }
.pjx-hero-copy a { pointer-events: auto; }
.pjx-hero .pjx-eyebrow { color: var(--pjx-cream); }
.pjx-hero .pjx-script { color: var(--pjx-cream-2); }
.pjx-hero .pjx-display { color: var(--pjx-cream); }
.pjx-lead { margin: 12px 0 0; max-width: 52ch; font-size: clamp(17px, 1.5vw, 20px); line-height: 1.6; color: var(--pjx-cream); }
.pjx-stats { margin: 8px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 16px 40px; }
.pjx-stats dt { font-size: 11px; font-weight: 400; letter-spacing: .2em; text-transform: uppercase; color: var(--pjx-cream-2); }
.pjx-stats dd { margin: 2px 0 0; font-size: 22px; color: var(--pjx-cream); }

/* ---------- /projects: feature (first project) ---------- */
.pjx-feature { display: flex; flex-wrap: wrap; align-items: center; gap: clamp(28px, 4vw, 72px); padding-block: clamp(56px, 7vw, 110px); }
.pjx-feature-media { flex: 1 1 520px; min-width: 0; display: block; aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; background: var(--clay); }
.pjx-feature-media img, .pjx-card-media img, .pjx-phero-media img, .pjx-gallery img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pjx-feature-copy { flex: 1 1 380px; min-width: 0; max-width: 540px; display: grid; gap: 14px; }
.pjx-feature-copy .pjx-text { margin-top: 4px; }
.pjx-mini { margin-top: 8px; }
.pjx-mini-list { list-style: none; margin: 6px 0 0; padding: 0; border-top: 1px solid var(--line); }
.pjx-mini-list li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pjx-mini-list a { color: var(--text); text-decoration: none; }
.pjx-mini-list a:hover { text-decoration: underline; text-underline-offset: 4px; }
.pjx-mini-list span { color: var(--pjx-muted); white-space: nowrap; }
.pjx-feature-copy .btn { justify-self: start; margin-top: 10px; }

/* ---------- /projects: Madrid band ---------- */
.pjx-band { background: var(--olive); color: var(--pjx-cream); }
.pjx-band-in { display: flex; flex-wrap: wrap; align-items: center; gap: clamp(28px, 4vw, 72px); padding-block: clamp(56px, 7vw, 110px); }
.pjx-band-copy { flex: 1 1 380px; min-width: 0; max-width: 540px; display: grid; gap: 14px; }
.pjx-band .pjx-eyebrow, .pjx-band .pjx-script, .pjx-band .pjx-meta { color: var(--pjx-sand-2); }
.pjx-band .pjx-h2 { color: var(--pjx-cream); }
.pjx-band .pjx-text { margin-top: 4px; color: rgba(246, 241, 234, .92); }
.pjx-band-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; margin-top: 10px; }
.pjx-band .btn-light { background: var(--pjx-cream); color: var(--olive); border-color: var(--pjx-cream); }
.pjx-band .pjx-link { color: var(--pjx-cream); }
.pjx-band-media { flex: 1 1 520px; min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.pjx-band-media img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--radius); }
.pjx-band-media img:nth-child(2) { margin-top: clamp(24px, 4vw, 56px); }

/* ---------- /projects: the rest ---------- */
.pjx-more { padding-block: clamp(56px, 7vw, 110px); }
.pjx-more-hd { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 40px; margin-bottom: clamp(24px, 3vw, 40px); }
.pjx-more-hd > div { display: grid; gap: 10px; }
.pjx-more-hd .pjx-muted { margin: 0; max-width: 46ch; }
.pjx-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr)); gap: clamp(14px, 2vw, 28px); }
.pjx-card { display: grid; gap: 8px; align-content: start; color: inherit; text-decoration: none; }
.pjx-card-media { display: block; aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; background: var(--clay); }
.pjx-card-media img { transition: transform .7s var(--ease); }
.pjx-card:hover .pjx-card-media img { transform: scale(1.03); }
.pjx-card-kicker { margin-top: 6px; font-size: 11px; font-weight: 400; letter-spacing: .2em; text-transform: uppercase; color: var(--walnut-2); }
.pjx-card-name { font-size: clamp(17px, 1.6vw, 22px); font-weight: 400; line-height: 1.25; letter-spacing: .08em; text-transform: uppercase; color: var(--walnut); }
.pjx-card-sub { font-size: 14px; line-height: 1.5; color: var(--pjx-muted); }

/* ---------- closing band ---------- */
.pjx-cta { background: var(--linen); }
.pjx-cta-in { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 40px 72px; padding-block: clamp(48px, 6vw, 88px); }
.pjx-cta-in > div { display: grid; gap: 12px; align-content: start; }
.pjx-cta h2 { margin: 0; font-weight: 300; font-size: clamp(22px, 2.4vw, 30px); line-height: 1.15; letter-spacing: .06em; text-transform: uppercase; color: var(--walnut); }
.pjx-cta p { margin: 0; max-width: 48ch; color: var(--text); }
.pjx-cta .btn { justify-self: start; margin-top: 6px; }

/* ---------- project page ---------- */
.pjx-crumbs { display: flex; flex-wrap: wrap; align-items: center; padding-top: 22px; font-size: 12px; font-weight: 400; letter-spacing: .16em; text-transform: uppercase; color: var(--pjx-muted); }
.pjx-crumbs a { color: var(--pjx-muted); text-underline-offset: 4px; }
.pjx-crumbs .sep { padding: 0 10px; }
.pjx-crumbs [aria-current] { color: var(--walnut); }
.pjx-phero { display: flex; flex-wrap: wrap; align-items: center; gap: clamp(28px, 4vw, 72px); padding-block: clamp(28px, 4vw, 56px) clamp(48px, 6vw, 88px); }
.pjx-phero-copy { flex: 1 1 380px; min-width: 0; max-width: 560px; display: grid; gap: 14px; }
.pjx-phero h1 { margin: 0; font-weight: 300; font-size: clamp(40px, 5.6vw, 84px); line-height: 1.02; letter-spacing: .02em; text-transform: uppercase; color: var(--walnut); text-wrap: balance; }
.pjx-facts { margin: 14px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 28px; padding-top: 18px; border-top: 1px solid var(--line); }
.pjx-facts dt { font-size: 11px; font-weight: 400; letter-spacing: .2em; text-transform: uppercase; color: var(--pjx-muted); }
.pjx-facts dd { margin: 3px 0 0; color: var(--walnut); }
.pjx-phero-media { flex: 1 1 520px; min-width: 0; margin: 0; aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; background: var(--clay); }

.pjx-summary { background: var(--linen); }
.pjx-summary p { box-sizing: border-box; max-width: 980px; margin: 0 auto; padding: clamp(48px, 6vw, 96px) var(--gutter); font-size: clamp(24px, 2.8vw, 38px); font-weight: 300; line-height: 1.35; color: var(--walnut); text-align: center; text-wrap: balance; }

.pjx-story { box-sizing: border-box; max-width: 1280px; margin: 0 auto; padding: clamp(56px, 7vw, 110px) var(--gutter); display: grid; gap: clamp(56px, 7vw, 110px); }
.pjx-row { display: flex; flex-wrap: wrap; align-items: center; gap: clamp(28px, 4vw, 72px); }
.pjx-row.is-flip { flex-direction: row-reverse; }
.pjx-row.is-text { justify-content: center; text-align: center; }
.pjx-row.is-text .pjx-row-copy { max-width: 640px; }
.pjx-row-media { flex: 1 1 440px; min-width: 0; display: block; aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; background: var(--clay); cursor: zoom-in; }
.pjx-row-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.pjx-row-copy { flex: 1 1 340px; min-width: 0; max-width: 480px; display: grid; gap: 12px; }
.pjx-body { margin: 0; font-size: 19px; line-height: 1.65; color: var(--text); }
.pjx-pictured { margin: 6px 0 0; font-size: 13px; font-weight: 400; letter-spacing: .12em; text-transform: uppercase; color: var(--pjx-muted); }
.pjx-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: clamp(14px, 2vw, 28px); }
.pjx-gallery a { display: block; aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden; background: var(--clay); cursor: zoom-in; }

.pjx-shop { border-top: 1px solid var(--line); }
.pjx-shop-in { box-sizing: border-box; max-width: 1280px; margin: 0 auto; padding: clamp(48px, 6vw, 96px) var(--gutter); display: grid; gap: 24px; }
.pjx-shop-hd { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 32px; }
.pjx-shop-hd > div { display: grid; gap: 10px; }
.pjx-shop-hd .pjx-muted { margin: 0; max-width: 40ch; }
.pjx-shop-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-2); }
.pjx-shop-list li { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.pjx-shop-name { flex: 1 1 260px; min-width: 0; font-size: clamp(20px, 2vw, 26px); font-weight: 300; letter-spacing: .04em; text-transform: uppercase; color: var(--walnut); text-decoration: none; }
.pjx-shop-cat { flex: 0 1 220px; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--pjx-muted); }
.pjx-shop-price { flex: 0 0 120px; font-size: 16px; color: var(--text); }
.pjx-shop-go { flex: 0 0 auto; font-size: 12px; font-weight: 400; letter-spacing: .18em; text-transform: uppercase; color: var(--walnut); text-decoration: underline; text-underline-offset: 5px; }

.pjx-next { background: var(--olive); color: var(--pjx-cream); }
.pjx-next-in { box-sizing: border-box; max-width: 1280px; margin: 0 auto; padding: clamp(40px, 5vw, 72px) var(--gutter); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px 48px; }
.pjx-next a { color: var(--pjx-cream); }
.pjx-next-card { display: flex; align-items: center; gap: 20px; text-decoration: none; }
.pjx-next-card > span { display: grid; gap: 4px; text-align: end; }
.pjx-next-kicker { font-size: 11px; font-weight: 400; letter-spacing: .2em; text-transform: uppercase; color: var(--pjx-sand-2); }
.pjx-next-name { font-size: clamp(20px, 2.2vw, 28px); font-weight: 300; letter-spacing: .05em; text-transform: uppercase; }
.pjx-next-card img { display: block; width: 88px; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 8px; }

/* ---------- product page: "Seen in" a project ---------- */
.pjx-seen { padding-block: clamp(56px, 7vw, 104px); border-top: 1px solid var(--line); }
.pjx-seen > .wrap { display: grid; gap: clamp(48px, 6vw, 88px); }
.pjx-seen-item { display: flex; flex-wrap: wrap; align-items: center; gap: clamp(28px, 4vw, 72px); }
.pjx-seen-item.is-flip { flex-direction: row-reverse; }
.pjx-seen-media { flex: 1 1 520px; min-width: 0; display: block; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; background: var(--clay); }
.pjx-seen-media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease, ease); }
.pjx-seen-media:hover img { transform: scale(1.03); }
.pjx-seen-copy { flex: 1 1 340px; min-width: 0; max-width: 500px; display: grid; gap: 12px; justify-items: start; }
.pjx-seen-copy .pjx-text { margin-top: 4px; }
.pjx-seen-copy .pjx-link { margin-top: 8px; color: var(--walnut); }
.pdp-facts a { color: inherit; text-decoration: underline; text-underline-offset: 4px; }
@media (prefers-reduced-motion: reduce) { .pjx-seen-media img { transition: none; } }
