/* =============================================================
   BASE GALLERY STYLES
   ============================================================= */

.lazy-animate {
  opacity: 0;
  transition: opacity 0.7s cubic-bezier(0.4,0,0.2,1);
  will-change: opacity;
}
.lazy-animate.loaded {
  opacity: 1;
}

.back-link-wrapper {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
  margin-top: 8px;
}
.back-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  gap: 12px;
  font-size: 1.2rem;
  color: #ccc;
  transition: color 0.2s;
}
.back-link:hover .back-link-text {
  color: #111;
  text-decoration: underline;
}
.back-link-text {
  font-size: 0.85rem;
  transition: color 0.3s ease;
}
.lottie-hover-link.lottie-back-arrow {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ink-gallery-page {
  margin-bottom: 50px;
}

.ink-gallery-subheadline{
  width: 100%;
  color: #666;
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
}
.ink-gallery-description{
  color: #666;
  text-align: center;
  width: 75%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 7px 25px 25px 25px;
}

@media (max-width: 1400px) {
  .ink-gallery-page {
    /* width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    box-sizing: border-box;
    max-width: 100vw; */
  }
}
.ink-gallery-galleryitem-title {
  font-size: 1.05em;
  margin-bottom: 12px;
  color: #222;
  font-weight: 500;
}

.ink-gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  width: 100%;
}


/* =============================================================
   FULL WIDTH DISPLAY
   ============================================================= */
.ink-gallery-grid.full-width {
  gap: 1px;
}
.ink-gallery-grid.full-width .ink-gallery-galleryitem.landscape {
  grid-column: 1 / -1;
  width: 100%;
  justify-self: stretch;
}
.ink-gallery-grid.full-width .ink-gallery-pair-row {
  display: flex;
  flex-direction: row;
  width: 100%;
  gap: 1px;
  margin-bottom: 1px;
}
.ink-gallery-grid.full-width .ink-gallery-galleryitem.portrait.paired {
  width: 50%;
  flex: 1 1 0;
  justify-self: stretch;
  margin: 0;
  display: flex;
  flex-direction: column;
}
.ink-gallery-grid.full-width .ink-gallery-galleryitem.portrait.single {
  width: 50%;
  margin-left: auto;
  margin-right: auto;
  display: block;
}
.ink-gallery-grid.full-width .ink-gallery-galleryitem.landscape {
  width: 100%;
  justify-self: stretch;
}
.ink-gallery-grid.full-width .ink-gallery-galleryitem-text {
  cursor: pointer;
  aspect-ratio: 16 / 9;
  height: auto;
  min-height: 0;
  /* Fallback for older browsers */
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.ink-gallery-grid.full-width .ink-gallery-galleryitem-text::before {
  content: '';
  display: block;
  padding-top: 56.25%; /* 16:9 ratio fallback */
  height: 0;
}
.ink-gallery-grid.full-width .ink-gallery-galleryitem-text > * {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}



/* =============================================================
   GALLERY ITEM STYLES
   ============================================================= */

.ink-gallery-galleryitem {
  position: relative;
}

.gallery-play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.88;
  transition: opacity 0.2s, filter 0.2s;
  pointer-events: auto;
}
.gallery-play-overlay:hover,
.gallery-play-overlay:focus {
  opacity: 1;
  filter: brightness(1.2);
}
.media-preview.playing .gallery-play-overlay {
  display: none;
}
.ink-gallery-galleryitem img,
.ink-gallery-galleryitem video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0;
}

/* =============================================================
   TEXT ITEM STYLES
   ============================================================= */

.ink-gallery-galleryitem-text {
  cursor: pointer;
  padding: 24px;
  font-size: 1.1rem;
  color: #333;
  background: #f9f9f9;
  text-align: center;
}
.ink-gallery-grid.full-width .ink-gallery-galleryitem-text {
  cursor: pointer;
  aspect-ratio: 16 / 9;
  height: auto;
  min-height: 0;
  /* Fallback for older browsers */
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.ink-gallery-grid.full-width .ink-gallery-galleryitem-text::before {
  content: '';
  display: block;
  padding-top: 56.25%; /* 16:9 ratio fallback */
  height: 0;
}
.ink-gallery-grid.full-width .ink-gallery-galleryitem-text > * {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}


/* =============================================================
   FUTURE FEATURES: LIGHTBOX, LAZY LOADING, ETC.
   ============================================================= */

/* =============================================================
   LIGHTBOX OVERLAY STYLES
   ============================================================= */

.ink-gallery-lightbox-text-container {
  position: relative;
  width: 90vw;
  max-width: 700px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f9f9f9;
  /* Aspect ratio 16:9 */
  aspect-ratio: 16 / 9;
  min-height: 0;
}
/* Fallback for browsers without aspect-ratio */
.ink-gallery-lightbox-text-container::before {
  content: '';
  display: block;
  padding-top: 56.25%; /* 16:9 ratio fallback */
  height: 0;
}
.ink-gallery-lightbox-text {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  font-size: 1.1rem;
  color: #333;
  background: #f9f9f9;
  text-align: center;
  border-radius: 0;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}

.ink-gallery-lightbox-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.95);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  animation: slideInTop 1s cubic-bezier(.23,1,.32,1);
  transform: translateY(0);
}
.ink-gallery-lightbox-overlay.slide-out {
  animation: slideOutTop 1s cubic-bezier(.23,1,.32,1);
  transform: translateY(-100vh);
}
@keyframes slideInTop {
  from {
    transform: translateY(-100vh);
    opacity: 1;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
@keyframes slideOutTop {
  from {
    transform: translateY(0);
    opacity: 1;
  }
  to {
    transform: translateY(-100vh);
    opacity: 1;
  }
}

.ink-gallery-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  font-size: 2rem;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
  transition: opacity 0.2s;
  z-index: 10001;
}
.ink-gallery-lightbox-arrow-svg {
  width: 32px;
  height: 32px;
  display: block;
  pointer-events: none;
  fill: #fff;
}
.ink-gallery-lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  background: none;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.85;
  z-index: 10002;
  transition: opacity 0.2s, background 0.2s;
}
.ink-gallery-lightbox-close:focus,
.ink-gallery-lightbox-close:hover {
  opacity: 1;
  background: rgba(255,255,255,0.08);
}
.ink-gallery-lightbox-close-svg {
  width: 36px;
  height: 36px;
  display: block;
  pointer-events: none;
}

.ink-gallery-lightbox-prev .ink-gallery-lightbox-arrow-svg {
  transform: scaleX(-1);
}


.ink-gallery-lightbox-nav svg {
  display: block;
  width: 28px;
  height: 28px;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.10));
  color: #222;
}
.ink-gallery-lightbox-nav svg path {
  stroke: #222 !important;
  opacity: 1;
}
.ink-gallery-lightbox-nav:hover,
.ink-gallery-lightbox-nav:focus {
  opacity: 1;
  background: none;
}

.ink-gallery-lightbox-prev {
  left: 24px;
}
.ink-gallery-lightbox-next {
  right: 24px;
}

.ink-gallery-lightbox-content {
  position: relative;
  z-index: 10000;
}

.ink-gallery-lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ink-gallery-lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  border-radius: 4px;
  background: #fff;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}


/* =============================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================= */

/* Responsive adjustments */
@media (max-width: 900px) {
  .ink-gallery-grid.full-width .ink-gallery-galleryitem.portrait,
  .ink-gallery-grid.full-width .ink-gallery-galleryitem.portrait.paired,
  .ink-gallery-grid.full-width .ink-gallery-galleryitem.portrait.single {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
  .ink-gallery-grid.full-width .ink-gallery-pair-row {
    flex-direction: column;
    gap: 1pxthere;
    margin-bottom: 0;
  }
  }

/* =============================
   GALLERY INFO BOXES FRONTEND
   ============================= */

.ink-gallery-infobox-row {
  display: flex;
  flex-wrap: wrap;
  gap: 48px;
  justify-content: flex-start;
  margin: 50px auto 50px auto;
  max-width: 1400px;
}
.single-ink-gallery-info-box {
  flex: 1 1 0%;
  flex-basis: 0;
  flex-grow: 1;
  background: #fff;
  border: none;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  box-shadow: none;
  min-width: 0;
  max-width: 100%;
}
.ink-info-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid #ececec;
  margin-bottom: 14px;
      cursor: pointer;
      padding-top: 10px;
      margin-top: -10px;
}
.ink-info-box-header:hover h3 {
  color:#333;
}
.ink-info-box-header h3 {
  font-size: 1.1rem;
  font-weight: 500;
  color: #666;
  margin: 0;
}
.ink-toggle-icon {
  color: #666;
  font-size: 1.5em;
  cursor: pointer;
  margin-left: 18px;
  transition: color 0.15s;
  line-height: 1;
  user-select: none;
  font-family: 'Tajawal', sans-serif;
}
.ink-toggle-icon:hover {
  color: #333;
}
.ink-info-box-content {
  overflow: hidden;
  transition: height 0.25s cubic-bezier(.4,0,.2,1);
  background: none;
}
.ink-info-box-content-inner {
  padding: 0 2px 0 0;
  color: #666;
  font-size: 0.97rem;
  line-height: 1.6;
  word-break: break-word;
}
@media (max-width: 1100px) {
  .ink-gallery-infobox-row {
    flex-direction: column;
    gap: 0;
  }
  .single-ink-gallery-info-box {
    flex: 1 1 100%;
    min-width: 0;
    max-width: 100vw;
    margin-bottom: 32px;
    transition: margin-bottom 0.2s;
  }
  .single-ink-gallery-info-box.open {
    margin-bottom: 50px;
  }
  .single-ink-gallery-info-box:last-child {
    margin-bottom: 0;
  }
}
@media (max-width: 700px) {
  .ink-gallery-infobox-row {
    flex-direction: column;
    gap: 0;
  }
  .single-ink-gallery-info-box {
    flex: 1 1 100%;
    min-width: 0;
    max-width: 100vw;
    margin-bottom: 32px;
    transition: margin-bottom 0.2s;
  }
  .single-ink-gallery-info-box.open {
    margin-bottom: 50px;
  }
  .single-ink-gallery-info-box:last-child {
    margin-bottom: 0;
  }
}

