/* AQAR — responsive / mobile fixes (RTL, cards, typography) */

html {
  direction: rtl;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  text-align: right;
  overflow-x: hidden;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Numbers — LTR digits only (not whole price rows) */
.font-nums:not(.card-price):not(.property-price),
.stat-num,
.metric-value,
.bridge-stat span,
.map-item-num,
.map-pin-num span,
input[type="number"],
.price-amount {
  direction: ltr;
  unicode-bidi: isolate;
}

input[type="tel"] {
  direction: rtl;
  text-align: right;
  unicode-bidi: plaintext;
}

input[type="tel"]::placeholder {
  text-align: right;
}

.stat-num {
  display: inline-block;
}

/* Prevent clipped / split Arabic text on mobile */
body:not(.page-map) .section-label,
body:not(.page-map) .hero-eyebrow,
body:not(.page-map) .narrative-type,
body:not(.page-map) .brand-tagline,
body:not(.page-map) .footer-col .section-label {
  letter-spacing: 0 !important;
  text-transform: none !important;
  word-spacing: normal;
  white-space: normal;
}

body:not(.page-map) .display-hero,
body:not(.page-map) .display-md,
body:not(.page-map) .display-sm {
  letter-spacing: 0 !important;
}

/* Prevent clipped labels on small screens */
.section-label {
  letter-spacing: 0;
  word-break: normal;
  overflow-wrap: anywhere;
  line-height: 1.65;
}

.hero-eyebrow {
  letter-spacing: 0;
  max-width: 100%;
  white-space: normal;
}

.display-hero,
.display-md,
.display-sm {
  word-break: break-word;
  overflow-wrap: break-word;
}

/* ── Uniform property cards (mobile & tablet) ── */
.cards-grid,
.featured-scroll,
.catalog-grid {
  align-items: stretch;
}

.premium-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.premium-card .card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  flex: 1;
}

/* ── Universal card / property image fit ── */
.card-media,
.card-img-wrap,
.panel-prop-media,
.panel-index-thumb,
.record-cover-wrap {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #121216;
  flex-shrink: 0;
}

.card-media img,
.card-img-wrap img,
.panel-prop-media img,
.panel-index-thumb img,
.record-cover-wrap img,
.record-cover:not(.record-cover-empty) {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.card-img-wrap .img-placeholder,
.panel-prop-placeholder,
.panel-index-empty,
.record-cover-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  min-height: 0;
  font-family: var(--font-display, inherit);
  font-weight: 700;
  color: var(--gold, #d4af6a);
  opacity: .45;
  background: linear-gradient(145deg, rgba(255,255,255,.03), rgba(0,0,0,.35));
}

.premium-card .card-img-wrap {
  aspect-ratio: 4 / 3;
  width: 100%;
  overflow: hidden;
  flex-shrink: 0;
}

.premium-card.card-featured .card-img-wrap,
.card-featured .card-img-wrap {
  aspect-ratio: 16 / 10;
}

@media (max-width: 1023px) {
  .premium-card.card-featured .card-img-wrap,
  .card-featured .card-img-wrap {
    aspect-ratio: 4 / 3;
  }
}

.premium-card .card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.premium-card .card-content h3 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
  word-break: normal;
  overflow-wrap: anywhere;
}

@media (max-width: 767px) {
  .premium-card .card-content h3 {
    -webkit-line-clamp: 3;
    overflow: visible;
    display: block;
  }

  body:not(.page-map) .section-label::after {
    max-width: 100%;
  }

  .marquee-track span {
    letter-spacing: 0 !important;
  }

  .site-nav a,
  .footer-col a {
    white-space: normal;
  }
}

.premium-card .card-meta-row {
  margin-top: auto;
}

/* Featured hero card — same grid as others on mobile */
@media (max-width: 1023px) {
  .featured-grid,
  .lux-featured-grid {
    grid-template-columns: 1fr !important;
  }

  .featured-side {
    grid-template-columns: 1fr !important;
  }

  .featured-scroll {
    display: grid !important;
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .featured-scroll .premium-card,
  .featured-side .premium-card {
    min-width: 0 !important;
  }

  body:not(.page-map) .card-featured .card-content {
    position: relative !important;
    background: var(--surface-card, #0c0c10);
    padding: 1.15rem 1.25rem 1.35rem !important;
  }

  body:not(.page-map) .card-featured .card-img-wrap {
    aspect-ratio: 16 / 10 !important;
    min-height: 220px;
    max-height: 280px;
  }

  body:not(.page-map) .card-featured .card-content h3 {
    color: var(--foreground) !important;
    font-size: 1.05rem !important;
  }
}

@media (min-width: 480px) and (max-width: 767px) {
  .cards-grid,
  .catalog-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 479px) {
  .cards-grid,
  .catalog-grid {
    grid-template-columns: 1fr !important;
  }
}

/* Hero mobile */
@media (max-width: 767px) {
  .hero-inner {
    padding-top: calc(var(--header-h) + 0.5rem);
  }

  .hero-btns {
    flex-direction: column;
    width: 100%;
  }

  .hero-btns .btn {
    width: 100%;
  }

  .hero-trust {
    flex-direction: column;
    gap: 0.65rem;
  }

  .bridge-grid {
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.25rem !important;
  }

  .bridge-divider {
    width: 48px !important;
    height: 1px !important;
  }
}

/* Map page mobile */
@media (max-width: 899px) {
  body.page-map .map-page {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto 1fr;
    height: auto;
    min-height: calc(100dvh - var(--header-h));
  }

  body.page-map .map-filters {
    max-height: none;
    border-left: none;
    border-bottom: 1px solid var(--border);
  }

  body.page-map .map-main {
    min-height: 55vh;
  }

  body.page-map .map-preview {
    max-width: none;
    right: 0.75rem;
    left: 0.75rem;
  }

  .map-item-title {
    white-space: normal;
    text-align: right;
    direction: rtl;
  }
}

/* Property detail mobile */
@media (max-width: 899px) {
  .property-layout {
    grid-template-columns: 1fr !important;
  }

  body.page-property .property-info {
    position: static !important;
  }

  .specs-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  .lux-contact-wrap {
    grid-template-columns: 1fr !important;
  }
}

/* Catalog filters */
@media (max-width: 767px) {
  .filters-advanced {
    grid-template-columns: 1fr !important;
  }

  .filters-advanced .btn {
    width: 100%;
  }

  .catalog-stats-row {
    flex-direction: column;
  }

  .catalog-stat-pill {
    width: 100%;
  }
}

/* Header / nav mobile */
@media (max-width: 1023px) {
  .brand-name {
    max-width: 120px;
    font-size: 0.8rem;
  }

  .container {
    width: min(1280px, 94vw);
  }
}

/* Footer */
@media (max-width: 767px) {
  .footer-grid {
    grid-template-columns: 1fr !important;
    text-align: center;
  }

  .footer-btns,
  .head-actions {
    justify-content: center;
  }
}

/* Property uploaded video */
.property-video {
  width: 100%;
  border-radius: var(--radius);
  margin-top: 1rem;
  background: #000;
  max-height: 420px;
}

.property-video-wrap {
  margin-top: 1rem;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}

/* Panel hood map */
.hood-map-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.hood-map {
  height: min(420px, 55vh);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--p-border, rgba(255,255,255,.1));
  margin-bottom: 1rem;
}

.hood-map-hint {
  font-size: 0.8rem;
  color: var(--p-muted, #9ca3af);
  margin: 0 0 0.75rem;
}

@media (max-width: 768px) {
  .hood-map {
    height: min(320px, 45vh);
  }

  .panel-table {
    font-size: 0.75rem;
  }
}
