/* ============================================================
   ХАРОН — Ритуальные услуги и памятники
   styles.css — токены, база, компоненты (общие для всех страниц)
   ============================================================ */

/* ---------- 1. ТОКЕНЫ ---------- */
:root {
  /* Цвет */
  --color-bg:         #F5F3F0;
  --color-surface:    #EDEBE7;
  --color-surface-2:  #E6E3DD;
  --color-stone:      #6E6962;  /* затемнён до WCAG AA на светлом фоне */
  --color-text:       #2A2825;
  --color-text-muted: #6B6662;
  --color-accent:     #4A4540;
  --color-gold:       #B5986A;
  --color-gold-soft:  #C9B492;
  --color-white:      #FFFFFF;
  --color-dark:       #1C1A18;  /* почти-чёрный фон герой/футер */
  --color-placeholder:#D4D0CB;  /* заглушки изображений */

  /* Типографика */
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Inter', system-ui, -apple-system, sans-serif;

  /* Радиусы / линии */
  --radius:  2px;
  --hair:    1px solid rgba(74,69,64,0.14);

  /* Ритм отступов */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 40px;
  --space-5: 64px;
  --space-6: 96px;
  --space-7: 140px;

  /* Контейнер */
  --maxw: 1240px;
  --gutter: clamp(20px, 5vw, 56px);

  /* Тени (мягкие, тёплые) */
  --shadow-sm: 0 1px 2px rgba(42,40,37,0.05);
  --shadow-md: 0 18px 40px -24px rgba(42,40,37,0.30);
  --shadow-lg: 0 30px 70px -30px rgba(42,40,37,0.40);

  /* Время анимаций */
  --t-fast: 150ms;
  --t-base: 200ms;
  --t-slow: 500ms;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- 2. СБРОС / БАЗА ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

/* ---------- 3. ТИПОГРАФИКА ---------- */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 300;
  color: var(--color-text);
  margin: 0;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(44px, 6vw, 72px); line-height: 1.05; letter-spacing: -0.02em; }
h2 { font-size: clamp(32px, 4vw, 44px); line-height: 1.12; }
h3 { font-size: clamp(22px, 2.4vw, 28px); font-weight: 400; line-height: 1.2; }
p  { margin: 0 0 1em; color: var(--color-text-muted); }

.caption {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--color-stone);
}

/* ---------- 4. РАЗМЕТКА ---------- */
.container { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }
.section  { padding-block: var(--space-7); }
.section--tight { padding-block: var(--space-6); }

.section-head { max-width: 640px; margin: 0 auto var(--space-5); text-align: center; }
.section-head .caption { display: block; margin-bottom: var(--space-2); }
.section-head h2 + p { margin-top: var(--space-2); }

/* ---------- 5. СИГНАТУРА: разделитель ◆ ---------- */
.divider {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; margin: var(--space-3) auto;
}
.divider::before, .divider::after {
  content: ""; height: 1px; width: 28px; background: var(--color-gold);
  opacity: 0.7;
}
.divider .diamond { color: var(--color-gold); font-size: 9px; line-height: 1; transform: translateY(-0.5px); }
.divider--inline { margin: 0; }

/* ---------- 6. КНОПКИ ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 30px;
  font-family: var(--font-body); font-size: 12px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.14em;
  border: 1px solid var(--color-gold);
  border-radius: var(--radius);
  background: transparent; color: var(--color-text);
  transition: background var(--t-base) var(--ease), color var(--t-base) var(--ease), border-color var(--t-base);
}
.btn .arrow { transition: transform var(--t-base) var(--ease); }
.btn:hover { background: var(--color-gold); color: var(--color-white); border-color: var(--color-gold); }
.btn:hover .arrow { transform: translateX(4px); }

.btn--on-dark { color: var(--color-bg); }
.btn--on-dark:hover { color: var(--color-dark); }

.btn--ghost { border-color: rgba(74,69,64,0.25); }
.btn--ghost:hover { background: var(--color-accent); color: var(--color-white); border-color: var(--color-accent); }

.link-more {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--color-accent); padding-bottom: 4px;
  border-bottom: 1px solid var(--color-gold);
  transition: gap var(--t-base) var(--ease);
}
.link-more:hover { gap: 14px; }

/* ---------- 7. ШАПКА ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(245,243,240,0.86);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: var(--hair);
}
.site-header__bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-3); height: 78px;
}
.brand { display: flex; align-items: center; gap: 14px; }
/* LOGO: в шапке используется круглый эмблемный знак + текстовый логотип.
   Можно заменить на <img src="assets/img/logo.svg"> при наличии вектора. */
.brand__chip {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--color-dark) url('../img/mark-chip.png') center/cover no-repeat;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(181,152,106,0.25);
  flex: none;
}
.brand__name {
  font-family: var(--font-display); font-size: 25px; font-weight: 600;
  letter-spacing: 0.22em; padding-left: 0.22em; line-height: 1; color: var(--color-text);
}
.brand__sub { display: block; font-family: var(--font-body); font-size: 9px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.34em; color: var(--color-stone); margin-top: 4px; padding-left: 0.34em; }

.nav { display: flex; align-items: center; gap: var(--space-4); }
.nav__links { display: flex; gap: 28px; list-style: none; margin: 0; padding: 0; }
.nav__links a {
  font-size: 13px; font-weight: 400; color: var(--color-text-muted);
  position: relative; padding-block: 6px; transition: color var(--t-base);
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 0;
  background: var(--color-gold); transition: width var(--t-base) var(--ease);
}
.nav__links a:hover, .nav__links a[aria-current="page"] { color: var(--color-text); }
.nav__links a:hover::after, .nav__links a[aria-current="page"]::after { width: 100%; }

.header-phone { display: flex; flex-direction: column; align-items: flex-end; }
.header-phone a { font-family: var(--font-display); font-size: 21px; font-weight: 500; color: var(--color-text); }
.header-phone span { font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--color-stone); }

.burger {
  display: none; width: 44px; height: 44px; border: var(--hair); border-radius: var(--radius);
  background: transparent; position: relative;
}
.burger span, .burger span::before, .burger span::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 18px; height: 1px;
  background: var(--color-text); transform: translate(-50%,-50%); transition: var(--t-base);
}
.burger span::before { transform: translate(-50%, -6px); }
.burger span::after  { transform: translate(-50%, 6px); }
.burger[aria-expanded="true"] span { background: transparent; }
.burger[aria-expanded="true"] span::before { transform: translate(-50%, 0) rotate(45deg); }
.burger[aria-expanded="true"] span::after  { transform: translate(-50%, 0) rotate(-45deg); }

/* блокировка прокрутки при открытом мобильном меню */
body.no-scroll { overflow: hidden; }

/* ---------- ВИДИМЫЙ ФОКУС ДЛЯ КЛАВИАТУРЫ ---------- */
:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 3px;
  border-radius: 2px;
}
.site-footer :focus-visible { outline-color: var(--color-gold-soft); }

/* мобильное меню */
.mobile-menu { display: none; }

/* ---------- 8. КАРТОЧКИ ---------- */
.card {
  background: var(--color-white);
  border: var(--hair); border-radius: var(--radius);
  overflow: hidden;
  transition: transform var(--t-base) var(--ease), box-shadow var(--t-base) var(--ease);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.card__media { aspect-ratio: 4/3; background: var(--color-placeholder); position: relative; }
.card__body { padding: var(--space-3); }
.card__title { font-family: var(--font-display); font-size: 23px; font-weight: 400; }
.card__meta { font-size: 12px; color: var(--color-stone); margin-top: 4px; }
.card__price { font-family: var(--font-display); font-size: 20px; color: var(--color-text); margin-top: 12px; }
.card__price b { font-weight: 600; }

/* заглушка изображения c подписью */
.ph { width: 100%; height: 100%; background: var(--color-placeholder);
  display: flex; align-items: center; justify-content: center; }
.ph__label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.16em; color: #A39E97; }

/* бейдж */
.badge {
  position: absolute; top: 12px; left: 12px;
  font-size: 10px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.12em;
  padding: 5px 10px; background: rgba(28,26,24,0.78); color: var(--color-bg);
  border-radius: var(--radius);
}

/* ---------- 9. ФОРМЫ ---------- */
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--color-stone); }
.field input, .field textarea {
  font-family: var(--font-body); font-size: 15px; font-weight: 300; color: var(--color-text);
  padding: 13px 0; background: transparent; border: none;
  border-bottom: 1px solid rgba(74,69,64,0.22); transition: border-color var(--t-base);
}
.field input:focus, .field textarea:focus { outline: none; border-bottom-color: var(--color-gold); }
.field input::placeholder, .field textarea::placeholder { color: #A8A39D; }

/* ---------- 10. ФУТЕР ---------- */
.site-footer { background: var(--color-dark); color: #C7C2BB; padding-block: var(--space-6) var(--space-4); }
.site-footer a { color: #C7C2BB; transition: color var(--t-base); }
.site-footer a:hover { color: var(--color-gold-soft); }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.1fr; gap: var(--space-5); }
.footer-brand img { width: 220px; opacity: 0.95; }
.footer-brand p { color: #948E86; max-width: 30ch; margin-top: var(--space-2); }
.footer-col h4 { font-family: var(--font-body); font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.16em; color: var(--color-gold-soft); margin: 0 0 var(--space-2); }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; font-size: 14px; }
.footer-col p { color: #948E86; font-size: 14px; margin: 0 0 10px; }
.footer-bottom {
  margin-top: var(--space-5); padding-top: var(--space-3); border-top: 1px solid rgba(255,255,255,0.08);
  display: flex; justify-content: space-between; gap: var(--space-2); flex-wrap: wrap;
  font-size: 12px; color: #6F6A63;
}

/* ---------- 11. SCROLL REVEAL ---------- */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- 12. АДАПТИВ ---------- */
@media (max-width: 1023px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--space-4); }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 880px) {
  .nav__links, .header-phone { display: none; }
  .burger { display: block; }
  .site-header__bar { height: 66px; }
  .mobile-menu {
    display: block; position: fixed; inset: 66px 0 auto 0; z-index: 49;
    background: var(--color-bg); border-bottom: var(--hair);
    transform: translateY(-12px); opacity: 0; pointer-events: none;
    transition: var(--t-base);
  }
  .mobile-menu.is-open { transform: none; opacity: 1; pointer-events: auto; }
  .mobile-menu ul { list-style: none; margin: 0; padding: var(--space-2) var(--gutter) var(--space-3); }
  .mobile-menu li { border-bottom: var(--hair); }
  .mobile-menu a { display: block; padding: 16px 0; font-size: 16px; }
  .mobile-menu .mm-phone { display: block; padding: 20px 0 8px; font-family: var(--font-display); font-size: 22px; }
  .section, .section--tight { padding-block: var(--space-6); }
}
@media (max-width: 540px) {
  .footer-grid { grid-template-columns: 1fr; }
  .btn { width: 100%; justify-content: center; }
}

/* ---------- 13. PREFERS-REDUCED-MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
