/* =========================================================
   ARISE HOME — Responsive System (320 → 1920)
   Breakpoints: 320 · 375 · 390 · 414 · 768 · 1024 · 1440 · 1920
   ========================================================= */

/* Global safety */
html, body { max-width: 100vw; overflow-x: hidden; }
img, video, iframe { max-width: 100%; height: auto; }

/* ============ ≤ 1440px — LARGE DESKTOP TIGHTEN ============ */
@media (max-width: 1440px) {
  :root { --container: 1180px; }
}

/* ============ ≤ 1180px ============ */
@media (max-width: 1180px) {
  :root { --container: 1040px; }
  .container { padding: 0 24px; }
}

/* ============ ≤ 1080px — TABLET LANDSCAPE ============ */
@media (max-width: 1080px) {
  .section { padding: 72px 0; }
  .section-head { margin-bottom: 44px; }
}

/* ============ ≤ 1024px ============ */
@media (max-width: 1024px) {
  .hero { height: clamp(440px, 55vh, 560px); }
  .hero__title { font-size: clamp(1.8rem, 4.6vw, 2.8rem); }
  .hero__sub   { font-size: 1rem; }
  .search-wrap { margin-top: -50px; }
  .pre-footer__inner { grid-template-columns: 1fr; gap: 30px; }
  .pre-footer__cta { justify-content: flex-start; }
  .pre-footer { padding: 70px 0; }
}

/* ============ ≤ 900px ============ */
@media (max-width: 900px) {
  :root { --container: 820px; }
  h1 { font-size: clamp(2rem, 5.5vw, 2.8rem); }
  h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
  h3 { font-size: 1.25rem; }
  .section { padding: 60px 0; }
  .section-head { margin-bottom: 36px; }
  .container { padding: 0 20px; }
  .topbar__right, .topbar__sep { display: none; }
  .topbar { padding: 8px 0; font-size: .74rem; }

  /* Hero */
  .hero { height: clamp(320px, 48vh, 460px); }
  .hero__inner { padding: 40px 0 40px; }
  .hero__title { font-size: clamp(1.6rem, 6vw, 2.4rem); margin: 12px 0 12px; }
  .hero__sub   { font-size: .95rem; margin-bottom: 20px; }
  .hero__cta .btn { padding: 12px 20px; font-size: .85rem; }
  .hero__dots { bottom: 16px; left: 20px; }
  .hero__dots button { width: 22px; }
  .hero__dots button.is-active { width: 42px; }
  .hero__scroll { display: none; }

  /* Search */
  .search-wrap { margin-top: -40px; padding: 0 16px; }
  .search__tabs { padding: 6px; gap: 3px; }
  .search__tab  { padding: 9px 14px; font-size: .78rem; }
  .search__form { grid-template-columns: 1fr 1fr; }
  .search__field { padding: 14px 16px; border-right: none; border-bottom: 1px solid var(--border-soft); }
  .search__field:nth-child(odd) { border-right: 1px solid var(--border-soft); }
  .search__submit { grid-column: 1 / -1; padding: 18px; width: 100%; }
  .search--refine .search__form { grid-template-columns: 1fr 1fr; }

  /* Trending */
  .trending { padding: 0 4px; margin-top: 20px; }
  .trending__label { width: 100%; margin-bottom: 8px; font-size: .72rem; }
  .trending__chip { padding: 7px 12px; font-size: .78rem; }

  /* Cards grid */
  .projects-grid, .blogs-grid { grid-template-columns: 1fr 1fr; gap: 20px; }

  /* Cities */
  .cities-grid { grid-template-columns: 1fr 1fr; grid-template-rows: auto; gap: 16px; min-height: 0; }
  .city-card { min-height: 220px; }
  .city-card:first-child { grid-row: auto; grid-column: 1 / -1; min-height: 300px; }
  .city-card__body { padding: 24px; }

  /* Builders */
  .builders-strip { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .builder-card { padding: 24px 18px; }

  /* USP */
  .usp-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .usp-card { padding: 26px 22px; }
  .usp-card h3 { font-size: 1.05rem; }

  /* Testimonials → 2 cards */
  .testimonials-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; display: grid; overflow: visible; padding-bottom: 0; }
  .testimonial-card { flex: unset; padding: 26px; }

  /* Counters */
  .counters { padding: 36px 22px; gap: 24px; }
  .counter__num { font-size: 2rem; }

  /* Page header */
  .page-header { padding: 130px 0 50px; padding-top: 150px; }

  /* Project detail */
  .pd-hero { min-height: 60vh; padding-bottom: 40px; }
  .pd-hero__inner { padding: 90px 0 40px; }
  .pd-hero__title { font-size: clamp(1.8rem, 6vw, 2.6rem); }
  .pd-hero__meta { gap: 14px 24px; margin-top: 18px; }
  .pd-hero__meta strong { font-size: 1rem; }
  .pd-hero__cta { margin-top: 22px; }
  .pd-hero__cta .btn { padding: 12px 18px; font-size: .85rem; }
  .pd-tabs__inner { padding: 10px 0; gap: 2px; }
  .pd-tabs a { padding: 8px 14px; font-size: .82rem; }
  .pd-section { padding: 44px 0; }
  .pd-gallery { grid-template-columns: 1fr 1fr; gap: 10px; }
  .pd-gallery img:first-child { grid-row: auto; grid-column: 1 / -1; aspect-ratio: 16/10; }

  /* Contact grid */
  .contact-grid { grid-template-columns: 1fr !important; gap: 32px !important; }
  .about-grid   { grid-template-columns: 1fr !important; gap: 32px !important; }
}

/* ============ ≤ 768px — TABLET PORTRAIT ============ */
@media (max-width: 768px) {
  h1 { font-size: clamp(1.9rem, 6vw, 2.4rem); }
  .cities-grid { grid-template-columns: 1fr 1fr; }
  .builders-strip { grid-template-columns: repeat(2, 1fr); }

  /* Testimonials on tablet portrait — 2 cards remain grid */
  .testimonials-grid { grid-template-columns: repeat(2, 1fr); }

  /* Contact aside stacks */
  .contact-grid { grid-template-columns: 1fr !important; }
  .about-grid   { grid-template-columns: 1fr !important; }
}

/* ============ ≤ 640px — MOBILE (SLIDER MODE) ============ */
@media (max-width: 640px) {
  :root { --container: 100%; }
  .container { padding: 0 16px; }
  h1 { font-size: clamp(1.7rem, 7vw, 2.1rem); }
  h2 { font-size: clamp(1.35rem, 5.8vw, 1.75rem); }
  h3 { font-size: 1.1rem; }
  p  { font-size: .95rem; }
  .section { padding: 50px 0; }
  .section-head { margin-bottom: 30px; }
  .eyebrow { font-size: .7rem; letter-spacing: .2em; }
  .btn { padding: 12px 20px; font-size: .85rem; }
  .btn--lg { padding: 14px 24px; font-size: .9rem; }
  .btn--sm { padding: 10px 14px; font-size: .78rem; }

  /* Topbar */
  .topbar { display: none; }

  /* Nav */
  .nav__inner { padding: 10px 16px; }
  .brand__badge { padding: 5px 9px; }
  .brand__badge img { height: 36px; }

  /* Hero — LANDSCAPE BANNER (260-340) */
  .hero { height: clamp(280px, 44vh, 340px); margin-top: -60px; padding-top: 60px; }
  .hero__inner { padding: 20px 0 24px; max-width: 100%; }
  .eyebrow { justify-content: flex-start; }
  .hero__title { font-size: clamp(1.35rem, 6.5vw, 1.8rem); margin: 10px 0 10px; line-height: 1.1; }
  .hero__title br { display: none; }
  .hero__sub { font-size: .88rem; line-height: 1.5; margin-bottom: 16px; -webkit-line-clamp: 3; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
  .hero__cta { gap: 8px; }
  .hero__cta .btn { padding: 10px 16px; font-size: .8rem; flex: 1; justify-content: center; min-width: 130px; }
  .hero__cta .btn i { display: none; }
  .hero__dots { bottom: 12px; left: 16px; }
  .hero__dots button { width: 18px; }
  .hero__dots button.is-active { width: 34px; }

  /* Search */
  .search-wrap { margin-top: -30px; padding: 0 12px; }
  .search { border-radius: 18px; }
  .search__tabs { padding: 5px; gap: 3px; overflow-x: auto; scrollbar-width: none; flex-wrap: nowrap; }
  .search__tabs::-webkit-scrollbar { display: none; }
  .search__tab { padding: 8px 14px; font-size: .74rem; flex-shrink: 0; }
  .search__form { grid-template-columns: 1fr; }
  .search__field { padding: 13px 16px; border-right: none !important; border-bottom: 1px solid var(--border-soft); }
  .search__field label { font-size: .64rem; }
  .search__field input, .search__field select { font-size: .92rem; }
  .search__submit { padding: 16px; grid-column: 1 / -1; }
  .search--refine .search__form { grid-template-columns: 1fr; }

  /* Trending — proper wrapping */
  .trending { gap: 8px; padding: 0; margin-top: 18px; }
  .trending__label { font-size: .7rem; width: 100%; margin-bottom: 6px; }
  .trending__chip { padding: 6px 10px; font-size: .74rem; }

  /* Section head text wraps clean */
  .section-head p { font-size: .92rem; }

  /* Property cards → horizontal swipe slider */
  .projects-grid, .blogs-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 82%;
    grid-template-columns: unset;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 0 4px 20px;
    gap: 14px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .projects-grid::-webkit-scrollbar,
  .blogs-grid::-webkit-scrollbar { display: none; }
  .project-card, .blog-card { scroll-snap-align: start; min-width: 0; }
  .project-card__body { padding: 20px 20px 20px; }
  .project-card__title { font-size: 1.15rem; }
  .project-card__meta { grid-template-columns: 1fr 1fr; gap: 10px; }
  .project-card__meta .value { font-size: .85rem; }
  .project-card__actions { flex-wrap: wrap; gap: 8px; }
  .project-card__actions .btn { flex: 1 1 auto; padding: 10px 12px; font-size: .78rem; min-width: 0; }
  .project-card__actions .btn span { white-space: nowrap; }
  .project-card__icons { gap: 6px; }
  .project-card__icons a { width: 38px; height: 38px; }

  /* Filter pills */
  .filter-pills {
    display: flex; flex-wrap: nowrap;
    overflow-x: auto; scrollbar-width: none;
    justify-content: flex-start;
    padding: 0 4px 6px;
    margin-bottom: 28px;
    scroll-snap-type: x mandatory;
  }
  .filter-pills::-webkit-scrollbar { display: none; }
  .filter-pill { padding: 9px 16px; font-size: .8rem; white-space: nowrap; flex-shrink: 0; scroll-snap-align: start; }

  /* Cities → horizontal swipe */
  .cities-grid {
    display: grid !important;
    grid-auto-flow: column;
    grid-auto-columns: 78%;
    grid-template-columns: unset !important;
    grid-template-rows: unset !important;
    overflow-x: auto; scroll-snap-type: x mandatory;
    padding: 0 4px 16px;
    gap: 12px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    min-height: 0;
  }
  .cities-grid::-webkit-scrollbar { display: none; }
  .city-card, .city-card:first-child {
    grid-row: unset !important; grid-column: unset !important;
    min-height: 260px; scroll-snap-align: start;
  }
  .city-card__body { padding: 20px; }
  .city-card__name { font-size: 1.5rem; }

  /* Builders */
  .builders-strip { grid-template-columns: 1fr 1fr; gap: 12px; }
  .builder-card { padding: 22px 14px; }
  .builder-card__mark { width: 54px; height: 54px; font-size: 1.2rem; }
  .builder-card__name { font-size: 1rem; }
  .builder-card__tag  { font-size: .78rem; }

  /* USP */
  .usp-grid { grid-template-columns: 1fr; }
  .usp-card { padding: 22px 20px; }

  /* Testimonials → single card slider */
  .testimonials-grid {
    display: flex !important;
    grid-template-columns: unset !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding: 0 4px 16px;
    gap: 12px;
    -webkit-overflow-scrolling: touch;
  }
  .testimonials-grid::-webkit-scrollbar { display: none; }
  .testimonial-card { flex: 0 0 88%; scroll-snap-align: start; padding: 22px; }
  .testimonial-card__quote { font-size: 1rem; }

  /* Counters */
  .counters { padding: 26px 16px; gap: 18px; border-radius: 20px; }
  .counter__num { font-size: 1.6rem; }
  .counter__label { font-size: .68rem; margin-top: 8px; }

  /* Page header */
  .page-header { padding: 110px 0 40px; padding-top: 130px; }
  .page-header h1 { margin-bottom: 8px; }
  .page-header p { font-size: .92rem; }
  .breadcrumbs { padding: 6px 14px; font-size: .74rem; }

  /* Project details */
  .pd-hero { min-height: 0; height: auto; padding-bottom: 30px; padding-top: 60px; margin-top: -60px; }
  .pd-hero__img { position: absolute; }
  .pd-hero__inner { padding: 70px 0 30px; }
  .pd-hero__title { font-size: clamp(1.5rem, 6.5vw, 2rem); margin: 10px 0 12px; }
  .pd-hero__meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; }
  .pd-hero__meta strong { font-size: .92rem; }
  .pd-hero__meta span { font-size: .64rem; }
  .pd-hero__cta { gap: 8px; margin-top: 20px; }
  .pd-hero__cta .btn { flex: 1 1 auto; padding: 10px 14px; font-size: .78rem; min-width: 130px; justify-content: center; }
  .pd-tabs { top: 60px; }
  .pd-tabs__inner { padding: 8px 4px; }
  .pd-tabs a { padding: 7px 12px; font-size: .76rem; }
  .pd-section { padding: 36px 0; }
  .pd-section h2 { font-size: 1.35rem; }
  .pd-gallery { grid-template-columns: 1fr; gap: 8px; }
  .pd-gallery img:first-child { grid-column: unset; aspect-ratio: 16/10; }
  .pd-price { grid-template-columns: 1fr; gap: 14px; }
  .amenities { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .amenity { padding: 18px 12px; }
  .amenity i { font-size: 1.3rem; }
  .amenity span { font-size: .82rem; }
  .faq__q { font-size: 1rem; padding: 18px 20px; }
  .faq__a p { padding: 0 20px 20px; font-size: .9rem; }

  /* Forms */
  .form { grid-template-columns: 1fr; gap: 16px; }
  .form__field input, .form__field select, .form__field textarea { padding: 13px 15px; font-size: .92rem; }
  .form__field label { font-size: .72rem; }

  /* Pre-footer */
  .pre-footer { padding: 50px 0; }
  .pre-footer__desc { font-size: .95rem; }
  .pre-footer__cta { gap: 10px; }
  .pre-footer__cta .btn { flex: 1 1 auto; min-width: 140px; justify-content: center; }

  /* Footer — vertical stack */
  .footer { padding: 60px 0 0; }
  .footer__grid { grid-template-columns: 1fr; gap: 34px; padding-bottom: 40px; }
  .footer__brand { text-align: center; }
  .footer__brand .brand { justify-content: center; }
  .footer__blurb { text-align: center; }
  .footer__socials { justify-content: center; }
  .footer__title { text-align: left; }

  /* Quick-links + Popular Builders + Popular Cities → two columns each row */
  .footer__col:not(.footer__col--map) { }
  .footer__col ul { columns: 2; column-gap: 20px; }
  .footer__col--map ul { columns: 1; }
  .footer__col--map { text-align: left; }
  .footer__bar-inner { flex-direction: column; gap: 10px; text-align: center; align-items: center; }

  /* Empty state */
  .empty { padding: 50px 20px; }
  .empty i { font-size: 2rem; }

  /* Pd hero — remove full-height for mobile */
  .pd-hero__scrim { background: linear-gradient(180deg, rgba(20,20,20,.45), rgba(20,20,20,.9)); }
}

/* ============ ≤ 414px ============ */
@media (max-width: 414px) {
  .container { padding: 0 14px; }
  .brand__badge img { height: 32px; }
  .brand__badge { padding: 4px 8px; }
  .nav__toggle { width: 40px; height: 40px; }
  .hero__title { font-size: 1.4rem; }
  .search-wrap { padding: 0 10px; }
  .search__tab { padding: 7px 12px; }
  .projects-grid, .blogs-grid { grid-auto-columns: 86%; }
  .cities-grid { grid-auto-columns: 82%; }
  .testimonial-card { flex-basis: 90%; }
  .hero__cta .btn span { font-size: .78rem; }
}

/* ============ ≤ 390px ============ */
@media (max-width: 390px) {
  .hero { height: clamp(260px, 42vh, 320px); }
  .hero__inner { padding: 16px 0 20px; }
  .hero__sub { -webkit-line-clamp: 2; }
  .search__tab { padding: 7px 10px; font-size: .7rem; }
  .filter-pill { padding: 8px 14px; font-size: .76rem; }
}

/* ============ ≤ 375px ============ */
@media (max-width: 375px) {
  .container { padding: 0 12px; }
  h1 { font-size: 1.55rem; }
  h2 { font-size: 1.3rem; }
  .btn { padding: 11px 16px; font-size: .8rem; }
  .btn--lg { padding: 13px 20px; font-size: .84rem; }
  .hero__cta .btn { padding: 9px 14px; font-size: .76rem; min-width: 120px; }
  .brand__badge img { height: 30px; }
  .nav__cta { gap: 6px; }
  .float-actions__btn { width: 46px; height: 46px; font-size: 1rem; }
  .float-actions { right: 12px; bottom: 16px; gap: 10px; }
}

/* ============ ≤ 320px — SMALLEST ============ */
@media (max-width: 320px) {
  .container { padding: 0 10px; }
  h1 { font-size: 1.4rem; }
  .hero { height: 260px; }
  .hero__title { font-size: 1.25rem; }
  .hero__sub { font-size: .82rem; }
  .hero__cta { flex-direction: column; }
  .hero__cta .btn { width: 100%; }
  .brand__badge img { height: 28px; }
  .search__field { padding: 12px 14px; }
  .search__tab { padding: 6px 10px; font-size: .68rem; }
  .filter-pill { padding: 7px 12px; font-size: .72rem; }
  .project-card__actions { flex-direction: column; }
  .project-card__actions .btn { width: 100%; }
  .project-card__icons { justify-content: center; width: 100%; }
  .pre-footer__cta { flex-direction: column; }
  .pre-footer__cta .btn { width: 100%; }
  .pd-hero__cta { flex-direction: column; }
  .pd-hero__cta .btn { width: 100%; }
}

/* ============ ≥ 1440px — LARGE DESKTOP ============ */
@media (min-width: 1440px) {
  .hero { height: clamp(560px, 60vh, 640px); }
  .container { padding: 0 32px; }
}

/* ============ ≥ 1920px — XL DESKTOP ============ */
@media (min-width: 1920px) {
  :root { --container: 1360px; }
  .hero { height: 640px; }
  .hero__title { font-size: 4rem; }
  .hero__sub { font-size: 1.15rem; }
}
