/* ============================================================
   Документатор — section: Mockup Gallery
   «Так выглядит готовое ТУ»
   ============================================================ */

.mockup-gallery {
  padding: var(--s-24) 0;
  background: var(--graphite-100);
  color: var(--graphite-900);
}

.mockup-gallery__container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--s-6);
}

.mockup-gallery__head {
  max-width: var(--max-w-narrow);
  margin: 0 0 var(--s-12);
}

.mockup-gallery__title {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.5vw, 44px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--ink-900);
  margin: 0 0 var(--s-4);
  font-weight: 700;
}

.mockup-gallery__lead {
  font-size: clamp(16px, 1.4vw, 18px);
  line-height: 1.55;
  color: var(--graphite-700);
  margin: 0;
  max-width: 65ch;
}

.mockup-gallery__lead .mg-chain {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--indigo-50);
  color: var(--indigo-800);
  font-family: var(--font-mono);
  font-size: 0.92em;
  font-weight: 600;
  white-space: nowrap;
}

/* ---------- Grid ---------- */
.mockup-gallery__grid {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--s-12);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-6);
}

@media (max-width: 960px) {
  .mockup-gallery__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--s-4);
  }
}

@media (max-width: 560px) {
  .mockup-gallery__grid {
    grid-template-columns: 1fr;
    gap: var(--s-4);
  }
}

/* ---------- Card ---------- */
.mg-card {
  margin: 0;
  padding: 0;
}

.mg-card__link {
  display: flex;
  flex-direction: column;
  background: var(--paper-pure);
  border: 1px solid var(--graphite-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-card);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
  height: 100%;
}

.mg-card__link:hover,
.mg-card__link:focus-visible {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
  border-color: var(--indigo-100);
  text-decoration: none;
}

.mg-card__link:focus-visible {
  outline: 2px solid var(--indigo-600);
  outline-offset: 3px;
}

.mg-card__figure {
  margin: 0;
  padding: 0;
  background: var(--graphite-100);
  border-bottom: 1px solid var(--graphite-200);
  aspect-ratio: 1 / 1.414; /* A4 portrait */
  overflow: hidden;
  position: relative;
}

.mg-card__figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform .35s ease;
}

.mg-card__link:hover .mg-card__figure img,
.mg-card__link:focus-visible .mg-card__figure img {
  transform: scale(1.025);
}

.mg-card__caption {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: var(--s-4) var(--s-6) var(--s-6);
}

.mg-card__eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--indigo-700);
}

.mg-card__title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink-900);
}

.mg-card__hint {
  font-size: 13px;
  line-height: 1.45;
  color: var(--graphite-500);
}

/* ---------- Downloads ---------- */
.mockup-gallery__downloads {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-4);
  margin: 0 0 var(--s-6);
}

.mg-download {
  display: inline-flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-6);
  background: var(--ink-900);
  color: var(--paper);
  border: 1px solid var(--ink-900);
  border-radius: var(--radius);
  text-decoration: none;
  font-family: var(--font-body);
  transition: background .15s ease, transform .15s ease, color .15s ease, border-color .15s ease;
}

.mg-download:hover {
  background: var(--indigo-800);
  border-color: var(--indigo-800);
  transform: translateY(-1px);
  text-decoration: none;
  color: var(--paper);
}

.mg-download--ghost {
  background: transparent;
  color: var(--ink-900);
}

.mg-download--ghost:hover {
  background: var(--paper-pure);
  border-color: var(--ink-900);
  color: var(--ink-900);
}

.mg-download__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mg-download__body {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.2;
  text-align: left;
}

.mg-download__label {
  font-size: 15px;
  font-weight: 600;
}

.mg-download__meta {
  font-family: var(--font-mono);
  font-size: 11px;
  opacity: 0.75;
  margin-top: 2px;
}

/* ---------- Disclaimer ---------- */
.mockup-gallery__disclaimer {
  font-size: 12px;
  line-height: 1.5;
  color: var(--graphite-500);
  margin: 0;
  max-width: 65ch;
}

.mockup-gallery__disclaimer strong {
  color: var(--graphite-700);
  font-weight: 600;
}

/* ============================================================
   Lightbox (CSS-only via :target)
   ============================================================ */
.mg-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--s-6);
}

.mg-lightbox:target {
  display: flex;
  animation: mg-fade-in .18s ease;
}

@keyframes mg-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.mg-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 27, 46, 0.82);
  backdrop-filter: blur(2px);
  cursor: zoom-out;
}

.mg-lightbox__inner {
  position: relative;
  max-width: min(960px, 92vw);
  max-height: 92vh;
  background: var(--paper-pure);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
}

.mg-lightbox__inner img {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(92vh - 56px);
  object-fit: contain;
  background: var(--graphite-100);
}

.mg-lightbox__cap {
  margin: 0;
  padding: var(--s-3) var(--s-6);
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--graphite-700);
  border-top: 1px solid var(--graphite-200);
  background: var(--paper);
}

.mg-lightbox__close {
  position: absolute;
  top: 8px;
  right: 12px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  line-height: 1;
  color: var(--ink-900);
  background: var(--paper-pure);
  border: 1px solid var(--graphite-200);
  border-radius: 50%;
  text-decoration: none;
  z-index: 2;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}

.mg-lightbox__close:hover {
  background: var(--ink-900);
  color: var(--paper);
  text-decoration: none;
}
