/* Страничные стили нового дизайна. Источник: docs/redesign/ds/components.css. Подключается только на своих страницах */
/* ---------- Страница мода ---------- */
.mod-hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, 1fr); gap: 32px; align-items: start; }
.mod-media { position: relative; display: grid; place-items: center; aspect-ratio: 1 / 1; max-height: 78vh; border-radius: var(--r-2xl); overflow: hidden; background: var(--surface-2); box-shadow: var(--shadow-1); }
.mod-media .blur { position: absolute; inset: -30px; background-size: cover; background-position: center; filter: blur(30px) saturate(1.1); opacity: .55; transform: scale(1.1); }
.mod-media img { position: relative; width: 100%; height: 100%; object-fit: contain; }
/* Картинка мода кликабельна: открывает оригинал (Mod.img — полный размер) в просмотрщике */
a.mod-media { cursor: zoom-in; color: inherit; }
a.mod-media:focus-visible { box-shadow: var(--focus-ring); }
.zoom-hint { position: absolute; right: 12px; bottom: 12px; z-index: 1; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: var(--r-pill); background: rgba(24,22,23,.66); color: #fff; font-size: 13px; font-weight: var(--fw-heavy); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); transition: background var(--dur-1), transform var(--dur-2) var(--ease-spring); pointer-events: none; }
.zoom-hint .i { width: 16px; height: 16px; }
a.mod-media:hover .zoom-hint { background: rgba(24,22,23,.85); transform: scale(1.04); }
a.mod-media:hover img { transform: scale(1.015); }
.mod-media img { transition: transform var(--dur-3) var(--ease); }

/* Просмотр оригинала (лайтбокс). Тёмный фон в обеих темах. Закрытие: крестик, Esc, клик по фону.
   Сначала показывается уже загруженный ресайз 1280, оригинал подменяет его, когда догрузится. */
.lightbox { position: fixed; inset: 0; z-index: var(--z-modal); display: grid; grid-template-rows: auto minmax(0, 1fr); background: rgba(14,16,16,.94); color: #fff; animation: fade var(--dur-2); }
.lb-bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 20px; }
.lb-title { flex: 1; min-width: 0; font-weight: var(--fw-heavy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-title small { display: block; font-size: 12px; font-weight: var(--fw-semibold); color: rgba(255,255,255,.6); }
.lb-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: var(--tap); height: var(--tap); padding: 0 12px; border-radius: var(--r-pill); border: 0; background: rgba(255,255,255,.1); color: #fff; font-size: 14px; font-weight: var(--fw-bold); transition: background var(--dur-1); }
.lb-btn:hover { background: rgba(255,255,255,.2); }
.lb-btn:focus-visible { box-shadow: 0 0 0 3px #fff; }
.lb-stage { position: relative; display: grid; place-items: center; padding: 8px 20px 24px; overflow: hidden; cursor: zoom-out; }
/* «По размеру экрана»: ячейка грида ровно со сцену, иначе строка растёт под натуральную высоту картинки,
   max-height: 100% считается от неё же и на невысоких экранах низ обрезается без прокрутки */
.lb-stage { grid-template: minmax(0, 1fr) / minmax(0, 1fr); }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; cursor: zoom-in; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lightbox.is-zoomed .lb-stage { grid-template: none; place-items: start center; overflow: auto; cursor: auto; }
.lightbox.is-zoomed .lb-stage img { max-width: none; max-height: none; width: auto; cursor: zoom-out; border-radius: 0; }
.lb-status { position: absolute; left: 50%; bottom: 32px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 16px; border-radius: var(--r-pill); background: rgba(0,0,0,.6); font-size: 13px; font-weight: var(--fw-bold); white-space: nowrap; }
.lb-status.is-error { background: rgba(196,30,66,.85); }
@media (max-width: 767px) {
  .lb-bar { padding: 6px 6px 6px 16px; padding-top: calc(6px + env(safe-area-inset-top)); }
  .lb-bar .lb-label { display: none; }
  .lb-stage { padding: 0 0 calc(16px + env(safe-area-inset-bottom)); }
  .lb-stage img { border-radius: 0; }
  .zoom-hint span { display: none; } .zoom-hint { padding: 0; width: 36px; justify-content: center; }
}
.mod-info { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.mod-title { font-size: var(--fs-h1); line-height: var(--lh-h1); font-weight: var(--fw-black); letter-spacing: -.01em; overflow-wrap: anywhere; }
.author-card { display: flex; align-items: center; gap: 12px; padding: 10px 16px 10px 10px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); }
.author-card small { display: block; font-size: var(--fs-xs); color: var(--text-2); }
/* Ник, слот уровня и облачко роли: в шаблоне идут вплотную, отступ даёт gap (как .prof-name в профиле) */
.author-card .who { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.author-card .who .lvl-slot { margin-left: 0; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { padding: 12px 8px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); text-align: center; }
.stat b { display: block; font-size: 19px; font-weight: var(--fw-black); line-height: 1.2; }
.stat span { font-size: 12px; color: var(--text-2); font-weight: var(--fw-semibold); }
/* РЕЗЕРВ «В коллекцию»: третья ячейка .cta-row (.cta-slot) — пустая сейчас, ширина 0 */
.cta-row { display: flex; gap: 10px; }
.cta-row .btn-primary { flex: 1; }
.cta-slot:empty { display: none; }
/* На узком телефоне три кнопки в ряд: формат файла прячем (он есть на кнопке на ПК и в описании), боковые кнопки компактнее */
@media (max-width: 419px) { .cta-row .cta-ext { display: none; } .cta-row .like-btn.btn-lg, .cta-row .cmt-btn.btn-lg { padding: 0 16px; min-width: 0; } }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
.mod-cmts { scroll-margin-top: calc(var(--header-h) + 16px); }
@media (max-width: 767px) { .mod-cmts { scroll-margin-top: calc(var(--header-h-m) + 12px); } }
.cta-sub { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: var(--fs-sm); }
.cta-sub a { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; font-weight: var(--fw-heavy); color: var(--primary-ink); }
.cta-sub a.is-muted { color: var(--text-2); }
.cta-sub a:hover { text-decoration: underline; text-underline-offset: 3px; }
.dl-check { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 14px; border-radius: var(--r-md); font-size: var(--fs-sm); font-weight: var(--fw-bold); }
.dl-check.is-loading { background: var(--surface-2); color: var(--text-2); }
.dl-check.is-new { background: var(--success-soft); color: var(--success); }
.dl-check.is-done { background: var(--warning-soft); color: var(--warning); }
.dl-check.is-error { background: var(--danger-soft); color: var(--danger); }
.dl-unavailable { display: flex; gap: 10px; align-items: center; min-height: var(--ctl-h-lg); padding: 0 18px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--text-2); font-weight: var(--fw-bold); flex: 1; }
.desc { font-size: var(--fs-body); line-height: 1.65; overflow-wrap: anywhere; }
.desc a { color: var(--primary-ink); font-weight: var(--fw-bold); text-decoration: underline; text-underline-offset: 3px; }
/* Страница мода: как «просмотр видео» — слева мод, справа во всю высоту крупные рекомендации.
   Раскладка зависит от ширины основной колонки (container query), а не окна: при развёрнутом сайдбаре на 1440 места меньше. */
.mod-wrap { container: modpage / inline-size; }
.mod-page { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "crumbs" "hero" "desc" "rec" "cmts"; align-items: start; }
.mod-crumbs { grid-area: crumbs; margin-bottom: 12px; }
.mod-page > .mod-hero { grid-area: hero; }
.mod-desc { grid-area: desc; margin-top: 40px; }
.mod-rec { grid-area: rec; min-width: 0; margin-top: 40px; }
.mod-cmts { grid-area: cmts; min-width: 0; margin-top: 40px; }
@container modpage (min-width: 1100px) {
  .mod-page { grid-template-columns: minmax(0, 1fr) clamp(300px, 24cqw, 340px); grid-template-areas: "crumbs rec" "hero rec" "desc rec" "cmts rec"; grid-template-rows: auto auto auto 1fr; column-gap: 32px; }
  .mod-rec { margin-top: 0; }
}
@media (max-width: 1023px) {
  .mod-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
  .stat b { font-size: 17px; }
}
@media (max-width: 767px) {
  .mod-hero { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .mod-media { aspect-ratio: 1 / 1; max-height: none; border-radius: var(--r-xl); }
  .mod-info { position: static; gap: 14px; }
  .mod-desc, .mod-rec, .mod-cmts { margin-top: 28px; }
}

/* Рекомендуемые моды — те же крупные карточки, что в каталоге (.mcard).
   Колонка справа (≥1100px основной области) шириной 300–340px — как карточки каталога в 4 колонки; уже 300 нельзя,
   там рекламный блок Caramel (было 320–400, сузили 14.11.2026: просили больше места под сам мод) → сетка в 2 колонки → на телефоне 1 колонка во всю ширину, как сейчас на сайте.
   Реклама Caramel — после 2-й карточки, как сейчас; в сетке занимает всю строку. */
.rec-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.rec-list .ad-rec { min-height: 300px; }
@container modpage (max-width: 1099px) {
  .rec-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rec-list .ad-rec { grid-column: 1 / -1; min-height: 250px; }
}
@container modpage (max-width: 559px) {
  .rec-list { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}

/* ---------- Комментарии ---------- */
.cmts-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.cmt-form { display: grid; grid-template-columns: auto 1fr; gap: 12px; margin-top: 24px; }
.cmt-form .textarea { min-height: 96px; }
.cmt-form-foot { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 10px; }
.cmt-guest { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px; border-radius: var(--r-lg); background: var(--primary-soft); color: var(--primary-ink); font-weight: var(--fw-bold); margin-top: 24px; }
.cmt-list { display: flex; flex-direction: column; gap: 8px; }
.cmt { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 12px; border-radius: var(--r-lg); }
.cmt-thread { border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow-1); padding: 4px; }
.cmt-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.cmt-date { font-size: 12px; color: var(--text-3); font-weight: var(--fw-semibold); }
.cmt-text { margin-top: 4px; overflow-wrap: anywhere; }
.cmt-text .mention { color: var(--primary-ink); font-weight: var(--fw-bold); }
.cmt-actions { display: flex; align-items: center; gap: 4px; margin: 6px 0 0 -10px; }
.cmt-actions button { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; border-radius: var(--r-pill); border: 0; background: none; font-size: 14px; font-weight: var(--fw-heavy); color: var(--text-2); }
.cmt-actions button:hover { background: var(--surface-2); color: var(--primary-ink); }
.cmt-actions .is-danger:hover { color: var(--danger); background: var(--danger-soft); }
.cmt-replies { margin: 0 12px 8px 64px; padding-left: 12px; border-left: 2px solid var(--border); }
.cmt-replies .cmt { padding: 10px 8px; }
.cmt-reply-form { margin: 4px 0 8px; }
.cmt-tip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--r-sm); background: var(--text); color: var(--bg); font-size: 13px; font-weight: var(--fw-bold); }
.cmt-tip a { text-decoration: underline; }
@media (max-width: 767px) { .cmt-replies { margin-left: 16px; } .cmt-form { grid-template-columns: 1fr; } .cmt-form > .ava { display: none; } }


/* Внедрение (этап 4) */
.mod-cmts { scroll-margin-top: calc(var(--header-h) + 16px); }
.cta-sub .link-btn { min-height: 36px; font-weight: var(--fw-heavy); text-decoration: none; color: var(--primary-ink); }
.cta-sub .link-btn.is-muted { color: var(--text-2); }
.cta-sub .link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.cmt-actions a { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; border-radius: var(--r-pill); font-size: 14px; font-weight: var(--fw-bold); color: var(--text-2); }
.cmt-empty { padding: 8px 0 16px; }
/* Длинное описание сворачивается скриптом; без JS показано целиком */
.desc.is-clamped { max-height: 280px; overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.desc-more { margin-top: 12px; }
.textarea-sm { min-height: 80px; }
.promo-modal .promo-label { top: 12px; left: 12px; }
.promo-modal .h3 { margin: 0; }
.cmt-reply-form .textarea { min-height: 88px; }
.cmt-reply-form .cmt-form-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
