/* ============================================================
   Журнал COVERPRESS — список статей и страница статьи.
   Устройство по образцу журналов BrainCam / BOTIX, значения — из брендбука
   (docs/brandbook.md): коралл #FF6B47, Inter, радиусы 16/24/100, шкала
   отступов 4·8·12·16·24·32·48·64, анимации 0.2–0.4s cubic-bezier(0.16,1,0.3,1).
   Классы .jn-* — журнал; прежние .jr-* в main.css оставлены юридическим
   страницам (типографика оферты и политики).
   Файл собирает Coverpress\Services\JournalRenderer.
   ============================================================ */

/* ── список ───────────────────────────────────────────────── */
.jn-wrap { max-width: 1080px; margin: 0 auto; padding: 8px 24px 64px; }
.jn-head { text-align: center; padding: 24px 0; }
.jn-head h1 { font-size: clamp(32px, 5vw, 44px); font-weight: 300; letter-spacing: -0.02em; }
.jn-head p { max-width: 640px; margin: 12px auto 0; color: var(--text-2); font-size: 17px; line-height: 1.5; }

.jn-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 32px; }
.jn-chip { font: inherit; font-size: 13.5px; padding: 8px 16px; border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--bg); color: var(--text-2); cursor: pointer; transition: border-color .2s cubic-bezier(0.16,1,0.3,1), color .2s cubic-bezier(0.16,1,0.3,1), background .2s cubic-bezier(0.16,1,0.3,1); }
.jn-chip:hover { border-color: var(--accent); color: var(--text); }
.jn-chip.is-on { border-color: var(--accent); background: rgba(255,107,71,.08); color: var(--accent); font-weight: 600; }
.jn-chip-count { opacity: .6; font-variant-numeric: tabular-nums; }

.jn-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.jn-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--border); border-radius: var(--r-card); overflow: hidden; text-decoration: none; color: inherit; transition: transform .3s cubic-bezier(0.16,1,0.3,1), box-shadow .3s cubic-bezier(0.16,1,0.3,1); }
.jn-card:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(0,0,0,.09); }
.jn-card[hidden] { display: none; }

.jn-cover { position: relative; aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #fff6f3 0%, #fdeae4 100%); overflow: hidden; }
.jn-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.jn-cover .brand { opacity: .28; font-size: 20px; }
.jn-badges { position: absolute; top: 12px; left: 12px; display: flex; gap: 8px; }
.jn-tag { font-size: 11.5px; font-weight: 600; padding: 4px 12px; border: 1px solid var(--border); border-radius: var(--r-pill); background: #fff; color: var(--text-2); }
.jn-read { position: absolute; top: 12px; right: 12px; font-size: 11.5px; font-weight: 600; padding: 4px 12px; border-radius: var(--r-pill); background: #fff; color: var(--text-3); font-variant-numeric: tabular-nums; }

.jn-cbody { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 16px 20px 20px; }
.jn-ctitle { font-size: 17px; font-weight: 600; line-height: 1.35; color: var(--text); }
.jn-cdesc { font-size: 14px; color: var(--text-2); line-height: 1.55; }
.jn-cmore { margin-top: auto; padding-top: 8px; font-size: 13.5px; font-weight: 600; color: var(--accent); }
.jn-empty { text-align: center; padding: 64px 24px; color: var(--text-3); font-size: 15px; }

/* ── страница статьи ──────────────────────────────────────── */
.jn-article { max-width: 760px; margin: 0 auto; padding: 8px 24px 72px; }
.jn-crumbs { padding-top: 8px; font-size: 13px; color: var(--text-3); }
.jn-crumbs a { color: var(--text-3); text-decoration: none; }
.jn-crumbs a:hover { color: var(--accent); }
.jn-crumbs span { margin: 0 8px; color: #ccc; }

.jn-hero { position: relative; aspect-ratio: 16 / 9; margin: 24px 0 20px; border-radius: var(--r-card-lg); display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #fff6f3 0%, #fdeae4 100%); overflow: hidden; }
.jn-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.jn-hero .brand { opacity: .28; font-size: 30px; }
.jn-hero .jn-badges { top: 16px; left: 16px; }
.jn-hero .jn-read { top: 16px; right: 16px; }

/* подпись под обложкой: чем и какой сценой она сделана */
.jn-credit { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 24px; font-size: 13.5px; line-height: 1.5; color: var(--text-3); }
.jn-credit a { color: var(--text-2); text-decoration: none; border-bottom: 1px solid var(--border); transition: color .2s cubic-bezier(0.16,1,0.3,1), border-color .2s cubic-bezier(0.16,1,0.3,1); }
.jn-credit a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.jn-credit-sep { color: #ccc; }
.jn-credit-toggle { display: inline-flex; align-items: center; gap: 4px; padding: 0; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--accent); background: none; border: none; cursor: pointer; }
.jn-credit-toggle svg { transition: transform .2s cubic-bezier(0.16,1,0.3,1); }
.jn-credit-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

.jn-scene { margin: -12px 0 28px; padding: 20px 24px; background: var(--bg); border: 1px solid var(--border-soft, #f0f0f0); border-radius: var(--r-card); }
.jn-scene[hidden] { display: none; }
.jn-scene-text { margin: 0; font-size: 15.5px; line-height: 1.6; color: var(--text); }
.jn-scene-hint { margin: 12px 0 0; font-size: 14px; line-height: 1.5; color: var(--text-2); }
.jn-scene-link { display: inline-block; margin-top: 12px; font-size: 14px; font-weight: 600; color: var(--accent); text-decoration: none; }
.jn-scene-link:hover { color: var(--accent-hover); }

.jn-article h1 { margin: 0 0 24px; font-size: clamp(28px, 4vw, 40px); font-weight: 300; letter-spacing: -0.02em; line-height: 1.2; }

.jn-tldr { margin-bottom: 24px; padding: 20px 24px; background: var(--bg); border: 1px solid var(--border-soft, #f0f0f0); border-radius: var(--r-card); }
.jn-tldr h4 { margin: 0 0 8px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); }
.jn-tldr p { margin: 0; font-size: 15.5px; line-height: 1.6; color: var(--text); }

.jn-toc { margin: 0 0 32px; }
.jn-toc h4 { margin: 0 0 8px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); }
.jn-toc a { display: block; padding: 8px 0 8px 16px; border-left: 2px solid var(--border); font-size: 15px; line-height: 1.4; color: var(--text-2); text-decoration: none; transition: color .2s cubic-bezier(0.16,1,0.3,1), border-color .2s cubic-bezier(0.16,1,0.3,1); }
.jn-toc a:hover { color: var(--accent); border-left-color: var(--accent); }

.jn-body { font-size: 16.5px; line-height: 1.75; color: var(--text); }
.jn-body h2 { margin: 40px 0 12px; font-size: 25px; font-weight: 500; letter-spacing: -0.01em; scroll-margin-top: 88px; }
.jn-body p { margin: 0 0 16px; }
.jn-body ul { margin: 0 0 16px; padding-left: 24px; }
.jn-body li { margin-bottom: 8px; }
.jn-body a { color: var(--accent); }

.jn-cta { margin-top: 48px; padding: 32px 24px; background: var(--bg); border-radius: var(--r-card-lg); text-align: center; }
.jn-cta p { margin: 0 0 16px; font-size: 16px; color: var(--text-2); }
.jn-cta a { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 32px; border-radius: var(--r-pill); background: var(--accent); color: #fff; font-size: 15px; font-weight: 600; text-decoration: none; transition: background .2s cubic-bezier(0.16,1,0.3,1); }
.jn-cta a:hover { background: var(--accent-hover); }

.jn-related { margin-top: 48px; }
.jn-related h3 { margin: 0 0 16px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); }
.jn-rgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.jn-rc { display: block; padding: 16px 20px; border: 1px solid var(--border); border-radius: var(--r-card); text-decoration: none; color: inherit; transition: border-color .2s cubic-bezier(0.16,1,0.3,1), background .2s cubic-bezier(0.16,1,0.3,1); }
.jn-rc:hover { border-color: var(--accent); background: rgba(255,107,71,.04); }
.jn-rc-title { font-size: 15px; font-weight: 600; line-height: 1.35; }
.jn-rc-hook { margin-top: 4px; font-size: 13.5px; line-height: 1.45; color: var(--text-2); }

.jn-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); }
.jn-foot a, .jn-foot button { font: inherit; font-size: 14px; padding: 9px 16px; border: 1px solid var(--border); border-radius: var(--r-pill); background: none; color: var(--text-2); text-decoration: none; cursor: pointer; transition: border-color .2s cubic-bezier(0.16,1,0.3,1), color .2s cubic-bezier(0.16,1,0.3,1); }
.jn-foot a:hover, .jn-foot button:hover { border-color: var(--text); color: var(--text); }

/* ── адаптив ──────────────────────────────────────────────── */
@media (max-width: 1023px) {
  .jn-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
  .jn-wrap { padding: 8px 16px 88px; }
  .jn-article { padding: 8px 16px 88px; }
  .jn-grid { grid-template-columns: 1fr; gap: 16px; }
  .jn-rgrid { grid-template-columns: 1fr; }
  .jn-hero { border-radius: var(--r-card); }
  .jn-body { font-size: 16px; }
  .jn-body h2 { margin-top: 32px; font-size: 22px; }
  .jn-foot a, .jn-foot button { min-height: 44px; display: inline-flex; align-items: center; }
}

/* ============================================================
   Обложки статей и переключатель демонстрационных стилей.
   ТЗ: docs/tz-stil-jurnala-pereklyuchatel.md. Полка пузырьков —
   канон витрины (assets/css/library.css §«Ряд полки»).
   ============================================================ */
/* обложка поверх плейсхолдера: логотип остаётся под картинкой */
.jn-cover img,
.jn-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.jn-cover img[hidden],
.jn-hero img[hidden] { display: none; }

/* ── переключатель демонстрационных стилей: самостоятельная карточка ── */
.jn-ss {
  margin: 0 0 32px;
  padding: 22px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
}
.jn-ss-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.jn-ss-title { font-size: 15px; font-weight: 600; color: var(--text); }
.jn-ss-invite { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text-2); }

/* полка: одна строка, лишние пузырьки уходят вбок и докручиваются */
.jn-ss-nav { position: relative; }
.jn-ss-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}
.jn-ss-list::-webkit-scrollbar { display: none; }
.jn-ss-btn {
  flex: 0 0 auto;
  scroll-snap-align: start;
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  padding: 9px 18px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--bg);
  color: var(--text-2);
  cursor: pointer;
  transition: border-color .2s cubic-bezier(0.16,1,0.3,1), color .2s cubic-bezier(0.16,1,0.3,1), background .2s cubic-bezier(0.16,1,0.3,1);
}
.jn-ss-btn:hover { border-color: var(--accent); color: var(--text); }
.jn-ss-btn.is-on { border-color: var(--accent); background: var(--accent); color: #fff; font-weight: 600; }

/* стрелки полки — как на витрине: только на указательных устройствах, гаснут на краях */
.jn-ss-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
  transition: background .2s cubic-bezier(0.16,1,0.3,1), opacity .2s cubic-bezier(0.16,1,0.3,1);
}
.jn-ss-arrow-prev { left: -12px; }
.jn-ss-arrow-next { right: -12px; }
.jn-ss-arrow:hover { background: #fff; }
.jn-ss-arrow[disabled] { opacity: 0; pointer-events: none; }
@media (hover: hover) and (min-width: 1000px) {
  .jn-ss-nav:hover .jn-ss-arrow { display: inline-flex; }
}

/* на странице статьи — та же карточка, плотнее */
.jn-ss--compact { margin: 16px 0 24px; padding: 16px 18px; }
.jn-ss--compact .jn-ss-head { margin-bottom: 12px; }
.jn-ss--compact .jn-ss-invite { font-size: 13.5px; }

@media (max-width: 767px) {
  .jn-ss { margin-bottom: 24px; padding: 18px 16px; }
  .jn-ss-invite { font-size: 13.5px; }
  .jn-ss-btn { min-height: 40px; }
  /* полка уходит под край экрана — видно, что строка продолжается */
  .jn-ss-list { margin-right: -16px; padding-right: 16px; }
}

/* Смартфон в альбоме: экран низкий. Блок ужимаем и поднимаем шапку журнала —
   иначе полка при заходе попадает под нижнюю панель (она fixed, см.
   assets/css/mobile-bar.css), и пузырьки нечем листать без прокрутки. */
@media (max-height: 500px) and (max-width: 900px) {
  .jn-head { padding: 10px 0 6px; }
  .jn-head h1 { font-size: 26px; }
  .jn-head p { margin-top: 6px; font-size: 14px; }
  .jn-crumbs { padding-top: 4px; }
  .jn-ss { padding: 12px 16px; margin-bottom: 16px; }
  .jn-ss--compact { margin: 10px 0 16px; }
  .jn-ss-head { margin-bottom: 8px; gap: 8px; }
  .jn-ss-title { font-size: 14px; }
  .jn-ss-invite { font-size: 12.5px; line-height: 1.4; }
  .jn-ss-btn { min-height: 36px; padding: 7px 14px; font-size: 13px; }
}
