/* ═══════════════════════════════════════════════════════════════════════════
   YAAD ADZ v3.0 — "LAGOON" LIQUID GLASS · SHARED AD PAGES
   ───────────────────────────────────────────────────────────────────────────
   Loaded last by every generated /ad/*.html page (see generate-pages.js).
   The home app uses v3-glass.css; these pages have their own class names, so
   they get this matching layer. Rollback: remove the one <link> from the
   generator template and let the workflow regenerate the pages.
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
  --v3-spring: cubic-bezier(.34, 1.56, .64, 1);
  --v3-gold: #ffd27a;
  --v3-gold-grad: linear-gradient(145deg, #fff0b8 0%, #ffd45c 52%, #f4c300 100%);
  --v3-fill: linear-gradient(145deg, rgba(255, 255, 255, .24), rgba(255, 255, 255, .06) 55%, rgba(255, 255, 255, .13));
  --v3-tint: rgba(6, 34, 30, .34);
  --v3-rim: inset 0 1px 1px rgba(255, 255, 255, .6), inset 0 -1px 2px rgba(255, 255, 255, .12), inset 0 0 22px rgba(255, 255, 255, .06);
  --v3-shadow: 0 18px 40px rgba(2, 20, 18, .34);
  --v3-font: 'Sora', 'Outfit', system-ui, sans-serif;
}

/* sunset-lagoon backdrop */
body {
  background-color: #06231f;
  background-image:
    linear-gradient(180deg, rgba(3, 22, 18, 0) 0%, rgba(3, 22, 18, 0) 34%, rgba(3, 22, 18, .6) 70%, rgba(3, 22, 18, .86) 100%),
    radial-gradient(11rem 11rem at 84% 7%, rgba(255, 238, 190, .85), rgba(255, 190, 110, .45) 45%, rgba(255, 150, 80, 0) 72%),
    radial-gradient(26rem 18rem at 92% 8%, rgba(255, 160, 90, .45), transparent 66%),
    radial-gradient(23rem 15rem at 6% 34%, rgba(0, 205, 140, .3), transparent 62%),
    radial-gradient(26rem 16rem at 62% 44%, rgba(46, 132, 224, .24), transparent 66%),
    linear-gradient(180deg, #123f5c 0%, #0c5f60 40%, #053a2a 100%);
  background-attachment: fixed;
}

/* shared glass */
.gallery-main, .gallery-placeholder, .price-card, .contact-box, .section-card, .wa-share-box, .sim-card,
.nav-back, .nav-post, .float-contact, .ad-feedback {
  background: var(--v3-fill), var(--v3-tint);
  border: 0;
  -webkit-backdrop-filter: blur(22px) saturate(190%) brightness(1.06);
  backdrop-filter: blur(22px) saturate(190%) brightness(1.06);
  box-shadow: var(--v3-rim), var(--v3-shadow);
}

/* ── header: floating capsules, no bar ── */
nav, nav#topNav {
  background: none; border: 0; box-shadow: none;
  -webkit-backdrop-filter: none; backdrop-filter: none;
  height: 46px; padding: 0; margin-top: 18px;
  width: min(calc(100% - 36px), 960px);
}
body.pwa-mode nav { height: calc(46px + env(safe-area-inset-top, 0px)); }
.nav-back {
  height: 46px; padding: 0 18px 0 12px; border-radius: 999px;
  color: #fff; font-weight: 600; justify-self: start;
  transition: transform .4s var(--v3-spring);
}
.nav-back-chevron { color: var(--v3-gold); margin-left: 0; }
.nav-back-label { color: #fff; font-size: 15px; font-weight: 600; }
.nav-back:active { transform: scale(.95); opacity: 1; }
.nav-center { text-shadow: 0 1px 12px rgba(0, 30, 30, .5); }
.nav-center-price { color: var(--v3-gold); font-family: var(--v3-font); }
.nav-post {
  height: 46px; padding: 0 20px; border-radius: 999px; display: flex; align-items: center;
  background: var(--v3-gold-grad); color: #1a1405; font-weight: 700; font-size: 14px;
  box-shadow: 0 10px 26px rgba(244, 195, 0, .34), inset 0 1px 1px rgba(255, 255, 255, .7);
  -webkit-backdrop-filter: none; backdrop-filter: none;
  transition: transform .4s var(--v3-spring);
}
.nav-post:active { transform: scale(.95); opacity: 1; }

.breadcrumb a, .breadcrumb span { color: rgba(255, 255, 255, .86); }

/* ── gallery: photo framed inside the glass ── */
.gallery-main, .gallery-placeholder { border-radius: 34px; padding: 10px; }
.gallery-main > img, .gallery-main img { border-radius: 26px; }
.gallery-placeholder { overflow: hidden; }
.gallery-count, .gallery-zoom-hint {
  background: var(--v3-fill), rgba(6, 34, 30, .5);
  -webkit-backdrop-filter: blur(16px) saturate(180%); backdrop-filter: blur(16px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, .24); border-radius: 999px; color: #fff;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .3);
}
.gallery-arrow {
  background: var(--v3-fill), rgba(6, 34, 30, .5); border: 0; color: #fff; border-radius: 50%;
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: var(--v3-rim);
}
.gallery-thumbs { gap: 10px; }
.gallery-thumbs .thumb { border-radius: 20px; border: 2px solid transparent; transition: transform .4s var(--v3-spring), border-color .25s ease; }
.gallery-thumbs .thumb:hover { transform: translateY(-2px); }
.gallery-thumbs .thumb.active { border-color: var(--v3-gold); box-shadow: 0 0 0 3px rgba(255, 212, 92, .22); }

/* ── price panel ── */
.price-card, .contact-box, .section-card, .wa-share-box { border-radius: 34px; }
.price-card { padding: 22px 20px; }
.price-main {
  font-family: var(--v3-font); font-weight: 700; letter-spacing: -.03em;
  color: var(--v3-gold); font-size: 32px;
}
.price-neg { color: rgba(255, 255, 255, .84); }
.ad-title-panel { font-family: var(--v3-font); font-weight: 600; font-size: 19px; letter-spacing: -.01em; }
.meta-tag {
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 999px; padding: 6px 14px; font-size: 13px; color: #fff;
}
.status-badge { border-radius: 999px; padding: 5px 12px; }
.status-badge.active { background: rgba(79, 192, 139, .22); color: #8ff0bf; }
.section-card h2 { font-family: var(--v3-font); font-weight: 600; letter-spacing: -.02em; }
.desc-text { color: rgba(255, 255, 255, .92); }
.seller-row {
  padding: 12px; border-radius: 24px;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .14);
}
.seller-avatar { box-shadow: 0 0 0 2px rgba(255, 255, 255, .22); }
.seller-sub { color: rgba(255, 255, 255, .84); }

/* ── contact: capsule buttons ── */
.cta-btn, .float-contact-btn, .wa-share-btn, .copy-link-btn, .see-more-btn {
  border-radius: 999px; border: 0;
  transition: transform .4s var(--v3-spring), filter .25s ease;
}
.cta-btn { padding: 15px 18px; }
.cta-btn:active, .float-contact-btn:active { transform: scale(.95); }
.cta-call, .float-btn-call {
  background: var(--v3-fill), rgba(6, 34, 30, .4); color: #fff;
  box-shadow: var(--v3-rim);
}
.cta-wa, .float-btn-wa {
  background: var(--v3-gold-grad); color: #1a1405;
  box-shadow: 0 10px 26px rgba(244, 195, 0, .34), inset 0 1px 1px rgba(255, 255, 255, .7);
}
.cta-btn::before, .float-contact-btn::before { display: none; }
.float-contact { border-radius: 999px; padding: 8px 10px 8px 20px; }
.float-contact-price { font-family: var(--v3-font); font-weight: 700; color: var(--v3-gold); }
.float-contact-title { color: rgba(255, 255, 255, .8); }
.float-contact-btn { padding: 0 20px; height: 52px; }

/* ── similar listings ── */
.similar-heading { font-family: var(--v3-font); font-weight: 600; letter-spacing: -.02em; }
.sim-card { border-radius: 30px; padding: 8px; }
.sim-img { border-radius: 22px; overflow: hidden; }
.sim-price { font-family: var(--v3-font); font-weight: 700; color: var(--v3-gold); }

@media (prefers-reduced-motion: reduce) {
  .nav-back, .nav-post, .cta-btn, .float-contact-btn, .gallery-thumbs .thumb { transition: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .gallery-main, .price-card, .contact-box, .section-card, .sim-card, .float-contact, .nav-back { background: #0d2a1d; }
}
@media (forced-colors: active) {
  body { background-image: none; }
}

/* title + price fade in over the page when you scroll: give them their own glass
   capsule now that the header bar is gone, or the text collides with the content */
.nav-center.visible {
  align-self: center; justify-self: center; max-width: 100%;
  padding: 4px 18px; border-radius: 999px;
  background: var(--v3-fill), rgba(6, 34, 30, .5);
  -webkit-backdrop-filter: blur(18px) saturate(180%); backdrop-filter: blur(18px) saturate(180%);
  box-shadow: var(--v3-rim);
}
.breadcrumb span[style] { color: #fff !important; }
/* the reviews block comes from ad-feedback.css, which loads after this file */
body .ad-feedback {
  background: var(--v3-fill), var(--v3-tint); border: 0; border-radius: 34px;
  box-shadow: var(--v3-rim), var(--v3-shadow);
  -webkit-backdrop-filter: blur(22px) saturate(190%); backdrop-filter: blur(22px) saturate(190%);
}
.meta-tag.view-count-tag, .view-count-tag { color: rgba(255, 255, 255, .88); }


/* ═══ PHASE 2 — LISTING PAGE (board K) ═══
   One glass sheet (price, title, place, facts, description, seller) over a
   full-bleed photo, round glass Back / Share / Save, and a floating capsule
   contact bar. Markup comes from generate-pages.js (.v3-sheet, .v3-circ…). */
.nav-right { display: flex; align-items: center; gap: 10px; justify-self: end; }
.v3-circ {
  position: relative; width: 46px; height: 46px; flex: none; padding: 0; border: 0; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: #fff; text-decoration: none;
  background: var(--v3-fill), rgba(6, 34, 30, .42);
  -webkit-backdrop-filter: blur(22px) saturate(190%) brightness(1.06); backdrop-filter: blur(22px) saturate(190%) brightness(1.06);
  box-shadow: var(--v3-rim), 0 10px 24px rgba(2, 20, 18, .34);
  transition: transform .4s var(--v3-spring);
}
.v3-circ:active { transform: scale(.92); }
.v3-save.on { color: #ff6b81; } .v3-save.on svg { fill: currentColor; }
.v3-save.pop svg { animation: v3Pop .5s var(--v3-spring); }
.v3-share.done { color: var(--v3-gold); }
@keyframes v3Pop { 0% { transform: scale(.6); } 60% { transform: scale(1.3); } 100% { transform: scale(1); } }

/* the sheet */
.price-card.v3-sheet { padding: 20px 18px 18px; border: 0; border-radius: 34px; }
.price-card.v3-sheet::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(135deg, rgba(255,255,255,.75), rgba(255,255,255,0) 36%, rgba(255,255,255,0) 64%, rgba(255,255,255,.4));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); mask-composite: exclude;
}
.v3-sheet .price-main { font-size: 31px; line-height: 1.1; }
.price-neg-pill { font: 600 12px/1 var(--font-b, system-ui); letter-spacing: 0; color: var(--v3-gold); vertical-align: middle;
  background: rgba(255,210,122,.14); border: 1px solid rgba(255,210,122,.3); border-radius: 999px; padding: 5px 10px; margin-left: 4px; }
.sr-only-neg { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1.ad-title-panel { margin: 4px 0 0; font-size: 19px; font-weight: 700; line-height: 1.3; color: #fff; }
.v3-loc { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 14px; color: rgba(255,255,255,.88); }
.v3-loc svg { color: var(--v3-gold); flex: none; }
.v3-specs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.v3-spec { display: flex; flex-direction: column; gap: 1px; min-width: 0; padding: 10px 12px; border-radius: 20px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); }
.v3-spec-k { font-size: 12px; color: rgba(255,255,255,.8); }
.v3-spec-v { font-size: 15px; font-weight: 700; color: #fff; overflow-wrap: anywhere; line-height: 1.25; }
.v3-h { font-family: var(--v3-font); font-size: 15px; font-weight: 600; margin: 0 0 6px; color: #fff; }
.v3-sheet .desc-text { font-size: 14.5px; line-height: 1.55; color: rgba(255,255,255,.92); margin: 0 0 14px; }
.v3-sheet .seller-row { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 24px;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14); }
.v3-sheet .seller-row::after { content: "›"; margin-left: auto; padding-right: 4px; font-size: 28px; line-height: 1; color: var(--v3-gold); }
.v3-sheet .seller-info { min-width: 0; }
.v3-sheet .seller-avatar { width: 48px; height: 48px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #fff0b8, #ffd27a); color: #3a2400; font-family: var(--v3-font); font-weight: 700; font-size: 18px; box-shadow: none; }

@media (max-width: 700px) {
  /* header → three round glass buttons floating on the photo */
  nav#topNav, body.pwa-mode nav#topNav {
    position: absolute; top: 0; left: 0; right: 0; width: auto; height: auto; margin: 0; z-index: 30;
    padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 0;
    display: flex; justify-content: space-between; align-items: center;
  }
  .nav-back { width: 48px; height: 48px; padding: 0; justify-content: center; border-radius: 50%; }
  .nav-back-label, .nav-center, .nav-center.visible, .nav-post, .breadcrumb { display: none; }
  .nav-back-chevron { margin: 0; color: #fff; font-size: 30px; font-weight: 300; line-height: 1; transform: translateX(-1px); }
  .v3-circ { width: 48px; height: 48px; }

  /* photo: full bleed */
  .page-wrap { padding: 0 0 calc(110px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; }
  .ad-layout, .ad-body, .ad-panel { display: contents; }
  .gallery { order: 1; margin: 0; }
  .gallery .gallery-main, .gallery.gallery-placeholder {
    height: 420px; aspect-ratio: auto; padding: 0; margin: 0; border-radius: 0; background: #06231f;
    box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none;
  }
  .gallery.gallery-placeholder { display: flex; align-items: center; justify-content: center; }
  .gallery .gallery-main::before { top: auto; height: 150px; background: linear-gradient(to top, rgba(5,40,32,.9), rgba(5,40,32,0)); }
  .gallery .gallery-main > img, .gallery .gallery-main img { border-radius: 0; height: 100%; }
  .gallery-thumbs, .gallery-zoom-hint { display: none; }
  .gallery-count { left: 16px; right: auto; top: auto; bottom: 140px; }
  .gallery-count-total::after { content: " photos"; }

  /* sheet overlaps the photo (card top = 296px of the 420px photo, as in the board) */
  .price-card.v3-sheet { order: 2; margin: -124px 12px 0; z-index: 2; }
  .price-card:not(.v3-sheet) { order: 2; margin: 14px 12px 0; }
  .section-card { order: 3; margin: 14px 12px 0; }
  .contact-box:not(.sold-msg) { display: none; }
  .contact-box.sold-msg { order: 3; margin: 14px 12px 0; }
  .wa-share-box { order: 4; margin: 14px 12px 0; }
  .ad-feedback { order: 5; margin: 14px 12px 0; }
  .ad-slot-wrap { order: 9; margin: 14px 12px 0; }
  .similar-section { padding: 0 12px 48px; }

  /* floating capsule: Call circle + gold primary, always on screen */
  .float-contact, .float-contact.visible {
    left: 12px; right: 12px; bottom: max(14px, env(safe-area-inset-bottom, 14px)); max-width: 640px;
    height: 74px; padding: 0 10px; border-radius: 999px; transform: none; pointer-events: auto;
  }
  .float-contact-info { display: none; }
  .float-btns { flex: 1; min-width: 0; gap: 10px; }
  .float-contact-btn { height: 54px; padding: 0; gap: 9px; }
  .float-btn-call { width: 54px; flex: none; border-radius: 50%; }
  .float-btn-call .fc-t { display: none; }
  .float-btn-wa { flex: 1; font-size: 16px; font-weight: 700; color: #1a1405; white-space: nowrap; }
  body.has-float-bar { padding-bottom: 0; }
}
@media (max-width: 360px) {
  .v3-sheet .price-main { font-size: 27px; }
  .v3-specs { gap: 6px; } .v3-spec { padding: 9px 9px; } .v3-spec-v { font-size: 14px; }
  .float-btn-wa { font-size: 14.5px; }
}
@media (prefers-reduced-motion: reduce) { .v3-circ, .v3-save.pop svg { transition: none; animation: none; } }
@media (prefers-reduced-transparency: reduce) { .v3-circ, .price-card.v3-sheet { background: #0d2a1d; -webkit-backdrop-filter: none; backdrop-filter: none; } }

/* ── whole photo visible + the photo as a blurred page backdrop ── */
.v3-ad-bg { position: fixed; inset: -30px; z-index: -1; pointer-events: none; background-size: cover; background-position: center;
  background-color: #0d3b33; filter: blur(9px) saturate(1.5) brightness(.85); transform: translateZ(0); transition: background-image .3s ease; }
.v3-ad-bg::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(5,40,30,.05) 0%, rgba(5,40,30,.2) 50%, rgba(3,26,20,.5) 100%); }
body.has-ad-bg { background-image: none; }
.gallery-main > img, .gallery-main img { object-fit: contain; }
.gallery-main { background: transparent; }
@media (max-width: 700px) {
  .gallery .gallery-main, .gallery.gallery-placeholder { background: transparent; }
  .gallery .gallery-main { height: auto; aspect-ratio: 4 / 3; max-height: 58vh; }
  .gallery .gallery-main > img, .gallery .gallery-main img { height: 100%; }
  .gallery .gallery-main::before { display: none; }
  .gallery-count { bottom: 14px; }
  .price-card.v3-sheet { margin-top: 12px; }
}
@media (prefers-reduced-motion: reduce) { .v3-ad-bg { transition: none; } }

/* ── depth: photo recedes while scrolling, backdrop sharpens (--p is 0 → 1, set by js/v3-ad-bg.js) ── */
@media (max-width: 700px) {
  .gallery .gallery-main { transform-origin: 50% 0; will-change: transform, opacity, filter;
    transform: translateY(calc(var(--p, 0) * 170px)) scale(calc(1 - var(--p, 0) * .1));
    opacity: calc(1 - var(--p, 0) * .3); filter: blur(calc(var(--p, 0) * 2px)); position: relative; z-index: 0; }
}
.v3-ad-bg { filter: blur(calc(12px - var(--p, 0) * 5px)) saturate(1.5) brightness(calc(.7 + var(--p, 0) * .2)); transition: background-image .3s ease; }
