/* ============================================================
   STREET23 / Галерея — стили
   Все классы под префиксом .g23-gallery, никаких глобальных
   селекторов. Безопасно вставлять рядом с Tailwind / app.css.
   ============================================================ */

.g23-gallery {
  --g23-gold-1: #BF953F;
  --g23-gold-2: #B38728;
  --g23-gold-3: #FBF5B7;
  --g23-gold-4: #D4AF37;
  --g23-gold-soft: #fbebc8;
  --g23-slate-900: #0f172a;
  --g23-slate-700: #334155;
  --g23-slate-500: #64748b;
  --g23-slate-300: #cbd5e1;
  --g23-gray-100: #f1f5f9;
  --g23-gray-200: #e2e8f0;
  --g23-dark: #13161c;

  --g23-font-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --g23-font-sans: 'Inter Tight', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --g23-card-w: 280px;
  --g23-card-h: 400px;
  --g23-card-gap: 16px;
  --g23-radius: 1rem;

  font-family: var(--g23-font-sans);
  padding: 64px 0;
  background: #fff;
  border-top: 1px solid var(--g23-gray-100);
  color: var(--g23-slate-900);
  -webkit-font-smoothing: antialiased;
  position: relative;
  overflow: hidden;
}

@media (min-width: 640px) {
  .g23-gallery {
    --g23-card-w: 400px;
    --g23-card-h: 550px;
    --g23-card-gap: 24px;
    --g23-radius: 2rem;
    padding: 96px 0;
  }
}

@media (min-width: 1024px) {
  .g23-gallery { --g23-card-w: 480px; }
}

/* === Container =========================================== */
.g23-gallery__container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
}
@media (min-width: 640px) { .g23-gallery__container { padding: 0 24px; } }
@media (min-width: 1024px) { .g23-gallery__container { padding: 0 32px; } }

/* === Header ============================================== */
.g23-gallery__header {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 40px;
}
@media (min-width: 768px) {
  .g23-gallery__header {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: 64px;
  }
}

.g23-gallery__heading { max-width: 640px; }

.g23-gallery__eyebrow {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-bottom: 12px;
  background: linear-gradient(120deg, var(--g23-gold-1) 0%, var(--g23-gold-2) 25%, var(--g23-gold-3) 50%, var(--g23-gold-4) 75%, var(--g23-gold-1) 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: g23-sweep 6s linear infinite;
}
@media (min-width: 640px) { .g23-gallery__eyebrow { font-size: 12px; } }

@keyframes g23-sweep {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}
@media (prefers-reduced-motion: reduce) {
  .g23-gallery__eyebrow { animation: none; }
}

.g23-gallery__title {
  font-family: var(--g23-font-serif);
  font-weight: 400;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--g23-slate-900);
}

.g23-gallery__lead {
  font-size: 16px;
  line-height: 1.6;
  font-weight: 300;
  color: var(--g23-slate-500);
  margin: 16px 0 0;
}
@media (min-width: 640px) { .g23-gallery__lead { font-size: 18px; } }

/* === Nav arrows ========================================== */
.g23-gallery__nav {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.g23-gallery__arrow {
  width: 48px;
  height: 48px;
  border-radius: 9999px;
  border: 1px solid var(--g23-gray-200);
  background: #fff;
  color: var(--g23-slate-900);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 280ms cubic-bezier(.2,.7,.2,1);
  padding: 0;
  font: inherit;
}
.g23-gallery__arrow svg { width: 20px; height: 20px; }

.g23-gallery__arrow:hover {
  background: var(--g23-slate-900);
  border-color: var(--g23-slate-900);
  color: #fff;
  transform: translateY(-1px);
}
.g23-gallery__arrow:active { transform: translateY(0); }
.g23-gallery__arrow:focus-visible {
  outline: 2px solid var(--g23-gold-1);
  outline-offset: 3px;
}

.g23-gallery__arrow[disabled],
.g23-gallery__arrow[aria-disabled="true"] {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* === Viewport ============================================ */
.g23-gallery__viewport {
  position: relative;
  /* выходим за правый край контейнера, как у портфолио */
  margin-right: -16px;
}
@media (min-width: 640px) { .g23-gallery__viewport { margin-right: -24px; } }
@media (min-width: 1024px) { .g23-gallery__viewport { margin-right: -32px; } }

/* === Track =============================================== */
.g23-gallery__track {
  display: flex;
  gap: var(--g23-card-gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding-bottom: 32px;
  padding-right: 16px;
  cursor: grab;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
@media (min-width: 640px) { .g23-gallery__track { padding-right: 32px; } }
.g23-gallery__track::-webkit-scrollbar { display: none; }

.g23-gallery__track.is-dragging {
  cursor: grabbing;
  scroll-behavior: auto;
  scroll-snap-type: none;
}
.g23-gallery__track.is-dragging .g23-gallery__card { pointer-events: none; }

/* === Card ================================================ */
.g23-gallery__card {
  position: relative;
  flex-shrink: 0;
  width: var(--g23-card-w);
  height: var(--g23-card-h);
  border-radius: var(--g23-radius);
  overflow: hidden;
  scroll-snap-align: start;
  display: block;
  text-decoration: none;
  background: var(--g23-gray-100);
  cursor: zoom-in;
  isolation: isolate;
}

.g23-gallery__card:focus-visible {
  outline: 2px solid var(--g23-gold-1);
  outline-offset: 4px;
}

.g23-gallery__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 700ms cubic-bezier(.2,.7,.2,1);
  will-change: transform;
  pointer-events: none;
}
.g23-gallery__card:hover .g23-gallery__img { transform: scale(1.05); }

@media (prefers-reduced-motion: reduce) {
  .g23-gallery__img { transition: none; }
  .g23-gallery__card:hover .g23-gallery__img { transform: none; }
}

/* === "+" marker on hover ================================ */
.g23-gallery__plus {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border-radius: 9999px;
  background: linear-gradient(135deg, var(--g23-gold-4), var(--g23-gold-1));
  color: var(--g23-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateY(-4px) scale(0.85);
  opacity: 0;
  transition: opacity 350ms ease, transform 350ms cubic-bezier(.2,.7,.2,1);
  box-shadow: 0 8px 24px -8px rgba(191, 149, 63, 0.6);
  pointer-events: none;
}
@media (min-width: 640px) {
  .g23-gallery__plus { top: 24px; right: 24px; width: 48px; height: 48px; }
}
.g23-gallery__plus svg { width: 18px; height: 18px; }
.g23-gallery__card:hover .g23-gallery__plus,
.g23-gallery__card:focus-visible .g23-gallery__plus {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* === Progress bar ======================================== */
.g23-gallery__progress {
  position: relative;
  height: 2px;
  background: var(--g23-gray-200);
  border-radius: 9999px;
  margin-right: 16px;
  overflow: hidden;
}
@media (min-width: 640px) { .g23-gallery__progress { margin-right: 32px; } }

.g23-gallery__progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 25%;
  background: linear-gradient(90deg, var(--g23-gold-1), var(--g23-gold-4));
  border-radius: 9999px;
  transition: width 200ms ease, left 200ms ease;
}

/* === Mobile: скрываем стрелки, оставляем drag ============ */
@media (max-width: 767px) {
  .g23-gallery__nav { display: none; }
}

/* === Fancybox theming под сайт =========================== */
.fancybox__container { --fancybox-bg: rgba(19, 22, 28, 0.96); }
.fancybox__container .f-button:hover { color: #D4AF37; }
