:root {
  --primary: #2563EB;
  --primary-600: #1D4ED8;
  --primary-50: #EFF4FF;
  --accent: #FF9900;
  --success: #16A34A;
  --danger: #EF4444;
  --purple: #7C3AED;

  --bg: #FFFFFF;
  --bg-soft: #F6F7F9;
  --bg-card: #FFFFFF;
  --ink: #0F172A;
  --ink-soft: #475569;
  --ink-faint: #94A3B8;
  --border: #E7E9ED;
  --border-soft: #EEF0F3;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-md: 0 8px 24px -8px rgba(15, 23, 42, .10);
  --shadow-lg: 0 20px 48px -12px rgba(15, 23, 42, .16);
  --shadow-primary: 0 12px 28px -8px rgba(37, 99, 235, .35);

  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 22px;
  --r-xl: 24px;
  --r-full: 999px;

  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --t-fast: 160ms;
  --t-base: 280ms;
  --t-slow: 520ms;

  --nav-h: 72px;
  --container-pad: 12px;
  --max-width: 1200px;
  --font: 'Vazirmatn', system-ui, -apple-system, sans-serif;
}

[data-theme="dark"] {
  --bg: #0B1220;
  --bg-soft: #0E1626;
  --bg-card: #141B2D;
  --ink: #F1F5F9;
  --ink-soft: #AEB9CC;
  --ink-faint: #5E6B85;
  --border: #232E45;
  --border-soft: #1C2640;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-md: 0 8px 24px -8px rgba(0, 0, 0, .5);
  --shadow-lg: 0 24px 56px -16px rgba(0, 0, 0, .6);
  --primary-50: #16213A;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font);
  background: var(--bg-soft);
  color: var(--ink);
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background var(--t-base), color var(--t-base);
  line-height: 1.6;
  min-height: 100vh;
  /* ثابت کردن body برای جلوگیری از اسکرول افقی */
  width: 100%;
  max-width: 100vw;
}

img {
  max-width: 100%;
  display: block;
  object-fit: cover;
  height: auto;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  -webkit-tap-highlight-color: transparent;
}

a {
  text-decoration: none;
  color: inherit;
}

input {
  font-family: inherit;
}
svg {
  width: auto;
  height: auto;
  flex-shrink: 0;
}

.skip-link {
  position: absolute;
  right: -9999px;
  background: var(--primary);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--r-sm);
  z-index: 999;
}

.skip-link:focus {
  right: 12px;
  top: 12px;
}

:focus-visible {
  outline: 2.5px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* ============ PAGE LOADER ============ */
.page-loader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  transition: opacity .4s, visibility .4s;
}

.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-logo {
  width: 56px;
  height: 56px;
  color: var(--primary);
}

.loader-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============ HEADER ============ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid var(--border-soft);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

[data-theme="dark"] .app-header {
  background: rgba(11, 18, 32, .92);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px var(--container-pad);
  width: 100%;
  max-width: var(--max-width);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.page-title {
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
}

.header-badge {
  font-size: 8px;
  font-weight: 700;
  background: var(--primary-50);
  color: var(--primary);
  padding: 2px 7px;
  border-radius: var(--r-full);
  white-space: nowrap;
  display: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: auto;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--bg);
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  transition: all var(--t-fast);
  position: relative;
  flex-shrink: 0;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.icon-btn:active {
  background: var(--bg-soft);
  color: var(--ink);
}

.notification-badge {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.theme-toggle .icon-moon {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  display: block;
}

/* Search - Mobile First */
.search-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--bg-soft);
  border: 1.5px solid var(--border-soft);
  border-radius: var(--r-full);
  padding: 2px 4px;
  flex: 1 1 100%;
  min-width: 0;
  order: 1;
  transition: all var(--t-fast);
  height: 40px;
}

.search-bar:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-50);
}

.search-icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: transparent;
  display: grid;
  place-items: center;
  color: var(--primary);
  flex-shrink: 0;
}

.search-icon-btn svg {
  width: 16px;
  height: 16px;
}

.search-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  font-size: 12px;
  color: var(--ink);
  padding: 6px 2px;
}

.search-input::placeholder {
  color: var(--ink-faint);
}

.search-clear {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--border-soft);
  display: none;
  place-items: center;
  color: var(--ink-faint);
  flex-shrink: 0;
}

.search-clear svg {
  width: 10px;
  height: 10px;
}

.search-divider {
  width: 1px;
  height: 16px;
  background: var(--border-soft);
  flex-shrink: 0;
}

.location-icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: transparent;
  display: grid;
  place-items: center;
  color: var(--ink-faint);
  flex-shrink: 0;
}

.location-icon-btn svg {
  width: 14px;
  height: 14px;
}

/* Quick Filters */
.quick-filters {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 4px var(--container-pad) 8px;
  width: 100%;
  max-width: var(--max-width);
}

.quick-filters::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex-shrink: 0;
  padding: 5px 12px;
  border-radius: var(--r-full);
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-soft);
  color: var(--ink-soft);
  border: 1px solid var(--border-soft);
  transition: all var(--t-fast);
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.filter-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: var(--shadow-primary);
}

/* ============ MAIN LAYOUT ============ */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 8px var(--container-pad) 0;
  width: 100%;
}

.section {
  padding: 12px 0;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 6px;
}

.section-header-left {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.section-title {
  font-size: 15px;
  font-weight: 700;
}

.section-subtitle {
  font-size: 10px;
  color: var(--ink-faint);
}

.section-link {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary);
  padding: 4px 12px;
  border-radius: var(--r-full);
  transition: background var(--t-fast);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.section-link:active {
  background: var(--primary-50);
}

/* Fade In */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .5s ease, transform .5s ease;
}

.fade-in.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============ HERO SLIDER ============ */
.hero-section {
  padding-top: 4px;
}

.hero-slider {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  aspect-ratio: 8/3;
}

.hero-slides {
  position: relative;
  width: 100%;
  height: 100%;
}

.hero-slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1.04);
  transition: opacity .7s ease, transform .9s ease;
}

.hero-slide.is-active {
  opacity: 1;
  transform: scale(1);
  z-index: 2;
}

/*.hero-slide::after {*/
/*  content: '';*/
/*  position: absolute;*/
/*  inset: 0;*/
/*  background: linear-gradient(to top, rgba(0, 0, 0, .7) 0%, transparent 55%);*/
/*}*/

.hero-overlay-text {
  position: absolute;
  right: 12px;
  bottom: 40px;
  z-index: 3;
  color: #fff;
  pointer-events: none;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  background: var(--accent);
  color: #000;
  padding: 2px 8px;
  border-radius: var(--r-full);
  margin-bottom: 4px;
}

.hero-overlay-text h2 {
  font-size: 16px;
  font-weight: 800;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .3);
}

.hero-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 4px;
  z-index: 3;
}

.hero-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .4);
  transition: all var(--t-base);
  padding: 0;
  border: none;
}

.hero-dot.is-active {
  width: 16px;
  background: #fff;
}

.hero-progress {
  position: absolute;
  bottom: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  z-index: 5;
  transition: width 100ms linear;
}

/* ============ STATS BAR ============ */
.stats-bar {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 12px 8px;
  margin: 8px 0;
  background: var(--bg);
  border-radius: var(--r-lg);
  border: 1px solid var(--border-soft);
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  gap: 4px;
}

.stat-item {
  text-align: center;
  flex: 1;
  min-width: 50px;
}

.stat-number {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: var(--primary);
}

.stat-label {
  font-size: 9px;
  color: var(--ink-faint);
}

.stat-divider {
  width: 1px;
  height: 20px;
  background: var(--border-soft);
  flex-shrink: 0;
}

/* ============ HORIZONTAL SCROLL ============ */
.hscroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.hscroll::-webkit-scrollbar {
  display: none;
}

/* Property Card */
.property-card {
  scroll-snap-align: start;
  flex: 0 0 140px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--t-base);
  -webkit-tap-highlight-color: transparent;
}

.property-card:active {
  transform: scale(.97);
}

.property-media {
  position: relative;
  aspect-ratio: 1/1;
  overflow: hidden;
}

.property-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s;
}

.property-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .7) 0%, transparent 50%);
  z-index: 1;
}

.property-tag {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 8px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--r-full);
  z-index: 3;
  color: #fff;
}

.property-tag.hot {
  background: var(--danger);
}

.property-tag.new {
  background: var(--success);
}

.property-tag.economic {
  background: var(--accent);
  color: #000;
}

.property-tag.metaverse {
  background: var(--purple);
}

.fav-btn {
  position: absolute;
  top: 6px;
  left: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: transparent;
  display: grid;
  place-items: center;
  z-index: 3;
  color: #fff;
  transition: all var(--t-fast);
}

.fav-btn svg {
  width: 16px;
  height: 16px;
}

.fav-btn.is-active {
  color: red;
}

.fav-btn.is-active svg {
  fill: currentColor;
}

.fav-btn.pulse svg {
  animation: favPulse .4s ease;
}

@keyframes favPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.property-body {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 6px 8px;
  z-index: 2;
  color: #fff;
}

.property-title {
  font-size: 10px;
  font-weight: 700;
  margin-bottom: 1px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
  line-height: 1.3;
}

.property-loc {
  font-size: 8px;
  opacity: .85;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
  display: flex;
  align-items: center;
  gap: 2px;
}

.property-loc svg {
  width: 10px;
  height: 10px;
}

/* ============ VIDEO BANNER ============ */
.video-banner {
  position: relative;
  display: block;
  width: 100%;
  border-radius: var(--r-lg);
  overflow: hidden;
  aspect-ratio: 23/9;
  box-shadow: var(--shadow-md);
}

.video-banner-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform .6s;
}

.video-banner-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .35);
  z-index: 1;
}

.play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .95);
  display: grid;
  place-items: center;
  color: var(--primary);
  z-index: 2;
  animation: playPulse 2s ease-out infinite;
}

.play-btn svg {
  width: 20px;
  height: 20px;
}

@keyframes playPulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 255, 255, .5); }
  100% { box-shadow: 0 0 0 14px rgba(255, 255, 255, 0); }
}

.video-banner-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 12px;
  z-index: 2;
  background: linear-gradient(transparent, rgba(0, 0, 0, .7));
  color: #fff;
}

.video-banner-title {
  display: block;
  font-size: 13px;
  font-weight: 700;
}

.video-banner-desc {
  font-size: 9px;
  opacity: .75;
}

/* ============ STORIES ============ */
.stories-scroll {
  gap: 10px;
  padding: 4px 0 8px;
}

.story-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: transparent;
  flex-shrink: 0;
  scroll-snap-align: start;
  cursor: pointer;
  transition: transform 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.story-item:active {
  transform: scale(0.94);
}

.story-ring {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.story-ring-border {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--border-soft);
  z-index: 0;
  transition: all 0.3s ease;
}

.story-item.is-active .story-ring-border {
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}

.story-item--seen .story-ring-border {
  background: var(--border-soft);
}

.story-ring img {
  position: relative;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--bg);
  z-index: 1;
  background: var(--bg);
}

.story-label {
  font-size: 9px;
  font-weight: 500;
  color: var(--ink);
  text-align: center;
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}

/* Story Viewer - Full Screen */
.story-viewer {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  display: flex;
  flex-direction: column;
}

.story-viewer.is-open {
  opacity: 1;
  visibility: visible;
}

.story-viewer-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
  background: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.3) 60%, transparent 100%);
}

.story-viewer-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.story-viewer-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255,255,255,0.5);
}

.story-viewer-user-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.story-viewer-username {
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.story-viewer-time {
  font-size: 10px;
  color: rgba(255,255,255,0.8);
}

.story-viewer-actions {
  position: absolute;
  top: 12px;
  left: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.story-viewer-more,
.story-viewer-close-btn {
  background: none;
  border: none;
  color: #fff;
  padding: 4px;
  cursor: pointer;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

.story-viewer-more svg,
.story-viewer-close-btn svg {
  width: 20px;
  height: 20px;
}

.story-progress-container {
  display: flex;
  gap: 3px;
  padding: 10px 0 6px;
  width: 100%;
}

.story-progress-item {
  flex: 1;
  height: 2px;
  background: rgba(255,255,255,0.35);
  border-radius: 2px;
  overflow: hidden;
}

.story-progress-fill {
  height: 100%;
  background: #fff;
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s linear;
}

.story-progress-item.is-done .story-progress-fill {
  width: 100%;
}

.story-viewer-main {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.story-viewer-main img,
.story-viewer-main video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.story-viewer-main img.is-active,
.story-viewer-main video.is-active {
  opacity: 1;
}

.story-touch-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 35%;
  z-index: 5;
  background: transparent;
  border: none;
  cursor: pointer;
}

.story-touch-left { left: 0; }
.story-touch-right { right: 0; }

.story-viewer-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 10;
}

.story-reply-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(30,30,30,0.8);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 24px;
  padding: 6px 12px;
}

.story-reply-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 12px;
  outline: none;
  font-family: var(--font);
}

.story-reply-input::placeholder {
  color: rgba(255,255,255,0.5);
}

.story-reply-send {
  background: none;
  border: none;
  color: #fff;
  padding: 4px;
  cursor: pointer;
  opacity: 0.7;
}

.story-reply-send svg {
  width: 16px;
  height: 16px;
}

/* ============ ADVISOR CARDS ============ */
.advisor-card {
  scroll-snap-align: start;
  flex: 0 0 140px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--t-base);
  -webkit-tap-highlight-color: transparent;
}

.advisor-card:active {
  transform: scale(.97);
}

.advisor-media {
  position: relative;
  aspect-ratio: 1/1;
  overflow: hidden;
}

.advisor-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.advisor-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.7) 0%, transparent 50%);
  z-index: 1;
}

.advisor-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 8px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--r-full);
  z-index: 3;
  background: #10b981;
  color: #fff;
}

.advisor-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 6px 8px;
  z-index: 2;
  color: #fff;
}

.advisor-name {
  font-size: 10px;
  font-weight: 700;
  margin-bottom: 1px;
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
}

.advisor-role {
  font-size: 8px;
  opacity: .85;
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
}

/* ============ BLOG CARDS (HSCROLL) ============ */
.blog-card {
  scroll-snap-align: start;
  flex: 0 0 260px;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--t-base);
  -webkit-tap-highlight-color: transparent;
}

.blog-card:active {
  transform: scale(.97);
}

.blog-media {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
}

.blog-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.75) 0%, rgba(0,0,0,.1) 50%, transparent 70%);
  z-index: 1;
}

.blog-category {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 8px;
  font-weight: 700;
  background: rgba(255,255,255,.95);
  color: var(--primary);
  padding: 3px 8px;
  border-radius: var(--r-full);
  z-index: 3;
  backdrop-filter: blur(4px);
}

.blog-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 10px 12px;
  z-index: 2;
  color: #fff;
}

.blog-meta {
  display: flex;
  gap: 8px;
  font-size: 9px;
  opacity: .85;
  margin-bottom: 6px;
  align-items: center;
}

.blog-meta span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.blog-meta svg {
  width: 10px;
  height: 10px;
}

.blog-title {
  font-size: 13px;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0,0,0,.4);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============ AD BANNER ============ */
.ad-banner {
  position: relative;
  display: flex;
  border-radius: var(--r-lg);
  overflow: hidden;
  min-height: 90px;
  box-shadow: var(--shadow-md);
}

.ad-banner-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, var(--primary) 0%, #4F7CFB 30%, var(--accent) 100%);
  background-size: 200% 200%;
  animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.ad-banner-shine {
  position: absolute;
  top: -40%;
  right: -20%;
  width: 50%;
  height: 200%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.15), transparent);
  transform: rotate(6deg);
  animation: shine 4s ease-in-out infinite;
}

@keyframes shine {
  0% { transform: translateX(-50%) rotate(6deg); }
  50%, 100% { transform: translateX(250%) rotate(6deg); }
}

.ad-banner-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  color: #fff;
  width: 100%;
  gap: 8px;
  flex-wrap: wrap;
}

.ad-banner-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.ad-icon svg {
  width: 24px;
  height: 24px;
}

.ad-banner-texts {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.ad-banner-text {
  font-size: 11px;
  font-weight: 800;
}

.ad-banner-subtext {
  font-size: 9px;
  opacity: .8;
}

.ad-banner-cta {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: rgba(255,255,255,.95);
  color: var(--primary-600);
  font-size: 10px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--r-full);
  flex-shrink: 0;
  white-space: nowrap;
}

.ad-banner-cta svg {
  width: 10px;
  height: 10px;
}

/* ============ NEWSLETTER ============ */
.newsletter-card {
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  padding: 16px 14px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.newsletter-icon svg {
  width: 28px;
  height: 28px;
  margin-bottom: 8px;
}

.newsletter-content h3 {
  font-size: 13px;
  margin-bottom: 3px;
}

.newsletter-content p {
  font-size: 10px;
  color: var(--ink-soft);
  margin-bottom: 12px;
}

.newsletter-form {
  display: flex;
  gap: 4px;
  max-width: 300px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.newsletter-form input {
  flex: 1;
  min-width: 140px;
  padding: 8px 10px;
  border-radius: var(--r-full);
  border: 1.5px solid var(--border);
  background: var(--bg-soft);
  font-size: 11px;
}

.newsletter-form button {
  padding: 8px 14px;
  border-radius: var(--r-full);
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 11px;
  white-space: nowrap;
}
/* ============ MODAL ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8,12,24,.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transition: all var(--t-base);
}

.modal-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.modal-box {
  background: var(--bg);
  border-radius: var(--r-lg);
  width: 100%;
  max-width: 560px;
  box-shadow: 0 24px 60px rgba(0,0,0,.3);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-soft);
}

.modal-title {
  font-size: 13px;
  font-weight: 700;
}

.modal-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-soft);
  display: grid;
  place-items: center;
  color: var(--ink-soft);
}

.modal-close svg {
  width: 14px;
  height: 14px;
}

.modal-video-frame {
  aspect-ratio: 16/9;
  background: linear-gradient(160deg, #0F172A, #1E293B 60%, #0F172A);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: rgba(255,255,255,.6);
}

.modal-play-icon svg {
  width: 40px;
  height: 40px;
  opacity: .4;
}

.modal-video-note {
  font-size: 11px;
}

/* ============ TOAST ============ */
.toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: var(--bg);
  font-size: 11px;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--r-full);
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: all var(--t-base);
  z-index: 90;
  white-space: nowrap;
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============ BACK TO TOP ============ */
.back-to-top {
  position: fixed;
  bottom: calc(var(--nav-h) + 28px);
  left: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-primary);
  z-index: 55;
  opacity: 0;
  visibility: hidden;
  transition: all var(--t-base);
}

.back-to-top svg {
  width: 14px;
  height: 14px;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
}

/* ============ RESPONSIVE BREAKPOINTS ============ */

/* ≥ 360px */
@media (min-width: 360px) {
  .property-card { flex: 0 0 150px; }
  .advisor-card { flex: 0 0 150px; }
}

/* ≥ 400px */
@media (min-width: 400px) {
  .property-card { flex: 0 0 160px; }
  .advisor-card { flex: 0 0 160px; }
  .blog-card { flex: 0 0 280px; }
  .property-title { font-size: 11px; }
  .advisor-name { font-size: 11px; }
}

/* ≥ 480px */
@media (min-width: 480px) {
  :root { --container-pad: 16px; }
  
  .page-title { font-size: 18px; }
  .header-badge { display: inline-block; }
  
  .property-card { flex: 0 0 170px; }
  .advisor-card { flex: 0 0 170px; }
  .blog-card { flex: 0 0 300px; }
  
  .hero-slider { aspect-ratio: 21/9; }
  .hero-overlay-text { right: 14px; bottom: 44px; }
  .hero-overlay-text h2 { font-size: 18px; }
  
  .story-ring { width: 68px; height: 68px; }
  .story-ring img { width: 62px; height: 62px; }
  .story-label { font-size: 10px; max-width: 68px; }
  
  .section-title { font-size: 16px; }
  .stat-number { font-size: 15px; }
  .stat-label { font-size: 10px; }
}

/* Tablet (≥600px) */
@media (min-width: 600px) {
  :root { --container-pad: 20px; }
  
  .header-inner {
    flex-wrap: nowrap;
    gap: 12px;
    padding: 10px var(--container-pad);
  }
  
  .search-bar {
    flex: 0 1 260px;
    order: 0;
    height: 42px;
  }
  
  .hero-slider { aspect-ratio: 21/9; border-radius: var(--r-xl); }
  .hero-overlay-text { right: 18px; bottom: 48px; }
  .hero-overlay-text h2 { font-size: 22px; }
  .hero-eyebrow { font-size: 10px; }
  
  .property-card { flex: 0 0 190px; }
  .advisor-card { flex: 0 0 190px; }
  .blog-card { flex: 0 0 340px; }
  
  .story-ring { width: 76px; height: 76px; }
  .story-ring img { width: 70px; height: 70px; }
  .story-label { font-size: 11px; max-width: 76px; }
  
  .stats-bar { padding: 14px 12px; border-radius: var(--r-xl); }
  .stat-number { font-size: 16px; }
  .stat-divider { height: 24px; }
  
  .section { padding: 16px 0; }
  .section-title { font-size: 17px; }
  .section-subtitle { font-size: 11px; }
  
  .bottom-nav { max-width: 500px; }
  .nav-item { font-size: 10px; padding: 5px 12px; }
  .nav-item svg { width: 22px; height: 22px; }
  .nav-add-btn { width: 46px; height: 46px; }
}

/* Desktop (≥900px) */
@media (min-width: 900px) {
  :root { --container-pad: 32px; }
  
  .header-inner { gap: 16px; padding: 12px var(--container-pad); }
  .page-title { font-size: 20px; }
  .search-bar { max-width: 340px; flex: 0 1 340px; height: 44px; }
  
  .hero-slider { aspect-ratio: 35/8; }
  .hero-overlay-text { right: 22px; bottom: 56px; }
  .hero-overlay-text h2 { font-size: 30px; }
  .hero-dots { bottom: 14px; gap: 5px; }
  .hero-dot { width: 6px; height: 6px; }
  .hero-dot.is-active { width: 20px; }
  
  .property-card { flex: 0 0 220px; }
  .property-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
  .property-card:hover .property-media img { transform: scale(1.05); }
  
  .advisor-card { flex: 0 0 220px; }
  .advisor-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
  .advisor-card:hover .advisor-media img { transform: scale(1.05); }
  
  .blog-card { flex: 0 0 300px; }
  .blog-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
  .blog-card:hover .blog-media img { transform: scale(1.05); }
  
  .story-ring { width: 101px; height: 101px; }
  .story-ring img { width: 90px; height: 90px; }
  .story-label { font-size: 12px; max-width: 84px; }
  
  .stats-bar { padding: 18px 24px; }
  .stat-number { font-size: 18px; }
  
  .section { padding: 20px 0; }
  .section-title { font-size: 18px; }
  
  .ad-banner { min-height: 100px; }
  .ad-banner-text { font-size: 13px; }
  .ad-banner-content { padding: 18px 20px; }
  
  /* .bottom-nav, .bottom-spacer { display: none; } */
  .back-to-top { bottom: 16px; left: 16px; }
  .toast { bottom: 16px; }
  
  .fav-btn { opacity: 0; }
  .property-card:hover .fav-btn { opacity: 1; }
  
  .story-viewer { max-width: 420px; margin: 0 auto; border-radius: 18px; }
}

/* Large Desktop (≥1200px) */
@media (min-width: 1200px) {
  :root { --container-pad: 40px; }
  
  .page-title { font-size: 22px; }
  .search-bar { max-width: 420px; flex: 0 1 420px; }
  
  .hero-overlay-text h2 { font-size: 36px; }
  
  .property-card { flex: 0 0 250px; }
  .advisor-card { flex: 0 0 250px; }
  .blog-card { flex: 0 0 360px; }
  
  .story-ring { width: 92px; height: 92px; }
  .story-ring img { width: 86px; height: 86px; }
  .story-label { max-width: 92px; }
  
  .stat-number { font-size: 20px; }
}

/* Touch device overrides */
@media (hover: none) {
  .property-card:active { transform: scale(.97); }
  .advisor-card:active { transform: scale(.97); }
  .blog-card:active { transform: scale(.97); }
  
  .property-card:hover,
  .advisor-card:hover,
  .blog-card:hover { transform: none; }
  
  .property-card:hover .property-media img,
  .advisor-card:hover .advisor-media img,
  .blog-card:hover .blog-media img { transform: none; }
  
  .fav-btn { opacity: 1; }
}