/* ==========================================================
   Apartments pages — builds on home-lively.css + about-lively.css
   ========================================================== */

/* ---------- Intro: quick facts ---------- */
.ap-facts { list-style: none; padding: 0; margin: 0 0 2.2rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; max-width: 30rem; }
.ap-facts li { display: flex; align-items: center; gap: .75rem; padding: .8rem 1rem; border-radius: 16px; background: #fff; border: 1px solid rgba(18,26,20,.08); font-size: .9rem; font-weight: 500; color: var(--cp-ink); transition: transform .4s var(--cp-ease), border-color .3s, box-shadow .4s; }
.ap-facts li:hover { transform: translateY(-3px); border-color: var(--cp-green); box-shadow: 0 14px 28px -18px rgba(18,26,20,.45); }
.ap-facts i { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 12px; background: rgba(134,169,0,.12); color: var(--cp-green); font-size: 1.1rem; flex-shrink: 0; }

/* ---------- Layouts with tabs ---------- */
.ap-layouts { padding: clamp(5rem, 10vw, 8rem) 0; background: var(--cp-sand); }
.ap-layouts-lead { max-width: 30rem; margin: 0; }
.ap-tabs-wrap.cp-reveal { transform: translateY(30px); }
.ap-tabs { position: relative; display: inline-flex; gap: .3rem; padding: .35rem; margin-bottom: 2rem; border-radius: 999px; background: #fff; box-shadow: 0 14px 30px -22px rgba(18,26,20,.5); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.ap-tabs::-webkit-scrollbar { display: none; }
.ap-tab { position: relative; z-index: 1; display: inline-flex; flex-direction: column; align-items: center; padding: .7rem 1.5rem; border: 0; border-radius: 999px; background: none; cursor: pointer; color: var(--cp-ink); font-family: var(--cp-sans); white-space: nowrap; transition: color .4s; }
.ap-tab-name { font-size: .82rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; }
.ap-tab-area { font-size: .72rem; opacity: .6; margin-top: .1rem; }
.ap-tab.is-active { color: #fff; }
.ap-tab-ink { position: absolute; z-index: 0; top: .35rem; bottom: .35rem; left: 0; width: 0; border-radius: 999px; background: var(--cp-ink); transition: transform .6s var(--cp-ease), width .6s var(--cp-ease); }

.ap-panel { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; padding: clamp(1.5rem, 3vw, 2.5rem); border-radius: 30px; background: #fff; box-shadow: 0 40px 80px -50px rgba(18,26,20,.5); }
.ap-panel[hidden] { display: none; }
.ap-panel.is-entering .ap-plan { animation: ap-in-left .9s var(--cp-ease) both; }
.ap-panel.is-entering .ap-info > * { animation: ap-in-up .8s var(--cp-ease) both; }
.ap-panel.is-entering .ap-info > *:nth-child(2) { animation-delay: .05s; }
.ap-panel.is-entering .ap-info > *:nth-child(3) { animation-delay: .1s; }
.ap-panel.is-entering .ap-info > *:nth-child(4) { animation-delay: .15s; }
.ap-panel.is-entering .ap-info > *:nth-child(5) { animation-delay: .2s; }
.ap-panel.is-entering .ap-info > *:nth-child(6) { animation-delay: .25s; }
@keyframes ap-in-left { from { opacity: 0; transform: translateX(-30px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes ap-in-up { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.ap-plan { position: relative; }
.ap-plan-main { position: relative; display: block; border-radius: 22px; overflow: hidden; background: #f6f3ec; aspect-ratio: 4 / 3.2; }
.ap-plan-main img { width: 100%; height: 100%; object-fit: contain; padding: 1rem; transition: transform 1.2s var(--cp-ease); }
.ap-plan-main:hover img { transform: scale(1.05); }
.ap-zoom { position: absolute; right: 1rem; top: 1rem; display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: rgba(18,26,20,.8); color: #fff; font-size: 1.1rem; opacity: 0; transform: scale(.7); transition: opacity .3s, transform .5s var(--cp-ease); }
a:hover > .ap-zoom, a:focus-visible > .ap-zoom { opacity: 1; transform: none; }
.ap-plan-detail { position: absolute; left: 1.2rem; bottom: -1.4rem; display: flex; align-items: center; gap: .8rem; padding: .5rem 1rem .5rem .5rem; border-radius: 16px; background: var(--cp-ink); color: #fff !important; text-decoration: none; font-size: .78rem; letter-spacing: .08em; box-shadow: 0 18px 36px -18px rgba(0,0,0,.6); transition: transform .4s var(--cp-ease); }
.ap-plan-detail:hover { transform: translateY(-3px); }
.ap-plan-detail img { width: 3.4rem; height: 3.4rem; object-fit: cover; border-radius: 10px; background: #fff; }

.ap-type { display: inline-block; padding: .35rem .9rem; border-radius: 999px; background: rgba(200,164,93,.16); color: #9a7a35; font-size: .72rem; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; margin-bottom: 1rem; }
.ap-info h3 { font-family: var(--cp-serif) !important; font-weight: 400; font-size: clamp(2rem, 3.4vw, 2.8rem) !important; line-height: 1.05; margin: 0 0 .9rem; color: var(--cp-ink); }
.ap-info > p { color: var(--cp-muted); line-height: 1.8; font-weight: 300; margin: 0 0 1.6rem; }
.ap-area { display: flex; align-items: flex-end; gap: .6rem; margin-bottom: 1.6rem; }
.ap-area-num { font-family: var(--cp-serif); font-size: clamp(3.6rem, 6vw, 5rem); line-height: .85; color: var(--cp-green-deep); }
.ap-area-unit { font-size: 1rem; font-weight: 500; line-height: 1.1; color: var(--cp-ink); padding-bottom: .3rem; }
.ap-area-unit small { font-size: .72rem; font-weight: 400; color: var(--cp-muted); letter-spacing: .1em; text-transform: uppercase; }
.ap-specs { list-style: none; padding: 0; margin: 0 0 2rem; display: grid; grid-template-columns: 1fr 1fr; gap: .6rem 1rem; }
.ap-specs li { display: flex; align-items: center; gap: .65rem; font-size: .9rem; color: var(--cp-ink); }
.ap-specs i { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 10px; background: #f3efe5; color: var(--cp-green-deep); font-size: 1rem; flex-shrink: 0; }

/* ---------- Gallery ---------- */
.ap-gallery { padding: clamp(5rem, 10vw, 8rem) 0; }
.ap-gallery-hint { margin: 0; font-size: .82rem; color: var(--cp-muted); display: inline-flex; align-items: center; gap: .4rem; }
.ap-grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 14rem; grid-auto-flow: dense; gap: 1rem; }
.ap-shot { position: relative; display: block; overflow: hidden; border-radius: 20px; background: #ece6d8; }
.ap-shot:nth-child(6n + 1) { grid-column: span 2; grid-row: span 2; }
.ap-shot:nth-child(6n + 4) { grid-row: span 2; }
.ap-shot img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s var(--cp-ease), filter .6s; }
.ap-shot[href$=".png"] img { object-fit: contain; background: #fff; padding: .6rem; }
.ap-shot::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 55%, rgba(0,0,0,.35)); opacity: 0; transition: opacity .5s; }
.ap-shot:hover img { transform: scale(1.08); }
.ap-shot:hover::after { opacity: 1; }
.ap-shot .ap-zoom { z-index: 1; }

/* ---------- Lightbox ---------- */
.ap-lb { position: fixed; inset: 0; z-index: 2000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; padding: 4.5rem 5.5rem 1.5rem; background: rgba(8,12,9,.96); opacity: 0; visibility: hidden; transition: opacity .4s ease, visibility 0s linear .4s; font-family: 'Poppins', sans-serif; }
.ap-lb.is-open { opacity: 1; visibility: visible; transition-delay: 0s; }
.ap-lb-stage { display: flex; align-items: center; justify-content: center; min-height: 0; max-width: 100%; }
/* size the photo against the screen so the whole image always fits */
.ap-lb-img { box-sizing: border-box; display: block; width: auto; height: auto; max-width: calc(100vw - 11rem); max-height: calc(100vh - 9rem); max-height: calc(100dvh - 9rem); object-fit: contain; border-radius: 12px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.8); transform: scale(.94); opacity: 0; transition: transform .6s cubic-bezier(.19,1,.22,1), opacity .4s; }
.ap-lb-img.is-png { background: #fff; padding: 1rem; }
.ap-lb.is-open .ap-lb-img.is-loaded { transform: none; opacity: 1; }
/* spinner while a large photo loads */
.ap-lb-stage { position: relative; }
.ap-lb-stage::before { content: ""; position: absolute; left: 50%; top: 50%; width: 2.6rem; height: 2.6rem; margin: -1.3rem 0 0 -1.3rem; border-radius: 50%; border: 2px solid rgba(255,255,255,.2); border-top-color: #e9d8a6; animation: ap-spin .8s linear infinite; opacity: 0; transition: opacity .3s; pointer-events: none; }
.ap-lb.is-loading .ap-lb-stage::before { opacity: 1; }
@keyframes ap-spin { to { transform: rotate(360deg); } }
.ap-lb.is-loading .ap-lb-img:not(.is-loaded) { min-width: 4rem; min-height: 4rem; }
.ap-lb-btn { position: absolute; display: grid; place-items: center; width: 3.2rem; height: 3.2rem; border: 0; border-radius: 50%; background: rgba(255,255,255,.1); color: #fff; font-size: 1.5rem; cursor: pointer; transition: background .3s, transform .4s cubic-bezier(.19,1,.22,1); }
.ap-lb-btn:hover { background: rgba(255,255,255,.22); }
.ap-lb-close { top: 1.2rem; right: 1.2rem; }
.ap-lb-close:hover { transform: rotate(90deg); }
.ap-lb-prev { left: 1.2rem; top: 50%; transform: translateY(-50%); }
.ap-lb-next { right: 1.2rem; top: 50%; transform: translateY(-50%); }
.ap-lb-prev:hover { transform: translateY(-50%) translateX(-3px); }
.ap-lb-next:hover { transform: translateY(-50%) translateX(3px); }
.ap-lb-bar { flex-shrink: 0; text-align: center; color: rgba(255,255,255,.8); font-size: .85rem; letter-spacing: .06em; }
.ap-lb-bar b { color: #e9d8a6; font-weight: 500; margin-right: .6rem; }
body.ap-lock { overflow: hidden; }

/* ---------- Other apartments ---------- */
.ap-others { padding: 0 0 clamp(5rem, 10vw, 8rem); }
.ap-others-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 3vw, 2.75rem); }
.ap-others .cp-apt { aspect-ratio: 16 / 11; }

/* ==========================================================
   Overview page (apartments.php)
   ========================================================== */
.ov-types { padding: clamp(5rem, 10vw, 8rem) 0; background: var(--cp-sand); }
.ov-type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.5rem, 2.6vw, 2.5rem); }
.ov-card { position: relative; display: flex; flex-direction: column; overflow: hidden; border-radius: 28px; background: #fff; color: var(--cp-ink) !important; text-decoration: none; box-shadow: 0 30px 60px -40px rgba(18,26,20,.5); transition: transform .7s var(--cp-ease), box-shadow .7s var(--cp-ease); }
.ov-card:hover { transform: translateY(-10px); box-shadow: 0 40px 70px -35px rgba(18,26,20,.55); }
.ov-card-img { position: relative; aspect-ratio: 4 / 3; overflow: hidden; }
.ov-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.4s var(--cp-ease); }
.ov-card:hover .ov-card-img img { transform: scale(1.08); }
.ov-card-size { position: absolute; left: 1rem; bottom: 1rem; padding: .45rem .9rem; border-radius: 999px; background: rgba(18,26,20,.75); backdrop-filter: blur(6px); color: #fff; font-size: .78rem; letter-spacing: .06em; }
.ov-card-body { padding: 1.8rem 1.8rem 2rem; display: flex; flex-direction: column; flex: 1; }
.ov-card-body h3 { font-family: var(--cp-serif) !important; font-size: 2.1rem !important; font-weight: 400; margin: 0 0 .6rem; }
.ov-card-body p { color: var(--cp-muted); font-size: .92rem; line-height: 1.7; font-weight: 300; margin: 0 0 1.3rem; }
.ov-card-specs { list-style: none; padding: 0; margin: 0 0 1.6rem; display: flex; flex-wrap: wrap; gap: .45rem; }
.ov-card-specs li { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .75rem; border-radius: 999px; background: #f3efe5; font-size: .76rem; }
.ov-card-specs i { color: var(--cp-green); }
.ov-card-go { margin-top: auto; display: inline-flex; align-items: center; gap: .7rem; font-size: .75rem; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; }
.ov-card-go i { display: grid; place-items: center; width: 2.3rem; height: 2.3rem; border-radius: 50%; background: var(--cp-ink); color: #fff; font-size: 1.05rem; transition: transform .5s var(--cp-ease), background .4s; }
.ov-card:hover .ov-card-go i { transform: rotate(45deg); background: var(--cp-green); }

.ov-amenity { padding: clamp(4rem, 8vw, 6.5rem) 0; }
.ov-amenity:nth-of-type(even) { background: var(--cp-sand); }
.ov-amenity .cp-intro-main { aspect-ratio: 5 / 4; }
.ov-amenity .cp-intro-visual { padding-bottom: 3rem; }
.ov-amenity .cp-intro-inset { width: 42%; }
.ov-amenity .cp-lead { max-width: 36rem; }
.ov-amenity-icon { display: inline-grid; place-items: center; width: 3.6rem; height: 3.6rem; border-radius: 18px; background: var(--cp-ink); color: var(--cp-gold-soft); font-size: 1.6rem; margin-bottom: 1.4rem; }
.ov-perk { display: flex; align-items: flex-start; gap: .9rem; margin-top: 1.4rem; padding: 1.1rem 1.3rem; border-radius: 18px; background: rgba(134,169,0,.1); border: 1px solid rgba(134,169,0,.25); max-width: 36rem; }
.ov-perk i { color: var(--cp-green); font-size: 1.4rem; margin-top: .1rem; }
.ov-perk p { margin: 0; font-size: .9rem; line-height: 1.7; color: var(--cp-ink); }

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
  .ap-panel { grid-template-columns: 1fr; }
  .ap-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 11rem; }
  .ov-type-grid { grid-template-columns: 1fr 1fr; }
  .ov-type-grid .ov-card:last-child { grid-column: span 2; }
}
@media (max-width: 768px) {
  .ap-facts { grid-template-columns: 1fr 1fr; }
  .ap-facts li { padding: .7rem .8rem; font-size: .82rem; }
  .ap-tabs { display: flex; }
  .ap-tab { flex: 1; padding: .6rem 1rem; }
  .ap-panel { padding: 1rem; border-radius: 24px; }
  .ap-plan-detail { position: static; margin-top: 1rem; }
  .ap-specs { grid-template-columns: 1fr; }
  .ap-grid { grid-auto-rows: 9rem; gap: .6rem; }
  .ap-shot { border-radius: 14px; }
  .ap-zoom { opacity: 1; transform: none; width: 2.1rem; height: 2.1rem; font-size: .9rem; }
  .ap-others-grid { grid-template-columns: 1fr; gap: 1.6rem; }
  .ap-others .cp-apt { aspect-ratio: 4 / 3.4; }
  .ov-type-grid { grid-template-columns: 1fr; }
  .ov-type-grid .ov-card:last-child { grid-column: auto; }
  .ap-lb-prev, .ap-lb-next { top: auto; bottom: 3.5rem; transform: none; }
  .ap-lb-prev:hover, .ap-lb-next:hover { transform: none; }
  .ap-lb { padding: 4.2rem .8rem 6rem; }
  .ap-lb-img { max-width: calc(100vw - 1.6rem); max-height: calc(100dvh - 12rem); }
  .ap-lb-bar { position: absolute; left: 0; right: 0; bottom: 1.6rem; }
  .ap-lb-prev { left: 1rem; bottom: 1rem; }
  .ap-lb-next { right: 1rem; bottom: 1rem; }
}
@media (prefers-reduced-motion: reduce) {
  .ap-panel.is-entering .ap-plan, .ap-panel.is-entering .ap-info > * { animation: none; }
}

/* overview page: amenity header + alternating backgrounds + footer straddle colour */
.ov-amenities-head { padding: clamp(5rem, 10vw, 8rem) 0 1rem; }
.ov-amenities-head .cp-heading { margin-left: auto !important; margin-right: auto !important; }
.ov-amenities-head .cp-eyebrow::after { content: ""; width: 2.6rem; height: 1px; background: currentColor; }
.ov-amenity:nth-of-type(even) { background: transparent; }
.ov-amenity--sand { background: var(--cp-sand) !important; }
body:has(.ov-amenity--sand:last-of-type) .footer-cta-wrap { --above: #efe6d4; }
