/* Public gallery archive + single + lightbox — Vazirmatn via site --font */

.gallery-page,
.gallery-page button,
.gallery-page input,
.gallery-page select,
.gallery-page a,
.glb,
.glb button,
.glb a,
.glb input {
  font-family: var(--font, "Vazirmatn", "Segoe UI", Tahoma, sans-serif);
}

.gallery-page .breadcrumb {
  display: flex;
  width: 100%;
  max-width: 100%;
  justify-content: center;
  margin-inline: auto;
  box-sizing: border-box;
}

.gallery-hero {
  padding: 1.25rem 0 0.5rem;
  text-align: center;
}
.gallery-hero h1 {
  margin: 0 0 0.4rem;
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-family: var(--font);
}
.gallery-hero p {
  margin: 0 auto;
  color: var(--muted, #a89fbf);
  max-width: 62ch;
  font-size: 0.95rem;
  font-family: var(--font);
  line-height: 1.8;
}

.gallery-controls {
  margin: 1.25rem auto 0.5rem;
  max-width: 920px;
}
.gallery-panel {
  padding: 1.1rem 1.15rem;
  border: 1px solid var(--border, #2a2540);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface, #12101c) 88%, transparent);
}
.gallery-panel__row {
  display: grid;
  gap: 0.75rem;
  justify-items: stretch;
}
@media (min-width: 720px) {
  .gallery-panel__row {
    grid-template-columns: minmax(0, 1.6fr) minmax(140px, 0.7fr) minmax(130px, 0.6fr);
    align-items: center;
  }
}
.gallery-search {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}
.gallery-search input {
  width: 100%;
  background: var(--bg, #07060f);
  border: 1px solid var(--border, #2a2540);
  color: var(--text, #ece9f5);
  border-radius: 12px;
  padding: 0.7rem 2.6rem 0.7rem 2.4rem;
  outline: none;
  font-family: inherit;
  font-size: 0.92rem;
}
.gallery-search input:focus {
  border-color: var(--accent-2, #a78bfa);
}
.gallery-search__icon {
  position: absolute;
  right: 0.85rem;
  width: 1.1rem;
  height: 1.1rem;
  color: var(--muted, #a89fbf);
  pointer-events: none;
  display: grid;
  place-items: center;
}
.gallery-search__go {
  position: absolute;
  left: 0.4rem;
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--accent, #c4b5fd);
  cursor: pointer;
  padding: 0.4rem;
  display: grid;
  place-items: center;
  font-family: inherit;
}
.gallery-select {
  width: 100%;
  background: var(--bg, #07060f);
  border: 1px solid var(--border, #2a2540);
  color: var(--text, #ece9f5);
  border-radius: 12px;
  padding: 0.7rem 1rem;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
}
.gallery-stats {
  margin: 0.85rem 0 0;
  font-size: 0.82rem;
  color: var(--muted, #a89fbf);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: center;
  font-family: inherit;
}
.gallery-stats__sep { opacity: 0.45; }

.gallery-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1rem auto 1.25rem;
  justify-content: center;
  max-width: 920px;
}
.gallery-cats .module-chip {
  font-family: var(--font);
  font-weight: 600;
}

.gallery-grid {
  display: grid;
  gap: 1.15rem;
  grid-template-columns: 1fr;
}
@media (min-width: 560px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}

.g-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border, #2a2540);
  border-radius: 18px;
  background: var(--surface, #12101c);
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  font-family: var(--font);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.25, 1), border-color 0.25s, box-shadow 0.25s;
}
.g-card:hover,
.g-card:focus-visible {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent-2, #a78bfa) 45%, var(--border, #2a2540));
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  outline: none;
}
.g-card__cover {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--bg, #07060f);
}
.g-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.25, 1);
}
.g-card:hover .g-card__cover img { transform: scale(1.05); }
.g-card__count {
  position: absolute;
  bottom: 0.65rem;
  left: 0.65rem;
  background: rgba(7, 6, 15, 0.72);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(196, 181, 253, 0.14);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font);
}
.g-card__body {
  padding: 1rem 1.05rem 1.15rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.g-card__cat {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-2, #2dd4bf);
  font-family: var(--font);
}
.g-card__title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.35;
  font-family: var(--font);
}
.g-card__excerpt {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted, #a89fbf);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-family: var(--font);
  line-height: 1.7;
}
.g-card__meta {
  margin-top: auto;
  padding-top: 0.55rem;
  font-size: 0.72rem;
  color: var(--muted, #a89fbf);
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-family: var(--font);
}

.gallery-empty {
  text-align: center;
  padding: 3rem 1rem;
  font-family: var(--font);
}

.gallery-single__back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted, #a89fbf);
  margin-bottom: 0.75rem;
  text-decoration: none;
  font-family: var(--font);
}
.gallery-single__back:hover { color: var(--accent, #c4b5fd); }

.gallery-single__head {
  display: grid;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}
@media (min-width: 860px) {
  .gallery-single__head {
    grid-template-columns: 1.15fr 0.85fr;
    align-items: end;
  }
}
.gallery-single__cover {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border, #2a2540);
  aspect-ratio: 16 / 9;
  background: var(--surface, #12101c);
}
.gallery-single__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: auto;
}
.gallery-single__cat {
  color: var(--accent-2, #2dd4bf);
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  font-family: var(--font);
}
.gallery-single__title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  font-weight: 800;
  font-family: var(--font);
}
.gallery-single__lead {
  margin: 0 0 1rem;
  color: var(--muted, #a89fbf);
  font-size: 0.95rem;
  font-family: var(--font);
  line-height: 1.8;
}
.gallery-single__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.photo-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, 1fr);
  margin-bottom: 2rem;
}
@media (min-width: 720px) {
  .photo-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }
}
.photo-item {
  appearance: none;
  border: 1px solid var(--border, #2a2540);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface, #12101c);
  padding: 0;
  cursor: zoom-in;
  color: inherit;
  font-family: var(--font);
  text-align: right;
  transition: 0.25s cubic-bezier(0.2, 0.8, 0.25, 1);
  display: flex;
  flex-direction: column;
  width: 100%;
}
.photo-item:hover,
.photo-item:focus-visible {
  border-color: var(--accent-2, #a78bfa);
  transform: translateY(-2px);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45);
  outline: none;
}
.photo-item__img {
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--bg, #07060f);
}
.photo-item__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.25, 1);
}
.photo-item:hover .photo-item__img img { transform: scale(1.04); }
.photo-item figcaption {
  padding: 0.65rem 0.75rem 0.8rem;
  font-size: 0.78rem;
  color: var(--muted, #a89fbf);
  line-height: 1.45;
  font-family: var(--font);
}
.photo-item figcaption strong {
  display: block;
  color: var(--text, #ece9f5);
  font-size: 0.85rem;
  margin-bottom: 0.15rem;
  font-weight: 700;
}

/* —— Lightbox (above site-header z-index:1000) —— */
.glb {
  position: fixed;
  inset: 0;
  z-index: 10050;
  background: rgba(4, 3, 10, 0.94);
  backdrop-filter: blur(12px);
  display: none;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.25s;
  font-family: var(--font, "Vazirmatn", "Segoe UI", Tahoma, sans-serif);
  direction: rtl;
}
.glb.is-open {
  display: flex;
  opacity: 1;
}
.glb[hidden] { display: none !important; }

.glb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border, #2a2540);
  flex-shrink: 0;
  background: rgba(12, 10, 22, 0.92);
  position: relative;
  z-index: 3;
  min-height: 64px;
}
.glb-title {
  font-weight: 700;
  font-size: 0.92rem;
  min-width: 0;
  flex: 1;
  font-family: inherit;
}
.glb-title-main {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.glb-title small,
.glb-title-meta {
  display: block;
  color: var(--muted, #a89fbf);
  font-weight: 500;
  font-size: 0.75rem;
  font-family: inherit;
}
.glb-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.glb-btn {
  appearance: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border, #2a2540);
  background: var(--surface, #12101c);
  color: var(--text, #ece9f5);
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  transition: 0.2s;
  text-decoration: none;
  font-weight: 700;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
}
.glb-btn:hover {
  border-color: var(--accent-2, #a78bfa);
  background: var(--surface-2, #1a1728);
  color: #fff;
}
.glb-btn--primary {
  width: auto;
  min-width: 42px;
  padding: 0 0.85rem;
  gap: 0.4rem;
  display: inline-flex;
  align-items: center;
  font-size: 0.8rem;
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  border-color: transparent;
  color: #fff;
}
.glb-btn--close {
  background: color-mix(in srgb, #f87171 18%, var(--surface, #12101c));
  border-color: color-mix(in srgb, #f87171 40%, var(--border, #2a2540));
}
.glb-btn svg {
  width: 18px;
  height: 18px;
  display: block;
  flex-shrink: 0;
}

.glb-stage {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  min-height: 0;
  user-select: none;
}
.glb-stage.is-dragging { cursor: grabbing; }
.glb-stage > img {
  max-width: min(92%, 1100px);
  max-height: calc(100vh - 180px);
  object-fit: contain;
  border-radius: 8px;
  transform-origin: center center;
  transition: transform 0.08s linear;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

/* Physical left = previous, physical right = next (dir=ltr prevents RTL glyph flip) */
.glb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 1px solid var(--border, #2a2540);
  background: rgba(18, 16, 28, 0.9);
  color: #fff;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: 0.2s;
  z-index: 2;
  padding: 0;
  direction: ltr;
  unicode-bidi: isolate;
}
.glb-nav:hover {
  background: var(--surface-2, #1a1728);
  border-color: var(--accent, #c4b5fd);
}
.glb-nav svg {
  width: 22px;
  height: 22px;
  display: block;
}
.glb-nav--prev { left: 1rem; right: auto; }
.glb-nav--next { right: 1rem; left: auto; }

.glb-zoom-hint {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.72rem;
  color: var(--muted, #a89fbf);
  background: rgba(7, 6, 15, 0.7);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border, #2a2540);
  pointer-events: none;
  white-space: nowrap;
  font-family: inherit;
}

.glb-thumbs {
  display: flex;
  gap: 0.45rem;
  padding: 0.65rem 1rem;
  overflow-x: auto;
  border-top: 1px solid var(--border, #2a2540);
  flex-shrink: 0;
  justify-content: center;
  background: rgba(12, 10, 22, 0.92);
  position: relative;
  z-index: 3;
}
.glb-thumbs button {
  appearance: none;
  border: 2px solid transparent;
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  cursor: pointer;
  background: var(--surface, #12101c);
  opacity: 0.55;
  transition: 0.2s;
  font-family: inherit;
}
.glb-thumbs button.is-on {
  border-color: var(--accent, #c4b5fd);
  opacity: 1;
}
.glb-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Match articles archive pagination (gallery page does not load articles.css) */
.gallery-page .articles-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 2.5rem;
  font-family: var(--font);
}

.gallery-page .articles-page-nums {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.gallery-page .articles-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.gallery-page .articles-page-btn:hover:not(.is-disabled):not(.is-active) {
  border-color: var(--accent);
  color: var(--accent-2);
  transform: translateY(-1px);
}

.gallery-page .articles-page-btn.is-active {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.22), rgba(139, 92, 246, 0.08));
  color: var(--accent-2);
  box-shadow: 0 8px 22px rgba(139, 92, 246, 0.2);
}

.gallery-page .articles-page-btn--nav {
  min-width: 4.5rem;
  border-radius: var(--radius);
}

.gallery-page .articles-page-btn.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.gallery-page .articles-page-ellipsis {
  color: var(--muted-2);
  padding: 0 0.15rem;
  user-select: none;
}

@media (max-width: 560px) {
  .glb-nav--prev { left: 0.4rem; }
  .glb-nav--next { right: 0.4rem; }
  .glb-btn--primary .glb-btn__label { display: none; }
  .glb-bar { padding: 0.55rem 0.65rem; }
  .glb-actions { gap: 0.3rem; }
  .glb-btn { width: 38px; height: 38px; border-radius: 10px; }
}

/* 01 inventory: gallery guide block */
.gallery-single__guide{max-width:46rem;margin:2rem auto 0;line-height:1.95}
.gallery-single__guide h2{font-size:1.15rem;margin:0 0 .6rem}
.gallery-single__guide p{margin:0 0 .8rem}
.gallery-single__related{display:flex;flex-wrap:wrap;gap:.5rem;list-style:none;padding:0;margin:.8rem 0 0}
.gallery-single__related a{display:inline-block;padding:.35rem .8rem;border:1px solid var(--line, rgba(139,92,246,.35));border-radius:999px;text-decoration:none}
