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

/* ===================================================================
   PREMIUM ROOM CARDS
   Signature element: the price tag overlapping the photo's corner -
   like a real tag clipped onto the room, instead of price sitting as
   plain text below the image (the default every listing site uses).
   All original classes/data-attributes kept alongside these for
   slider JS and any other existing logic - this only adds a new
   visual layer, explicit enough to override without needing to know
   what the old CSS does.
   =================================================================== */

.rc-card,
.room-card.rc-card {
  display: block !important;
  gap: 0 !important;
  height: auto !important;
  position: relative;
  background: var(--card);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
  border: 1px solid var(--border);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.rc-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
}
/* Applied by static/js/room-card.js only to cards that land via the
   "Browse More" AJAX pagination, not the first page's cards - a
   subtle staggered rise instead of new results just popping in. */
.rc-card.rc-card-enter {
  animation: rc-card-in 0.42s ease both;
}
@keyframes rc-card-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .rc-card.rc-card-enter {
    animation: none;
  }
}
/* Hover feedback does nothing for the touch devices most of our
   traffic is on - this gives tapping a card the same "it responded to
   me" feel a hover gives a mouse user. */
.rc-card:active {
  transform: scale(0.985);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.1);
}

.rc-media,
.room-media.rc-media {
  position: relative;
  width: 100%;
  height: 0 !important;
  padding-bottom: 75% !important; /* 4:3 ratio via the classic padding trick -
    works on every browser ever made, unlike aspect-ratio which is
    newer CSS. Given today's track record of real bugs on real
    phones, not taking the chance here. */
  margin: 0 !important;
  background: var(--card-sunken);
  /* deliberately NO overflow:hidden here - this wrapper needs to let
     the price tag hang below the photo without being clipped. Only
     .rc-media-clip (below) clips, and only around the slider. */
}
.rc-media-clip {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  overflow: hidden;
  border-radius: 22px 22px 0 0;
}
.rc-slider-shell {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100%;
  height: 100%;
}
.rc-image-slider {
  display: flex;
  width: 100%;
  height: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
}
.rc-img,
.image-slider .rc-img,
.rc-image-slider .rc-img {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  flex: none;
  flex-shrink: 0;
  scroll-snap-align: start;
  object-fit: cover !important;
  transition: transform 0.4s ease, opacity 0.35s ease;
}
.rc-card:hover .rc-img {
  transform: scale(1.045);
}
/* Progressive enhancement only - rc-img-loading is added by JS right
   before an image starts loading (see static/js/room-card.js) and
   always removed on load/error. If JS never runs, images simply
   never get this class and stay fully visible - no risk of a photo
   being stuck invisible. */
.rc-img.rc-img-loading {
  opacity: 0;
}

.rc-slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  /* 30px read as fiddly to tap accurately on a real phone - a
     photo-carousel arrow that's easy to miss just means an
     accidental tap on the card underneath instead. */
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
  flex-shrink: 0;
}
.rc-slider-prev { left: 10px; }
.rc-slider-next { right: 10px; }

/* .slider-dots removed entirely - was position:absolute in both my
   CSS and base.css, so it was never actually the cause of the gap,
   but removed per request since it's no longer used. */


/* ===== Landlord verification (photo, top-left) =====
   The first-glance trust signal and the only badge on the photo. The
   shared badge (partials/_verified_badge.html) on a frosted chip, so
   it reads on bright and dark pictures alike. */
.rc-verify {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 4;
  line-height: 0;
}
.rc-verify .vbadge {
  height: 26px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.18);
}
.rc-verify .vbadge--no { color: #475569; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .rc-verify .vbadge { background: rgba(15, 23, 42, 0.78); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35); }
  :root:not([data-theme="light"]) .rc-verify .vbadge--no { color: #cbd5e1; }
}
:root[data-theme="dark"] .rc-verify .vbadge { background: rgba(15, 23, 42, 0.78); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35); }
:root[data-theme="dark"] .rc-verify .vbadge--no { color: #cbd5e1; }

/* ===== Room status tag (beside the price) =====
   At most one: Featured (paid - navy + gold, so it never looks like a
   trust signal) > Popular > New. */
.rc-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px 0 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  color: var(--text);
  background: var(--card-sunken);
  box-shadow: inset 0 0 0 1px var(--border);
}
.rc-tag svg { width: 12px; height: 12px; flex: none; }
.rc-tag--popular {
  color: var(--dm-fg-9a3412, #9a3412);
  background: var(--dm-bg-fff7ed, #fff7ed);
  box-shadow: inset 0 0 0 1px rgba(234, 88, 12, 0.22);
}
.rc-tag--popular svg { fill: #ea580c; }
.rc-tag--featured {
  color: #FFD166;
  background: #002A5C;
  box-shadow: none;
}
.rc-tag--featured svg { fill: #FFD166; }
.rc-tag-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #16a34a;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.18);
}

/* ===== Save / favorite heart ===== */
.rc-fav-btn {
  position: absolute !important;
  top: 10px !important;
  right: 10px !important;
  z-index: 4;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(15, 23, 42, 0.38);
  backdrop-filter: blur(4px);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s ease, background 0.15s ease;
}
.rc-fav-btn:hover {
  background: rgba(15, 23, 42, 0.55);
}
.rc-fav-btn:active {
  transform: scale(0.9);
}
.rc-fav-icon path {
  transition: fill 0.15s ease, stroke 0.15s ease;
}
.rc-fav-btn.rc-fav-active {
  background: var(--dm-bg-glass, rgba(255, 255, 255, 0.92));
}
.rc-fav-btn.rc-fav-active .rc-fav-icon path {
  fill: #ef4444;
  stroke: #ef4444;
}
.rc-fav-btn.rc-fav-pop {
  animation: rc-fav-pop 0.32s ease;
}
@keyframes rc-fav-pop {
  0% { transform: scale(1); }
  35% { transform: scale(1.28); }
  100% { transform: scale(1); }
}

/* ===== First row: price + landlord verification ===== */
.rc-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.rc-top-row .rc-price-chip { margin-bottom: 0 !important; }

/* ===== Signature: the price chip ===== */
/* Sits at the top of the info area, in normal flow - no longer
   overlapping the photo, since that looked like it was cutting into
   the room photos rather than reading as an intentional tag. */
.rc-price-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  background: linear-gradient(135deg, #0B6FBF, #002A5C);
  color: #fff;
  padding: 6px 14px;
  border-radius: 10px;
  box-shadow: 0 6px 14px rgba(11, 111, 191, 0.25);
  margin-bottom: 10px !important;
}
.rc-price-amount {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.2px;
}
.rc-price-period {
  font-size: 0.72rem;
  font-weight: 500;
  opacity: 0.85;
}

.rc-deposit-line {
  margin: -4px 0 10px;
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 600;
}
.rc-deposit-none {
  color: var(--success);
}

.rc-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.rc-info,
.room-info.rc-info {
  display: block !important;
  gap: 0 !important;
  padding: 16px 18px 16px !important;
  margin: 0 !important;
}

.rc-title {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rc-location {
  margin: 0 0 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ===== Landlord trust chips (Verified / Fast replies) =====
   About the landlord, not the photo - so they sit with the text,
   using theme tokens so they read in light and dark mode. */
.rc-trust-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  margin: -4px 0 10px;
}
/* Quiet text with an icon, not boxed chips: the Verified badge above
   is the trust signal that should stand out. */
.rc-trust-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
.rc-trust-row .rc-trust-chip + .rc-trust-chip::before {
  content: "·";
  margin: 0 4px 0 -1px;
  color: var(--text-muted);
}
.rc-trust-icon {
  width: 14px;
  height: 14px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.rc-trust-fast .rc-trust-icon { fill: #f59e0b; stroke: #f59e0b; }

.rc-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

/* Availability: a coloured dot + plain text (it used to be a filled
   green pill - one green badge too many next to Verified). */
.rc-status {
  flex-shrink: 0;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
}
.rc-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.rc-status-available .rc-status-dot { background: #16a34a; box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15); }
.rc-status-upcoming { color: var(--dm-fg-92400e, #92400e); }
.rc-status-upcoming .rc-status-dot { background: #d97706; box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15); }
.rc-status-occupied { color: var(--text-muted); }
.rc-status-occupied .rc-status-dot { background: #94a3b8; }

.rc-rating {
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  padding: 3px 8px;
  margin: -3px 0;
  border-radius: 999px;
  cursor: pointer;
  position: relative;
  z-index: 2;
}
.rc-rating:hover, .rc-rating:focus-visible { background: var(--dm-bg-fef3c7, #fef3c7); outline: none; }
.rc-rating-count { text-decoration: underline; text-underline-offset: 2px; }
.rc-rating-star {
  margin-right: 3px;
  color: #f59e0b;
}

.rc-rating-count {
  font-weight: 500;
  color: var(--text-muted);
}

.rc-posted {
  margin: 0;
  font-size: 0.74rem;
  color: var(--text-muted);
}

/* Footer CTA - explicit "click me" affordance so the card doesn't rely
   on visitors guessing the whole thing is clickable. Sits inside the
   same .rc-link anchor as the rest of the info block, so it's just a
   styled row rather than a second/nested link. */
.rc-cta {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.rc-cta-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  padding: 0 14px 0 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #0B6FBF, #00489a);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 800;
  box-shadow: 0 6px 16px rgba(11, 111, 191, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.rc-card:hover .rc-cta-btn,
.rc-link:focus-visible .rc-cta-btn {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(11, 111, 191, 0.32);
}
.rc-cta-icons {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
  font-size: 0.95rem;
  opacity: 0.95;
}
.rc-cta-arrow {
  font-size: 0.8rem;
  transition: transform 0.18s ease;
}
.rc-card:hover .rc-cta-arrow {
  transform: translateX(3px);
}
.rc-cta-note {
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-muted);
}
.rc-cta-note .fa-lock {
  margin-right: 3px;
  color: var(--link);
}
@media (prefers-reduced-motion: reduce) {
  .rc-cta-btn, .rc-cta-arrow { transition: none; }
}

@media (max-width: 480px) {
  .rc-info,
  .room-info.rc-info {
    display: block !important;
    gap: 0 !important;
    padding: 14px 14px 14px !important;
    margin: 0 !important;
  }
  .rc-title { font-size: 1rem; }
}
