/* ============================================
   Apartments page (apartments-phase-2.html)
   Same layout as serampore-html/apartments.html: a sticky section bar, the
   typical floor plan with its flat types and legend, flat cards that open a
   flat sheet, and a full-screen plan viewer.
   Loaded after style.css and project.css. Only ap-* rules.
   ============================================ */

.ap-hero svg, .ap-bar svg, .ap-sec svg, .ap-modal svg, .ap-lb svg{fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;}
:root{--ap-ease: cubic-bezier(0.22, 1, 0.36, 1);}

/* ---------- Banner ---------- */
.ap-hero{position: relative; overflow: hidden; isolation: isolate; display: flex; min-height: 600px; background: rgb(18, 22, 26); color: #ffffff;}
.ap-hero-bg{position: absolute; inset: 0; z-index: -2;}
.ap-hero-bg img{width: 100%; height: 100%; object-fit: cover; object-position: 55% 45%; display: block; transform: scale(1.1); animation: apKen 16s var(--ap-ease) forwards;}
@keyframes apKen{to{transform: scale(1);}}
.ap-hero-shade{position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(12, 14, 16, 0.78) 0%, rgba(12, 14, 16, 0.42) 42%, rgba(12, 14, 16, 0.05) 78%), linear-gradient(180deg, rgba(12, 14, 16, 0.15) 0%, rgba(12, 14, 16, 0) 40%, rgba(12, 14, 16, 0.5) 100%);}
.ap-hero-inner{flex: 1; display: flex; align-items: center; width: 100%; max-width: 1400px; margin: 0 auto; padding: clamp(28px, 5vh, 64px) clamp(16px, 4vw, 56px);}
.ap-hero-copy{max-width: 640px; animation: sol-rise 900ms ease both;}
.ap-hero .pj-badge{margin-bottom: 22px;}
.ap-hero .pj-hero2-title{font-size: clamp(52px, 6.4vw, 104px);}
.ap-hero .pj-hero2-lead{max-width: 440px;}

/* ---------- Sticky section bar ---------- */
.ap-bar{position: sticky; top: var(--ap-nav-h, 76px); z-index: 50; background: rgba(255, 255, 255, 0.9); -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2); box-shadow: 0 1px 0 rgba(26, 20, 16, 0.07), 0 14px 30px -26px rgba(26, 20, 16, 0.35);}
.ap-bar-inner{position: relative; display: flex; align-items: center; gap: 6px; max-width: 1320px; margin: 0 auto; padding: 10px clamp(16px, 4vw, 56px) 12px; overflow-x: auto; scrollbar-width: none;}
.ap-bar-inner::-webkit-scrollbar{display: none;}
.ap-bar-k{margin-right: auto; padding-right: 16px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: rgb(140, 122, 110); white-space: nowrap;}
.ap-bar-link{display: inline-flex; align-items: center; gap: 10px; flex: 0 0 auto; min-height: 42px; padding: 0 18px 0 7px; border-radius: 99px; font-size: 14px; font-weight: 500; color: rgb(61, 49, 41); white-space: nowrap; transition: background 260ms ease, color 260ms ease;}
.ap-bar-link b{display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: rgba(240, 90, 40, 0.1); font-family: "Source Serif 4", Georgia, serif; font-size: 13px; font-weight: 500; color: rgb(240, 90, 40); transition: background 260ms ease, color 260ms ease;}
.ap-bar-link:hover{background: #fff9f7; color: rgb(26, 20, 16);}
.ap-bar-link.is-active{background: rgb(26, 20, 16); color: #ffffff;}
.ap-bar-link.is-active b{background: rgb(240, 90, 40); color: #ffffff;}
.ap-bar-progress{position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(26, 20, 16, 0.06);}
.ap-bar-progress i{display: block; height: 100%; background: linear-gradient(90deg, rgb(226, 74, 26), rgb(240, 90, 40) 60%, rgb(247, 162, 75)); transform: scaleX(var(--p, 0)); transform-origin: left;}

/* ---------- Section heads ---------- */
.ap-sec{scroll-margin-top: calc(var(--ap-nav-h, 76px) + 64px);}
.ap-head{display: flex; align-items: center; justify-content: space-between; gap: 22px 48px; flex-wrap: wrap; margin-bottom: clamp(24px, 2.8vw, 38px);}
.ap-title{font-size: clamp(34px, 4.2vw, 60px); font-weight: 500; line-height: 1.02; letter-spacing: -0.04em; color: rgb(26, 20, 16);}
.ap-title em{display: block; font-family: "Source Serif 4", Georgia, serif; font-style: italic; font-weight: 400; letter-spacing: -0.02em; color: rgb(240, 90, 40);}
.ap-intro{max-width: 400px; padding-left: 16px; border-left: 2px solid rgb(240, 90, 40); font-family: "Source Serif 4", Georgia, serif; font-size: clamp(15px, 1.2vw, 17px); line-height: 1.55; color: rgb(74, 70, 64);}

/* ---------- Master plan ---------- */
.ap-master{display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr); gap: clamp(18px, 2.6vw, 36px); align-items: start;}
.ap-frame{position: relative; margin: 0; overflow: hidden; border-radius: 28px; background: #ffffff; box-shadow: 0 0 0 1px rgba(26, 20, 16, 0.05), 0 40px 80px -50px rgba(26, 20, 16, 0.5);}
.ap-frame--master{padding: clamp(10px, 1.6vw, 22px);}
.ap-frame img{width: 100%; height: auto; display: block; transition: transform 1200ms var(--ap-ease);}
.ap-frame:hover img{transform: scale(1.02);}
.ap-zoom{position: absolute; top: 16px; right: 16px; z-index: 2; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(26, 20, 16, 0.78); color: #ffffff; cursor: zoom-in; transition: background 200ms ease, transform 300ms var(--ap-ease);}
.ap-zoom svg{width: 18px; height: 18px;}
.ap-zoom:hover{background: rgb(240, 90, 40); transform: scale(1.08);}
.ap-side{position: sticky; top: calc(var(--ap-nav-h, 76px) + 84px); padding: clamp(22px, 2.4vw, 32px); border-radius: 28px; background: #ffffff; box-shadow: 0 0 0 1px rgba(26, 20, 16, 0.05);}
.ap-legends{counter-reset: lg; display: grid; margin: 16px 0 20px; padding: 0; list-style: none;}
.ap-legends li{counter-increment: lg; display: flex; align-items: center; gap: 12px; padding: 9px 4px; border-top: 1px solid rgba(26, 20, 16, 0.07); font-size: 14.5px; color: rgb(61, 49, 41); border-radius: 10px; transition: background 200ms ease, padding 260ms var(--ap-ease);}
.ap-legends li:hover{background: #fff9f7; padding-left: 10px;}
.ap-legends li::before{content: counter(lg); display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; flex: 0 0 26px; border-radius: 50%; background: rgba(240, 90, 40, 0.1); font-size: 12px; font-weight: 600; color: rgb(240, 90, 40);}

/* ---------- Downloads / buttons ---------- */
.ap-dl{display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 1.5px solid rgba(26, 20, 16, 0.14); border-radius: 99px; background: #ffffff; font-size: 14px; font-weight: 600; color: rgb(26, 20, 16); transition: border-color 200ms ease, color 200ms ease, background 200ms ease;}
.ap-dl svg{width: 17px; height: 17px;}
.ap-dl:hover{border-color: rgb(240, 90, 40); color: rgb(240, 90, 40);}
.ap-dl--sm{min-height: 38px; padding: 0 14px; font-size: 13px;}

/* ---------- Flat finder ---------- */

.ap-cards{display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 1.4vw, 20px);}
.ap-card{position: relative; display: flex; flex-direction: column; padding: 0; overflow: hidden; border: 0; border-radius: 24px; background: #ffffff; font-family: Outfit, system-ui, sans-serif; text-align: left; cursor: pointer; box-shadow: 0 0 0 1px rgba(26, 20, 16, 0.06), 0 26px 50px -40px rgba(26, 20, 16, 0.5); transition: transform 420ms var(--ap-ease), box-shadow 420ms ease, opacity 360ms ease;}
.ap-card.reveal{transition-delay: calc(var(--i, 0) * 40ms);}
.ap-card:hover, .ap-card.reveal.is-in:hover{transform: translateY(-8px); box-shadow: 0 0 0 1.5px rgba(240, 90, 40, 0.45), 0 40px 70px -40px rgba(240, 90, 40, 0.55); transition-delay: 0ms;}
.ap-card:focus-visible{outline: 3px solid rgba(240, 90, 40, 0.5); outline-offset: 3px;}
.ap-card[hidden]{display: none;}
.ap-card.is-pop{animation: apPop 560ms var(--ap-ease) both; animation-delay: calc(var(--n, 0) * 45ms);}
@keyframes apPop{from{opacity: 0; transform: translateY(18px) scale(0.96);} to{opacity: 1; transform: none;}}
.ap-card-media{position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 1 / 0.86; padding: 14px; background: radial-gradient(ellipse 70% 60% at 50% 55%, #ffffff 0%, #fff4ef 100%);}
.ap-card-media img{max-width: 100%; max-height: 100%; object-fit: contain; transition: transform 900ms var(--ap-ease); filter: drop-shadow(0 18px 18px rgba(80, 40, 10, 0.16));}
.ap-card:hover .ap-card-media img{transform: scale(1.07) rotate(-1.5deg);}
.ap-card-size{position: absolute; bottom: 12px; left: 12px; padding: 5px 11px; border-radius: 99px; background: rgb(26, 20, 16); font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; color: #ffffff;}
.ap-card-body{display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 16px 18px 18px; border-top: 1px solid rgba(26, 20, 16, 0.06);}
.ap-card-t{grid-column: 1; font-size: 18px; font-weight: 600; letter-spacing: -0.015em; color: rgb(26, 20, 16);}
.ap-card-t small{margin-left: 8px; font-size: 13px; font-weight: 500; color: rgb(140, 122, 110);}
.ap-card-tw{grid-column: 1; font-size: 12.5px; color: rgb(110, 98, 90);}
.ap-card-area{grid-column: 2; grid-row: 1 / 3; align-self: center; text-align: right;}
.ap-card-area b{display: block; font-family: "Source Serif 4", Georgia, serif; font-size: 28px; font-weight: 500; line-height: 1; color: rgb(240, 90, 40);}
.ap-card-area span{display: block; margin-top: 3px; font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: rgb(140, 122, 110);}
.ap-card-go{grid-column: 1 / -1; display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13.5px; font-weight: 600; color: rgb(26, 20, 16); transition: color 220ms ease;}
.ap-card-go svg{width: 16px; height: 16px; transition: transform 260ms var(--ap-ease);}
.ap-card:hover .ap-card-go{color: rgb(240, 90, 40);}
.ap-card:hover .ap-card-go svg{transform: translateX(5px);}

/* ---------- Flat sheet (modal) ---------- */
.ap-modal{position: fixed; inset: 0; z-index: 250; display: flex; align-items: center; justify-content: center; padding: 24px;}
.ap-modal[hidden]{display: none;}
.ap-modal-scrim{position: absolute; inset: 0; background: rgba(12, 14, 16, 0.6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity 360ms ease;}
.ap-modal.is-open .ap-modal-scrim{opacity: 1;}
.ap-modal-box{position: relative; display: flex; flex-direction: column; width: min(1180px, 100%); max-height: calc(100vh - 48px); overflow: hidden; border-radius: 30px; background: #fffaf8; box-shadow: 0 60px 120px -40px rgba(0, 0, 0, 0.6); transform-origin: 0 0;}
.ap-modal-top{display: flex; align-items: center; gap: 8px; padding: 14px 16px 0;}
.ap-modal-count{margin-right: auto; padding-left: 4px; font-family: "Source Serif 4", Georgia, serif; font-size: 15px; color: rgb(140, 122, 110);}
.ap-modal-top > .ap-mbtn:first-child{order: 1;}
.ap-modal-top > .ap-mbtn[data-step="1"]{order: 2;}
.ap-modal-top > .ap-mbtn--x{order: 3; margin-left: 8px;}
.ap-mbtn{display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border: 0; border-radius: 50%; background: #ffffff; color: rgb(26, 20, 16); cursor: pointer; box-shadow: inset 0 0 0 1px rgba(26, 20, 16, 0.08); transition: background 200ms ease, color 200ms ease, transform 260ms var(--ap-ease);}
.ap-mbtn svg{width: 18px; height: 18px;}
.ap-mbtn:hover{background: rgb(240, 90, 40); color: #ffffff; box-shadow: none;}
.ap-mbtn--x:hover{transform: rotate(90deg);}
.ap-modal-body{overflow-y: auto; padding: 12px clamp(16px, 2.2vw, 28px) clamp(18px, 2.4vw, 28px); scrollbar-width: thin;}
.ap-sheet{display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: clamp(16px, 2.2vw, 30px); align-items: start;}
.ap-sheet[hidden]{display: none;}
.ap-sheet.is-in .ap-sheet-viewer{animation: apSlideL 560ms var(--ap-ease) both;}
.ap-sheet.is-in .ap-sheet-info > *{animation: apRise 560ms var(--ap-ease) both;}
.ap-sheet.is-in .ap-sheet-info > :nth-child(2){animation-delay: 50ms;}
.ap-sheet.is-in .ap-sheet-info > :nth-child(3){animation-delay: 100ms;}
.ap-sheet.is-in .ap-sheet-info > :nth-child(n+4){animation-delay: 150ms;}
@keyframes apSlideL{from{opacity: 0; transform: translateX(calc(var(--dir, 1) * 30px));} to{opacity: 1; transform: none;}}
@keyframes apRise{from{opacity: 0; transform: translateY(14px);} to{opacity: 1; transform: none;}}
.ap-sheet-viewer{position: sticky; top: 0; overflow: hidden; border-radius: 24px; background: #ffffff; box-shadow: 0 0 0 1px rgba(26, 20, 16, 0.05);}
.ap-view-tabs{position: absolute; top: 14px; left: 14px; z-index: 2; display: inline-flex; padding: 4px; border-radius: 99px; background: rgba(255, 255, 255, 0.94); box-shadow: 0 10px 24px -14px rgba(26, 20, 16, 0.45);}
.ap-vt{min-height: 34px; padding: 0 14px; border: 0; border-radius: 99px; background: none; font-family: Outfit, system-ui, sans-serif; font-size: 13px; font-weight: 600; color: rgb(61, 49, 41); cursor: pointer; transition: background 260ms ease, color 260ms ease;}
.ap-vt[aria-pressed="true"]{background: rgb(240, 90, 40); color: #ffffff;}
.ap-plan{display: grid; margin: 0; aspect-ratio: 1 / 1; max-height: calc(100vh - 170px); padding: 60px 16px 16px;}
.ap-plan img{grid-area: 1 / 1; width: 100%; height: 100%; object-fit: contain; transition: opacity 480ms ease, transform 600ms var(--ap-ease), filter 480ms ease;}
.ap-plan.is-3d .ap-img-2d, .ap-plan.is-2d .ap-img-3d{opacity: 0; transform: scale(0.94) rotate(-1deg); filter: blur(4px); pointer-events: none;}
.ap-sheet-viewer .ap-zoom{top: 14px; right: 14px;}

.ap-sheet-info{padding: clamp(18px, 2vw, 26px); border-radius: 24px; background: #ffffff; box-shadow: 0 0 0 1px rgba(26, 20, 16, 0.05);}
.ap-info-k{font-size: 11.5px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: rgb(240, 90, 40);}
.ap-info-t{margin-top: 8px; font-size: clamp(20px, 1.8vw, 25px); font-weight: 600; line-height: 1.25; letter-spacing: -0.02em; color: rgb(26, 20, 16);}
.ap-stats{display: grid; grid-template-columns: repeat(auto-fit, minmax(108px, 1fr)); gap: 8px; margin-top: 16px;}
.ap-stat{padding: 12px 14px; border-radius: 14px; background: #fff9f7; box-shadow: inset 0 0 0 1px rgba(240, 90, 40, 0.1);}
.ap-stat b{display: block; font-family: "Source Serif 4", Georgia, serif; font-size: 25px; font-weight: 500; line-height: 1; color: rgb(26, 20, 16); font-variant-numeric: tabular-nums;}
.ap-stat span{display: block; margin-top: 6px; font-size: 12px; line-height: 1.3; color: rgb(110, 98, 90);}
.ap-stat--main{background: linear-gradient(150deg, rgb(246, 104, 52) 0%, rgb(214, 74, 26) 100%); box-shadow: 0 16px 30px -18px rgba(240, 90, 40, 0.8);}
.ap-stat--main b, .ap-stat--main span{color: #ffffff;}
.ap-note{margin-top: 10px; font-size: 12.5px; font-style: italic; color: rgb(140, 122, 110);}
.ap-legend{margin-top: 16px;}
.ap-legend-k{font-size: 12px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: rgb(26, 20, 16);}
.ap-legend ol{display: grid; margin: 8px 0 0; padding: 0; list-style: none;}
.ap-legend li{display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 8px; align-items: baseline; padding: 8px 4px; border-top: 1px solid rgba(26, 20, 16, 0.07); font-size: 14px; border-radius: 8px; transition: background 200ms ease;}
.ap-legend li:hover{background: #fff9f7;}
.ap-legend li i{font-style: normal; font-weight: 600; color: rgb(240, 90, 40);}
.ap-legend li span{color: rgb(61, 49, 41);}
.ap-legend li b{font-weight: 600; text-align: right; color: rgb(26, 20, 16);}
.ap-actions{display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px;}
.ap-enq{display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 20px; border: 0; border-radius: 99px; background: rgb(240, 90, 40); font-family: Outfit, system-ui, sans-serif; font-size: 14px; font-weight: 600; color: #ffffff; cursor: pointer; box-shadow: 0 16px 30px -16px rgba(240, 90, 40, 0.8); transition: background 200ms ease, transform 200ms ease;}
.ap-enq svg{width: 16px; height: 16px; transition: transform 220ms ease;}
.ap-enq:hover{background: rgb(216, 76, 30); transform: translateY(-2px);}
.ap-enq:hover svg{transform: translateX(3px);}

/* ---------- Full-screen viewer ---------- */
.ap-lb{position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 64px 20px 20px; background: rgba(12, 14, 16, 0.94);}
.ap-lb[hidden]{display: none;}
.ap-lb img{max-width: 100%; max-height: 100%; border-radius: 16px; background: #ffffff; animation: apRise 420ms var(--ap-ease) both;}
.ap-lb-x{position: absolute; top: 16px; right: 16px; display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border: 1px solid rgba(255, 255, 255, 0.3); border-radius: 50%; background: rgba(255, 255, 255, 0.08); color: #ffffff; cursor: pointer;}
.ap-lb-x svg{width: 20px; height: 20px;}
.ap-lb-x:hover{background: rgb(240, 90, 40);}

/* ---------- Responsive ---------- */
@media (max-width: 1100px){
  .ap-cards{grid-template-columns: repeat(3, minmax(0, 1fr));}
}
@media (max-width: 1024px){
  .ap-master, .ap-sheet{grid-template-columns: minmax(0, 1fr);}
  .ap-side, .ap-sheet-viewer{position: static;}
  .ap-plan{max-height: 60vh;}
}
@media (max-width: 720px){
  .ap-hero{min-height: 0;}
  .ap-hero-shade{background: linear-gradient(180deg, rgba(12, 14, 16, 0.2) 0%, rgba(12, 14, 16, 0.1) 25%, rgba(12, 14, 16, 0.6) 50%, rgba(12, 14, 16, 0.9) 100%);}
  .ap-hero-inner{align-items: flex-end; padding: 18px 16px;}
  .ap-hero .pj-badge{margin-bottom: 12px; font-size: 10.5px;}
  .ap-hero .pj-hero2-title{font-size: clamp(40px, 12vw, 52px); line-height: 0.95;}
  .ap-hero .pj-hero2-lead{margin-top: 12px; font-size: 14.5px;}
  .ap-hero .pj-hero2-cta{gap: 10px; margin-top: 18px;}
  .ap-hero .pj-hero2-btn{flex: 1 1 0; justify-content: center; min-height: 46px; padding: 0 12px; font-size: 14px; white-space: nowrap;}
  .ap-fab-hide .pj-fab:not(.is-open) .pj-fab-btn{opacity: 0; transform: translateY(24px) scale(0.92); pointer-events: none;}
  .ap-bar-k{display: none;}
  .ap-bar-inner{gap: 4px; padding: 8px 16px 10px;}
  .ap-bar-link{flex: 1 1 auto; justify-content: center; min-height: 38px; padding: 0 10px 0 4px; gap: 6px; font-size: 13px;}
  .ap-bar-link b{width: 24px; height: 24px; font-size: 11px;}
  .ap-cards{grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;}
  .ap-card{border-radius: 18px;}
  .ap-card-body{grid-template-columns: minmax(0, 1fr); padding: 12px 12px 14px;}
  .ap-card-t{font-size: 15px;}
  .ap-card-t small{display: block; margin: 2px 0 0;}
  .ap-card-tw{font-size: 11.5px;}
  .ap-card-area{grid-column: 1; grid-row: auto; text-align: left; margin-top: 6px;}
  .ap-card-area b{font-size: 22px;}
  .ap-card-go{display: none;}
  .ap-modal{padding: 0; align-items: flex-end;}
  .ap-modal-box{max-height: 94vh; border-radius: 24px 24px 0 0;}
  .ap-modal-body{padding: 10px 12px 20px;}
  .ap-sheet-info{padding: 18px 14px;}
  .ap-legend li{grid-template-columns: 28px minmax(0, 1fr); font-size: 13.5px;}
  .ap-legend li b{grid-column: 2; text-align: left; font-weight: 500; color: rgb(110, 98, 90);}
  .ap-actions > *{flex: 1 1 auto; justify-content: center;}
}
@media (prefers-reduced-motion: reduce){
  .ap-hero-bg img, .ap-hero-copy, .ap-card.is-pop, .ap-sheet.is-in .ap-sheet-viewer, .ap-sheet.is-in .ap-sheet-info > *, .ap-lb img{animation: none; transform: none;}
}

/* sticky bar needs the page wrapper not to be a scroll container (this page only) */
@supports (overflow: clip){ .ic1{overflow-x: clip;} }

/* never enlarge a plan past its own pixel size (the sources are ~480 x 500):
   the image keeps its natural size and is centred in the viewer */
.ap-plan img{width: auto; height: auto; max-width: 100%; max-height: 100%; place-self: center;}
.ap-card-media img{width: auto; height: auto;}
.ap-frame--master img{width: auto; margin: 0 auto;}

/* centre the plan in its frame: equal space top/bottom, one centred cell */
.ap-plan{grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; padding: 64px 20px;}
.ap-plan img{grid-area: 1 / 1; place-self: center;}
@media (max-width: 720px){ .ap-plan{padding: 58px 10px;} }

/* ---------- Flat popup on phones: a tidier bottom sheet ----------
   A grab handle and a sticky top bar, a shorter plan viewer, the carpet
   area as a wide headline card with the other areas three across beneath,
   a compact room legend and full-width actions. Type is a step smaller
   throughout. Desktop and tablet keep the layout above. */
@media (max-width: 720px){
  .ap-modal-box{max-height: 92vh; max-height: 92dvh; border-radius: 26px 26px 0 0; box-shadow: 0 -30px 60px -30px rgba(0, 0, 0, 0.55);}
  .ap-modal-box::before{content: ""; position: absolute; top: 6px; left: 50%; z-index: 3; width: 36px; height: 4px; margin-left: -20px; border-radius: 99px; background: rgba(26, 20, 16, 0.16);}
  .ap-modal-top{position: relative; z-index: 2; gap: 6px; padding: 14px 12px 6px; background: #fffaf8; box-shadow: 0 1px 0 rgba(26, 20, 16, 0.06);}
  .ap-modal-count{display: inline-flex; align-items: center; min-height: 26px; padding: 0 10px; border-radius: 99px; background: #ffffff; box-shadow: inset 0 0 0 1px rgba(26, 20, 16, 0.08); font-family: Outfit, system-ui, sans-serif; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; color: rgb(110, 98, 90); font-variant-numeric: tabular-nums;}
  .ap-mbtn{width: 32px; height: 32px;}
  .ap-mbtn svg{width: 15px; height: 15px;}
  .ap-mbtn:active{transform: scale(0.92);}
  .ap-modal-top > .ap-mbtn--x{margin-left: 4px; background: rgb(26, 20, 16); color: #ffffff; box-shadow: none;}
  .ap-modal-body{padding: 10px 10px calc(16px + env(safe-area-inset-bottom));}
  .ap-sheet{gap: 10px;}

  /* plan viewer */
  .ap-sheet-viewer{border-radius: 20px;}
  .ap-plan{aspect-ratio: 1 / 0.86; max-height: 44vh; padding: 50px 10px 10px;}
  .ap-view-tabs{top: 10px; left: 10px; padding: 3px;}
  .ap-vt{min-height: 30px; padding: 0 12px; font-size: 12px;}
  .ap-sheet-viewer .ap-zoom{top: 10px; right: 10px; width: 36px; height: 36px;}
  .ap-sheet-viewer .ap-zoom svg{width: 16px; height: 16px;}

  /* details */
  .ap-sheet-info{padding: 16px 14px 14px; border-radius: 20px;}
  .ap-info-k{font-size: 10px; letter-spacing: 0.14em;}
  .ap-info-t{margin-top: 6px; font-size: 17px; line-height: 1.3; letter-spacing: -0.015em;}
  .ap-stats{display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px;}
  .ap-stat{flex: 1 1 0; min-width: 0; padding: 10px 10px 11px; border-radius: 12px;}
  .ap-stat b{font-size: 19px;}
  .ap-stat span{margin-top: 5px; font-size: 10.5px; line-height: 1.3;}
  .ap-stat--main{flex: 1 1 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; border-radius: 14px;}
  .ap-stat--main b{font-size: 28px;}
  .ap-stat--main span{order: -1; margin: 0; font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase;}
  .ap-note{margin-top: 8px; font-size: 11.5px;}
  .ap-legend{margin-top: 14px; padding: 12px 12px 4px; border-radius: 14px; background: #fff9f7;}
  .ap-legend-k{font-size: 10.5px; letter-spacing: 0.14em;}
  .ap-legend ol{margin-top: 6px;}
  .ap-legend li{grid-template-columns: 22px minmax(0, 1fr) auto; gap: 6px; padding: 8px 0; font-size: 12.5px; line-height: 1.35; border-radius: 0;}
  .ap-legend li:hover{background: none;}
  .ap-legend li b{grid-column: auto; max-width: 11.5em; font-size: 12px; text-align: right;}
  .ap-actions{gap: 8px; margin-top: 14px;}
  .ap-actions > *{flex: 1 1 100%; justify-content: center; min-height: 46px; font-size: 13.5px;}
}

/* ---------- Flat cards: every picture box the same height ----------
   The plan images differ in shape, and an in-flow image could stretch its
   box past the set aspect ratio; the image now sits inside the fixed box. */
.ap-card-media{flex: none; overflow: hidden;}
.ap-card-media img{position: absolute; top: 14px; left: 14px; width: calc(100% - 28px); height: calc(100% - 28px); max-width: none; max-height: none; object-fit: contain;}


/* ---------- Solaris Bonhooghly Phase 2 additions ---------- */
/* typical floor plan: one wide image centred in a card as tall as the panel */
.ap-master{grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr); align-items: stretch;}
.ap-frame--plan{display: flex; flex-direction: column; justify-content: center; min-height: 100%; padding: 64px clamp(16px, 2.2vw, 36px) clamp(24px, 3vw, 48px);}
.ap-frame--plan .ap-site-img{width: 100%; height: auto; margin: auto 0;}
.ap-frame-k{position: absolute; top: 22px; left: clamp(18px, 2.2vw, 30px); padding-bottom: 6px; font-size: 13px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: rgb(26, 20, 16);}
.ap-frame-k::after{content: ""; position: absolute; left: 0; bottom: 0; width: 26px; height: 2px; border-radius: 2px; background: rgb(240, 90, 40);}
.ap-side{position: static;}
.ap-side .ap-info-t{font-size: clamp(19px, 1.6vw, 23px);}

/* "Click on a Flat type": each flat opens its sheet */
.ap-picks{display: grid; gap: 8px; margin: 16px 0 24px; padding: 0; list-style: none;}
.ap-pick{display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 0 16px; border: 1.5px solid rgba(26, 20, 16, 0.1); border-radius: 16px; background: #ffffff; font-family: Outfit, system-ui, sans-serif; font-size: 14.5px; font-weight: 600; letter-spacing: 0.02em; text-align: left; text-transform: uppercase; color: rgb(26, 20, 16); cursor: pointer; transition: border-color 220ms ease, background 220ms ease, transform 300ms var(--ap-ease), box-shadow 300ms ease;}
.ap-pick span{flex: 1;}
.ap-pick svg{width: 17px; height: 17px; color: rgb(240, 90, 40); transition: transform 260ms var(--ap-ease);}
.ap-pick:hover{border-color: rgba(240, 90, 40, 0.5); background: #fff9f7; transform: translateX(4px); box-shadow: 0 16px 30px -24px rgba(240, 90, 40, 0.7);}
.ap-pick:hover svg{transform: translateX(4px);}
.ap-pick:focus-visible{outline: 3px solid rgba(240, 90, 40, 0.4); outline-offset: 2px;}

/* colour keys, as on the live plan */
.ap-dot{flex: 0 0 auto; width: 12px; height: 12px; border-radius: 50%; box-shadow: 0 0 0 3px rgba(26, 20, 16, 0.05);}
.ap-dot--c{background: rgb(122, 168, 140);}
.ap-dot--d{background: rgb(222, 200, 118);}
.ap-dot--el{background: rgb(84, 92, 160);}
.ap-dot--cc{background: rgb(176, 180, 228);}
.ap-keys{display: grid; margin: 8px 0 22px; padding: 0; list-style: none;}
.ap-keys li{display: flex; align-items: center; gap: 12px; padding: 11px 4px; border-top: 1px solid rgba(26, 20, 16, 0.07); font-size: 14.5px; font-weight: 500; color: rgb(61, 49, 41);}

/* two flat cards: wider, with a landscape picture box */
.ap-cards--duo{grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 2vw, 28px);}
.ap-cards--duo .ap-card{border-radius: 28px;}
.ap-cards--duo .ap-card-media{aspect-ratio: 16 / 9.4;}
.ap-cards--duo .ap-card-media img{top: 24px; left: 24px; width: calc(100% - 48px); height: calc(100% - 48px);}
.ap-cards--duo .ap-card-body{padding: 20px 24px 22px;}
.ap-cards--duo .ap-card-t{font-size: clamp(19px, 1.6vw, 23px);}
.ap-cards--duo .ap-card-tw{font-size: 13.5px;}
.ap-cards--duo .ap-card-area b{font-size: clamp(30px, 2.6vw, 40px);}
.ap-cards--duo .ap-card.reveal{transition-delay: calc(var(--i, 0) * 140ms);}

/* areas carry their unit */
.ap-stat b small{font-family: Outfit, system-ui, sans-serif; font-size: 12px; font-weight: 500; opacity: 0.8;}

@media (max-width: 1100px){
  .ap-master{grid-template-columns: minmax(0, 1fr);}
}
@media (max-width: 720px){
  .ap-frame--plan{padding: 54px 12px 18px;}
  .ap-frame-k{top: 18px; left: 16px; font-size: 12px;}
  .ap-pick{min-height: 50px; font-size: 13px;}
  .ap-cards--duo{grid-template-columns: minmax(0, 1fr); gap: 14px;}
  .ap-cards--duo .ap-card-media img{top: 14px; left: 14px; width: calc(100% - 28px); height: calc(100% - 28px);}
  .ap-cards--duo .ap-card-body{grid-template-columns: minmax(0, 1fr) auto; padding: 14px 16px 16px;}
  .ap-cards--duo .ap-card-area{grid-column: 2; grid-row: 1 / 3; text-align: right; margin: 0;}
  .ap-cards--duo .ap-card-go{display: inline-flex;}
  .ap-stat--main b small{font-size: 12px;}
}
@media (prefers-reduced-motion: reduce){
  .ap-hero-bg img, .ap-hero-copy, .ap-sheet.is-in .ap-sheet-viewer, .ap-sheet.is-in .ap-sheet-info > *, .ap-lb img{animation: none; transform: none;}
  .ap-card, .ap-pick, .ap-plan img, .ap-modal-scrim{transition: none;}
}

/* plan images are small (about 440-620 px wide): never enlarged, on white
   (the 3D view has a white backing of its own) */
.ap-cards--duo .ap-card-media{background: #ffffff;}
.ap-cards--duo .ap-card-media img{object-fit: scale-down; filter: none;}

/* section titles a step smaller than the Serampore page */
.ap-title{font-size: clamp(28px, 3vw, 44px); line-height: 1.08;}
