/* The map of the surroundings (zbor/stages.js, map.js): a section with no background of its own is
   a window onto the same fixed 3D canvas as the flight. Until the 3D world runs (.is-live is set by
   the script), it is an ordinary section showing the list of places as the plain grid it was. */

body.in-site.stage-on #labels { opacity: 1 !important; }
/* tags on the map: darker pills than in the flight, the daylight behind them is brighter */
.label.on-map span { background: rgba(22, 28, 20, .84); border-color: rgba(201, 155, 104, .6); }
.label.chalet.on-map span { background: var(--p-gold); border-color: var(--p-gold); }

.stage3d__attrib { /* the map's data providers must stay visible on it: quiet, but readable */
  position: absolute; right: 8px; bottom: 6px; z-index: 2; margin: 0;
  padding: 3px 7px; border-radius: 4px; background: rgba(18, 24, 17, .72);
  font: 400 10px/1.2 var(--p-sans); letter-spacing: .03em; color: rgba(244, 239, 230, .8);
  pointer-events: none;
}
@media (max-width: 899px) { .stage3d__attrib { right: auto; left: 12px; bottom: auto; top: calc(var(--header-h, 66px) + 8px); } }

.around-top { padding-bottom: clamp(40px, 5vw, 64px); }
.around-top .head { margin-bottom: 0; }
.around-rest { padding-top: clamp(56px, 7vw, 96px); }
.map3d { position: relative; }
.map3d__hint {
  margin: 0 0 10px; padding: 9px 13px; border-radius: var(--r-sm, 10px);
  font-size: .78125rem; line-height: 1.45; color: var(--p-ink);
  background: rgba(24, 30, 22, .62); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.map3d__home {
  margin-top: 12px; padding: 10px 16px; border-radius: 999px; cursor: pointer;
  font: 500 .6875rem/1 var(--p-sans); letter-spacing: .16em; text-transform: uppercase;
  color: var(--p-ink); background: rgba(24, 30, 22, .62); border: 1px solid rgba(201, 155, 104, .7);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); transition: background .25s, color .25s;
}
.map3d__home[hidden] { display: none; }
.map3d__home:hover, .map3d__home:focus-visible { background: var(--p-gold); color: var(--p-forest); outline: none; }
/* the closer look on the map (map.js; the button's own look is .zoom in style.css): beside "Toată zona"
   and, like it, only once a place is chosen (never Măgura); as tall as that pill to the eye, more to the pointer */
.map3d__tools { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.map3d__tools[hidden] { display: none; }
.map3d__tools .map3d__home { margin-top: 0; }
.map3d__zoom { width: 34px; height: 34px; background: rgba(24, 30, 22, .62); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.map3d__zoom svg { width: 16px; height: 16px; }
.map3d__zoom::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; }

.map3d.is-live { height: 175vh; height: 175svh; }
.map3d.is-live .map3d__pin { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; touch-action: pan-y; cursor: grab; -webkit-user-select: none; user-select: none; }
.map3d.is-live .map3d__pin.is-dragging { cursor: grabbing; }
.map3d.is-live .map3d__panel {
  position: absolute; left: clamp(16px, 3.2vw, 44px); top: calc(var(--header-h, 78px) + 14px); bottom: 14px; width: clamp(240px, 23vw, 296px); z-index: 2;
  display: flex; flex-direction: column; justify-content: center; align-items: flex-start;
}
.map3d.is-live .map3d__hint { align-self: stretch; }
/* twelve cards: they share the height there is, and scroll inside the panel on a short screen */
.map3d.is-live .places { display: flex; flex-direction: column; gap: 5px; align-self: stretch; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(201, 155, 104, .5) transparent; }
.map3d.is-live .place {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px;
  padding: 6px 11px 7px 14px; cursor: pointer; flex: none;
  background: rgba(24, 30, 22, .62); border: 1px solid rgba(201, 155, 104, .3);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: background .25s, border-color .25s, opacity .9s var(--ease), transform .9s var(--ease);
}
.map3d.is-live .place:hover { border-color: rgba(201, 155, 104, .75); }
.map3d.is-live .place:focus-visible { outline: 2px solid var(--p-gold); outline-offset: 2px; }
.map3d.is-live .place.is-on { background: rgba(60, 48, 30, .78); border-color: var(--p-gold); }
.map3d.is-live .place__name { grid-column: 1; grid-row: 1; font-size: 1.1875rem; }
.map3d.is-live .place__dist { grid-column: 2; grid-row: 1; margin: 0; align-self: center; white-space: nowrap; }
.map3d.is-live .place__desc { grid-column: 1 / -1; display: none; font-size: .8125rem; color: #d9d4c6; }
.map3d.is-live .place.is-on .place__desc { display: block; }
.map3d.is-live .place--map { display: block; padding: 0; background: var(--gold); border-color: var(--gold); cursor: auto; }
.map3d.is-live .place--map a { flex-direction: row; align-items: center; justify-content: flex-start; gap: 10px; padding: 6px 9px 6px 13px; }
.map3d.is-live .place--map .icon { width: 18px; height: 18px; flex: none; }
.map3d.is-live .place--map strong { flex: 1; font-size: 1.0625rem; }
.map3d.is-live .place--map .place__go { align-self: center; width: 28px; height: 28px; }
.map3d.is-live .place--map .place__go .icon { width: 14px; height: 14px; }
@media (max-width: 899px) {
  .map3d.is-live .map3d__panel { left: 0; right: 0; top: auto; bottom: calc(84px + env(safe-area-inset-bottom)); width: auto; display: block; }
  .map3d.is-live .map3d__hint { margin: 0 16px 10px; font-size: .75rem; }
  .map3d.is-live .map3d__panel:has(.map3d__home:not([hidden])) .map3d__hint { margin-right: 150px; }
  .map3d.is-live .map3d__panel:has(.map3d__zoom:not([hidden])) .map3d__hint { margin-right: 192px; } /* and the magnifier: 34 + 8 more */
  .map3d.is-live .places { flex-direction: row; align-items: flex-end; gap: 7px; overflow-x: auto; overflow-y: visible; padding: 0 16px 2px; scroll-snap-type: x proximity; scrollbar-width: none; touch-action: pan-x; }
  .map3d.is-live .places::-webkit-scrollbar { display: none; }
  .map3d.is-live .place { flex: 0 0 auto; width: min(224px, 64vw); padding: 9px 12px 10px 15px; scroll-snap-align: start; }
  .map3d.is-live .place--map { width: auto; }
  .map3d.is-live .place--map strong { white-space: nowrap; }
  .map3d__home { position: absolute; right: 16px; bottom: 100%; margin: 0 0 10px; }
  .map3d__tools { position: absolute; right: 16px; bottom: 100%; margin: 0 0 10px; }
  .map3d__tools .map3d__home { position: static; margin: 0; }
}
@media (max-width: 899px) and (min-width: 701px) { .map3d.is-live .map3d__panel { bottom: 28px; } }
/* without the 3D world: the list of places as the plain grid it was */
.map3d:not(.is-live) { background: var(--forest); padding: 0 0 clamp(8px, 2vw, 24px); }
.map3d:not(.is-live) .map3d__pin { max-width: calc(var(--max) + var(--gutter) * 2); margin: 0 auto; padding-inline: var(--gutter); }
.map3d:not(.is-live) .map3d__hint, .map3d:not(.is-live) .map3d__home, .map3d:not(.is-live) .map3d__tools, .map3d:not(.is-live) .stage3d__attrib { display: none; }
@media (max-width: 719px) {
  /* On a phone the places are one row to swipe, like the guide's groups — and like these same
     places already are on a phone when the map is live, only without the map behind them. */
  .map3d:not(.is-live) .places { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scroll-padding-inline: var(--gutter); }
  .map3d:not(.is-live) .places::-webkit-scrollbar { display: none; }
  .map3d:not(.is-live) .place { flex: 0 0 82%; scroll-snap-align: start; }
}

/* ——— 3D objects on the amenity cards (zbor/objects.js): the flat icon gives way once its object is drawn ——— */
.amenity__obj { display: none; width: 104px; height: 104px; margin: -14px 0 -4px; }
.amenity.has-obj .amenity__obj { display: block; }
.amenity.has-obj > .icon { display: none; }
@media (max-width: 640px) { .amenity__obj { width: 92px; height: 92px; margin-top: -10px; } }

/* ——— falling leaves / snow over the site below the flight (zbor/drift.js) ——— */
.drift { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 9; pointer-events: none; }
/* The buzzard soaring over the site: one layer below the leaves, because it is far away and they
   fall right in front of you. On every screen (bird.js sizes it for a phone). */
.bird { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 8; pointer-events: none; opacity: 0; }

/* ——— the night sky behind the dark sections (zbor/sky.js): it turns slowly round the Pole Star ——— */
.section--dark.has-stars { position: relative; isolation: isolate; }
.stars {
  position: absolute; left: 0; right: 0; top: 0; height: min(100%, 780px); z-index: -1; overflow: hidden; pointer-events: none;
  -webkit-mask-image: linear-gradient(#000 0%, #000 42%, transparent 100%); mask-image: linear-gradient(#000 0%, #000 42%, transparent 100%);
}
.stars img { position: absolute; left: 50%; top: 190px; width: 1800px; height: 1800px; max-width: none; margin: -900px 0 0 -900px; opacity: .85; animation: sky-turn 1500s linear infinite paused; }
.stars.is-near img { animation-play-state: running; }
@media (max-width: 720px) { .stars img { width: 1300px; height: 1300px; margin: -650px 0 0 -650px; top: 150px; } }
@keyframes sky-turn { to { transform: rotate(-360deg); } }
@media (prefers-reduced-motion: reduce) { .stars img { animation: none; } }

/* ——— photographs with depth (zbor/depth.js): one canvas laid over the photo the visitor is looking at ——— */
.has-depth { position: relative; }
.depth-photo { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; opacity: 0; transition: opacity .18s linear; }
.depth-photo.is-on { opacity: 1; }

/* ——— "Casa pe niveluri" (zbor/levels.js): a cut-away model beside three level cards ——— */

