/*
 * Findar Property Desktop Reference V4
 * Desktop-only. Mobile is intentionally untouched.
 * Goal: photo-first hierarchy with clean side gutters,
 * compact overview, generous main/sidebar separation and flatter sections.
 */

@media (min-width: 1024px) {
  body.single-propriete .fdp-property-detail {
    --fdp4-shell-gutter: clamp(12px, 1.15vw, 22px);
    --fdp4-content-max: 1160px;
    --fdp4-sidebar: 318px;
    --fdp4-gap: clamp(42px, 3.8vw, 60px);
  }

  body.single-propriete .fdp-property-shell {
    width: calc(100% - (var(--fdp4-shell-gutter) * 2));
    max-width: 1880px;
    padding-top: 10px;
  }

  body.single-propriete .fdp-breadcrumb {
    width: min(var(--fdp4-content-max), calc(100% - 48px));
    margin: 4px auto 10px;
    padding: 0;
  }

  body.single-propriete .fdp-section-nav {
    width: min(var(--fdp4-content-max), calc(100% - 48px));
    min-height: 50px;
    margin: 0 auto 10px;
    border: 0;
    border-top: 1px solid #edf0f4;
    border-bottom: 1px solid #dfe4eb;
    border-radius: 0;
    box-shadow: none;
    background: rgba(255,255,255,.98);
  }

  body.single-propriete .fdp-section-nav a {
    min-height: 49px;
    padding: 0 18px;
    border-radius: 0;
    color: #273142;
    font-size: 13px;
    font-weight: 800;
  }

  body.single-propriete .fdp-section-nav a.is-active,
  body.single-propriete .fdp-section-nav a[aria-current="true"] {
    background: transparent;
    color: #0e46d8;
  }

  body.single-propriete .fdp-section-nav a::after {
    right: 16px;
    bottom: -1px;
    left: 16px;
    height: 3px;
  }

  /* PHOTO FIRST — V46206 desktop authority.
     The grid adapts to the real number of unique listing photos. No duplicate
     placeholders are invented, and 5+ always shows exactly five tiles while
     the complete real gallery remains available in the explorer. */
  body.single-propriete .fdp-gallery {
    width: 100%;
    margin: 0;
    overflow: hidden;
    border-radius: 12px;
    background: #edf0f4;
  }

  body.single-propriete .fdp-gallery-track {
    display: grid;
    min-height: 0;
    max-height: none;
    gap: 8px;
    overflow: hidden;
    background: #edf0f4;
  }

  /* Specificity, not force: this beats the base rule in
     findar-property-detail-v2.css that hides every slide past the fifth, and
     the per-count rules below beat this one in turn. No !important needed. */
  body.single-propriete .fdp-gallery-slide {
    display: block;
    min-width: 0;
    min-height: 0;
    background: #e8ebef;
  }

  body.single-propriete .fdp-gallery-slide img {
    object-fit: cover;
    object-position: center;
  }

  /* 1 photo: a single wide hero, no empty cells. */
  body.single-propriete .fdp-gallery--count-1 .fdp-gallery-track {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: clamp(430px, 39vw, 650px);
  }
  body.single-propriete .fdp-gallery--count-1 .fdp-gallery-slide:first-child {
    grid-column: 1;
    grid-row: 1;
  }

  /* 2 photos: main image + one full-height companion. */
  body.single-propriete .fdp-gallery--count-2 .fdp-gallery-track {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: clamp(430px, 36vw, 620px);
  }
  body.single-propriete .fdp-gallery--count-2 .fdp-gallery-slide:first-child {
    grid-column: 1;
    grid-row: 1;
  }
  body.single-propriete .fdp-gallery--count-2 .fdp-gallery-slide:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
  }

  /* 3 photos: main image + two stacked images. */
  body.single-propriete .fdp-gallery--count-3 .fdp-gallery-track {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: repeat(2, clamp(215px, 18vw, 305px));
  }
  body.single-propriete .fdp-gallery--count-3 .fdp-gallery-slide:first-child {
    grid-column: 1;
    grid-row: 1 / 3;
  }
  body.single-propriete .fdp-gallery--count-3 .fdp-gallery-slide:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
  }
  body.single-propriete .fdp-gallery--count-3 .fdp-gallery-slide:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
  }

  /* 4 photos: main image, wide upper-right image, two lower-right images. */
  body.single-propriete .fdp-gallery--count-4 .fdp-gallery-track {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: repeat(2, clamp(215px, 18vw, 305px));
  }
  body.single-propriete .fdp-gallery--count-4 .fdp-gallery-slide:first-child {
    grid-column: 1;
    grid-row: 1 / 3;
  }
  body.single-propriete .fdp-gallery--count-4 .fdp-gallery-slide:nth-child(2) {
    grid-column: 2 / 4;
    grid-row: 1;
  }
  body.single-propriete .fdp-gallery--count-4 .fdp-gallery-slide:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
  }
  body.single-propriete .fdp-gallery--count-4 .fdp-gallery-slide:nth-child(4) {
    grid-column: 3;
    grid-row: 2;
  }

  /* 5 and 6 photos: main image at exactly half width + a 2x2 mosaic. */
  body.single-propriete .fdp-gallery--count-5plus .fdp-gallery-track {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: repeat(2, clamp(215px, 18vw, 305px));
  }
  body.single-propriete .fdp-gallery--count-5plus .fdp-gallery-slide:first-child {
    grid-column: 1;
    grid-row: 1 / 3;
  }
  body.single-propriete .fdp-gallery--count-5plus .fdp-gallery-slide:nth-child(2) { grid-column: 2; grid-row: 1; }
  body.single-propriete .fdp-gallery--count-5plus .fdp-gallery-slide:nth-child(3) { grid-column: 3; grid-row: 1; }
  body.single-propriete .fdp-gallery--count-5plus .fdp-gallery-slide:nth-child(4) { grid-column: 2; grid-row: 2; }
  body.single-propriete .fdp-gallery--count-5plus .fdp-gallery-slide:nth-child(5) { grid-column: 3; grid-row: 2; }
  body.single-propriete .fdp-gallery--count-5plus .fdp-gallery-slide:nth-child(n+6) {
    display: none;
  }

  /* 7 or more photos: main image at half width + a 3x2 mosaic. The
     remainder sits behind the photo count. */
  body.single-propriete .fdp-gallery--count-7plus .fdp-gallery-track {
    grid-template-columns: minmax(0, 3fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: repeat(2, clamp(215px, 18vw, 305px));
  }
  body.single-propriete .fdp-gallery--count-7plus .fdp-gallery-slide:first-child {
    grid-column: 1;
    grid-row: 1 / 3;
  }
  body.single-propriete .fdp-gallery--count-7plus .fdp-gallery-slide:nth-child(2) { grid-column: 2; grid-row: 1; }
  body.single-propriete .fdp-gallery--count-7plus .fdp-gallery-slide:nth-child(3) { grid-column: 3; grid-row: 1; }
  body.single-propriete .fdp-gallery--count-7plus .fdp-gallery-slide:nth-child(4) { grid-column: 4; grid-row: 1; }
  body.single-propriete .fdp-gallery--count-7plus .fdp-gallery-slide:nth-child(5) { grid-column: 2; grid-row: 2; }
  body.single-propriete .fdp-gallery--count-7plus .fdp-gallery-slide:nth-child(6) { grid-column: 3; grid-row: 2; }
  body.single-propriete .fdp-gallery--count-7plus .fdp-gallery-slide:nth-child(7) { grid-column: 4; grid-row: 2; }
  body.single-propriete .fdp-gallery--count-7plus .fdp-gallery-slide:nth-child(n+8) {
    display: none;
  }

  body.single-propriete .fdp-gallery-actions {
    top: 14px;
    right: 14px;
  }

  body.single-propriete .fdp-gallery-counter {
    display: none;
  }

  body.single-propriete .fdp-gallery-more {
    right: 14px;
    bottom: 14px;
    gap: 7px;
    min-height: 38px;
    padding: 0 13px;
    border: 1px solid rgba(255,255,255,.68);
    border-radius: 9px;
    background: rgba(17,24,39,.84);
    box-shadow: 0 6px 18px rgba(15,23,42,.18);
    color: #fff;
    font: 850 12px/1 Outfit, Inter, sans-serif;
    cursor: pointer;
  }

  body.single-propriete .fdp-gallery-more:hover {
    background: rgba(17,24,39,.94);
  }

  /* Compact overview. The right column is visually reserved for contact. */
  body.single-propriete .fdp-summary {
    width: min(var(--fdp4-content-max), calc(100% - 48px));
    margin: 0 auto;
    padding: 18px 0 17px;
    display: grid;
    grid-template-columns: minmax(0, 850px) minmax(0, 1fr);
    grid-auto-rows: auto;
    column-gap: var(--fdp4-gap);
    border-bottom: 1px solid #e5e8ed;
  }

  body.single-propriete .fdp-price-block {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    margin: 0 0 7px;
    text-align: left;
  }

  body.single-propriete .fdp-price {
    font-size: clamp(30px, 2.25vw, 38px);
    letter-spacing: -.035em;
  }

  body.single-propriete .fdp-summary-main {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
  }

  body.single-propriete .fdp-summary-kicker {
    margin-bottom: 4px;
    font-size: 11px;
  }

  body.single-propriete .fdp-summary h1 {
    max-width: none;
    font-size: clamp(21px, 1.65vw, 28px);
    line-height: 1.16;
    letter-spacing: -.022em;
  }

  body.single-propriete .fdp-location {
    margin-top: 6px;
    font-size: 13px;
  }

  body.single-propriete .fdp-facts {
    grid-column: 1;
    grid-row: 3;
    display: flex;
    align-items: stretch;
    gap: 0;
    margin-top: 14px;
  }

  body.single-propriete .fdp-fact {
    flex: 0 1 auto;
    min-width: 128px;
    min-height: 50px;
    padding: 7px 20px 7px 0;
    margin-right: 20px;
    border: 0;
    border-right: 1px solid #dfe4eb;
    border-radius: 0;
    background: transparent;
    text-align: left;
  }

  body.single-propriete .fdp-fact:last-child {
    margin-right: 0;
    padding-right: 0;
    border-right: 0;
  }

  body.single-propriete .fdp-fact strong {
    font-size: 16px;
  }

  body.single-propriete .fdp-fact span {
    font-size: 10px;
  }

  body.single-propriete .fdp-insights {
    grid-column: 1;
    grid-row: 4;
    gap: 7px;
    padding-top: 11px;
  }

  body.single-propriete .fdp-insight {
    min-height: 30px;
    padding: 0 9px;
    border-color: #e2e7ef;
    background: #f7f9fc;
    font-size: 10px;
  }

  /* Main article + seller sidebar. Sidebar begins beside the price block and
     stays sticky while the article continues. */
  body.single-propriete .fdp-content-layout {
    width: min(var(--fdp4-content-max), calc(100% - 48px));
    margin: 0 auto;
    padding-top: 24px;
    grid-template-columns: minmax(0, 850px) var(--fdp4-sidebar);
    gap: var(--fdp4-gap);
    align-items: start;
  }

  body.single-propriete .fdp-main-column {
    min-width: 0;
  }

  body.single-propriete .fdp-contact-column {
    position: sticky;
    /* Same stack as findar-property-detail-v2.css. This used to hold a third
       independent value (76px against 74px against a 64px header). */
    top: calc(
    var(--findar-header-height-actual, var(--findar-header-height, 64px))
    + var(--findar-property-nav-height, 52px)
    + var(--findar-space-4, 16px)
  );
    margin-top: calc(-1 * var(--fdp4-summary-lift, 0px));
    z-index: 12;
  }

  body.single-propriete .fdp-contact-card {
    border: 1px solid #dfe4eb;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(15,23,42,.07);
  }

  body.single-propriete .fdp4-contact-title {
    padding: 16px 18px 12px;
    border-bottom: 1px solid #edf0f4;
  }

  body.single-propriete .fdp4-contact-title strong {
    display: block;
    color: #111827;
    font-size: 18px;
    font-weight: 900;
    line-height: 1.2;
  }

  body.single-propriete .fdp4-contact-title span {
    display: block;
    margin-top: 4px;
    color: #6b7280;
    font-size: 11px;
    line-height: 1.4;
  }

  body.single-propriete .fdp-contact-head {
    padding: 14px 18px;
  }

  body.single-propriete .fdp-contact-body {
    padding: 14px 18px 17px;
  }

  body.single-propriete .fdp-contact-action {
    min-height: 44px;
    border-radius: 9px;
    font-size: 13px;
  }

  /* One coherent reading flow instead of a stack of heavy cards. */
  /* Denser vertical rhythm. The page reads as a dossier, not a magazine:
     sections sit close enough that the eye moves between them without a
     deliberate scroll. */
  body.single-propriete .fdp-section {
    padding: 20px 0;
    border-bottom: 1px solid #e6e9ee;
  }

  body.single-propriete .fdp-section:first-child {
    padding-top: 0;
  }

  body.single-propriete .fdp-section-heading {
    margin-bottom: 15px;
  }

  body.single-propriete .fdp-eyebrow {
    margin-bottom: 3px;
    font-size: 10px;
    letter-spacing: .075em;
  }

  body.single-propriete .fdp-section h2 {
    font-size: 23px;
    line-height: 1.15;
  }

  body.single-propriete .fdp-section-heading p,
  body.single-propriete .fdp-section-intro {
    margin-top: 5px;
    font-size: 13px;
    line-height: 1.5;
  }

  body.single-propriete .fdp-description {
    max-width: none;
    font-size: 15px;
    line-height: 1.65;
  }

  /* Three columns, not two: the eight facts fit in three rows instead of
     four, keeping the density tight. */
  body.single-propriete .fdp-detail-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0;
    overflow: hidden;
    border: 1px solid #e2e6ec;
    border-radius: 12px;
    background: #fff;
  }

  body.single-propriete .fdp-detail-item {
    min-height: 48px;
    padding: 8px 14px;
    border: 0;
    border-bottom: 1px solid #e8ebef;
    border-radius: 0;
    background: #fff;
  }

  /* Separators follow the three columns: every item except the last of a row. */
  body.single-propriete .fdp-detail-item:not(:nth-child(3n)) {
    border-right: 1px solid #e8ebef;
  }

  body.single-propriete .fdp-detail-item span {
    font-size: 10px;
  }

  body.single-propriete .fdp-detail-item strong {
    font-size: 14px;
  }

  body.single-propriete .fdp-neighborhood-browser,
  body.single-propriete .fdp3-page-map-card,
  body.single-propriete .fdp-quartier-card,
  body.single-propriete .fdp3-climate-rows {
    border-radius: 12px;
    box-shadow: none;
  }

  body.single-propriete .fdp-neighborhood-workspace {
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
    min-height: 405px;
  }

  body.single-propriete .fdp-map-frame,
  body.single-propriete .fdp-map-frame #findar-map,
  body.single-propriete .fdp-map-frame .findar-map {
    min-height: 405px;
  }

  body.single-propriete .fdp-neighborhood-results {
    min-height: 405px;
    max-height: 405px;
  }

  body.single-propriete .fdp3-page-map-canvas {
    height: 315px;
  }

  body.single-propriete .fdp-quartier-card {
    background: #fff;
  }

  body.single-propriete .fdp-sun-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.single-propriete .fdp-sun-card {
    min-height: 76px;
    border-color: #ebe3ce;
    border-radius: 11px;
  }

  body.single-propriete .fdp-decision {
    margin-top: 28px;
    padding: 18px 20px;
    border-radius: 14px;
  }

  body.single-propriete .fdp3-similar-grid {
    gap: 14px;
  }

  body.single-propriete .fdp3-similar-card {
    border-radius: 12px;
    box-shadow: none;
  }

  body.single-propriete .fdp3-similar-media {
    height: 165px;
  }

  body.single-propriete .findar-results-publish-cta {
    width: min(var(--fdp4-content-max), calc(100% - 48px));
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 1023px) {
  body.single-propriete .fdp-gallery-more {
    display: none !important;
  }

  body.single-propriete .fdp4-contact-title {
    display: none !important;
  }
}
