/* ==========================================================================
   self-study.css — раздел «Самостоятельно» на главной (.cat-*) и карточка
   материала (.pc-*: бейджи, книжный мокап, плитки-преимущества). Карточка и
   её части используются и на лендинге методички.
   Перенос из макета site-design-v10 (site.css, классы .cat-* / .pc-*) — только
   нужные правила, без глобальных reset/body/nav макета. Подключается ПОСЛЕ
   main.css + shared-shell.css. Raw hex — только в объявлениях переменных.
   ========================================================================== */

:root {
  --self-orange: #F4A040;
  --self-a2: #F5C542;
  --self-paper: #FFFDF9;
  --self-paper-edge: #E6DFD3;
  --self-soon-bg: #E6F4EA;
  --self-soon-bd: #BFE3CB;
  /* приглушённый текст новых блоков: ≥4.5:1 на белом, #F7F7F5 и #F3EDE9
     (общий --color-text-muted даёт ~2.8:1 — для подписей с информацией мало) */
  --self-muted: #6B6B6B;
}

/* ===================== РАЗДЕЛ «САМОСТОЯТЕЛЬНО» ===================== */
.cat { padding: 76px 0; background: var(--color-bg); }
.cat-filters { max-width: 1000px; margin: 0 auto 26px; display: flex; flex-direction: column; gap: 12px; }
.cat-frow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cat-flabel { flex: none; width: 92px; font-size: 11.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--self-muted); }
.cat-chip { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 100px; border: 1.5px solid var(--color-border); background: var(--color-bg); color: var(--color-text-secondary); font-family: inherit; font-size: 14px; font-weight: 700; line-height: 1; cursor: pointer; transition: border-color .15s, background .15s, color .15s; }
.cat-chip:hover { border-color: var(--color-text); color: var(--color-text); }
.cat-chip:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 2px; }
.cat-chip[aria-pressed='true'] { background: var(--color-text); border-color: var(--color-text); color: var(--color-text-on-dark); }
.cat-chip small { font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 3px 7px; border-radius: 100px; background: var(--color-bg-alt); color: var(--self-muted); }
.cat-chip[aria-pressed='true'] small { background: rgba(255, 255, 255, .18); color: var(--color-text-on-dark); }
.cat-chip--soon, .cat-chip--soon:hover { color: var(--color-text-muted); border-color: var(--color-border); border-style: dashed; cursor: default; }
.cat-count { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--self-muted); }

.cat-grid { max-width: 1000px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.cat-empty { max-width: 1000px; margin: 0 auto; border-radius: 28px; border: 1px solid var(--color-border); background: var(--color-bg-alt); padding: 44px 32px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.cat-empty[hidden] { display: none; }
.cat-empty b { font-size: 22px; font-weight: 800; line-height: 1.25; color: var(--color-text); }
.cat-empty p { font-size: 15.5px; line-height: 1.55; color: var(--color-text-secondary); max-width: 46ch; }
.cat-empty-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }

.cat-soon-row { max-width: 1000px; margin: 16px auto 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.cat-soon { border-radius: 28px; border: 2px dashed var(--color-border); background: var(--color-bg-alt); display: flex; align-items: center; gap: 16px; padding: 22px 24px; color: var(--self-muted); }
.cat-soon-ico { flex: none; width: 56px; height: 56px; border-radius: 16px; background: var(--color-bg); border: 1px solid var(--color-border); display: inline-flex; align-items: center; justify-content: center; color: var(--color-text-muted); }
.cat-soon-ico svg { width: 22px; height: 22px; stroke-width: 2; }
.cat-soon b { display: block; font-size: 16px; font-weight: 800; line-height: 1.3; color: var(--color-text-secondary); }
.cat-soon p { margin-top: 2px; font-size: 14px; line-height: 1.5; }
.cat-note { max-width: 1000px; margin: 24px auto 0; text-align: center; font-size: 14px; line-height: 1.55; color: var(--self-muted); }

/* ===================== КАРТОЧКА МАТЕРИАЛА (утверждённая v07/v08) ===================== */
.pc-a { display: grid; grid-template-columns: 300px minmax(0, 1fr); grid-template-rows: auto 1fr; border-radius: 28px; background: var(--color-bg); border: 2px solid var(--color-accent); box-shadow: 0 16px 40px rgba(214, 90, 58, .14); overflow: hidden; transition: transform .25s cubic-bezier(.2, .6, .3, 1), box-shadow .25s; }
.pc-a[hidden] { display: none; }
.pc-a:hover { transform: translateY(-6px); box-shadow: 0 30px 70px rgba(214, 90, 58, .22); }

/* полоса демо: тёмно-синяя, замок в оранжевом квадрате 30px */
.pc-strip { grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; background: var(--shared-navy); color: var(--color-text-on-dark); padding: 13px 30px; font-size: 15px; font-weight: 700; line-height: 1.3; }
.pc-strip b { font-weight: 800; }
.pc-strip-t { opacity: .78; font-weight: 600; }
.pc-strip-ic { flex: none; width: 30px; height: 30px; border-radius: 9px; background: var(--self-orange); color: var(--shared-navy); display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(244, 160, 64, .35); }
/* «Попробовать» — неактивная кнопка (демо закрыто) */
.pc-strip-btn { margin-left: auto; font-family: inherit; font-size: 13px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; line-height: 1.3; color: var(--color-text-on-dark); background: transparent; border: 1.5px solid rgba(255, 255, 255, .45); border-radius: 100px; padding: 6px 12px; }
.pc-strip-btn:disabled { opacity: .55; cursor: not-allowed; }

/* поле под обложкой: светло-серое, книга без 3D */
.pc-a-cover { position: relative; background: var(--color-bg-alt); border-right: 1px solid var(--color-border); display: flex; align-items: center; justify-content: center; padding: 40px 24px 44px; }
.pc-book { position: relative; width: 200px; aspect-ratio: 210 / 297; }
.pc-book img { position: relative; z-index: 2; display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 3px 7px 7px 3px; box-shadow: 0 22px 44px rgba(26, 26, 26, .22), 0 3px 8px rgba(26, 26, 26, .10); }
.pc-book-spine { position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: 3; border-radius: 3px 7px 7px 3px; pointer-events: none; background: linear-gradient(90deg, rgba(0, 0, 0, .22) 0, rgba(0, 0, 0, .04) 7px, rgba(255, 255, 255, .16) 11px, rgba(0, 0, 0, .06) 17px, rgba(0, 0, 0, 0) 30px); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .05); }
.pc-book-pages,
.pc-book-pages::before,
.pc-book-pages::after { content: ""; position: absolute; z-index: 1; border-radius: 3px 7px 7px 3px; background: var(--self-paper); border: 1px solid var(--self-paper-edge); box-sizing: border-box; }
.pc-book-pages { top: 0; right: 0; bottom: 0; left: 0; transform: translate(7px, 5px); }
.pc-book-pages::before { top: -1px; right: -1px; bottom: -1px; left: -1px; transform: translate(7px, 5px); z-index: -1; }
.pc-book-pages::after { top: -1px; right: -1px; bottom: -1px; left: -1px; transform: translate(14px, 10px); z-index: -2; box-shadow: 0 16px 32px rgba(26, 26, 26, .16); }

.pc-a-body { padding: 26px 30px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.pc-badges { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pc-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; border-radius: 100px; padding: 7px 13px; line-height: 1; }
.pc-badge--type { background: var(--color-label-bg); color: var(--color-accent-active); }
.pc-lvl { display: inline-flex; gap: 4px; }
.pc-lvl .a2, .pc-lvl .b1 { font-size: 12.5px; font-weight: 800; padding: 6px 10px; border-radius: 8px; line-height: 1; }
.pc-lvl .a2 { background: var(--self-a2); color: var(--shared-navy); }
/* B1: тёмный текст на оранжевом (белый давал 2.1:1) */
.pc-lvl .b1 { background: var(--self-orange); color: var(--shared-navy); }
.pc-title { font-size: 30px; font-weight: 800; letter-spacing: -.015em; line-height: 1.1; color: var(--color-text); }
.pc-sub { font-size: 16px; line-height: 1.5; color: var(--color-text-secondary); }

/* плитки 2×2: светлый фон, оранжевые квадраты 44px с тёмным глифом */
.pc-benefits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 2px 0 4px; }
.pc-ben { display: flex; align-items: center; gap: 14px; padding: 12px 16px 12px 12px; border-radius: 16px; background: var(--color-bg-alt); border: 1px solid var(--color-border); min-width: 0; }
.pc-ben > div { min-width: 0; }
.pc-ben-ic { flex: 0 0 44px; width: 44px; height: 44px; margin: 0; border-radius: 12px; display: flex; align-items: center; justify-content: center; color: var(--shared-navy); background: var(--self-orange); box-shadow: 0 6px 14px rgba(244, 160, 64, .38), 0 1px 2px rgba(26, 26, 26, .10); }
/* значки — набор «плотные, с заливкой» (render.mjs ICONS): силуэт цветом глифа,
   детали вырезаны цветом плашки; глиф 26px по центру плашки 44px */
.pc-ben-ic, .pc-strip-ic { --pc-plate: var(--self-orange); }
.pc-ic { display: block; flex: none; width: 26px; height: 26px; fill: none; stroke: none; overflow: visible; }
.pc-strip-ic .pc-ic { width: 19px; height: 19px; }
.pc-ic .s { fill: currentColor; }
.pc-ic .sk { fill: currentColor; stroke: var(--pc-plate); stroke-width: 1.7; }
.pc-ic .k { fill: none; stroke: var(--pc-plate); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pc-ic .t { fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
/* текст плашки — только прямые потомки текстового блока (значок тоже span,
   общий «.pc-ben span» ломал его центрирование) */
.pc-ben > div > b { display: block; font-size: 15px; font-weight: 800; color: var(--color-text); line-height: 1.25; }
.pc-ben > div > span { display: block; margin-top: 2px; font-size: 13px; line-height: 1.4; color: var(--color-text-secondary); }

.pc-foot { margin-top: auto; padding-top: 4px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.pc-price { display: flex; flex-direction: column; gap: 4px; }
.pc-price b { font-size: 22px; font-weight: 800; letter-spacing: -.01em; color: var(--color-text); line-height: 1.1; }
.pc-price small { font-size: 13px; font-weight: 600; color: var(--self-muted); }
.pc-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 100px; font-weight: 800; font-size: 15.5px; padding: 15px 28px; background: var(--color-accent); color: var(--color-text-on-dark); box-shadow: 0 8px 22px rgba(214, 90, 58, .3); white-space: nowrap; text-decoration: none; transition: background .15s; }
.pc-btn:hover { background: var(--color-accent-hover); }
.pc-btn:focus-visible { outline: 3px solid var(--color-accent); outline-offset: 3px; }
/* текст только для скринридеров (контекст ссылки «Подробнее») */
.pc-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@media (max-width: 820px) {
  .cat { padding: 60px 0; }
  .pc-a { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; }
  .pc-strip { padding: 12px 18px; font-size: 14px; }
  .pc-a-cover { border-right: 0; border-bottom: 1px solid var(--color-border); padding: 28px 20px 34px; }
  .pc-a-cover .pc-book { width: 150px; }
  .pc-a-body { padding: 22px 20px 24px; }
  .pc-title { font-size: 26px; }
}
@media (max-width: 600px) {
  .cat-flabel { width: 100%; }
  .cat-chip { padding: 9px 13px; }
  .pc-benefits { grid-template-columns: minmax(0, 1fr); }
  .cat-soon-row { grid-template-columns: minmax(0, 1fr); }
  .cat-soon { padding: 18px 18px; }
  .cat-empty { padding: 32px 20px; }
  .pc-foot { flex-direction: column; align-items: stretch; }
  .pc-btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .pc-a, .pc-a:hover, .cat-chip, .pc-btn { transition: none; transform: none; }
}
