/* ═══════════════════════════════════════════════
   INKO Service Traiteur — style.css
   Palette: #302E31 bg · #c9a227 gold · #f0e8d0 beige
════════════════════════════════════════════════ */

/* ── RESET & BASE ────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Lato', sans-serif;
  background-color: #302E31;
  color: #f0e8d0;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; background: none; border: none; }
ul { list-style: none; }

/* ── CSS CUSTOM PROPERTIES ───────────────────── */
:root {
  --bg:          #302E31;
  --bg-dark:     #232022;
  --bg-darker:   #161416;
  --gold:        #c9a227;
  --gold-dim:    rgba(201, 162, 39, 0.3);
  --gold-faint:  rgba(201, 162, 39, 0.12);
  --text:        #f0e8d0;
  --text-dim:    rgba(240, 232, 208, 0.5);
  --text-muted:  rgba(240, 232, 208, 0.2);
  --text-ghost:  rgba(240, 232, 208, 0.08);
  --border:      rgba(240, 232, 208, 0.1);
  --font-display: 'Playfair Display', serif;
  --font-label:   'Cinzel', serif;
  --font-body:    'Lato', sans-serif;
  --ticker-height: 44px;   /* высота бегущей строки; на неё поднят первый экран */
  --radius:       2px;
  --transition:   0.3s ease;
}

/* ── SECTION LABEL ───────────────────────────── */
.section-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 14px;
}

.section-label__line {
  display: block;
  width: 24px;
  height: 1px;
  background-color: var(--gold);
  flex-shrink: 0;
}

/* ── BUTTONS ─────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 16px 40px;
  border-radius: var(--radius);
  transition: opacity var(--transition), background-color var(--transition), color var(--transition), border-color var(--transition);
  white-space: nowrap;
}

.btn--gold {
  background-color: var(--gold);
  color: #111;
}
.btn--gold:hover { opacity: 0.88; }

.btn--outline-gold {
  border: 1px solid rgba(201, 162, 39, 0.55);
  color: var(--gold);
  padding: 13px 28px;
}
.btn--outline-gold:hover {
  background-color: var(--gold);
  color: #111;
}

.btn--full { width: 100%; justify-content: center; }

.btn__spinner {
  display: none;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(17,17,17,0.3);
  border-top-color: #111;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn.btn--loading .btn__text,
.btn.btn--loading .btn__icon { display: none; }
.btn.btn--loading .btn__spinner { display: block; }
.btn.btn--loading { opacity: 0.75; pointer-events: none; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════
   HERO
════════════════════════════════════════════════ */
.hero {
  position: relative;
  width: 100%;
  /* Оставляем внизу полосу под бегущую строку, чтобы она попадала
     в первый экран, а не начиналась ровно за его нижним краем. */
  height: calc(100svh - var(--ticker-height));
  min-height: 560px;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background-image: url('/images/photo-1663530761401-15eefb544889.webp');
  background-size: cover;
  background-position: center 40%;
  background-color: var(--bg-dark);
}

.hero__overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hero__overlay--gradient {
  background: linear-gradient(
    180deg,
    rgba(15, 12, 13, 0.78) 0%,
    rgba(15, 12, 13, 0.12) 42%,
    rgba(15, 12, 13, 0.82) 100%
  );
}

.hero__overlay--side {
  background: linear-gradient(
    90deg,
    rgba(15, 12, 13, 0.52) 0%,
    transparent 65%
  );
}

/* Header */
.hero__header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 36px 56px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo__icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.logo__text {
  display: flex;
  flex-direction: column;
}

.logo__name {
  font-family: var(--font-label);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.35em;
  color: var(--gold);
  line-height: 1;
}

.logo__sub {
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text);
  margin-top: 5px;
  line-height: 1;
}

.hero__nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.hero__phone {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text);
  transition: color var(--transition);
}
.hero__phone:hover { color: var(--gold); }

/* Center content */
.hero__content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 24px;
}

.hero__label {
  display: flex;
  align-items: center;
  gap: 20px;
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 28px;
}

.hero__label-line {
  display: block;
  width: 52px;
  height: 1px;
  background-color: rgba(201, 162, 39, 0.6);
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(4.5rem, 11vw, 10rem);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 20px;
}

.hero__tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.3rem, 3vw, 2rem);
  color: var(--text);
  letter-spacing: 0.03em;
  margin-bottom: 44px;
}

/* Bottom bar */
.hero__bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  border-top: 1px solid var(--text-ghost);
}

.hero__thumbs {
  display: flex;
  gap: 1px;
  flex-shrink: 0;
}

.hero__thumb {
  width: 110px;
  height: 88px;
  overflow: hidden;
  background-color: var(--bg-dark);
}

.hero__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.75;
  transition: opacity var(--transition), transform 0.5s ease;
}
.hero__thumb:hover img { opacity: 1; transform: scale(1.06); }

.hero__services {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  height: 88px;
  padding: 0 32px;
  background-color: rgba(15, 12, 13, 0.62);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.hero__service {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.hero__dot {
  color: rgba(201, 162, 39, 0.3);
  font-size: 20px;
  line-height: 1;
}

/* ═══════════════════════════════════════════════
   TICKER
════════════════════════════════════════════════ */
.ticker {
  overflow: hidden;
  background-color: var(--gold);
  padding: 14px 0;
}

/*
 * Лента состоит из нескольких одинаковых копий блока .ticker__group.
 * Зазор между словами живёт ВНУТРИ копии (gap + padding-right), поэтому
 * копии стыкуются встык и сдвиг ровно на ширину одной копии незаметен.
 * Раньше gap стоял на самой ленте: при 24 элементах половина её ширины
 * не совпадала с шириной копии на один зазор — отсюда и был рывок.
 * Ширину сдвига и длительность подставляет JS (см. main.js).
 */
.ticker__track {
  display: flex;
  width: max-content;
}

.ticker__track--ready {
  animation: ticker var(--ticker-duration, 22s) linear infinite;
}

.ticker__group {
  display: flex;
  align-items: center;
  gap: 40px;
  padding-right: 40px;   /* тот же зазор на стыке копий */
}

.ticker__item {
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #1a1208;
  white-space: nowrap;
}

.ticker__sep {
  color: rgba(17, 13, 8, 0.35);
  font-size: 16px;
  line-height: 1;
}

@keyframes ticker {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(var(--ticker-shift, -50%), 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .ticker__track--ready { animation: none; }
}

/* ═══════════════════════════════════════════════
   GALLERY / SLIDER
════════════════════════════════════════════════ */
.gallery {
  background-color: var(--bg-dark);
  padding: 72px 0 60px;
}

.gallery__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 0 56px;
  margin-bottom: 36px;
}

.gallery__title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 3.5vw, 2.8rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--text);
}

.gallery__title em {
  font-style: italic;
  color: var(--gold);
}

.gallery__controls {
  display: flex;
  gap: 10px;
}

.gallery__btn {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  border-radius: var(--radius);
  transition: background-color var(--transition), color var(--transition);
}
.gallery__btn:hover {
  background-color: var(--gold);
  color: #111;
}

.gallery__viewport {
  overflow: hidden;
  padding: 0 56px;
}

.gallery__track {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  /* вертикальный скролл остаётся браузеру, горизонтальный жест — слайдеру */
  touch-action: pan-y;
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
}

/* Мгновенный (неанимированный) сдвиг — петля и перетаскивание */
.gallery__track--instant { transition: none !important; }

.gallery__track--dragging { cursor: grabbing; }

.gallery__slide img {
  -webkit-user-drag: none;
  user-select: none;
}

.gallery__slide {
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  background-color: var(--bg-darker);
  /* Ширина и высота выставляются из JS одинаковой высотой для всех слайдов,
     чтобы блок под галереей не «прыгал» во время перелистывания.
     aspect-ratio — запасной вариант, если JS не отработал. */
  aspect-ratio: 3 / 4;
  border-radius: var(--radius);
  transition: width 0.5s ease, opacity 0.5s ease;
}

.gallery__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s ease;
}
.gallery__slide:hover img { transform: scale(1.05); }

.gallery__slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 12, 13, 0.78) 0%, transparent 55%);
  pointer-events: none;
}

.gallery__slide-label {
  position: absolute;
  bottom: 20px;
  left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gallery__slide-line {
  display: block;
  width: 24px;
  height: 1px;
  background-color: var(--gold);
}

.gallery__slide-text {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text);
}

.gallery__dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  padding: 0 56px;
}

.gallery__dot {
  height: 6px;
  border-radius: 3px;
  background-color: var(--gold-dim);
  border: none;
  cursor: pointer;
  transition: width 0.3s ease, background-color 0.3s ease;
  width: 6px;
}

.gallery__dot--active {
  width: 24px;
  background-color: var(--gold);
}

/* ═══════════════════════════════════════════════
   РЕЖИМ РЕДАКТИРОВАНИЯ В АДМИНКЕ
   Класс cms-edit ставит main.js, когда страница открыта
   в визуальном редакторе. Слайдер и бегущая строка замирают,
   все слайды показываются сеткой — чтобы подписи можно было
   править прямо на месте и видеть сразу все.
════════════════════════════════════════════════ */
.cms-edit .gallery__viewport {
  overflow: visible;
}

.cms-edit .gallery__track {
  flex-wrap: wrap;
  transform: none !important;
  height: auto !important;
  animation: none !important;
  cursor: default;
}

.cms-edit .gallery__slide {
  width: 200px;
  height: auto;
  aspect-ratio: 3 / 4;
  opacity: 1 !important;
  transition: none;
}

.cms-edit .gallery__dots,
.cms-edit .gallery__controls {
  display: none;
}

.cms-edit .ticker__track {
  animation: none !important;
  transform: none !important;
}

/* ═══════════════════════════════════════════════
   CONTACT
════════════════════════════════════════════════ */
.contact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  background-color: var(--bg);
}

/* Photo column */
.contact__photo {
  position: relative;
  min-height: 700px;
  overflow: hidden;
}

.contact__photo-img {
  position: absolute;
  inset: 0;
  background-image: url('/images/form_photo.webp');
  background-size: cover;
  background-position: center 30%;
  background-color: var(--bg-dark);
  transition: transform 0.8s ease;
}
.contact__photo:hover .contact__photo-img { transform: scale(1.03); }

.contact__photo-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgba(48, 46, 49, 0.88) 0%,
    rgba(48, 46, 49, 0.15) 50%,
    transparent 100%
  );
}

.contact__photo-caption {
  position: absolute;
  bottom: 48px;
  left: 40px;
  right: 40px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.contact__photo-line {
  display: block;
  height: 1px;
  background-color: rgba(201, 162, 39, 0.45);
  margin-bottom: 8px;
}

.contact__photo-name {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 15px;
  color: var(--text);
  letter-spacing: 0.04em;
}

.contact__photo-role {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(201, 162, 39, 0.75);
}

/* Form column */
.contact__content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 80px 56px;
}

.contact__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.12;
  color: var(--text);
  margin-bottom: 40px;
}

.contact__title em {
  font-style: italic;
  color: var(--gold);
}

/* Contact info */
.contact__info {
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--text-ghost);
}

.contact__info-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  transition: color var(--transition);
}
a.contact__info-item:hover { color: var(--gold); }
a.contact__info-item svg { color: var(--gold); }
span.contact__info-item { color: var(--text-dim); }
span.contact__info-item svg { color: var(--gold); }

/* ── FORM ─────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 16px; }

.form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form__group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.form__label-optional {
  font-size: 10px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--text-muted);
}

.form__input,
.form__select,
.form__textarea {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text);
  background-color: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(240, 232, 208, 0.13);
  border-radius: var(--radius);
  padding: 14px 18px;
  transition: border-color var(--transition), background-color var(--transition);
  outline: none;
  width: 100%;
}

.form__input::placeholder,
.form__textarea::placeholder { color: rgba(240, 232, 208, 0.22); }

.form__input:focus,
.form__select:focus,
.form__textarea:focus {
  border-color: var(--gold);
  background-color: rgba(201, 162, 39, 0.04);
}

.form__input.form__input--error,
.form__select.form__select--error,
.form__textarea.form__textarea--error {
  border-color: #e05353;
}

.form__select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23c9a227' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  padding-right: 44px;
  cursor: pointer;
  color: var(--text);
}

.form__select option {
  background-color: #302E31;
  color: var(--text);
}

.form__textarea { resize: vertical; min-height: 110px; }

input[type="date"].form__input { color-scheme: dark; }

.form__error {
  font-size: 12px;
  color: #e05353;
  min-height: 16px;
  display: block;
  font-weight: 400;
  letter-spacing: 0.02em;
}

/* Success — модалка по центру экрана, видна только после успешной отправки.
   В скрытом состоянии display остаётся flex (меняются только opacity/visibility),
   иначе анимация появления не сработала бы. */
.form__success {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.form__success[hidden] {
  display: flex;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.form__success-backdrop {
  position: absolute;
  inset: 0;
  background-color: rgba(12, 10, 11, 0.8);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.form__success-box {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  padding: 52px 32px 46px;
  border: 1px solid var(--gold-dim);
  background-color: var(--bg-dark);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  transform: translateY(18px) scale(0.96);
  transition: transform 0.45s cubic-bezier(0.2, 0.75, 0.3, 1);
}

.form__success[hidden] .form__success-box {
  transform: translateY(18px) scale(0.96);
}

.form__success:not([hidden]) .form__success-box {
  transform: none;
}

.form__success-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  border-radius: var(--radius);
  transition: color var(--transition), background-color var(--transition);
}
.form__success-close:hover {
  color: var(--gold);
  background-color: var(--gold-faint);
}

.form__success-icon {
  font-size: 28px;
  color: var(--gold);
}

.form__success-title {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--text);
}

.form__success-text {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.6;
}

@media (prefers-reduced-motion: reduce) {
  .form__success,
  .form__success-box { transition: none; }
}

.form__server-error {
  padding: 14px 18px;
  border: 1px solid rgba(224, 83, 83, 0.4);
  background-color: rgba(224, 83, 83, 0.06);
  border-radius: var(--radius);
  font-size: 13px;
  color: #e89090;
  line-height: 1.5;
}

.form__server-error a {
  color: #e05353;
  text-decoration: underline;
}

/* ═══════════════════════════════════════════════
   FOOTER
════════════════════════════════════════════════ */
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 28px 56px;
  border-top: 1px solid var(--text-ghost);
  background-color: var(--bg);
}

.footer__left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer__logo {
  opacity: 0.3;
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.footer__copy {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(240, 232, 208, 0.2);
}

.footer__tagline {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 12px;
  color: rgba(240, 232, 208, 0.15);
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .hero__header { padding: 28px 32px; }
  .hero__bottom { display: none; }
  .gallery__header { padding: 0 32px; }
  .gallery__viewport { padding: 0 32px; }
  .gallery__dots { padding: 0 32px; }
  .contact { grid-template-columns: 1fr; }
  .contact__content { padding: 64px 32px; }
  .footer { padding: 24px 32px; }
}

@media (max-width: 768px) {
  .hero__header { padding: 20px 20px; }
  .hero__nav .btn--outline-gold { display: none; }
  .hero__phone { font-size: 13px; }

  .gallery { padding: 48px 0 40px; }
  .gallery__header { padding: 0 20px; margin-bottom: 24px; }
  .gallery__viewport { padding: 0 20px; }
  .gallery__dots { padding: 0 20px; margin-top: 20px; }

  .contact__content { padding: 48px 20px; }
  .form__row { grid-template-columns: 1fr; }
  .contact__info { gap: 20px; }
  .footer { padding: 20px; flex-direction: column; align-items: flex-start; gap: 8px; }
}

/* Подсказка про панель слайдера — видна только в редакторе админки */
.gallery__cms-note {
  margin: 24px 56px 0;
  padding: 14px 18px;
  border: 1px dashed var(--gold-dim);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 14px;
}
.gallery__cms-note b { color: var(--gold); }
