/* Stay pages (G3, G3a, G3b, G3c). Builds on app.css; only additions and phone overrides here. */

.stay-body main > .banner-sample { margin-top: var(--s5); }
.staypage .titlebar { align-items: center; }
.titlebar h1 { overflow-wrap: anywhere; }
.share-msg { color: var(--positive); font-weight: 700; }
.share-msg:empty { display: none; }

/* gallery: 1 large + 4 small; phone: swipe with counter */
.sgwrap { position: relative; margin-top: var(--s5); }
.gallery.sg { margin-top: 0; }
.gallery.sg .photo { display: block; }
.gallery.sg .photo img { transition: opacity .15s; }
.gallery.sg .photo:hover img { opacity: .92; }
.gallery.sg .photo.extra { display: none; }
.sg-1 { grid-template-columns: minmax(0, 1fr); grid-template-rows: 440px; }
.sg-1 .photo:first-child { grid-row: auto; }
.sg-2 { grid-template-columns: 2fr 1fr; }
.sg-2 .photo:nth-child(2) { grid-row: span 2; }
.sg-4 { grid-template-columns: 2fr 1fr 1fr; }
.sg-4 .photo:nth-child(4) { grid-column: span 2; }
.sg-5 { grid-template-columns: 2fr 1fr 1fr; }
.sg-0 { grid-template-columns: minmax(0, 1fr); grid-template-rows: 280px; }
.sgwrap .allphotos { position: absolute; right: var(--s3); bottom: var(--s3); background: var(--white); }
.sgwrap .counter { display: none; }

.nophoto { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s2); background: var(--surface); color: var(--muted); border-radius: var(--r); font-size: var(--fs-14); font-weight: 700; text-align: center; padding: var(--s3); }
.nophoto .icon { color: var(--muted); }
.nophoto-hero { height: 100%; min-height: 240px; }
.nophoto-room { height: 96px; margin-top: var(--s2); font-size: var(--fs-13); }
.nophoto-card { aspect-ratio: 3 / 2; border-radius: var(--r) var(--r) 0 0; }

/* main column */
.score-line { margin-top: var(--s2); }
.hostline { margin-top: var(--s5); }
.notice-inline { display: flex; gap: var(--s2); align-items: center; margin-top: var(--s4); font-weight: 700; color: var(--danger); }
.hl .icon.ic-ok { color: var(--positive); }
.prose.is-clamped { max-height: calc(1.6em * 6); overflow: hidden; }
.rev-text.is-clamped { max-height: calc(1.55em * 4); overflow: hidden; }
.more-btn { margin-top: var(--s3); }
.beds { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--s3); }
.bedcard { padding: var(--s4); }
.bedcard h3 { font-size: var(--fs-16); margin-top: var(--s2); }
.licence { margin-top: var(--s4); color: var(--muted); }
.hostname { font: 700 18px/1.3 var(--font-head); }
.hostcard { grid-template-columns: auto minmax(0, 1fr); }
.trader { margin-top: var(--s5); }
.trader h3 { font-size: var(--fs-16); }
.trader .rules { margin-top: var(--s3); font-size: var(--fs-14); }

/* amenities + dialog */
.amen-dialog { max-width: 560px; max-height: min(86vh, 760px); padding: 0; overflow: auto; }
.amen-dialog::backdrop { background: rgba(21, 23, 31, .5); }
.amen-dialog header { position: sticky; top: 0; background: var(--white); z-index: 1; }
.amen-dialog header h2 { font-size: var(--fs-20); }
.amen-group + .amen-group { margin-top: var(--s5); }
.amen-group h3 { font-size: var(--fs-16); margin-bottom: var(--s3); }
.amen-group .amen { margin-bottom: 0; }
.amen-page { margin-top: var(--s5); max-width: 760px; }

/* location panel */
.locmap .m-area { fill: var(--wine); fill-opacity: .12; stroke: var(--wine); stroke-width: 2; }
.locmap .m-dot { fill: var(--wine); }
.locmap .m-halo { paint-order: stroke; stroke: #ECEEF1; stroke-width: 5px; stroke-linejoin: round; }
.loc-note { margin-top: var(--s3); }

/* reviews */
svg.meter { display: block; width: 100%; height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
svg.meter rect { fill: var(--ink); }
.dist svg.meter rect { fill: var(--sea); }
.overall-word { font: 700 20px/1.2 var(--font-head); }
.dist-h { font-size: var(--fs-16); margin: var(--s5) 0 var(--s3); }
.rev .who { position: relative; }
.rev .who > div { flex: 1; min-width: 0; }
.rev-score b { min-width: 30px; height: 24px; font-size: var(--fs-13); }
.rev-text p { display: flex; gap: var(--s2); align-items: flex-start; }
.rev-text p + p { margin-top: var(--s2); }
.rev-text .icon { margin-top: 4px; color: var(--muted); }
.rev-text .liked .icon { color: var(--positive); }

/* booking rail */
.rail .trip summary { list-style: none; cursor: pointer; display: grid; gap: var(--s2); color: var(--ink); font-weight: 400; }
.rail .trip summary::-webkit-details-marker { display: none; }
.rail .trip .dr { display: block; background: var(--white); padding: 8px 14px; min-height: 56px; }
.rail .trip .dr + .dr { border-left: 1px solid var(--line-strong); }
.rail .trip .daterange { margin-top: 0; }
.rail .trip summary:hover .daterange { border-color: var(--ink); }
.trip-who { display: flex; align-items: center; gap: var(--s2); font-size: var(--fs-14); }
.trip[open] summary { margin-bottom: var(--s3); }
.tripform { display: grid; gap: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--line); }
.trip-dates, .trip-party { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: var(--s3); }
.tripform .input[type=date] { min-height: 48px; }
.nodates { font: 700 var(--fs-20)/1.3 var(--font-head); }
.totalline { line-height: 1; }
.totalline, .selline { font: 600 var(--fs-16)/1.2 var(--font-head); }
.rail .bigtotal { color: var(--wine); }
.selline .bigtotal { font-size: var(--fs-32); }
.rates { border: 0; padding: 0; margin: 0; display: grid; gap: var(--s2); }
.rates legend { margin-bottom: var(--s2); }
.rate-opt { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: var(--s3); align-items: start; padding: var(--s3); border: 1px solid var(--line-strong); border-radius: var(--r); cursor: pointer; }
.rate-opt input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--wine); }
.rate-opt:has(input:checked) { border-color: var(--wine); background: var(--wine-soft); }
.rate-opt b { display: block; font-family: var(--font-head); }
.rate-opt small { display: block; color: var(--muted); font-size: var(--fs-13); }
.rail .bd summary { list-style: none; }
.rail .bd summary::-webkit-details-marker { display: none; }
.policy { display: flex; gap: var(--s2); align-items: flex-start; }
.policy .icon { color: var(--positive); margin-top: 2px; }
.paynote { display: flex; gap: var(--s2); align-items: center; }
.paynote[hidden], .reserve-msg[hidden], .reserve-wait[hidden] { display: none; }
.reserve-msg .btn { margin-top: var(--s2); }
.unavail { display: grid; gap: var(--s3); font-weight: 700; }
.unavail .btn { font-weight: 600; }
.notice-box { display: grid; gap: var(--s3); }
.notice { display: flex; gap: var(--s2); align-items: flex-start; font: 700 var(--fs-16)/1.4 var(--font-head); }
.reservebar .bar-off { font-size: var(--fs-16); }

/* room table (hotels, several room types) */
.rooms-intro { margin: calc(-1 * var(--s2)) 0 var(--s4); }
.rate-note { margin-bottom: var(--s3); background: var(--surface); border-radius: var(--r); padding: var(--s2) var(--s3); font-size: var(--fs-14); font-weight: 700; }
.stay-rooms { grid-template-columns: minmax(0, 1fr); }
table.rooms td.rt { width: 200px; }
table.rooms .sl { white-space: nowrap; }
.sleeps .icon.child { width: 14px; height: 14px; }
.sleeps-n { display: block; margin-top: 2px; }
table.rooms .rate-price small s { color: var(--muted); }
table.rooms .rate-price .badge { margin-top: 4px; }
table.rooms .soldout.nodates { font-weight: 400; }
table.rooms tbody.rtg + tbody.rtg tr:first-child td { border-top: 2px solid var(--line); }

/* similar stays */
.similar { margin-top: var(--s6); padding-top: var(--s6); border-top: 1px solid var(--line); }
.similar h2 { margin-bottom: var(--s4); }
.simgrid { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s4); }
.simcard { overflow: hidden; position: relative; }
.simcard .photo { aspect-ratio: 3 / 2; border-radius: 0; }
.simbody { padding: var(--s3) var(--s4) var(--s4); display: grid; gap: 6px; }
.simbody h3 { font-size: var(--fs-16); }
.simbody h3 a { color: var(--ink); text-decoration: none; }
.simbody h3 a::after { content: ""; position: absolute; inset: 0; }
.simbody h3 a:hover { text-decoration: underline; }
.simbody .score { position: relative; z-index: 1; }
.sim-price b { font: 800 var(--fs-20)/1.1 var(--font-head); }

/* sub pages */
.backlink { padding-top: var(--s5); }
.backlink a { display: inline-flex; align-items: center; gap: 4px; color: var(--sea); font-weight: 700; }
.sub-h1 { margin-top: var(--s3); overflow-wrap: anywhere; }
.sub-h1 .tag { margin-left: var(--s2); vertical-align: 6px; }
main > .banner-sample { margin-top: var(--s5); }
.photogrid { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--s5) var(--s4); margin: var(--s5) 0 var(--s7); }
.photogrid .photo { display: block; aspect-ratio: 4 / 3; }
.photogrid figcaption { display: grid; gap: 2px; margin-top: var(--s2); font-size: var(--fs-14); }
.photogrid-empty { max-width: 560px; margin: var(--s5) 0 var(--s7); }
.viewer { border: 0; padding: 0; margin: 0; width: 100vw; height: 100vh; max-width: none; max-height: none; background: var(--ink); color: var(--white); }
.viewer::backdrop { background: var(--ink); }
.viewer[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.viewer-top { display: flex; justify-content: space-between; align-items: center; padding: var(--s3) var(--s4); }
.viewer-count { font-weight: 700; }
.viewer-fig { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: var(--s2); padding: 0 var(--s8) var(--s4); min-height: 0; }
.viewer-fig img { width: 100%; height: 100%; object-fit: contain; min-height: 0; }
.viewer-fig figcaption { text-align: center; font-size: var(--fs-14); }
.viewer-prev, .viewer-next { position: absolute; top: 50%; transform: translateY(-50%); }
.viewer-prev { left: var(--s3); }
.viewer-next { right: var(--s3); }
.allrevs { margin: var(--s5) 0 var(--s7); }
.allrevs > h2 { margin-bottom: var(--s4); }
.revtools { display: flex; gap: var(--s3); align-items: flex-end; flex-wrap: wrap; margin: var(--s6) 0 var(--s3); }
.revsearch { flex: 1 1 280px; }
.revsort { flex: 0 1 220px; }
.inwrap { position: relative; }
.inwrap .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.inwrap .input { padding-left: 40px; }
.revs-all { margin-top: var(--s4); }
.empty { margin: var(--s5) 0; font-weight: 700; }

@media (max-width: 760px) {
  .sgwrap { margin: var(--s4) calc(-1 * var(--s4)) 0; }
  .gallery.sg { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0; grid-template-rows: none; height: 260px; gap: 0; }
  .gallery.sg::-webkit-scrollbar { display: none; }
  .gallery.sg .photo, .gallery.sg .photo:not(:first-child), .gallery.sg .photo.extra { display: block; flex: 0 0 100%; scroll-snap-align: start; border-radius: 0; height: 100%; }
  .gallery.sg .nophoto-hero { flex: 1; border-radius: 0; }
  .sgwrap .counter { display: inline-flex; position: absolute; right: var(--s3); bottom: var(--s3); background: rgba(21,23,31,.8); color: var(--white); font-size: var(--fs-13); font-weight: 700; padding: 4px 10px; border-radius: 999px; }
  .sgwrap .allphotos { right: auto; left: var(--s3); min-height: 36px; }
  .hostcard { grid-template-columns: auto minmax(0, 1fr); }
  .rules { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .rules dd + dt { margin-top: var(--s3); }
  /* one table for all widths: on the phone each room type becomes a stacked card */
  .stay-rooms table.rooms { display: block; border: 0; border-radius: 0; overflow: visible; }
  .stay-rooms table.rooms thead { display: none; }
  .stay-rooms table.rooms tbody.rtg { display: block; border: 1px solid var(--line); border-radius: var(--r); padding: var(--s4); margin-bottom: var(--s3); background: var(--white); }
  .stay-rooms table.rooms tr { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s3); align-items: center; }
  .stay-rooms table.rooms tr + tr { border-top: 1px solid var(--line); padding-top: var(--s3); margin-top: var(--s3); }
  .stay-rooms table.rooms td { display: block; border: 0; padding: 0; }
  .stay-rooms table.rooms td + td { border-left: 0; }
  .stay-rooms table.rooms tbody.rtg + tbody.rtg tr:first-child td { border-top: 0; }
  .stay-rooms table.rooms td.rt { width: 100%; order: 0; }
  .stay-rooms table.rooms .rt .photo, .stay-rooms .nophoto-room { height: 160px; }
  .stay-rooms table.rooms td.sl { width: 100%; order: 0; display: flex; gap: var(--s2); align-items: center; }
  .stay-rooms table.rooms td.sl .sleeps-n { margin: 0; }
  .stay-rooms table.rooms td.rate-price { flex: 1 1 0; order: 1; }
  .stay-rooms table.rooms td.sel { order: 2; }
  .stay-rooms table.rooms td.choices { width: 100%; order: 3; }
  .stay-rooms table.rooms td.soldout { width: 100%; order: 1; }
  .stay-rooms table.rooms tr.picked { background: var(--wine-soft); margin-left: calc(-1 * var(--s4)); margin-right: calc(-1 * var(--s4)); padding: var(--s3) var(--s4); }
  .stay-rooms table.rooms tr.picked td.rate { background: none; }
  .stay-rooms table.rooms tr.picked:first-child { margin-top: var(--s3); }
  .stay-rooms table.rooms .select { width: 84px; min-height: 44px; }
  .simgrid { grid-template-columns: minmax(0, 1fr); }
  .photogrid { grid-template-columns: minmax(0, 1fr); }
  .viewer-fig { padding: 0 0 var(--s4); }
  .viewer-prev, .viewer-next { top: auto; bottom: var(--s4); transform: none; }
}
