/* Casa de Campo® Resort & Villas — Interactive Resort Map
   Brand: charcoal #414042 dominant, CDC Blue #3a5896 + Sky #3fb6e8 as accents.
   Colour comes from the photography, not from graphic blocks. */

:root {
  --charcoal: #414042;
  --charcoal-deep: #2e2d2f;
  --charcoal-soft: #56545700;
  --cdc-blue: #3a5896;
  --cdc-sky: #3fb6e8;
  --cool-gray: #a3a5a8;
  --line: rgba(255, 255, 255, .1);
  --sidebar-w: 348px;
  --font: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; height: 100%;
  font-family: var(--font);
  color: var(--charcoal);
  background: var(--charcoal-deep);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ---------- layout ---------- */
#app { display: flex; height: 100%; width: 100%; }

#sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--charcoal);
  color: #fff;
  display: flex;
  flex-direction: column;
  z-index: 500;
  transition: margin-left .32s cubic-bezier(.4, 0, .2, 1);
  box-shadow: 2px 0 18px rgba(0, 0, 0, .28);
}
body.presenting #sidebar { margin-left: calc(var(--sidebar-w) * -1); }

#map { flex: 1; height: 100%; background: #1d2a33; }

/* ---------- sidebar head ---------- */
.side-head { padding: 26px 24px 18px; border-bottom: 1px solid var(--line); }
.side-head img { width: 172px; height: auto; display: block; }
.side-head .loc {
  margin-top: 13px;
  font-size: 9.5px;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--cool-gray);
  font-weight: 400;
}

.side-search { padding: 15px 18px 12px; }
.side-search input {
  width: 100%;
  padding: 9px 12px;
  font-family: var(--font);
  font-size: 13px;
  color: #fff;
  background: rgba(255, 255, 255, .07);
  border: 1px solid var(--line);
  border-radius: 3px;
  outline: none;
}
.side-search input::placeholder { color: #86888c; }
.side-search input:focus { border-color: var(--cdc-sky); background: rgba(255, 255, 255, .11); }

/* ---------- list ---------- */
.side-list { flex: 1; overflow-y: auto; padding: 0 0 26px; }
.side-list::-webkit-scrollbar { width: 8px; }
.side-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .16); border-radius: 4px; }

.cat { border-bottom: 1px solid rgba(255, 255, 255, .06); }

.cat-head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 18px;
  cursor: pointer;
  user-select: none;
}
.cat-head:hover { background: rgba(255, 255, 255, .04); }
.cat-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 9px; }
.cat-name {
  flex: 1;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .17em;
  text-transform: uppercase;
}
.cat-count { font-size: 10.5px; color: var(--cool-gray); font-variant-numeric: tabular-nums; }
.cat-eye {
  width: 15px; height: 15px; opacity: .45;
  flex: 0 0 15px; transition: opacity .15s;
}
.cat-head:hover .cat-eye { opacity: .85; }
.cat.off .cat-name, .cat.off .cat-count { color: #7c7e82; }
.cat.off .cat-dot { background: #6a6b6e !important; }
.cat.off .cat-items { display: none; }

.cat-items { padding-bottom: 6px; }
.cat.collapsed .cat-items { display: none; }

.item {
  display: flex; align-items: center; gap: 11px;
  padding: 7px 18px 7px 20px;
  cursor: pointer;
  border-left: 3px solid transparent;
}
.item:hover { background: rgba(255, 255, 255, .06); }
.item.active { background: rgba(63, 182, 232, .14); border-left-color: var(--cdc-sky); }
.item-thumb {
  width: 42px; height: 32px; flex: 0 0 42px;
  object-fit: cover; border-radius: 2px;
  background: #55565a;
}
.item-name { font-size: 12.5px; line-height: 1.32; color: #e8e8e9; }
.item.active .item-name { color: #fff; font-weight: 600; }
.item-badge { margin-left: auto; font-size: 9px; color: var(--cool-gray); letter-spacing: .06em; }

.side-foot {
  padding: 13px 18px 15px;
  border-top: 1px solid var(--line);
  font-size: 10px;
  color: #7f8185;
  line-height: 1.55;
}
.side-foot strong { color: var(--cool-gray); font-weight: 600; }

/* ---------- map controls ---------- */
.map-ctrl {
  position: absolute; z-index: 460;
  display: flex; gap: 7px;
}
.map-ctrl.top-right { top: 16px; right: 16px; }
.map-ctrl.top-left { top: 16px; left: 16px; display: none; }
.map-ctrl.bottom-left { bottom: 26px; left: 16px; }

.mbtn {
  background: rgba(65, 64, 66, .93);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 3px;
  font-family: var(--font);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 9px 13px;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background .15s;
}
.mbtn:hover { background: var(--cdc-blue); }
.mbtn.on { background: var(--cdc-sky); border-color: var(--cdc-sky); color: #10333f; }
a.mbtn { text-decoration: none; display: inline-block; }

/* ---------- embedded in a page ---------- */
/* Inside an iframe the map gets far less room than a full window, so the list
   gives some back and the escape hatch to the standalone map appears. */
#btnFull { display: none; }
body.embed #btnFull { display: inline-block; }
body.embed { --sidebar-w: 292px; }
body.embed .side-head { padding: 18px 20px 14px; }
body.embed .side-head img { width: 142px; }
body.embed #btnPresent { display: none; }

/* ---------- markers ---------- */
.pin {
  width: 26px; height: 26px;
  border-radius: 50% 50% 50% 4px;
  transform: rotate(-45deg);
  border: 2px solid rgba(255, 255, 255, .92);
  box-shadow: 0 2px 7px rgba(0, 0, 0, .45);
  display: flex; align-items: center; justify-content: center;
  transition: transform .18s, box-shadow .18s;
}
.pin svg { transform: rotate(45deg); width: 13px; height: 13px; fill: #fff; }
.pin-wrap:hover .pin { transform: rotate(-45deg) scale(1.18); }
.pin-wrap.active .pin {
  transform: rotate(-45deg) scale(1.32);
  box-shadow: 0 0 0 5px rgba(63, 182, 232, .38), 0 3px 10px rgba(0, 0, 0, .5);
}
.pin-label {
  position: absolute;
  left: 32px; top: 3px;
  white-space: nowrap;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .04em;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .95), 0 0 9px rgba(0, 0, 0, .8);
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s;
}
.pin-label.left { left: auto; right: 32px; }
body.labels .pin-label { opacity: 1; }
body.labels .pin-label.collide { opacity: 0; }
.pin-wrap:hover .pin-label,
body.labels .pin-wrap:hover .pin-label.collide,
.pin-wrap.active .pin-label,
body.labels .pin-wrap.active .pin-label.collide { opacity: 1; }

/* Esri's imagery runs flat at resort-wide zooms; a light lift, nothing more. */
.leaflet-tile { filter: saturate(1.14) brightness(1.07) contrast(1.03); }

/* ---------- detail panel ---------- */
#panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: 470px; max-width: 100%;
  background: #fff;
  z-index: 620;
  transform: translateX(102%);
  transition: transform .34s cubic-bezier(.4, 0, .2, 1);
  display: flex; flex-direction: column;
  box-shadow: -3px 0 26px rgba(0, 0, 0, .3);
}
#panel.open { transform: none; }

.p-hero { position: relative; flex: 0 0 auto; background: #2e2d2f; }
.p-hero.playable { cursor: pointer; }
.p-hero img { width: 100%; height: 268px; object-fit: cover; object-position: center 34%; display: block; }
.p-hero iframe { width: 100%; height: 250px; border: 0; display: block; }
.p-hero .hero-blank { width: 100%; height: 268px; }
/* Video stills carry their own burnt-in titles, so the scrim has to be heavy
   enough that the place name still wins. */
.p-hero .scrim {
  position: absolute; inset: 0;
  pointer-events: none;
  background: linear-gradient(to top,
    rgba(35, 34, 36, .99) 0%,
    rgba(35, 34, 36, .97) 24%,
    rgba(35, 34, 36, .62) 44%,
    rgba(35, 34, 36, .18) 72%,
    rgba(35, 34, 36, .06) 100%);
}
.p-hero .hero-play {
  position: absolute; top: 42%; left: 50%;
  transform: translate(-50%, -50%);
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  display: none; align-items: center; justify-content: center;
  pointer-events: none;
}
.p-hero.playable .hero-play { display: flex; }
.p-hero .hero-play::after {
  content: ""; margin-left: 5px;
  border-left: 16px solid var(--charcoal);
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
}
.p-hero:has(iframe) .scrim, .p-hero:has(iframe) .cap { display: none; }
.p-hero .cap { position: absolute; left: 26px; right: 62px; bottom: 17px; }
.p-hero .kicker {
  font-size: 9px; letter-spacing: .3em; text-transform: uppercase;
  color: var(--cdc-sky); margin-bottom: 7px; font-weight: 600;
}
.p-hero h2 {
  margin: 0; color: #fff; font-size: 25px; font-weight: 300;
  letter-spacing: .01em; line-height: 1.16;
}
.p-close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .45);
  border: 1px solid rgba(255, 255, 255, .3);
  color: #fff; font-size: 17px; line-height: 1;
  cursor: pointer; backdrop-filter: blur(4px);
}
.p-close:hover { background: rgba(0, 0, 0, .72); }

.p-body { flex: 1; overflow-y: auto; padding: 22px 26px 34px; }
.p-body::-webkit-scrollbar { width: 8px; }
.p-body::-webkit-scrollbar-thumb { background: #d3d4d6; border-radius: 4px; }

.p-text { font-size: 13.5px; line-height: 1.72; color: #55545a; }
.p-text p { margin: 0 0 11px; }
.p-text .lead { font-size: 15px; line-height: 1.62; color: #3d3c41; }
.p-text ul { margin: 0 0 13px; padding-left: 17px; }
.p-text li { margin-bottom: 4px; }
.p-text h4 {
  margin: 19px 0 8px;
  font-size: 10px; letter-spacing: .2em; text-transform: uppercase;
  color: var(--cdc-blue); font-weight: 700;
}

.p-sec-title {
  margin: 26px 0 11px;
  font-size: 9.5px; letter-spacing: .24em; text-transform: uppercase;
  color: #9a9ba0; font-weight: 700;
  padding-bottom: 7px; border-bottom: 1px solid #e6e7e9;
}

.gal { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.gal img {
  width: 100%; height: 96px; object-fit: cover;
  border-radius: 2px; cursor: zoom-in; display: block;
  transition: opacity .15s;
  background: #eceded;
}
.gal img:hover { opacity: .84; }

.vid {
  position: relative; display: block;
  border-radius: 3px; overflow: hidden;
  margin-bottom: 8px; cursor: pointer;
  background: #000;
}
.vid img { width: 100%; height: 168px; object-fit: cover; display: block; opacity: .82; }
.vid:hover img { opacity: 1; }
.vid .play {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(255, 255, 255, .93);
  display: flex; align-items: center; justify-content: center;
}
.vid .play::after {
  content: ""; margin-left: 4px;
  border-left: 15px solid var(--charcoal);
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
}
.vid iframe { width: 100%; height: 250px; border: 0; display: block; }

/* ---------- lightbox ---------- */
#lightbox {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(30, 29, 31, .96);
  display: none; align-items: center; justify-content: center;
}
#lightbox.open { display: flex; }
#lightbox img { max-width: 92%; max-height: 88%; object-fit: contain; box-shadow: 0 8px 40px rgba(0, 0, 0, .6); }
#lightbox .lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 48px; height: 74px;
  background: rgba(255, 255, 255, .1);
  border: 0; color: #fff; font-size: 26px; cursor: pointer;
}
#lightbox .lb-nav:hover { background: rgba(255, 255, 255, .22); }
#lightbox .lb-prev { left: 22px; }
#lightbox .lb-next { right: 22px; }
#lightbox .lb-close { position: absolute; top: 20px; right: 26px; background: none; border: 0; color: #fff; font-size: 30px; cursor: pointer; }
#lightbox .lb-count {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  color: var(--cool-gray); font-size: 11px; letter-spacing: .18em;
}

/* ---------- leaflet skin ---------- */
.leaflet-control-attribution {
  background: rgba(46, 45, 47, .72) !important;
  color: #b9babd !important;
  font-size: 9px !important;
  padding: 2px 7px !important;
}
.leaflet-control-attribution a { color: var(--cdc-sky) !important; }
.leaflet-bar a {
  background: rgba(65, 64, 66, .93) !important;
  color: #fff !important;
  border-bottom-color: rgba(255, 255, 255, .16) !important;
}
.leaflet-bar a:hover { background: var(--cdc-blue) !important; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  :root { --sidebar-w: 280px; }
  #panel { width: 100%; }
  .p-hero img { height: 210px; }
}
@media (max-width: 700px) {
  :root { --sidebar-w: 84vw; }
  /* The list is a drawer here, closed by default — CSS decides, not a width
     check in JS that can run before the layout exists. */
  #sidebar {
    position: absolute; top: 0; bottom: 0; left: 0;
    max-width: 340px;
    margin-left: calc(var(--sidebar-w) * -1);
  }
  body.sidebar-open #sidebar { margin-left: 0; }
  #map { width: 100%; flex: 1 0 100%; }

  .map-ctrl.top-left { display: flex; }
  .map-ctrl.top-right { top: 14px; right: 12px; gap: 5px; }
  #btnPresent { display: none; }
  .mbtn { padding: 8px 10px; font-size: 9.5px; letter-spacing: .08em; }

  .p-hero img, .p-hero iframe { height: 200px; }
  .p-hero h2 { font-size: 21px; }
  .gal img { height: 84px; }
}
