/* ==========================================================================
   Room detail page (templates/room-detail.html)
   "Other rooms" cards come from home-rooms.css.
   ========================================================================== */

.room-page {
  --rd-ink: #171b24;
  --rd-body: #3b3f4a;
  --rd-muted: #676459;
  --rd-line: #e9e4d8;
  --rd-tint: #f7f5f0;
  --rd-primary: #1f2a44;
  --rd-primary-hover: #151d31;
  --rd-primary-soft: rgba(31, 42, 68, 0.08);
  --rd-gold: #b8903f;
  --rd-shadow: 0 1px 2px rgba(23, 27, 36, 0.04), 0 18px 40px -20px rgba(23, 27, 36, 0.25);

  color: var(--rd-muted);
}

.room-page .container {
  padding-left: calc(var(--bs-gutter-x) * 0.5);
  padding-right: calc(var(--bs-gutter-x) * 0.5);
}

/* ---------- Header ---------- */

.room-page .rd-head {
  padding: 2.25rem 0 1.5rem;
}

.rd-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
  font-size: 0.85rem;
}

.rd-crumbs li + li::before {
  content: "/";
  margin-right: 0.4rem;
  color: #cdc6b6;
}

.rd-crumbs a {
  color: var(--rd-muted);
  text-decoration: none;
}

.rd-crumbs a:hover {
  color: var(--rd-primary);
}

.rd-head h1 {
  margin-bottom: 0.75rem;
  color: var(--rd-ink);
  font-size: clamp(1.9rem, 1.3rem + 2.2vw, 2.9rem);
  line-height: 1.12;
  letter-spacing: 0;
}

.rd-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--rd-ink);
  font-size: 0.95rem;
}

.rd-facts i {
  margin-right: 0.4rem;
  color: var(--rd-gold);
}

/* ---------- Gallery mosaic ---------- */

.rd-gallery {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: repeat(2, clamp(9rem, 17vw, 14rem));
  gap: 0.6rem;
  margin: 0 0 3rem;
  padding: 0;
  list-style: none;
}

.rd-gallery > li:first-child {
  grid-row: span 2;
}

/* 1-2 photos: simpler layouts */
.rd-gallery.is-1 { grid-template-columns: 1fr; grid-template-rows: clamp(16rem, 38vw, 30rem); }
.rd-gallery.is-2 { grid-template-columns: 2fr 1fr; }
.rd-gallery.is-2 > li:last-child { grid-row: span 2; }
.rd-gallery.is-3 { grid-template-columns: 2fr 1fr; }

.rd-tile {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 1rem;
  background: var(--rd-tint);
  color: #fff;
  text-decoration: none;
}

.rd-gallery > li:first-child .rd-tile {
  border-radius: 1.5rem 1rem 1rem 1.5rem;
}

.rd-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.rd-tile:hover img {
  transform: scale(1.04);
}

.rd-more {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(10, 14, 23, 0.55);
  font-weight: 600;
}

.rd-all {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--rd-ink);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 8px 20px -10px rgba(23, 27, 36, 0.5);
}

.rd-noimage {
  display: grid;
  place-items: center;
  height: 18rem;
  margin-bottom: 3rem;
  border-radius: 1.5rem;
  background: var(--rd-tint);
}

/* ---------- Content ---------- */

.rd-section + .rd-section {
  margin-top: 2.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--rd-line);
}

.rd-section h2 {
  margin-bottom: 1.1rem;
  color: var(--rd-ink);
  font-size: 1.4rem;
}

.rd-desc {
  color: var(--rd-body);
  font-size: 1.05rem;
  line-height: 1.85;
}

.rd-desc > * + * {
  margin-top: 1.1em;
}

.rd-desc p {
  margin-bottom: 0;
}

.rd-desc strong {
  color: var(--rd-ink);
}

.rd-highlights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rd-highlights li {
  padding: 1.1rem;
  border-radius: 1rem;
  background: var(--rd-tint);
  color: var(--rd-muted);
  font-size: 0.85rem;
}

.rd-highlights i {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--rd-gold);
  font-size: 1.3rem;
}

.rd-highlights strong {
  display: block;
  color: var(--rd-ink);
  font-size: 1rem;
}

.rd-amenities {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rd-amenities li {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  color: var(--rd-ink);
  font-weight: 500;
}

.rd-amenities i {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.75rem;
  background: var(--rd-primary-soft);
  color: var(--rd-primary);
}

.rd-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rd-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  border: 1px solid var(--rd-line);
  border-radius: 999px;
  color: var(--rd-ink);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.rd-links a:hover {
  border-color: var(--rd-primary);
  color: var(--rd-primary);
}

.rd-links i {
  color: var(--rd-gold);
}

/* ---------- Booking card ---------- */

.rd-book {
  position: sticky;
  top: 6.5rem;
  padding: 1.5rem;
  border: 1px solid var(--rd-line);
  border-radius: 1.5rem;
  background: #fff;
  box-shadow: var(--rd-shadow);
}

.rd-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.6rem;
  margin-bottom: 0.2rem;
  color: var(--rd-ink);
}

.rd-price strong {
  font-family: var(--bs-heading-font-family, "Playfair Display", Georgia, serif);
  font-size: 2rem;
  line-height: 1;
}

.rd-price s {
  color: #a7a194;
}

.rd-save {
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #e2c27a, #b8903f);
  color: #1c1608;
  font-size: 0.75rem;
  font-weight: 700;
}

.rd-per {
  margin-bottom: 1.25rem;
  font-size: 0.85rem;
}

.rd-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  border: 1px solid var(--rd-line);
  border-radius: 1rem;
}

.rd-field {
  padding: 0.65rem 0.85rem;
}

.rd-field + .rd-field {
  border-left: 1px solid var(--rd-line);
}

.rd-field.is-wide {
  grid-column: 1 / -1;
  border-left: 0;
  border-top: 1px solid var(--rd-line);
}

.rd-field label {
  display: block;
  margin: 0;
  color: var(--rd-muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rd-field input,
.rd-field select {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--rd-ink);
  font-size: 0.95rem;
  font-weight: 600;
  outline: none;
}

.rd-field:focus-within {
  background: var(--rd-tint);
}

.rd-estimate {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 1rem 0 0;
  font-size: 0.92rem;
}

.rd-estimate strong {
  color: var(--rd-ink);
}

.room-page .rd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: 1.1rem;
  padding: 0.95rem 1.25rem;
  border: 0;
  border-radius: 999px;
  background: var(--rd-primary);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 14px 30px -12px rgba(31, 42, 68, 0.85);
  transition: background-color 0.2s ease;
}

.room-page .rd-btn:hover {
  background: var(--rd-primary-hover);
  color: #fff;
}

.rd-note {
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
  text-align: center;
}

.rd-ask {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rd-line);
  color: var(--rd-ink);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.rd-ask i {
  color: #1fa855;
}

.rd-ask:hover {
  color: var(--rd-primary);
}

/* ---------- Other rooms ---------- */

.room-page .rd-others {
  padding: 5rem 0 5rem !important;
}

.room-page .rd-others h2 {
  color: var(--rd-ink);
}

.room-page a:focus-visible,
.room-page button:focus-visible {
  outline: 2px solid var(--rd-primary);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .room-page * {
    transition: none !important;
  }
}

@media (max-width: 991.98px) {
  .rd-book {
    position: static;
  }
}

@media (max-width: 767.98px) {
  .rd-gallery,
  .rd-gallery.is-2,
  .rd-gallery.is-3 {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 14rem 7.5rem;
    gap: 0.4rem;
  }

  .rd-gallery > li:first-child {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .rd-gallery.is-2 > li:last-child {
    grid-row: auto;
    grid-column: 1 / -1;
  }

  /* phones: show the big photo + 2 small, the rest via "+N" */
  .rd-gallery > li:nth-child(n + 4) {
    display: none;
  }

  .rd-gallery > li:first-child .rd-tile {
    border-radius: 1.1rem;
  }

  .rd-highlights {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575.98px) {
  .rd-amenities {
    grid-template-columns: 1fr;
  }
}

/* 4 photos: last one spans the two small columns so no cell is empty */
@media (min-width: 768px) {
  .rd-gallery.is-4 > li:nth-child(4) {
    grid-column: span 2;
  }
}
