/* Styles for listings/templates/listings/room_list.html
   (moved out of an inline <style> block so browsers cache them). */

/* ===== Hero: Pretoria panorama behind the title; the search card
   floats over its bottom edge, then becomes the sticky bar on scroll. */
.rl-hero {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  min-height: 280px;
  display: flex;
  align-items: center;
  border-radius: 22px;
  overflow: hidden;
  background-color: #0b3a66;
  background-image:
    linear-gradient(180deg, rgba(6, 22, 45, 0.25) 0%, rgba(6, 22, 45, 0.55) 55%, rgba(6, 22, 45, 0.78) 100%),
    url("../../../images/hero-pretoria.d3c38c19550d.jpg");
  background-image:
    linear-gradient(180deg, rgba(6, 22, 45, 0.25) 0%, rgba(6, 22, 45, 0.55) 55%, rgba(6, 22, 45, 0.78) 100%),
    image-set(url("../../../images/hero-pretoria.7b0b2943c998.webp") type("image/webp"), url("../../../images/hero-pretoria.d3c38c19550d.jpg") type("image/jpeg"));
  background-size: cover;
  background-position: center 45%;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}
.rl-hero-inner {
  width: 100%;
  padding: 36px 32px 84px;
  text-align: center;
  color: #fff;
}
.rl-hero-title {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
}
.rl-hero-credit {
  position: absolute;
  right: 14px;
  top: 10px;
  font-size: 0.66rem;
  color: rgba(255, 255, 255, 0.7) !important;
  text-decoration: none;
}
.rl-hero-credit:hover { color: #fff !important; text-decoration: underline; }

/* December: fairy lights across the top of the photo
   (partials/_browse_festive.html, static/css/festive.css). Room above
   the title for the lights; a soft white wire, as real fairy lights read
   at night. The photo credit (a licence requirement) moves from the top
   corner, where the lights hang, to the photo's lower edge. */
.rl-hero--festive .rl-hero-inner { position: relative; z-index: 2; padding-top: 60px; }
.rl-hero.rl-hero--festive .fx-wire path { stroke: rgba(255, 255, 255, 0.4); }
.rl-hero--festive .rl-hero-credit { z-index: 3; top: auto; bottom: 70px; }

/* The search card overlaps the photo. Its size and position never
   change (no jump on scroll); once the page scrolls (.scrolled) the bar
   behind it turns solid, as before. */
.search-toolbar-wrapper {
  margin-top: -64px;
}
.search-toolbar-wrapper:not(.scrolled) {
  background: transparent;
  border-bottom: none;
  box-shadow: none;
}
.search-toolbar-wrapper .search-toolbar {
  max-width: 980px;
  padding: 18px 18px 6px;
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.18);
}
.search-toolbar-wrapper.scrolled .search-toolbar {
  box-shadow: none;
}
.rl-scam-warning {
  max-width: 980px;
  margin: 6px auto 18px;
  line-height: 1.45;
}
.rl-scam-warning a {
  margin-left: 4px;
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .rl-hero {
    min-height: 220px;
    border-radius: 18px;
    background-image:
      linear-gradient(180deg, rgba(6, 22, 45, 0.3) 0%, rgba(6, 22, 45, 0.6) 55%, rgba(6, 22, 45, 0.8) 100%),
      url("../../../images/hero-pretoria-mobile.3592807c94a8.webp");
    background-position: center;
  }
  .rl-hero-inner { padding: 26px 18px 76px; }
  .rl-hero--festive .rl-hero-inner { padding-top: 50px; padding-bottom: 86px; }
  .rl-hero--festive .rl-hero-credit { bottom: 62px; right: 12px; }
  .search-toolbar-wrapper { margin-top: -58px; }
  .search-toolbar-wrapper .search-toolbar { padding: 14px 12px 4px; margin: 0 8px; }
}

.search-toolbar {
  max-width: 1100px;
  margin: 0 auto 24px;
  transition: margin-bottom 0.2s ease;
}

.search-input,
.filter-input,
.filter-select {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  /* Without this the browser's default black text sat on the dark-mode
     background - typed searches were invisible on phones in dark mode. */
  color: var(--text);
  caret-color: var(--link);
  font-size: 16px; /* 16px+ stops iPhones zooming in on focus */
  transition: all 0.2s ease;
}
.search-input::placeholder,
.filter-input::placeholder {
  color: var(--text-muted);
  opacity: 1;
}
.search-input {
  -webkit-appearance: none;
  appearance: none;
}
.search-input::-webkit-search-cancel-button {
  display: none;
}

/* Live suggestions under the search box */
.search-suggest {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 60;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.18);
}
.search-suggest[hidden] {
  display: none;
}
.search-suggest-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
  font-size: 0.95rem;
}
.search-suggest-item[aria-selected="true"],
.search-suggest-item:hover {
  background: var(--card-sunken);
}
.search-suggest-icon {
  flex-shrink: 0;
  width: 22px;
  text-align: center;
}
.search-suggest-label {
  flex: 1;
  min-width: 0;
}
.search-suggest-count {
  flex-shrink: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.rl-understood {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  max-width: 1100px;
  margin: 0 auto 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.rl-understood .rl-chip {
  margin: 0;
}
.rl-suggestion a {
  color: var(--link);
  font-weight: 700;
}
.rl-areas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 4px 0 16px;
}
.rl-area-link {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
}
.rl-area-link:hover {
  border-color: var(--link);
}

.search-input:focus,
.filter-input:focus,
.filter-select:focus {
  outline: none;
  border-color: #0B6FBF;
  box-shadow: 0 0 0 4px rgba(11, 111, 191,.12);
}

.filter-toggle-btn {
  background: #0B6FBF;
  color: white;
  border: none;
  border-radius: 14px;
  padding: 14px 20px;
  font-weight: 700;
  cursor: pointer;
  transition: .2s;
}

.filter-toggle-btn:hover {
  transform: translateY(-1px);
  background: #002A5C;
}

.filter-panel {
  display: none;
  background: var(--card);
  border-radius: 20px;
  padding: 20px;
  border: 1px solid var(--border);
  box-shadow: 0 12px 30px rgba(0,0,0,.08);
  margin-bottom: 18px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
  gap: 14px;
  align-items: start;
}

.filter-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  /* spans the full width of the grid instead of squeezing into one column */
  grid-column: 1 / -1;
}

@media (max-width:768px) {
  .filter-toggle-btn {
    width: 100%;
  }

  .filter-grid {
    grid-template-columns: 1fr;
  }

  .filter-actions {
    flex-direction: column;
  }

  .filter-actions .btn-primary,
  .filter-actions .btn-secondary {
    width: 100%;
    text-align: center;
  }
}

/* ================= ACTIVE FILTER CHIPS =================
   Custom pills - the shared .badge class is position:absolute with no
   background by default (meant for photo-overlay badges), so a bare
   .badge here would render invisible/mispositioned. */
.rl-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.rl-chip {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  white-space: nowrap;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  background: #eef4fb;
  color: var(--link);
  border: 1px solid rgba(11, 111, 191, 0.16);
}

.rl-suggestion {
  max-width: 1000px;
  margin: 0 auto 20px;
  padding: 14px;
  border-radius: 14px;
  background: var(--dm-bg-eff6ff, #eff6ff);
  border: 1px solid #bfdbfe;
  font-weight: 700;
}

.rl-verified-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}
.rl-verified-check input { width: 18px; height: 18px; accent-color: #16a34a; }

/* ================= EMPTY STATE ================= */
.rl-empty {
  max-width: 1000px;
  margin: 40px auto;
  padding: 40px;
  text-align: center;
  background: var(--card);
  border-radius: 20px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}
.rl-empty-icon {
  font-size: 2.4rem;
  margin-bottom: 10px;
}
.rl-empty-title {
  margin: 0 0 10px;
}
.rl-empty-text {
  color: var(--text-muted);
  margin: 0 0 12px;
}
.rl-empty-tips {
  list-style: none;
  padding: 0;
  margin: 0;
  color: var(--text-muted);
}
.rl-empty-link {
  color: var(--link);
  font-weight: 700;
}
.rl-empty-cta {
  margin-top: 20px;
}

.rl-howto {
  position: relative;
  max-width: 980px;
  margin: -8px auto 14px;
  padding: 6px 36px 6px 10px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
}
.rl-howto[hidden] { display: none; }
.rl-howto-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.rl-howto-steps li + li::before {
  content: "›";
  margin: 0 8px;
  color: var(--link);
  font-weight: 800;
}
.rl-howto-close {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.rl-howto-close:hover { background: var(--card-sunken); color: var(--text); }
@media (max-width: 380px) {
  .rl-howto-steps { font-size: 0.74rem; }
  .rl-howto-steps li + li::before { margin: 0 5px; }
}

/* Classes that replaced inline style="" attributes */
.rl-search-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  align-items: center;
  flex-wrap: wrap;
}
.rl-search-field {
  flex: 1;
  position: relative;
  min-width: 280px;
}
.rl-search-input {
  padding-right: 55px;
}
.rl-search-btn {
  position: absolute;
  right: 6px;
  top: 6px;
  bottom: 6px;
  width: 42px;
  border: none;
  border-radius: 10px;
  background: #0B6FBF;
  color: white;
  cursor: pointer;
  font-size: 18px;
}

/* Phones held sideways (short screens): a shorter photo, and the search
   bar stays in the page instead of sticking, so the header and bar don't
   fill the whole screen. */
@media (max-height: 500px) and (orientation: landscape) {
  .rl-hero { min-height: 150px; }
  .rl-hero-inner { padding-top: 18px; padding-bottom: 70px; }
  .search-toolbar-wrapper { position: static; }
}
