/* Gallery — aligned with Work Samples design system */
.agf-gal-page {
  --gal-ink: #031012;
  --gal-text: #172020;
  --gal-muted: #6C7A79;
  --gal-bg: #F3F6F5;
  --gal-green: #21C77A;
  --gal-deep: #083D3F;
  --gal-gold: #B8954A;
  direction: rtl;
  background: var(--gal-bg);
  color: var(--gal-text);
  overflow: hidden;
}

.agf-gal-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 0 0 28px;
}

.agf-gal-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(8, 61, 63, 0.12);
  background: #fff;
  color: var(--gal-muted);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.agf-gal-tab:hover {
  color: var(--gal-deep);
  border-color: rgba(33, 199, 122, 0.45);
  transform: translateY(-1px);
  text-decoration: none;
}

.agf-gal-tab.is-active {
  color: #fff;
  background: linear-gradient(135deg, #083D3F, #21C77A);
  border-color: transparent;
}

.agf-gal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

@media (min-width: 576px) {
  .agf-gal-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }
}

@media (min-width: 992px) {
  .agf-gal-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
  }
}

.agf-gal-item {
  position: relative;
  margin: 0;
  border: 0;
  padding: 0;
  background: transparent;
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  isolation: isolate;
  aspect-ratio: 1 / 1;
  box-shadow: 0 10px 28px rgba(3, 16, 18, 0.08);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  animation: agfGalIn 0.55s ease both;
}

.agf-gal-item:hover,
.agf-gal-item:focus-visible {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 18px 40px rgba(3, 16, 18, 0.14);
  outline: none;
}

.agf-gal-item__media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.agf-gal-item__frame {
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(184, 149, 74, 0.18);
}

.agf-gal-item__veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(3, 16, 18, 0.72) 100%);
  opacity: 0.85;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.agf-gal-item:hover .agf-gal-item__veil {
  opacity: 1;
}

.agf-gal-item__caption {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  margin: 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.82rem;
  line-height: 1.6;
  text-align: right;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  pointer-events: none;
}

.agf-gal-item__play {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.agf-gal-item__play span {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.92);
  color: #083D3F;
  box-shadow: 0 10px 30px rgba(3, 16, 18, 0.25);
  font-size: 1.1rem;
}

.agf-gal-item--video .agf-gal-item__media,
.agf-gal-item--aparat .agf-gal-item__media {
  width: 100%;
  height: 100%;
}

.agf-gal-item--aparat .h_iframe-aparat_embed_frame,
.agf-gal-item--aparat iframe {
  width: 100% !important;
  height: 100% !important;
  pointer-events: none;
}

@keyframes agfGalIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.agf-gal-modal .modal-content {
  border: 0;
  border-radius: 18px;
  overflow: hidden;
  background: #031012;
  color: #fff;
}

.agf-gal-modal .modal-body {
  padding: 0;
  background: #031012;
}

.agf-gal-modal .modal-body img,
.agf-gal-modal .modal-body video {
  width: 100%;
  height: auto;
  max-height: 78vh;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.agf-gal-modal .modal-footer {
  border: 0;
  background: #052628;
  color: rgba(255, 255, 255, 0.8);
  justify-content: flex-start;
  text-align: right;
  font-size: 0.9rem;
  line-height: 1.7;
}
