/* The gallery (bake-off C, "through the arches", reworked 2026-11-03 after Rafael's friend's review). Chapters by
   floor; photographs only on the page, their room, caption and credit in the viewer. Each floor's chapter opens with
   its first photograph appearing through an arch, the building's own shape; the rest fade in quietly, in rows that
   keep each photo whole. js/gallery.js draws the chapters and rows from gallery-photos.json. */
html{scrollbar-gutter:stable}
.cg{--gap:clamp(12px,1.25vw,22px);max-width:var(--wide);margin:0 auto;
  padding:calc(var(--mast-h,64px) + 26px) var(--pad) clamp(96px,14vh,180px)}

/* The page's h1 is a small label that sits with the photographs. */
.cg-h1{display:flex;align-items:center;gap:12px;margin:0 0 12px;font-family:var(--sans);font-size:11.5px;font-weight:500;
  letter-spacing:.28em;text-transform:uppercase;color:var(--gold-soft);line-height:1.4}
.cg-h1::before{content:"";flex:none;width:28px;height:1px;background:var(--gold)}
.cg-h1 span{color:var(--mute);letter-spacing:.2em}

/* A place: its number, its name, a hairline, its count. */
.cg-place+.cg-place{margin-top:clamp(96px,15vh,190px)}
.cg-head{display:flex;align-items:baseline;gap:16px;margin:0 0 clamp(14px,2vh,24px)}
.cg-num{font-family:var(--sans);font-size:12px;letter-spacing:.2em;color:var(--gold-soft)}
.cg-head h2{margin:0;font-size:clamp(26px,2.5vw,40px);font-weight:normal;line-height:1.1;letter-spacing:-.01em}
.cg-rule{flex:1;align-self:center;height:1px;background:var(--line);transform-origin:0 50%}
.cg-count{font-family:var(--sans);font-size:11.5px;letter-spacing:.18em;text-transform:uppercase;color:var(--mute);white-space:nowrap}
.cg-intro{max-width:62ch;margin:calc(-1 * clamp(4px,1vh,12px)) 0 clamp(18px,2.6vh,30px);font-size:clamp(16px,1.15vw,19px);
  line-height:1.5;color:var(--cream-dim)}
.cg-place[id]{scroll-margin-top:calc(var(--mast-h,64px) + var(--bar-h,0px) + 18px)}
/* Muñoz Photography's credit, small, under each of his photos (Rafael, 2026-11-03). */
.cg-by{display:block;padding-top:8px;font-family:var(--sans);font-size:10px;line-height:16px;letter-spacing:.14em;
  text-transform:uppercase;color:var(--mute)}

/* The chapters, always in view on a laptop: a quiet bar under the header (a phone uses the pill instead). */
.cg-bar{position:sticky;top:var(--mast-h,64px);z-index:20;margin:0 calc(-1 * var(--pad)) clamp(22px,3.4vh,40px);
  padding:0 var(--pad);background:rgba(13,11,8,.9);-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);
  border-bottom:1px solid rgba(201,162,39,.16)}
.cg-bar ol{display:flex;gap:clamp(18px,2.4vw,40px);margin:0;padding:0;list-style:none}
.cg-bar a{display:block;padding:15px 0 13px;border-bottom:1px solid transparent;font-family:var(--sans);font-size:12px;
  letter-spacing:.16em;text-transform:uppercase;text-decoration:none;color:var(--mute);white-space:nowrap;
  transition:color .25s,border-color .25s}
.cg-bar a:hover{color:var(--cream)}
.cg-bar a[aria-current]{color:var(--cream);border-bottom-color:var(--gold)}
.cg-bar a:focus-visible{outline:2px solid var(--gold-soft);outline-offset:2px}

/* One understated invitation, after the dinner chapter. */
.cg-mid{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:14px 26px;
  margin:clamp(80px,12vh,150px) auto 0;text-align:center}
.cg-mid p{margin:0;font-size:clamp(20px,1.7vw,26px);color:var(--cream-dim)}
.cg-mid .cta{border-radius:999px}

/* Rows keep every photo whole: each photo's width follows its shape, so a row's photos share one height. */
.cg-row{display:flex;align-items:flex-start;gap:var(--gap);max-width:var(--rw,100%);margin-inline:auto}
.cg-row.al-l{margin-left:0}
.cg-row.al-r{margin-right:0}
.cg-row+.cg-row{margin-top:clamp(30px,5vh,64px)}
.cg-row>.cg-ph{flex:var(--ar) 1 0;min-width:0}
.cg-lead{flex:0 0 var(--lw);min-width:0}
.cg-stack{flex:1 1 0;min-width:0;display:flex;flex-direction:column;gap:var(--gap)}

.cg-ph{margin:0}
.cg-open{position:relative;display:block;width:100%;aspect-ratio:var(--ar);padding:0;border:0;border-radius:0;
  background:transparent;overflow:hidden;cursor:zoom-in;color:inherit}
.cg-wipe{position:absolute;inset:0;overflow:hidden}
.cg-par{position:absolute;inset:0}
.cg-par img{width:100%;height:100%;object-fit:cover}
.cg-open:focus-visible{outline:2px solid var(--gold-soft);outline-offset:4px}

/* A place's first photograph opens through an arch: an ink panel with an arched opening that grows past the frame. */
.cg-arch,.cg-arch-line{position:absolute;left:-2px;top:-2px;width:calc(100% + 4px);height:calc(100% + 4px);
  pointer-events:none;transform-origin:50% 50%;will-change:transform}
.cg-arch path{fill:var(--ink);fill-rule:evenodd}
.cg-arch-line path{fill:none;stroke:var(--gold-soft);stroke-width:1;opacity:.75;vector-effect:non-scaling-stroke}

/* A revealed photo leans in a little under the pointer. */
@media (hover:hover) and (prefers-reduced-motion:no-preference){
  .cg-ph.is-in .cg-wipe{transition:transform .9s cubic-bezier(.2,.7,.2,1)}
  .cg-ph.is-in .cg-open:hover .cg-wipe{transform:scale(1.02)}
}

.cg-empty{font-family:var(--sans);color:var(--cream-dim)}
/* Hidden for a moment while js/gallery.js assembles the first screen. */
.cg-wait .cg-ph,.cg-wait .cg-h1,.cg-wait .cg-place:first-child .cg-head,.cg-wait .cg-place:first-child .cg-intro{opacity:0}

/* On a phone: one photograph at a time, landscapes edge to edge, portraits a little narrower and alternating sides. */
@media (max-width:760px){
  .cg{padding-inline:0;padding-top:calc(var(--mast-h,64px) + 20px)}
  .cg-h1,.cg-head,.cg-intro,.cg-by,.cg-mid{padding-inline:var(--pad)}
  .cg-intro{font-size:16px;margin-top:-6px}
  .cg-h1{font-size:10.5px;letter-spacing:.22em;margin-bottom:8px}
  .cg-h1 span{display:none}
  .cg-head{gap:12px;margin-bottom:14px}
  .cg-count{display:none}
  .cg-place+.cg-place{margin-top:96px}
  .cg-row,.cg-stack{display:block;max-width:none;margin:0}
  .cg-row+.cg-row,.cg-row .cg-ph+.cg-ph,.cg-stack,.cg-stack .cg-ph+.cg-ph{margin-top:34px}
  .cg-lead{width:auto}
  .cg-ph.is-p{width:86%}
  .cg-ph.is-p.alt{margin-left:auto}
}

/* The place index: one small pill at the foot of the screen, opening to the list of places. */
@media (min-width:1025px){.cg-pill{display:none}}
@media (max-width:1024px){.cg-bar{display:none}}
.cg-pill{position:fixed;left:0;right:0;bottom:max(18px,env(safe-area-inset-bottom));z-index:55;width:max-content;
  max-width:calc(100% - 32px);margin-inline:auto;transition:opacity .45s,transform .55s cubic-bezier(.2,.7,.2,1)}
.cg-pill.away{opacity:0;transform:translateY(18px);pointer-events:none}
.cg-pill-btn{display:flex;align-items:center;gap:12px;height:46px;padding:0 18px 0 18px;border-radius:999px;
  border:1px solid var(--line);background:rgba(13,11,8,.84);-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);
  color:var(--cream);font-family:var(--sans);font-size:14px;cursor:pointer;box-shadow:0 12px 34px rgba(0,0,0,.4)}
.cg-pill-btn:focus-visible,.cg-pill-list a:focus-visible{outline:2px solid var(--gold-soft);outline-offset:3px}
.cg-pill-num{flex:none;white-space:nowrap;font-size:11px;letter-spacing:.16em;text-transform:uppercase;color:var(--gold-soft)}
.cg-pill-now{color:var(--cream-dim)}
.cg-pill-now{display:block;min-width:0;overflow:hidden;height:1.45em;line-height:1.45}
.cg-pill-label{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cg-pill-chev{width:7px;height:7px;margin:3px 0 0 2px;border-left:1.5px solid var(--gold-soft);border-top:1.5px solid var(--gold-soft);
  transform:rotate(45deg);transition:transform .35s}
.cg-pill.open .cg-pill-chev{transform:rotate(225deg) translate(3px,3px)}
.cg-pill-list{position:absolute;left:50%;bottom:calc(100% + 10px);min-width:260px;margin:0;padding:8px;list-style:none;
  transform:translateX(-50%);background:#17130e;border:1px solid var(--line);border-radius:14px;
  box-shadow:0 18px 44px rgba(0,0,0,.5);display:none}
.cg-pill.open .cg-pill-list{display:block}
.cg-pill-list a{display:flex;align-items:baseline;gap:14px;padding:11px 12px;border-radius:8px;text-decoration:none;
  font-family:var(--sans);font-size:15px;color:var(--cream-dim)}
.cg-pill-list a:hover,.cg-pill-list a[aria-current]{background:#241e16;color:var(--cream)}
.cg-pill-list .n{min-width:2ch;font-size:11px;letter-spacing:.16em;color:var(--gold-soft)}
.cg-pill-list .c{margin-left:auto;font-size:12px;color:var(--mute)}

/* The viewer: the whole screen, the photograph whole, its place, caption and credit with it. */
html.cg-lock{overflow:hidden}
.cgv{position:fixed;inset:0;width:100%;height:100%;max-width:none;max-height:none;margin:0;padding:0;border:0;
  background:transparent;color:var(--cream);overflow:hidden}
.cgv::backdrop{background:transparent}
.cgv-back{position:absolute;inset:0;background:#080604}
.cgv-stage{position:absolute;inset:0;touch-action:pinch-zoom;cursor:grab;user-select:none;-webkit-user-select:none}
.cgv-stage.dragging{cursor:grabbing}
.cgv-track{position:absolute;inset:0}
.cgv-slide{--k:0;position:absolute;inset:0;display:flex;align-items:center;justify-content:center;
  padding:72px 96px 116px;transform:translateX(calc(var(--k) * (100% + 48px)))}
.cgv-slide img{flex:none;min-width:0;min-height:0;max-width:100%;max-height:100%;width:auto;height:auto;
  -webkit-user-drag:none;user-select:none}
.cgv-ui>*{position:absolute;z-index:2}
.cgv-where{top:22px;left:26px;display:flex;gap:16px;margin:0;font-family:var(--sans);font-size:11.5px;
  letter-spacing:.22em;text-transform:uppercase;color:var(--gold-soft)}
.cgv-count{color:var(--mute);letter-spacing:.16em}
.cgv-close,.cgv-prev,.cgv-next{display:grid;place-items:center;border-radius:50%;cursor:pointer;color:var(--cream);
  transition:background .25s,border-color .25s}
.cgv-close{top:10px;right:12px;width:48px;height:48px;border:1px solid transparent;background:none}
.cgv-close span{position:relative;width:20px;height:20px}
.cgv-close span::before,.cgv-close span::after{content:"";position:absolute;left:0;top:50%;width:100%;height:1.5px;background:currentColor;
  transform:rotate(45deg)}
.cgv-close span::after{transform:rotate(-45deg)}
.cgv-prev,.cgv-next{top:50%;width:54px;height:54px;margin-top:-27px;border:1px solid var(--line);background:rgba(13,11,8,.45)}
.cgv-prev{left:22px}.cgv-next{right:22px}
.cgv-prev span,.cgv-next span{width:10px;height:10px;border-left:1.5px solid var(--gold-soft);border-bottom:1.5px solid var(--gold-soft)}
.cgv-prev span{transform:translateX(2px) rotate(45deg)}
.cgv-next span{transform:translateX(-2px) rotate(-135deg)}
.cgv-close:hover,.cgv-prev:hover,.cgv-next:hover{border-color:var(--gold-soft);background:rgba(201,162,39,.14)}
.cgv button:focus-visible{outline:2px solid var(--gold-soft);outline-offset:3px}
.cgv-cap{left:50%;bottom:24px;width:min(88vw,820px);transform:translateX(-50%);text-align:center}
.cgv-text{margin:0;font-size:19px;line-height:1.35;color:var(--cream)}
.cgv-by{min-height:1.2em;margin:7px 0 0;font-family:var(--sans);font-size:10.5px;letter-spacing:.16em;
  text-transform:uppercase;color:var(--mute)}
@media (max-width:760px){
  .cgv-slide{padding:62px 0 132px}
  .cgv-where{top:20px;left:var(--pad);right:72px;flex-wrap:wrap;row-gap:4px;font-size:10.5px;gap:12px;line-height:1.5}
  .cgv-prev,.cgv-next{top:auto;bottom:22px;margin:0;width:46px;height:46px}
  .cgv-prev{left:12px}.cgv-next{right:12px}
  .cgv-cap{bottom:20px;width:calc(100% - 136px)}
  .cgv-text{font-size:16px}
}

/* The photographs as the page's HTML holds them (tools/make-static.py): what a crawler reads, and what shows if the
   script can't run or the list doesn't load. Hidden while the script lays them out itself. */
.cg-js .cg-static{display:none}
/* While the script fetches the list, hold a screen for the photographs, so the band under them never shows and then
   jumps away (0.549 of layout shift on a laptop, the SEO & AEO audit, 2026-11-11). */
.cg-js .cg-places:has(> .cg-static){min-height:calc(100vh + 120px)}
.cg-static .cg-place h2{margin:48px 0 8px}
.cg-static .cg-rows{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,420px),1fr));gap:18px;align-items:start}
.cg-static figure{margin:0}
.cg-static img{display:block;width:100%;height:auto}
.cg-static figcaption{margin-top:6px;font-size:13px;color:var(--cream-dim)}
.cg-static figcaption .cg-by{display:block;color:var(--mute)}
