/* ASTI Gallery Page — Node 26 */
.custom-gallery-page {
  --gallery-green-950: #0c2b1e;
  --gallery-green-600: #36745a;
  --gallery-gold-600: #b78d43;
  --gallery-bg: #fcfbfa;
  --gallery-surface: #fff;
  --gallery-text: #0c2b1e;
  --gallery-muted: #4a6b5d;
  --gallery-border: rgba(12, 43, 30, .09);

  width: 100%;
  margin: 0;
  background: var(--gallery-bg);
  color: var(--gallery-text);
  font-family: inherit;
  direction: rtl;
}

.custom-gallery-page,
.custom-gallery-page *,
.custom-gallery-page *::before,
.custom-gallery-page *::after {
  box-sizing: border-box;
}

/* Section */
.custom-gallery-section {
  position: relative;
  overflow: hidden;
  width: 100%;
  padding: 72px 0 90px;
  background:
    radial-gradient(
      circle at 10% 8%,
      rgba(183, 141, 67, .10),
      transparent 24%
    ),
    radial-gradient(
      circle at 92% 92%,
      rgba(24, 75, 55, .08),
      transparent 26%
    ),
    var(--gallery-bg);
}

/* Container */
.gallery-container {
  position: relative;
  z-index: 1;
  width: min(1600px, calc(100% - 40px));
  margin-inline: auto;
}

/* Header */
.gallery-header {
  max-width: 760px;
  margin: 0 auto 52px;
  text-align: center;
}

.gallery-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  margin-bottom: 17px;
  padding: 7px 15px;
  border: 1px solid rgba(183, 141, 67, .28);
  border-radius: 999px;
  background: rgba(183, 141, 67, .10);
  color: #8b682d;
  font-size: 12px;
  font-weight: 800;
}

.gallery-title {
  margin: 0;
  color: var(--gallery-green-950);
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 800;
  line-height: 1.35;
}

.gallery-title::after {
  content: "";
  display: block;
  width: 82px;
  height: 4px;
  margin: 17px auto 0;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--gallery-gold-600),
    var(--gallery-green-600)
  );
}

.gallery-subtitle {
  max-width: 680px;
  margin: 24px auto 0;
  color: var(--gallery-muted);
  font-size: 17px;
  line-height: 1.9;
}

/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 34px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Gallery Card */
.gallery-item {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--gallery-border);
  border-radius: 20px;
  background: var(--gallery-surface);
  box-shadow: 0 16px 38px rgba(12, 43, 30, .09);
  transition:
    transform .3s ease,
    box-shadow .3s ease,
    border-color .3s ease;
}

.gallery-item:hover {
  transform: translateY(-8px);
  border-color: rgba(183, 141, 67, .45);
  box-shadow: 0 24px 52px rgba(12, 43, 30, .14);
}

.gallery-figure {
  margin: 0;
}

/* Image */
.image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #eae8e5;
}

.image-wrapper::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgba(12, 43, 30, .14),
    transparent 34%
  );
  opacity: .62;
  transition: opacity .3s ease;
}

.gallery-item:hover .image-wrapper::after {
  opacity: .34;
}

.gallery-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  transition: transform .65s cubic-bezier(.25, 1, .5, 1);
}

.gallery-item:hover .gallery-image {
  transform: scale(1.045);
}

/* Caption */
.gallery-caption {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 20px;

  background: var(--gallery-surface);
  color: var(--gallery-green-950) !important;

  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.7;
  text-align: center;
}

/* English */
body.en-body .custom-gallery-page {
  direction: ltr;
}

/* =========================
   DARK MODE
   ========================= */

body.dark-mode .custom-gallery-page {
  --gallery-bg: #101711;
  --gallery-surface: #18231c;
  --gallery-text: #f1f5f2;
  --gallery-muted: #c3cec6;
  --gallery-border: rgba(255, 255, 255, .11);
}

body.dark-mode .custom-gallery-section {
  background:
    radial-gradient(
      circle at 10% 8%,
      rgba(210, 179, 111, .10),
      transparent 24%
    ),
    radial-gradient(
      circle at 92% 92%,
      rgba(67, 125, 94, .11),
      transparent 26%
    ),
    var(--gallery-bg);
}

body.dark-mode .gallery-title {
  color: #f3f6f4 !important;
}

body.dark-mode .gallery-subtitle {
  color: #c3cec6 !important;
}

body.dark-mode .gallery-kicker {
  border-color: rgba(210, 179, 111, .25);
  background: rgba(210, 179, 111, .10);
  color: #e5cb91 !important;
}

body.dark-mode .gallery-item {
  background: var(--gallery-surface);
  border-color: var(--gallery-border);
  box-shadow: 0 18px 42px rgba(0, 0, 0, .25);
}

/* Caption — Dark Mode */
body.dark-mode .gallery-caption {
  background: #18231c !important;
  color: #f3f6f4 !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Tablet */
@media (max-width: 900px) {
  .gallery-grid {
    gap: 24px;
  }

  .gallery-container {
    width: min(100% - 28px, 1600px);
  }
}

/* Mobile */
@media (max-width: 700px) {
  .custom-gallery-section {
    padding: 55px 0 70px;
  }

  .gallery-header {
    margin-bottom: 36px;
  }

  .gallery-subtitle {
    font-size: 15px;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .image-wrapper {
    aspect-ratio: 4 / 3;
  }

  .gallery-caption {
    min-height: 60px;
    padding: 14px 17px;
  }
}

/* Small Mobile */
@media (max-width: 420px) {
  .gallery-container {
    width: min(100% - 20px, 1600px);
  }

  .gallery-title {
    font-size: 29px;
  }

  .gallery-item {
    border-radius: 16px;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .gallery-item,
  .gallery-image,
  .image-wrapper::after {
    transition: none !important;
  }
}