/* =============================================
   GALERIA MAIN PAGE STYLES
   Styles for the main gallery landing page
   ============================================= */

/* ---- Gallery Header ---- */
@media screen and (min-width: 0px) {
  .galeria-header {
    padding-bottom: 2rem;
  }

  .galeria-title-box {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .galeria-title-box .logo-bambu {
    width: 2rem;
    height: auto;
    margin-top: 0.3rem;
  }

  .galeria-title-text {
    display: flex;
    flex-direction: column;
  }

  .galeria-title-text .tag-text {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--text-font);
    font-size: 0.9rem;
    color: var(--tag-color);
    margin-bottom: 0.3rem;
  }

  .galeria-title-text .tag-text span {
    width: 1.5rem;
    height: 2px;
    background-color: var(--tag-color);
  }

  .galeria-title-text h2 {
    font-family: var(--title-font);
    font-size: 2.5rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.1;
  }
}

/* ---- Main Gallery Section ---- */
@media screen and (min-width: 0px) {
  .galeria-main-section {
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem 1.5rem;
    background-color: var(--background-color1);
    overflow: hidden;
  }

  /* Background decorative images */
  .galeria-bg-left,
  .galeria-bg-right {
    position: absolute;
    z-index: 0;
    pointer-events: none;
  }

  .galeria-bg-left {
    left: -5rem;
    bottom: 2rem;
    width: 20rem;
    opacity: 0.15;
  }

  .galeria-bg-left img {
    width: 100%;
    height: auto;
    object-fit: contain;
  }

  .galeria-bg-right {
    right: -3rem;
    bottom: -2rem;
    width: 18rem;
    opacity: 0.2;
  }

  .galeria-bg-right img {
    width: 100%;
    height: auto;
    object-fit: contain;
  }

  /* Gallery Container */
  .galeria-container {
    width: 100%;
    max-width: 1400px;
    display: flex;
    flex-direction: column;
    gap: 3rem;
    position: relative;
    z-index: 1;
  }

  /* Gallery Column */
  .galeria-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }

  .galeria-column-header h3 {
    font-family: var(--title-font);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--title-color);
    margin-bottom: 0.5rem;
  }

  .galeria-column-header p {
    font-family: var(--text-font);
    font-size: 0.95rem;
    color: var(--text-color);
    line-height: 1.5;
    max-width: 400px;
  }

  /* Gallery Divider */
  .galeria-divider {
    display: none;
  }

  /* Gallery Grid - Auto-responsive with CSS Grid */
  .galeria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
  }

  .fotos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
  }

  .videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
  }

  /* Gallery Item */
  .galeria-item {
    position: relative;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 3px solid var(--tag-color);
    background-color: var(--background-color2);
    aspect-ratio: 1 / 1;
  }

  .galeria-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
  }

  .galeria-item:hover img {
    transform: scale(1.05);
  }


  .galeria-item-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.8rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  }

  .galeria-item-caption p {
    font-family: var(--text-font);
    font-size: 0.85rem;
    color: #ffffff;
    margin: 0;
  }

  /* Video item with play button */
  .video-item {
    cursor: pointer;
  }

  .video-item .play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 3rem;
    height: 3rem;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    transition: transform 0.3s ease, background-color 0.3s ease;
  }

  .video-item .play-button img {
    width: 1.2rem;
    height: 1.2rem;
    object-fit: contain;
    margin-left: 0.2rem;
  }

  .video-item:hover .play-button {
    transform: translate(-50%, -50%) scale(1.1);
    /* background-color: #ffffff; */
  }

  /* Video Thumbnail Loading States */
  .video-item.thumbnail-loading img {
    opacity: 0.5;
  }

  .video-item.thumbnail-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2rem;
    height: 2rem;
    margin-top: -1rem;
    margin-left: -1rem;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--tag-color);
    border-radius: 50%;
    animation: thumbnailSpin 0.8s linear infinite;
    z-index: 5;
  }

  .video-item.thumbnail-loaded img {
    opacity: 1;
    transition: opacity 0.3s ease;
  }

  @keyframes thumbnailSpin {
    to {
      transform: rotate(360deg);
    }
  }

  /* Gallery Button */
 .galeria-page-cta {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 0.7rem 2rem;
    font-family: var(--text-font);
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    background-color: var(--tag-color);
    border: none;
    border-radius: 0.3rem;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
  }

  .galeria-page-cta:hover {
    background-color: #7a7a12;
    transform: translateY(-2px);
  }

  /* Gallery blur bottom */
  .galeria-blur-bottom {
    margin-top: -5rem;
  }
}

/* ---- Tablet Breakpoint ---- */
@media screen and (min-width: 600px) {
  .galeria-main-section {
    padding: 4rem 2rem;
  }

  .fotos-grid,
  .videos-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }

  /* .galeria-item-large {
    grid-column: span 1;
    min-height: 220px;
  } */

  .galeria-bg-left {
    width: 25rem;
    left: -6rem;
  }

  .galeria-bg-right {
    width: 22rem;
    right: -4rem;
  }
}

/* ---- Desktop Breakpoint ---- */
@media screen and (min-width: 1000px) {
  .galeria-main-section {
    padding: 5rem 3rem;
  }

  .galeria-container {
    flex-direction: row;
    gap: 0;
  }

  .galeria-column {
    flex: 1;
    padding: 0 2rem;
  }

  .galeria-fotos {
    padding-left: 0;
    padding-right: 2rem;
  }

  .galeria-videos {
    padding-left: 2rem;
    padding-right: 0;
  }

  /* Vertical Divider */
  .galeria-divider {
    display: flex;
    width: 2px;
    background: repeating-linear-gradient(
      to bottom,
      var(--tag-color) 0,
      var(--tag-color) 8px,
      transparent 8px,
      transparent 16px
    );
    min-height: 100%;
    align-self: stretch;
  }

  /* Gallery Grid - Desktop with auto-fill */
  .fotos-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }

  /* .galeria-item-large {
    grid-column: span 1;
    min-height: 250px;
    aspect-ratio: auto;
  } */

  .videos-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }

  .videos-grid .galeria-item {
    aspect-ratio: 4 / 3;
  }

  .galeria-column-header h3 {
    font-size: 2rem;
  }

  .galeria-column-header p {
    font-size: 1rem;
  }

  .galeria-bg-left {
    width: 30rem;
    left: -8rem;
    bottom: 0;
    opacity: 0.12;
  }

  .galeria-bg-right {
    width: 28rem;
    right: -5rem;
    bottom: -3rem;
    opacity: 0.15;
  }

  .video-item .play-button {
    width: 4rem;
    height: 4rem;
  }

  .video-item .play-button img {
    width: 1.5rem;
    height: 1.5rem;
  }
}

/* ---- Large Desktop Breakpoint ---- */
@media screen and (min-width: 1400px) {
  .galeria-main-section {
    padding: 6rem 4rem;
  }

  .galeria-container {
    max-width: 1600px;
  }

  .galeria-column {
    padding: 0 3rem;
  }

  .galeria-column-header h3 {
    font-size: 2.2rem;
  }

  .galeria-bg-left {
    width: 35rem;
    left: -5rem;
  }

  .galeria-bg-right {
    width: 32rem;
    right: -3rem;
  }
}

/* =============================================
   GALLERY LIGHTBOX STYLES
   Complete lightbox/dialog for images and videos
   ============================================= */

/* Lightbox Overlay */
.gallery-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  /* iOS Safari fix for address bar */
  min-height: 100vh;
  min-height: -webkit-fill-available;
  z-index: 9999;
  display: flex;
  -webkit-box-pack: center;
  justify-content: center;
  -webkit-box-align: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  -webkit-transition: opacity 0.3s ease, visibility 0.3s ease;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  overflow: visible !important;
  /* Mobile touch fixes */
  -webkit-overflow-scrolling: touch;
  touch-action: none;
  isolation: isolate;
}

.gallery-lightbox.active {
  opacity: 1;
  visibility: visible;
}

/* Override global overflow-x hidden for lightbox elements */
.gallery-lightbox,
.gallery-lightbox *,
.lightbox-container,
.lightbox-close,
.lightbox-nav {
  overflow: visible !important;
}

/* Backdrop */
.lightbox-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  cursor: pointer;
  overflow: hidden !important;
  -webkit-tap-highlight-color: transparent;
}

/* Lightbox Container */
.lightbox-container {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 1400px;
  max-height: 90vh;
  max-height: 90dvh;
  display: flex;
  flex-direction: column;
  -webkit-box-pack: center;
  justify-content: center;
  -webkit-box-align: center;
  align-items: center;
  padding: 1rem;
  z-index: 1;
}

/* Close Button */
.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 3rem;
  height: 3rem;
  display: flex;
  -webkit-box-pack: center;
  justify-content: center;
  -webkit-box-align: center;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 50%;
  color: #ffffff;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  -webkit-transition: all 0.3s ease;
  transition: all 0.3s ease;
  z-index: 10;
}

.lightbox-close:hover {
  background-color: rgba(0, 0, 0, 0.7);
  border-color: rgba(255, 255, 255, 0.8);
  -webkit-transform: scale(1.1);
  transform: scale(1.1);
}

.lightbox-close svg {
  width: 1.5rem;
  height: 1.5rem;
  stroke: #ffffff;
  fill: none;
}

/* Navigation Buttons */
.lightbox-nav {
  position: absolute;
  top: 50%;
  -webkit-transform: translateY(-50%);
  transform: translateY(-50%);
  width: 3.5rem;
  height: 3.5rem;
  display: flex;
  -webkit-box-pack: center;
  justify-content: center;
  -webkit-box-align: center;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  color: #ffffff;
  cursor: pointer;
  -webkit-transition: all 0.3s ease;
  transition: all 0.3s ease;
  z-index: 10;
  -webkit-tap-highlight-color: transparent;
}

.lightbox-nav:hover:not(.disabled) {
  background-color: var(--tag-color);
  border-color: var(--tag-color);
  -webkit-transform: translateY(-50%) scale(1.1);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-nav.disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.lightbox-prev {
  left: 1rem;
}

.lightbox-next {
  right: 1rem;
}

.lightbox-nav svg {
  width: 2rem;
  height: 2rem;
}

/* Lightbox Content */
.lightbox-content {
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 90%;
  max-height: 75vh;
  transition: opacity 0.15s ease;
}

.lightbox-content.fade-out {
  opacity: 0;
}

.lightbox-content.fade-in {
  opacity: 1;
}

/* Lightbox Image */
.lightbox-image {
  max-width: 100%;
  max-height: 70vh;
  max-height: 70dvh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0.5rem;
  -webkit-box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  -webkit-animation: lightboxZoomIn 0.3s ease;
  animation: lightboxZoomIn 0.3s ease;
}

/* Lightbox Video */
.lightbox-video {
  max-width: 100%;
  max-height: 70vh;
  max-height: 70dvh;
  width: auto;
  height: auto;
  border-radius: 0.5rem;
  -webkit-box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  -webkit-animation: lightboxZoomIn 0.3s ease;
  animation: lightboxZoomIn 0.3s ease;
  background-color: #000000;
}

/* Lightbox YouTube Container */
.lightbox-youtube-container {
  position: relative;
  width: 90vw;
  max-width: 1000px;
  aspect-ratio: 16 / 9;
  border-radius: 0.5rem;
  overflow: hidden;
  -webkit-box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  -webkit-animation: lightboxZoomIn 0.3s ease;
  animation: lightboxZoomIn 0.3s ease;
  background-color: #000000;
}

.lightbox-youtube {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Lightbox Info (Caption & Counter) */
.lightbox-info {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  -webkit-transform: translateX(-50%);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  -webkit-box-align: center;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
  z-index: 10;
}

.lightbox-caption {
  font-family: var(--text-font);
  font-size: 1rem;
  color: #ffffff;
  background-color: rgba(0, 0, 0, 0.7);
  padding: 0.5rem 1.5rem;
  border-radius: 2rem;
  margin: 0;
  max-width: 90vw;
}

.lightbox-counter {
  font-family: var(--text-font);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}

/* Animations */
@-webkit-keyframes lightboxZoomIn {
  from {
    opacity: 0;
    -webkit-transform: scale(0.9);
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    -webkit-transform: scale(1);
    transform: scale(1);
  }
}

@keyframes lightboxZoomIn {
  from {
    opacity: 0;
    -webkit-transform: scale(0.9);
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    -webkit-transform: scale(1);
    transform: scale(1);
  }
}

/* Tablet and Desktop adjustments */
@media screen and (min-width: 600px) {
  .lightbox-container {
    padding: 2rem;
  }

  .lightbox-close {
    top: 1.5rem;
    right: 1.5rem;
    width: 3.5rem;
    height: 3.5rem;
  }

  .lightbox-nav {
    width: 4rem;
    height: 4rem;
  }

  .lightbox-prev {
    left: 1.5rem;
  }

  .lightbox-next {
    right: 1.5rem;
  }

  .lightbox-content {
    max-width: 85%;
    max-height: 80vh;
  }

  .lightbox-image,
  .lightbox-video {
    max-height: 75vh;
  }

  .lightbox-info {
    bottom: 2rem;
  }

  .lightbox-caption {
    font-size: 1.1rem;
  }
}

@media screen and (min-width: 1000px) {
  .lightbox-container {
    padding: 3rem;
  }

  .lightbox-close {
    top: 2rem;
    right: 2rem;
  }

  .lightbox-prev {
    left: 2rem;
  }

  .lightbox-next {
    right: 2rem;
  }

  .lightbox-content {
    max-width: 80%;
  }

  .lightbox-image,
  .lightbox-video {
    max-height: 80vh;
  }
}
