/* ============================================================
   Portfolio CMS — public site
   Built on the shared tokens. --accent is set per-site by the
   business owner, so colour personality comes from their choice;
   the rest stays quiet and gallery-forward.
   ============================================================ */

:root {
  --accent: #A6701F; --maxw: 1280px;
}

/* ── Per-template shape system ──────────────────────────────────────
   Every border-radius in the site uses these four tokens.
   Changing the template body class rewires the entire design language. */
body.tpl-bento  { --r-sm: 8px;  --r-md: 14px; --r-lg: 20px; --r-pill: 999px; }
body.tpl-gallery { --r-sm: 0;   --r-md: 0;    --r-lg: 0;    --r-pill: 0;     }
body.tpl-studio  { --r-sm: 6px;  --r-md: 10px; --r-lg: 16px; --r-pill: 999px; }
body.tpl-classic { --r-sm: 3px;  --r-md: 4px;  --r-lg: 6px;  --r-pill: 4px;   }
/* Manual rounded/square override still works */
body.is-square   { --r-sm: 0;    --r-md: 0;    --r-lg: 0;    --r-pill: 0;     }
body.is-rounded  { --r-pill: 999px; }

body { background: var(--paper); color: var(--ink); }
img { display: block; max-width: 100%; }

/* ---------- header ---------- */
.site-header {
  position: relative; top: 0; z-index: 40;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: var(--maxw); margin: 0 auto;
  padding: 14px clamp(20px, 5vw, 56px);
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
.brand { text-decoration: none; color: var(--ink); display: flex; align-items: center; }
.brand-name { font-family: var(--font-display); font-weight: 500; font-size: 21px; letter-spacing: -0.01em; }
.brand-logo { max-height: 38px; width: auto; }
.site-nav { display: flex; align-items: center; gap: clamp(12px, 2vw, 26px); }
.nav-link {
  text-decoration: none; color: var(--muted); font-size: 14px; font-weight: 500;
  padding: 4px 0; border-bottom: 1.5px solid transparent; transition: color .15s, border-color .15s; white-space: nowrap;
}
.nav-link:hover { color: var(--ink); }
.nav-link.active { color: var(--ink); border-color: var(--accent); }
.nav-search input {
  font-family: var(--font-ui); font-size: 13.5px; width: 120px;
  padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-pill);
  background: var(--paper-card); color: var(--ink); transition: width .2s, border-color .15s;
}
.nav-search input:focus { outline: none; width: 170px; border-color: var(--ink); }
@media (max-width: 640px) {
  .nav-search input { width: 100%; }
}

/* ---------- layout containers ---------- */
main { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(20px, 5vw, 56px); }

/* ---------- hero ---------- */
.hero { padding: 40px 0 18px; max-width: 64ch; }
.hero-tagline {
  font-size: 12.5px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 18px; font-weight: 600;
}
.hero-heading {
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(38px, 6.5vw, 76px); line-height: 1.0; letter-spacing: -0.02em; margin: 0;
}
.hero-text { margin-top: 22px; color: var(--ink-soft); font-size: clamp(15px, 1.5vw, 18px); line-height: 1.6; }
.hero-text p { margin: 0 0 0.7em; }

.collection-head { padding: clamp(40px, 6vw, 72px) 0 18px; }
.collection-title { font-family: var(--font-display); font-weight: 400; font-size: clamp(30px, 5vw, 52px); letter-spacing: -0.015em; margin: 0; }
.collection-count { color: var(--muted); font-size: 14px; margin: 8px 0 0; }

/* ---------- filter bar ---------- */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 6px 0 28px; border-bottom: 1px solid var(--line); margin-bottom: 32px;
}
.chips {
  display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0;
  flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity;
  scrollbar-width: none; -ms-overflow-style: none; -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; scroll-snap-align: start;
  text-decoration: none; font-size: 13.5px; font-weight: 500; color: var(--ink-soft);
  padding: 7px 15px; border: 1px solid var(--line-strong); border-radius: var(--r-pill);
  background: var(--paper-card); transition: all .15s; white-space: nowrap;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- project grid (masonry via columns) ---------- */
.work { padding-bottom: clamp(64px, 9vw, 120px); }
.pf-grid { columns: 3 300px; column-gap: clamp(16px, 2vw, 26px); }
@media (max-width: 720px) { .pf-grid { columns: 2 160px; column-gap: 14px; } }
@media (max-width: 440px) { .pf-grid { columns: 1; } }

.pf-card {
  display: block; break-inside: avoid; margin-bottom: clamp(16px, 2vw, 26px);
  text-decoration: none; color: inherit;
}
.card-media {
  position: relative; overflow: hidden; border-radius: var(--r-md);
  background: var(--paper-sunk); aspect-ratio: var(--ar, 3/2);
  box-shadow: var(--shadow-1);
}
.card-cover-bg {
  width: 100%; height: 100%; background-size: cover; background-position: center;
  transition: transform .55s cubic-bezier(.2,.7,.2,1), filter .3s; position: absolute; inset: 0;
}
.card-media::after {
  content: ""; position: absolute; inset: 0; border-radius: var(--r-md);
  box-shadow: inset 0 0 0 1px rgba(23,22,27,.06); pointer-events: none;
}
.pf-card:hover .card-cover-bg { transform: scale(1.045); }
.card-media-empty { background:
  repeating-linear-gradient(45deg, var(--paper-sunk), var(--paper-sunk) 10px, var(--paper) 10px, var(--paper) 20px); }

.card-body { padding: 13px 2px 4px; }
.card-cat {
  display: inline-block; font-size: var(--cat-tag-size, 11.5px); letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--cat-tag-color, var(--accent)); font-weight: 600; margin-bottom: 6px;
}
.card-cats { display: flex; flex-wrap: wrap; align-items: baseline; row-gap: 1px; margin-bottom: 7px; }
.card-cats .card-cat { margin-bottom: 0; white-space: nowrap; letter-spacing: 0.06em; }
.card-cats .card-cat:not(:last-child)::after { content: "·"; margin: 0 7px; color: var(--muted); font-weight: 400; }
.card-cats .card-cat-more { color: var(--cat-tag-color, var(--accent)); letter-spacing: 0; }

/* Category tag styling variants (driven by Appearance settings) */
.cattag-nocaps .card-cat { text-transform: none; letter-spacing: 0.02em; }
/* Pill: filled rounded badge */
.cattag-pill .card-cats { gap: 6px; align-items: center; row-gap: 6px; }
.cattag-pill .card-cat {
  padding: 3px 9px; border-radius: var(--r-pill); line-height: 1.4;
  background: var(--cat-tag-color, var(--accent));
  color: #fff; font-weight: 600;
}
.cattag-pill .card-cats .card-cat:not(:last-child)::after { content: none; margin: 0; }
.cattag-pill .card-cat-more { background: var(--cat-tag-color, var(--accent)); color: #fff; }
/* Outline: bordered badge */
.cattag-outline .card-cats { gap: 6px; align-items: center; row-gap: 6px; }
.cattag-outline .card-cat {
  padding: 2px 8px; border-radius: var(--r-sm); line-height: 1.4;
  border: 1px solid color-mix(in srgb, var(--cat-tag-color, var(--accent)) 45%, transparent);
  color: var(--cat-tag-color, var(--accent));
}
.is-square .cattag-pill .card-cat { border-radius: var(--r-sm); }
.cattag-outline .card-cats .card-cat:not(:last-child)::after { content: none; margin: 0; }
.cattag-outline .card-cat-more { border-color: color-mix(in srgb, var(--cat-tag-color, var(--accent)) 45%, transparent); color: var(--cat-tag-color, var(--accent)); }
.card-title { font-family: var(--font-display); font-weight: 500; font-size: 19px; line-height: 1.2; margin: 0; letter-spacing: -0.01em; }
.pf-card:hover .card-title { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.card-summary { margin: 6px 0 0; color: var(--muted); font-size: 13.5px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.empty-note { color: var(--muted); padding: 40px 0 80px; font-size: 15px; }

/* ---------- project detail ---------- */
.project { padding: clamp(28px, 4vw, 48px) 0 clamp(64px, 9vw, 110px); }
.project-head { max-width: 70ch; margin-bottom: clamp(26px, 4vw, 44px); }
.back-link { display: inline-block; color: var(--muted); text-decoration: none; font-size: 13.5px; margin-bottom: 22px; }
.back-link:hover { color: var(--ink); }
.project-meta { margin-bottom: 12px; }
.proj-cat {
  font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600;
  color: var(--accent); text-decoration: none;
}
.proj-cat:hover { text-decoration: underline; text-underline-offset: 3px; }
.project-title { font-family: var(--font-display); font-weight: 400; font-size: clamp(32px, 5.5vw, 64px); line-height: 1.02; letter-spacing: -0.02em; margin: 0; }
.project-summary { font-size: clamp(16px, 1.6vw, 20px); color: var(--ink-soft); line-height: 1.5; margin: 18px 0 0; }
.project-desc { max-width: 68ch; margin: 0 0 clamp(30px, 5vw, 52px); color: var(--ink-soft); font-size: 16px; line-height: 1.7; }
.project-desc p { margin: 0 0 1em; }

/* gallery — masonry */
.pf-masonry { columns: 2 420px; column-gap: clamp(14px, 1.6vw, 22px); }
.pf-masonry.pf-cols-set { display: grid; grid-template-columns: repeat(var(--pf-cols, 3), 1fr); gap: clamp(14px, 1.6vw, 22px); align-items: start; }
.pf-masonry.pf-cols-set .pf-item { margin-bottom: 0; }
@media (max-width: 880px) { .pf-masonry.pf-cols-set { grid-template-columns: repeat(var(--pf-cols-t, 2), 1fr); } }
@media (max-width: 560px) { .pf-masonry.pf-cols-set { grid-template-columns: repeat(var(--pf-cols-m, 1), 1fr); } }
/* True masonry flow (JS): distribute items into shortest column, no row gaps. */
.pf-masonry.pf-cols-set.pf-mjs { display: flex; align-items: flex-start; gap: clamp(14px, 1.6vw, 22px); grid-template-columns: none; }
.pf-mjs .pf-mcol { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: clamp(14px, 1.6vw, 22px); }
.pf-mjs .pf-mcol > .pf-item { margin: 0; }
@media (max-width: 560px) { .pf-masonry { columns: 1; } }
.pf-item { break-inside: avoid; margin-bottom: clamp(14px, 1.6vw, 22px); border-radius: var(--r-md); overflow: hidden; }
.pf-image { display: block; cursor: zoom-in; background: var(--paper-sunk); position: relative; aspect-ratio: var(--ar, 3/2); overflow: hidden; }
.pf-bg { width: 100%; height: 100%; position: absolute; inset: 0; background-size: cover; background-position: center; transition: transform .5s; }
.pf-image:hover .pf-bg { transform: scale(1.02); }
.pf-video video { width: 100%; height: auto; display: block; background: #000; border-radius: var(--r-md); }
.pf-cap { font-size: 13px; color: var(--muted); margin: 8px 2px 0; }
.embed-frame { position: relative; padding-top: 56.25%; background: #000; border-radius: var(--r-md); overflow: hidden; }
.embed-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.pf-extra { margin-top: clamp(14px, 2vw, 22px); }

/* gallery — carousel */
.pf-carousel { position: relative; background: var(--paper-sunk); border-radius: var(--r-lg); overflow: hidden; }
.car-track { display: flex; transition: transform .45s cubic-bezier(.2,.7,.2,1); }
.car-slide { min-width: 100%; display: flex; align-items: center; justify-content: center; }
.car-slide .pf-item { margin: 0; width: 100%; border-radius: 0; }
.car-slide img { width: 100%; max-height: 78vh; object-fit: contain; background: #111; }
.car-slide .pf-image { cursor: default; }
.car-slide video { max-height: 78vh; }
.car-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 46px; height: 46px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,.85); color: var(--ink); font-size: 26px; line-height: 1;
  display: grid; place-items: center; box-shadow: var(--shadow-2); transition: background .15s;
}
.car-btn:hover { background: #fff; }
.car-prev { left: 14px; } .car-next { right: 14px; }
.car-dots { position: absolute; bottom: 14px; left: 0; right: 0; display: flex; justify-content: center; gap: 7px; }
.car-dots button { width: 8px; height: 8px; border-radius: 50%; border: none; background: rgba(255,255,255,.55); cursor: pointer; padding: 0; }
.car-dots button.active { background: #fff; width: 22px; border-radius: var(--r-sm); }

/* gallery — before / after */
.pf-ba-wrap { display: flex; flex-direction: column; gap: clamp(20px, 3vw, 36px); }
.pf-ba { position: relative; aspect-ratio: var(--ar, 3/2); border-radius: var(--r-md); overflow: hidden; user-select: none; background: #000; container-type: inline-size; }
.pf-ba img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ba-after { background-size: cover; background-position: center; }
.ba-before { position: absolute; inset: 0; width: 50%; overflow: hidden; border-right: 2px solid #fff; }
.ba-before-bg { width: 100cqw; max-width: none; height: 100%; background-size: cover; background-position: left center; position: absolute; inset: 0; }
.pf-ba .ba-range {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; z-index: 3;
}
.ba-handle {
  position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: #fff; transform: translateX(-1px); z-index: 2; pointer-events: none;
}
.ba-handle::after {
  content: "⟷"; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: 38px; height: 38px; border-radius: 50%; background: #fff; color: var(--ink);
  display: grid; place-items: center; font-size: 15px; box-shadow: var(--shadow-2);
}
.ba-tag { position: absolute; bottom: 12px; z-index: 2; font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  background: rgba(0,0,0,.55); color: #fff; padding: 4px 9px; border-radius: var(--r-pill); pointer-events: none; }
.ba-tag-before { left: 12px; } .ba-tag-after { right: 12px; }
.pf-ba-single { border-radius: var(--r-md); overflow: hidden; }

/* tags */
.project-tags { margin-top: clamp(28px, 4vw, 44px); display: flex; flex-wrap: wrap; gap: 8px; }
.tag { text-decoration: none; font-size: 13px; color: var(--ink-soft); background: var(--paper-sunk);
  padding: 6px 13px; border-radius: var(--r-pill); transition: background .15s, color .15s; }
.tag:hover { background: var(--accent); color: #fff; }

/* ---------- lightbox ---------- */
.lb { position: fixed; inset: 0; z-index: 100; background: rgba(18,17,16,.96);
  display: flex; align-items: center; justify-content: center; opacity: 0; animation: lbin .2s forwards; }
@keyframes lbin { to { opacity: 1; } }
.lb.closing { animation: lbout .18s forwards; } @keyframes lbout { to { opacity: 0; } }
.lb .lb-main { width: 92vw; height: 88vh; max-width: 1400px; background-size: contain; background-repeat: no-repeat; background-position: center; border-radius: 2px; box-shadow: 0 30px 80px rgba(0,0,0,.5); transition: opacity .25s ease; }
.lb.lb-loading .lb-main { opacity: .35; }
.lb-btn { position: absolute; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); color: #fff;
  width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; font-size: 22px; }
.lb-btn:hover { background: rgba(255,255,255,.16); }
.lb-close { top: 20px; right: 20px; }
.lb-prev { left: 18px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 18px; top: 50%; transform: translateY(-50%); }
.lb-cap { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; color: rgba(255,255,255,.8); font-size: 13px; }
.lb.has-thumbs .lb-cap { bottom: 98px; }
.lb-thumbs { position: absolute; bottom: 16px; left: 0; right: 0; display: flex; gap: 8px; justify-content: center; padding: 0 16px; overflow-x: auto; scrollbar-width: none; }
.lb-thumbs::-webkit-scrollbar { display: none; }
.lb-thumb { flex: 0 0 auto; width: 66px; height: 46px; padding: 0; border: 2px solid transparent; border-radius: 5px; overflow: hidden; cursor: pointer; opacity: .45; background: #1c1b1a; transition: opacity .15s ease, border-color .15s ease; position: relative; }
.lb-thumb-bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.lb-thumb:hover { opacity: .8; }
.lb-thumb.active { opacity: 1; border-color: #fff; }

/* Smooth fade-in for lazily loaded images (class added by JS only) */
.pf-fade { opacity: 0; }
.pf-fade.pf-in { opacity: 1; transition: opacity .5s ease, transform .5s ease; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: clamp(34px, 5vw, 56px) clamp(20px, 5vw, 56px);
  display: flex; flex-direction: column; gap: 10px; }
.foot-brand { font-family: var(--font-display); font-size: 18px; }
.foot-contact, .foot-social { color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.foot-contact a, .foot-social a { color: var(--ink-soft); text-decoration: none; }
.foot-contact a:hover, .foot-social a:hover { color: var(--accent); }
.foot-contact .dot { color: var(--muted-2); }
.foot-social { gap: 16px; }
.foot-note { color: var(--muted-2); font-size: 12.5px; margin-top: 6px; }

/* ---------- not found ---------- */
.state-page { text-align: center; padding: clamp(80px, 14vw, 160px) 0; }
.state-page h1 { font-family: var(--font-display); font-weight: 500; font-size: 32px; margin: 0 0 10px; }
.state-page p { color: var(--muted); margin: 0 0 24px; }
.btn-link { display: inline-block; background: var(--ink); color: #fff; text-decoration: none; padding: 11px 20px; border-radius: var(--r-md); font-weight: 600; font-size: 14px; }

/* ============================================================
   Theme: contrast-safe tweaks + visual templates + dark schemes
   ============================================================ */

/* text that sits on the --ink colour must use --paper to stay legible
   in both light and dark colour schemes */
.chip.active { color: var(--paper); }
.btn-link { color: var(--paper); }

/* ---------- Template: Studio (clean, gridded, centered) ---------- */
.tpl-studio .header-inner { flex-direction: column; gap: 12px; text-align: center; }
.tpl-studio .site-nav { justify-content: center; flex-wrap: wrap; }
.tpl-studio .hero { max-width: none; text-align: center; padding-top: clamp(40px, 6vw, 84px); }
.tpl-studio .hero-text { margin-left: auto; margin-right: auto; max-width: 60ch; }
.tpl-studio .filter-bar { justify-content: center; }
.tpl-studio .collection-head { text-align: center; }
.tpl-studio .pf-grid {
  columns: auto; column-gap: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: clamp(14px, 2vw, 24px);
}
.tpl-studio .pf-card { margin-bottom: 0; break-inside: auto; }
.tpl-studio .card-media { aspect-ratio: 4 / 3; }
.tpl-studio .card-body { text-align: center; }
.tpl-studio .card-summary { display: none; }
.tpl-studio .card-cat { letter-spacing: 0.16em; }

/* ---------- Template: Classic (formal, bordered, serif) ---------- */
.tpl-classic .header-inner { flex-direction: column; gap: 10px; text-align: center; }
.tpl-classic .site-header { border-bottom: 1px solid var(--line-strong); }
.tpl-classic .brand-name { font-size: 26px; letter-spacing: 0; }
.tpl-classic .site-nav { justify-content: center; flex-wrap: wrap; }
.tpl-classic .hero { text-align: center; max-width: none; }
.tpl-classic .hero-heading { font-style: italic; }
.tpl-classic .filter-bar { justify-content: center; }
.tpl-classic .card-media { border-radius: 0; box-shadow: none; border: 1px solid var(--line-strong); }
.tpl-classic .card-media::after { display: none; }
.tpl-classic .card-body { text-align: center; }
.tpl-classic .card-title { font-style: italic; }
.tpl-classic .project-head { text-align: center; margin-left: auto; margin-right: auto; }
.tpl-classic .project-summary { margin-left: auto; margin-right: auto; }
.tpl-classic .project-title { font-style: italic; }
.tpl-classic .project-desc { margin-left: auto; margin-right: auto; }

/* ---------- Dark colour schemes ---------- */
.is-dark .card-media::after { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06); }
.is-dark .nav-search input { background: var(--paper-sunk); color: var(--ink); }
.is-dark .chip { background: var(--paper-sunk); }
.is-dark .car-btn { background: rgba(255,255,255,0.9); }

/* ============ v2 additions ============ */

/* Corner style + text size */
/* shape handled by body.tpl-* and body.is-square tokens above */
body.fs-compact { font-size: 15px; }
body.fs-large { font-size: 17px; }

/* Header variants */
.hdr-sticky .site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: saturate(1.3) blur(8px); }
.hdr-center .header-inner { flex-direction: column; gap: 12px; text-align: center; align-items: center; }
.hdr-center .site-nav { justify-content: center; flex-wrap: wrap; }
/* hdr-left is authoritative — it overrides a template's default centering */
.hdr-left .header-inner { flex-direction: row; align-items: center; justify-content: space-between; text-align: left; gap: 24px; }
.hdr-left .site-nav { justify-content: flex-end; flex-wrap: nowrap; }

/* Announcement bar */
.announce { display: block; text-align: center; padding: 9px 16px; font-size: 13.5px; letter-spacing: .01em;
  background: var(--accent); color: #fff; text-decoration: none; }
a.announce:hover { filter: brightness(1.06); }

/* Header CTA + mobile nav toggle */
.nav-cta { display: inline-flex; align-items: center; padding: 8px 16px; border-radius: var(--r-md);
  background: var(--accent); color: #fff; font-weight: 600; font-size: 14px; text-decoration: none; }
.nav-cta:hover { filter: brightness(1.06); }
.nav-toggle { display: none; flex-direction: column; gap: 4px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 22px; height: 2px; background: var(--ink); display: block; transition: .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Filter bar: sort + tags */
.filter-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.sort-form { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.sort-form select { font: inherit; padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--paper-card); color: var(--ink); }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; }
.tag-chip { font-size: 12.5px; color: var(--muted); text-decoration: none; padding: 3px 9px; border: 1px solid var(--line); border-radius: var(--r-pill); }
.tag-chip:hover { color: var(--ink); border-color: var(--line-strong); }

/* Footer extras */
.foot-contact { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--muted); font-size: 14px; }
.foot-contact a { color: var(--ink-soft); text-decoration: none; }
.foot-contact a:hover { color: var(--accent); }
.foot-contact .dot { color: var(--muted-2); }
.foot-hours { color: var(--muted); font-size: 13.5px; margin-top: 6px; line-height: 1.6; }
.foot-note { color: var(--muted); font-size: 13px; margin-top: 8px; }
.foot-social { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.foot-social .soc { font-size: 12.5px; color: var(--ink-soft); text-decoration: none; padding: 5px 11px;
  border: 1px solid var(--line); border-radius: var(--r-pill); }
.foot-social .soc:hover { border-color: var(--accent); color: var(--accent); }
.map-embed { margin-top: 18px; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); }
.map-embed iframe { width: 100%; min-height: 240px; border: 0; display: block; }

/* Static pages */
.page { max-width: 760px; margin: 0 auto; padding: 48px 24px 72px; }
.page.tpl-page-wide { max-width: 1080px; }
.page-head { margin-bottom: 28px; }
.page-title { font-family: var(--font-display); font-size: clamp(30px, 4.4vw, 46px); line-height: 1.08; }
.page-content { font-size: 17px; line-height: 1.75; color: var(--ink-soft); }
.page-content h2 { font-family: var(--font-display); font-size: 1.5em; margin: 1.4em 0 .5em; color: var(--ink); }
.page-content h3 { font-family: var(--font-display); font-size: 1.2em; margin: 1.2em 0 .4em; color: var(--ink); }
.page-content p { margin: 0 0 1.1em; }
.page-content a { color: var(--accent); }
.page-content ul, .page-content ol { margin: 0 0 1.1em 1.3em; }
.page-content li { margin: .3em 0; }
.page-content img { max-width: 100%; height: auto; border-radius: var(--r-md); margin: 1em 0; }
.page-content blockquote { margin: 1.2em 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--accent); color: var(--muted); font-style: italic; }

/* Rich-text elements emitted by the WYSIWYG editor (pages + project descriptions) */
.page-content h1, .project-desc h1 { font-family: var(--font-display); font-size: 1.8em; line-height: 1.12; margin: 1.2em 0 .45em; color: var(--ink); }
.page-content h4, .project-desc h4 { font-family: var(--font-display); font-size: 1.05em; margin: 1.1em 0 .35em; color: var(--ink); }
.page-content pre, .project-desc pre { background: color-mix(in srgb, var(--ink) 5%, transparent); border: 1px solid color-mix(in srgb, var(--ink) 12%, transparent); border-radius: var(--r-sm, 6px); padding: 14px 16px; overflow-x: auto; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; line-height: 1.55; margin: 1.1em 0; }
.page-content code, .project-desc code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; background: color-mix(in srgb, var(--ink) 6%, transparent); padding: .1em .35em; border-radius: var(--r-sm); }
.page-content pre code, .project-desc pre code { background: none; padding: 0; }
.page-content mark, .project-desc mark { padding: 0 .15em; }
.page-content hr, .project-desc hr { border: 0; border-top: 1px solid color-mix(in srgb, var(--ink) 18%, transparent); margin: 1.8em 0; }
.page-content sub, .page-content sup, .project-desc sub, .project-desc sup { font-size: .72em; }
.project-desc h1, .project-desc h2, .project-desc h3 { font-family: var(--font-display); color: var(--ink); line-height: 1.18; margin: 1.1em 0 .4em; }
.project-desc h2 { font-size: 1.45em; } .project-desc h3 { font-size: 1.18em; }
.project-desc ul, .project-desc ol { margin: 0 0 1em 1.3em; } .project-desc li { margin: .3em 0; }
.project-desc img { max-width: 100%; height: auto; border-radius: var(--r-md); margin: 1em 0; }
.project-desc blockquote { margin: 1.2em 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--accent); color: var(--muted); font-style: italic; }
.project-desc a { color: var(--accent); }
.page-content table, .project-desc table { border-collapse: collapse; width: 100%; margin: 1.2em 0; font-size: .96em; }
.page-content th, .page-content td, .project-desc th, .project-desc td { border: 1px solid color-mix(in srgb, var(--ink) 16%, transparent); padding: 8px 11px; text-align: left; }
.page-content thead th, .project-desc thead th { background: color-mix(in srgb, var(--ink) 5%, transparent); }

/* ---- Page block builder (grid layout) ---- */
.page.has-blocks { max-width: 1180px; padding-left: 28px; padding-right: 28px; }
.pb-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(16px, 2.4vw, 30px); align-items: start; }
.pb-block { min-width: 0; border-radius: var(--r-md, 10px); }
.pb-block > :first-child { margin-top: 0; }
.pb-block > :last-child { margin-bottom: 0; }
.pb-pad-none { padding: 0; }
.pb-pad-s { padding: 14px; }
.pb-pad-m { padding: 22px; }
.pb-pad-l { padding: 40px; }
.pb-pad-s:not([style*="background"]), .pb-pad-m:not([style*="background"]), .pb-pad-l:not([style*="background"]) { padding-left: 0; padding-right: 0; }
.pb-block[style*="background"] { padding-left: max(14px, var(--pb-px, 22px)); padding-right: max(14px, var(--pb-px, 22px)); }
.pb-align-center { text-align: center; }
.pb-align-right { text-align: right; }
.pb-rich { font-size: 17px; line-height: 1.75; color: var(--ink-soft); }
.pb-rich > :first-child { margin-top: 0; }
.pb-rich h1, .pb-rich h2, .pb-rich h3, .pb-rich h4 { font-family: var(--font-display); color: var(--ink); line-height: 1.15; margin: 1.1em 0 .4em; }
.pb-rich p { margin: 0 0 1.05em; }
.pb-rich a { color: var(--accent); }
.pb-rich ul, .pb-rich ol { margin: 0 0 1.05em 1.3em; }
.pb-rich img { max-width: 100%; height: auto; border-radius: var(--r-md); }
.pb-heading { font-family: var(--font-display); color: var(--ink); line-height: 1.12; font-size: clamp(24px, 3.4vw, 38px); margin: 0; }
.pb-figure { margin: 0; }
.pb-figure img, .pb-gitem img { display: block; width: 100%; height: auto; border-radius: var(--r-md, 10px); }
.pb-cap { margin-top: 8px; font-size: 14px; color: var(--muted); }
.pb-align-center .pb-figure { display: inline-block; }
.pb-gallery { display: grid; grid-template-columns: repeat(var(--pb-gcols, 3), 1fr); gap: 12px; }
.pb-gitem { margin: 0; }
.pb-btnwrap { display: flex; }
.pb-align-center .pb-btnwrap { justify-content: center; }
.pb-align-right .pb-btnwrap { justify-content: flex-end; }
.pb-btn { display: inline-block; padding: 12px 26px; border-radius: var(--r-pill); font-weight: 600; font-size: 15px; text-decoration: none; line-height: 1.2; transition: filter .15s, background .15s, color .15s; }
.pb-btn-solid { background: var(--accent); color: #fff; border: 1px solid var(--accent); }
.pb-btn-solid:hover { filter: brightness(.93); }
.pb-btn-outline { background: transparent; color: var(--accent); border: 1px solid currentColor; }
.pb-btn-outline:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.pb-divider { border: 0; border-top: 1px solid color-mix(in srgb, var(--ink) 18%, transparent); margin: 0; }
.pb-embed { position: relative; }
.pb-embed iframe, .pb-embed video { max-width: 100%; border: 0; border-radius: var(--r-md, 10px); }
@media (max-width: 860px) {
  .pb-grid { gap: 20px; }
  .pb-block { grid-column: 1 / -1 !important; }
  .pb-gallery { grid-template-columns: repeat(min(var(--pb-gcols, 3), 3), 1fr); }
}
@media (max-width: 520px) {
  .page.has-blocks { padding-left: 18px; padding-right: 18px; }
  .pb-gallery { grid-template-columns: repeat(2, 1fr); }
  .pb-pad-l { padding: 24px; }
}

/* Contact block + form */
.contact-info { margin: 28px 0; border-top: 1px solid var(--line); padding-top: 20px; }
.ci-row { display: flex; gap: 16px; padding: 7px 0; font-size: 15px; }
.ci-row .ci-k { width: 90px; color: var(--muted); flex: none; }
.ci-row a { color: var(--ink); text-decoration: none; }
.contact-form { margin-top: 28px; display: grid; gap: 14px; }
.contact-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.contact-form label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.contact-form .cf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.contact-form .input, .contact-form .textarea { font: inherit; padding: 11px 13px; border: 1px solid var(--line);
  border-radius: var(--r-md); background: var(--paper-card); color: var(--ink); width: 100%; }
.btn-send { justify-self: start; padding: 11px 22px; border: 0; border-radius: var(--r-md); background: var(--accent);
  color: #fff; font-weight: 600; cursor: pointer; }
.form-note { padding: 11px 14px; border-radius: var(--r-md); font-size: 14px; }
.form-note.ok { background: color-mix(in srgb, var(--good) 16%, var(--paper)); color: var(--good); }
.form-note.err { background: var(--danger-soft); color: var(--danger); }
.state-page { max-width: 560px; margin: 0 auto; padding: 80px 24px; text-align: center; }
.state-page h1 { font-family: var(--font-display); font-size: 32px; margin-bottom: 10px; }
.btn-link { display: inline-block; margin-top: 16px; color: var(--accent); text-decoration: none; font-weight: 600; }

/* Cookie banner */
.cookie-banner { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 200; max-width: 720px; margin: 0 auto;
  background: var(--paper-card); border: 1px solid var(--line-strong); border-radius: var(--r-lg);
  box-shadow: var(--shadow-pop); padding: 18px 20px; display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.cookie-banner .cookie-msg { flex: 1 1 260px; font-size: 13.5px; color: var(--ink-soft); line-height: 1.55; }
.cookie-banner .cookie-msg a { color: var(--accent); }
.cookie-actions { display: flex; gap: 10px; flex: none; }
.cookie-actions button { font: inherit; font-size: 14px; font-weight: 600; padding: 9px 18px; border-radius: var(--r-md); cursor: pointer; border: 1px solid var(--line-strong); }
.ck-accept { background: var(--accent); color: #fff; border-color: var(--accent); }
.ck-decline { background: transparent; color: var(--ink-soft); }
.ck-accept:hover { filter: brightness(1.06); }
.ck-decline:hover { background: var(--paper-sunk); }

.cookie-block { position: fixed; inset: 0; z-index: 300; background: color-mix(in srgb, var(--paper) 92%, #000 8%);
  backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 24px; }
.cookie-block .cb-card { max-width: 440px; text-align: center; background: var(--paper-card); border: 1px solid var(--line-strong);
  border-radius: var(--r-lg); padding: 36px 30px; box-shadow: var(--shadow-pop); }
.cb-title { font-family: var(--font-display); font-size: 24px; margin-bottom: 10px; }
.cb-text { color: var(--muted); font-size: 14.5px; line-height: 1.6; margin-bottom: 22px; }
.cb-review { font: inherit; font-weight: 600; padding: 11px 22px; border-radius: var(--r-md); background: var(--accent); color: #fff; border: 0; cursor: pointer; }

/* ---- Template: Gallery ---- */
.tpl-gallery .pf-grid { gap: 6px; }
.tpl-gallery .card-media { border-radius: 0; box-shadow: none; }
.tpl-gallery .hero { text-align: center; }
/* Overlay the title + category tags on the image (summary stays hidden) */
.tpl-gallery .pf-card { position: relative; overflow: hidden; }
.tpl-gallery .card-body {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  justify-content: flex-end; padding: 14px 14px 12px;
  background: linear-gradient(to top, rgba(0,0,0,.72), rgba(0,0,0,.08) 52%, transparent);
  color: #fff; opacity: 1;
}
.tpl-gallery .card-title { color: #fff; }
.tpl-gallery .card-cat { color: #fff; }
.tpl-gallery .card-summary { display: none; }

/* ============================================================
   Bento Box — true masonry via MEASURED heights + absolute
   positioning. The JS (site.js) renders every tile, reads its
   REAL rendered height, runs a shortest-column packer (wide
   tiles span 2 columns), then absolutely positions each tile.
   Because positions are derived from measured heights, tiles
   butt together exactly and interior gaps are impossible. A
   CSS-columns fallback keeps it readable before/without JS.
   ============================================================ */
.tpl-bento .hero { max-width: none; }

/* Before JS runs (and as a no-JS fallback): simple CSS columns mosaic. */
.tpl-bento .pf-grid:not(.bento-abs) { column-count: 3; column-gap: 16px; }
.tpl-bento .pf-grid:not(.bento-abs) > .pf-card { break-inside: avoid; margin: 0 0 16px; width: 100%; display: inline-block; }
.tpl-bento .pf-grid:not(.bento-abs) > .pf-filler { display: none; }
@media (max-width: 900px) { .tpl-bento .pf-grid:not(.bento-abs) { column-count: 2; } }
@media (max-width: 560px) { .tpl-bento .pf-grid:not(.bento-abs) { column-count: 1; } }

/* Absolute-positioned mode (JS active). Container is relative; JS sets its
   height. Each tile is absolutely placed with an explicit width + translate. */
.tpl-bento .pf-grid.bento-abs { position: relative; display: block; }
.tpl-bento .pf-grid.bento-abs > .pf-card {
  position: absolute; top: 0; left: 0; margin: 0;
  overflow: hidden; border-radius: var(--r-lg, 18px);
  will-change: transform;
}
.tpl-bento .pf-card { position: relative; overflow: hidden; border-radius: var(--r-lg, 18px); }
.tpl-bento .pf-card .card-media { height: 100%; width: 100%; aspect-ratio: auto; }
.tpl-bento .pf-card .card-cover-bg { width: 100%; height: 100%; background-size: cover; background-position: center; position: absolute; inset: 0; }
/* Overlay title/cats on the image */
.tpl-bento .pf-grid.bento-abs > .pf-card .card-body {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  justify-content: flex-end; padding: 18px;
  background: linear-gradient(to top, rgba(0,0,0,.78), rgba(0,0,0,.12) 55%, transparent);
  color: #fff;
}
.tpl-bento .pf-grid.bento-abs > .pf-card .card-title { color: #fff; }
.tpl-bento .pf-grid.bento-abs > .pf-card .card-summary { color: rgba(255,255,255,.85); }
.tpl-bento .pf-grid.bento-abs > .pf-card .card-cat { color: #fff; }
.tpl-bento .pf-card.is-featured { outline: 2px solid var(--accent); outline-offset: -2px; }
/* Text-only projects: solid dark tiles */
.tpl-bento .pf-card.ar-text { background: var(--ink); }
.tpl-bento .pf-card.ar-text .card-media, .tpl-bento .pf-card.ar-text .card-media-empty { display: none; }
.tpl-bento .pf-grid.bento-abs > .pf-card.ar-text .card-body { position: absolute; background: none; }

/* Category filler tiles — flat-colour tiles linking to a category. */
.tpl-bento .pf-card.pf-filler { display: none; }
.tpl-bento .pf-grid.bento-abs > .pf-card.pf-filler.is-placed { display: block; }
.tpl-bento .pf-card.pf-filler .filler-body {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  justify-content: center; align-items: flex-start; gap: 6px; padding: 20px;
}
.tpl-bento .pf-card.pf-filler .filler-eyebrow {
  font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; opacity: .8;
}
.tpl-bento .pf-card.pf-filler .filler-name {
  font-family: var(--font-display, inherit); font-size: 1.5rem; font-weight: 600; line-height: 1.1;
}
.tpl-bento .pf-card.pf-filler .filler-arrow { font-size: 1.3rem; margin-top: 4px; opacity: .9; }
.tpl-bento .pf-card.pf-filler:hover .filler-arrow { transform: translateX(3px); transition: transform .2s; }

/* Single-column (mobile): natural vertical stack, no absolute positioning. */
.tpl-bento .pf-grid.bento-1col { position: static; display: block; height: auto !important; }
.tpl-bento .pf-grid.bento-1col > .pf-card { position: static; transform: none !important; width: 100% !important; height: auto !important; margin: 0 0 16px; }
.tpl-bento .pf-grid.bento-1col > .pf-card .card-media { height: auto; aspect-ratio: var(--ar, 3/2); min-height: 200px; }
.tpl-bento .pf-grid.bento-1col > .pf-card { min-height: 200px; }
.tpl-bento .pf-grid.bento-1col > .pf-card.ar-text { min-height: 220px; }
.tpl-bento .pf-grid.bento-1col > .pf-filler.is-placed { display: block; }

/* Mobile (single column): overlay title/cats on the image, same as desktop. */
.tpl-bento .pf-grid.bento-1col > .pf-card { position: relative; }
.tpl-bento .pf-grid.bento-1col > .pf-card .card-body {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  justify-content: flex-end; padding: 18px;
  background: linear-gradient(to top, rgba(0,0,0,.78), rgba(0,0,0,.12) 55%, transparent);
  color: #fff;
}
.tpl-bento .pf-grid.bento-1col > .pf-card .card-title { color: #fff; }
.tpl-bento .pf-grid.bento-1col > .pf-card .card-summary { color: rgba(255,255,255,.85); }
.tpl-bento .pf-grid.bento-1col > .pf-card .card-cat { color: #fff; }
.tpl-bento .pf-grid.bento-1col > .pf-card.ar-text .card-body { background: none; }

/* Drop-in: tiles fade in rising from below, staggered. */
.tpl-bento .pf-card.bento-fall { animation: bentoFall .6s cubic-bezier(.16,.84,.44,1) both; }
@keyframes bentoFall {
  from { opacity: 0; transform: translate(var(--bx,0px), calc(var(--by,0px) + 48px)); }
  to   { opacity: 1; transform: translate(var(--bx,0px), var(--by,0px)); }
}
@media (prefers-reduced-motion: reduce) {
  .tpl-bento .pf-card.bento-fall { animation: none; }
}

/* ============================================================
   Horizontal Scroll — one swipeable row with scroll-snap.
   ============================================================ */
.tpl-carousel .work { overflow: visible; }
.tpl-carousel .pf-grid {
  display: flex; columns: auto; column-gap: 0;
  gap: 22px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding-bottom: 18px; scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  scroll-padding-left: 2px;
}
.tpl-carousel .pf-grid > .pf-card {
  margin: 0; break-inside: auto;
  flex: 0 0 clamp(240px, 30%, 360px); scroll-snap-align: start;
}
.tpl-carousel .pf-card .card-media { aspect-ratio: 4 / 5; }
.tpl-carousel .pf-card .card-media img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 760px) {
  .tpl-carousel .pf-grid > .pf-card { flex-basis: 82%; scroll-snap-align: center; }
}

/* ============================================================
   Fluid Masonry (Pinterest) — true column masonry, tuned for
   mixed portrait/landscape covers; image-less projects render
   as solid dark text tiles for rhythm.
   ============================================================ */
.tpl-pinterest .pf-grid { columns: 4 260px; column-gap: 20px; }
.tpl-pinterest .pf-card { margin: 0 0 20px; break-inside: avoid; display: inline-block; width: 100%; }
.tpl-pinterest .pf-card.ar-text { background: var(--ink); border-radius: var(--r-md, 12px); color: #fff; }
.tpl-pinterest .pf-card.ar-text .card-media-empty { display: none; }
.tpl-pinterest .pf-card.ar-text .card-title { color: #fff; }
.tpl-pinterest .pf-card.ar-text .card-summary { color: rgba(255,255,255,.8); }
@media (max-width: 1024px) { .tpl-pinterest .pf-grid { columns: 3 220px; } }
@media (max-width: 760px) { .tpl-pinterest .pf-grid { columns: 2 160px; column-gap: 14px; } }
@media (max-width: 440px) { .tpl-pinterest .pf-grid { columns: 1; } }

@media (max-width: 760px) {
  /* backdrop-filter makes the header a containing block for fixed children,
     which traps the slide-out panel. Drop it on mobile so the panel can
     anchor to the viewport. */
  .site-header { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--paper); }
  .nav-toggle { display: flex; }
  .site-nav {
    position: fixed; top: 0; right: 0; bottom: 0; left: auto;
    width: min(82vw, 320px); height: 100dvh; height: 100vh;
    flex-direction: column; align-items: stretch;
    background: #fff; background: var(--paper-card);
    box-shadow: var(--shadow-pop); padding: 76px 24px 28px;
    transform: translateX(100%); transition: transform .25s ease;
    z-index: 60; gap: 6px; overflow-y: auto; overscroll-behavior: contain;
  }
  body.nav-open .site-nav { transform: translateX(0); }
  body.nav-open { overflow: hidden; }
  body.nav-open .site-header { z-index: 60; }
  body.nav-open::before {
    content: ""; position: fixed; inset: 0; background: rgba(20, 19, 24, 0.45);
    z-index: 30; opacity: 1;
  }
  body.nav-open .nav-toggle { position: fixed; right: 16px; top: 16px; z-index: 70; }
  .contact-form .cf-row { grid-template-columns: 1fr; }
  .hdr-center .header-inner { flex-direction: row; }
}

/* ============ v2.1: announcement styling + responsive ============ */
.announce { position: relative; }
.announce-link { color: inherit; text-decoration: underline; }
.announce-text { color: inherit; }
.announce.has-close { padding-right: 46px; }
.announce-close { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: none; border: 0;
  color: inherit; font-size: 22px; line-height: 1; cursor: pointer; opacity: .85; padding: 0 6px; }
.announce-close:hover { opacity: 1; }

/* Custom-colour live preview swatch in admin is handled in admin.css */

/* ---- Responsive refinements ---- */
@media (max-width: 1024px) {
  .nav-search input { width: 104px; }
}
@media (max-width: 760px) {
  .site-nav .nav-link { display: block; font-size: 17px; width: 100%; padding: 12px 4px; border-bottom: 1px solid var(--line); }
  .site-nav .nav-link.active { border-bottom-color: var(--accent); }
  .nav-search { width: 100%; margin-top: 12px; }
  .nav-search input { width: 100%; }
  .nav-cta { width: 100%; text-align: center; justify-content: center; margin-top: 12px; padding: 12px 16px; }
  .tpl-studio .header-inner, .tpl-classic .header-inner, .hdr-center .header-inner { flex-direction: row; gap: 16px; text-align: left; }
  .tpl-studio .site-nav, .tpl-classic .site-nav, .hdr-center .site-nav,
  .hdr-left .site-nav { justify-content: flex-start; flex-wrap: nowrap; }
  .site-nav { justify-content: flex-start; }
  .filter-bar { gap: 10px; }
  .sort-form { width: 100%; justify-content: flex-end; }
}
@media (max-width: 640px) {
  .footer-inner { display: block; }
  .foot-main { margin-bottom: 20px; }
  .collection-head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .project-tags { flex-wrap: wrap; }
  .page { padding: 36px 20px 56px; }
  .page-title { font-size: clamp(26px, 7vw, 34px); }
  .page-content { font-size: 16px; }
  .cookie-banner { left: 10px; right: 10px; bottom: 10px; padding: 16px; flex-direction: column; align-items: stretch; }
  .cookie-actions { justify-content: stretch; }
  .cookie-actions button { flex: 1; }
  .ci-row { flex-direction: column; gap: 2px; }
  .ci-row .ci-k { width: auto; }
}
@media (max-width: 460px) {
  .hero-heading { font-size: clamp(30px, 11vw, 44px); }
  .car-btn { width: 36px; height: 36px; }
}

/* Consent block: Accept/Decline inside the covering overlay */
.cb-actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; }
.cb-actions button { flex: 1; max-width: 180px; }
.cb-policy { display: inline-block; margin-top: 12px; font-size: 13px; color: var(--muted); }
.cb-policy:hover { color: var(--ink); }

/* Pagination */
.pager { margin-top: clamp(28px, 4vw, 48px); }
.pg-inner { display: flex; align-items: center; justify-content: center; gap: 16px; }
.pg-link { text-decoration: none; color: var(--ink); font-weight: 500; font-size: 14px; padding: 8px 15px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); transition: border-color .15s; }
.pg-link:hover { border-color: var(--ink); }
.pg-link.is-off { color: var(--muted-2); border-color: var(--line); pointer-events: none; }
.pg-cur { font-size: 13px; color: var(--muted); }

/* ============================================================
   v2.2 — full responsive hardening (public)
   ============================================================ */
/* Global safety net: never allow horizontal scroll, keep media fluid */
html, body { max-width: 100%; overflow-x: hidden; }
img, svg, video, iframe, canvas { max-width: 100%; }
.page-content img, .page-content video, .page-content iframe { height: auto; }
.page-content table { display: block; width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.page-content pre { overflow-x: auto; }
.hero-heading, .project-title, .collection-title, .card-title, .page-title { overflow-wrap: anywhere; }

/* Tablet */
@media (max-width: 1024px) {
  :root { --maxw: 1100px; }
  .pf-grid { columns: 3 240px; }
}

/* Small tablet / large phone */
@media (max-width: 760px) {
  main { padding: 0 18px; }
  .footer-inner { padding: 30px 18px; }
  .header-inner { padding: 12px 18px; gap: 14px; }
  .hero { padding: clamp(36px, 9vw, 64px) 0 24px; }
  .filter-bar { padding-bottom: 18px; margin-bottom: 22px; }
  .project { padding-top: 20px; }
  .car-slide img, .car-slide video { max-height: 62vh; }
}

/* Phones */
@media (max-width: 560px) {
  .pf-grid { columns: 1; }
  .pf-masonry { columns: 1; }
  .collection-head { padding-top: 28px; }
  .hero-tagline { margin-bottom: 12px; }
  .project-tags { gap: 6px; }
  .lb-btn { width: 40px; height: 40px; }
  .lb-prev { left: 8px; } .lb-next { right: 8px; }
  .lb-close { top: 12px; right: 12px; }
  .lb-thumb { width: 52px; height: 36px; }
  .lb.has-thumbs .lb-cap { bottom: 80px; }
  .car-btn { width: 38px; height: 38px; font-size: 22px; }
  .car-prev { left: 8px; } .car-next { right: 8px; }
  .foot-contact, .foot-social { font-size: 13px; }
}

/* Small phones */
@media (max-width: 380px) {
  main { padding: 0 14px; }
  .header-inner { padding: 10px 14px; }
  .brand-name { font-size: 19px; }
  .chip { padding: 6px 12px; font-size: 12.5px; }
}

/* Coarse-pointer (touch) niceties: bigger tap targets, no sticky-hover zoom */
@media (hover: none) {
  .pf-card:hover .card-media img { transform: none; }
  .nav-link, .chip, .tag, .pg-link { padding-top: 9px; padding-bottom: 9px; }
}

/* v2.2.1 — cookie banner / block on small screens */
@media (max-width: 560px) {
  .cookie-banner { left: 10px; right: 10px; bottom: 10px; padding: 14px 16px; gap: 12px; }
  .cookie-banner .cookie-msg { flex: 1 1 100%; font-size: 13px; }
  .cookie-actions { flex: 1 1 100%; gap: 8px; }
  .cookie-actions button { flex: 1; padding: 11px 14px; }
  .cookie-block { padding: 16px; align-items: flex-end; }
  .cookie-block .cb-card { padding: 22px 18px; width: 100%; max-width: none; }
  .cb-title { font-size: 20px; }
  .cb-actions { flex-direction: row; }
  .cb-actions button { padding: 11px 14px; max-width: none; }
}

/* Footer elements (about / link columns / copyright) */
.foot-about { color: var(--muted); font-size: 14px; max-width: 42ch; margin-top: 4px; line-height: 1.6; }
.foot-cols { display: flex; gap: clamp(24px, 5vw, 64px); flex-wrap: wrap; }
.foot-col h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted-2); margin: 0 0 12px; font-weight: 600; }
.foot-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.foot-col a { color: var(--ink-soft); text-decoration: none; font-size: 14px; }
.foot-col a:hover { color: var(--accent); }
.foot-copy { border-top: 1px solid var(--line); margin-top: 28px; padding: 20px 0 4px; color: var(--muted-2); font-size: 13px; }
@media (max-width: 640px) { .foot-cols { gap: 28px; } }

/* Footer widgets (front end) */
.site-footer .fw-grid { display: grid; align-items: start; }
.fw-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.fw-title { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted-2); margin: 0 0 12px; font-weight: 600; }
.fw-widget ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fw-widget a { color: var(--ink-soft); text-decoration: none; font-size: 14px; }
.fw-widget a:hover { color: var(--accent); }
.fw-text, .fw-contact { font-size: 14px; color: var(--muted); line-height: 1.7; }
.fw-logo { max-height: 44px; width: auto; }
.fw-brand .foot-brand { font-family: var(--font-head); font-size: 20px; }
.fw-col[style*="center"] .fw-widget ul, .fw-col[style*="center"] .social-row { align-items: center; }
.fw-col[style*="right"] .social-row { justify-content: flex-end; }
@media (max-width: 760px) {
  .site-footer .fw-grid { grid-template-columns: 1fr !important; gap: 28px !important; text-align: left !important; }
}

/* Footer language switcher */
.fw-langs { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 16px; }
.fw-langs a { color: var(--ink-soft); text-decoration: none; font-size: 14px; }
.fw-langs a.is-active { color: var(--accent); font-weight: 600; }
.fw-langs a:hover { color: var(--accent); }

/* Per-device columns: carousel items-in-view + before/after grid */
.pf-carousel.pf-cols-set .car-slide { min-width: calc(100% / var(--pf-cols, 1)); }
@media (max-width: 880px) { .pf-carousel.pf-cols-set .car-slide { min-width: calc(100% / var(--pf-cols-t, 1)); } }
@media (max-width: 560px) { .pf-carousel.pf-cols-set .car-slide { min-width: calc(100% / var(--pf-cols-m, 1)); } }
.pf-ba-wrap.pf-cols-set { display: grid; grid-template-columns: repeat(var(--pf-cols, 2), 1fr); gap: clamp(16px, 2vw, 28px); }
@media (max-width: 880px) { .pf-ba-wrap.pf-cols-set { grid-template-columns: repeat(var(--pf-cols-t, 1), 1fr); } }
@media (max-width: 560px) { .pf-ba-wrap.pf-cols-set { grid-template-columns: repeat(var(--pf-cols-m, 1), 1fr); } }

/* Main menu: horizontal scroll with hidden overflow on desktop (never wraps/breaks). */
@media (min-width: 761px) {
  .site-nav { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; -ms-overflow-style: none; scroll-behavior: smooth; }
  .site-nav::-webkit-scrollbar { display: none; }
  .tpl-studio .site-nav, .tpl-classic .site-nav, .hdr-center .site-nav { flex-wrap: nowrap; }
  .site-nav .nav-link { flex: 0 0 auto; white-space: nowrap; }
}

.proj-date { color: var(--muted); }
.project-meta { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }

/* Single-mode homepage gallery */
.single-work { margin-top: 8px; }
.single-work .empty-note { color: var(--muted, #888); text-align: center; padding: 48px 16px; }
