/* ============================================================
   Адвокат Васильев А. А. — Сочинский филиал ККА
   Тема: графит + золото/бронза, заголовки с засечками
   ============================================================ */

:root {
  --bg:        #14161a;   /* основной графит */
  --bg-alt:    #1c2029;   /* чередующиеся секции (чуть светлее) */
  --panel:     #1f232b;   /* карточки */
  --panel-2:   #252a33;   /* ховер/границы */
  --line:      #33383f;   /* тонкие линии */

  --gold:      #c8a24d;   /* акцент — золото/бронза */
  --gold-soft: #d9be7e;
  --gold-deep: #a9863a;

  --text:      #ece9e2;   /* основной текст */
  --muted:     #a6a9ae;   /* приглушённый текст */

  --wa:        #25936a;   /* WhatsApp */
  --tg:        #2f7bb0;   /* Telegram */

  --maxw: 1120px;
  --radius: 6px;
  --shadow: 0 12px 34px rgba(0, 0, 0, 0.35);

  --font-head: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "PT Sans", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}
.btn--lg { padding: 15px 30px; font-size: 16px; }
.btn--block { width: 100%; }

.btn--gold {
  background: var(--gold);
  color: #14161a;
  border-color: var(--gold);
}
.btn--gold:hover { background: var(--gold-soft); border-color: var(--gold-soft); }

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
}
.btn--ghost:hover { border-color: var(--gold); color: var(--gold-soft); }

.btn--wa { background: var(--wa); color: #fff; border-color: var(--wa); }
.btn--wa:hover { filter: brightness(1.1); }
.btn--tg { background: var(--tg); color: #fff; border-color: var(--tg); }
.btn--tg:hover { filter: brightness(1.1); }

/* ---------- Шапка ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(20, 22, 26, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  transition: transform 0.32s ease;
  will-change: transform;
}
/* Классическое скрытие: уезжает вверх при прокрутке вниз */
.site-header--hidden { transform: translateY(-100%); }
.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 74px;
}
.brand { display: flex; align-items: center; gap: 14px; margin-right: auto; }
.brand__emblem {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--gold-deep);
  flex: none;
}
.brand__text { display: flex; flex-direction: column; line-height: 1.2; }
.brand__name { font-family: var(--font-head); font-weight: 600; font-size: 18px; }
.brand__sub { font-size: 12.5px; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; }

.nav { display: flex; gap: 26px; }
.nav a {
  font-size: 15px;
  color: var(--muted);
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.nav a:hover { color: var(--text); border-color: var(--gold); }

.header-phone__label { font-size: 15px; }

/* Бургер */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 0 auto;
  background: var(--text);
  transition: transform 0.25s ease, opacity 0.2s ease;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu[hidden] { display: none; }
.mobile-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 24px 20px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.mobile-menu a { padding: 12px 4px; color: var(--text); border-bottom: 1px solid var(--line); }
.mobile-menu a.btn { border-bottom: none; margin-top: 10px; }

/* ---------- Герой ---------- */
.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  min-height: 600px;
  padding: 96px 0 88px;
  background: #14161a; /* запасной фон, если картинка не загрузилась */
  border-bottom: 1px solid var(--line);
}
/* Фото-подложка с лёгким размытием */
.hero::before {
  content: "";
  position: absolute;
  inset: -40px;
  z-index: 0;
  background: url("assets/hero-desktop.jpg") center right / cover no-repeat;
  filter: blur(4px);
  transform: scale(1.06);
}
/* Затемнение слева — чтобы текст читался поверх фото */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg,
    rgba(16, 18, 22, 0.92) 0%,
    rgba(16, 18, 22, 0.78) 34%,
    rgba(16, 18, 22, 0.35) 62%,
    rgba(16, 18, 22, 0) 88%);
}
.hero__inner {
  position: relative;
  z-index: 2;
  max-width: var(--maxw);
}
.hero__eyebrow {
  margin: 0 0 22px;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-soft);
  max-width: 640px;
}
.hero__title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.15;
  margin: 0 0 24px;
  max-width: 640px;
}
.hero__lead {
  font-size: 18px;
  color: var(--muted);
  max-width: 560px;
  margin: 0 0 34px;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------- Секции ---------- */
.section { padding: 80px 0; }
.section--alt { background: var(--bg-alt); }

.section__title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(26px, 3.5vw, 38px);
  text-align: center;
  margin: 0 0 12px;
}
.section__title--left { text-align: left; }
.section__title::after {
  content: "";
  display: block;
  width: 56px;
  height: 3px;
  background: var(--gold);
  margin: 16px auto 0;
}
.section__title--left::after { margin-left: 0; }
.section__subtitle {
  text-align: center;
  color: var(--muted);
  margin: 0 auto 46px;
  max-width: 620px;
}

/* ---------- Карточки ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 28px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.card:hover { border-color: var(--gold-deep); transform: translateY(-3px); }
.card__title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 21px;
  margin: 0 0 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  color: var(--gold-soft);
}
.card__list { list-style: none; margin: 0; padding: 0; }
.card__list li {
  position: relative;
  padding: 7px 0 7px 22px;
  color: var(--text);
}
.card__list li::before {
  content: "";
  position: absolute;
  left: 0; top: 15px;
  width: 7px; height: 7px;
  background: var(--gold);
  transform: rotate(45deg);
}

/* ---------- Об адвокате ---------- */
.about {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 48px;
  align-items: center;
}
.about__media img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  filter: grayscale(0.15) contrast(1.02);
}
.about__body p { margin: 0 0 16px; color: var(--text); }
.about__body p:first-of-type { color: var(--text); }
.about__facts {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.about__facts li {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 12px 18px;
}
.about__facts span { display: block; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.about__facts strong { font-family: var(--font-head); font-size: 18px; }

/* ---------- Отзывы ---------- */
.review {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 26px;
  margin: 0;
}
.review blockquote {
  margin: 0 0 16px;
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
}
.review::before {
  content: "\201C";
  display: block;
  font-family: var(--font-head);
  font-size: 54px;
  line-height: 0.6;
  color: var(--gold-deep);
  margin-bottom: 6px;
}
.review figcaption { color: var(--gold-soft); font-weight: 700; font-size: 15px; }

/* ---------- Контакты ---------- */
.contacts {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 40px;
}
.contacts__col { display: flex; flex-direction: column; gap: 26px; }
.contact-item__label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-soft);
  margin-bottom: 8px;
}
.contact-item a,
.contact-item p { display: block; margin: 3px 0; color: var(--text); }
.contact-item a { transition: color 0.2s ease; }
.contact-item a:hover { color: var(--gold-soft); }

.contacts__col--actions {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px 28px;
  justify-content: flex-start;
}
.contacts__cta { margin: 0 0 18px; color: var(--muted); }
.messengers { display: flex; flex-direction: column; gap: 12px; }

/* Иконка внутри длинной кнопки */
.btn__icon { width: 20px; height: 20px; fill: currentColor; flex: none; }

/* Кнопка мессенджера MAX (фирменный сине-фиолетовый градиент) */
.btn--max {
  background: linear-gradient(135deg, #2f8bff 0%, #7b5cff 55%, #9b53ff 100%);
  color: #fff;
  border-color: transparent;
}
.btn--max:hover { filter: brightness(1.08); }

/* ---------- Футер ---------- */
.site-footer {
  background: #101215;
  border-top: 1px solid var(--line);
  padding: 44px 0;
  font-size: 14.5px;
  color: var(--muted);
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  gap: 32px;
  align-items: start;
}
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-brand__emblem {
  width: 48px; height: 48px; border-radius: 50%;
  object-fit: cover; border: 1px solid var(--gold-deep); flex: none;
}
.footer-brand__name { font-family: var(--font-head); color: var(--text); font-size: 17px; }
.footer-brand__sub { font-size: 13px; }
.footer-legal p { margin: 4px 0; }
.footer-copy { text-align: right; }
.footer-copy a { color: var(--gold-soft); }
.footer-copy p { margin: 0 0 8px; }

/* ---------- Адаптив ---------- */
@media (max-width: 900px) {
  .nav, .header-phone { display: none; }
  .nav-toggle { display: flex; }

  .about { grid-template-columns: 1fr; gap: 28px; }
  .about__media { max-width: 320px; margin: 0 auto; }
  .section__title--left, .section__title--left::after { text-align: center; }
  .section__title--left::after { margin-left: auto; }

  .contacts { grid-template-columns: 1fr; gap: 28px; }
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
  .footer-copy { text-align: left; }
}

/* Мобильный Hero: вертикальное фото, текст сверху */
@media (max-width: 700px) {
  .hero {
    min-height: 80vh;
    align-items: flex-start;
  }
  .hero::before {
    background-image: url("assets/hero-mobile.jpg");
    background-position: center bottom;
    filter: blur(3px);
  }
  .hero::after {
    background: linear-gradient(180deg,
      rgba(16, 18, 22, 0.92) 0%,
      rgba(16, 18, 22, 0.75) 28%,
      rgba(16, 18, 22, 0.28) 55%,
      rgba(16, 18, 22, 0) 82%);
  }
  .hero__title,
  .hero__lead { max-width: 100%; }

  /* «Реестровый №» и «Статус» — скрываем на мобильных (на десктопе остаются) */
  .about__facts { display: none; }
}

@media (max-width: 520px) {
  body { font-size: 16px; }
  .section { padding: 60px 0; }
  .container { padding: 0 18px; }
  .hero__actions { flex-direction: column; }
  .hero__actions .btn { width: 100%; }
}

/* ---------- Форма отзыва ---------- */
.review-form-wrap {
  margin: 44px auto 0;
  max-width: 720px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 34px 32px;
}
.review-form__title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 24px;
  margin: 0 0 8px;
}
.review-form__note { margin: 0 0 24px; color: var(--muted); font-size: 15px; }
.review-form { display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-size: 14px; color: var(--muted); letter-spacing: 0.02em; }
.field .req { color: var(--gold-soft); }
.field .opt { color: var(--muted); font-size: 12.5px; }
.review-form input[type="text"],
.review-form textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.review-form textarea { resize: vertical; min-height: 120px; }
.review-form input[type="text"]::placeholder,
.review-form textarea::placeholder { color: #6f747c; }
.review-form input[type="text"]:focus,
.review-form textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(200, 162, 77, 0.18);
}
.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
}
.consent input {
  margin-top: 3px;
  width: 16px;
  height: 16px;
  flex: none;
  accent-color: var(--gold);
}
.review-form__actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}
.review-form__status { margin: 0; font-size: 14.5px; }
.review-form__status.is-ok { color: var(--gold-soft); }
.review-form__status.is-err { color: #e5807a; }
/* honeypot — скрыт от людей, виден ботам */
.hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  opacity: 0;
}
@media (max-width: 520px) {
  .review-form-wrap { padding: 24px 18px; }
}

/* ---------- Отзывы: кнопка, сворачивание, модалка ---------- */
.reviews-cta { display: flex; justify-content: center; margin: 0 0 40px; }

/* В свёрнутом виде показываем только первые отзывы (остальные скрыты) */
.cards.is-collapsed .review--extra { display: none; }

.reviews-more { display: flex; justify-content: center; margin: 34px 0 0; }
.reviews-empty { text-align: center; color: var(--muted); }

/* Модальное окно с формой (нативный <dialog>) */
dialog.modal {
  border: none;
  background: transparent;
  padding: 0;
  max-width: 720px;
  width: calc(100% - 32px);
  max-height: calc(100vh - 40px);
  overflow: visible;
  color: var(--text);
}
dialog.modal::backdrop {
  background: rgba(10, 11, 13, 0.66);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.modal .review-form-wrap {
  position: relative;
  margin: 0;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  box-shadow: var(--shadow);
}
.modal__close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  font-size: 26px;
  line-height: 1;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.modal__close:hover { color: var(--text); border-color: var(--gold); }
/* Плавное появление окна */
dialog.modal[open] { animation: modal-in 0.18s ease-out; }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  dialog.modal[open] { animation: none; }
}

/* ---------- Фотогалерея: карусель ---------- */
.carousel { position: relative; }
.carousel__track {
  display: flex;
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 4px 2px 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.carousel__track::-webkit-scrollbar { display: none; }
.carousel__item {
  flex: 0 0 auto;
  scroll-snap-align: start;
  height: 320px;
  max-width: 480px;
}
.carousel__photo {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.carousel__photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.4s ease;
}
.carousel__photo:hover { border-color: var(--gold-deep); }
.carousel__photo:hover img { transform: scale(1.07); }
.carousel__photo:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.carousel__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  font-size: 26px;
  line-height: 1;
  color: var(--gold);
  background: rgba(20, 22, 26, 0.86);
  border: 1px solid var(--gold);
  border-radius: 50%;
  cursor: pointer;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  transition: background 0.2s ease, color 0.2s ease;
}
.carousel__nav:hover { background: var(--gold); color: #14161a; }
.carousel__nav--prev { left: -10px; }
.carousel__nav--next { right: -10px; }
@media (max-width: 700px) {
  .carousel__nav { display: none; } /* на мобиле — свайп */
  .carousel__item { height: 260px; max-width: 82vw; }
}

/* ---------- Лайтбокс (просмотр фото) ---------- */
dialog.lightbox {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: 100vw;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
}
dialog.lightbox[open] { display: flex; align-items: center; justify-content: center; }
dialog.lightbox::backdrop { background: rgba(8, 9, 11, 0.92); }
.lightbox__figure { margin: 0; display: flex; align-items: center; justify-content: center; }
.lightbox__img {
  max-width: 92vw;
  max-height: 86vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 12px 44px rgba(0, 0, 0, 0.5);
}
.lightbox__close {
  position: fixed;
  top: 16px;
  right: 20px;
  z-index: 5;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  font-size: 32px;
  line-height: 1;
  color: #fff;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  cursor: pointer;
}
.lightbox__close:hover { background: rgba(0, 0, 0, 0.6); }
.lightbox__nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  font-size: 32px;
  line-height: 1;
  color: #fff;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s ease;
}
.lightbox__nav:hover { background: rgba(0, 0, 0, 0.7); }
.lightbox__nav--prev { left: 18px; }
.lightbox__nav--next { right: 18px; }
.lightbox__counter {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  color: #fff;
  font-size: 14px;
  opacity: 0.85;
  letter-spacing: 0.05em;
}
@media (max-width: 520px) {
  .lightbox__nav { width: 44px; height: 44px; font-size: 26px; }
  .lightbox__nav--prev { left: 8px; }
  .lightbox__nav--next { right: 8px; }
}

/* Кнопка «наверх» */
.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: rgba(20, 22, 26, 0.85);
  color: var(--gold);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.25s ease, transform 0.25s ease,
              visibility 0.25s ease, background 0.2s ease, color 0.2s ease;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.to-top:hover {
  background: var(--gold);
  color: #14161a;
}
@media (max-width: 520px) {
  .to-top { right: 16px; bottom: 16px; width: 44px; height: 44px; }
}

/* Уважаем пользовательские настройки анимаций */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
