/* ==========================================================
   Site styles (loaded after styles.css)
   ========================================================== */

/* ---------- Hero: split layout (copy left, photo right) ---------- */
.hero {
  display: grid;
  grid-template-columns: 40% 60%;
  background: var(--ink);
  max-height: 960px;
}
.hero-img {
  position: relative;
  grid-column: 2;
  grid-row: 1;
  filter: none;
  object-position: 60% 22%;
  animation: none;
}
.hero-shade {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  pointer-events: none;
  background: linear-gradient(to right, var(--ink) 0%, rgba(14, 13, 12, 0) 18%);
}
.hero-copy {
  position: relative;
  left: auto;
  bottom: auto;
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  padding: var(--nav-h) var(--gutter) 0;
}
.hero h1 { font-size: clamp(2.8rem, 5.4vw, 5.6rem); }

/* ---------- About: portrait column on the right ---------- */
.about-img {
  width: min(40%, 560px);
  object-position: 50% 18%;
}
.about-shade {
  background:
    linear-gradient(to right, var(--ink-2) 0%, var(--ink-2) 58%, rgba(21, 19, 17, 0) 72%),
    linear-gradient(to top, var(--ink-2) 0%, rgba(21, 19, 17, 0) 28%);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .about-img { width: 100%; height: 62%; object-position: 50% 15%; }
  .about-shade {
    background: linear-gradient(to top, var(--ink-2) 0%, var(--ink-2) 42%, rgba(21, 19, 17, 0.4) 60%, rgba(21, 19, 17, 0) 100%);
  }
}

@media (max-width: 760px) {
  .hero {
    grid-template-columns: 1fr;
    grid-template-rows: 62svh auto;
    height: auto;
    min-height: 0;
    max-height: none;
  }
  .hero-img { grid-column: 1; grid-row: 1; object-position: 38% 30%; }
  .hero-shade {
    grid-column: 1;
    grid-row: 1;
    background: linear-gradient(to top, var(--ink) 0%, rgba(14, 13, 12, 0) 30%),
                linear-gradient(to bottom, rgba(14, 13, 12, 0.6) 0%, rgba(14, 13, 12, 0) 25%);
  }
  .hero-copy { grid-column: 1; grid-row: 2; align-self: start; padding: 0.5rem var(--gutter) 64px; }
}

/* ---------- Gallery ---------- */
.gallery {
  background: var(--ink);
  padding: clamp(80px, 10vw, 140px) 0;
}
.gallery-head { margin-bottom: clamp(32px, 5vw, 56px); }
.gallery-head h2 { font-size: clamp(2.3rem, 4.4vw, 3.8rem); color: var(--cream); }
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: clamp(320px, 36vw, 520px);
  gap: clamp(10px, 1.4vw, 18px);
}
.g-item { margin: 0; overflow: hidden; background: var(--ink-3); }
.g-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.8s ease;
}
.gallery-grid .g-item:nth-child(1) img { object-position: 50% 30%; }
.gallery-grid .g-item:nth-child(2) img { object-position: 45% 40%; }
.gallery-grid .g-item:nth-child(3) img { object-position: 50% 45%; }

@media (max-width: 760px) {
  .gallery-grid { grid-template-columns: 1fr; grid-auto-rows: 110vw; }
}

/* Longer headline, keep "Michelin-trained" on one line */
.hero h1.h1-long { font-size: clamp(2.4rem, 4.2vw, 4.5rem); }

/* Portrait hero photo (red jacket) + plating photo in About */
@media (min-width: 761px) { .hero { grid-template-columns: 48% 52%; grid-template-rows: 100%; } }
.hero-img { object-position: 50% 22%; }
.about-img { object-position: 32% 30%; }
@media (max-width: 900px) { .about-img { object-position: 35% 30%; } }
@media (max-width: 760px) { .hero-img { object-position: 50% 18%; } }

/* Centered hero headline + subtitle */
.hero-copy { text-align: center; justify-self: center; max-width: 640px; }
.hero .lede { margin-left: auto; margin-right: auto; max-width: 30rem; text-wrap: balance; }
.hero h1 { text-wrap: balance; }
@media (min-width: 761px) {
  .hero-copy { padding: 0 var(--gutter); align-self: center; }
}
/* Headline: "Michelin-trained chef," / "your table." on two fixed lines */
.hero h1.h1-long { font-size: clamp(2rem, 3.9vw, 4.2rem); }
.nowrap { white-space: nowrap; }
@media (max-width: 760px) { .hero h1.h1-long { font-size: clamp(1.9rem, 8vw, 3rem); } }

/* Subtitles: elegant but legible italic (Playfair Display) */
.lede,
.contact-sub {
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0.005em;
  line-height: 1.5;
}
.lede { font-size: clamp(1.05rem, 1.35vw, 1.3rem); color: var(--text); opacity: 0.94; }
.hero .lede { margin-top: 1.3rem; }
.contact-sub { font-size: 1.15rem; }

/* "Chef Wilson Wong" signature at the bottom of the hero text panel */
.hero-signature {
  grid-column: 1;
  grid-row: 1;
  align-self: end;
  justify-self: center;
  position: relative;
  z-index: 1;
  margin: 0 0 clamp(36px, 6vh, 64px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.9rem;
  font-family: var(--serif);
  font-size: 0.95rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--text);
  opacity: 0.85;
  animation: fadeUp 1.2s 0.6s ease-out both;
}
.sig-rule { width: 48px; height: 1px; background: var(--copper); }
@media (max-width: 760px) {
  .hero { grid-template-rows: 62svh auto auto; }
  .hero-signature { grid-row: 3; align-self: start; margin-top: 0; }
  .hero-copy { padding-bottom: 32px; }
}

/* Three service cards (Catering / Private Chef / Consulting) */
@media (min-width: 761px) {
  .services-strip { grid-template-columns: repeat(3, 1fr); }
  .service-link { padding-left: clamp(20px, 3vw, 48px); padding-right: clamp(20px, 3vw, 48px); }
  .service-link h3 { font-size: clamp(1.8rem, 2.8vw, 2.6rem); }
}

/* Keep alternating section backgrounds now that Consulting sits before the gallery */
.gallery { background: var(--ink-3); }

/* Solid backing so service cards stay readable over the About photo */
.services-strip { background: rgba(21, 19, 17, 0.9); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }

/* ==========================================================
   Fit each section to one screen on desktop/laptop
   ========================================================== */
@media (min-width: 901px) and (min-height: 560px) {
  html { scroll-padding-top: 0; }

  main > section:not(.hero) {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: calc(68px + 3vh);
    padding-bottom: 4vh;
  }

  /* About */
  .about-copy { min-height: 0; }
  .about h2 { font-size: min(5.5vw, 9vh); }
  .about .body { margin-top: 2.5vh; }
  .rule { margin-bottom: 3vh; }
  .services-strip { margin-top: 6vh; }
  .service-link { padding-top: 3.2vh; padding-bottom: 3.2vh; }
  .service-link h3 { font-size: min(2.8vw, 5.2vh); }
  .arrow { margin-top: 2vh; }

  /* Catering / Private Chef / Consulting */
  .offer-grid { align-items: center; }
  .offer-head h2 { font-size: min(4.2vw, 7vh); }
  .offer-head .body { margin: 2.4vh 0 3.2vh; }
  .eyebrow { margin-bottom: 1.8vh; }
  .offer-list li { padding: 2.1vh 0; }
  .steps li { padding: 2.6vh 0; }
  .offer h4 { font-size: min(1.6rem, 3.6vh); }

  /* Gallery */
  .gallery-head { margin-bottom: 3.5vh; }
  .gallery-head h2 { font-size: min(4.2vw, 7vh); }
  .gallery-grid { grid-auto-rows: min(36vw, calc(100svh - 68px - 7vh - 3.5vh - 7vh - 3.6rem)); }

  /* Contact */
  .contact h2 { font-size: min(6vw, 9vh); }
  .contact-sub { margin: 1.5vh 0 4vh; }
  .contact-form { grid-template-columns: repeat(3, 1fr); gap: 2.6vh 2rem; }
  .form-actions { margin-top: 1vh; }
  .form-note { margin-top: 0.6vh; }
}
@media (min-width: 901px) { .hero { max-height: none; } }
@media (min-width: 901px) and (min-height: 560px) {
  .contact h2 { font-size: min(6vw, 8vh); }
  .contact-form { gap: 2.2vh 2rem; }
  .contact-sub { margin: 1.2vh 0 3.2vh; }
}

/* Slim one-row footer; Contact + footer together fill exactly one screen */
@media (min-width: 901px) and (min-height: 560px) {
  .footer { padding: 0; height: 72px; display: flex; align-items: center; }
  .footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
  .footer .brand { margin: 0; font-size: 1.05rem; }
  .footer p { margin: 0; font-size: 0.95rem; }
  .footer .copyright { margin-top: 0 !important; }
  main > section.contact { min-height: calc(100svh - 72px); padding-top: calc(68px + 2vh); padding-bottom: 3vh; }
}
@media (min-width: 901px) and (min-height: 560px) {
  .contact h2 { font-size: min(6vw, 7.5vh); }
  .contact-sub { margin: 1vh 0 2.6vh; }
  .contact-form { gap: 1.8vh 2rem; }
  .contact-form textarea { height: 4.2em; min-height: 3em; }
  .form-actions .btn { padding: 0.55em 3em; }
  .form-note { min-height: 0; }
  .form-note:empty { display: none; }
}

/* About now has two paragraphs: tighten so it still fits short laptop screens */
@media (min-width: 901px) and (min-height: 560px) {
  .about .body { max-width: 38rem; margin-top: 1.6vh; margin-bottom: 0; }
  .about .lede + .body { margin-top: 2.4vh; }
  .services-strip { margin-top: 4.5vh; }
}
@media (min-width: 901px) and (max-height: 720px) {
  .about .body { font-size: 1rem; line-height: 1.5; }
  .about h2 { font-size: min(5vw, 8vh); }
  .service-link { padding-top: 2.4vh; padding-bottom: 2.4vh; }
}

/* ---------- Phone & tablet fixes ---------- */
@media (max-width: 760px) {
  html, body, .hero { background: #000; }
  .hero-shade {
    background: linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0) 30%),
                linear-gradient(to bottom, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 25%);
  }
}

@media (max-width: 760px) {
  /* Full-screen menu: the scrolled nav's blur traps fixed children, so drop it while open */
  body.nav-open { overflow: hidden; }
  .nav-open .nav {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: #000;
    box-shadow: none;
  }
  .nav-links {
    z-index: 1;
    height: 100vh;
    height: 100dvh;
    background: #000;
    gap: 1.6rem;
  }
  .nav .brand, .nav-toggle { position: relative; z-index: 2; }
}

@media (max-width: 900px) {
  /* About: photo on top, text below on a solid background */
  .about { padding-top: 0; }
  .about-img {
    position: relative;
    display: block;
    width: 100%;
    height: min(105vw, 68svh);
    object-position: 35% 30%;
  }
  .about-shade {
    inset: 0 0 auto 0;
    height: min(105vw, 68svh);
    background: linear-gradient(to top, var(--ink-2) 0%, rgba(21, 19, 17, 0) 30%),
                linear-gradient(to bottom, rgba(14, 13, 12, 0.55) 0%, rgba(14, 13, 12, 0) 22%);
  }
  .about-copy { padding-top: 1.75rem; }
}

/* ---------- Gallery: masonry wall (natural photo shapes, thin even gaps) ---------- */
.gallery { --gap: clamp(8px, 0.9vw, 16px); }
main > section.gallery {
  min-height: 0;
  display: block;
  padding: clamp(64px, 9vh, 110px) 0 var(--gap);
}
.gallery .container { max-width: none; padding: 0 var(--gap); }
.gallery-head { text-align: center; margin-bottom: clamp(24px, 3.5vh, 44px); }
.gallery-grid {
  display: block;
  columns: 3;
  column-gap: var(--gap);
}
.g-item {
  display: block;
  break-inside: avoid;
  margin: 0 0 var(--gap);
  overflow: hidden;
  background: var(--ink);
  cursor: zoom-in;
}
.g-item img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.8s ease, opacity 0.4s ease;
}
.g-item:focus, .a-item:focus { outline: none; }
@media (max-width: 900px) { .gallery-grid { columns: 2; } }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.94);
  padding: clamp(16px, 4vw, 64px);
}
.lightbox[hidden] { display: none; }
.lb-img { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 20px 60px rgba(0,0,0,0.6); }
.lb-btn {
  position: absolute; background: none; border: 0; color: var(--cream);
  font-size: 2.6rem; line-height: 1; padding: 0.4em 0.5em; cursor: pointer; opacity: 0.75;
}
.lb-btn:hover, .lb-btn:focus-visible { opacity: 1; }
.lb-close { top: 8px; right: 12px; }
.lb-prev { left: 4px; top: 50%; transform: translateY(-50%); font-size: 3.4rem; }
.lb-next { right: 4px; top: 50%; transform: translateY(-50%); font-size: 3.4rem; }
.lb-count { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); font-family: var(--sans); font-size: 0.8rem; letter-spacing: 0.2em; color: var(--muted, #a59a8e); }
body.lb-open { overflow: hidden; }

/* Floating Contact button (shown while scrolling the gallery) */
.float-contact {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 60;
  transform: translate(-50%, 140%);
  opacity: 0;
  pointer-events: none;
  padding: 0.5em 1.5em;
  font-family: var(--serif);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  color: var(--cream);
  background: rgba(10, 9, 8, 0.78);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--copper);
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  transition: transform 0.45s cubic-bezier(.2,.8,.2,1), opacity 0.35s ease, background 0.3s ease, color 0.3s ease;
}
.float-contact.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.float-contact:hover, .float-contact:focus-visible { background: var(--copper); color: var(--ink); }
body.lb-open .float-contact, body.nav-open .float-contact { opacity: 0; pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .float-contact { transition: opacity 0.2s ease; } }

.gallery { background: #0a0908; }
.g-item { background: #141210; }

/* ---------- Section photos (Catering / Private Chef / Consulting) ---------- */
.offer-photo { position: relative; margin: 0; overflow: hidden; background: var(--ink); }
.offer-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
#catering .offer-photo img { object-position: 42% 50%; }
#private-chef .offer-photo img { object-position: 24% 50%; }
#consulting .offer-photo img { object-position: 54% 40%; }

@media (min-width: 901px) {
  .offer.has-photo {
    display: grid;
    grid-template-columns: 36% 1fr;
    align-items: stretch;
    padding: 0;
  }
  .offer.has-photo.photo-right { grid-template-columns: 1fr 36%; }
  .offer.has-photo .offer-photo { grid-row: 1; grid-column: 1; min-height: 100%; }
  .offer.has-photo.photo-right .offer-photo { grid-column: 2; }
  .offer.has-photo > .container {
    grid-row: 1; grid-column: 2;
    align-self: center;
    max-width: none; width: 100%;
    padding: calc(68px + 3vh) clamp(28px, 4vw, 72px) 4vh;
  }
  .offer.has-photo.photo-right > .container { grid-column: 1; }
  .offer.has-photo .offer-grid { grid-template-columns: 1fr 1fr; gap: clamp(28px, 3.5vw, 64px); }
}
@media (min-width: 901px) and (min-height: 560px) {
  main > section.offer.has-photo { min-height: 100svh; }
}
@media (max-width: 900px) {
  .offer.has-photo { padding-top: 0; }
  .offer-photo { height: min(72vw, 56svh); margin-bottom: clamp(32px, 7vw, 56px); }
}

/* ---------- About: mini strip of chef photos ---------- */
.about-strip { display: flex; gap: 8px; margin-top: clamp(18px, 3vh, 32px); max-width: 38rem; }
.a-item {
  flex: 1 1 0; display: block; overflow: hidden; cursor: zoom-in;
  height: clamp(84px, 15vh, 150px);
  border: 1px solid rgba(185, 130, 87, 0.35);
}
.a-item img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; transition: transform 0.6s ease; }

/* ---------- Gallery masonry (JS: row-first columns) ---------- */
.gallery-grid.is-masonry { display: flex; align-items: flex-start; gap: var(--gap); columns: auto; }
.g-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: var(--gap); }
.gallery-grid.is-masonry .g-item { margin: 0; }
.g-item { position: relative; }

/* ---------- Gallery editing (?edit) ---------- */
.edit-bar {
  position: fixed; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 80; display: flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 10px 18px;
  width: max-content; max-width: calc(100vw - 24px);
  padding: 12px 18px; border-radius: 14px;
  background: rgba(10, 9, 8, 0.92); border: 1px solid var(--copper);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5);
  font-family: var(--sans); font-size: 0.85rem; color: var(--cream);
}
.edit-bar strong { font-weight: 500; letter-spacing: 0.04em; }
.edit-hint { color: var(--text-dim, #a59a8e); }
.edit-add, .edit-done, .edit-view, .edit-undo, .edit-discard, .edit-save {
  cursor: pointer; padding: 0.45em 1em; border: 1px solid var(--copper); border-radius: 999px; color: var(--cream);
}
.edit-add:hover, .edit-done:hover, .edit-view:hover, .edit-undo:not(:disabled):hover, .edit-discard:not(:disabled):hover, .edit-save:not(:disabled):hover { background: var(--copper); color: var(--ink); }
.edit-status { min-width: 4.5em; color: var(--text-dim, #a59a8e); }
.edit-status.ok { color: #9fc79a; }
.edit-status.err { color: #f08a7a; }
body.gallery-editing .float-contact { display: none; }
body.gallery-editing .g-item { cursor: grab; }
.g-tools { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; z-index: 2; }
.g-tool {
  min-width: 34px; height: 34px; padding: 0 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.35); background: rgba(10, 9, 8, 0.78); color: #fff;
  font: 500 1.05rem/1 var(--sans);
}
.g-tool:hover { background: var(--copper); color: var(--ink); border-color: var(--copper); }
.g-restore { display: none; font-size: 0.8rem; }
.g-item.is-removed img { opacity: 0.25; filter: grayscale(1); }
.g-item.is-removed { outline: 2px dashed #f08a7a; outline-offset: -2px; }
.g-item.is-removed .g-hide, .g-item.is-removed .g-left, .g-item.is-removed .g-right { display: none; }
.g-item.is-removed .g-restore { display: inline-block; }
.g-item.is-dragging { opacity: 0.35; }
.g-item.drop-before { box-shadow: 0 -5px 0 0 var(--copper); }
.g-item.drop-after { box-shadow: 0 5px 0 0 var(--copper); }
body.gallery-editing .g-item.is-upload::after {
  content: "New"; position: absolute; left: 8px; top: 8px; padding: 3px 8px; border-radius: 999px;
  background: var(--copper); color: var(--ink); font: 500 0.7rem/1.2 var(--sans); letter-spacing: 0.08em;
}

/* ---------- About: portrait on the LEFT, text on the right (desktop) ---------- */
@media (min-width: 901px) {
  .about.photo-left .about-img {
    left: 0; right: auto;
    width: min(54%, 820px);
    object-position: 36% 30%;
  }
  .about.photo-left .about-shade {
    background:
      linear-gradient(to left, var(--ink-2) 0%, var(--ink-2) calc(100% - min(54%, 820px)), rgba(21, 19, 17, 0) calc(100% - min(54%, 820px) + 6%)),
      linear-gradient(to top, rgba(21, 19, 17, 0.6) 0%, rgba(21, 19, 17, 0) 14%);
  }
  .about.photo-left .about-copy {
    max-width: none;
    padding-left: calc(min(54%, 820px) + clamp(24px, 3vw, 56px));
    padding-right: clamp(24px, 4vw, 72px);
  }
}
#catering .offer-photo img { object-position: 46% 55%; }
#consulting .offer-photo img { object-position: 50% 50%; }

/* ---------- About: service cards sit in the text column (no photo overlap) ---------- */
.about-copy .services-strip {
  background: none; backdrop-filter: none; -webkit-backdrop-filter: none;
  margin-top: clamp(24px, 4.5vh, 48px);
  max-width: 40rem;
}
@media (min-width: 761px) {
  .about-copy .service-link { padding: clamp(16px, 2.6vh, 28px) clamp(14px, 1.6vw, 24px); }
  .about-copy .service-link:first-child { padding-left: 0; }
  .about-copy .service-link h3 { font-size: min(2vw, 4vh); white-space: nowrap; }
  .about-copy .service-link .lede { font-size: 0.95rem; line-height: 1.4; margin-top: 0.4em; }
  .about-copy .arrow { margin-top: 1.4vh; }
}
@media (max-width: 760px) {
  .about-copy .service-link { padding-left: 0; padding-right: 0; }
  .about-copy .service-link + .service-link { border-left: 0; border-top: 1px solid var(--copper-soft); }
}

/* Section labels (CATERING / PRIVATE CHEF / ...): larger and brighter so they read on dark */
.eyebrow { font-size: clamp(0.95rem, 1.1vw, 1.1rem); font-weight: 500; letter-spacing: 0.22em; color: #d39a6c; }
#private-chef .offer-photo img { object-position: 42% 60%; }

/* Edit bar: Undo / Discard / Save */
.edit-undo, .edit-discard, .edit-save { background: none; font: inherit; line-height: 1.2; }
.edit-undo:disabled, .edit-discard:disabled, .edit-save:disabled { opacity: 0.35; cursor: default; }
.edit-save:not(:disabled) { background: var(--copper); color: var(--ink); font-weight: 500; }
.edit-save:not(:disabled):hover { background: var(--cream); border-color: var(--cream); }
.edit-bar.is-dirty .edit-status { color: #e8c07a; }

/* Zoomed-out section photo: the whole dish shows, with a soft blurred copy of the
   photo filling the rest of the tall frame (desktop only; phones already show it all). */
@media (min-width: 901px) {
  .zoom-out { --r: 0.7315; /* photo height ÷ width */ position: relative; overflow: hidden; background: var(--ink); container-type: size; }
  .zoom-out::before {
    content: ""; position: absolute; inset: -40px;
    background: var(--src) center / cover no-repeat;
    filter: blur(28px) brightness(0.45) saturate(1.1);
  }
  .zoom-out img {
    position: relative; z-index: 1; object-fit: contain !important; object-position: 50% 50% !important; transform: scale(var(--zs, 1.15));
    /* fade the photo's top and bottom edges into the blurred fill */
    --half: calc(50cqw * var(--r));
    -webkit-mask-image: linear-gradient(to bottom, transparent calc(50% - var(--half)), #000 calc(50% - var(--half) + var(--fade, 9cqw)), #000 calc(50% + var(--half) - var(--fade, 9cqw)), transparent calc(50% + var(--half)));
            mask-image: linear-gradient(to bottom, transparent calc(50% - var(--half)), #000 calc(50% - var(--half) + var(--fade, 9cqw)), #000 calc(50% + var(--half) - var(--fade, 9cqw)), transparent calc(50% + var(--half)));
  }
}

/* ---------- Gallery: absolute layout from gallery.js (wide tiles for sharp photos) ---------- */
.gallery-grid.is-abs { position: relative; display: block; columns: auto; }
.gallery-grid.is-abs .g-item { position: absolute; margin: 0; }
.gallery-grid.is-abs .g-item img { width: 100%; height: 100%; object-fit: cover; }

/* Soft photos open smaller in the viewer so they don't look blurry */
.lb-img.lb-soft { max-width: min(100%, 72vw); max-height: min(100%, 72vh); }

/* Edit mode: photo picked for a swap, and the Large/Normal button */
.g-item.is-picked { outline: 3px solid var(--copper); outline-offset: -3px; }
.g-item.is-picked img { opacity: 0.8; }
.g-tool.g-size { font-size: 0.78rem; letter-spacing: 0.02em; }
.g-item.is-removed .g-size { display: none; }
.edit-status.pick { color: #e8c07a; }
body.gallery-editing .flow-wall .g-item { cursor: pointer; }

/* Continuous view editing: drop-to-swap target, Compact, hidden-photos tray */
.g-item.drop-swap { outline: 3px dashed var(--copper); outline-offset: -3px; }
.edit-compact, .edit-hidden {
  cursor: pointer; padding: 0.45em 1em; border: 1px solid var(--copper); border-radius: 999px; color: var(--cream); background: none; font: inherit;
}
.edit-compact:not(:disabled):hover, .edit-hidden:not(:disabled):hover { background: var(--copper); color: var(--ink); }
.edit-compact:disabled, .edit-hidden:disabled { opacity: 0.45; cursor: default; }
.edit-tray {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 96px; z-index: 81;
  width: min(760px, calc(100vw - 24px)); max-height: 46vh; overflow: auto;
  padding: 14px 16px; border-radius: 14px; background: rgba(10, 9, 8, 0.95); border: 1px solid var(--copper);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5); font-family: var(--sans); font-size: 0.85rem; color: var(--cream);
}
.edit-tray[hidden] { display: none; }
.edit-tray-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; letter-spacing: 0.04em; }
.edit-tray-close { background: none; border: 0; color: var(--cream); font-size: 1.4rem; cursor: pointer; line-height: 1; }
.edit-tray-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.edit-tray-item { position: relative; }
.edit-tray-item img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; display: block; }
.edit-tray-item button {
  position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%); cursor: pointer;
  padding: 0.3em 0.8em; border-radius: 999px; border: 1px solid var(--copper); background: rgba(10, 9, 8, 0.85); color: var(--cream); font: inherit; font-size: 0.78rem;
}
.edit-tray-item button:hover { background: var(--copper); color: var(--ink); }

/* "Tell us about the occasion": a real box, so it reads as a place to type (not another underline field) */
.field textarea {
  border: 1px solid rgba(14, 13, 12, 0.3); border-radius: 10px;
  background: rgba(255, 255, 255, 0.6);
  padding: 0.75rem 0.95rem; min-height: 6.2em; line-height: 1.5;
}
.field textarea::placeholder { color: #9a8b7c; font-style: italic; opacity: 1; }
.field textarea:focus { border-color: var(--copper); background: #fff; }
.form-actions { margin-top: 1.6rem; }

/* "(optional)" after a form label */
.field label .optional { text-transform: none; letter-spacing: 0.02em; opacity: 0.75; }

/* Veggie badge on vegetarian photos (data-veg, from the "veg" tag in tools/photos.txt) */
.g-item[data-veg]::after {
  content: ""; position: absolute; top: 8px; right: 8px; z-index: 1; pointer-events: none;
  width: clamp(26px, 2.1vw, 34px); aspect-ratio: 1;
  background: url(images/veggie-badge.svg) center / contain no-repeat;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.45));
}
body.gallery-editing .g-item[data-veg]::after { right: auto; left: 8px; } /* edit tools sit top-right */
.edit-tray-item[data-veg]::after { content: ""; position: absolute; top: 5px; left: 5px; width: 22px; aspect-ratio: 1; background: url(images/veggie-badge.svg) center / contain no-repeat; }
