/* details.css - the listing dialog (details.js) in the blue / yellow / white palette.
   Uses the site tokens (--brand, --ink, --gold, --goldink, --line, --card), so the
   dark Discover page (body.dark) gets a matching dark version. */

#dlg {
  border: 0;
  box-shadow: 0 24px 70px rgba(5, 20, 60, 0.45);
  scrollbar-width: thin;
  scrollbar-color: var(--gold) transparent;
  overscroll-behavior: contain;
}
#dlg::-webkit-scrollbar {
  width: 8px;
}
#dlg::-webkit-scrollbar-thumb {
  background: var(--gold);
  border-radius: 9px;
}

/* close button: first child + sticky, so it stays at the top while the dialog scrolls */
#dlg .dlg-x {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: grid;
  place-items: center;
  margin: 12px 12px -46px auto; /* overlap the hero instead of pushing it down */
  width: 34px;
  height: 34px;
  background: #fff;
  color: var(--brand);
  border: 2px solid var(--gold);
  border-radius: 50%;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 4px 14px rgba(5, 20, 60, 0.3);
  cursor: pointer;
  transition:
    transform 0.15s,
    background 0.15s;
}
#dlg .dlg-x:hover {
  background: var(--gold);
  color: var(--goldink);
  transform: rotate(90deg);
}
#dlg .dlg-x:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* hero: photo gallery on a deep blue base (shown while the photo loads) with a gold edge */
.dlg-hero {
  height: 240px;
  display: block;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 85% 15%, rgba(255, 200, 61, 0.35), transparent 45%),
    linear-gradient(135deg, #0a47a9, #0a2f73);
  border-bottom: 4px solid var(--gold);
}
@media (max-width: 520px) {
  .dlg-hero {
    height: 200px;
  }
}
.dlg-gal {
  position: absolute;
  inset: 0;
}
.dlg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  user-select: none;
}
.dlg-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(10, 47, 115, 0.45),
    transparent 32%,
    transparent 55%,
    rgba(10, 30, 80, 0.85)
  );
  pointer-events: none;
}
.dlg-type {
  position: absolute;
  left: 16px;
  top: 14px;
  z-index: 2;
  background: var(--gold);
  color: var(--goldink);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 99px;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
.dlg-area {
  position: absolute;
  left: 16px;
  top: 46px;
  z-index: 2;
  background: rgba(255, 255, 255, 0.92);
  color: var(--brand);
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
}
.dlg-cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  margin: 0;
  padding: 22px 16px 10px;
  color: #fff;
  font-size: 12px;
  line-height: 1.4;
}
.dlg-cap b {
  font-size: 13px;
}
.dlg-cap a {
  color: #ffe08a;
  font-weight: 600;
}
.dlg-count {
  float: right;
  opacity: 0.85;
}
.dlg-nav {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  z-index: 3;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: rgba(255, 255, 255, 0.9);
  color: var(--brand);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding-bottom: 3px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
  transition: background 0.15s;
}
.dlg-nav:hover {
  background: var(--gold);
  color: var(--goldink);
}
.dlg-nav:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}
.dlg-prev {
  left: 12px;
}
.dlg-next {
  right: 12px;
}
.dlg-dots {
  position: absolute;
  left: 50%;
  translate: -50% 0;
  bottom: 46px;
  z-index: 2;
  display: flex;
  gap: 6px;
}
.dlg-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
}
.dlg-dots i.on {
  background: var(--gold);
  width: 18px;
  border-radius: 9px;
}

/* photos on listing cards (Rooms) and swipe cards (Discover) */
.card .ph,
.sw .ph {
  overflow: hidden;
}
.ph-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
  transition: transform 0.4s ease;
}
.card:hover .ph-img {
  transform: scale(1.04);
}
.ph .tag,
.ph .ver,
.ph .pct {
  z-index: 2;
}
.ph-label {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 2;
  max-width: calc(100% - 16px);
  background: rgba(10, 47, 115, 0.78);
  color: #fff;
  font-size: 10.5px;
  line-height: 1.3;
  padding: 3px 9px;
  border-radius: 99px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ph-label b {
  color: var(--gold);
}
.sw .ph-label {
  max-width: 60%;
} /* leave room for the match badge on Discover */
@media (prefers-reduced-motion: reduce) {
  .ph-img {
    transition: none;
  }
  .card:hover .ph-img {
    transform: none;
  }
}

/* body */
.dlg-body {
  gap: 16px;
  padding: 20px 22px 22px;
}
.dlg-title h2 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 26px;
  line-height: 1.15;
}
.dlg-price {
  justify-self: start;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  background: var(--gold);
  color: var(--goldink);
  padding: 6px 16px;
  border-radius: 99px;
  font:
    800 19px "Bricolage Grotesque",
    sans-serif;
  box-shadow: 0 3px 0 #b88a00;
}
.dlg-price .np,
.dlg-price small {
  color: inherit;
  font:
    700 14px Figtree,
    system-ui,
    sans-serif;
}
.dlg-desc {
  margin: 0;
  line-height: 1.55;
}

/* fact tiles */
.dlg-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 520px) {
  .dlg-facts {
    grid-template-columns: 1fr;
  }
}
.dlg-fact {
  display: grid;
  gap: 4px;
  align-content: start;
  background: #f3f7fe;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
}
.dlg-wide {
  grid-column: 1 / -1;
}
.dlg-k {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand);
}
.dlg-k::before {
  content: "";
  width: 14px;
  height: 4px;
  border-radius: 9px;
  background: var(--gold);
}
.dlg-k2 {
  margin-top: 8px;
}
.dlg-fact .chips {
  gap: 6px;
}
.dlg-fact .chip {
  cursor: default;
  background: #fff;
  border-color: #c9daf5;
  color: var(--ink);
}
.dlg-fact a {
  font-weight: 600;
}

/* nearby section inside the dialog: same palette */
.dlg-body .nb {
  border-top: 2px solid var(--line);
  padding-top: 16px;
}
.dlg-body .nb-head h3 {
  color: var(--ink);
}
.dlg-body .nb-map {
  border: 2px solid var(--line);
  box-shadow: 0 6px 18px rgba(10, 47, 115, 0.12);
}
.dlg-body .nb-chip[aria-pressed="true"] {
  border-color: var(--brand);
  background: #eef4fd;
  font-weight: 600;
}
.dlg-body .nb-chip:hover {
  border-color: var(--gold);
}
.dlg-body .nb-cat h4 {
  color: var(--ink);
}

/* dark Discover page */
body.dark .dlg-fact {
  background: rgba(255, 255, 255, 0.05);
}
body.dark .dlg-fact .chip {
  background: transparent;
  border-color: var(--line);
  color: #fff;
}
body.dark .dlg-k {
  color: var(--gold);
}
body.dark .dlg-body .nb-chip[aria-pressed="true"] {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--gold);
}
body.dark .dlg-body .nb-name {
  color: #9cc3ff;
}
body.dark .dlg-fact a,
body.dark .nb a {
  color: #9cc3ff;
}

/* ---------- comments (shared/js/listings/comments.js) ---------- */
.cm {
  display: grid;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 4px;
}
.cm-head {
  display: grid;
  gap: 2px;
}
.cm-head h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 18px;
}
.cm-head h3 .ic {
  width: 19px;
  height: 19px;
  color: var(--brand);
}
.cm-n:not(:empty) {
  font:
    700 12px Figtree,
    system-ui,
    sans-serif;
  padding: 2px 9px;
  border-radius: 99px;
  background: var(--gold);
  color: var(--goldink);
}
.cm .sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.cm-av {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font:
    800 15px Figtree,
    system-ui,
    sans-serif;
  color: #fff;
  background: hsl(var(--h, 215) 62% 42%);
}

/* write box */
.cm-form {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.cm-form > .meta {
  margin: 0;
}
.cm-field {
  flex: 1;
  min-width: 0;
  display: grid;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfdff;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.cm-field:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(255, 200, 61, 0.35);
}
.cm-field textarea {
  width: 100%;
  min-height: 46px;
  resize: none;
  border: 0;
  background: none;
  padding: 12px 14px 4px;
  font:
    500 14.5px/1.45 Figtree,
    system-ui,
    sans-serif;
  color: var(--ink);
  box-sizing: border-box;
}
.cm-field textarea:focus {
  outline: none;
}
.cm-field textarea::placeholder {
  color: var(--mute);
  opacity: 0.8;
}
.cm-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 8px 14px;
}
.cm-left {
  font-size: 12px;
}
.cm-left.warn {
  color: #b7791f;
  font-weight: 600;
}
.cm-bar .btn {
  border-radius: 99px;
  padding: 7px 18px;
}
.cm-bar .btn:disabled {
  opacity: 0.45;
  cursor: default;
}

/* list */
.cm-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.cm-it {
  display: flex;
  gap: 12px;
  padding: 12px 10px;
  margin: 0 -10px;
  border-radius: 12px;
  transition: background 0.2s;
}
.cm-it:hover {
  background: rgba(127, 160, 220, 0.08);
}
.cm-it.cm-new {
  animation: cmNew 1.6s ease;
}
@keyframes cmNew {
  0% {
    background: rgba(255, 200, 61, 0.35);
  }
  100% {
    background: transparent;
  }
}
.cm-main {
  flex: 1;
  min-width: 0;
}
.cm-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 14px;
}
.cm-top time {
  font-size: 12px;
  color: var(--mute);
}
.cm-you {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 1px 7px;
  border-radius: 99px;
  background: #eef4fd;
  color: var(--brand);
}
.cm-del {
  margin-left: auto;
  border: 0;
  background: none;
  padding: 2px 6px;
  border-radius: 6px;
  font:
    600 12px Figtree,
    system-ui,
    sans-serif;
  color: var(--mute);
  cursor: pointer;
  opacity: 0;
  transition:
    opacity 0.15s,
    color 0.15s,
    background 0.15s;
}
.cm-it:hover .cm-del,
.cm-del:focus-visible,
.cm-del.sure {
  opacity: 1;
}
.cm-del:hover,
.cm-del.sure {
  color: #c53030;
  background: rgba(229, 62, 62, 0.1);
}
@media (hover: none) {
  .cm-del {
    opacity: 1;
  }
}
.cm-text {
  margin: 3px 0 0;
  font-size: 14.5px;
  line-height: 1.5;
  white-space: pre-line;
  overflow-wrap: anywhere;
  color: var(--ink);
}
.cm-empty {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  font-size: 14px;
  color: var(--mute);
}
.cm-empty .ic {
  width: 22px;
  height: 22px;
  flex: none;
  color: var(--brand);
  opacity: 0.7;
}
.cm-empty b {
  color: var(--ink);
}
.cm-note {
  margin: 0;
  font-size: 12px;
}
@media (prefers-reduced-motion: reduce) {
  .cm-it.cm-new {
    animation: none;
  }
}

body.dark .cm-field {
  background: rgba(255, 255, 255, 0.04);
}
body.dark .cm-head h3 .ic,
body.dark .cm-empty .ic {
  color: var(--gold);
}
body.dark .cm-you {
  background: rgba(255, 200, 61, 0.14);
  color: var(--gold);
}
body.dark .cm-left.warn {
  color: #ffd76a;
}
body.dark .cm-del:hover,
body.dark .cm-del.sure {
  color: #ff8a8a;
}

/* ---------- reference number (utils.js refHTML) ---------- */
.ref {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--mute);
}
.ref code {
  font:
    700 12px ui-monospace,
    "Cascadia Mono",
    Consolas,
    monospace;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 6px;
}
.ref-cp {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: none;
  color: var(--mute);
  cursor: pointer;
}
.ref-cp .ic {
  width: 15px;
  height: 15px;
}
.ref-cp:hover,
.ref-cp:focus-visible {
  color: var(--brand);
  border-color: var(--line);
  background: var(--bg);
  outline: none;
}

/* ---------- room photos: their own section, apart from the cover in the header ---------- */
.dlg-rooms {
  display: grid;
  gap: 10px;
}
.dlg-rooms-h {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dlg-rooms-n {
  font-size: 11px;
  font-weight: 800;
  padding: 1px 8px;
  border-radius: 99px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--mute);
}
.rp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 8px;
}
.rp {
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--bg);
  cursor: zoom-in;
  transition:
    transform 0.15s,
    box-shadow 0.15s,
    border-color 0.15s;
}
.rp img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.rp:hover,
.rp:focus-visible {
  transform: translateY(-2px);
  border-color: var(--gold);
  box-shadow: 0 8px 18px rgba(10, 47, 115, 0.14);
  outline: none;
}
.dlg-rooms-none {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: 12px;
}
.dlg-rooms-none .ic {
  width: 18px;
  height: 18px;
  flex: none;
}

/* full-size room photo viewer (a second modal over the listing dialog) */
.rp-view {
  width: min(960px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: #0b1630;
  color: #fff;
  overflow: hidden;
}
.rp-view::backdrop {
  background: rgba(5, 12, 28, 0.78);
}
.rp-view figure {
  margin: 0;
  display: grid;
}
.rp-view img {
  width: 100%;
  max-height: calc(100dvh - 100px);
  object-fit: contain;
  display: block;
  background: #000;
}
.rp-view figcaption {
  padding: 10px 16px;
  font-size: 13px;
  color: #c9d6f0;
}
.rp-view figcaption a {
  color: inherit;
}
.rp-x {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: rgba(255, 255, 255, 0.92);
  color: var(--brand);
  cursor: pointer;
}
.rp-x .ic {
  width: 18px;
  height: 18px;
}

/* ---------- price + "Inquire now" (details.js inquireBtn) ---------- */
.dlg-price-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.inq-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 99px;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(10, 71, 169, 0.25);
}
.inq-btn .ic {
  width: 18px;
  height: 18px;
}
/* the panel for places whose owner isn't on DormNamo: call, text, copy a ready message */
.inq {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 14px;
  background: #fffdf5;
}
.inq p {
  margin: 0;
  font-size: 14px;
}
.inq-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.inq-acts .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.inq-acts .ic {
  width: 16px;
  height: 16px;
}
.inq-msg {
  display: grid;
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.inq-msg textarea {
  font:
    500 14px/1.45 Figtree,
    system-ui,
    sans-serif;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  resize: vertical;
  background: #fff;
}
@media (max-width: 520px) {
  .inq-btn {
    flex: 1 1 100%;
    justify-content: center;
  }
}

/* ---------- opening and closing (details.js wraps showModal / close) ----------
   In: the dialog rises a little and fades in while the backdrop dims. Out (.closing): a quicker fade down.
   On phones it slides up from lower down, like a sheet. Transform and opacity only, so it stays smooth. */
@keyframes dlgIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes dlgOut {
  to {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
}
@keyframes dimIn {
  from {
    opacity: 0;
  }
}
@keyframes dimOut {
  to {
    opacity: 0;
  }
}
#dlg[open] {
  animation: dlgIn 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}
#dlg[open]::backdrop {
  animation: dimIn 0.26s ease;
}
#dlg.closing {
  animation: dlgOut 0.19s ease-in forwards;
  pointer-events: none;
}
#dlg.closing::backdrop {
  animation: dimOut 0.19s ease-in forwards;
}
@media (max-width: 760px) {
  @keyframes dlgUp {
    from {
      opacity: 0;
      transform: translateY(56px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
  @keyframes dlgDown {
    to {
      opacity: 0;
      transform: translateY(40px);
    }
  }
  #dlg[open] {
    animation-name: dlgUp;
    animation-duration: 0.34s;
  }
  #dlg.closing {
    animation-name: dlgDown;
  }
}
@media (prefers-reduced-motion: reduce) {
  #dlg[open],
  #dlg[open]::backdrop,
  #dlg.closing,
  #dlg.closing::backdrop {
    animation: none;
  }
}
