/* عکس هیرو + گالری نمونه کارها + لایت‌باکس */

/* عکس جایگزین طرح پرینتر در هیرو */
.printer-art.has-photo { aspect-ratio: auto; max-width: 620px; }
.hero-photo {
  display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: 50% 60%;
  border-radius: var(--r-lg); border: 1.5px solid var(--edge); box-shadow: 8px 8px 0 var(--hard);
}

/* گالری */
.gallery {
  display: grid; gap: 14px;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 200px;
}
.gallery figure {
  position: relative; overflow: hidden; border-radius: var(--r-md);
  border: 1.5px solid var(--edge); background: var(--paper); cursor: zoom-in;
}
/* عکس اول فقط وقتی بزرگ می‌شود که تعداد عکس‌ها ۱، ۵ یا ۹ باشد تا جای خالی نماند */
.gallery.feature figure:nth-child(1) { grid-column: span 2; grid-row: span 2; }
.gallery img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .6s cubic-bezier(.2, .8, .2, 1), filter .4s;
}
.gallery figure::after {
  content: '🔍'; position: absolute; bottom: 12px; inset-inline-end: 12px;
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: var(--ink); color: var(--ink-inv);
  opacity: 0; transform: translateY(8px); transition: .3s;
}
.gallery figure:hover img { transform: scale(1.07); filter: brightness(1.08); }
.gallery figure:hover::after { opacity: 1; transform: none; }

/* لایت‌باکس */
.lightbox {
  position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; padding: 20px;
  background: rgba(5, 6, 9, .92); backdrop-filter: blur(6px); cursor: zoom-out;
  animation: lbIn .25s ease;
}
.lightbox img {
  max-width: min(1100px, 96vw); max-height: 88vh; border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .7); animation: lbPop .3s cubic-bezier(.2, .9, .3, 1.1);
}
.lightbox button {
  position: absolute; top: 18px; inset-inline-end: 18px; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .06); color: var(--text); font-size: 1.1rem;
}
@keyframes lbIn { from { opacity: 0; } }
@keyframes lbPop { from { transform: scale(.94); opacity: 0; } }

@media (max-width: 960px) {
  .gallery { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 170px; }
  .gallery.feature figure:nth-child(1) { grid-column: span 1; grid-row: span 1; }
}
@media (max-width: 600px) {
  .gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 140px; gap: 10px; }
}

/* وقتی فقط یک عکس در گالری است، آن را وسط و بزرگ نشان بده (به‌جای نیمه‌ی خالی گرید) */
.gallery.feature figure:only-child, .gallery figure:only-child { grid-column: 1 / -1; grid-row: auto; max-width: 720px; width: 100%; margin-inline: auto; }
.gallery.feature figure:only-child img, .gallery figure:only-child img { aspect-ratio: 1 / 1; }
.gallery:has(> figure:only-child) { grid-auto-rows: auto; }

/* نوارهای مدل‌ها (هر مدل جدا): بدون ارتفاع ثابت، نسبت طبیعی تصویر */
.gallery.band { grid-template-columns: repeat(3, 1fr); grid-auto-rows: auto; gap: 16px; }
.gallery.band figure { border-radius: var(--r-md); background: var(--paper); }
.gallery.band img { height: auto; aspect-ratio: 313 / 88; }
@media (max-width: 960px) { .gallery.band { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .gallery.band { grid-template-columns: 1fr; gap: 12px; } }
.gallery.band figcaption { position: absolute; top: 10px; inset-inline-start: 12px; padding: 4px 10px; border-radius: 999px; background: var(--ink); color: var(--ink-inv); font-size: .78rem; font-weight: 700; }
.gallery.community figcaption { position: absolute; inset-inline: 0; bottom: 0; padding: 22px 12px 10px; background: linear-gradient(to top, rgba(0,0,0,.7), transparent); color: #fff; font-size: .85rem; font-weight: 700; }

/* بنر تمام‌عرض بالای صفحه‌ی اصلی */
.home-banner { position: relative; margin: 0; overflow: hidden; height: min(58vh, 620px); }
.home-banner img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; display: block; }
.home-banner::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 55%, var(--bg, #0d0f12) 100%);
}
@media (max-width: 640px) { .home-banner { height: 44vh; } }

/* فیگورهای در دست ساخت: اسلایدر */
.fig-slider { position: relative; }
.fig-track {
  display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  scrollbar-width: none; direction: ltr; padding: 4px 2px 8px;
}
.fig-track::-webkit-scrollbar { display: none; }
.fig-track figure {
  flex: 0 0 calc((100% - 32px) / 3); scroll-snap-align: start; margin: 0; position: relative; overflow: hidden;
  border-radius: var(--r-md); border: 1.5px solid var(--edge); background: var(--paper); cursor: zoom-in;
}
.fig-track img { display: block; width: 100%; height: auto; aspect-ratio: 780 / 213; object-fit: contain; background: var(--paper); }
.fig-track figcaption { position: absolute; top: 10px; inset-inline-start: 12px; padding: 4px 10px; border-radius: 999px; background: var(--ink); color: var(--ink-inv); font-size: .78rem; font-weight: 700; }
.fs-btn {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 42px; height: 42px; border-radius: 50%;
  border: 1.5px solid var(--edge); background: var(--paper); color: var(--ink); font-size: 1.5rem; line-height: 1; cursor: pointer;
}
.fs-prev { inset-inline-start: -8px; } .fs-next { inset-inline-end: -8px; }
.fs-btn:hover, .fs-btn:focus-visible { border-color: var(--accent); color: var(--accent); }
.fig-dots { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
.fig-dots .fd { width: 9px; height: 9px; border-radius: 99px; border: 0; padding: 0; background: var(--edge); cursor: pointer; transition: width .3s, background .3s; }
.fig-dots .fd.on { background: var(--accent); width: 26px; }
@media (max-width: 960px) { .fig-track figure { flex-basis: calc((100% - 16px) / 2); } }
@media (max-width: 600px) { .fig-track figure { flex-basis: 100%; } .fs-prev { inset-inline-start: 0; } .fs-next { inset-inline-end: 0; } }
