/* ===== Чам Кавказа: светлая / тёмная темы =====
   Переключение: <html data-theme="light|dark">.
   По умолчанию — светлая. Выбор хранится в localStorage (cham-theme),
   иначе берётся prefers-color-scheme. См. js/theme.js */

/* Курсива на сайте нет — страховка от случайных <em>/<i> */
em, i { font-style: normal !important; }

:root { color-scheme: light; }
:root:has(html[data-theme="dark"]), html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }

/* ---------- Переключатель темы ---------- */
#theme-toggle { flex-shrink: 0; }
#theme-toggle .icon-moon { display: none; }
html[data-theme="light"] #theme-toggle .icon-moon { display: block; }
html[data-theme="light"] #theme-toggle .icon-sun { display: none; }

/* ---------- Hero-затемнение (оба героя через .hero-shade) ---------- */
.hero-shade { background: linear-gradient(to top, #0d0b09, rgba(13,11,9,.6) 55%, rgba(13,11,9,.2)); }
html[data-theme="light"] .hero-shade { background: linear-gradient(to top, #f4ead8 3%, rgba(244,234,216,.78) 45%, rgba(244,234,216,.22)); }

/* ---------- ТЁМНАЯ ТЕМА: приглушённый красный для кнопок ----------
   Отзывы (span.bg-wine, звёзды) не трогаем — только ссылки/кнопки. */
html[data-theme="dark"] a.bg-wine,
html[data-theme="dark"] button.bg-wine { background-color: #5e1414; }
html[data-theme="dark"] a.bg-wine:hover,
html[data-theme="dark"] button.bg-wine:hover { background-color: #7a1a1a; }

/* ================= СВЕТЛАЯ ТЕМА =================
   Палитра по референсу IMG_9176: песочный #E4C7A3, золото #F3CE91,
   бронза #9A6A3F, терракота #8C3A27, олива #4B4F32, кора #3A2314. */

html[data-theme="light"] body {
  background-color: #f4ead8;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='280' height='280'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.012 0.014' numOctaves='3' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.07'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)' opacity='0.05'/%3E%3C/svg%3E");
  color: #3a2314;
}

/* Шапка */
html[data-theme="light"] #site-header { background-color: rgba(252,246,234,.93); border-color: rgba(58,35,20,.14); }
html[data-theme="light"] #site-header.header-scrolled { background-color: rgba(252,246,234,.96); }
html[data-theme="light"] .nav-link { color: #5c4a38; }
html[data-theme="light"] .nav-link:hover, html[data-theme="light"] .nav-link.nav-active { color: #9a6a3f; }

/* Поверхности */
html[data-theme="light"] .bg-coal { background-color: #f4ead8; }
html[data-theme="light"] .bg-coal\/90 { background-color: rgba(252,246,234,.93); }
html[data-theme="light"] .bg-ember { background-color: #ecdcbf; }
html[data-theme="light"] .bg-card {
  background-color: #fcf6ea;
  border-color: rgba(58,35,20,.14);
  box-shadow: 0 14px 30px -18px rgba(58,35,20,.35);
}
html[data-theme="light"] .border-white\/10,
html[data-theme="light"] .border-white\/5,
html[data-theme="light"] .border-white\/15 { border-color: rgba(58,35,20,.14); }
html[data-theme="light"] .divide-white\/5 > :not([hidden]) ~ :not([hidden]) { border-color: rgba(58,35,20,.12); }
html[data-theme="light"] .bg-white\/10 { background-color: rgba(58,35,20,.07); }
html[data-theme="light"] .hover\:bg-white\/20:hover { background-color: rgba(58,35,20,.12); }

/* Текст */
html[data-theme="light"] .text-stone-200 { color: #3a2314; }
html[data-theme="light"] .text-stone-300 { color: #4e3a28; }
html[data-theme="light"] .text-stone-400 { color: #7c6a54; }
html[data-theme="light"] .text-stone-500 { color: #a08b6d; }
html[data-theme="light"] .text-stone-600 { color: #a08b6d; }
html[data-theme="light"] .text-white { color: #3a2314; }
html[data-theme="light"] .hover\:text-white:hover { color: #3a2314; }
html[data-theme="light"] .placeholder-stone-500::placeholder { color: #a08b6d; }
html[data-theme="light"] .text-goldlight { color: #7e5a24; }
html[data-theme="light"] .hover\:text-goldlight:hover { color: #9a6a3f; }
html[data-theme="light"] .text-gold { color: #8f6e1f; }
html[data-theme="light"] .text-gold\/90 { color: rgba(143,110,31,.9); }
html[data-theme="light"] .text-gold\/80 { color: rgba(143,110,31,.85); }
html[data-theme="light"] .text-red-400 { color: #b3261e; }
html[data-theme="light"] .text-red-300 { color: #b3261e; }
html[data-theme="light"] .border-red-400\/40 { border-color: rgba(179,38,30,.4); }

/* Акцентные границы */
html[data-theme="light"] .border-gold\/60 { border-color: rgba(154,106,63,.6); }
html[data-theme="light"] .border-gold\/30 { border-color: rgba(154,106,63,.35); }
html[data-theme="light"] .hover\:border-gold\/60:hover { border-color: rgba(154,106,63,.7); }
html[data-theme="light"] .gold-rule { background: linear-gradient(90deg, #9a6a3f, transparent); }

/* Красные (терракотовые в светлой) кнопки */
html[data-theme="light"] a.bg-wine,
html[data-theme="light"] button.bg-wine { background-color: #8c3a27; border-color: #6e2a1d; color: #fff8ee; }
html[data-theme="light"] a.bg-wine:hover,
html[data-theme="light"] button.bg-wine:hover { background-color: #73291b; }
html[data-theme="light"] .bg-wine\/30 { background-color: rgba(140,58,39,.14); }
html[data-theme="light"] .bg-wine\/50 { background-color: rgba(140,58,39,.22); }
html[data-theme="light"] .bg-wine\/60 { background-color: rgba(140,58,39,.3); }
html[data-theme="light"] .hover\:bg-wine\/50:hover { background-color: rgba(140,58,39,.25); }

/* Контурные кнопки (золото -> бронза) */
html[data-theme="light"] .hover\:bg-gold:hover { background-color: #9a6a3f; }
html[data-theme="light"] .hover\:text-coal:hover { color: #fff8ee; }

/* Кнопка "Наверх" в светлой теме */
html[data-theme="light"] #to-top { background-color: rgba(140,58,39,.12); border-color: rgba(154,106,63,.6); color: #8c3a27; }
html[data-theme="light"] #to-top:hover { background-color: rgba(140,58,39,.22); }

/* Мессенджеры: цветной контур оставляем, текст чуть глубже для читаемости (см. общие правила в конце файла) */

/* Чипы фильтров в меню */
html[data-theme="light"] #cat-nav a.chip-active { border-color: rgba(154,106,63,.8); color: #7e5a24; background: rgba(154,106,63,.12); }

/* Админка: поля и мелочи */
html[data-theme="light"] .field { background: #fffdf8; border-color: rgba(58,35,20,.2); color: #3a2314; }
html[data-theme="light"] .field::placeholder { color: #a08b6d; }
html[data-theme="light"] label.lbl { color: #7c6a54; }
html[data-theme="light"] .bg-gold { background-color: #9a6a3f; }
html[data-theme="light"] input[data-toggle] { background: #cbb894; }
html[data-theme="light"] input[data-toggle]:checked { background: #9a6a3f; }
html[data-theme="light"] input[type="file"] { color: #7c6a54; }

/* Переключатель темы в светлой теме */
html[data-theme="light"] #theme-toggle { border-color: rgba(58,35,20,.2); color: #7e5a24; }
html[data-theme="light"] #theme-toggle:hover { border-color: rgba(154,106,63,.7); }

/* ============ СВЕТЛАЯ ТЕМА: монохромная разметка -> песочная палитра ============
   Актуальный дизайн: #090909 / zinc / white. Правила ниже дополняют базовые. */

/* Поверхности */
html[data-theme="light"] .bg-\[\#090909\] { background-color: #f4ead8; }
html[data-theme="light"] .bg-\[\#090909\]\/90,
html[data-theme="light"] .bg-\[\#090909\]\/95 { background-color: rgba(252,246,234,.93); }
html[data-theme="light"] .bg-\[\#111111\] { background-color: #ead9be; }
html[data-theme="light"] .bg-\[\#161616\] {
  background-color: #fcf6ea;
  border-color: rgba(58,35,20,.14);
  box-shadow: 0 14px 30px -18px rgba(58,35,20,.35);
}
html[data-theme="light"] .bg-\[\#141414\] { background-color: #fffdf8; border-color: rgba(58,35,20,.14); }
html[data-theme="light"] .bg-black\/70 { background-color: rgba(58,35,20,.45); }
html[data-theme="light"] .bg-white { background-color: #8c3a27; }
html[data-theme="light"] .bg-white\/5 { background-color: rgba(154,106,63,.08); }
html[data-theme="light"] .hover\:bg-white:hover { background-color: #9a6a3f; }
html[data-theme="light"] .hover\:bg-zinc-200:hover { background-color: #73291b; }

/* Текст */
html[data-theme="light"] .text-zinc-100 { color: #4e3a28; }
html[data-theme="light"] .text-zinc-200 { color: #4e3a28; }
html[data-theme="light"] .text-zinc-300 { color: #5f4c39; }
html[data-theme="light"] .text-zinc-400 { color: #7c6a54; }
html[data-theme="light"] .text-zinc-500 { color: #a08b6d; }
html[data-theme="light"] .text-zinc-600 { color: #a98f68; }
html[data-theme="light"] .text-black { color: #fff8ee; }
html[data-theme="light"] .hover\:text-black:hover { color: #fff8ee; }
html[data-theme="light"] .hover\:text-zinc-300:hover { color: #4e3a28; }
html[data-theme="light"] .group:hover .group-hover\:text-white { color: #3a2314; }
html[data-theme="light"] .eyebrow { color: #7e5a24; }
html[data-theme="light"] .placeholder-zinc-500::placeholder { color: #a08b6d; }

/* Границы и правила */
html[data-theme="light"] .border-white\/20 { border-color: rgba(58,35,20,.25); }
html[data-theme="light"] .border-white\/30 { border-color: rgba(154,106,63,.45); }
html[data-theme="light"] .border-white\/40 { border-color: rgba(154,106,63,.55); }
html[data-theme="light"] .border-white { border-color: #8c3a27; }
html[data-theme="light"] .hover\:border-white\/30:hover { border-color: rgba(154,106,63,.5); }
html[data-theme="light"] .hover\:border-white\/40:hover,
html[data-theme="light"] .hover\:border-white\/50:hover { border-color: rgba(154,106,63,.65); }
html[data-theme="light"] .bely-rule { background: rgba(154,106,63,.7); }
html[data-theme="light"] .focus\:border-white:focus { border-color: #9a6a3f; }
html[data-theme="light"] .focus\:ring-white:focus { --tw-ring-color: rgba(154,106,63,.4); }

/* Градиенты поверх фото */
html[data-theme="light"] .from-white\/5 { --tw-gradient-from: rgba(154,106,63,.12); }
html[data-theme="light"] .from-white\/40 { --tw-gradient-from: rgba(154,106,63,.5); }

/* Фото в светлой теме — без ч/б фильтра */
html[data-theme="light"] .grayscale-\[15\%\],
html[data-theme="light"] .grayscale-\[20\%\],
html[data-theme="light"] .grayscale-\[25\%\] { filter: none; }

/* Hero-затемнение под актуальный тёмный (#090909) */
.hero-shade { background: linear-gradient(to top, #090909, rgba(9,9,9,.7) 55%, rgba(9,9,9,.3)); }
html[data-theme="light"] .hero-shade { background: linear-gradient(to top, #f4ead8 3%, rgba(244,234,216,.78) 45%, rgba(244,234,216,.22)); }

/* Мобильный сайдбар в светлой теме */
html[data-theme="light"] #mobile-drawer-content { background-color: #f7efdd; border-color: rgba(58,35,20,.14); }

/* Кнопка "Наверх" в светлой теме */
html[data-theme="light"] #to-top { background-color: rgba(140,58,39,.12); border-color: rgba(154,106,63,.6); color: #8c3a27; }
html[data-theme="light"] #to-top:hover { background-color: rgba(140,58,39,.22); color: #8c3a27; }

/* Мессенджеры: прозрачные, цветной только контур (обе темы) */
#c-tg { background-color: transparent; border-color: #229ed9; color: #229ed9; }
#c-tg:hover { background-color: rgba(34,158,217,.12); color: #229ed9; }
#c-wa { background-color: transparent; border-color: #25d366; color: #25d366; }
#c-wa:hover { background-color: rgba(37,211,102,.12); color: #25d366; }
html[data-theme="light"] #c-tg { color: #0e7fb5; border-color: #0e7fb5; }
html[data-theme="light"] #c-wa { color: #1b9e57; border-color: #1b9e57; }

/* Переключатель темы в сайдбаре: показываем ЦЕЛЕВУЮ тему */
#theme-toggle-drawer .icon-moon, #theme-toggle-drawer .theme-name-dark { display: none; }
html[data-theme="light"] #theme-toggle-drawer .icon-moon { display: block; }
html[data-theme="light"] #theme-toggle-drawer .theme-name-dark { display: inline; }
html[data-theme="light"] #theme-toggle-drawer .icon-sun,
html[data-theme="light"] #theme-toggle-drawer .theme-name-light { display: none; }
html[data-theme="light"] #theme-toggle-drawer { border-color: rgba(58,35,20,.25); color: #5f4c39; }

/* ============ ТЁМНАЯ ТЕМА: премиум — кроваво-красный + белый + золото + чёрный ============
   База остаётся чёрной, CTA-кнопки заливаются бордо, акценты (подзаголовки, линейки) — золото. */

/* CTA-кнопки: бордо + белый текст (белая окантовка уже есть в разметке) */
html[data-theme="dark"] .bg-white { background-color: #8e1616; }
html[data-theme="dark"] .text-black { color: #ffffff; }
html[data-theme="dark"] .hover\:bg-white:hover { background-color: #a81e1e; }
html[data-theme="dark"] .hover\:bg-zinc-200:hover { background-color: #a81e1e; }
html[data-theme="dark"] .hover\:text-black:hover { color: #ffffff; }

/* Золотые акценты */
html[data-theme="dark"] .eyebrow { color: #c9a227; }
html[data-theme="dark"] .bely-rule { background: linear-gradient(90deg, #c9a227, rgba(201,162,39,0)); }
html[data-theme="dark"] .nav-link.nav-active { color: #e6c76a; }
html[data-theme="dark"] ::selection { background: #8e1616; color: #ffffff; }

/* Hero-фото для светлой темы скрыто в тёмной */
#hero-bg-light { display: none; }
html[data-theme="light"] #hero-bg-light { display: block; }
html[data-theme="light"] #hero-bg { display: none; }
