
/* =========================================
   AANANDA YOGA STUDIO — PREMIUM MEDIA GALLERY
========================================= */

.font-display {
  font-family: "Playfair Display", Georgia, serif;
}

/* Filter buttons */
.gallery-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid #e7e5e4;
  border-radius: 999px;
  background: #fff;
  color: #57534e;
  padding: 0.7rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 600;
  transition: 0.25s ease;
  cursor: pointer;
}

.gallery-filter:hover {
  border-color: #a7c4ad;
  color: #14532d;
  transform: translateY(-1px);
}

.gallery-filter:focus-visible {
  outline: 3px solid #86efac;
  outline-offset: 3px;
}

.gallery-filter.is-active {
  background: #173d2c;
  border-color: #173d2c;
  color: #fff;
  box-shadow: 0 5px 15px #173d2c25;
}

/* Gallery cards */
.media-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #29252412;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 8px 24px #1c19170b;
  transition:
    box-shadow 0.35s ease,
    border-color 0.35s ease;
}

.media-card:hover {
  box-shadow: 0 18px 44px #1c19171f;
  border-color: #16653430;
}

.media-card-button {
  display: block;
  width: 100%;
  text-align: left;
  color: inherit;
  cursor: pointer;
}

.media-card-button:focus-visible {
  outline: 3px solid #16a34a;
  outline-offset: -4px;
  border-radius: 1rem;
}

/* Image and video containers */
.media-visual {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #e7e5e4;
}

.media-visual.is-tall {
  aspect-ratio: 4 / 5;
}

.media-visual.is-wide {
  aspect-ratio: 16 / 10;
}

.media-visual img,
.media-visual video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.2, 0.65, 0.25, 1);
}

.media-card:hover .media-visual img,
.media-card:hover .media-visual video {
  transform: scale(1.045);
}

/* Subtle image overlay */
.media-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    #0003,
    transparent 30%,
    transparent 65%,
    #0002
  );
}

/* Photo / video label */
.media-type {
  position: absolute;
  z-index: 2;
  left: 0.9rem;
  bottom: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid #ffffff70;
  border-radius: 999px;
  background: #1c19177a;
  color: #fff;
  padding: 0.38rem 0.65rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.media-type svg {
  width: 14px;
  height: 14px;
}

/* Video play button */
.media-play {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 3.25rem;
  height: 3.25rem;
  border: 1px solid #ffffffbd;
  border-radius: 50%;
  background: #ffffffe0;
  color: #173d2c;
  box-shadow: 0 5px 25px #0002;
  transition: transform 0.25s ease;
}

.media-card:hover .media-play {
  transform: translate(-50%, -50%) scale(1.08);
}

.media-play svg {
  width: 1rem;
  height: 1rem;
  margin-left: 2px;
}

/* NEW badge */
.media-new {
  position: absolute;
  z-index: 3;
  top: 0.85rem;
  right: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  border: 1px solid #ffffffb3;
  border-radius: 999px;
  background: linear-gradient(135deg, #fbbf24, #f97316);
  color: #431407;
  padding: 0.4rem 0.68rem;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  box-shadow: 0 4px 16px #f973164d;
}

.media-new::before {
  content: "";
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 50%;
  background: #7c2d12;
  animation: newPulse 1.8s ease-in-out infinite;
}

@keyframes newPulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.45;
    transform: scale(0.72);
  }
}

/* Card title and metadata */
.media-card-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.05rem 1.1rem;
}

.media-card-title {
  overflow: hidden;
  color: #292524;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.12rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-card-subtitle {
  margin-top: 0.25rem;
  color: #a8a29e;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.media-open-icon {
  flex: none;
  color: #78716c;
  transition:
    transform 0.25s ease,
    color 0.25s ease;
}

.media-open-icon svg {
  width: 18px;
  height: 18px;
}

.media-card:hover .media-open-icon {
  color: #166534;
  transform: translate(2px, -2px);
}

/* Lightbox overlay */
.gallery-lightbox {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4.5rem 1.25rem 2rem;
  background: #0c0f0df2;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease;
}

.gallery-lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, 1100px);
  max-height: 100%;
}

.lightbox-media {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
  flex: 1;
}

.lightbox-media img,
.lightbox-media video {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 10rem);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 0.75rem;
  box-shadow: 0 20px 70px #0005;
}

.lightbox-media video {
  width: min(100%, 1000px);
  max-height: calc(100vh - 11rem);
  background: #000;
}

/* Lightbox caption */
.lightbox-caption {
  width: 100%;
  padding-top: 1rem;
  text-align: center;
}

/* Lightbox controls */
.lightbox-close,
.lightbox-nav {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  border: 1px solid #ffffff33;
  background: #ffffff17;
  color: #fff;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background 0.2s ease;
  cursor: pointer;
}

.lightbox-close {
  top: 1rem;
  right: 1rem;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 50%;
  font-size: 2rem;
  line-height: 1;
}

.lightbox-close:hover,
.lightbox-nav:hover {
  background: #ffffff33;
}

.lightbox-close:focus-visible,
.lightbox-nav:focus-visible {
  outline: 3px solid #a7f3d0;
  outline-offset: 3px;
}

.lightbox-nav {
  top: 50%;
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 50%;
  font-size: 1.2rem;
  transform: translateY(-50%);
}

.lightbox-prev {
  left: 1rem;
}

.lightbox-next {
  right: 1rem;
}

.lightbox-nav:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

/* Prevent background scrolling when lightbox is open */
body.lightbox-open {
  overflow: hidden;
}

/* Tablet and mobile */
@media (max-width: 640px) {
  .gallery-filter {
    padding: 0.62rem 0.9rem;
  }

  .media-card-copy {
    padding: 0.85rem 0.9rem 0.95rem;
  }

  .media-card-title {
    font-size: 1.02rem;
  }

  .gallery-lightbox {
    padding: 4.25rem 0.6rem 1.5rem;
  }

  .lightbox-nav {
    top: auto;
    bottom: 0.65rem;
    transform: none;
  }

  .lightbox-prev {
    left: calc(50% - 3.4rem);
  }

  .lightbox-next {
    right: calc(50% - 3.4rem);
  }

  .lightbox-caption {
    padding-top: 0.6rem;
    padding-bottom: 3.2rem;
  }

  .lightbox-media img,
  .lightbox-media video {
    max-height: calc(100vh - 12rem);
    border-radius: 0.4rem;
  }
}

/* Accessibility: respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  .media-card,
  .media-visual img,
  .media-visual video,
  .gallery-filter,
  .media-play,
  .media-open-icon {
    transition: none !important;
  }

  .media-new::before {
    animation: none !important;
  }
}

/* Load More button */
.gallery-load-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  min-width: 170px;
  border: 1px solid #173d2c;
  border-radius: 999px;
  background: #173d2c;
  color: #fff;
  padding: 0.9rem 1.6rem;
  font-size: 0.875rem;
  font-weight: 600;
  transition:
    background 0.25s ease,
    color 0.25s ease,
    transform 0.25s ease,
    box-shadow 0.25s ease;
  cursor: pointer;
}

.gallery-load-more:hover {
  background: #24543d;
  box-shadow: 0 8px 20px #173d2c20;
  transform: translateY(-2px);
}

.gallery-load-more:focus-visible {
  outline: 3px solid #86efac;
  outline-offset: 4px;
}

.gallery-load-more span {
  font-size: 1.1rem;
  transition: transform 0.25s ease;
}

.gallery-load-more:hover span {
  transform: translateY(3px);
}

.gallery-load-more-wrap-hidden {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .gallery-load-more,
  .gallery-load-more span {
    transition: none;
  }
}
