/*
  LaVi Bloom Academy - Gallery page layer (scoped to body.lavi-gallery).
  Loaded after style.css and lavi-home.css. Sections are appended here one at a time.
*/

/* =====================================================================
   GALLERY BANNER (Kiddino .breadcumb-wrapper, forest-green variant)
   ===================================================================== */
.lavi-gallery .lv-gallery-banner {
  position: relative;
  padding: 80px 0 64px;
  background: linear-gradient(120deg, #23543b 0%, #1d4733 60%, #173a2a 100%);
  overflow: hidden;
}
.lavi-gallery .lv-gallery-banner .breadcumb-content { position: relative; z-index: 2; max-width: 640px; }
.lavi-gallery .lv-gallery-banner .breadcumb-title {
  font-size: clamp(40px, 6vw, 70px);
  color: #fff;
  margin: 0 0 14px;
  line-height: 1.1;
}
.lavi-gallery .lv-gallery-banner .breadcumb-text { font-size: 19px; color: #e3efe8; margin: 0; max-width: 520px; }
.lavi-gallery .lv-gallery-banner .breadcumb-menu-wrap { margin: 34px 0 0; min-height: 0; }
/* breadcrumb pill: white on the green band, "Home / Gallery" */
.lavi-gallery .lv-gallery-banner .breadcumb-menu { display: inline-block; border-radius: 50px; padding: 12px 28px; background-color: #fff; }
.lavi-gallery .lv-gallery-banner .breadcumb-menu li,
.lavi-gallery .lv-gallery-banner .breadcumb-menu a { color: var(--vs-secondary-color); }
.lavi-gallery .lv-gallery-banner .breadcumb-menu a:hover { color: var(--theme-color); }
.lavi-gallery .lv-gallery-banner .breadcumb-menu li:not(:last-child):after { content: "/"; margin-left: 12px; margin-right: 8px; color: var(--theme-color2); }

/* right-hand illustration: transparent collage (gold + pink photo frames), centred vertically, never over the text */
.lavi-gallery .lv-gallery-banner__collage {
  position: absolute; z-index: 1; right: 2%; top: 50%; transform: translateY(-50%);
  display: block; line-height: 0; pointer-events: none;
  width: clamp(300px, 42vw, 620px);
}
.lavi-gallery .lv-gallery-banner__collage img { display: block; width: 100%; height: auto; object-fit: contain; }

/* entrance */
.lavi-gallery .lv-gallery-banner .breadcumb-content > * { animation: lv-gal-rise 0.7s ease both; }
.lavi-gallery .lv-gallery-banner .breadcumb-text { animation-delay: 0.1s; }
.lavi-gallery .lv-gallery-banner .breadcumb-menu-wrap { animation-delay: 0.2s; }
@keyframes lv-gal-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .lavi-gallery .lv-gallery-banner .breadcumb-content > * { animation: none; }
}

@media (max-width: 991px) {
  .lavi-gallery .lv-gallery-banner { padding: 56px 0 48px; }
  .lavi-gallery .lv-gallery-banner__collage { top: auto; bottom: 0; transform: none; right: 1%; width: clamp(200px, 34vw, 260px); }
}
@media (max-width: 575px) {
  .lavi-gallery .lv-gallery-banner { padding: 44px 0 40px; }
  .lavi-gallery .lv-gallery-banner .breadcumb-text { font-size: 17px; }
  .lavi-gallery .lv-gallery-banner__collage { width: 172px; right: 0; }
}

/* =====================================================================
   INTRODUCTION + FILTERS
   ===================================================================== */
.lavi-gallery .lv-gal { background: #fff; overflow: hidden; }
.lavi-gallery .lv-gal .sec-title { font-size: clamp(30px, 4vw, 48px); line-height: 1.15; margin-top: 0; color: var(--vs-secondary-color); }
.lavi-gallery .lv-gal-filters { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
@media (min-width: 1200px) { .lavi-gallery .lv-gal-filters { justify-content: flex-end; } }
.lavi-gallery .lv-gal-filters button {
  font-family: var(--title-font); font-weight: 600; font-size: 16px; line-height: 1;
  padding: 13px 22px; border-radius: 50px; cursor: pointer;
  color: var(--vs-secondary-color); background: #fff; border: 2px solid #e1d3ea;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.lavi-gallery .lv-gal-filters button:hover { border-color: var(--theme-color); color: var(--theme-color); }
.lavi-gallery .lv-gal-filters button.active { background: var(--theme-color); border-color: var(--theme-color); color: #fff; }
.lavi-gallery .lv-gal-filters button:focus-visible { outline: 3px solid var(--theme-color2); outline-offset: 2px; }
.lavi-gallery .lv-gal-note {
  margin: 28px 0 30px; padding: 12px 18px; border-radius: 14px; font-size: 15px; line-height: 1.5;
  background: var(--smoke-color); color: var(--vs-secondary-color); border-left: 4px solid var(--theme-color2); text-align: left;
}
.lavi-gallery .lv-gal-note i { color: var(--theme-color2); margin-right: 8px; }

/* =====================================================================
   MAIN PHOTO GALLERY (gallery-style1 tiles in CSS columns; photos keep their own aspect ratio)
   ===================================================================== */
/* equal-size tiles (3:4) in centred rows: no ragged column bottoms. The lightbox still shows each photo uncropped. */
.lavi-gallery .lv-gal-grid { --gap: 22px; --per-row: 4; margin: 34px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--gap); }
.lavi-gallery .lv-gal-item { margin: 0; flex: 0 0 calc((100% - (var(--per-row) - 1) * var(--gap)) / var(--per-row)); }
.lavi-gallery .lv-gal-item.is-hidden { display: none; }
.lavi-gallery .lv-gal-item .gallery-img { border-radius: 24px; box-shadow: 0 10px 26px rgba(72, 22, 95, 0.1); background: var(--smoke-color); }
.lavi-gallery .lv-gal-item .gallery-img img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; object-position: var(--pos, 50% 45%); }
.lavi-gallery .lv-gal-link { display: block; }
.lavi-gallery .lv-gal-link:focus-visible { outline: 3px solid var(--theme-color2); outline-offset: -3px; border-radius: 24px; }
/* template hover overlay uses a hard-coded red; use the brand pink and let clicks reach the photo link */
.lavi-gallery .lv-gal-item .gallery-img:before,
.lavi-gallery .lv-gal-item .gallery-img:after { background-color: rgba(194, 56, 114, 0.82); pointer-events: none; }
.lavi-gallery .lv-gal-item .gallery-btn { pointer-events: none; background-color: var(--theme-color2); color: #fff; }
.lavi-gallery .lv-gal-item .gallery-style1:hover .gallery-btn,
.lavi-gallery .lv-gal-item .gallery-img:focus-within .gallery-btn { opacity: 1; visibility: visible; }
.lavi-gallery .lv-gal-item .gallery-img:focus-within:before,
.lavi-gallery .lv-gal-item .gallery-img:focus-within:after { opacity: 1; visibility: visible; height: 100%; }
.lavi-gallery .lv-gal-tag {
  position: absolute; left: 12px; bottom: 12px; z-index: 3; pointer-events: none;
  background: rgba(255, 255, 255, 0.94); color: var(--vs-secondary-color);
  font-family: var(--title-font); font-weight: 600; font-size: 13px; line-height: 1; padding: 8px 13px; border-radius: 50px;
}
.lavi-gallery .lv-gal-empty { text-align: center; font-size: 18px; margin: 30px 0 0; }
@media (max-width: 1199px) { .lavi-gallery .lv-gal-grid { --per-row: 3; } }
@media (max-width: 991px)  { .lavi-gallery .lv-gal-grid { --per-row: 2; } }
@media (max-width: 767px)  { .lavi-gallery .lv-gal-grid { --gap: 14px; } }
/* touch screens have no hover: keep the category tag, drop the heavy overlay */
@media (hover: none) {
  .lavi-gallery .lv-gal-item .gallery-img:before,
  .lavi-gallery .lv-gal-item .gallery-img:after { display: none; }
}

/* =====================================================================
   CONTACT CTA (index-6 subscribe-layout6 shape, forest green)
   ===================================================================== */
.lavi-gallery .lv-gal-cta { background: #fff; }
.lavi-gallery .lv-gal-cta__box { background: #23543b; position: relative; overflow: hidden; }
.lavi-gallery .lv-gal-cta__box::after {
  content: ""; position: absolute; right: -70px; top: -70px; width: 220px; height: 220px; border-radius: 50%;
  border: 28px solid rgba(181, 138, 53, 0.4); pointer-events: none;
}
.lavi-gallery .lv-gal-cta__box > * { position: relative; z-index: 1; }
.lavi-gallery .lv-gal-cta .sec-title { font-size: clamp(26px, 3.4vw, 40px); line-height: 1.2; margin-top: 0; }
.lavi-gallery .lv-gal-cta .sec-subtitle { margin-bottom: 14px; }
.lavi-gallery .lv-gal-cta__btns { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; }
@media (min-width: 992px) { .lavi-gallery .lv-gal-cta__btns { justify-content: flex-end; } }
@media (max-width: 575px) { .lavi-gallery .lv-gal-cta__btns .vs-btn { flex: 1 1 100%; } }

/* =====================================================================
   VIDEO GALLERY (poster cards; a <video> is created only when a visitor chooses one)
   ===================================================================== */
.lavi-gallery .lv-vgal { overflow: hidden; }
.lavi-gallery .lv-vgal .sec-title { font-size: clamp(30px, 4vw, 48px); line-height: 1.15; margin-top: 0; color: var(--vs-secondary-color); }
.lavi-gallery .lv-vgal .title-area { margin-bottom: 34px; }
.lavi-gallery .lv-vid-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; max-width: 1200px; margin: 0 auto; padding: 0; }
.lavi-gallery .lv-vid-item { margin: 0; }
.lavi-gallery .lv-vid {
  position: relative; aspect-ratio: 9 / 16; border-radius: 24px; overflow: hidden; background: #000;
  box-shadow: 0 14px 34px rgba(72, 22, 95, 0.18);
}
.lavi-gallery .lv-vid__btn { position: absolute; inset: 0; width: 100%; height: 100%; display: block; padding: 0; border: 0; background: none; cursor: pointer; text-align: left; }
.lavi-gallery .lv-vid__btn[hidden] { display: none; }
.lavi-gallery .lv-vid__btn img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.lavi-gallery .lv-vid__btn:hover img { transform: scale(1.04); }
.lavi-gallery .lv-vid__btn:focus-visible { outline: 4px solid var(--theme-color2); outline-offset: -4px; border-radius: 24px; }
.lavi-gallery .lv-vid__play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 72px; height: 72px; border-radius: 50%;
  display: grid; place-items: center; padding-left: 4px; font-size: 26px; color: #fff;
  background: rgba(194, 56, 114, 0.94); box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.35); transition: transform 0.3s ease, background-color 0.3s ease;
}
.lavi-gallery .lv-vid__btn:hover .lv-vid__play { transform: translate(-50%, -50%) scale(1.08); background: var(--theme-color2); }
.lavi-gallery .lv-vid__meta {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; align-items: flex-end; gap: 8px;
  padding: 44px 14px 14px; color: #fff; background: linear-gradient(to top, rgba(30, 10, 40, 0.88), rgba(30, 10, 40, 0));
}
.lavi-gallery .lv-vid__title { font-family: var(--title-font); font-weight: 600; font-size: 15px; line-height: 1.3; }
.lavi-gallery .lv-vid__time { flex: none; background: rgba(255, 255, 255, 0.22); padding: 3px 9px; border-radius: 20px; font-size: 12px; line-height: 1.4; }
.lavi-gallery .lv-vid video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
@media (max-width: 991px) { .lavi-gallery .lv-vid-grid { gap: 14px; } .lavi-gallery .lv-vid__title { font-size: 13px; } .lavi-gallery .lv-vid__play { width: 56px; height: 56px; font-size: 20px; } .lavi-gallery .lv-vid__meta { padding: 36px 10px 10px; } }
@media (max-width: 767px) { .lavi-gallery .lv-vid-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; } }
@media (max-width: 575px) {
  .lavi-gallery .lv-vid-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .lavi-gallery .lv-vid { border-radius: 18px; }
  .lavi-gallery .lv-vid__play { width: 52px; height: 52px; font-size: 19px; box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.35); }
  .lavi-gallery .lv-vid__meta { padding: 34px 10px 10px; }
  .lavi-gallery .lv-vid__title { font-size: 12.5px; }
  .lavi-gallery .lv-vid__time { font-size: 11px; padding: 2px 7px; }
}
@media (prefers-reduced-motion: reduce) {
  .lavi-gallery .lv-vid__btn img, .lavi-gallery .lv-vid__play { transition: none; }
}

/* filter pills: keep them on one tidy centred row on tablets, and in an even 2 x 2 grid on phones */
@media (max-width: 991px) {
  .lavi-gallery .lv-gal-filters { justify-content: center; flex-wrap: nowrap; gap: 8px; }
  .lavi-gallery .lv-gal-filters button { font-size: 15px; padding: 12px 16px; white-space: nowrap; }
}
@media (max-width: 575px) {
  .lavi-gallery .lv-gal-filters { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .lavi-gallery .lv-gal-filters button { font-size: 14px; padding: 12px 10px; white-space: normal; line-height: 1.2; }
}
@media (min-width: 992px) and (max-width: 1399px) {
  .lavi-gallery .lv-gal-filters button { font-size: 15px; padding: 12px 16px; white-space: nowrap; }
}

/* =====================================================================
   PHOTO LIGHTBOX (Magnific Popup, scoped with mainClass "lv-lightbox")
   Image is contained (never cropped), caption + counter sit in their own area below it,
   close / arrows are fixed to the viewport and never overlap the photo.
   ===================================================================== */
html.lv-lb-open, html.lv-lb-open body { overflow: hidden; }

/* overlay + fade */
.lv-lightbox.mfp-bg { background: #140820; opacity: 0; transition: opacity 0.26s ease; }
.lv-lightbox.mfp-bg.mfp-ready { opacity: 0.94; }
.lv-lightbox.mfp-bg.mfp-removing { opacity: 0; }
.lv-lightbox.mfp-wrap { overscroll-behavior: contain; }
.lv-lightbox .mfp-content { opacity: 0; transition: opacity 0.26s ease; }
.lv-lightbox.mfp-ready .mfp-content { opacity: 1; }
.lv-lightbox.mfp-removing .mfp-content { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .lv-lightbox.mfp-bg, .lv-lightbox .mfp-content { transition: none; }
}

/* viewing area: room for the close button (top) and the caption block (bottom) */
.lv-lightbox .mfp-container { padding: 60px 84px 20px; }
.lv-lightbox .mfp-figure:after { display: none; }                  /* plugin's grey box behind the photo */
.lv-lightbox .mfp-figure figure { display: flex; flex-direction: column; align-items: center; margin: 0; }
.lv-lightbox img.mfp-img {
  width: auto; height: auto; padding: 0; margin: 0 auto;
  max-width: 85vw; max-height: 78vh; max-height: min(78vh, calc(100dvh - 250px));
  object-fit: contain; border-radius: 12px; box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5);
}

/* caption + counter: a dedicated block under the photo */
.lv-lightbox .mfp-bottom-bar {
  position: static; margin: 16px 0 0; width: min(85vw, 760px); top: auto;
  display: flex; flex-direction: column; align-items: center; gap: 10px; cursor: auto;
}
.lv-lightbox .mfp-title {
  order: 1; padding: 0; text-align: center; color: #fff; font-size: 17px; line-height: 1.5; word-wrap: break-word;
  max-height: 20vh; overflow-y: auto; overscroll-behavior: contain;      /* long captions scroll here, never push the controls away */
}
.lv-lightbox .mfp-counter {
  order: 2; position: static; flex: none; padding: 5px 16px; border-radius: 20px; background: rgba(255, 255, 255, 0.16);
  color: #fff; font-family: var(--title-font); font-weight: 600; font-size: 15px; line-height: 1.4; letter-spacing: 0.04em;
}

/* close button: fixed top-right, 48px target, high contrast */
.lv-lightbox .mfp-close,
.lv-lightbox.mfp-wrap .mfp-close {
  position: fixed; top: 12px; right: 12px; width: 48px; height: 48px; padding: 0; margin: 0;
  display: grid; place-items: center; border-radius: 50%; opacity: 1; z-index: 1046;
  background: rgba(255, 255, 255, 0.18); color: #fff; font-size: 30px; line-height: 1; font-family: Arial, sans-serif; text-align: center;
  transition: background-color 0.2s ease;
}
.lv-lightbox .mfp-close:hover, .lv-lightbox .mfp-close:focus-visible { background: var(--theme-color); }

/* previous / next arrows: fixed in the side gutters (the photo is capped at 85vw, so they never overlap it) */
.lv-lightbox .mfp-arrow {
  position: fixed; top: 50%; margin: -28px 0 0; width: 56px; height: 56px; opacity: 1; border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.18); background-repeat: no-repeat; background-position: center; background-size: 22px 22px;
  transform: none; transition: background-color 0.2s ease;
}
.lv-lightbox .mfp-arrow:before, .lv-lightbox .mfp-arrow:after { display: none; }
.lv-lightbox .mfp-arrow-left { left: 14px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M15 4l-8 8 8 8'/%3E%3C/svg%3E"); }
.lv-lightbox .mfp-arrow-right { right: 14px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 4l8 8-8 8'/%3E%3C/svg%3E"); }
.lv-lightbox .mfp-arrow:hover, .lv-lightbox .mfp-arrow:focus-visible { background-color: var(--theme-color); }
.lv-lightbox .mfp-close:focus-visible, .lv-lightbox .mfp-arrow:focus-visible { outline: 3px solid var(--theme-color2); outline-offset: 2px; }

/* tablets */
@media (max-width: 991px) {
  .lv-lightbox .mfp-container { padding: 60px 72px 20px; }
  .lv-lightbox img.mfp-img { max-height: min(78vh, calc(100dvh - 250px)); }
}
/* phones: arrows move to the bottom corners so they never cover the children's faces */
@media (max-width: 767px) {
  .lv-lightbox .mfp-container { padding: 60px 8px 80px; }
  .lv-lightbox img.mfp-img { max-width: 94vw; max-height: calc(100vh - 290px); max-height: calc(100dvh - 290px); border-radius: 10px; }
  .lv-lightbox .mfp-bottom-bar { width: 94vw; margin-top: 12px; gap: 8px; }
  .lv-lightbox .mfp-title { font-size: 15px; max-height: 15vh; }
  .lv-lightbox .mfp-arrow { top: auto; bottom: 14px; margin: 0; width: 48px; height: 48px; background-size: 20px 20px; }
  .lv-lightbox .mfp-arrow-left { left: 14px; }
  .lv-lightbox .mfp-arrow-right { right: 14px; }
}

/* CTA: balanced heading, two equal buttons on one row, kept clear of the corner ring */
.lavi-gallery .lv-gal-cta .sec-title { text-wrap: balance; }
.lavi-gallery .lv-gal-cta__btns .vs-btn { min-width: 190px; justify-content: center; text-align: center; margin: 0; }
@media (min-width: 992px) {
  .lavi-gallery .lv-gal-cta__btns { flex-wrap: nowrap; gap: 16px; padding-right: 36px; }
}
@media (max-width: 575px) { .lavi-gallery .lv-gal-cta__btns .vs-btn { min-width: 0; } }

/* phones: hide the banner picture */
@media (max-width: 575px) { .lavi-gallery .lv-gallery-banner__collage { display: none; } }
