/* =============================================================================
   Дизайн-система Tkuma. Палитра и типографика из макета.
   Два цвета скорректированы ради читаемости — см. блок ниже.
   ============================================================================= */

:root {
  --bg-base:    #FAFAF7;
  --bg-muted:   #F3F0EB;
  --line:       #E8E6E1;
  --sand:       #D6C1A5;  /* только декор: текстом на светлом фоне не читается */
  --green:      #6F8C72;  /* зелёный из макета, декоративный */

  /* Белый текст на #6F8C72 даёт контраст 3,7:1 при норме 4,5:1.
     На #5F7A62 получается 4,7:1 — кнопки становятся читаемыми. */
  --green-deep:  #5F7A62;
  --green-hover: #52694F;

  --ink:      #222222;
  /* Вторичный текст: #222 при 60% прозрачности давал 4,2:1 и не проходил.
     Сплошной #6B6B68 даёт 5,1:1. */
  --ink-soft: #6B6B68;

  --danger:  #A4483F;
  --success: #4F7A52;

  --radius-card: 2px;
  --radius-ctl:  4px;

  --font-head: "Cormorant Garamond", Georgia, serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;

  --scale: 1;
  --lh-body: 1.6;
  --lh-head: 1.15;

  --maxw: 1280px;
}

/* Иврит: другие гарнитуры и обязательные оптические поправки.
   Без них ивритская версия выглядит сломанной независимо от шрифта. */
html[lang="he"] {
  --font-head: "Bellefair", Georgia, serif;
  --font-body: "Assistant", system-ui, sans-serif;
  --scale: 1.06;      /* у иврита нет выносных элементов, буквы кажутся мельче */
  --lh-body: 1.7;
  --lh-head: 1.25;
}

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--bg-base); color: var(--ink); -webkit-font-smoothing: antialiased; }

body {
  margin: 0;
  font-family: var(--font-body);
  line-height: var(--lh-body);
  font-size: calc(1rem * var(--scale));
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 400; line-height: var(--lh-head); margin: 0; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--green-deep); }

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

:focus-visible { outline: 2px solid var(--green-deep); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* --- Правила для иврита ---------------------------------------------------- */
/* В иврите нет заглавных букв: uppercase превратил бы надзаголовки в мусор. */
html[lang="he"] .uppercase,
html[lang="he"] .eyebrow { text-transform: none; letter-spacing: .05em; color: var(--green-deep); }
/* Синтетический курсив уродует ивритские формы. */
html[lang="he"] em, html[lang="he"] i { font-style: normal; }
/* Разрядка разрушает связность ивритского письма. */
html[lang="he"] body { letter-spacing: 0; }
/* У Bellefair одно начертание: акцент делается кеглем и цветом, не жирностью. */
html[lang="he"] h1, html[lang="he"] h2, html[lang="he"] h3 { font-weight: 400; }

/* Числа, цены и размеры внутри RTL-текста остаются слева направо.
   Без изоляции «₪ 2,450» в ивритской строке рассыпается. */
.numeric { direction: ltr; unicode-bidi: isolate; display: inline-block; }

/* --- Типографика ----------------------------------------------------------- */
.h1 { font-family: var(--font-head); font-size: calc(2rem * var(--scale)); line-height: var(--lh-head); }
.h2 { font-family: var(--font-head); font-size: calc(1.5rem * var(--scale)); line-height: var(--lh-head); }
.h3 { font-family: var(--font-head); font-size: calc(1.25rem * var(--scale)); line-height: var(--lh-head); }
.small { font-size: calc(.875rem * var(--scale)); }
.micro { font-size: calc(.8125rem * var(--scale)); }
.muted { color: var(--ink-soft); }
.eyebrow {
  font-family: var(--font-body); font-size: calc(.75rem * var(--scale));
  text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft);
}
@media (min-width: 768px) {
  .h1 { font-size: calc(3rem * var(--scale)); }
  .h2 { font-size: calc(2rem * var(--scale)); }
  .h3 { font-size: calc(1.5rem * var(--scale)); }
}

/* --- Раскладка -------------------------------------------------------------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .wrap { padding: 0 40px; } }
main { flex: 1; }
.section { margin-top: 56px; }
@media (min-width: 768px) { .section { margin-top: 80px; } }
.row { display: flex; align-items: center; gap: 16px; }
.between { justify-content: space-between; }
.grid { display: grid; gap: 24px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1280px) { .grid { grid-template-columns: repeat(4, 1fr); } }
.grid-2 { display: grid; gap: 32px; }
@media (min-width: 768px) { .grid-2 { grid-template-columns: 1fr 1fr; } }

/* --- Кнопки ------------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 24px; border-radius: var(--radius-ctl);
  font-family: var(--font-body); font-size: calc(.875rem * var(--scale));
  border: 1px solid transparent; cursor: pointer; transition: background-color .15s, border-color .15s;
}
.btn-primary { background: var(--green-deep); color: #fff; }
.btn-primary:hover { background: var(--green-hover); color: #fff; }
.btn-secondary { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--ink-soft); color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--bg-muted); }
.btn:disabled, .btn[aria-disabled="true"] { background: var(--line); color: var(--ink-soft); cursor: not-allowed; }
.btn-sm { height: 36px; padding: 0 16px; font-size: calc(.8125rem * var(--scale)); }

/* --- Поля --------------------------------------------------------------------- */
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; margin-bottom: 6px; font-size: calc(.8125rem * var(--scale)); color: var(--ink-soft); }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 16px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius-ctl);
  font-family: var(--font-body); font-size: calc(.875rem * var(--scale)); color: var(--ink);
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--green-deep); }
.input.is-invalid { border-color: var(--danger); }
.textarea { min-height: 120px; resize: vertical; }
.search { position: relative; }
.search .input { height: 52px; padding-inline-start: 48px; }
.search svg { position: absolute; inset-inline-start: 16px; top: 50%; transform: translateY(-50%); color: var(--ink-soft); }

/* --- Метки и теги --------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-soft);
  font-size: calc(.8125rem * var(--scale));
}
.badge-sand { background: rgba(214,193,165,.4); border-color: var(--sand); color: var(--ink); }
.badge-green { background: var(--green-deep); border-color: var(--green-deep); color: #fff; }
.badge-sold { background: var(--ink); border-color: var(--ink); color: #fff; }
.tag {
  display: inline-block; padding: 8px 20px; border-radius: var(--radius-ctl);
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  font-size: calc(.875rem * var(--scale)); cursor: pointer;
}
.tag.is-active { background: var(--green-deep); border-color: var(--green-deep); color: #fff; }

/* --- Карточки ------------------------------------------------------------------- */
.card { display: flex; flex-direction: column; gap: 12px; }
.card-media {
  position: relative; overflow: hidden; border-radius: var(--radius-card);
  background: var(--bg-muted); aspect-ratio: 4 / 5;
}
.card-media img, .card-media svg { width: 100%; height: 100%; object-fit: cover; }
.card:hover .card-media img { opacity: .9; }
.card-sold { position: absolute; inset-inline-start: 12px; top: 12px; }

/* --- Шапка и футер ---------------------------------------------------------------- */
/* Стили шапки собраны ниже, в разделе «ШАПКА» — здесь их быть не должно,
   иначе более весомый селектор .header .wrap перебивал бы .header-inner. */
.footer { margin-top: 96px; border-top: 1px solid var(--line); background: var(--bg-muted); }
.footer .wrap { padding-top: 56px; padding-bottom: 56px; }
.footer-cols { display: grid; gap: 40px; }
@media (min-width: 768px) { .footer-cols { grid-template-columns: repeat(4, 1fr); } }
.footer h2 { margin-bottom: 16px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }

/* --- Прочее -------------------------------------------------------------------------- */
.hero { background: var(--bg-muted); border-radius: var(--radius-card); padding: 32px; }
@media (min-width: 768px) { .hero { padding: 56px; } }
.flash { padding: 12px 16px; border-radius: var(--radius-ctl); margin-bottom: 16px; font-size: calc(.875rem * var(--scale)); }
.flash-error { background: #FBEEEC; color: var(--danger); }
.flash-success { background: #EDF3ED; color: var(--success); }
.flash-info { background: var(--bg-muted); color: var(--ink); }
.empty { text-align: center; padding: 64px 16px; color: var(--ink-soft); }
.arrow { display: inline-block; }
[dir="rtl"] .arrow { transform: scaleX(-1); }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-card); padding: 24px; }
table.data { width: 100%; border-collapse: collapse; font-size: calc(.875rem * var(--scale)); }
table.data th, table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: start; }
table.data th { color: var(--ink-soft); font-weight: 500; }
.skip-link { position: absolute; inset-inline-start: -9999px; }
.skip-link:focus { inset-inline-start: 16px; top: 16px; background: #fff; padding: 8px 16px; z-index: 100; }

/* =============================================================================
   ШАПКА: липкая, сжимается при прокрутке, не разъезжается на телефоне
   ============================================================================= */

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 250, 247, .94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .2s;
}
.header.is-compact { box-shadow: 0 1px 12px rgba(34, 34, 34, .06); }

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 68px;
  transition: height .2s ease;
  /* min-width: 0 обязателен: без него длинное меню распирает контейнер
     и иконки уезжают за край экрана на телефоне. */
  min-width: 0;
}
.header.is-compact .header-inner { height: 54px; }

.logo { display: flex; flex-direction: column; line-height: 1; flex-shrink: 0; }
.logo-name { font-family: var(--font-head); font-size: 1.35rem; transition: font-size .2s; }
.header.is-compact .logo-name { font-size: 1.15rem; }
.logo-tag {
  font-family: var(--font-body); font-size: .62rem; text-transform: uppercase;
  letter-spacing: .12em; color: var(--ink-soft); margin-top: 2px;
}
html[lang="he"] .logo-tag { text-transform: none; }
.header.is-compact .logo-tag { display: none; }

.nav { display: none; gap: 24px; min-width: 0; }
.header-actions { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }

.lang-switch { display: none; gap: 6px; margin-inline-end: 6px; }
.lang-switch .is-current { color: var(--ink); }
.btn-artist { display: none; margin-inline-end: 6px; white-space: nowrap; }

.icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0; background: none; border: 0;
  cursor: pointer; color: var(--ink); flex-shrink: 0;
}
.dot {
  position: absolute; inset-inline-end: 3px; top: 3px;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
  background: var(--green-deep); color: #fff; font-size: 10px; line-height: 16px;
  text-align: center;
}
.burger { display: inline-flex; }

/* Мобильное меню */
.mobile-menu { border-top: 1px solid var(--line); background: var(--bg-base); }
.mobile-menu .wrap { display: flex; flex-direction: column; padding-top: 12px; padding-bottom: 16px; }
.mobile-menu a { padding: 10px 0; font-size: calc(1rem * var(--scale)); }
.mobile-menu .accent { color: var(--green-deep); }
.lang-switch-mobile {
  display: flex; gap: 16px; margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--line);
}
.lang-switch-mobile a { padding: 0; font-size: calc(.875rem * var(--scale)); color: var(--ink-soft); }
.lang-switch-mobile .is-current { color: var(--ink); }

@media (min-width: 700px)  { .btn-artist { display: inline-flex; } }
@media (min-width: 1000px) { .nav { display: flex; } .burger { display: none; } .mobile-menu { display: none; } }
@media (min-width: 1200px) { .lang-switch { display: flex; } }

/* =============================================================================
   КАРТОЧКА: сердце избранного
   ============================================================================= */
.card-body { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.card-text { min-width: 0; }
.card-title { font-size: calc(.9375rem * var(--scale)); overflow-wrap: anywhere; }
.heart {
  flex-shrink: 0; background: none; border: 0; padding: 2px; cursor: pointer;
  color: var(--ink-soft); transition: color .15s;
}
.heart:hover { color: var(--green-deep); }
.heart.is-on { color: var(--green-deep); }

/* =============================================================================
   ГАЛЕРЕЯ РАБОТЫ
   ============================================================================= */
.gallery-main {
  position: relative; aspect-ratio: 4 / 5; background: var(--bg-muted);
  border-radius: var(--radius-card); overflow: hidden;
}
.gallery-slide {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity .25s ease; pointer-events: none;
}
.gallery-slide.is-active { opacity: 1; pointer-events: auto; }
.gallery-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border: 0; border-radius: 999px;
  background: rgba(255, 255, 255, .9); color: var(--ink);
  font-size: 24px; line-height: 1; cursor: pointer;
}
.gallery-prev { inset-inline-start: 10px; }
.gallery-next { inset-inline-end: 10px; }
/* Стрелки зеркалятся: в RTL «предыдущее» находится справа */
[dir="rtl"] .gallery-prev { transform: translateY(-50%) scaleX(-1); }
[dir="rtl"] .gallery-next { transform: translateY(-50%) scaleX(-1); }
.gallery-counter {
  position: absolute; inset-inline-end: 12px; bottom: 12px;
  padding: 3px 10px; border-radius: 999px;
  background: rgba(34, 34, 34, .7); color: #fff; font-size: 12px;
}
.gallery-thumbs { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.gallery-thumb {
  width: 72px; height: 90px; padding: 0; border: 1px solid var(--line);
  border-radius: var(--radius-card); overflow: hidden; background: none; cursor: pointer;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb.is-active { border-color: var(--green-deep); }

/* =============================================================================
   СЛАЙДЕР НА ГЛАВНОЙ
   ============================================================================= */
.hero { position: relative; overflow: hidden; }
.hero-media { position: relative; aspect-ratio: 16 / 10; border-radius: var(--radius-card); overflow: hidden; }
@media (min-width: 768px) { .hero-media { aspect-ratio: 4 / 3; } }
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .8s ease; }
.hero-slide.is-active { opacity: 1; }
.hero-slide img, .hero-slide svg { width: 100%; height: 100%; object-fit: cover; }
.hero-dots { display: flex; gap: 8px; justify-content: center; margin-top: 12px; }
.hero-dot {
  width: 8px; height: 8px; padding: 0; border: 0; border-radius: 999px;
  background: var(--line); cursor: pointer;
}
.hero-dot.is-active { background: var(--green-deep); width: 20px; }

/* =============================================================================
   МЕЛОЧИ ДЛЯ ТЕЛЕФОНА
   ============================================================================= */
@media (max-width: 480px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .hero { padding: 20px; }
  .panel { padding: 16px; }
  table.data { font-size: calc(.8125rem * var(--scale)); }
  table.data th, table.data td { padding: 8px 6px; }
}
/* Ничто не должно выходить за край экрана */
html, body { max-width: 100%; overflow-x: hidden; }
img, svg, video { max-width: 100%; }

/* Статические страницы: читаемая колонка, различимые подзаголовки */
.page-text { max-width: 46em; padding-top: 48px; padding-bottom: 80px; }
.page-heading { margin-top: 40px; margin-bottom: 12px; }
.page-heading:first-of-type { margin-top: 24px; }
.page-para { margin: 0 0 16px; }
