/**
 * CY Colombia - Elementor Gallery Widget Styles
 * Editorial Masonry Layout, Real-time Filter System & Interactive Lightbox Modal
 */

:root {
  --cy-gallery-gap: 24px;
}

.cy-gallery-section {
  background-color: var(--cy-gallery-bg, #f6f5f1);
  border-bottom: 1px solid rgba(21, 21, 21, 0.12);
  width: 100%;
  position: relative;
  box-sizing: border-box;
}

.cy-gallery-section.cy-grid-pattern {
  background-image: 
    linear-gradient(90deg, rgba(21, 21, 21, 0.055) 1px, transparent 1px),
    linear-gradient(rgba(21, 21, 21, 0.045) 1px, transparent 1px);
  background-size: 160px 160px;
  background-position: top center;
}

.cy-gallery-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 120px 32px;
  box-sizing: border-box;
}

/* Section Label & Headings */
.cy-gallery__label {
  color: inherit;
  font-family: var(--font-geist-mono, monospace);
  letter-spacing: 0.13em;
  opacity: 0.68;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(21, 21, 21, 0.2);
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 14px;
  font-size: 11px;
  display: flex;
  width: 100%;
}

.cy-gallery__label-number {
  opacity: 0.75;
}

.cy-gallery__heading {
  margin: 46px 0 40px;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.62fr);
  align-items: end;
  gap: 60px;
}

.cy-gallery__title {
  letter-spacing: -0.055em;
  max-width: 860px;
  margin: 0;
  font-size: clamp(38px, 4.5vw, 67px);
  font-weight: 570;
  line-height: 0.98;
  color: var(--cy-ink, #151515);
}

.cy-gallery__desc {
  color: var(--cy-muted, #686866);
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
}

/* Category Filter Bar */
.cy-gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 44px;
}

.cy-gallery-filter-btn {
  border: 1px solid var(--cy-line, rgba(21, 21, 21, 0.14));
  min-height: 44px;
  color: var(--cy-muted, #686866);
  cursor: pointer;
  background: #ffffff;
  border-radius: 999px;
  padding: 0 22px;
  font-size: 13px;
  font-weight: 560;
  letter-spacing: 0.01em;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.cy-gallery-filter-btn span.count {
  font-family: var(--font-geist-mono, monospace);
  font-size: 10px;
  opacity: 0.6;
}

.cy-gallery-filter-btn:hover {
  border-color: var(--cy-ink, #151515);
  color: var(--cy-ink, #151515);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.cy-gallery-filter-btn.is-active {
  border-color: var(--cy-red, #d00618);
  background: var(--cy-red, #d00618);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(208, 6, 24, 0.25);
  transform: translateY(-2px);
}

.cy-gallery-filter-btn.is-active span.count {
  opacity: 0.85;
}

/* =======================================================
   MASONRY GRID LAYOUT
   ======================================================= */
.cy-gallery-masonry {
  column-count: 3;
  column-gap: var(--cy-gallery-gap);
  width: 100%;
}

.cy-gallery-item {
  break-inside: avoid;
  margin-bottom: var(--cy-gallery-gap);
  display: inline-block;
  width: 100%;
  position: relative;
  border-radius: var(--radius, 22px);
  overflow: hidden;
  background: #141414;
  cursor: pointer;
  box-shadow: 
    0 16px 36px -6px rgba(0, 0, 0, 0.16),
    0 6px 16px -3px rgba(0, 0, 0, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.08) inset;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              opacity 0.35s ease;
}

.cy-gallery-item.cy-item-hidden {
  display: none !important;
}

.cy-gallery-item:hover {
  transform: translateY(-8px) scale(1.008);
  box-shadow: 
    0 32px 64px -10px rgba(0, 0, 0, 0.36),
    0 16px 30px -4px rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(255, 255, 255, 0.16) inset;
}

.cy-gallery-item__media {
  position: relative;
  width: 100%;
  overflow: hidden;
  display: block;
}

.cy-gallery-item__media img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  transition: transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Masonry Aspect Variations */
.cy-gallery-item--portrait .cy-gallery-item__media img {
  aspect-ratio: 4 / 5;
}

.cy-gallery-item--standard .cy-gallery-item__media img {
  aspect-ratio: 4 / 3;
}

.cy-gallery-item--panoramic .cy-gallery-item__media img {
  aspect-ratio: 16 / 10;
}

.cy-gallery-item:hover .cy-gallery-item__media img {
  transform: scale(1.06);
}

/* Rich Dark Gradient & Shadow Overlay */
.cy-gallery-item__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(10, 10, 10, 0.48) 0%,
    rgba(10, 10, 10, 0.05) 30%,
    rgba(10, 10, 10, 0.35) 60%,
    rgba(10, 10, 10, 0.94) 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
  box-sizing: border-box;
  pointer-events: none;
  transition: background 0.35s ease;
}

.cy-gallery-item:hover .cy-gallery-item__overlay {
  background: linear-gradient(
    180deg,
    rgba(10, 10, 10, 0.6) 0%,
    rgba(10, 10, 10, 0.15) 28%,
    rgba(10, 10, 10, 0.5) 55%,
    rgba(10, 10, 10, 0.97) 100%
  );
}

/* Top Meta (Enhanced Dual Badges) */
.cy-gallery-item__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.cy-gallery-item__badge {
  background: rgba(18, 18, 18, 0.86);
  color: #ffffff;
  font-family: var(--font-geist-mono, monospace);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 999px;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}

.cy-gallery-item__badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cy-red, #d00618);
  display: inline-block;
  box-shadow: 0 0 6px rgba(208, 6, 24, 0.8);
}

.cy-gallery-item__location {
  background: rgba(255, 255, 255, 0.92);
  color: var(--cy-ink, #151515);
  font-family: var(--font-geist-mono, monospace);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 5px 12px;
  border-radius: 999px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.cy-gallery-item__location::before {
  content: '⌖';
  font-size: 11px;
  color: var(--cy-red, #d00618);
  font-weight: 900;
}

/* Bottom Content */
.cy-gallery-item__bottom {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cy-gallery-item__title {
  color: #ffffff;
  font-size: 20px;
  font-weight: 580;
  line-height: 1.2;
  margin: 0;
  letter-spacing: -0.03em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.cy-gallery-item__caption {
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, opacity 0.35s ease, margin-top 0.35s ease;
}

.cy-gallery-item:hover .cy-gallery-item__caption {
  max-height: 80px;
  opacity: 1;
  margin-top: 4px;
}

.cy-gallery-item__action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
}

.cy-gallery-item__action span.cy-expand-arrow {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: grid;
  place-content: center;
  font-size: 15px;
  transition: background 0.2s, transform 0.2s;
}

.cy-gallery-item:hover .cy-gallery-item__action span.cy-expand-arrow {
  background: var(--cy-red, #d00618);
  transform: translate(2px, -2px);
}

/* =======================================================
   LIGHTBOX MODAL HD
   ======================================================= */
.cy-gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(8, 8, 8, 0.94);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 24px;
  box-sizing: border-box;
}

.cy-gallery-lightbox.cy-is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.cy-lightbox__dialog {
  position: relative;
  max-width: min(1180px, 94vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #141414;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  transform: scale(0.96);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.cy-gallery-lightbox.cy-is-open .cy-lightbox__dialog {
  transform: scale(1);
}

.cy-lightbox__image-container {
  max-height: 68vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000000;
  overflow: hidden;
}

.cy-lightbox__image-container img {
  max-width: 100%;
  max-height: 68vh;
  object-fit: contain;
  display: block;
}

.cy-lightbox__meta {
  width: 100%;
  padding: 22px 28px 24px;
  background: #141414;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  box-sizing: border-box;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}

.cy-lightbox__info {
  flex: 1;
}

.cy-lightbox__header-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.cy-lightbox__badge {
  background: var(--cy-red, #d00618);
  color: #ffffff;
  font-family: var(--font-geist-mono, monospace);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 999px;
}

.cy-lightbox__location {
  color: rgba(255, 255, 255, 0.6);
  font-family: var(--font-geist-mono, monospace);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.cy-lightbox__title {
  color: #ffffff;
  font-size: 22px;
  font-weight: 560;
  letter-spacing: -0.03em;
  margin: 0 0 6px;
}

.cy-lightbox__desc {
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
  max-width: 820px;
}

/* Lightbox Controls */
.cy-lightbox__close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(15, 15, 15, 0.75);
  color: #ffffff;
  font-size: 26px;
  display: grid;
  place-content: center;
  cursor: pointer;
  z-index: 10;
  line-height: 1;
  transition: all 0.2s ease;
}

.cy-lightbox__close:hover {
  background: var(--cy-red, #d00618);
  border-color: var(--cy-red, #d00618);
  transform: rotate(90deg);
}

.cy-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(15, 15, 15, 0.65);
  color: #ffffff;
  font-size: 26px;
  display: grid;
  place-content: center;
  cursor: pointer;
  z-index: 8;
  line-height: 1;
  transition: all 0.2s ease;
  user-select: none;
}

.cy-lightbox__nav:hover {
  background: #ffffff;
  color: var(--cy-ink, #151515);
  transform: translateY(-50%) scale(1.08);
}

.cy-lightbox__prev {
  left: 20px;
}

.cy-lightbox__next {
  right: 20px;
}

/* =======================================================
   RESPONSIVE BREAKPOINTS
   ======================================================= */
@media (max-width: 1100px) {
  .cy-gallery-inner {
    padding: 96px 32px;
  }
  .cy-gallery__heading {
    grid-template-columns: 1.25fr 0.75fr;
    gap: 40px;
  }
  .cy-gallery-masonry {
    column-count: 2;
    column-gap: 20px;
  }
  .cy-gallery-item {
    margin-bottom: 20px;
  }
}

@media (max-width: 768px) {
  .cy-gallery-inner {
    padding: 72px 20px;
  }
  .cy-gallery__heading {
    grid-template-columns: 1fr;
    gap: 20px;
    margin: 36px 0 28px;
  }
  .cy-gallery__title {
    font-size: 38px;
  }
  .cy-gallery-filters {
    gap: 8px;
    margin-bottom: 32px;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
  }
  .cy-gallery-filter-btn {
    flex-shrink: 0;
    font-size: 12px;
    padding: 0 16px;
    min-height: 40px;
  }
  .cy-gallery-masonry {
    column-count: 1;
    column-gap: 0;
  }
  .cy-gallery-item {
    margin-bottom: 18px;
    border-radius: 18px;
    overflow: hidden;
  }
  .cy-gallery-item__media {
    width: 100% !important;
    overflow: hidden !important;
  }
  .cy-gallery-item__media img,
  .cy-gallery-item--portrait .cy-gallery-item__media img,
  .cy-gallery-item--standard .cy-gallery-item__media img,
  .cy-gallery-item--panoramic .cy-gallery-item__media img {
    aspect-ratio: 16 / 11 !important;
    max-height: 280px !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
  }
  .cy-gallery-item__caption {
    max-height: none !important;
    opacity: 1 !important;
    margin-top: 4px !important;
    font-size: 12.5px;
  }
  .cy-gallery-item__overlay {
    padding: 16px;
  }
  .cy-gallery-item__top {
    gap: 6px;
  }
  .cy-gallery-item__badge {
    padding: 4px 10px;
    font-size: 9px;
  }
  .cy-gallery-item__location {
    padding: 4px 9px;
    font-size: 9px;
  }
  .cy-lightbox__meta {
    flex-direction: column;
    padding: 18px;
    gap: 12px;
  }
  .cy-lightbox__nav {
    display: none; /* Hide floating arrows on small phones; tap image or swipe */
  }
}
