/* ===========================================================
   Сайт: базовые стили.
   Палитра и все размеры управляются переменными, чтобы редактор
   мог менять оформление без правки этого файла.
   =========================================================== */

:root {
  /* цвета по умолчанию (тёплая палитра из исходной вёрстки) */
  --sage: #6a7b68;
  --gold: #a98b65;
  --rose: #a5736b;
  --ink: #5c564f;
  --nav: #8d6e63;
  --btn: #de9c8a;
  --btn-hover: #d58b78;
  --line: #c3b4a6;
  --surface: rgba(255, 252, 248, 0.42);
  --surface-line: rgba(255, 255, 255, 0.62);
  --shadow: 0 14px 36px rgba(110, 90, 80, 0.04);

  /* оформление кнопки */
  --btn-radius: 12px;

  /* размер кадра фото и его форма */
  --photo-size: 352px;
  --photo-radius: 50%;
  --photo-ring: 8px;
  --photo-ring-color: rgba(255, 252, 248, 0.72);
  --photo-aspect: 1;

  /* фон страницы */
  --bg-color: #f6e7dc;
  --bg-image:
    radial-gradient(980px 760px at -6% 0%, rgba(146, 186, 178, 0.92), transparent 56%),
    radial-gradient(860px 680px at 108% -4%, rgba(246, 198, 188, 0.94), transparent 50%),
    radial-gradient(720px 520px at 46% 24%, rgba(255, 242, 230, 0.92), transparent 62%),
    radial-gradient(980px 680px at -8% 108%, rgba(104, 162, 156, 0.48), transparent 54%),
    radial-gradient(900px 600px at 108% 108%, rgba(242, 188, 176, 0.78), transparent 50%),
    linear-gradient(108deg, #b4d0c8 0%, #e3ddd2 26%, #f8efe6 48%, #f8ddd4 74%, #f3c8be 100%);
}

/* палитры: редактор переключает data-palette у body */
html[data-palette="mint"] {
  --sage: #5f7f74;
  --gold: #9d8a63;
  --rose: #a2736c;
  --ink: #4f5a55;
  --nav: #6f7f7a;
  --btn: #7fb3a3;
  --btn-hover: #6ea493;
  --line: #b9c4b8;
  --bg-color: #eaf2ec;
  --bg-image:
    radial-gradient(900px 700px at -4% 0%, rgba(178, 212, 198, 0.9), transparent 58%),
    radial-gradient(820px 640px at 106% -2%, rgba(214, 231, 219, 0.95), transparent 52%),
    radial-gradient(700px 520px at 48% 26%, rgba(250, 248, 234, 0.9), transparent 62%),
    radial-gradient(900px 660px at -6% 106%, rgba(150, 192, 176, 0.45), transparent 55%),
    radial-gradient(860px 600px at 108% 108%, rgba(200, 226, 214, 0.8), transparent 50%),
    linear-gradient(108deg, #cfe3d8 0%, #e6ece3 30%, #f7f5ec 50%, #eaf1e9 74%, #dce9e1 100%);
}

html[data-palette="sand"] {
  --sage: #77785f;
  --gold: #a89068;
  --rose: #ab7f6e;
  --ink: #5b544a;
  --nav: #8a7869;
  --btn: #d9a17f;
  --btn-hover: #cd9370;
  --line: #cdbfae;
  --bg-color: #f4ece1;
  --bg-image:
    radial-gradient(940px 720px at -6% 0%, rgba(214, 200, 178, 0.9), transparent 56%),
    radial-gradient(880px 660px at 108% -4%, rgba(238, 220, 200, 0.95), transparent 50%),
    radial-gradient(720px 520px at 46% 24%, rgba(255, 248, 239, 0.92), transparent 62%),
    radial-gradient(960px 680px at -8% 108%, rgba(196, 178, 152, 0.45), transparent 54%),
    radial-gradient(880px 600px at 108% 108%, rgba(236, 214, 192, 0.78), transparent 50%),
    linear-gradient(108deg, #e3d8c6 0%, #eee5d8 30%, #faf3e9 52%, #f1e2d2 76%, #e8d3c3 100%);
}

html[data-palette="blush"] {
  --sage: #6f7a68;
  --gold: #ab8a68;
  --rose: #a86a68;
  --ink: #5d5150;
  --nav: #8b6563;
  --btn: #e2918d;
  --btn-hover: #d6807c;
  --line: #d0b6b0;
  --bg-color: #f9e6e4;
  --bg-image:
    radial-gradient(960px 740px at -6% 0%, rgba(246, 210, 208, 0.94), transparent 56%),
    radial-gradient(860px 680px at 108% -4%, rgba(250, 222, 214, 0.94), transparent 50%),
    radial-gradient(720px 520px at 46% 24%, rgba(255, 246, 240, 0.92), transparent 62%),
    radial-gradient(980px 680px at -8% 108%, rgba(232, 186, 182, 0.5), transparent 54%),
    radial-gradient(900px 600px at 108% 108%, rgba(248, 200, 194, 0.8), transparent 50%),
    linear-gradient(108deg, #f5d8d4 0%, #f0ded8 28%, #fdf3ec 50%, #f8d9d3 74%, #f2c8c3 100%);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }
body { overflow-x: hidden; }

/*
  Фон живёт на html: тогда он закрывает и «резинку» прокрутки, и место под
  вырезом камеры и полосой жестов, а не оставляет серые полосы браузера.
*/
html {
  min-height: 100%;
  background-color: var(--bg-color);
  background-image: var(--bg-image);
  background-attachment: fixed;
  background-repeat: no-repeat;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  /* svh — высота без панелей браузера: не даёт лишней прокрутки на телефоне */
  min-height: 100vh;
  min-height: 100svh;
  color: var(--ink);
  font-family: "Outfit", "Segoe UI", sans-serif;
  font-weight: 300;
  background: none;
  -webkit-tap-highlight-color: rgba(197, 141, 122, 0.15);
}

.page {
  width: min(1040px, calc(100% - 40px));
  margin: 0 auto;
  padding: 26px 0 28px;
  padding-top: calc(26px + env(safe-area-inset-top, 0px));
  padding-bottom: 28px;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

/* ----------------------------------------------------------- шапка */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-decoration: none;
  color: #667568;
  min-width: 168px;
}

.brand svg {
  width: 34px;
  height: 32px;
  margin-bottom: 2px;
}

.brand-name {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  line-height: 1.1;
}

.brand-role {
  margin-top: 4px;
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #8d978c;
}

.nav {
  display: flex;
  align-items: center;
  gap: 30px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav a {
  position: relative;
  display: inline-block;
  color: var(--nav);
  text-decoration: none;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 6px 0 8px;
}

.nav a.active { color: #6d534a; }

.nav a.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 28px;
  height: 1.5px;
  transform: translateX(-50%);
  background: #c9b59a;
}

.nav a:hover { color: #6d534a; }

/* ----------------------------------------------------------- главный экран */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  column-gap: 28px;
  margin-top: 42px;
}

.hero[data-side="left"] .hero-copy { order: 2; }
.hero[data-side="left"] .portrait { order: 1; }
.hero[data-side="none"] { grid-template-columns: minmax(0, 1fr); }

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  max-width: 100%;
  padding-top: 18px;
  container-type: inline-size;
}

h1 {
  margin: 0;
  align-self: stretch;
  max-width: 100%;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  font-size: clamp(34px, 8vw, 96px);
  line-height: 1.02;
  letter-spacing: -0.02em;
}

@supports (font-size: 1cqi) {
  h1 { font-size: clamp(34px, 13cqi, 96px); }
}

h1 .line {
  display: block;
  overflow-wrap: break-word;
}
h1 .sage { color: var(--sage); }
h1 .gold { color: var(--gold); }
h1 .rose { color: var(--rose); }

.hero[data-align="left"] .hero-copy { align-items: flex-start; }
.hero[data-align="left"] h1 { text-align: left; }
.hero[data-align="left"] .hero-bottom { text-align: left; }
.hero[data-align="left"] .rule { margin-left: 0; }
.hero[data-align="left"] .lede { margin-left: 0; text-align: left; }

.hero-bottom {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-top: 22px;
  text-align: center;
}

.rule {
  width: 74px;
  height: 1px;
  margin: 0 auto 22px;
  background: var(--line);
}

.lede {
  margin: 0 auto;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  font-size: clamp(17px, 1.7vw, 20px);
  line-height: 1.55;
  color: #5e584f;
  text-align: center;
  white-space: pre-line;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 26px;
  padding: 16px 32px;
  border-radius: var(--btn-radius);
  background: var(--btn);
  color: #fffaf7;
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  box-shadow: 0 10px 22px rgba(176, 112, 96, 0.16);
  transition: background 0.2s ease, transform 0.2s ease;
}

.btn:hover { background: var(--btn-hover); }
.btn:active { transform: translateY(1px); }

/* ----------------------------------------------------------- фото */

.portrait {
  width: var(--photo-size, 352px);
  max-width: 100%;
  flex: none;
  margin: 4px 0 0;
  cursor: pointer;
  border: 0;
  background: none;
  padding: 0;
  position: relative;
}

.portrait-ring {
  position: relative;
  aspect-ratio: var(--photo-aspect);
  border-radius: var(--photo-radius);
  padding: var(--photo-ring);
  background: var(--photo-ring-color);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.45),
    0 16px 40px rgba(130, 96, 86, 0.1);
}

.portrait[data-shadow="off"] .portrait-ring {
  box-shadow: none;
}

.portrait.is-over .portrait-ring {
  box-shadow:
    0 0 0 2px rgba(224, 154, 136, 0.7),
    0 16px 40px rgba(130, 96, 86, 0.12);
}

.portrait-inner {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: var(--photo-radius);
  overflow: hidden;
  background: radial-gradient(circle at 50% 38%, #f7f1ea 0%, #eadfd4 72%, #e3d4c6 100%);
}

.portrait img,
.frame-inner img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  display: none;
  max-width: none;
  -webkit-user-drag: none;
  user-select: none;
}

.portrait img.is-on,
.frame-inner img.is-on {
  display: block;
  z-index: 1;
  object-fit: fill;
}

.portrait.is-filled .hint { display: none; }

.hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  color: rgba(138, 118, 104, 0.55);
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: 26px;
  letter-spacing: 0.08em;
  pointer-events: none;
}

/* ----------------------------------------------------------- блоки */

.paths {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-top: 58px;
}

.paths:empty { display: none; }

/* якорь блока не должен прятаться под панелью редактора */
.blk[id], .paths [id] { scroll-margin-top: 76px; }

.blk {
  padding: 42px 36px 36px;
  border-radius: 26px;
  background: var(--surface);
  border: 1px solid var(--surface-line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  min-width: 0;
}

/*
   Блок целиком — ссылка. Подчёркивания быть не должно: это не ссылка в тексте,
   а кликабельная карточка. display: block задаём здесь, чтобы правила раскладок
   (.blk-image, .blk-media, .blk-banner) ниже могли переопределить его на flex/grid.
*/
.blk-link,
.blk-link * {
  text-decoration: none;
}

.blk-link {
  display: block;
  color: inherit;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.blk-link:hover { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(110, 90, 80, 0.1); }
.blk-link:focus-visible { outline: 2px solid #c48478; outline-offset: 3px; }

.card-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 26px;
  min-width: 0;
}

.card-head > div { min-width: 0; }

.blk-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  color: inherit;
}

.blk .blk-icon svg {
  width: 52px;
  height: 52px;
}

.blk h2 {
  margin: 0;
  font-family: "Outfit", sans-serif;
  font-weight: 400;
  font-size: 13px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  overflow-wrap: break-word;
}

.card-rule {
  display: block;
  width: 36px;
  height: 1px;
  margin: 8px auto 0;
}

.card p,
.blk-body {
  max-width: 32em;
  margin: 0 auto;
  text-align: center;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  font-size: 18px;
  line-height: 1.45;
  white-space: pre-line;
}

.card.sage { color: #748674; }
.card.sage .card-rule { background: #9aab98; }
.card.rose { color: #c08e86; }
.card.rose .card-rule { background: #d4aea6; }

/* широкий текстовый блок */
.blk-text { grid-column: 1 / -1; text-align: center; }
.blk-text h2 { margin-bottom: 14px; }
.blk-text .blk-body { font-size: clamp(18px, 2vw, 22px); }

/* цитата */
.blk-quote { grid-column: 1 / -1; text-align: center; padding: 48px 40px; }
.blk-quote blockquote {
  margin: 0 auto;
  max-width: 30em;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(22px, 2.6vw, 30px);
  line-height: 1.4;
  color: var(--sage);
  white-space: pre-line;
}
.blk-quote cite {
  display: block;
  margin-top: 18px;
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8d7b72;
}

/* картинка */
.blk-image {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 30px;
}
.blk-image .frame {
  width: min(100%, 420px);
  aspect-ratio: var(--photo-aspect, 1);
  border-radius: var(--photo-radius, 16px);
  padding: var(--photo-ring, 0);
  background: var(--photo-ring-color, transparent);
  position: relative;
}
.blk-image .frame-inner {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: var(--photo-radius, 16px);
  overflow: hidden;
  background: #ede2d8;
}
.blk-image figcaption {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #8d7b72;
}

/* ----------------------------------------------------------- картинка + текст */

.blk-media {
  grid-column: 1 / -1;
  display: grid;
  gap: 24px;
  align-items: center;
  padding: 28px;
}

.blk-media[data-layout="media-left"] { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); }
.blk-media[data-layout="media-right"] { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); }
.blk-media[data-layout="media-right"] .blk-pic { order: 2; }
.blk-media[data-layout="media-top"] { grid-template-columns: minmax(0, 1fr); text-align: center; }

.blk-pic {
  position: relative;
  aspect-ratio: var(--blk-aspect, 1.25);
  border-radius: var(--blk-radius, 16px);
  overflow: hidden;
  background: rgba(233, 221, 210, 0.55);
  min-width: 0;
}

.blk-pic img { display: block; width: 100%; height: 100%; object-fit: cover; }

.blk-pic-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-style: italic;
  font-size: 20px;
  letter-spacing: 0.08em;
  color: rgba(138, 118, 104, 0.6);
}

.blk-media .blk-copy h2 { text-align: left; margin-bottom: 10px; }
.blk-media .blk-body { text-align: left; margin: 0; max-width: none; }
.blk-media[data-layout="media-top"] .blk-copy h2,
.blk-media[data-layout="media-top"] .blk-body { text-align: center; }
.blk-media[data-layout="media-top"] .blk-pic { width: 100%; max-width: 620px; margin: 0 auto; }

/* ----------------------------------------------------------- баннер */

.blk-banner {
  grid-column: 1 / -1;
  position: relative;
  min-height: 280px;
  display: flex;
  align-items: flex-end;
  padding: 30px;
  border-radius: 26px;
  overflow: hidden;
  background-color: rgba(233, 221, 210, 0.65);
  background-size: cover;
  background-position: center;
  color: #fffdfa;
}

.blk-banner::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(56, 42, 35, 0) 0%, rgba(56, 42, 35, 0.55) 100%);
}

.blk-banner .blk-banner-inner { position: relative; z-index: 1; width: 100%; }

.blk-banner h2 {
  margin-bottom: 8px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 500;
  font-size: clamp(22px, 2.6vw, 34px);
  line-height: 1.15;
  letter-spacing: 0;
  text-transform: none;
  text-align: left;
  color: #fffdfa;
}

.blk-banner .blk-body {
  margin: 0;
  max-width: 42em;
  text-align: left;
  font-size: clamp(16px, 1.6vw, 19px);
  color: rgba(255, 253, 250, 0.94);
}

.blk-banner.is-plain { color: var(--ink); }
.blk-banner.is-plain::before { display: none; }
.blk-banner.is-plain h2 { color: var(--sage); }
.blk-banner.is-plain .blk-body { color: var(--ink); }

/* ----------------------------------------------------------- раскладка внутри блока */

/* карточка: иконка сверху, по центру */
.card[data-inner="center"] .card-head { flex-direction: column; gap: 12px; margin-bottom: 20px; }
.card[data-inner="center"] .card-head > div { text-align: center; }
.card[data-inner="center"] .card-rule { margin-left: auto; margin-right: auto; }

/* карточка: иконка сверху, по левому краю */
.card[data-inner="left"] .card-head { justify-content: flex-start; }
.card[data-inner="left"] h2,
.card[data-inner="left"] p { text-align: left; }
.card[data-inner="left"] .card-rule { margin-left: 0; margin-right: auto; }
.card[data-inner="left"] p { margin-left: 0; }

/* карточка: иконка слева, текст справа */
.card[data-inner="row"] { padding: 32px 30px; }
.card[data-inner="row"] .card-row { display: flex; gap: 18px; align-items: flex-start; }
.card[data-inner="row"] .card-row .blk-icon { margin-top: 2px; }
.card[data-inner="row"] .card-copy { min-width: 0; text-align: left; }
.card[data-inner="row"] .card-copy h2 { text-align: left; }
.card[data-inner="row"] .card-copy .card-rule { margin: 8px 0 0; }
.card[data-inner="row"] .card-copy p { margin: 12px 0 0; max-width: none; text-align: left; }

/* карточка без иконки */
.card[data-inner="plain"] .card-head { justify-content: center; }

/* карточка: фото + заголовок + текст */
.card[data-inner="photo"] { padding: 24px; }
.card[data-inner="photo"] .card-photo-card { display: flex; gap: 22px; align-items: center; }
.card[data-inner="photo"][data-side="right"] .card-photo-card { flex-direction: row-reverse; }
.card[data-inner="photo"] .card-photo { width: var(--blk-photo-w, 40%); flex: none; min-width: 0; position: relative; }
.card[data-inner="photo"] .card-photo-ring {
  padding: var(--blk-ring, 0);
  background: var(--photo-ring-color);
  border-radius: var(--blk-radius, 16px);
}
.card[data-inner="photo"] .card-photo-inner {
  position: relative;
  width: 100%;
  aspect-ratio: var(--blk-aspect, 1);
  border-radius: var(--blk-radius, 16px);
  overflow: hidden;
  background: #ece2d8;
}
.card[data-inner="photo"] .card-photo-inner img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}
.card[data-inner="photo"] .card-photo-inner img.is-on { display: block; object-fit: fill; }

/* фото-заполнение: тянется по высоте блока */
.card[data-inner="photo"] .card-photo-inner img.is-cover {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* фото от верхней границы блока до нижней */
.card[data-inner="photo"][data-photo-full="true"] {
  display: grid;
  /* ширина фото — это ширина колонки сетки: работает при любом значении */
  grid-template-columns: var(--blk-photo-w, 40%) minmax(0, 1fr);
  align-items: stretch;
  min-height: 180px;
  padding: 0;
  overflow: hidden;
}

.card[data-inner="photo"][data-photo-full="true"][data-side="right"] {
  grid-template-columns: minmax(0, 1fr) var(--blk-photo-w, 40%);
}

/* обёртка больше не нужна: фото и текст — ячейки сетки */
.card[data-inner="photo"][data-photo-full="true"] .card-photo-card { display: contents; }

.card[data-inner="photo"][data-photo-full="true"] .card-photo {
  grid-row: 1 / -1;
  width: 100%;
  align-self: stretch;
  position: relative;
}

.card[data-inner="photo"][data-photo-full="true"][data-side="right"] .card-photo { grid-column: 2; }

.card[data-inner="photo"][data-photo-full="true"] .card-photo-ring {
  height: 100%;
  padding: 0;
  background: none;
  border-radius: 0;
}
.card[data-inner="photo"][data-photo-full="true"] .card-photo-inner {
  position: absolute;
  inset: 0;
  height: 100%;
  aspect-ratio: auto;
  border-radius: 0;
}
.card[data-inner="photo"][data-photo-full="true"] .card-photo-copy {
  padding: 30px;
  align-self: center;
  width: 100%;
}
.card[data-inner="photo"][data-photo-full="true"] .card-photo-copy h2 { margin-top: 0; }
.card[data-inner="photo"] .card-photo-copy { flex: 1 1 auto; min-width: 0; text-align: left; }
.card[data-inner="photo"] .card-photo-copy h2 { text-align: left; }
.card[data-inner="photo"] .card-photo-copy .card-rule { margin: 8px 0 0; }
.card[data-inner="photo"] .card-photo-copy p { margin: 12px 0 0; max-width: none; text-align: left; }

/* фото на всю ширину, текст под ним */
.card[data-inner="photo"][data-full="true"] .card-photo-card { flex-direction: column; align-items: stretch; }
.card[data-inner="photo"][data-full="true"] .card-photo { width: 100%; }

/* фото на всю карточку, текст поверх */
.card[data-inner="photo"][data-overlay="true"] {
  position: relative;
  padding: 0;
  min-height: 300px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
}
.card[data-inner="photo"][data-overlay="true"] .card-photo-card {
  position: absolute;
  inset: 0;
  display: grid;
  gap: 0;
}
.card[data-inner="photo"][data-overlay="true"] .card-photo { width: 100%; height: 100%; }
.card[data-inner="photo"][data-overlay="true"] .card-photo-ring {
  height: 100%;
  padding: 0;
  background: none;
  border-radius: 0;
}
.card[data-inner="photo"][data-overlay="true"] .card-photo-inner {
  position: absolute;
  inset: 0;
  aspect-ratio: auto;
  border-radius: 0;
}
.card[data-inner="photo"][data-overlay="true"] .card-photo-copy {
  grid-area: 1 / 1;
  align-self: end;
  z-index: 1;
  width: 100%;
  padding: 30px;
  background: linear-gradient(180deg, rgba(56, 42, 35, 0) 0%, rgba(56, 42, 35, 0.62) 100%);
}
.card[data-inner="photo"][data-overlay="true"] .card-photo-copy h2,
.card[data-inner="photo"][data-overlay="true"] .card-photo-copy p { color: #fffdfa; }
.card[data-inner="photo"][data-overlay="true"] .card-photo-copy .card-rule { background: rgba(255, 255, 255, 0.65); }

/* выравнивание в остальных видах */
.blk-text.is-left h2,
.blk-text.is-left .blk-body { text-align: left; }
.blk-quote.is-left { text-align: left; }
.blk-quote.is-left blockquote { margin-left: 0; }
.blk-image.is-left { align-items: flex-start; }
.blk-image.is-left figcaption { text-align: left; }
.blk-media.is-center .blk-copy h2,
.blk-media.is-center .blk-body { text-align: center; }
.blk-banner.is-center h2,
.blk-banner.is-center .blk-body { text-align: center; }
.blk-banner.is-center .blk-body { margin-left: auto; margin-right: auto; }

/* ----------------------------------------------------------- кнопка */

.blk.blk-button {
  grid-column: 1 / -1;
  display: flex;
  padding: 10px 0;
  background: none;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  backdrop-filter: none;
}

.blk-button[data-align="left"] { justify-content: flex-start; }
.blk-button[data-align="center"] { justify-content: center; }
.blk-button[data-align="right"] { justify-content: flex-end; }

.blk-button .btn-el {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 32px;
  border-radius: var(--btn-radius-block, 12px);
  background: var(--btn-bg, #de9c8a);
  color: var(--btn-color, #fffaf7);
  font-family: "Outfit", "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 10px 22px rgba(176, 112, 96, 0.16);
  transition: background 0.2s ease, transform 0.2s ease, filter 0.2s ease;
}

.blk-button .btn-el:hover { transform: translateY(-1px); filter: brightness(0.97); }
.blk-button .btn-el:active { transform: translateY(0); }

/* прозрачная кнопка выглядит как ссылка */
.blk-button[data-btn-style="ghost"] .btn-el {
  background: transparent;
  box-shadow: none;
  padding: 6px 0;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: none;
}

.blk-button[data-btn-style="ghost"] .btn-el:hover { transform: none; filter: none; opacity: 0.78; }

.blk-button[data-underline="true"] .btn-el { text-decoration: underline; text-underline-offset: 4px; }

/* ----------------------------------------------------------- статьи */

.blk.blk-articles {
  grid-column: 1 / -1;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
  border-radius: 0;
  backdrop-filter: none;
}

.art-title { margin: 0 0 22px; font-size: clamp(22px, 2.6vw, 30px); }

.art-list { display: grid; gap: 18px; }
.blk-articles[data-view="grid"] .art-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.blk-articles[data-view="list"] .art-list { grid-template-columns: minmax(0, 1fr); }

.art-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--surface-line);
  border-radius: 20px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.art-card:hover { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(110, 90, 80, 0.1); }

.art-cover { display: block; background: #ece2d8; }
.art-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.blk-articles[data-view="grid"] .art-cover { aspect-ratio: 16 / 10; }
.blk-articles[data-view="list"] .art-card { flex-direction: row; align-items: stretch; }
.blk-articles[data-view="list"] .art-cover { width: 190px; flex: none; }

.art-body { display: flex; flex-direction: column; gap: 7px; padding: 18px 20px; min-width: 0; }
.art-date { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: #a08e84; }
.art-name { font-size: 18px; font-weight: 500; line-height: 1.3; color: var(--ink); }
.art-excerpt { font-size: 14px; line-height: 1.55; color: #7b675d; }
.art-tags { font-size: 12px; color: var(--rose); }
.art-empty { margin: 4px 0 0; color: #a08e84; font-size: 14px; }
.art-archive {
  display: inline-block;
  margin-top: 20px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--rose);
  text-decoration: none;
}

/* компактный вид — строки */
.blk-articles[data-view="compact"] .art-list { display: block; }
.blk-articles[data-view="compact"] .art-card {
  flex-direction: row;
  align-items: baseline;
  gap: 12px;
  padding: 11px 0;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--surface-line);
  border-radius: 0;
  box-shadow: none;
}
.blk-articles[data-view="compact"] .art-card:hover { transform: none; box-shadow: none; color: var(--rose); }
.blk-articles[data-view="compact"] .art-cover,
.blk-articles[data-view="compact"] .art-excerpt { display: none; }
.blk-articles[data-view="compact"] .art-body { flex-direction: row; align-items: baseline; gap: 12px; padding: 0; }

/* ----------------------------------------------------------- подвал */

.site-footer {
  margin-top: 8px;
  padding: 48px 20px 32px;
  /* фон подвала уходит под полосу жестов, текст остаётся выше неё */
  padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px));
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
  border-top: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 250, 246, 0.28);
}

.footer-inner {
  width: min(1040px, 100%);
  margin: 0 auto;
  text-align: center;
}

.footer-title {
  margin: 0;
  font-family: "Outfit", sans-serif;
  font-weight: 400;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--rose);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 36px;
  margin-top: 22px;
}

.footer-links a {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--ink);
  text-decoration: none;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.2;
}

.footer-links a .lbl {
  font-family: "Outfit", sans-serif;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8d7b72;
}

.footer-links a .val { display: block; }

.footer-links a:hover { color: #6d534a; }

/* соцсети в подвале */
.footer-socials {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 26px;
}

.footer-social {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(196, 156, 142, 0.45);
  background: rgba(255, 252, 248, 0.55);
  color: var(--sage);
  transition: transform 0.18s ease, color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.footer-social svg { display: block; width: 21px; height: 21px; }
.footer-social:hover {
  transform: translateY(-2px);
  color: var(--rose);
  border-color: rgba(196, 132, 120, 0.5);
  background: rgba(255, 255, 255, 0.85);
}

.footer-social:focus-visible { outline: 2px solid var(--rose); outline-offset: 3px; }

.footer-name {
  margin: 26px 0 0;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #8d7b72;
}

.footer-edit {
  display: inline-block;
  margin-top: 22px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(141, 123, 114, 0.55);
  text-decoration: none;
}
.footer-edit:hover { color: var(--rose); }

a:focus-visible,
.portrait:focus-visible {
  outline: 2px solid #c48478;
  outline-offset: 4px;
}

/* ===========================================================
   Режим редактора
   =========================================================== */

/* до первой отрисовки контент не показываем: никакой «чужой» версии на экране */
body.rt-booting .page,
body.rt-booting .site-footer { visibility: hidden; }

/* панель редактора занимает высоту вместе с вырезом сверху */
body.is-editing { padding-top: 56px; padding-top: calc(56px + env(safe-area-inset-top, 0px)); }

/* «Просмотр»: правка выключена, но панель редактора на месте */
body.is-preview { padding-top: 56px; padding-top: calc(56px + env(safe-area-inset-top, 0px)); }
body.is-preview #rt-bar { display: flex; }
body.is-preview .rt-photo-badge,
body.is-preview .rt-add,
body.is-preview .rt-actions { display: none !important; }
body.is-preview [data-path] { outline: none !important; cursor: auto; }

body.is-editing [data-path] {
  outline: 1px dashed rgba(31, 168, 188, 0.5);
  outline-offset: 4px;
  border-radius: 4px;
  cursor: text;
  transition: outline-color 0.15s ease, background-color 0.15s ease;
}

body.is-editing [data-path]:hover {
  outline-color: rgba(11, 110, 140, 0.9);
  background-color: rgba(255, 255, 255, 0.28);
}

body.is-editing [data-path]:focus {
  outline: 2px solid #0b6e8c;
  background-color: rgba(255, 255, 255, 0.55);
}

body.is-editing [data-path][contenteditable="true"]:empty::before {
  content: attr(data-empty);
  color: rgba(90, 113, 145, 0.6);
  font-style: italic;
}

/* обёртки пунктов списков: в обычном режиме не занимают места */
.rt-item { display: contents; }

body.is-editing .rt-item {
  display: flex;
  flex-direction: column;
  position: relative;
  min-width: 0;
  flex: 1 1 auto;
}

body.is-editing .rt-item > * { flex: 1 1 auto; }

body.is-editing .rt-item[data-span="2"] { grid-column: 1 / -1; }

/* панель действий у пункта */
.rt-actions {
  display: none;
  position: absolute;
  top: -11px;
  right: -6px;
  z-index: 40;
  gap: 1px;
  padding: 3px;
  border-radius: 10px;
  background: #0b2743;
  box-shadow: 0 8px 18px rgba(7, 30, 54, 0.3);
}

body.is-editing .rt-item:hover > .rt-actions,
body.is-editing .rt-item:focus-within > .rt-actions,
body.is-editing .rt-item.is-selected > .rt-actions {
  display: flex;
}

.rt-actions button {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #eaf4f9;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.rt-actions button:hover { background: rgba(255, 255, 255, 0.16); }
.rt-actions button svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* кнопка «добавить пункт» */
.rt-add {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px dashed rgba(31, 168, 188, 0.55);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.75);
  color: #0b6e8c;
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 11px;
  letter-spacing: 0.06em;
  cursor: pointer;
}

body.is-editing .rt-add { display: inline-flex; }
.rt-add:hover { background: #f1f9fc; border-color: #17889f; }
.rt-add svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.nav .rt-add { padding: 5px 9px; font-size: 10px; order: 99; }
.paths .rt-add { grid-column: 1 / -1; justify-self: center; margin-top: 4px; }
.footer-links .rt-add { align-self: center; }
.hero-bottom .rt-add { margin-top: 18px; }

body.is-editing .portrait { cursor: grab; }
body.is-editing .portrait:active { cursor: grabbing; }
body.is-editing .portrait:hover .portrait-ring {
  box-shadow:
    0 0 0 2px rgba(31, 168, 188, 0.7),
    0 16px 40px rgba(11, 110, 140, 0.14);
}

/* верхняя панель редактора */
#rt-bar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 200;
  display: none;
  align-items: center;
  gap: 10px;
  height: 56px;
  height: calc(56px + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) max(14px, env(safe-area-inset-right, 0px)) 0 max(14px, env(safe-area-inset-left, 0px));
  background: rgba(8, 34, 58, 0.97);
  color: #eaf4f9;
  font-family: "Manrope", "Segoe UI", sans-serif;
  box-shadow: 0 2px 14px rgba(7, 30, 54, 0.35);
}

body.is-editing #rt-bar { display: flex; }

#rt-bar .rt-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

#rt-bar .rt-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4fd1c5;
}
#rt-bar.is-dirty .rt-dot { background: #f0a63c; }
#rt-bar.is-error .rt-dot { background: #e05252; }

#rt-bar .rt-status {
  font-size: 11px;
  color: rgba(234, 244, 249, 0.62);
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#rt-bar .rt-grow { flex: 1 1 auto; }

.rt-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 9px;
  background: transparent;
  color: #eaf4f9;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.rt-btn:hover { background: rgba(255, 255, 255, 0.1); }
.rt-btn[aria-pressed="true"] { background: rgba(255, 255, 255, 0.18); border-color: rgba(255, 255, 255, 0.3); }
.rt-btn.primary { background: #1fa8bc; border-color: #1fa8bc; color: #ffffff; font-weight: 500; }
.rt-btn.primary:hover { background: #2bb3c6; }
.rt-btn.icon { width: 32px; padding: 0; justify-content: center; }
.rt-btn:disabled { opacity: 0.4; cursor: default; }
.rt-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* боковая панель */
#rt-panel {
  position: fixed;
  top: 56px;
  top: calc(56px + env(safe-area-inset-top, 0px));
  right: 0;
  bottom: 0;
  z-index: 190;
  width: min(392px, 100%);
  display: flex;
  flex-direction: column;
  background: #ffffff;
  color: #10273f;
  font-family: "Manrope", "Segoe UI", sans-serif;
  border-left: 1px solid #d9e7f0;
  box-shadow: -24px 0 50px rgba(7, 30, 54, 0.14);
  transform: translateX(104%);
  transition: transform 0.24s ease;
  font-size: 13px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

body.rt-panel-open #rt-panel { transform: none; }

/* на широком экране сдвигаем страницу, чтобы правый край не прятался под панелью */
@media (min-width: 1200px) {
  body.rt-panel-open .page {
    width: min(940px, calc(100vw - 460px));
    margin-left: max(24px, calc((100vw - 1332px) / 2));
    margin-right: 0;
  }
}

#rt-panel .rt-tabs {
  display: flex;
  gap: 2px;
  padding: 10px 12px 0;
  border-bottom: 1px solid #e6f0f5;
  flex: none;
}

#rt-panel .rt-tab {
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px 2px 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: #7f95ae;
  font-family: inherit;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

#rt-panel .rt-tab[aria-selected="true"] { color: #0e2f52; border-bottom-color: #1fa8bc; }

#rt-panel .rt-panes { flex: 1 1 auto; overflow-y: auto; padding: 16px; }

.rt-pane { display: none; }
.rt-pane.is-active { display: block; }

.rt-group { margin-bottom: 22px; }
.rt-group > h3 {
  margin: 0 0 10px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #7f95ae;
}

.rt-field { margin-bottom: 12px; }
.rt-field > label,
.rt-field > .rt-label {
  display: block;
  margin-bottom: 5px;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: #566e8b;
}

.rt-input,
.rt-select,
.rt-textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d9e7f0;
  border-radius: 8px;
  background: #fff;
  color: #10273f;
  font-family: inherit;
  font-size: 13px;
}
.rt-textarea { min-height: 72px; resize: vertical; line-height: 1.45; }
.rt-input:focus,
.rt-select:focus,
.rt-textarea:focus { outline: 2px solid #7fc8d8; outline-offset: 0; border-color: #7fc8d8; }

.rt-color {
  flex: none;
  width: 46px;
  height: 32px;
  padding: 2px;
  border: 1px solid #d9e7f0;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}
.rt-color::-webkit-color-swatch-wrapper { padding: 0; }
.rt-color::-webkit-color-swatch { border: 0; border-radius: 5px; }

.rt-hex {
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: #7f95ae;
  font-variant-numeric: tabular-nums;
}

.rt-hint {
  margin: 6px 0 0;
  font-size: 11px;
  line-height: 1.45;
  color: #7f95ae;
}

.rt-row { display: flex; gap: 8px; align-items: center; }
.rt-row.wrap { flex-wrap: wrap; }
.rt-col { flex: 1 1 0; min-width: 0; }

.rt-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid #d9e7f0;
  border-radius: 8px;
  background: #fff;
  color: #29405c;
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
}
.rt-mini:hover { background: #f1f9fc; border-color: #a8d8e4; }
.rt-mini.danger { color: #b8483f; border-color: #f3d6d6; }
.rt-mini.danger:hover { background: #fdf0f0; }
.rt-mini svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.rt-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid #e6f0f5;
}
.rt-switch:last-child { border-bottom: 0; }
.rt-switch span { font-size: 12.5px; color: #29405c; }

.rt-switch input { position: absolute; opacity: 0; pointer-events: none; }

.rt-switch .rt-toggle {
  position: relative;
  flex: none;
  width: 38px;
  height: 21px;
  border-radius: 999px;
  background: #d9e7f0;
  transition: background 0.18s ease;
  cursor: pointer;
}
.rt-switch .rt-toggle::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(7, 30, 54, 0.25);
  transition: transform 0.18s ease;
}
.rt-switch input:checked + .rt-toggle { background: #1fa8bc; }
.rt-switch input:checked + .rt-toggle::after { transform: translateX(17px); }
.rt-switch input:focus-visible + .rt-toggle { outline: 2px solid #7fc8d8; outline-offset: 2px; }

.rt-range {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 20px;
  background: transparent;
  cursor: pointer;
}
.rt-range::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 2px;
  background: #d9e7f0;
}
.rt-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  margin-top: -6px;
  border-radius: 50%;
  background: #1fa8bc;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(7, 30, 54, 0.28);
}
.rt-range::-moz-range-track { height: 3px; border-radius: 2px; background: #d9e7f0; }
.rt-range::-moz-range-thumb {
  width: 13px; height: 13px; border-radius: 50%;
  background: #1fa8bc; border: 2px solid #fff;
}

.rt-shapes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.rt-shape {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 9px 4px 7px;
  border: 1px solid #d9e7f0;
  border-radius: 10px;
  background: #fff;
  color: #566e8b;
  font-family: inherit;
  font-size: 10px;
  cursor: pointer;
}

.rt-shape[aria-pressed="true"] { border-color: #1fa8bc; box-shadow: 0 0 0 1px #1fa8bc inset; color: #0b6e8c; }
.rt-shape i {
  display: block;
  width: 26px;
  height: 26px;
  background: linear-gradient(160deg, #dbeef6, #a8d8e4);
  border-radius: 50%;
}
.rt-shape i.sq { border-radius: 7px; }
.rt-shape i.rd { border-radius: 4px; }
.rt-shape i.arch { border-radius: 50% 50% 4px 4px / 60% 60% 4px 4px; }
.rt-shape i.blob { border-radius: 62% 38% 55% 45% / 55% 45% 55% 45%; }
.rt-shape i.oval { border-radius: 50%; aspect-ratio: 0.78; width: 21px; }
.rt-shape i.none { border-radius: 1px; }

.rt-icons {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}
.rt-icon-btn {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 1px solid #d9e7f0;
  border-radius: 9px;
  background: #fff;
  color: #566e8b;
  cursor: pointer;
  padding: 4px;
}
.rt-icon-btn svg { width: 22px; height: 22px; }
.rt-icon-btn[aria-pressed="true"] { border-color: #1fa8bc; color: #0b6e8c; box-shadow: 0 0 0 1px #1fa8bc inset; }

.rt-tones { display: flex; gap: 8px; }.rt-tone {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  border: 1px solid #d9e7f0;
  border-radius: 9px;
  background: #fff;
  font-family: inherit;
  font-size: 12px;
  color: #566e8b;
  cursor: pointer;
}
.rt-tone i { width: 12px; height: 12px; border-radius: 50%; background: #dbeef6; }
.rt-tone.rose i { background: #8fdde8; }
.rt-tone[aria-pressed="true"] { border-color: #1fa8bc; box-shadow: 0 0 0 1px #1fa8bc inset; }

/* предпросмотр поисковой выдачи и карточки ссылки */
.rt-preview {
  margin-top: 10px;
  padding: 12px 13px;
  border: 1px solid #d9e7f0;
  border-radius: 11px;
  background: #fff;
  line-height: 1.45;
}
.rt-preview .p-host { font-size: 11.5px; color: #0b6e8c; overflow-wrap: anywhere; }
.rt-preview .p-title { margin: 2px 0 3px; font-size: 15px; line-height: 1.3; color: #1a0dab; }
.rt-preview .p-desc { font-size: 12px; color: #566e8b; }
.rt-preview.messenger { display: flex; gap: 10px; align-items: flex-start; }
.rt-preview .p-img {
  flex: none;
  width: 68px;
  height: 68px;
  border-radius: 8px;
  background: #eaf4f9;
  object-fit: cover;
  display: block;
}
.rt-counter {
  margin: 5px 0 0;
  font-size: 10.5px;
  letter-spacing: 0.03em;
  color: #7f95ae;
  text-align: right;
}
.rt-counter.is-long { color: #b45309; }

.rt-blocks { display: flex; flex-direction: column; gap: 8px; }

/* соцсети: строка «сеть + ссылка» */
.rt-socials { display: flex; flex-direction: column; gap: 8px; }
.rt-social-row { display: flex; align-items: center; gap: 8px; }
.rt-social-row .rt-select { width: 128px; flex: none; }
.rt-social-row .rt-input { flex: 1 1 auto; min-width: 0; }

.rt-block {
  border: 1px solid #d9e7f0;
  border-radius: 11px;
  background: #fff;
  overflow: hidden;
}

.rt-block.is-open { border-color: #a8d8e4; box-shadow: 0 6px 18px rgba(7, 30, 54, 0.08); }

.rt-block-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
}

.rt-block-head .rt-block-title {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 12.5px;
  color: #10273f;
  text-align: left;
  padding: 0;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rt-block-head .rt-block-kind {
  flex: none;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #7f95ae;
  background: #eaf4f9;
  border-radius: 5px;
  padding: 3px 6px;
}

.rt-block-head .rt-block-kind.is-link { background: #e3f2f7; color: #0b6e8c; }

.rt-block-body .rt-group { margin: 12px -10px 0; padding: 10px 10px 0; border-top: 1px solid #e6f0f5; }
.rt-block-body .rt-group > h3 { margin-bottom: 6px; }

.rt-block-body { display: none; padding: 4px 10px 12px; border-top: 1px solid #e6f0f5; }
.rt-block.is-open .rt-block-body { display: block; }

.rt-empty {
  padding: 14px;
  border: 1px dashed #d9e7f0;
  border-radius: 11px;
  text-align: center;
  font-size: 12px;
  color: #7f95ae;
}

/* выбор страницы над вкладками */
.rt-pages-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px 4px;
  border-bottom: 1px solid #e6f0f5;
  flex: none;
}

.rt-page-select { flex: 1 1 auto; font-size: 12px; padding: 6px 8px; }

/* список страниц */
.rt-pages { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }

.rt-page {
  border: 1px solid #d9e7f0;
  border-radius: 11px;
  padding: 10px;
  background: #fff;
}

.rt-page.is-current { border-color: #7fc8d8; box-shadow: 0 0 0 1px #7fc8d8 inset; }

.rt-page-main { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.rt-page-main .rt-input { flex: 1 1 auto; }

.rt-page-link {
  flex: none;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: #7f95ae;
  background: #eaf4f9;
  border-radius: 5px;
  padding: 3px 6px;
  max-width: 42%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rt-page-here { font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: #0b6e8c; }

/* статьи и шаблоны в списке страниц */
.rt-page-kind {
  flex: none;
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0b6e8c;
  background: #e3f2f7;
  border-radius: 5px;
  padding: 3px 6px;
}
.rt-page-kind.is-draft { color: #b8483f; background: #fdecec; }
.rt-page-date { display: block; margin: -2px 0 6px; font-size: 11px; color: #7f95ae; }

.rt-tpl {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  border: 1px solid #d9e7f0;
  border-radius: 10px;
  background: #fff;
  margin-bottom: 8px;
}

.rt-mini.is-on { border-color: #1fa8bc; background: #e3f2f7; color: #0b6e8c; }

/* сворачиваемые группы настроек */
.rt-acc {
  border: 1px solid #d9e7f0;
  border-radius: 11px;
  background: #fff;
  margin-bottom: 8px;
  padding: 0 12px;
}

.rt-acc > summary {
  cursor: pointer;
  list-style: none;
  padding: 11px 0;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #566e8b;
}

.rt-acc > summary::-webkit-details-marker { display: none; }
.rt-acc > summary::before { content: "＋"; margin-right: 7px; font-size: 12px; }
.rt-acc[open] > summary::before { content: "−"; }
.rt-acc[open] > summary { border-bottom: 1px solid #e6f0f5; margin-bottom: 12px; }
.rt-acc-body { padding-bottom: 4px; }

.rt-sub {
  margin: 16px 0 8px;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #7f95ae;
  font-weight: 400;
}

/* галерея блоков */
.rt-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 14px;
}

.rt-gal {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  border: 1px solid #d9e7f0;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.rt-gal:hover { transform: translateY(-1px); border-color: #1fa8bc; }
.rt-gal-pic svg { display: block; width: 100%; height: auto; }
.rt-gal-name { font-size: 11px; color: #29405c; text-align: center; }

@media (max-width: 720px) {
  .rt-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .rt-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.rt-btn.rt-add-block { display: block; width: 100%; margin-top: 12px; }

/* строки меню и контактов */
.rt-menu-row,
.rt-contact-row { display: flex; gap: 6px; margin-bottom: 6px; }
.rt-menu-row .rt-input { flex: 1 1 40%; min-width: 0; }
.rt-contact-row .rt-input { flex: 1 1 33%; min-width: 0; }
.rt-menu-row .rt-mini,
.rt-contact-row .rt-mini { flex: none; }

.rt-filters { gap: 6px; margin-bottom: 10px; }

.rt-anchor {
  flex: none;
  font-size: 9.5px;
  letter-spacing: 0.02em;
  color: #0b6e8c;
  background: #eaf4f9;
  border-radius: 5px;
  padding: 2px 5px;
  max-width: 34%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* выбор ссылки */
.rt-picks { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 14px; }

.rt-pick {
  padding: 6px 10px;
  border: 1px solid #d9e7f0;
  border-radius: 8px;
  background: #fff;
  color: #29405c;
  font-family: inherit;
  font-size: 11.5px;
  cursor: pointer;
  text-align: left;
}

.rt-pick:hover { background: #f1f9fc; border-color: #a8d8e4; }

.rt-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 8px;
  background: #eaf4f9;
  color: #566e8b;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.rt-close:hover { background: #dcecf4; color: #0e2f52; }
.rt-close svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

/* окно входа / сообщений */
#rt-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  background: rgba(7, 30, 54, 0.55);
  backdrop-filter: blur(3px);
  overflow-y: auto;
  overscroll-behavior: contain;
  font-family: "Manrope", "Segoe UI", sans-serif;
}

#rt-modal.is-open { display: flex; }

/* пока открыто окно, страница под ним не прокручивается */
body.rt-modal-open { overflow: hidden; }

.rt-card {
  width: min(420px, 100%);
  margin: auto;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 28px 26px 24px;
  border-radius: 20px;
  background: #ffffff;
  color: #10273f;
  box-shadow: 0 30px 60px rgba(7, 30, 54, 0.35);
}

.rt-card.is-wide { width: min(760px, 100%); padding: 24px 26px 20px; }

.rt-card h2 {
  margin: 0 0 6px;
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-weight: 600;
  font-size: 26px;
  color: #0e2f52;
}

.rt-card p {
  margin: 0 0 18px;
  font-size: 12.5px;
  line-height: 1.55;
  color: #566e8b;
}

.rt-card .rt-field { margin-bottom: 14px; }

.rt-card .rt-actions-row {
  display: flex;
  gap: 8px;
  margin-top: 18px;
}

.rt-card .rt-btn.primary { background: #1fa8bc; border-color: #1fa8bc; color: #ffffff; }
.rt-card .rt-btn.primary:hover { background: #2bb3c6; }
.rt-card .rt-btn { color: #29405c; border-color: #d9e7f0; }
.rt-card .rt-btn:hover { background: #f1f9fc; }

.rt-error {
  margin: 10px 0 0;
  font-size: 12px;
  color: #c0504d;
  min-height: 16px;
}

#rt-toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 20px);
  z-index: 320;
  padding: 10px 18px;
  border-radius: 10px;
  background: rgba(8, 34, 58, 0.94);
  color: #eef6fb;
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: min(520px, calc(100% - 32px));
  text-align: center;
}

#rt-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* значок настроек фото */
.rt-photo-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  display: none;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: rgba(8, 34, 58, 0.9);
  color: #eef6fb;
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
body.is-editing .rt-photo-badge { display: inline-flex; }
.rt-photo-badge svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 1.8; }

/* ----------------------------------------------------------- адаптив */

/* на тач-устройствах fixed-фон в Safari ведёт себя плохо: пусть фон прокручивается */
@media (hover: none), (pointer: coarse) {
  html { background-attachment: scroll; }
}

@media (max-width: 900px) {
  html { background-attachment: scroll; }
  .page {
    width: min(640px, calc(100% - 28px));
    padding-top: 20px;
    padding-top: calc(20px + env(safe-area-inset-top, 0px));
    padding-left: max(0px, env(safe-area-inset-left, 0px));
    padding-right: max(0px, env(safe-area-inset-right, 0px));
  }
  .site-header, .nav, .hero, .hero-copy, h1, .brand { min-width: 0; max-width: 100%; }
  .site-header { flex-direction: column; align-items: center; gap: 16px; }
  .brand-name { font-size: 14px; letter-spacing: 0.12em; }
  .nav {
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 12px;
  }
  .nav a { font-size: 11px; letter-spacing: 0.1em; }
  .hero {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    row-gap: 8px;
    margin-top: 28px;
  }
  .hero[data-side="left"] .hero-copy,
  .hero[data-side="right"] .hero-copy { order: 2; }
  .hero[data-side="left"] .portrait,
  .hero[data-side="right"] .portrait { order: 1; }
  .portrait { width: min(230px, 68vw); margin: 0; }
  .hero-copy { width: 100%; max-width: 100%; padding-top: 8px; align-items: center; }
  h1 { align-self: stretch; width: 100%; text-align: center; }
  .lede br { display: none; }
  .paths { grid-template-columns: minmax(0, 1fr); }
  .blk { padding: 32px 22px 28px; }
  .blk-text, .blk-quote, .blk-image { grid-column: 1 / -1; }
  .card[data-inner="photo"] .card-photo-card { flex-direction: column; align-items: stretch; gap: 16px; }
  .card[data-inner="photo"] .card-photo { width: 100%; }
  .card[data-inner="photo"][data-side="right"] .card-photo-card { flex-direction: column; }
  .card[data-inner="photo"][data-overlay="true"] { min-height: 240px; }
  .card[data-inner="photo"][data-overlay="true"] .card-photo-copy { padding: 22px; }
  /* на телефоне «на всю высоту» превращаем в обычную картинку сверху */
  .card[data-inner="photo"][data-photo-full="true"] { padding: 0 0 22px; grid-template-columns: minmax(0, 1fr); }
  .card[data-inner="photo"][data-photo-full="true"][data-side="right"] { grid-template-columns: minmax(0, 1fr); }
  .card[data-inner="photo"][data-photo-full="true"] .card-photo {
    grid-row: auto;
    grid-column: 1;
    width: 100%;
  }
  .card[data-inner="photo"][data-photo-full="true"] .card-photo-ring { height: auto; }
  .card[data-inner="photo"][data-photo-full="true"] .card-photo-inner {
    position: relative;
    inset: auto;
    height: auto;
    aspect-ratio: 16 / 10;
  }
  .card[data-inner="photo"][data-photo-full="true"] .card-photo-copy { padding: 22px 22px 0; }
  .blk-articles[data-view="grid"] .art-list { grid-template-columns: minmax(0, 1fr); }
  .blk-articles[data-view="list"] .art-cover { width: 120px; }
  .blk-media[data-layout="media-left"],
  .blk-media[data-layout="media-right"],
  .blk-media[data-layout="media-top"] { grid-template-columns: minmax(0, 1fr); }
  .blk-media[data-layout="media-right"] .blk-pic { order: 0; }
  .blk-media { padding: 22px; gap: 18px; }
  .blk-banner { min-height: 220px; padding: 22px; }
  .card-head { min-width: 0; }
  .footer-links {
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }
  .footer-links a { font-size: 20px; overflow-wrap: anywhere; }
  #rt-bar .rt-title span.rt-word { display: none; }
  #rt-bar .rt-status { max-width: 90px; }
  #rt-bar {
    gap: 6px;
    padding-left: max(8px, env(safe-area-inset-left, 0px));
    padding-right: max(8px, env(safe-area-inset-right, 0px));
  }
  .rt-btn { padding: 0 9px; }
  #rt-panel { width: 100%; padding-bottom: env(safe-area-inset-bottom, 0px); }
}

@media (max-width: 460px) {
  #rt-bar .rt-status { display: none; }
  #rt-bar .rt-btn span { display: none; }
  #rt-bar .rt-btn { padding: 0 9px; }
}

.rt-menu-warn { margin: -2px 0 8px; color: #b7791f; }
