/* ==========================================================================
   GALERIE — stiluri proprii paginii
   Grila bento (6 coloane) + bara de filtre lipicioasă + galeria video + previzualizarea turului virtual.
   ========================================================================== */

/* ---------- Bara de filtre (lipicioasă) ---------- */
.gal-bar {
  --stick: calc(var(--inset) + 78px);
  position: sticky; top: var(--stick); z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 22px;
  pointer-events: none;
}
.gal-bar > * { pointer-events: auto; }
.gal-filters {
  position: relative;
  flex-wrap: nowrap; gap: 2px;
  padding: 5px; border-radius: 999px;
  background: rgba(255, 255, 255, .86);
  border: 1px solid rgba(15, 15, 14, .06);
  backdrop-filter: blur(18px) saturate(150%); -webkit-backdrop-filter: blur(18px) saturate(150%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
  transition: box-shadow .45s var(--ease);
  max-width: 100%;
  overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
}
.gal-filters::-webkit-scrollbar { display: none; }
.gal-bar.is-stuck .gal-filters { box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 18px 40px -18px rgba(0, 0, 0, .3); }

.gal-filters .filter {
  position: relative; z-index: 1; flex: none;
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 10px 0 18px;
  border: 0; border-radius: 999px;
  color: var(--muted); background: transparent;
  font: 600 .95rem/1 var(--f-display); letter-spacing: -.005em;
  transition: color .35s var(--ease), background-color .35s;
}
.gal-filters .filter:hover { color: var(--ink); border: 0; }
.gal-filters .filter.is-active { background: var(--ink); color: #fff; }
.filter__n {
  display: inline-grid; place-items: center;
  min-width: 26px; height: 26px; padding: 0 7px; border-radius: 999px;
  background: var(--paper); color: var(--muted);
  font: 600 .74rem/1 var(--f-display); letter-spacing: .01em;
  transition: background-color .35s, color .35s;
}
.filter.is-active .filter__n { background: var(--yellow); color: var(--ink); }

/* indicatorul glisant (activ doar cu JS) */
.gal-ind {
  position: absolute; left: 0; top: 5px; z-index: 0;
  height: 44px; width: var(--w, 0px); border-radius: 999px;
  background: var(--ink);
  transform: translateX(var(--x, 0px));
  opacity: 0;
}
.gal-bar.has-ind .gal-ind { opacity: 1; }
.gal-bar.has-ind .gal-filters .filter.is-active { background: transparent; }
.gal-bar.is-ready .gal-ind { transition: transform .55s var(--ease), width .55s var(--ease); }

.gal-hint {
  display: inline-flex; align-items: center; gap: 10px;
  font: 500 .88rem/1.2 var(--f-display); color: var(--muted);
  transition: opacity .35s, transform .45s var(--ease);
}
.gal-hint .ic { width: 16px; height: 16px; color: var(--ink); }
.gal-bar.is-stuck .gal-hint { opacity: 0; transform: translateY(-6px); pointer-events: none; }

/* estompare la marginea pastilei când mai sunt filtre de derulat (mobil) */
.gal-bar::before, .gal-bar::after {
  content: ""; position: absolute; top: 1px; bottom: 1px; z-index: 2; width: 44px;
  pointer-events: none; opacity: 0; transition: opacity .3s;
}
.gal-bar::before { left: 1px; border-radius: 999px 0 0 999px; background: linear-gradient(90deg, #fff 30%, rgba(255, 255, 255, 0)); }
.gal-bar::after { right: 1px; border-radius: 0 999px 999px 0; background: linear-gradient(270deg, #fff 30%, rgba(255, 255, 255, 0)); }
.gal-bar.can-l::before, .gal-bar.can-r::after { opacity: 1; }

.gal-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Grila bento ---------- */
.gal {
  --u: clamp(60px, 6.4vw, 92px);
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: var(--u);
  grid-auto-flow: row dense;
  gap: 14px;
}
.gal > [data-s="L"] { grid-column: span 4; grid-row: span 6; }
.gal > [data-s="M"] { grid-column: span 2; grid-row: span 3; }
.gal > [data-s="S"] { grid-column: span 2; grid-row: span 4; }
.gal > [data-s="T"] { grid-column: span 2; grid-row: span 6; }
.gal > [data-s="P"] { grid-column: span 4; grid-row: span 4; }
.gal > [data-s="W"] { grid-column: span 3; grid-row: span 4; }
.gal > [data-s="F"] { grid-column: span 6; grid-row: span 6; }
.gal > [data-s="B"] { grid-column: span 6; grid-row: span 3; } /* bandă: imagini foarte late (~4:1) */

/* suprascrie stilul .g-item din pista orizontală a paginii principale */
.gal .g-item {
  display: block; width: 100%; height: auto; max-height: none; min-width: 0;
  border-radius: var(--r); overflow: hidden; isolation: isolate;
  background: #E4E1D8;
  cursor: zoom-in;
  text-align: left;
}
.gal > .g-item[hidden] { display: none; }
.gal .g-item img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; max-width: 100%;
  object-fit: cover;
}
.gal .g-item::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(10, 10, 9, 0) 45%, rgba(10, 10, 9, .74));
  opacity: 0; transition: opacity .5s var(--ease);
}
.gal .g-item:hover::after, .gal .g-item:focus-visible::after { opacity: 1; }
.gal .g-item:focus-visible { outline-offset: 4px; }

/* apariție la scroll (clasele sunt puse de galerie.js) */
.gal.js-rev .g-item { opacity: 0; transform: translateY(30px); transition: opacity .8s var(--ease), transform .9s var(--ease); transition-delay: var(--rd, 0s); }
.gal.js-rev .g-item.is-in { opacity: 1; transform: none; }

.g-cap {
  position: absolute; left: 22px; right: 22px; bottom: 20px; z-index: 1;
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  font-style: normal; color: #fff;
  opacity: 0; transform: translateY(12px);
  transition: opacity .45s var(--ease), transform .6s var(--ease);
}
.g-cap small { font: 600 .7rem/1 var(--f-display); letter-spacing: .16em; text-transform: uppercase; color: var(--yellow); }
.g-cap b { font: 600 clamp(1.05rem, 1.35vw, 1.4rem)/1.12 var(--f-display); letter-spacing: -.02em; }
.gal > [data-s="L"] .g-cap b, .gal > [data-s="P"] .g-cap b, .gal > [data-s="F"] .g-cap b, .gal > [data-s="B"] .g-cap b { font-size: clamp(1.4rem, 2.1vw, 2rem); }
.gal .g-item:hover .g-cap, .gal .g-item:focus-visible .g-cap { opacity: 1; transform: none; }

/* planuri 3D: card alb cu imaginea „conținută” și text mereu vizibil */
.gal .g-plan {
  display: flex; flex-direction: column;
  padding: 10px; background: var(--white);
}
.gal .g-plan::after { display: none; }
.gal > .g-plan[hidden] { display: none; }
.g-plan__media {
  position: relative; display: block; flex: 1; min-height: 0;
  border-radius: calc(var(--r) - 8px); overflow: hidden;
  background: var(--paper); /* același panou la toate planurile; randările au fundal alb și se topesc în el */
}
.gal .g-plan img {
  inset: 5%; width: 90%; height: 90%;
  object-fit: contain; mix-blend-mode: multiply;
}
.g-plan__cap { display: flex; flex-direction: column; gap: 5px; padding: 14px 64px 6px 8px; font-style: normal; }
.g-plan__cap b { font: 600 1.15rem/1.1 var(--f-display); letter-spacing: -.02em; color: var(--ink); }
.g-plan__cap small { font-size: .86rem; line-height: 1.3; color: var(--muted); }
.g-plan__zoom {
  position: absolute; right: 18px; bottom: 16px;
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  background: var(--ink); color: #fff;
  transition: background-color .3s, color .3s, transform .45s var(--ease);
}
.g-plan__zoom .ic { width: 16px; height: 16px; }
.gal .g-plan:hover .g-plan__zoom { background: var(--yellow); color: var(--ink); transform: rotate(90deg); }
.gal .g-plan:hover img { transform: scale(1.04); }

/* ---------- Bulina „Mărește” care urmărește cursorul ---------- */
.gal-cursor {
  position: fixed; left: 0; top: 0; z-index: 60;
  width: 96px; height: 96px; margin: -48px 0 0 -48px;
  display: none; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border-radius: 50%;
  background: var(--yellow); color: var(--ink);
  font: 600 .8rem/1 var(--f-display); letter-spacing: .02em;
  box-shadow: 0 14px 30px -12px rgba(15, 15, 14, .45);
  pointer-events: none; will-change: transform;
  transform: translate3d(-200px, -200px, 0) scale(0);
}
.gal-cursor .ic { width: 18px; height: 18px; stroke-width: 2; }
.gal-cursor.is-live { display: flex; }
.gal.has-cursor .g-item { cursor: none; }

/* ---------- Subsolul galeriei ---------- */
.gal-foot {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px 32px;
  margin-top: clamp(32px, 4vw, 48px); padding-top: 26px;
  border-top: 1px solid var(--line);
}
.gal-foot p { color: var(--muted); max-width: 62ch; }
.gal-foot .more-link { margin-top: 0; }

/* ---------- Galerie video: scenă + listă de clipuri ---------- */
.vid { background: var(--white); margin-inline: var(--inset); border-radius: var(--r-lg); }
.vid__grid {
  display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr);
  gap: clamp(14px, 1.6vw, 24px); align-items: stretch;
}
.vid__stage {
  position: relative; isolation: isolate; overflow: hidden; align-self: start;
  aspect-ratio: 16 / 9; border-radius: var(--r);
  background: var(--ink);
}
.vid__player { display: block; width: 100%; height: 100%; object-fit: cover; background: var(--ink); }

/* coperta cu butonul mare de redare (doar cu JS; fără JS rămân controalele native) */
.vid__cover {
  position: absolute; inset: 0; z-index: 1;
  display: none; align-items: center; justify-content: center;
  padding: 0; border: 0; border-radius: inherit;
  background: linear-gradient(180deg, rgba(10, 10, 9, .08) 0%, rgba(10, 10, 9, 0) 40%, rgba(10, 10, 9, .66) 100%);
  color: #fff; cursor: pointer;
  transition: opacity .45s var(--ease), visibility .45s;
}
.js .vid__cover { display: flex; }
.vid__stage.is-playing .vid__cover { opacity: 0; visibility: hidden; }
.vid__big { width: 92px; height: 92px; transition: transform .5s var(--ease), background-color .3s; }
.vid__big .ic { width: 30px; height: 30px; margin-left: 4px; }
.vid__cover:hover .vid__big, .vid__cover:focus-visible .vid__big { transform: scale(1.07); background: var(--yellow-hi); }
.vid__cover:focus-visible { outline: 2px solid var(--yellow); outline-offset: -6px; }
.vid__label {
  position: absolute; left: clamp(18px, 2vw, 28px); right: 18px; bottom: clamp(16px, 2vw, 26px);
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px; text-align: left;
}
.vid__label small { font: 600 .72rem/1 var(--f-display); letter-spacing: .16em; text-transform: uppercase; color: var(--yellow); }
.vid__label b { font: 600 clamp(1.3rem, 2vw, 1.9rem)/1.1 var(--f-display); letter-spacing: -.02em; }

.vid__list { display: grid; grid-auto-rows: 1fr; gap: 10px; margin: 0; padding: 0; list-style: none; }
.vid__list li { display: flex; }
.vid__item {
  flex: 1; display: grid; grid-template-columns: minmax(0, 42%) minmax(0, 1fr); align-items: center; gap: 16px;
  padding: 10px; border-radius: 18px;
  border: 1px solid var(--line); background: var(--white);
  transition: background-color .3s, border-color .3s, transform .45s var(--ease);
}
.vid__item:hover { border-color: rgba(15, 15, 14, .24); }
.vid__item.is-active { background: var(--paper); border-color: transparent; }
.vid__thumb {
  position: relative; display: block; overflow: hidden;
  aspect-ratio: 16 / 10; border-radius: 12px; background: var(--paper);
}
.vid__thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.vid__thumb--plan { background: var(--white); }
.vid__thumb--plan img { inset: 6%; width: 88%; height: 88%; object-fit: contain; }
.vid__item:hover .vid__thumb img { transform: scale(1.05); }
.vid__dur {
  position: absolute; right: 7px; bottom: 7px;
  padding: 5px 8px; border-radius: 999px;
  background: rgba(15, 15, 14, .74); color: #fff;
  font: 600 .72rem/1 var(--f-display); letter-spacing: .02em;
}
.vid__pl {
  position: absolute; left: 8px; bottom: 7px;
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: rgba(15, 15, 14, .74); color: #fff;
  transition: background-color .3s, color .3s;
}
.vid__pl .ic { width: 12px; height: 12px; margin-left: 2px; }
.vid__item.is-active .vid__pl, .vid__item:hover .vid__pl { background: var(--yellow); color: var(--ink); }
.vid__meta { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.vid__meta small { font: 600 .7rem/1 var(--f-display); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.vid__item.is-active .vid__meta small { color: var(--ink); }
.vid__meta b { font: 600 1.14rem/1.15 var(--f-display); letter-spacing: -.02em; color: var(--ink); }
.vid__meta > span {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
  font-size: .86rem; line-height: 1.4; color: var(--muted);
}

/* ---------- Tur virtual: previzualizare panoramică ---------- */
.tt__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.22fr); gap: clamp(40px, 6vw, 96px); align-items: center; }
.tt .h2 { margin-bottom: 22px; }
.tt__links { display: grid; gap: 10px; margin-top: 36px; max-width: 440px; }
.tt__link {
  display: flex; align-items: center; gap: 16px;
  padding: 8px 22px 8px 8px; border-radius: 999px;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--line-d);
  font: 600 1.25rem/1.1 var(--f-display); letter-spacing: -.02em;
  transition: background-color .3s, border-color .3s, transform .45s var(--ease);
}
.tt__link small { display: block; margin-bottom: 5px; font: 500 .72rem/1 var(--f-body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted-d); }
.tt__link .tour__play { width: 54px; height: 54px; flex: none; }
.tt__link .tour__play .ic { width: 20px; height: 20px; }
.tt__go { margin-left: auto; color: var(--muted-d); transition: color .3s, transform .45s var(--ease); }
.tt__link:hover { background: rgba(255, 255, 255, .09); border-color: rgba(250, 196, 29, .4); transform: translateX(4px); }
.tt__link:hover .tt__go { color: var(--yellow); transform: translate(2px, -2px); }

.tt__view {
  position: relative; isolation: isolate; display: block; overflow: hidden;
  aspect-ratio: 4 / 3.3; border-radius: var(--r);
  background: var(--ink-3);
}
.tt__view img {
  position: absolute; inset: 0; z-index: -2;
  width: 100%; height: 100%; object-fit: cover; object-position: 0% 50%;
  animation: ttPan 24s ease-in-out infinite alternate;
}
.tt__view.is-live img { animation: none; object-position: var(--px, 50%) 50%; transition: object-position 1.1s var(--ease); }
@keyframes ttPan { to { object-position: 100% 50%; } }
.tt__view::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(10, 10, 9, .35) 0%, rgba(10, 10, 9, 0) 30%, rgba(10, 10, 9, 0) 60%, rgba(10, 10, 9, .6) 100%);
}
.tt__badge {
  position: absolute; top: 18px; left: 18px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px 9px 11px; border-radius: 999px;
  background: rgba(15, 15, 14, .45); border: 1px solid rgba(255, 255, 255, .18);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  font: 600 .95rem/1 var(--f-display); color: #fff;
}
.tt__badge .ic { width: 18px; height: 18px; color: var(--yellow); animation: ttSpin 6s linear infinite; }
@keyframes ttSpin { to { transform: rotate(360deg); } }
.tt__hint {
  position: absolute; left: 18px; right: 18px; bottom: 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px 14px 20px; border-radius: 18px;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  font: 600 .98rem/1.2 var(--f-display); color: #fff;
  transition: background-color .3s;
}
.tt__hint .ic { width: 18px; height: 18px; color: var(--yellow); transition: transform .4s var(--ease); }
.tt__view:hover .tt__hint { background: rgba(255, 255, 255, .2); }
.tt__view:hover .tt__hint .ic { transform: translate(2px, -2px); }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .gal-hint { display: none; }
  .gal {
    --u: calc((100vw - 2 * var(--gutter) - 42px) / 8);
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .gal > [data-s="L"], .gal > [data-s="F"] { grid-column: span 4; grid-row: span 5; }
  .gal > [data-s="P"] { grid-column: span 4; grid-row: span 4; }
  .gal > [data-s="M"], .gal > [data-s="S"], .gal > [data-s="W"] { grid-column: span 2; grid-row: span 3; }
  .gal > [data-s="T"] { grid-column: span 2; grid-row: span 6; }
  .gal > [data-s="B"] { grid-column: span 4; grid-row: span 3; }
  .tt__grid { grid-template-columns: 1fr; }
  .gal-cursor { display: none !important; }
  .vid__grid { grid-template-columns: 1fr; }
  .vid__list { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: auto; }
  .vid__item { grid-template-columns: 1fr; align-items: start; align-content: start; gap: 14px; }
  .vid__meta { padding: 0 4px 6px; }
}
@media (max-width: 760px) {
  .gal-bar { --stick: calc(var(--inset) + 68px); margin-bottom: 16px; }
  .gal-filters { width: 100%; }
  .gal-filters .filter { height: 40px; padding: 0 8px 0 14px; font-size: .9rem; gap: 6px; }
  .gal-ind { height: 40px; }
  .filter__n { min-width: 22px; height: 22px; padding: 0 6px; font-size: .7rem; }
  .gal {
    --u: calc((100vw - 2 * var(--gutter) - 10px) / 2 * .375);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .gal > [data-s="L"], .gal > [data-s="F"] { grid-column: span 2; grid-row: span 4; }
  .gal > [data-s="P"] { grid-column: span 2; grid-row: span 3; }
  .gal > [data-s="M"], .gal > [data-s="S"], .gal > [data-s="W"] { grid-column: span 1; grid-row: span 2; }
  .gal > [data-s="T"] { grid-column: span 1; grid-row: span 4; }
  .gal > [data-s="B"] { grid-column: span 2; grid-row: span 2; }
  .gal > .g-plan[data-s] { grid-column: span 2; grid-row: span 3; }
  .gal .g-item { border-radius: 16px; }
  .gal .g-item::after { opacity: 1; background: linear-gradient(180deg, rgba(10, 10, 9, 0) 55%, rgba(10, 10, 9, .62)); }
  .g-cap { left: 12px; right: 12px; bottom: 11px; opacity: 1; transform: none; }
  .g-cap small { display: none; }
  .g-cap b { font-size: .86rem; line-height: 1.2; }
  .gal > [data-s="L"] .g-cap b, .gal > [data-s="P"] .g-cap b, .gal > [data-s="F"] .g-cap b, .gal > [data-s="B"] .g-cap b { font-size: 1.05rem; }
  .gal > [data-s="L"] .g-cap small, .gal > [data-s="P"] .g-cap small, .gal > [data-s="F"] .g-cap small { display: block; font-size: .62rem; }
  .gal .g-plan { padding: 8px; }
  .g-plan__media { border-radius: 10px; }
  .g-plan__cap { gap: 4px; padding: 10px 56px 2px 6px; }
  .g-plan__cap b { font-size: 1.02rem; }
  .g-plan__cap small { font-size: .8rem; }
  .g-plan__zoom { width: 36px; height: 36px; right: 14px; bottom: 12px; }
  .gal-foot { flex-direction: column; align-items: flex-start; }
  .vid__stage { border-radius: 16px; }
  .vid__big { width: 64px; height: 64px; }
  .vid__big .ic { width: 22px; height: 22px; }
  .vid__label { gap: 6px; }
  .vid__label small { font-size: .62rem; }
  .vid__label b { font-size: 1.08rem; }
  .vid__list { grid-template-columns: 1fr; gap: 8px; }
  .vid__item { grid-template-columns: 116px minmax(0, 1fr); align-items: center; gap: 14px; padding: 8px; border-radius: 16px; }
  .vid__thumb { border-radius: 10px; }
  .vid__meta { padding: 0; gap: 5px; }
  .vid__meta b { font-size: 1rem; }
  .vid__meta > span { font-size: .8rem; -webkit-line-clamp: 4; }
  .vid__pl { width: 24px; height: 24px; left: 6px; bottom: 6px; }
  .vid__pl .ic { width: 10px; height: 10px; }
  .vid__dur { right: 6px; bottom: 6px; padding: 4px 6px; font-size: .66rem; }
  .tt__links { max-width: none; }
  .tt__link { font-size: 1.1rem; }
  .tt__view { aspect-ratio: 4 / 4.2; }
  .tt__hint { font-size: .86rem; padding: 12px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .tt__view img { animation: none; object-position: 50% 50%; }
  .tt__badge .ic { animation: none; }
}
