:root {
  --bg: #0b1220;
  --page-edge: #060a13;
  --surface: #121b2e;
  --surface-2: #182642;
  --border: #263352;
  --text: #eef2fa;
  --text-dim: #90a0bf;
  --text-faint: #57648a;
  --accent: #45e2ac;
  --accent-soft: #45e2ac1f;
  --accent-strong: #0c2a22;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--page-edge);
  color: var(--text);
  font-family: 'IBM Plex Sans', -apple-system, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
}

.site {
  max-width: 720px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(120deg, #0c1526 0%, #101b30 55%, #0e1a2c 100%);
}

.wordmark { display: flex; flex-direction: column; gap: 2px; }
.wordmark-main { font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 17px; letter-spacing: 0.02em; display: flex; align-items: center; gap: 8px; }
.wordmark .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px 2px var(--accent-soft); }
.wordmark-sub { font-family: 'IBM Plex Sans', sans-serif; font-size: 11px; color: var(--text-dim); letter-spacing: 0.03em; }

.gauge-pill { display: flex; align-items: center; gap: 9px; background: var(--accent-soft); border: 1px solid #45e2ac35; border-radius: 999px; padding: 6px 14px 6px 8px; }
.ring { width: 22px; height: 22px; border-radius: 50%; background: conic-gradient(var(--accent) 0deg 250deg, #45e2ac25 250deg 360deg); flex-shrink: 0; }
.gauge-pill .label { font-size: 11.5px; color: var(--text-dim); line-height: 1.2; }
.gauge-pill .time { font-family: 'IBM Plex Mono', monospace; font-weight: 600; font-size: 14px; color: var(--accent); font-variant-numeric: tabular-nums; line-height: 1.2; }

.paid-badge { display: flex; align-items: center; gap: 8px; background: var(--accent-soft); border: 1px solid #45e2ac40; color: var(--accent); border-radius: 999px; padding: 7px 16px; font-size: 12px; font-family: 'IBM Plex Mono', monospace; }
.paid-badge .dot2 { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

.crumb-row { display: flex; gap: 8px; padding: 14px 22px 0; flex-wrap: wrap; }
.crumb-btn { font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; color: var(--text-dim); background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px; padding: 7px 12px; cursor: pointer; display: inline-block; }
.crumb-btn:hover { color: var(--text); border-color: #45e2ac40; }

.content-pad { padding: 22px; flex: 1; }

.hero { padding: 6px 0 22px; }
.hero .kicker { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.hero h2 { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 28px; margin: 0 0 10px; letter-spacing: 0.01em; }
.hero p { color: var(--text-dim); line-height: 1.5; margin: 0; }
.hero-note { color: var(--text-dim); line-height: 1.5; margin: 0 0 16px; }

.tile-grid { min-height: 96px; margin-bottom: 16px; }
.tile { min-height: 96px; display: flex; align-items: center; justify-content: center; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 18px; cursor: pointer; transition: border-color 0.15s ease, transform 0.15s ease; text-align: center; }
.tile:hover { border-color: #45e2ac55; transform: translateY(-1px); }
.tile .tile-title { font-family: 'Oswald', sans-serif; font-weight: 500; font-size: 18px; letter-spacing: 0.01em; white-space: nowrap; }
.tile.pdf-tile { border-color: #45e2ac45; background: linear-gradient(135deg, #0f2a22, #14213a); }

.tile-big { display: flex; align-items: center; justify-content: center; min-height: 72px; margin: 0 0 12px; background: var(--accent-soft); border: 1px solid #45e2ac55; border-radius: 14px; padding: 22px; text-align: center; }
.tile-big .tile-title { font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 23px; white-space: nowrap; }
.tile-big:hover { border-color: var(--accent); }

.hero-cover { width: 100%; height: auto; max-height: none; object-fit: contain; border-radius: 14px; border: 1px solid var(--border); margin: 10px 0 16px; display: block; }

.section-label { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); margin: 6px 0 14px; }
.section-grid { margin: 0 0 16px; }
.section-card { min-height: 64px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 14px 15px; cursor: pointer; display: flex; align-items: center; justify-content: center; text-align: center; }
.section-card:hover { border-color: #45e2ac45; }
.section-card .sc-title { font-size: 15.5px; font-weight: 500; line-height: 1.35; }

/* Универсальные ряды кнопок: контейнер — flex-wrap, ширина каждой кнопки задаётся
   инлайн через row_widths() в шаблоне (3 в ряд, 4 -> 2х2, остаток последнего ряда — во всю ширину). */
.btn-flex { display: flex; flex-wrap: wrap; }
.section-grid.btn-flex, .tile-grid.btn-flex { gap: 12px; }
.btn-flex > * { flex-basis: var(--wm); }
@media (min-width: 561px) {
  .btn-flex > * { flex-basis: var(--wd); }
}

.article { max-width: none; }
.article h1 { font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 24px; margin: 0 0 16px; }
.article h3, .article h4 { font-family: 'Oswald', sans-serif; font-weight: 600; margin: 22px 0 10px; }
.article h3 { font-size: 18px; }
.article h4 { font-size: 15px; color: var(--text-dim); }
.article p { line-height: 1.6; margin: 0 0 12px; color: var(--text); }
.article ul { margin: 0 0 12px; padding-left: 20px; line-height: 1.6; }
.article strong { color: var(--accent); font-weight: 600; }
.article-wrap { position: relative; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 0 0 16px; }
.photo-grid-one { grid-template-columns: 1fr; }
.photo-frame { display: block; background: var(--surface); border-radius: 10px; border: 1px solid var(--border); overflow: hidden; height: 180px; }
.photo-frame img { width: 100%; height: 100%; object-fit: cover; object-position: center; display: block; }
.photo-grid-one .photo-frame { height: 320px; }

/* Одна вертикальная фотография, показана целиком, без обрезки — идут друг за другом сплошным столбцом. */
.photo-grid.layout-vertical { grid-template-columns: 1fr; }
.photo-grid.layout-vertical .photo-frame { height: auto; background: var(--bg); }
.photo-grid.layout-vertical .photo-frame img { height: auto; object-fit: contain; }

/* Квадратная рамка, фото видно целиком (letterbox), не обрезается. */
.photo-grid.layout-square-one .photo-frame,
.photo-grid.layout-square-grid .photo-frame,
.photo-grid.layout-grid-2col-square .photo-frame { height: auto; aspect-ratio: 1 / 1; background: var(--bg); }
.photo-grid.layout-square-one .photo-frame img,
.photo-grid.layout-square-grid .photo-frame img,
.photo-grid.layout-grid-2col-square .photo-frame img { object-fit: contain; }
.photo-grid.layout-square-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.photo-grid.layout-grid-2col-square { grid-template-columns: repeat(2, 1fr); }

/* Белый фон под фото одежды/примеров — карточки выглядят одинаково, без тёмных полей вокруг предметной съёмки. */
.photo-grid.bg-white .photo-frame { background: #fff; }

/* Обычная 2-колоночная раскладка (без letterbox), крупнее карточки. */
.photo-grid.layout-grid-2col { grid-template-columns: repeat(2, 1fr); }
.photo-grid.layout-grid-2col .photo-frame { height: 220px; }

/* Во всю ширину страницы, одинаковый размер, друг под другом. */
.photo-grid.layout-full { grid-template-columns: 1fr; }
.photo-grid.layout-full .photo-frame { height: auto; aspect-ratio: 1 / 1; }

/* 2 небольших фото в один ряд. */
.photo-grid.layout-row-2-small { grid-template-columns: repeat(2, 1fr); max-width: 340px; }
.photo-grid.layout-row-2-small .photo-frame { height: auto; aspect-ratio: 1 / 1; }

/* Небольшие фото под текстом, по 2 в ряд. */
.photo-grid.layout-small-2col { grid-template-columns: repeat(2, 1fr); margin: 16px 0 0; }
.photo-grid.layout-small-2col .photo-frame { height: auto; aspect-ratio: 3 / 4; }
.photo-grid.layout-small-2col .photo-frame img { object-fit: contain; }

/* Точечная поправка кадрирования: фото подвесного моста — мост виден внизу кадра. */
.article[data-node="sights_nontouristy"] .photo-frame:nth-child(3) img { object-position: bottom; }

/* Точечные мобильные правки: скрыть лишние/повторяющиеся фото, чтобы оставшиеся легли в один ряд. */
@media (max-width: 560px) {
  .article[data-node="sights_lenin"] .photo-frame:nth-child(3) { display: none; }
  .article[data-node="sights_spas"] .photo-frame:nth-child(2) { display: none; }
  .article[data-node="sights_spas"] .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .article[data-node="nightlife"] .photo-frame:nth-child(2) { display: none; }
  .article[data-node="sights_semenovskoe"] .photo-grid.layout-full { grid-template-columns: repeat(2, 1fr); }
  .article[data-node="sights_semenovskoe"] .photo-grid.layout-full .photo-frame { aspect-ratio: 1 / 1; }
}

.link-row { gap: 12px; margin: 4px 0 20px; }
.link-btn { min-height: 64px; display: flex; align-items: center; justify-content: center; text-align: center; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); border-radius: 10px; padding: 14px 15px; font-size: 15.5px; font-weight: 500; font-family: 'IBM Plex Sans', sans-serif; line-height: 1.35; }
.link-btn:hover { border-color: #45e2ac45; }

.paywall-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; background: linear-gradient(180deg, rgba(11,18,32,0.25), rgba(11,18,32,0.95) 38%); backdrop-filter: blur(3px); }
.paywall-card { width: 100%; max-width: 340px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 26px 22px; text-align: center; box-shadow: 0 20px 50px -16px rgba(0,0,0,0.7); }
.paywall-card .icon { width: 40px; height: 40px; margin: 0 auto 14px; border-radius: 10px; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; color: var(--accent); font-size: 18px; }
.paywall-card h3 { font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 18px; margin: 0 0 8px; }
.paywall-card p { margin: 0 0 18px; font-size: 12.5px; color: var(--text-dim); line-height: 1.5; }
.article-blurred { filter: blur(5px); pointer-events: none; user-select: none; max-height: 420px; overflow: hidden; }

.cta { display: block; width: 100%; background: var(--accent); color: #06231a; border: none; border-radius: 9px; padding: 13px 16px; font-family: 'IBM Plex Sans', sans-serif; font-weight: 600; font-size: 14.5px; cursor: pointer; text-align: center; }
.cta:hover { filter: brightness(1.05); }
.ghost-link { display: block; margin-top: 12px; font-size: 12.5px; color: var(--text-dim); cursor: pointer; }
.ghost-link:hover { color: var(--text); }

.about-wrap, .sub-wrap { max-width: 620px; }
.about-wrap h1 { font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 22px; margin: 0 0 14px; }
.about-wrap p { line-height: 1.6; margin: 0 0 12px; }
.about-wrap strong { color: var(--accent); }

.sub-card { max-width: 380px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 26px; }
.sub-card .intro-html p { line-height: 1.6; margin: 0 0 14px; color: var(--text-dim); font-size: 13px; }
.sub-card .price { font-family: 'IBM Plex Mono', monospace; font-weight: 600; font-size: 32px; margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.sub-card .price-note { font-size: 12px; color: var(--text-dim); margin-bottom: 20px; }
.promo-row { display: flex; gap: 8px; margin-top: 16px; }
.promo-input { flex: 1; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-family: 'IBM Plex Mono', monospace; font-size: 13px; color: var(--text); }
.promo-btn { background: var(--surface); border: 1px solid var(--border); color: var(--text-dim); border-radius: 8px; padding: 0 16px; font-size: 12.5px; font-family: 'IBM Plex Sans', sans-serif; cursor: pointer; }
.sub-note { font-size: 11.5px; color: var(--text-faint); margin-top: 14px; }
.promo-result { margin-top: 10px; font-size: 12.5px; }
.promo-result.ok { color: var(--accent); }
.promo-result.error { color: #ff8a8a; }
