/* Общий стиль сайта «Медарин» (ADR 0093): шрифты Lora + Manrope, оформление
   «деревенская лавка» — восковой фон, зелёный луга, медовые кнопки, строгие углы.
   Здесь — то, что одинаково на всех страницах: цвета, шрифты, шапка, подвал,
   кнопки, заголовки разделов. Своё у страницы — в её {% block style %}. */

/* WOFF2 только с латиницей и кириллицей (pyftsubset, ADR 0093): 84 КБ вместо 377 КБ TTF.
   Полные TTF — исходники в apps/shop/brand-istochniki/fonts/. */
@font-face { font-family: "Lora"; src: url("fonts/Lora-wght.f45bd544e0f1.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Manrope"; src: url("fonts/Manrope-wght.c9d43c3f723f.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }

:root {
  --bg: #F6F1E6;         /* светлый воск */
  --card: #FFFDF7;
  --soft: #EDE5D2;       /* подложки, пустые места под фото */
  --line: #DED5BF;
  --fg: #12262D;         /* тёмно-синие чернила вместо оливковых (28.10.2026) */
  --muted: #4A5B61;
  --off: #7A878A;
  --hero: #002630;       /* синий фона узора из исходника логотипа: первый экран и подвал */
  --hero-fg: #FFF6DF;
  --hero-muted: #CBD6D6;
  --honey: #E3A21A;      /* кнопки и акценты; текст на мёде — --on-honey */
  --on-honey: #10222A;
  --honey-ink: #8A5A00;  /* мёд для текста на светлом фоне: #E3A21A там нечитаем */
  --note-bg: #FFF1D6; --note-fg: #5A3A00;
  --bloom: #E3A21A; --bloom-soft: #F3DDA6;
  /* Прежние имена — ими пользуются стили страниц */
  --ink: var(--hero); --paper: var(--card); --mist: var(--soft);
  --display: "Lora", Georgia, "Times New Roman", serif;
  --body: "Manrope", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --num: var(--body);
  --r: 4px;              /* кнопки и поля */
  --cr: 6px;             /* карточки и фото */
  --ease: cubic-bezier(.2, .7, .2, 1);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0E191D; --card: #152429; --soft: #1C2E34; --line: #2A3E45; --fg: #EAE6DA; --muted: #A8B6B9; --off: #76878B;
  --hero: #002B36; --honey-ink: #F0C25C; --note-bg: #3A2A08; --note-fg: #FFD38A; --bloom-soft: #5A4512; color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #0E191D; --card: #152429; --soft: #1C2E34; --line: #2A3E45; --fg: #EAE6DA; --muted: #A8B6B9; --off: #76878B;
  --hero: #002B36; --honey-ink: #F0C25C; --note-bg: #3A2A08; --note-fg: #FFD38A; --bloom-soft: #5A4512; color-scheme: dark; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  /* Переход между страницами — мягкая смена, шапка стоит на месте. Браузеры без
     поддержки просто открывают страницу, как раньше. */
  @view-transition { navigation: auto; }
  .top { view-transition-name: top; }
  ::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; }
}
body { margin: 0; background: var(--bg); color: var(--fg); font: 17px/1.6 var(--body); font-variant-numeric: lining-nums; }
.wrap { max-width: 1120px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.15; text-wrap: balance; margin: 0; }
p { margin: 0; }
a { color: inherit; text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: var(--honey); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
:focus-visible { outline: 3px solid var(--honey); outline-offset: 2px; }
.ph { color: var(--off); font-style: italic; }

/* Кнопки: одна главная (мёд) и одна второстепенная (контур) */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 22px; border: 0; border-radius: var(--r);
  background: var(--honey); color: var(--on-honey); font-weight: 700; font-size: 17px; line-height: 1.2; text-decoration: none; text-align: center;
  transition: background-color .2s var(--ease), transform .2s var(--ease); }
.btn:hover { background: #F0B23A; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: none; color: var(--fg); box-shadow: inset 0 0 0 2px currentColor; }
.btn.ghost:hover { background: var(--soft); }
.btn[disabled] { background: var(--soft); color: var(--off); cursor: not-allowed; }

/* Шапка: всегда сплошная, на всех страницах одна */
.top { position: sticky; top: 0; z-index: 20; background: var(--card); color: var(--fg); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
.top .wrap { display: flex; align-items: center; gap: 24px; min-height: 72px; padding-block: 8px; }
/* Логотип в шапке: знак и имя рядом; на телефоне — только знак */
.top .logo { display: flex; align-items: center; gap: 10px; flex: none; text-decoration: none; }
.top .logo img { width: 47px; height: 48px; }
.top .logo .name { display: grid; font-size: 12.5px; line-height: 1.2; color: var(--muted); letter-spacing: .02em; }
.top .logo .name b { font: 600 24px/1.05 var(--display); color: var(--fg); letter-spacing: 0; }
@media (max-width: 1100px) { .top .logo .name { display: none; } }  /* иначе разделы наезжают на соцсети */
/* Видны «Заявка» и «Корзина» — места для соцсетей и подписи у знака нет (соцсети есть в подвале) */
.top .wrap:has(.bag-link:not([hidden])) :is(.soc-top, .logo .name) { display: none; }
.top nav { display: flex; gap: 4px; flex: 1; min-width: 0; }
.top nav a { display: block; padding: 10px 12px; border-radius: var(--r); font-weight: 600; font-size: 16.5px; text-decoration: none; white-space: nowrap; transition: background-color .2s var(--ease); }
.top nav a:hover { background: var(--soft); }
.top nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--honey); border-radius: 0; }
.top .acts { display: flex; align-items: center; gap: 10px; flex: none; }
.top .btn { min-height: 44px; padding: 10px 18px; font-size: 16px; }
.bag-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 12px; border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--line); text-decoration: none; font-size: 15px; font-weight: 600; white-space: nowrap; }
.bag-link b { min-width: 1.6em; padding: 0 5px; border-radius: 99px; background: var(--honey); color: var(--on-honey); text-align: center; font-size: 13px; line-height: 1.6; }
@media (max-width: 1024px) {
  .top .wrap { flex-wrap: wrap; gap: 4px 12px; min-height: 0; padding-block: 8px 0; }
  .top .logo img { width: 42px; height: 43px; }
  .top .acts { margin-left: auto; }
  /* Разделы — второй строкой, листаются вбок, если не влезли */
  .top nav { order: 3; flex: 1 0 100%; overflow-x: auto; scrollbar-width: none; margin-inline: -12px; }
  .top nav::-webkit-scrollbar { display: none; }
  .top nav a { padding: 10px 12px 12px; font-size: 15.5px; }
  html { scroll-padding-top: 128px; }
}
@media (max-width: 420px) { .bag-link .l { display: none; } .top .btn { padding-inline: 14px; } .top nav a { padding-inline: 8px; font-size: 15px; } }

/* Соцсети: пока адресов нет, значок стоит без ссылки (владелец, 27.10.2026) */
.soc { display: flex; gap: 6px; }
.soc a, .soc span { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r); color: inherit; }
.soc a:hover { background: rgba(127, 127, 127, .15); }
.soc span { opacity: .45; cursor: default; }
.soc svg { width: 22px; height: 22px; fill: currentColor; }
/* звёздочка сноски про Meta — у правого верхнего угла значка */
.soc sup { position: absolute; top: 4px; right: 3px; font-size: 13px; line-height: 1; }

/* Первый экран страницы: зелёный луга с сотами */
.hero { position: relative; background: var(--hero); color: var(--hero-fg); overflow: hidden; }
/* Узор из исходника логотипа (uzor.svg — белые цветы листа logo-pattern, вектором, середина на
   месте знака заполнена теми же элементами — brand-istochniki/uzor_elementy.py): цвет — из
   токена через маску, поэтому тот же в обеих темах. Справа гуще, к тексту растворяется. */
.hero::before, .foot::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: var(--hero-fg); opacity: .13; }
/* Подвал: лист справа, вплотную к краю, к тексту растворяется */
.foot::before { opacity: .09;
  -webkit-mask: url("uzor.12317790d722.svg") right center / auto 150% no-repeat, linear-gradient(90deg, transparent 30%, #000 85%); -webkit-mask-composite: source-in;
  mask: url("uzor.12317790d722.svg") right center / auto 150% no-repeat, linear-gradient(90deg, transparent 30%, #000 85%); mask-composite: intersect; }
/* Шапка раздела: узор во всё свободное место вокруг текста, к тексту растворяется. --l — левый
   край текста (как у .wrap), текст шириной до ~640 точек; лист повторяется влево от правого края */
.hero { --l: max(16px, 50% - 544px); }
.hero::before {
  -webkit-mask: url("uzor.12317790d722.svg") right center / auto 150% repeat-x,
    linear-gradient(90deg, #000 calc(var(--l) - 72px), transparent calc(var(--l) - 8px), transparent calc(var(--l) + 600px), #000 calc(var(--l) + 960px));
  -webkit-mask-composite: source-in;
  mask: url("uzor.12317790d722.svg") right center / auto 150% repeat-x,
    linear-gradient(90deg, #000 calc(var(--l) - 72px), transparent calc(var(--l) - 8px), transparent calc(var(--l) + 600px), #000 calc(var(--l) + 960px));
  mask-composite: intersect; }
.hero > * { position: relative; }
/* Первый экран «текст + фото» (главная, экскурсии): рамка из листа вокруг текста с трёх сторон —
   слева, сверху и снизу; справа фото. Лист целиком над половиной с текстом, видна только кайма. */
:is(.home-hero, .eks-hero) { --pl: max(16px, calc((100vw - 1120px) / 2 + 16px)); --pv: 96px; }
:is(.home-hero, .eks-hero)::before { right: auto; width: 51.2%; opacity: .15;
  -webkit-mask: url("uzor.12317790d722.svg") center / cover no-repeat,
    linear-gradient(90deg, #000 calc(var(--pl) - 56px), transparent calc(var(--pl) - 8px)),
    linear-gradient(180deg, #000 calc(var(--pv) - 52px), transparent calc(var(--pv) - 8px)),
    linear-gradient(0deg, #000 calc(var(--pv) - 52px), transparent calc(var(--pv) - 8px));
  -webkit-mask-composite: source-in, source-over, source-over;
  mask: url("uzor.12317790d722.svg") center / cover no-repeat,
    linear-gradient(90deg, #000 calc(var(--pl) - 56px), transparent calc(var(--pl) - 8px)),
    linear-gradient(180deg, #000 calc(var(--pv) - 52px), transparent calc(var(--pv) - 8px)),
    linear-gradient(0deg, #000 calc(var(--pv) - 52px), transparent calc(var(--pv) - 8px));
  mask-composite: intersect, add, add; }
:is(.home-hero .foto, .eks-hero img) { z-index: 1; }  /* на телефоне фото поднято через order — без z-index узор лёг бы поверх */
/* Телефон: текст во всю ширину под фото — рамке места нет, лист бледно под текстом, к середине растворяется */
@media (max-width: 860px) { :is(.home-hero, .eks-hero)::before { width: auto; right: 0;
  -webkit-mask: url("uzor.12317790d722.svg") center / cover no-repeat, radial-gradient(ellipse 62% 58% at 46% 50%, transparent 42%, #000 95%); -webkit-mask-composite: source-in;
  mask: url("uzor.12317790d722.svg") center / cover no-repeat, radial-gradient(ellipse 62% 58% at 46% 50%, transparent 42%, #000 95%); mask-composite: intersect; } }
.hero h1 { color: var(--hero-fg); }
.hero p { color: var(--hero-muted); }
.hero .btn.ghost { color: var(--hero-fg); }
.hero .btn.ghost:hover { background: rgba(255, 246, 223, .1); }
.page-head { padding-block: 40px 36px; display: grid; gap: 12px; }
.page-head h1 { font-size: clamp(34px, 5vw, 52px); }
.page-head p { font-size: 19px; max-width: 58ch; }

/* Разделы страницы */
section.band { padding-block: 56px 8px; }
.band-head { display: grid; gap: 10px; max-width: 64ch; margin-bottom: 24px; }
.band-head h2 { font-size: clamp(28px, 4vw, 40px); }
.band-head p { color: var(--muted); }

/* Шаги в сотах: «как купить» и подобное — то, что идёт по порядку */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; list-style: none; margin: 0; padding: 0; counter-reset: st; }
.steps li { counter-increment: st; display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 14px; align-items: start; }
.steps li::before { content: counter(st); width: 48px; height: 54px; display: grid; place-items: center; background: var(--honey); color: var(--on-honey); font: 700 21px var(--body);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.steps b { display: block; font-size: 18px; margin-bottom: 2px; }
.steps span { color: var(--muted); font-size: 16px; }
@media (max-width: 760px) { .steps { grid-template-columns: minmax(0, 1fr); } }

/* Частые вопросы */
.faq { border-top: 2px solid var(--fg); max-width: 780px; }
/* На широком экране вопросы справа от заголовка — во всю ширину, без пустой правой трети */
@media (min-width: 1025px) { .voprosy { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 48px; align-items: start; }
  .voprosy .faq { max-width: none; } .voprosy .band-head { position: sticky; top: 112px; } }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px; padding: 16px 0; font-weight: 700; font-size: 18px; line-height: 1.35; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--honey-ink); font-size: 24px; line-height: 1; flex: none; transition: transform .25s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 0 16px; color: var(--muted); max-width: 64ch; }
.faq details p + p { margin-top: -8px; }

/* Подвал */
.foot { position: relative; overflow: hidden; margin-top: 80px; background: var(--hero); color: var(--hero-muted); font-size: 15px; }
.foot > .wrap { position: relative; }
.foot .cols { display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(0, 1fr)) minmax(0, 1.5fr); gap: 28px; padding-block: 40px 28px; }
.foot .marka { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.foot .marka .name { display: grid; font-size: 13px; line-height: 1.2; letter-spacing: .02em; }
.foot .marka .name b { font: 600 28px/1.05 var(--display); color: var(--hero-fg); letter-spacing: 0; }
.foot h2 { font-size: 20px; color: var(--hero-fg); margin-bottom: 10px; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.foot a { color: var(--hero-fg); }
.foot p + p { margin-top: 8px; }
.foot .soc { margin-top: 10px; margin-left: -8px; color: var(--hero-fg); }
.foot .fine { border-top: 1px solid rgba(255, 246, 223, .15); padding-block: 16px 24px; font-size: 13px; display: grid; gap: 4px; }
@media (max-width: 860px) { .foot .cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } .foot .cols > :first-child { grid-column: 1 / -1; }
  .foot .mesto { display: none; } }
@media (max-width: 520px) { .foot .cols { grid-template-columns: minmax(0, 1fr); } }

/* Просмотр фото крупно — общий для страниц с галереями (site.js) */
.lightbox { position: fixed; inset: 0; z-index: 40; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; gap: 12px; background: rgba(20, 22, 14, .95); color: #fff;
  padding: calc(14px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.lb-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.lb-bar button, .lb-nav button { min-height: 44px; min-width: 44px; background: none; color: #fff; border: 1px solid rgba(255,255,255,.45); border-radius: var(--r); padding: 6px 14px; }
.lb-frame { position: relative; min-height: 0; overflow: hidden; }
.lb-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.lb-cap { text-align: center; color: #E4DFCF; font-size: 15px; }
.lb-nav { display: flex; justify-content: center; gap: 10px; }
@media (prefers-reduced-motion: no-preference) {
  .lightbox:not([hidden]) { animation: lb-in .2s var(--ease); }
  @keyframes lb-in { from { opacity: 0; } }
}
@media (max-width: 1024px) { .soc-top { display: none; } }

/* Карта пунктов выдачи СДЭК (ADR 0103): корзина и заявка на самовывоз */
.karta-punktov { display: grid; gap: 8px; justify-items: start; }
.karta-punktov .hint { margin: 0; font-size: 13px; color: var(--muted); }
.karta-mesto { justify-self: stretch; height: min(420px, 60vh); border: 1px solid var(--line); border-radius: var(--cr); overflow: hidden; background: var(--soft); }
