/*
 * Sunny Estate Agent — alignment, responsive and HD image refinements
 * Loaded after style.css so the original design system remains intact.
 */

:root {
  --container: 1320px;
  --content-width: 760px;
  --hero-height: 650px;
  --page-hero-height: 460px;
}

html { scroll-padding-top: 96px; }
body { text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
.container { width: min(calc(100% - 56px), var(--container)); }
.section { padding: 88px 0; }
.section-sm { padding: 62px 0; }
.section-heading { margin-bottom: 36px; }
.section-heading > div { max-width: 800px; }
.section-heading h2 { margin-bottom: 0; }
.lead { line-height: 1.72; }

/* Header */
.site-header { background: rgba(255, 253, 251, .985); }
.header-inner {
  min-height: 88px;
  grid-template-columns: 214px 178px minmax(0, 1fr) auto;
  gap: 26px;
}
.brand { display: inline-flex; align-items: center; }
.brand img { width: 202px; max-height: 62px; object-fit: contain; }
.header-tagline { max-width: 178px; }
.desktop-nav { gap: clamp(15px, 1.65vw, 27px); }
.desktop-nav a { padding: 31px 0 28px; white-space: nowrap; }
.desktop-nav a::after { bottom: 21px; }
.header-call { min-height: 50px; padding-inline: 20px; }

/* Homepage hero slider */
.hero { min-height: var(--hero-height); }
.hero-grid {
  min-height: var(--hero-height);
  grid-template-columns: minmax(0, 46%) minmax(0, 54%);
}
.hero-copy {
  padding: 74px 48px 124px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero-copy h1 { max-width: 670px; }
.hero-copy .lead { max-width: 620px; }
.hero-visual {
  position: relative;
  min-height: var(--hero-height);
  isolation: isolate;
  overflow: hidden;
  background: #e9d8c8;
}
.hero-visual::before {
  z-index: 3;
  background: linear-gradient(90deg, #fffaf5 0%, rgba(255,250,245,.78) 12%, rgba(255,250,245,.12) 43%, transparent 58%);
}
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transform: scale(1.025);
  transition: opacity .9s ease, visibility .9s ease, transform 6.5s ease;
}
.hero-slide.is-active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}
.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 52% 50%;
}
.hero-slide:nth-child(2) img { object-position: 52% 50%; }
.hero-slide:nth-child(3) img { object-position: 54% 50%; }
.hero-slide:nth-child(4) img { object-position: 55% 55%; }
.hero-slider-dots {
  position: absolute;
  left: 34px;
  bottom: 30px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(255,255,255,.78);
  box-shadow: 0 10px 30px rgba(50, 30, 15, .12);
  backdrop-filter: blur(12px);
}
.hero-slider-dots button {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #cbb8a9;
  transition: width .25s ease, background .25s ease;
}
.hero-slider-dots button.is-active { width: 28px; background: var(--orange); }
.hero-location { right: 26px; bottom: 30px; z-index: 5; }
.hero-bullets { gap: 11px 22px; }
.hero-actions { align-items: center; }

/* Search and trust area */
.search-panel-wrap { margin-top: -70px; }
.search-panel { padding: 22px; gap: 15px; border-radius: 18px; }
.search-panel .btn { min-height: 50px; white-space: nowrap; }
.trust-grid { align-items: stretch; gap: 14px; }
.trust-card { height: 100%; padding: 20px 18px; }
.trust-card > div { min-width: 0; }

/* Shared card alignment */
.card-grid, .project-grid, .blog-grid, .services-grid, .value-grid { align-items: stretch; }
.project-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.project-image { flex: none; aspect-ratio: 16 / 10; }
.project-image img { image-rendering: auto; }
.project-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 23px;
}
.project-body h3 { min-height: 27px; }
.project-body p { flex: 1; }
.project-body .btn { width: 100%; margin-top: 18px; }
.project-meta { margin-top: auto; }
.home-project-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.blog-mini { height: 100%; }
.blog-mini img { min-height: 100%; }
.info-columns { align-items: start; gap: 54px; }
.info-column { min-width: 0; }
.testimonial-track { align-items: stretch; }
.testimonial-card { height: 100%; }

/* All internal page heroes */
.page-hero-grid {
  min-height: var(--page-hero-height);
  grid-template-columns: minmax(0, 45%) minmax(0, 55%);
}
.page-hero-copy {
  padding: 70px 52px 70px 0;
  min-width: 0;
}
.page-hero-copy .lead { max-width: 650px; }
.page-hero-image {
  min-height: var(--page-hero-height);
  overflow: hidden;
  isolation: isolate;
  background: #ead9ca;
}
.page-hero-image::before {
  z-index: 2;
  background: linear-gradient(90deg, #fffaf5 0%, rgba(255,250,245,.76) 14%, rgba(255,250,245,.08) 46%, transparent 62%);
}
.page-hero-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 54% 50%;
}
.about-hero .page-hero-image img { object-position: 58% 50%; }
.services-hero .page-hero-image img { object-position: 55% 50%; }
.blog-hero .page-hero-image img { object-position: 52% 50%; }
.contact-hero .page-hero-image img { object-position: 57% 50%; }
.projects-hero .page-hero-image img,
.area-hero .page-hero-image img { object-position: 55% 55%; }
.projects-hero .page-hero-grid { min-height: 430px; }
.projects-hero .page-hero-image { min-height: 430px; }
.page-hero-features { row-gap: 14px; }

/* About and services */
.about-founder { gap: 64px; }
.about-founder-image { min-height: 520px; border-radius: 0 26px 26px 0; }
.about-founder-image img { object-position: 64% 48%; }
.stats-grid, .value-card, .service-card, .split-cta, .process-card { height: 100%; }
.services-grid { gap: 22px; }
.service-card { display: flex; flex-direction: column; }
.service-card .link-arrow { margin-top: auto; }
.split-cta-grid { align-items: stretch; }
.split-cta { overflow: hidden; }
.split-cta img { min-height: 240px; height: 100%; }
.feature-icon-row { align-items: stretch; }
.feature-icon-card { height: 100%; }

/* Projects listing */
.filter-panel { margin-top: -44px; padding: 20px; }
.results-toolbar { margin-top: 52px; }
.project-grid { gap: 26px; }
.featured-project { align-items: stretch; }
.featured-project img { min-height: 330px; }

/* Project details */
.project-detail-hero { min-height: 620px; }
.project-detail-grid {
  grid-template-columns: minmax(0, 1fr) 372px;
  gap: 44px;
  padding: 62px 0 46px;
}
.project-detail-copy { min-height: 490px; padding-right: 30px; }
.project-detail-copy .lead { max-width: 680px; }
.project-bg { inset: 0 0 0 40%; }
.project-bg::before {
  background: linear-gradient(90deg, #fff9f3 0%, rgba(255,249,243,.88) 13%, rgba(255,249,243,.12) 47%, transparent 60%);
}
.project-bg img { object-position: 52% 50%; }
.enquiry-card { padding: 28px; top: 110px; }
.project-summary-bar { margin-top: -54px; }
.summary-item { min-width: 0; }
.summary-item span { min-width: 0; }
.summary-item strong { overflow-wrap: anywhere; }
.amenities-grid, .gallery-grid, .floor-grid { align-items: stretch; }
.amenity, .gallery-item, .floor-card { height: 100%; }
.gallery-item { aspect-ratio: 16 / 10; }
.floor-card img { min-height: 250px; }
.location-grid { align-items: stretch; }
.location-list, .map-card { height: 100%; }

/* Blog */
.featured-article, .blog-card { height: 100%; }
.featured-article > img { min-height: 100%; object-fit: cover; }
.blog-card { display: flex; flex-direction: column; }
.blog-card > a { display: block; flex: none; }
.blog-card > a img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.blog-card-body { flex: 1; display: flex; flex-direction: column; }
.blog-card-body .link-arrow { margin-top: auto; }
.article-hero-image { width: 100%; max-height: 560px; object-fit: cover; object-position: 55% 50%; }
.article-body img { width: 100%; max-height: 520px; object-fit: cover; }
.sidebar-card { overflow: hidden; }

/* Contact */
.contact-grid { align-items: stretch; }
.contact-form-wrap, .office-panel { height: 100%; }
.contact-form-wrap form { display: flex; flex-direction: column; }
.contact-form-wrap form > .btn { align-self: flex-end; min-width: 190px; }
.quick-connect > a { height: 100%; }
.map-section iframe { display: block; width: 100%; }

/* Footer */
.contact-strip-grid { align-items: stretch; }
.contact-strip-item { height: 100%; }
.footer-grid { align-items: start; }
.footer-contact p { overflow-wrap: anywhere; }

@media (max-width: 1260px) {
  .header-inner { grid-template-columns: 194px minmax(0, 1fr) auto; gap: 20px; }
  .header-tagline { display: none; }
  .desktop-nav { justify-content: flex-end; gap: 18px; }
  .home-project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1060px) {
  .container { width: min(calc(100% - 42px), var(--container)); }
  .desktop-nav { display: none; }
  .header-call { display: none; }
  .header-inner { grid-template-columns: 1fr auto; min-height: 76px; }
  .menu-toggle { display: grid; place-items: center; }
  .hero-grid, .page-hero-grid { grid-template-columns: 1fr; }
  .hero-copy { padding: 64px 0 46px; min-height: auto; }
  .hero-visual { min-height: 430px; }
  .hero-visual::before { background: linear-gradient(180deg, #fffaf5 0%, rgba(255,250,245,.32) 18%, transparent 42%); }
  .hero-location { bottom: 24px; }
  .hero-slider-dots { bottom: 24px; left: 24px; }
  .page-hero-copy { padding: 58px 0 40px; }
  .page-hero-image { min-height: 390px; }
  .page-hero-image::before { background: linear-gradient(180deg, #fffaf5 0%, rgba(255,250,245,.24) 20%, transparent 45%); }
  .projects-hero .page-hero-image { min-height: 370px; }
  .search-panel-wrap { margin-top: -44px; }
  .search-panel, .filter-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search-panel .btn, .filter-panel .btn { width: 100%; }
  .about-founder { grid-template-columns: 1fr; gap: 38px; }
  .about-founder-image { min-height: 480px; border-radius: 22px; }
  .project-detail-grid { grid-template-columns: 1fr; padding-top: 48px; }
  .project-detail-copy { padding-right: 0; }
  .project-bg { inset: 0; opacity: .38; }
  .project-bg::before { background: linear-gradient(90deg, #fff9f3 0%, rgba(255,249,243,.95) 58%, rgba(255,249,243,.48)); }
  .enquiry-card { position: relative; top: 0; width: min(100%, 620px); }
  .project-summary-bar { margin-top: -28px; }
}

@media (max-width: 760px) {
  .container { width: min(calc(100% - 30px), var(--container)); }
  .section { padding: 66px 0; }
  .section-sm { padding: 50px 0; }
  h1 { font-size: clamp(40px, 12vw, 52px); }
  h2 { font-size: clamp(32px, 9vw, 42px); }
  .section-heading { display: block; margin-bottom: 28px; }
  .section-heading .btn { margin-top: 16px; }
  .brand img { width: 178px; }
  .hero-copy { padding: 48px 0 36px; }
  .hero-copy .lead { font-size: 16px; }
  .hero-visual { min-height: 300px; }
  .hero-slide img { object-position: 58% 50%; }
  .hero-location { right: 14px; bottom: 15px; max-width: calc(100% - 100px); padding: 10px 13px; font-size: 12px; }
  .hero-slider-dots { left: 14px; bottom: 15px; padding: 8px 10px; }
  .service-pills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .service-pill { min-width: 0; justify-content: center; padding-inline: 10px; }
  .hero-actions .btn { flex: 1 1 190px; }
  .search-panel-wrap { margin-top: 0; padding-top: 15px; }
  .search-panel, .filter-panel { grid-template-columns: 1fr; padding: 16px; }
  .trust-grid, .home-project-grid, .project-grid, .services-grid, .value-grid { grid-template-columns: 1fr; }
  .trust-card { min-height: 92px; }
  .page-hero-copy { padding: 46px 0 32px; }
  .page-hero-copy h1 { font-size: clamp(40px, 12vw, 52px); }
  .page-hero-image, .projects-hero .page-hero-image { min-height: 285px; }
  .page-hero-image img { object-position: 58% 50%; }
  .page-hero-features { gap: 12px 16px; }
  .about-founder-image { min-height: 350px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .process-grid { grid-template-columns: 1fr; }
  .split-cta { grid-template-columns: 1fr; padding: 24px; }
  .split-cta img { min-height: 230px; }
  .feature-icon-row { grid-template-columns: 1fr 1fr; }
  .results-toolbar { margin-top: 34px; }
  .featured-project { grid-template-columns: 1fr; }
  .featured-project img { min-height: 250px; }
  .project-detail-hero { min-height: auto; display: flex; flex-direction: column; }
  .project-bg { position: relative; inset: auto; height: 300px; opacity: 1; order: 0; }
  .project-bg::before { background: linear-gradient(180deg, transparent 60%, #fff9f3 100%); }
  .project-detail-grid { order: 1; padding: 34px 0 36px; }
  .project-detail-copy { min-height: auto; }
  .project-detail-copy h1 { font-size: clamp(42px, 13vw, 58px); }
  .project-summary-bar { grid-template-columns: 1fr; margin-top: 16px; }
  .summary-item { border-right: 0 !important; border-top: 1px solid var(--line); }
  .summary-item:first-child { border-top: 0; }
  .amenities-grid { grid-template-columns: 1fr 1fr; }
  .gallery-grid { grid-template-columns: 1fr 1fr; }
  .floor-grid, .location-grid { grid-template-columns: 1fr; }
  .floor-card { grid-template-columns: 1fr; }
  .floor-card img { min-height: 300px; max-height: 380px; }
  .blog-mini { grid-template-columns: 1fr; }
  .blog-mini img { aspect-ratio: 16 / 9; }
  .related-grid { grid-template-columns: 1fr; }
  .contact-form-wrap form > .btn { width: 100%; align-self: stretch; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-about, .footer-contact { grid-column: auto; }
}

@media (max-width: 480px) {
  .container { width: min(calc(100% - 24px), var(--container)); }
  .header-inner { min-height: 70px; }
  .brand img { width: 164px; }
  .menu-toggle { width: 42px; height: 42px; }
  .hero-copy { padding-top: 40px; }
  .hero-visual { min-height: 270px; }
  .hero-location { max-width: calc(100% - 82px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hero-slider-dots button { width: 8px; height: 8px; }
  .hero-slider-dots button.is-active { width: 22px; }
  .service-pill { font-size: 11px; }
  .page-hero-image, .projects-hero .page-hero-image { min-height: 250px; }
  .stats-grid, .feature-icon-row, .amenities-grid, .gallery-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .hero-slide { transition: none; transform: none; }
}

/* Inline layout safeguards used by existing PHP templates */
@media (max-width: 760px) {
  .trust-grid { grid-template-columns: 1fr !important; }
  .split-cta { grid-template-columns: 1fr !important; }
  .split-cta .hero-actions { width: 100%; }
  .split-cta .hero-actions .btn { width: 100%; }
}
@media (max-width: 1060px) and (min-width: 761px) {
  .trust-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

/* Quick-connect cards: keep title and supporting text on separate lines */
.quick-card > span:nth-child(2) {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}
.quick-card strong,
.quick-card small {
  display: block;
}
.quick-card small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}
.quick-card > svg {
  flex: 0 0 auto;
  margin-left: auto;
}


/* ================================================================
   v3 — full-bleed hero alignment + compact blog cards + hardening
   ================================================================ */

/* Prevent any long content from creating horizontal page overflow. */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}

img,
video,
iframe,
svg {
  max-width: 100%;
}

/*
 * Desktop hero geometry:
 * Keep the copy aligned to the global container while allowing the visual
 * column to continue all the way to the right edge of the viewport.
 */
@media (min-width: 1061px) {
  .hero > .hero-grid,
  .page-hero > .page-hero-grid {
    width: auto;
    max-width: none;
    margin-left: max(28px, calc((100vw - var(--container)) / 2));
    margin-right: 0;
  }

  .hero-grid {
    grid-template-columns: minmax(500px, 620px) minmax(0, 1fr);
  }

  .page-hero-grid {
    grid-template-columns: minmax(470px, 585px) minmax(0, 1fr);
  }

  .hero-copy {
    padding-right: 46px;
  }

  .page-hero-copy {
    padding-right: 46px;
  }

  .hero-visual,
  .page-hero-image {
    width: 100%;
    max-width: none;
  }

  /* Images remain sharp and preserve the useful right-hand composition. */
  .hero-slide img,
  .page-hero-image img {
    object-fit: cover;
    object-position: center center;
  }

  .hero-slide:nth-child(1) img { object-position: 54% 50%; }
  .hero-slide:nth-child(2) img { object-position: 52% 50%; }
  .hero-slide:nth-child(3) img { object-position: 55% 52%; }
  .hero-slide:nth-child(4) img { object-position: 50% 50%; }

  .about-hero .page-hero-image img { object-position: 56% 50%; }
  .services-hero .page-hero-image img { object-position: 55% 50%; }
  .blog-hero .page-hero-image img { object-position: 53% 50%; }
  .contact-hero .page-hero-image img { object-position: 56% 50%; }
  .projects-hero .page-hero-image img { object-position: 52% 52%; }
  .area-hero .page-hero-image img { object-position: 52% 52%; }
}

/* Blog listing: project-card-like compact and aligned card grid. */
@media (min-width: 1181px) {
  .blog-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 30px;
  }

  .blog-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
  }
}

.blog-card {
  min-width: 0;
}

.blog-card > a {
  overflow: hidden;
  background: var(--cream-2);
}

.blog-card > a img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform .45s ease;
}

.blog-card:hover > a img {
  transform: scale(1.04);
}

.blog-card-body {
  padding: 18px;
}

.blog-card-body h3 {
  font-size: 20px;
  line-height: 1.2;
  min-height: 72px;
  margin: 9px 0 12px;
}

.blog-card-body p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.65;
  margin-bottom: 16px;
}

.blog-card-meta {
  flex-wrap: wrap;
  row-gap: 3px;
}

/* Tablet: full-width visual rows, with text kept on the standard gutter. */
@media (max-width: 1060px) {
  .hero > .hero-grid,
  .page-hero > .page-hero-grid {
    width: 100%;
    max-width: none;
    margin-inline: 0;
  }

  .hero-copy,
  .page-hero-copy {
    padding-left: max(21px, calc((100vw - var(--container)) / 2));
    padding-right: max(21px, calc((100vw - var(--container)) / 2));
  }

  .hero-visual,
  .page-hero-image {
    width: 100%;
  }

  .hero-slide img,
  .page-hero-image img {
    object-position: center center;
  }

  .blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Mobile: readable typography, edge-to-edge hero images and one-column cards. */
@media (max-width: 760px) {
  html,
  body {
    overflow-x: hidden;
  }

  .hero-copy,
  .page-hero-copy {
    padding-left: 15px;
    padding-right: 15px;
  }

  .hero-copy h1 {
    font-size: clamp(39px, 12vw, 52px);
    overflow-wrap: normal;
  }

  .hero-visual {
    min-height: clamp(270px, 78vw, 390px);
  }

  .page-hero-image,
  .projects-hero .page-hero-image {
    min-height: clamp(245px, 68vw, 340px);
  }

  .hero-slide img,
  .page-hero-image img {
    object-position: center center;
  }

  .hero-location {
    max-width: calc(100% - 112px);
  }

  .blog-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .blog-card-body h3 {
    min-height: 0;
    font-size: 21px;
  }

  .blog-card-body p {
    -webkit-line-clamp: 4;
  }

  .featured-article > img {
    min-height: 240px;
    aspect-ratio: 16 / 10;
  }

  .featured-article-copy {
    padding: 24px 20px;
  }

  .blog-filter-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }

  .blog-filter-tabs::-webkit-scrollbar {
    display: none;
  }

  .blog-filter-tabs button {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .btn,
  .field input,
  .field select,
  .field textarea {
    max-width: 100%;
  }

  .project-card,
  .blog-card,
  .service-card,
  .sidebar-card,
  .contact-form-wrap,
  .office-panel {
    min-width: 0;
  }
}

@media (max-width: 480px) {
  .hero-copy,
  .page-hero-copy {
    padding-left: 12px;
    padding-right: 12px;
  }

  .hero-location {
    right: 12px;
    max-width: calc(100% - 96px);
  }

  .hero-slider-dots {
    left: 12px;
  }

  .blog-card-body {
    padding: 17px;
  }
}

/* Closed off-canvas navigation must not increase the page's layout width. */
.mobile-nav {
  display: none;
  transform: none;
}

.mobile-nav.open {
  display: flex;
  transform: none;
}

.nav-backdrop {
  display: none;
}

.nav-backdrop.open {
  display: block;
}

/* Grid children must be allowed to shrink, especially around scrollable tabs. */
.blog-layout,
.blog-layout > div,
.blog-grid,
.featured-article,
.blog-filter-tabs {
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 760px) {
  .blog-filter-tabs {
    width: 100%;
    max-width: 100%;
  }
}
