/* ══════════════════════════════════════════════════════════════════════
   Страница «О нас» — журнальная.

   Общие токены, подвал и логотип приходят из menu.css — это один сайт. Здесь
   то, чего в витрине нет: заголовок с крупным снимком, цифры, рассказ с
   буквицей, цитата, галерея и финальная кнопка в каталог.

   Три вещи выбирает владелец, и все три — признаки на <main>:
     data-tone  — подложка страницы,
     data-type  — набор шрифтов и размеров,
     data-layout на самой галерее — как разложены снимки.
   Правила написаны так, чтобы любое сочетание оставалось читаемым: текст на
   фоне страницы — `--on-bg`, на карточке — `--ink`.
   ══════════════════════════════════════════════════════════════════════ */

/* ─── Шапка: одна и маленькая, как на витрине ────────────────────────── */

.about-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: calc(var(--page-max) + var(--page-gutter) * 2);
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) var(--page-gutter) 4px;
  color: var(--on-bg);
}
.about-top .brand {
  min-width: 0;
  min-height: 44px;
  color: inherit;
}
.about-top .brand__word {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 1.12rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.about-top .brand__mark[data-logo="true"] .brand__logo {
  height: 40px;
  max-width: 160px;
}
.about-top__tools {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
}
.about-top .lang-btn,
.about-top__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--on-bg) 7%, transparent);
  color: var(--on-bg);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.about-top .lang-btn[hidden] {
  display: none;
}
.about-top .lang-btn svg,
.about-top__back svg {
  width: 18px;
  height: 18px;
}
.about-top__back:hover,
.about-top .lang-btn:hover {
  background: color-mix(in srgb, var(--on-bg) 12%, transparent);
}
[dir="rtl"] .about-top__back svg {
  transform: scaleX(-1);
}

/* ─── Каркас ─────────────────────────────────────────────────────────── */

.about {
  display: grid;
  gap: 52px;
  max-width: calc(var(--page-max) + var(--page-gutter) * 2);
  margin: 0 auto;
  padding: 18px var(--page-gutter) 64px;
}
.about[hidden] {
  display: none;
}
@media (min-width: 900px) {
  .about {
    gap: 84px;
    padding-top: 36px;
    padding-bottom: 96px;
  }
}

/* ─── Первый экран: слова и крупный снимок ───────────────────────────── */

.about__hero {
  position: relative;
  display: grid;
  gap: 26px;
  isolation: isolate;
}
.about__hero-body {
  display: grid;
  align-content: center;
  justify-items: start;
  min-width: 0;
}

.about__eyebrow {
  margin: 0 0 14px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--accent-quiet) 30%, transparent);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--on-bg);
}
.about__eyebrow[hidden] {
  display: none;
}

.about__title {
  margin: 0;
  /* Набор шрифтов приходит переменной из fonts.css; запасной вариант — тот же
     шрифт, что и во всём сайте. */
  font-family: var(--about-display, var(--font-display));
  font-weight: var(--about-title-weight, 500);
  letter-spacing: var(--about-title-spacing, 0);
  font-size: clamp(2.3rem, 10.4vw, 3.4rem);
  line-height: 1.04;
  color: var(--on-bg);
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.about__lead {
  margin: 18px 0 0;
  font-family: var(--about-text, var(--font-text));
  max-width: 34em;
  font-size: clamp(1.1rem, 4.2vw, 1.34rem);
  line-height: 1.5;
  color: var(--on-bg-soft);
  text-wrap: pretty;
}
.about__lead[hidden] {
  display: none;
}

/* Снимок аркой: у букета нет углов, а ровная рамка читается как «каталог».
   Тонкое кольцо позади сдвинуто — получается второй, едва заметный слой. */
.about__hero-photo {
  position: relative;
  display: block;
  width: min(100%, 440px);
  aspect-ratio: 4 / 5;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px 999px 28px 28px;
  background: var(--surface);
  cursor: zoom-in;
  justify-self: center;
  -webkit-user-drag: none;
}
.about__hero-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  translate: 12px 12px;
  border: 1.5px solid var(--accent-quiet);
  border-radius: inherit;
}
[dir="rtl"] .about__hero-photo::before {
  translate: -12px 12px;
}
.about__hero-photo[hidden] {
  display: none;
}
.about__hero-photo:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 4px;
}
.about__hero-media {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
}
.about__hero-photo picture {
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
}

@media (min-width: 900px) {
  .about[data-has-photo="true"] .about__hero {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 64px;
    align-items: center;
  }
  .about__title {
    font-size: clamp(3rem, 5.2vw, 4.6rem);
  }
  .about__hero-photo {
    width: 100%;
    max-width: 460px;
    justify-self: end;
  }
}

/* ─── Цифры: крупно, без коробок ─────────────────────────────────────── */

.about__facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
  border-block: 1px solid var(--line-bg);
}
.about__facts[hidden] {
  display: none;
}
.about__facts li {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 22px 12px 22px 0;
  min-width: 0;
}
.about__facts li:nth-child(n + 3) {
  border-top: 1px solid var(--line-bg);
}
.about__facts li:nth-child(even) {
  padding-inline-start: 18px;
  border-inline-start: 1px solid var(--line-bg);
}
.about__facts strong {
  font-family: var(--about-display, var(--font-display));
  font-size: clamp(1.7rem, 7.4vw, 2.5rem);
  font-weight: 500;
  line-height: 1.05;
  color: var(--accent-strong);
  overflow-wrap: anywhere;
}
.about__facts span {
  font-family: var(--about-text, var(--font-text));
  font-size: 0.9rem;
  line-height: 1.35;
  color: var(--on-bg-soft);
}
@media (min-width: 720px) {
  .about__facts {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
  }
  .about__facts li,
  .about__facts li:nth-child(even) {
    padding: 28px 20px;
    border-top: 0;
    border-inline-start: 1px solid var(--line-bg);
  }
  .about__facts li:first-child {
    padding-inline-start: 0;
    border-inline-start: 0;
  }
}

/* ─── Рассказ: буквица и крупное начало ──────────────────────────────── */

.about__story {
  display: grid;
  gap: 18px;
  font-family: var(--about-text, var(--font-text));
  width: 100%;
  max-width: 38em;
  justify-self: center;
  font-size: 1.04rem;
  line-height: 1.75;
  color: var(--on-bg-soft);
}
.about__story[hidden] {
  display: none;
}
.about__story p {
  margin: 0;
  text-wrap: pretty;
}
.about__story p:first-child {
  font-size: 1.12em;
  line-height: 1.65;
  color: var(--on-bg);
}
/* Буквица — только для письма, где у заглавной буквы есть смысл. */
.about__story:not(:lang(ar)):not(:lang(zh)) p:first-child::first-letter {
  float: inline-start;
  margin: 0.06em 0.12em 0 0;
  font-family: var(--about-display, var(--font-display));
  font-size: 3.7em;
  font-weight: 500;
  line-height: 0.82;
  color: var(--accent-strong);
}
[dir="rtl"] .about__story:not(:lang(ar)):not(:lang(zh)) p:first-child::first-letter {
  margin: 0.06em 0 0 0.12em;
}

/* ─── Цитата: слова на странице без рамки ────────────────────────────── */

.about__quote {
  position: relative;
  margin: 0;
  padding: 44px 0 0;
  text-align: center;
  max-width: 34em;
  justify-self: center;
}
.about__quote[hidden] {
  display: none;
}
.about__quote::before {
  content: "\201C";
  position: absolute;
  top: -6px;
  inset-inline: 0;
  font-family: var(--about-display, var(--font-display));
  font-size: 6rem;
  line-height: 1;
  color: var(--accent-quiet);
}
.about__quote blockquote {
  margin: 0;
  font-family: var(--about-display, var(--font-display));
  font-size: clamp(1.4rem, 5.6vw, 2rem);
  line-height: 1.32;
  color: var(--on-bg);
  text-wrap: balance;
}
.about__quote figcaption {
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--on-bg-soft);
}
.about__quote figcaption::before {
  content: "\2014\00a0";
}
.about__quote figcaption[hidden] {
  display: none;
}

.about__section-title {
  margin: 0 0 18px;
  font-family: var(--about-display, var(--font-display));
  font-weight: 500;
  font-size: clamp(1.5rem, 6vw, 2.1rem);
  line-height: 1.15;
  color: var(--on-bg);
}
.about__section-title[hidden] {
  display: none;
}

/* ─── Подложка страницы ──────────────────────────────────────────────── */

/* «Карточкой»: заголовок и рассказ ложатся на подложку — разворот журнала. */
.about[data-tone="surface"] .about__hero,
.about[data-tone="surface"] .about__story {
  padding: 24px;
  border: 1px solid var(--line-bg);
  border-radius: var(--card-radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.about[data-tone="surface"] .about__title,
.about[data-tone="surface"] .about__story p:first-child,
.about[data-tone="surface"] .about__eyebrow {
  color: var(--ink);
}
.about[data-tone="surface"] .about__lead,
.about[data-tone="surface"] .about__story {
  color: var(--ink-soft);
}

/* «Акцентом»: верх залит фирменным цветом, текст на нём — пара от акцента. */
.about[data-tone="accent"] .about__hero {
  padding: 28px 24px;
  border-radius: var(--card-radius-lg);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: var(--on-accent);
}
.about[data-tone="accent"] .about__eyebrow {
  background: rgba(255, 255, 255, 0.18);
  color: var(--on-accent);
}
.about[data-tone="accent"] .about__title,
.about[data-tone="accent"] .about__lead {
  color: var(--on-accent);
}
.about[data-tone="accent"] .about__hero-photo::before {
  border-color: rgba(255, 255, 255, 0.45);
}

/* «Фотографией»: снимок уходит за заголовок. Затемнение обязательно —
   снимок бывает светлым, и белый текст на нём иначе пропадает. */
.about[data-tone="photo"][data-has-photo="true"] .about__hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-height: min(70dvh, 520px);
  padding: 28px 24px;
  border-radius: var(--card-radius-lg);
  overflow: hidden;
  align-content: end;
  color: #fff;
}
.about[data-tone="photo"][data-has-photo="true"] .about__hero-photo {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  max-width: none;
  aspect-ratio: auto;
  border-radius: 0;
  pointer-events: none;
}
.about[data-tone="photo"] .about__hero-photo::before {
  display: none;
}
.about[data-tone="photo"] .about__hero-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(22, 18, 14, 0.88), rgba(22, 18, 14, 0.4) 62%, rgba(22, 18, 14, 0.22));
}
.about[data-tone="photo"] .about__eyebrow {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}
.about[data-tone="photo"] .about__title,
.about[data-tone="photo"] .about__lead {
  color: #fff;
  text-shadow: 0 1px 14px rgba(0, 0, 0, 0.4);
}
@media (min-width: 900px) {
  .about[data-tone="photo"][data-has-photo="true"] .about__hero {
    padding: 56px;
  }
  .about[data-tone="photo"] .about__hero-body {
    max-width: 640px;
  }
}

/* Набор шрифтов выбирается владельцем; сами семейства и переменные набора
   описаны в fonts.css — тем же файлом пользуется образец в админке, чтобы
   список шрифтов там не разошёлся со страницей. */

/* ─── Размер текста ──────────────────────────────────────────────────── */
/* Множитель, а не отдельные размеры: заголовок, вступление и рассказ должны
   расти вместе, сохраняя пропорции. Антиква получает свой запас сверху. */

.about {
  --about-scale: 1;
  --about-serif-boost: 1;
  --about-size: calc(var(--about-scale) * var(--about-serif-boost));
}
.about[data-scale="s"] {
  --about-scale: 0.92;
}
.about[data-scale="l"] {
  --about-scale: 1.12;
}
.about[data-scale="xl"] {
  --about-scale: 1.26;
}

.about__title {
  font-size: calc(clamp(2.3rem, 10.4vw, 3.4rem) * var(--about-size));
}
@media (min-width: 900px) {
  .about__title {
    font-size: calc(clamp(3rem, 5.2vw, 4.6rem) * var(--about-size));
  }
}
.about[data-type="strict"] .about__section-title {
  letter-spacing: -0.01em;
}
.about__lead {
  font-size: calc(clamp(1.1rem, 4.2vw, 1.34rem) * var(--about-size));
}
.about__story {
  font-size: calc(1.04rem * var(--about-size));
}
.about[data-type="airy"] .about__lead,
.about[data-type="airy"] .about__story {
  line-height: 1.9;
}
.about[data-type="strict"] .about__story {
  line-height: 1.65;
}
.about__section-title {
  font-size: calc(clamp(1.5rem, 6vw, 2.1rem) * var(--about-size));
}
.about__quote blockquote {
  font-size: calc(clamp(1.4rem, 5.6vw, 2rem) * var(--about-size));
}
.about__facts strong {
  font-size: calc(clamp(1.7rem, 7.4vw, 2.5rem) * var(--about-size));
}

/* ─── Появление при прокрутке ────────────────────────────────────────── */
/* Блоки проявляются, когда до них долистали. Начальное состояние ставится
   только после того, как скрипт включил наблюдение (`data-reveal-ready`):
   иначе при сбое скрипта страница осталась бы пустой.

   Задержка внутри группы приходит переменной от скрипта — соседние карточки
   появляются по очереди, а не все разом. */

.about[data-reveal-ready="true"][data-reveal="soft"] [data-reveal-item],
.about[data-reveal-ready="true"][data-reveal="bold"] [data-reveal-item] {
  opacity: 0;
  transition:
    opacity 620ms var(--ease-out),
    translate 620ms var(--ease-out),
    scale 620ms var(--ease-out),
    filter 620ms var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}

.about[data-reveal-ready="true"][data-reveal="soft"] [data-reveal-item] {
  translate: 0 18px;
}
.about[data-reveal-ready="true"][data-reveal="bold"] [data-reveal-item] {
  translate: 0 38px;
  scale: 0.96;
  filter: blur(6px);
}
/* Снимки в «выразительном» появлении выезжают по очереди с разных сторон —
   галерея от этого читается как лента, а не как сетка, которая мигнула. */
.about[data-reveal-ready="true"][data-reveal="bold"] .gallery__item[data-reveal-item] {
  translate: var(--reveal-from, -32px) 24px;
  scale: 0.94;
}

.about[data-reveal-ready="true"] [data-reveal-item][data-revealed="true"] {
  opacity: 1;
  translate: 0 0;
  scale: 1;
  filter: none;
}

@media (prefers-reduced-motion: reduce) {
  .about [data-reveal-item] {
    opacity: 1 !important;
    translate: none !important;
    scale: 1 !important;
    filter: none !important;
    transition: none !important;
  }
}

/* ─── Галерея ────────────────────────────────────────────────────────── */

.about__gallery[hidden] {
  display: none;
}

.gallery__item {
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  border-radius: var(--card-radius);
  overflow: hidden;
  background: var(--surface);
  cursor: zoom-in;
  /* Жест по галерее не должен превращаться в перетаскивание картинки. */
  -webkit-user-drag: none;
}
.gallery__media {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Тот же случай, что и у баннеров: иначе браузер на первом движении
     запускает своё перетаскивание картинки, и листание мышью теряется.
     Нажатие при этом доходит до самой карточки и открывает снимок. */
  -webkit-user-drag: none;
  pointer-events: none;
}
.gallery__caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 26px 14px 10px;
  background: linear-gradient(to top, rgba(26, 21, 16, 0.8), transparent);
  color: #fff;
  font-size: 0.84rem;
  text-align: left;
}

/* Слайдер: один снимок во всю ширину. Органы управления видны — стрелки,
   точки, стрелки клавиатуры, перетаскивание мышью; пальцем листает сам
   браузер. Рамка нужна стрелкам: они лежат поверх кадра. */
.gallery-frame {
  position: relative;
}
/* Имя `.gallery` занято лентой снимков карточки (menu.css: absolute + inset 0):
   здесь это обычный блок в потоке. */
.about .gallery {
  position: relative;
  inset: auto;
}

.gallery[data-layout="slider"] {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  gap: 0;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  border-radius: var(--card-radius);
}
.gallery[data-layout="slider"]::-webkit-scrollbar {
  display: none;
}
.gallery[data-layout="slider"][data-dragging="true"] {
  scroll-snap-type: none;
  cursor: grabbing;
  user-select: none;
}
.gallery[data-layout="slider"] .gallery__item {
  scroll-snap-align: center;
  aspect-ratio: 4 / 5;
  border-radius: var(--card-radius);
}
@media (min-width: 720px) {
  .gallery[data-layout="slider"] .gallery__item {
    aspect-ratio: 16 / 10;
  }
}

.gallery-arrow {
  position: absolute;
  top: 50%;
  translate: 0 -50%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(20, 16, 13, 0.55);
  color: #fff;
  cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease-out), opacity var(--dur-fast) var(--ease-out);
}
.gallery-arrow:hover {
  background: rgba(20, 16, 13, 0.75);
}
/* У края листать некуда: стрелка гаснет, но остаётся на месте — иначе вторая
   прыгала бы вбок. */
.gallery-arrow:disabled {
  opacity: 0.35;
  cursor: default;
}
.gallery-arrow[hidden] {
  display: none;
}
.gallery-arrow svg {
  width: 22px;
  height: 22px;
}
.gallery-arrow--prev {
  left: 10px;
}
.gallery-arrow--next {
  right: 10px;
}

.gallery-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 12px;
}
.gallery-dots[hidden] {
  display: none;
}
.gallery-dots__dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--line-bg-strong);
  cursor: pointer;
  transition: width var(--dur-base) var(--ease-out), background-color var(--dur-base) var(--ease-out);
}
.gallery-dots__dot[aria-current="true"] {
  width: 20px;
  border-radius: var(--radius-pill);
  background: var(--accent);
}

/* Лента: снимки листаются пальцем вбок. Хороша, когда кадров немного и
   каждый стоит показать крупно. */
.gallery[data-layout="scroll"] {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 72%;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.gallery[data-layout="scroll"]::-webkit-scrollbar {
  display: none;
}
.gallery[data-layout="scroll"] .gallery__item {
  scroll-snap-align: center;
  aspect-ratio: 4 / 5;
}
@media (min-width: 720px) {
  .gallery[data-layout="scroll"] {
    grid-auto-columns: 30%;
  }
}

/* Ровная сетка: все кадры одного размера, порядок читается сразу. */
.gallery[data-layout="grid"] {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.gallery[data-layout="grid"] .gallery__item {
  aspect-ratio: 1;
}

/* Коллаж: каждая пятая карточка крупнее — иначе мозаика превращается в
   обычную сетку. */
.gallery[data-layout="collage"] {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  grid-auto-flow: dense;
}
.gallery[data-layout="collage"] .gallery__item {
  aspect-ratio: 1;
}
.gallery[data-layout="collage"] .gallery__item[data-big="true"] {
  grid-column: span 2;
  aspect-ratio: 16 / 10;
}
@media (min-width: 720px) {
  .gallery[data-layout="collage"] {
    grid-template-columns: repeat(4, 1fr);
  }
  .gallery[data-layout="collage"] .gallery__item[data-big="true"] {
    grid-column: span 2;
    grid-row: span 2;
    aspect-ratio: 1;
  }
}

/* Разброс: снимки лежат как фотографии на столе — с белым полем и лёгким
   наклоном. Наклон приходит переменной от скрипта и считается от номера
   карточки, поэтому при перерисовке ничего не прыгает. */
.gallery[data-layout="scatter"] {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  /* Каждая карточка сама по себе: при растягивании по строке высота считается
     до того, как известна высота кадра, и подпись под снимком обрезается. */
  align-items: flex-start;
  gap: 18px 14px;
  padding: 10px 0 26px;
}
.gallery[data-layout="scatter"] .gallery__item {
  flex: 0 1 min(260px, 44%);
  padding: 10px 10px 14px;
  border-radius: 6px;
  background: #fff;
  box-shadow: var(--shadow-md);
  rotate: var(--tilt, 0deg);
  translate: 0 var(--shift, 0px);
  transition: rotate var(--dur-base) var(--ease-out), translate var(--dur-base) var(--ease-out);
}
.gallery[data-layout="scatter"] .gallery__item:hover {
  rotate: 0deg;
  translate: 0 -4px;
}
.gallery[data-layout="scatter"] .gallery__media {
  aspect-ratio: 1;
  border-radius: 3px;
}
.gallery[data-layout="scatter"] .gallery__caption {
  position: static;
  padding: 8px 2px 0;
  background: none;
  color: #4a4038;
  text-align: center;
}
@media (min-width: 720px) {
  .gallery[data-layout="scatter"] .gallery__item {
    flex: 0 1 260px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .gallery[data-layout="scatter"] .gallery__item {
    rotate: 0deg;
    translate: none;
  }
}

/* ─── Новые виды галереи (M2) ─────────────────────────────────────────── */

/* Справа налево стрелки меняются местами и смотрят в другую сторону. */
[dir="rtl"] .gallery-arrow--prev {
  left: auto;
  right: 10px;
}
[dir="rtl"] .gallery-arrow--next {
  right: auto;
  left: 10px;
}
[dir="rtl"] .gallery-arrow svg {
  scale: -1 1;
}

/* Рамка — контейнер: ширину карусели и стопки считаем от неё, а не от экрана. */
.gallery-frame {
  container-type: inline-size;
}

/* Журнал: блоки по три — крупный кадр (2/3 ширины) и два малых; следующий блок
   зеркально. Остаток: один снимок — во всю ширину, два — пополам. Шесть колонок,
   высота ряда — по пропорции малого кадра 4:5. Место снимка (`data-slot`,
   `--row`) ставит скрипт по номеру. */
.gallery[data-layout="magazine"] {
  --gap: 10px;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: calc((100cqw - 2 * var(--gap)) / 3 * 1.25);
  gap: var(--gap);
}
.gallery[data-layout="magazine"] .gallery__item {
  grid-row: var(--row) / span 1;
  min-width: 0;
  min-height: 0;
}
.gallery[data-layout="magazine"] .gallery__item[data-slot^="big"],
.gallery[data-layout="magazine"] .gallery__item[data-slot="wide"] {
  grid-row: var(--row) / span 2;
}
.gallery[data-layout="magazine"] [data-slot="big-start"] {
  grid-column: 1 / span 4;
}
.gallery[data-layout="magazine"] [data-slot="small-end"] {
  grid-column: 5 / span 2;
}
.gallery[data-layout="magazine"] [data-slot="big-end"] {
  grid-column: 3 / span 4;
}
.gallery[data-layout="magazine"] [data-slot="small-start"] {
  grid-column: 1 / span 2;
}
.gallery[data-layout="magazine"] [data-slot="wide"] {
  grid-column: 1 / -1;
}
.gallery[data-layout="magazine"] [data-slot="half-start"] {
  grid-column: 1 / span 3;
}
.gallery[data-layout="magazine"] [data-slot="half-end"] {
  grid-column: 4 / span 3;
}
@media (min-width: 720px) {
  .gallery[data-layout="magazine"] {
    --gap: 14px;
  }
}

/* Кирпичики: колонки со снимками естественной пропорции, без обрезки. */
.gallery[data-layout="masonry"] {
  column-count: 2;
  column-gap: 10px;
}
@media (min-width: 768px) {
  .gallery[data-layout="masonry"] {
    column-count: 3;
    column-gap: 14px;
  }
}
.gallery[data-layout="masonry"] .gallery__item {
  width: 100%;
  margin: 0 0 10px;
  break-inside: avoid;
  aspect-ratio: var(--ar, 4 / 5);
}
@media (min-width: 768px) {
  .gallery[data-layout="masonry"] .gallery__item {
    margin-bottom: 14px;
  }
}

/* Карусель: текущий снимок по центру, соседи меньше и бледнее. Края добавлены
   полем, чтобы и первый, и последний можно было поставить по центру. */
.gallery[data-layout="carousel"] {
  --cw: min(68cqw, 400px);
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: var(--cw);
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 14px calc((100cqw - var(--cw)) / 2);
  align-items: center;
}
.gallery[data-layout="carousel"]::-webkit-scrollbar {
  display: none;
}
.gallery[data-layout="carousel"][data-dragging="true"] {
  scroll-snap-type: none;
  cursor: grabbing;
  user-select: none;
}
.gallery[data-layout="carousel"] .gallery__item {
  scroll-snap-align: center;
  aspect-ratio: 4 / 5;
  scale: 0.86;
  opacity: 0.5;
  transition:
    scale var(--dur-base) var(--ease-out),
    opacity var(--dur-base) var(--ease-out);
}
.gallery[data-layout="carousel"] .gallery__item[data-active="true"] {
  scale: 1;
  opacity: 1;
}
/* Стрелки — только там, где есть мышь; пальцем листают сами. */
@media (hover: none) {
  .gallery-frame[data-layout="carousel"] .gallery-arrow,
  .gallery-frame[data-layout="stack"] .gallery-arrow {
    display: none;
  }
}

/* Стопка: карточки лежат со сдвигом и лёгким поворотом, верхнюю смахивают.
   Положение (`data-pos`) считает скрипт по номеру в стопке — не случайно. */
.gallery[data-layout="stack"] {
  /* поля по бокам: карточки ниже выступают на 14px + поворот */
  width: min(calc(100% - 40px), 380px);
  margin: 14px auto 20px;
  aspect-ratio: 4 / 5;
  touch-action: pan-y;
  user-select: none;
}
.gallery[data-layout="stack"][data-dragging="true"] {
  cursor: grabbing;
}
.gallery[data-layout="stack"] .gallery__item {
  position: absolute;
  inset: 0;
  box-shadow: var(--shadow-md);
  transform: translate(var(--dx, 0px), 0) rotate(var(--rot, 0deg));
  transition:
    transform var(--dur-base) var(--ease-out),
    opacity var(--dur-base) var(--ease-out);
}
.gallery[data-layout="stack"] .gallery__item[data-pos="0"] {
  z-index: 4;
}
.gallery[data-layout="stack"] .gallery__item[data-pos="1"] {
  z-index: 3;
  transform: translate(14px, 10px) rotate(3deg) scale(0.96);
}
.gallery[data-layout="stack"] .gallery__item[data-pos="2"] {
  z-index: 2;
  transform: translate(-12px, 18px) rotate(-3.5deg) scale(0.92);
}
.gallery[data-layout="stack"] .gallery__item[data-pos="3"] {
  z-index: 1;
  opacity: 0;
  transform: translate(-12px, 18px) rotate(-3.5deg) scale(0.9);
}
.gallery[data-layout="stack"] .gallery__item[data-pos="1"],
.gallery[data-layout="stack"] .gallery__item[data-pos="2"],
.gallery[data-layout="stack"] .gallery__item[data-pos="3"] {
  pointer-events: none;
}
.gallery[data-layout="stack"] .gallery__item[data-leaving="true"] {
  z-index: 5;
  opacity: 0;
  pointer-events: none;
  transition:
    transform 280ms var(--ease-out),
    opacity 280ms var(--ease-out);
}
.gallery[data-layout="stack"][data-dragging="true"] .gallery__item[data-pos="0"],
.gallery[data-layout="stack"] .gallery__item[data-snap="true"] {
  transition: none;
}
.gallery-counter {
  margin: 0;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: 0.92rem;
  color: var(--on-bg);
  opacity: 0.7;
}

/* С миниатюрами: крупный снимок листается как слайдер, под ним ряд
   миниатюр. Мишень — 56px, выбранная обведена акцентом. */
.gallery-frame[data-layout="filmstrip"],
.gallery-frame[data-layout="magazine"],
.gallery-thumbs {
  max-width: 860px;
  margin-inline: auto;
}
.gallery[data-layout="filmstrip"] {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  border-radius: var(--card-radius);
}
.gallery[data-layout="filmstrip"]::-webkit-scrollbar {
  display: none;
}
.gallery[data-layout="filmstrip"][data-dragging="true"] {
  scroll-snap-type: none;
  cursor: grabbing;
  user-select: none;
}
.gallery[data-layout="filmstrip"] .gallery__item {
  scroll-snap-align: center;
  aspect-ratio: 4 / 5;
}
@media (min-width: 720px) {
  .gallery[data-layout="filmstrip"] .gallery__item {
    aspect-ratio: 16 / 10;
  }
}
.gallery-thumbs {
  position: relative;
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.gallery-thumbs::-webkit-scrollbar {
  display: none;
}
.gallery-thumbs__item:first-child {
  margin-inline-start: auto;
}
.gallery-thumbs__item:last-child {
  margin-inline-end: auto;
}
.gallery-thumbs__item {
  position: relative;
  flex: none;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
  cursor: pointer;
  opacity: 0.62;
  outline: 2px solid transparent;
  outline-offset: 2px;
  transition:
    opacity var(--dur-fast) var(--ease-out),
    outline-color var(--dur-fast) var(--ease-out);
}
.gallery-thumbs__item:hover {
  opacity: 0.9;
}
.gallery-thumbs__item[aria-current="true"] {
  opacity: 1;
  outline-color: var(--accent);
}
.gallery-thumbs__media {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
}
@media (prefers-reduced-motion: reduce) {
  .gallery[data-layout="carousel"] .gallery__item,
  .gallery[data-layout="stack"] .gallery__item,
  .gallery-thumbs__item {
    transition: none;
  }
}

/* ─── Контакты: «открытка» с адресом ─────────────────────────────────── */

.about__contacts {
  max-width: 38em;
  width: 100%;
  justify-self: center;
  padding: 22px;
  border: 1px solid var(--line-bg);
  border-radius: var(--card-radius-lg);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.about__contacts[hidden] {
  display: none;
}
.about__contacts .about__section-title {
  margin-bottom: 14px;
  font-size: calc(1.3rem * var(--about-size));
  color: var(--ink);
}

.about__contact-list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--ink-soft);
}
.about__contact-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}
.about__contact-list svg {
  flex: none;
  box-sizing: content-box;
  width: 18px;
  height: 18px;
  padding: 8px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent-quiet) 28%, transparent);
  color: var(--accent-strong);
}
.about__contact-list a {
  color: inherit;
}

.about__socials {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}
.about__socials[hidden] {
  display: none;
}
.about__socials a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.9rem;
}
.about__socials a:hover {
  border-color: var(--accent-quiet);
}

/* ─── Финал: дорога в каталог ────────────────────────────────────────── */
/* Страницу читают ради последнего шага — открыть букеты. Крупная панель цвета
   акцента, на ней светлая кнопка; текст на панели — пара от акцента. */

.about__actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  overflow: hidden;
  padding: 40px 22px;
  border-radius: var(--card-radius-lg);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  isolation: isolate;
}
.about__actions::before,
.about__actions::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}
.about__actions::before {
  width: 220px;
  height: 220px;
  inset-block-start: -90px;
  inset-inline-start: -60px;
}
.about__actions::after {
  width: 160px;
  height: 160px;
  inset-block-end: -70px;
  inset-inline-end: -30px;
}
.about__actions .btn {
  min-height: 52px;
  padding: 0 28px;
  border: 0;
  border-radius: var(--radius-pill);
  font-weight: 700;
  text-decoration: none;
  background: #fff;
  color: #2a1a20;
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.45);
}
.about__cta[hidden] {
  display: none;
}
/* Когда есть своя кнопка владельца, «в каталог» тише: контур на панели. */
.about__cta:not([hidden]) ~ .about__menu {
  background: transparent;
  color: var(--on-accent);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.7);
}
.about__menu::after {
  content: "\2192";
  margin-inline-start: 10px;
}
[dir="rtl"] .about__menu::after {
  content: "\2190";
}
@media (min-width: 900px) {
  .about__actions {
    padding: 64px 32px;
  }
}

/* ─── Снимок во весь экран ───────────────────────────────────────────── */

.lightbox {
  width: min(96vw, 1100px);
  max-width: none;
  max-height: 94dvh;
  padding: 0;
  border: 0;
  border-radius: var(--card-radius-lg);
  background: #12100e;
  color: #fff;
  overflow: hidden;
}
.lightbox::backdrop {
  background: rgba(12, 10, 8, 0.82);
}

.lightbox__frame {
  display: grid;
  place-items: center;
  background: #12100e;
}
.lightbox__media {
  display: block;
  max-width: 100%;
  max-height: 80dvh;
  object-fit: contain;
}

.lightbox__caption {
  margin: 0;
  padding: 12px 18px 16px;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.86);
}
.lightbox__caption[hidden] {
  display: none;
}

.lightbox__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  cursor: pointer;
}
.lightbox__close svg {
  width: 20px;
  height: 20px;
}
