/* =========================================================
   Ocean Key Realty – RESPONSIVE LAYOUTS
   ---------------------------------------------------------
   ≥ 1280px   Desktop – the fixed 1280px design in styles.css
   1024–1279  Desktop scaled down to fit (js/main.js)
   768–1023   TABLET  – same look as desktop, re-flowed
   ≤ 767      MOBILE  – compact, single column, burger menu
   The desktop layout positions elements absolutely; below
   1024px everything is reset to normal flow (the `[style]`
   resets below cancel the inline desktop coordinates).
   ========================================================= */

/* ---------- Desktop: wrappers are invisible, burger hidden ---------- */
.nav-panel, .nav-left, .hero-meta, .ph-row, .f-nav, .f-reach, .process picture { display: contents; }
.nav-right { display: flex; }                      /* (already flex in styles.css) */
.menu-btn { display: none; }
.band-track { display: contents; }
.band-track span:nth-child(n+2) { display: none; }   /* extra copies are only used by the mobile ticker */

/* =========================================================
   TABLET + MOBILE (shared rules)
   ========================================================= */
@media (max-width: 1023px) {
  :root {
    --pad: clamp(22px, 5.2vw, 48px);
    --overlap: 140px;                    /* how far the hero form card dips into the next section */
  }

  .in { width: auto; max-width: none; height: auto; padding-left: var(--pad); padding-right: var(--pad); }
  .in > *, .card > * { position: static; }
  /* cancel the inline desktop coordinates */
  .in [style*="px"]:not(i) { left: auto !important; top: auto !important; width: auto !important; }

  .h-display {
    font-size: clamp(28px, 5.2vw, 40px);
    line-height: 1.19;
    letter-spacing: .05em;
  }
  .body { font-size: clamp(14px, 2.05vw, 16px); line-height: 1.6; }
  .btn { height: 44px; padding: 0 26px; width: auto !important; }
  .btn.btn-navy, .btn.btn-blue { font-size: 15px; }

  .f { width: 100%; height: 46px; padding: 0 16px; font-size: 16px; }
  .f-area { width: 100%; height: 120px; padding: 13px 16px; }

  /* ---------- HERO ---------- */
  .hero { height: auto; }
  .hero::after {
    top: auto; bottom: 0; height: 92%;
    background: linear-gradient(to bottom, rgba(47,61,89,0) 0%, rgba(47,61,89,.5) 20%, rgba(47,61,89,.72) 42%, rgba(47,61,89,.78) 100%);
  }
  .hero .in { display: flex; flex-direction: column; padding-top: 26px; }

  .in > .nav { position: relative; display: flex; flex-direction: column; align-items: center; gap: 24px; }
  .logo { position: static; order: -1; width: clamp(190px, 28vw, 240px); height: auto; }
  .logo img { width: 100%; height: auto; }
  .nav-panel { display: flex; align-items: center; justify-content: center; gap: 38px; }
  .nav-left, .nav-right { display: flex; align-items: center; gap: 38px; position: static; height: auto; }
  .nav-link { position: static; height: auto; line-height: 24px; }

  .hero-place, .hero-tag, .nav-link { text-shadow: 0 1px 14px rgba(47, 61, 89, .6); }
  .hero-meta { display: block; order: 1; margin-top: clamp(110px, 19vw, 170px); text-align: right; }
  .hero-place { position: static; font-size: clamp(14px, 2.4vw, 20px); line-height: 1.6; }
  .hero-tag   { position: static; font-size: clamp(12px, 1.9vw, 15px); line-height: 1.6; white-space: normal; }
  .hero-title {
    position: static; order: 2; width: auto;
    margin-top: clamp(4px, 1vw, 10px);
    font-size: clamp(50px, 9.6vw, 96px); line-height: 1; letter-spacing: .05em;
  }

  .card-top {
    position: relative; left: auto; top: auto; order: 3; z-index: 2;
    width: auto; height: auto;
    margin: clamp(10px, 2vw, 18px) 0 calc(var(--overlap) * -1);
    padding: clamp(26px, 4.4vw, 38px) clamp(22px, 4.4vw, 40px) clamp(28px, 4.6vw, 40px);
    display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px;
  }
  .card-top input[type="hidden"], .card-contact input[type="hidden"] { display: none; }
  .card-ask {
    grid-column: 1 / -1; position: static;
    font-size: clamp(15px, 2.5vw, 20px); line-height: 1.4; white-space: normal;
    margin-bottom: 4px;
  }
  .card-top .btn, .card-contact .btn { grid-column: 1 / -1; justify-self: center; min-width: 220px; margin-top: 8px; }

  /* ---------- A NEW PERSPECTIVE ---------- */
  .perspective { height: auto; padding: calc(var(--overlap) + clamp(48px, 7vw, 72px)) 0 clamp(56px, 8vw, 84px); }
  .perspective .in { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 48px); align-items: start; }

  /* ---------- THE PROCESS ---------- */
  .process { height: auto; padding: clamp(60px, 9.5vw, 104px) 0; }
  .process .in {
    --pw: clamp(180px, 28vw, 236px);
    display: grid;
    grid-template-columns: calc(var(--pw) * .277) var(--pw) minmax(0, 1fr);
    column-gap: 0;
    align-items: start;
  }
  /* sand strip: desktop only */
  .sand { display: none; }
  .process-photo { position: static; grid-column: 2; grid-row: 1 / span 12; width: 100%; height: auto; aspect-ratio: 274 / 614; }
  .process .h-display, .process .body, .step, .step-d { grid-column: 3; padding-left: clamp(28px, 6vw, 56px); }
  .process .h-display { margin-top: 0; }
  .process .in > .body:first-of-type { margin-top: 16px; }
  .step { position: static; width: auto; font-size: clamp(15px, 2.55vw, 20px); line-height: 1.4; margin-top: clamp(18px, 3vw, 28px); }
  .step-d, html[lang="fr"] .step-d, html[lang="es"] .step-d { position: static; width: auto; margin-top: 4px; }

  /* ---------- PICTURE YOUR ISLAND LIFE ---------- */
  .picture { height: auto; padding: clamp(60px, 9vw, 100px) 0; }
  .picture .in { display: grid; grid-template-columns: 40% minmax(0, 1fr); column-gap: clamp(20px, 3.4vw, 32px); align-items: start; }
  .picture .h-display, .picture .body, .picture .btn { grid-column: 1; }
  .picture .body { margin-top: 20px; }
  .picture .btn { justify-self: start; margin-top: 28px; }
  .ph-row { display: flex; grid-column: 2; grid-row: 1 / span 3; align-self: center; gap: clamp(10px, 2vw, 16px); }
  .ph { position: static; flex: 1 1 0; min-width: 0; width: auto !important; height: auto !important; aspect-ratio: 255 / 365; }

  /* ---------- BAND ---------- */
  .band { height: 11.8vw; }
  .band span { top: 2.7vw; left: -.55vw; width: 103vw; font-size: 7.8vw; letter-spacing: .04em; line-height: 1.064; }

  /* ---------- HIGHLIGHTED PROPERTIES ---------- */
  .properties { height: auto; padding: clamp(60px, 9.5vw, 104px) 0 clamp(64px, 10vw, 110px); }
  .properties .in { display: grid; grid-template-columns: 1fr 1fr; column-gap: clamp(24px, 5vw, 48px); align-items: start; }
  .properties .in > .h-display { grid-column: 1; grid-row: 1 / span 2; }
  .properties .in > .body { grid-column: 2; grid-row: 1; text-align: right; }
  html[lang="fr"] .properties .body.right, html[lang="es"] .properties .body.right { left: auto !important; width: auto !important; }
  .properties .in > .btn { grid-column: 2; grid-row: 2; justify-self: end; margin-top: 18px; }

  .props-wrap { position: static; width: auto; grid-column: 1 / -1; margin-top: clamp(26px, 5vw, 46px); }
  .props { gap: clamp(12px, 2.4vw, 22px); padding: 12px 0 14px; }
  .prop { flex: 0 0 calc((100% - 2 * clamp(12px, 2.4vw, 22px)) / 3); }
  .prop h3 { margin: 14px 16px 0; font-size: clamp(16px, 2.5vw, 22px); line-height: 1.25; }
  .prop .loc { margin: 3px 16px 0; font-size: clamp(11px, 1.55vw, 13px); line-height: 1.45; }
  .prop .price { margin: 8px 16px 0; font-size: clamp(11.5px, 1.65vw, 14px); line-height: 1.5; }
  .meta { padding: 12px 16px 16px; gap: 8px; font-size: 14px; }
  .meta > span { line-height: 1; margin-right: 6px; }
  .meta > a { font-size: 13px; line-height: 1; }
  .props-nav { display: flex; justify-content: center; gap: 14px; margin-top: 18px; }
  .props-arrow { position: static; width: 42px; height: 42px; }

  /* ---------- POOL BAND ---------- */
  .poolband { height: 20.6vw; }

  /* ---------- CONTACT ---------- */
  .contact { height: auto; padding: clamp(56px, 9vw, 100px) 0; }
  .card-contact {
    position: relative; left: auto; top: auto; width: auto; height: auto;
    padding: clamp(32px, 6.4vw, 60px) clamp(24px, 6.4vw, 60px) clamp(34px, 6.4vw, 56px);
    display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px;
  }
  .card-contact .h-display { grid-column: 1 / -1; font-size: clamp(26px, 5.2vw, 40px); }
  .card-contact .body { grid-column: 1 / -1; margin-bottom: 14px; }
  .card-contact .f-area { grid-column: 1 / -1; }

  /* ---------- FOOTER ---------- */
  .footer { height: auto; padding: clamp(44px, 7vw, 64px) 0 clamp(36px, 6vw, 56px); }
  .footer .in { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; position: relative; z-index: 1; }
  .mono { position: absolute; left: -10px; top: auto; bottom: -34px; width: clamp(300px, 52vw, 440px); height: auto; z-index: -1; pointer-events: none; }
  .f-place { position: static; grid-column: 1; font-size: clamp(12px, 1.8vw, 14px); line-height: 1.4; white-space: nowrap; }
  .f-logo { position: static; grid-column: 2; justify-self: center; width: clamp(200px, 34vw, 290px); height: auto; }
  .f-logo img { width: 100%; height: auto; }
  .social { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: 14px; }
  .social a { position: static; display: block; width: 16px; height: 15px; overflow: hidden; }
  .f-nav { display: grid; grid-column: 1 / 3; grid-template-columns: auto auto; gap: 8px clamp(36px, 7vw, 64px); justify-content: start; margin-top: clamp(48px, 8vw, 72px); }
  .f-reach { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; grid-column: 3; margin-top: clamp(48px, 8vw, 72px); }
  .f-link { position: static; }
  .f-link.r { right: auto; font-size: 13px; }
  .f-nav .f-link:nth-child(1) { grid-column: 1; grid-row: 1; }
  .f-nav .f-link:nth-child(2) { grid-column: 1; grid-row: 2; }
  .f-nav .f-link:nth-child(3) { grid-column: 2; grid-row: 1; }
  .f-nav .f-link:nth-child(4) { grid-column: 2; grid-row: 2; }
}

/* =========================================================
   MOBILE (≤ 767px) – compact, single column
   ========================================================= */
@media (max-width: 767px) {
  :root { --pad: 22px; --overlap: 150px; }

  .h-display { font-size: clamp(26px, 7.6vw, 32px); letter-spacing: .045em; }
  .body { font-size: 14.5px; line-height: 1.62; }

  /* ---- Hero + burger menu ---- */
  .hero .in { padding-top: 18px; }
  .in > .nav { flex-direction: row; justify-content: space-between; align-items: center; gap: 0; }
  .logo { order: 0; width: 148px; }
  .menu-btn {
    display: flex; flex-direction: column; justify-content: center; gap: 7px;
    position: relative; z-index: 120;
    width: 44px; height: 44px; margin-right: -10px; padding: 0 10px;
    background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  .menu-btn span { display: block; height: 1px; background: var(--cream); transition: transform .45s var(--ease), opacity .3s ease; }
  html.menu-open .menu-btn span:nth-child(1) { transform: translateY(4px) rotate(45deg); }
  html.menu-open .menu-btn span:nth-child(2) { transform: translateY(-4px) rotate(-45deg); }

  .nav-panel {
    position: fixed; inset: 0; z-index: 110;
    flex-direction: column; justify-content: center; gap: 26px;
    background: rgba(47, 61, 89, .97);
    -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
    opacity: 0; visibility: hidden;
    transition: opacity .45s var(--ease), visibility 0s linear .45s;
  }
  html.menu-open .nav-panel { opacity: 1; visibility: visible; transition: opacity .45s var(--ease), visibility 0s; }
  html.menu-open { overflow: hidden; }
  .nav-left, .nav-right { flex-direction: column; gap: 26px; }
  .nav-panel .nav-link {
    font-family: var(--font-display); font-size: 30px; line-height: 1.2; letter-spacing: .08em; text-transform: uppercase;
    animation: none !important;
  }
  .nav-panel .lang { font-size: 15px; margin-top: 8px; }

  .hero-meta { margin-top: 150px; text-align: left; }
  .hero-place { font-size: 15px; }
  .hero-tag { font-size: 13px; margin-top: 2px; }
  .hero-title { font-size: 10.8vw; letter-spacing: .045em; margin-top: 22px; }
  .hero-media video { object-position: 58% center; }
  /* navy fade starts higher so the place name / tagline always have a dark backdrop */
  .hero::after {
    top: auto; bottom: 0; height: 92%;
    background: linear-gradient(to bottom, rgba(47,61,89,0) 0%, rgba(47,61,89,.5) 20%, rgba(47,61,89,.72) 42%, rgba(47,61,89,.78) 100%);
  }

  .card-top { grid-template-columns: 1fr; margin-top: 10px; padding: 26px 20px 28px; gap: 12px; }
  .card-ask { font-size: 15px; }
  .card-top .btn, .card-contact .btn { width: 100% !important; margin-top: 6px; }

  /* ---- Perspective ---- */
  .perspective .in { grid-template-columns: 1fr; gap: 18px; text-align: center; }

  /* ---- Process ---- */
  .process { padding: 56px 0 60px; }
  .process .in { --pw: 100%; grid-template-columns: minmax(0, 1fr); }
  .process .h-display, .process .body, .step, .step-d { grid-column: 1 / -1; padding-left: 0; }
  .process .h-display { order: 1; }
  .process .in > .body:first-of-type { order: 2; margin-top: 14px; }
  .process-photo { order: 3; grid-column: 1 / -1; grid-row: auto; margin-top: 30px; aspect-ratio: 5 / 4; object-fit: cover; }
  .step, .step-d { order: 4; }
  .step { margin-top: 26px; font-size: 16px; padding-top: 22px; border-top: 1px solid rgba(154, 184, 203, .45); }
  .step + .step-d { margin-top: 2px; }
  .step:nth-of-type(1) { margin-top: 36px; border-top: 0; padding-top: 0; }

  /* ---- Picture your island life: umbrella photo on top, inset on the beige ---- */
  .picture { padding: var(--pad) 0 56px; display: flex; flex-direction: column; }
  .picture-left { display: none; }
  .picture-right {
    position: relative; order: -1; top: auto; right: auto; bottom: auto; left: auto;
    width: auto; height: auto; aspect-ratio: 16 / 11; margin: 0 var(--pad);
    background: url("../images/umbrella-tall.jpg") 60% 30% / cover no-repeat;
  }
  .picture .in { display: block; position: relative; margin-top: 38px; min-width: 0; width: 100%; }
  .picture .btn { margin-top: 24px; }
  .ph-row { display: none; }                      /* the two couple photos are desktop + tablet only */

  /* ---- Band: one-line ticker ---- */
  .band { height: auto; padding: 0; display: flex; align-items: center; overflow: hidden; }
  .band-track { display: flex; width: max-content; padding: 30px 0; animation: ticker 26s linear infinite; will-change: transform; }
  .band-track span:nth-child(n+2) { display: block; }
  .band span {
    position: static; display: block; flex: none; width: auto; white-space: nowrap;
    padding-right: .9em; font-size: 10.4vw; letter-spacing: .05em; line-height: 1.1; transform: none !important;
  }

  /* ---- Properties: swipeable cards ---- */
  .properties { padding: 56px 0 44px; }
  .properties .in { display: block; padding-left: var(--pad); padding-right: var(--pad); }
  .properties .in > .body { margin-top: 16px; text-align: left; }
  .properties .in > .btn { margin-top: 22px; }
  .props-wrap { margin: 28px 0 0; }
  .props { align-items: stretch; gap: 14px; margin: 0 calc(var(--pad) * -1); padding: 14px var(--pad) 16px; scroll-padding-left: var(--pad); }
  .prop { flex: 0 0 74%; max-width: 320px; }
  .prop h3 { font-size: 22px; }
  .prop .loc { font-size: 13px; }
  .prop .price { font-size: 13px; }
  .meta > a { font-size: 13px; }

  .poolband { height: auto; aspect-ratio: 16 / 9; background: url("../images/pool-full.jpg") center / cover no-repeat; }

  /* ---- Contact ---- */
  .contact { padding: 44px 0 56px; }
  .card-contact { grid-template-columns: 1fr; padding: 30px 20px 30px; gap: 12px; }
  .card-contact .h-display { font-size: clamp(24px, 7vw, 30px); }

  /* ---- Footer: compact, same padding above the logo and below the last item ---- */
  .footer { padding: 46px 0; }
  .footer .in {
    grid-template-columns: 1fr; justify-items: center; text-align: center; row-gap: 0;
  }
  .f-logo { grid-column: 1; grid-row: 1; width: 230px; }
  .f-place, .f-nav { display: none; }            /* keep the mobile footer light */
  .f-reach { grid-column: 1; grid-row: 2; align-items: center; margin-top: 34px; }
  .social { grid-column: 1; grid-row: 3; justify-self: center; margin-top: 26px; gap: 20px; }
  .mono { width: 300px; bottom: -40px; opacity: .8; }
}

/* French is longer: keep the hero title inside the screen */
@media (max-width: 767px) {
  html[lang="fr"] .hero-title { font-size: 9.9vw; }
}

/* Small phones */
@media (max-width: 380px) {
  .hero-title { font-size: 10.4vw; }
  html[lang="fr"] .hero-title { font-size: 9.7vw; }
  .nav-panel .nav-link { font-size: 26px; }
}

/* French tablet: give the "La vie aux Caraïbes, simplement" title enough room for two lines */
@media (min-width: 768px) and (max-width: 1023px) {
  html[lang="fr"] .perspective .in { grid-template-columns: 1.3fr 1fr; }
  html[lang="fr"] .perspective .h-display { font-size: 4.4vw; }
}

/* =========================================================
   TABLET ONLY (768 – 1023px) – refinements
   ========================================================= */
@media (min-width: 768px) and (max-width: 1023px) {
  /* hero tagline on two lines */
  .br-tb { display: inline; }

  /* "Picture your island life": umbrella photo full height of the section */
  .picture-right { background: url("../images/umbrella-tall.jpg") 70% 100% / cover no-repeat; }

  /* Highlighted properties: tighter header, button under the 3 cards */
  .properties .in > .h-display { grid-row: 1; }
  .properties .in > .body { grid-row: 1; }
  .props-wrap { grid-row: 2; margin-top: 30px; }
  .properties .in > .btn { grid-column: 1 / -1; grid-row: 3; justify-self: center; margin-top: 36px; }

  /* Footer: "Dominican Republic" on two lines so it never touches the logo */
  .f-place { display: flex; align-items: flex-start; gap: 8px; white-space: normal; }
  .f-place img { margin: 4px 0 0; flex: none; }
  .f-place span { max-width: 8.5em; }
}

/* ---------- TABLET: "Finding your paradise" ----------
   Header (title | intro) → wide photo
   → steps as full-width rows (step | description). No more right-heavy column. */
@media (min-width: 768px) and (max-width: 1023px) {
  .process .in {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
    column-gap: clamp(24px, 5vw, 48px); row-gap: 0; align-items: start;
  }
  .process .in > .h-display { grid-column: 1; grid-row: 1; padding: 0; margin: 0 0 clamp(36px, 5.4vw, 52px); }
  .process .in > .body:first-of-type { grid-column: 2; grid-row: 1; padding: 0; margin: 6px 0 clamp(36px, 5.4vw, 52px); }

  .process .in > picture > .process-photo, .process .in > .process-photo {
    grid-column: 1 / -1; grid-row: 2; z-index: 1; position: relative; left: auto; top: auto;
    width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; margin: 0;
  }

  .process .in > .step, .process .in > .step-d {
    margin: 0; border-top: 1px solid rgba(154, 184, 203, .5);
  }
  .process .in > .step { grid-column: 1; padding: 24px 12px 22px 0; font-size: clamp(16px, 2.6vw, 21px); line-height: 1.4; }
  .process .in > .step-d { grid-column: 2; padding: 24px 0 22px; }
  .process .in > h3.step:first-of-type { margin-top: clamp(56px, 8vw, 76px); }
  .process .in > .step-d:nth-of-type(2) { margin-top: clamp(56px, 8vw, 76px); }
}

@keyframes ticker { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-50%, 0, 0); } }
