/* ============================================================
   Шаблон «22 Энергии» и схожие LP-страницы с prose-block
   hero-wheel · seals-index · prose-block/alt-1/alt-2
   Слой pages. Используется на energies.html, topics.html,
   love-line.html, prednaznachenie.html и др.
   ============================================================ */

@layer pages {

  /* ============================================================
     HERO-WHEEL — анимированное колесо 22 арканов
  ============================================================ */
  .hero-wheel {
    position: relative;
    width: 100%;
    max-width: 480px;
    height: auto;
    display: block;
    isolation: isolate;
    color: var(--ink);
  }
  .hero-wheel:hover .hero-wheel__rotor { animation-play-state: paused; }
  .hero-wheel:hover .hero-wheel__core  { animation-play-state: paused; }

  .hero-wheel__rotor {
    transform-origin: 160px 160px;
    animation: wheelSpin 120s linear infinite;
  }
  .hero-wheel__core {
    transform-origin: 160px 160px;
    animation: hero-wheel-counter 240s linear infinite;
  }
  @keyframes wheelSpin        { to { transform: rotate(360deg); } }
  @keyframes hero-wheel-counter { to { transform: rotate(-360deg); } }

  .hero-wheel__pt-hit {
    fill: transparent;
    stroke: none;
    cursor: pointer;
  }
  .hero-wheel__pt {
    cursor: pointer;
    transition: r 200ms var(--ease), opacity 200ms var(--ease);
  }
  .hero-wheel__link:hover .hero-wheel__pt { r: 4.5; opacity: 1; }

  .hero-wheel__label {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ink-3);
    text-align: center;
    margin-top: 12px;
    min-height: 16px;
    transition: color 180ms var(--ease);
  }
  :root[data-theme="night"] .hero-wheel__label strong { color: var(--gold); }

  /* ============================================================
     SEALS-INDEX — editorial-карточки 22 арканов
  ============================================================ */
  .seals-index {
    display: grid;
    grid-template-columns: repeat(11, minmax(0, 1fr));
    gap: 10px;
    border: none;
    margin-top: clamp(32px, 4vw, 48px);
    padding: 0;
  }
  .seals-index > a.seal-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 0;
    padding: 14px 8px 12px;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--bg-4);
    text-align: center;
    color: var(--ink);
    min-height: clamp(120px, 14vw, 200px);
    overflow: hidden;
    isolation: isolate;
    position: relative;
    transition: transform var(--t) var(--ease), border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
  }
  /* Убираем ::before/::after орнаменты (они для одиночных карточек) */
  .seals-index > a.seal-card::before,
  .seals-index > a.seal-card::after { content: none; display: none; }

  /* Hover */
  .seals-index > a.seal-card:hover {
    transform: translateY(-4px);
    border-color: var(--gold);
    box-shadow: 0 14px 32px -12px rgba(185, 138, 62, .35);
    background: linear-gradient(180deg, rgba(185, 138, 62, .04), var(--bg-4));
    z-index: 2;
  }
  .seals-index > a.seal-card:hover .seal-card__digit { color: var(--gold-lo); }
  :root[data-theme="night"] .seals-index > a.seal-card:hover {
    background: rgba(210, 166, 90, .06);
  }
  :root[data-theme="night"] .seals-index > a.seal-card:hover .seal-card__digit { color: var(--gold-hi); }

  /* Оверрайды частей seal-card внутри seals-index */
  .seals-index a.seal-card .seal-card__top {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 10px;
    letter-spacing: .04em;
    color: var(--gold-lo);
    margin: 0; padding: 0;
    background: none; border: none;
    text-align: center;
    position: relative; z-index: 2;
  }
  :root[data-theme="night"] .seals-index a.seal-card .seal-card__top { color: var(--gold-hi); }

  /* Divider — тонкая золотая линия */
  .seals-index a.seal-card .seal-card__divider {
    width: 40%;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--line-gold), transparent);
    position: relative;
    z-index: 2;
    margin: 6px 0;
    flex-shrink: 0;
  }
  .seals-index a.seal-card .seal-card__tag { display: none; }

  /* ornament SVG — скрываем, заменяем CSS-декором на emblem */
  .seals-index a.seal-card .seal-card__ornament { display: none; }

  /* CSS-кольца вместо ornament SVG (производительнее) */
  .seals-index a.seal-card .seal-card__emblem::before {
    content: "";
    position: absolute;
    top: 6px; left: 6px; right: 6px; bottom: 6px;
    border-radius: 50%;
    border: 1px solid var(--line-gold);
    opacity: .45;
    pointer-events: none;
    z-index: 0;
  }
  .seals-index a.seal-card .seal-card__emblem::after {
    content: "";
    position: absolute;
    top: 14px; left: 14px; right: 14px; bottom: 14px;
    border-radius: 50%;
    border: 1px dashed rgba(185, 138, 62, .18);
    opacity: .7;
    pointer-events: none;
    z-index: 0;
  }
  .seals-index > a.seal-card:hover .seal-card__emblem::before { opacity: .85; border-color: var(--gold); }

  .seals-index a.seal-card .seal-card__emblem {
    flex: 1;
    display: grid;
    place-items: center;
    width: 100%;
    position: relative;
    z-index: 1;
    overflow: hidden;
    min-height: 60px;
  }
  .seals-index a.seal-card .seal-card__digit {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 380;
    font-size: clamp(28px, 3.8vw, 60px);
    line-height: 1;
    color: var(--ink);
    letter-spacing: -.025em;
    position: relative; z-index: 2;
    background: none;
    font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
  }
  .seals-index a.seal-card .seal-card__bot {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative; z-index: 2;
  }
  .seals-index a.seal-card .seal-card__name {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 500;
    font-size: clamp(9px, .9vw, 12px);
    line-height: 1.2;
    color: var(--ink-3);
    text-align: center;
    max-width: 90%;
  }

  /* ============================================================
     PROSE-BLOCK — редакционный текстовый блок, полная ширина
  ============================================================ */
  .prose-block {
    display: block;
    margin: 0 0 clamp(28px, 3.5vw, 48px);
  }
  .prose-block:last-of-type { margin-bottom: 0; }

  /* Текст — полная ширина, никакой колонки */
  .prose-block--alt-1 .prose-block__text,
  .prose-block--alt-2 .prose-block__text { display: block; }

  /* Арт — убран из prose-block: секции чисто текстовые */
  .prose-block--alt-1 .prose-block__art,
  .prose-block--alt-2 .prose-block__art { display: none; }

  /* Абзацы — полная ширина */
  .prose-block--alt-1 .prose-block__text p,
  .prose-block--alt-2 .prose-block__text p {
    margin: 0 0 18px;
    color: var(--ink-2);
    font-size: clamp(16.5px, 1.4vw, 18px);
    line-height: 1.72;
  }
  .prose-block--alt-1 .prose-block__text p:first-of-type,
  .prose-block--alt-2 .prose-block__text p:first-of-type {
    color: var(--ink);
    font-size: clamp(17px, 1.5vw, 19px);
  }
  .prose-block--alt-1 .prose-block__text p:last-child,
  .prose-block--alt-2 .prose-block__text p:last-child { margin-bottom: 0; }

  /* h2 внутри prose-block — полная ширина */
  .prose-block .prose-block__text h2 {
    font-family: var(--font-display);
    font-size: clamp(32px, 3.6vw, 52px);
    line-height: 1.04;
    letter-spacing: -.024em;
    font-weight: 400;
    color: var(--ink);
    margin: 0 0 clamp(18px, 2vw, 28px);
    text-wrap: balance;
    max-width: none;
  }
  .prose-block .prose-block__text h2::before {
    content: "";
    display: block;
    width: clamp(40px, 4vw, 60px);
    height: 2px;
    background: var(--gold);
    margin-bottom: clamp(10px, 1.2vw, 16px);
    opacity: .9;
    border-radius: 1px;
  }
  .prose-block .prose-block__text h2::after { content: none; display: none; }
  :root[data-theme="night"] .prose-block .prose-block__text h2::before {
    background: linear-gradient(90deg, var(--gold-hi), rgba(210, 166, 90, .2));
  }
  /* Drop cap */
  .prose-block .prose-block__text p:first-of-type::first-letter {
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(48px, 5vw, 68px);
    font-weight: 400;
    line-height: .82;
    float: left;
    margin-right: 6px;
    margin-top: 4px;
    color: var(--gold-lo);
    font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
  }
  :root[data-theme="night"] .prose-block .prose-block__text p:first-of-type::first-letter { color: var(--gold-hi); }

  /* ============================================================
     LEAD — editorial-вставка с большим XXII
  ============================================================ */
  .section.section--tight.no-rhythm:has(> .container > .prose--narrow > p.lead) {
    background: var(--bg-1);
    border-top: 1px solid var(--line-gold);
    border-bottom: 1px solid var(--line-gold);
    padding: clamp(24px, 3vw, 40px) 0;
  }
  :root[data-theme="night"] .section.section--tight.no-rhythm:has(> .container > .prose--narrow > p.lead) {
    background: var(--bg-2);
  }

  .section.section--tight.no-rhythm:has(> .container > .prose--narrow > p.lead)::before,
  .section.section--tight.no-rhythm:has(> .container > .prose--narrow > p.lead)::after { content: none; }

  /* Контейнер — flex стека: XXII сверху, lead в центре, линия снизу */
  .section.section--tight.no-rhythm:has(> .container > .prose--narrow > p.lead) > .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
  }
  /* Большой XXII */
  .section.section--tight.no-rhythm:has(> .container > .prose--narrow > p.lead) > .container::before {
    content: "XXII";
    display: block;
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(64px, 8.5vw, 120px);
    line-height: .9;
    letter-spacing: -.04em;
    color: var(--gold-lo);
    font-weight: 380;
    font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
    opacity: .65;
    margin-bottom: clamp(12px, 1.4vw, 18px);
  }
  :root[data-theme="night"] .section.section--tight.no-rhythm:has(> .container > .prose--narrow > p.lead) > .container::before {
    color: var(--gold);
    opacity: .7;
  }
  /* Тонкая золотая линия под текстом */
  .section.section--tight.no-rhythm:has(> .container > .prose--narrow > p.lead) > .container::after {
    content: "";
    display: block;
    order: 2;
    width: clamp(80px, 10vw, 140px);
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold-lo) 50%, transparent);
    opacity: .7;
    margin-top: clamp(14px, 1.8vw, 22px);
  }
  :root[data-theme="night"] .section.section--tight.no-rhythm:has(> .container > .prose--narrow > p.lead) > .container::after {
    background: linear-gradient(90deg, transparent, var(--gold) 50%, transparent);
  }

  .section.section--tight.no-rhythm:has(> .container > .prose--narrow > p.lead) .prose--narrow {
    order: 1;
    max-width: none;
    margin: 0;
  }

  .section.section--tight.no-rhythm:has(> .container > .prose--narrow > p.lead) .lead {
    text-align: center;
    max-width: 920px;
    margin: 0 auto;
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(22px, 2.5vw, 36px);
    line-height: 1.5;
    color: var(--ink);
    font-weight: 400;
    font-variation-settings: "opsz" 144, "SOFT" 80, "WONK" 0;
    padding: 0;
    position: relative;
  }
  /* lead::before/::after убираем — все декоры на container */
  .section.section--tight.no-rhythm:has(> .container > .prose--narrow > p.lead) .lead::before,
  .section.section--tight.no-rhythm:has(> .container > .prose--narrow > p.lead) .lead::after { content: none; }

  /* Секции с prose-block — меньше отступов, чтобы h2 не висел в пустоте */
  .section.section--tight.no-rhythm:has(.prose-block),
  .section.section--tight.section--alt.no-rhythm:has(.prose-block) {
    padding: clamp(28px, 3.5vw, 48px) 0;
    border-top: 1px solid var(--line);
  }

  /* ============================================================
     SEALS-SECTION — сетка 22 арканов
  ============================================================ */
  .eg-seals {
    background: var(--bg-1);
    border-top: 1px solid var(--line);
    padding-top: clamp(48px, 6vw, 72px);
  }
  .eg-seals > .container::before {
    content: "22 Аркана";
    display: block;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: var(--gold-lo);
    font-weight: 500;
    margin-bottom: clamp(16px, 2vw, 24px);
  }
  :root[data-theme="night"] .eg-seals > .container::before { color: var(--gold-hi); }

  /* ============================================================
  /* ============================================================
     Адаптив energies/prose-block
  ============================================================ */
  @media (max-width: 1100px) {
    /* seals-index — 6 колонок на планшете */
    .seals-index {
      grid-template-columns: repeat(6, minmax(0, 1fr));
      gap: 8px;
    }
  }

  @media (max-width: 760px) {
    .prose-block--alt-1,
    .prose-block--alt-2 {
      grid-template-columns: 1fr;
      row-gap: clamp(16px, 3vw, 24px);
    }
    .prose-block--alt-1 .prose-block__text,
    .prose-block--alt-2 .prose-block__text { display: block; grid-column: 1; }
    .prose-block--alt-1 .prose-block__text p,
    .prose-block--alt-2 .prose-block__text p { grid-column: auto; margin-bottom: 16px; }
    .prose-block--alt-1 .prose-block__art,
    .prose-block--alt-2 .prose-block__art {
      grid-column: 1;
      grid-row: 1;
      max-width: 140px;
      justify-self: center;
    }
  }

  @media (max-width: 600px) {
    .seals-index {
      grid-template-columns: repeat(4, minmax(0, 1fr));
      gap: 6px;
    }
    .seals-index a.seal-card .seal-card__name { font-size: 9px; }
  }

  /* ============================================================
     РЕДАКЦИОННЫЕ СЕКЦИИ — energies.html
     eg-lead · eg-why · eg-how · eg-polus · eg-context
  ============================================================ */

  /* EG-LEAD */
  .eg-lead {
    padding: clamp(48px, 5.5vw, 80px) 0;
  }
  .eg-lead__eyebrow {
    display: block;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--gold-lo);
    margin-bottom: clamp(20px, 2.5vw, 32px);
  }
  :root[data-theme="night"] .eg-lead__eyebrow { color: var(--gold-hi); }
  .eg-lead__text {
    font-family: var(--font-display);
    font-size: clamp(20px, 2.2vw, 30px);
    line-height: 1.5;
    color: var(--ink);
    margin: 0;
    font-variation-settings: "opsz" 144, "SOFT" 50, "WONK" 0;
    text-wrap: pretty;
    letter-spacing: -.015em;
  }
  .eg-lead__text em {
    font-style: normal;
    color: var(--gold-lo);
  }
  :root[data-theme="night"] .eg-lead__text em { color: var(--gold-hi); }

  /* EG-WHY */
  .eg-why {
    padding: clamp(56px, 7vw, 96px) 0;
    background: var(--bg-1);
    border-top: 1px solid var(--line);
  }
  .eg-why > .container > .s-head__title {
    margin: 0 0 clamp(24px, 3vw, 36px);
  }
  .eg-why .arc-article__lead {
    margin: 0 0 clamp(24px, 3vw, 36px);
    border-left: 2px solid var(--gold);
    padding-left: clamp(16px, 2vw, 24px);
  }
  .eg-why__body {
    border-top: 1px solid var(--line-gold);
    padding-top: clamp(24px, 3vw, 36px);
    columns: 2;
    column-gap: clamp(32px, 5vw, 64px);
    column-rule: 1px solid var(--line);
  }
  .eg-why__body p {
    font-size: 17px;
    line-height: 1.72;
    color: var(--ink-2);
    margin: 0 0 clamp(14px, 1.8vw, 20px);
    text-wrap: pretty;
    break-inside: avoid;
  }
  .eg-why__coda { column-span: all; }
  @media (max-width: 720px) { .eg-why__body { columns: 1; } }
  .eg-why__coda {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 15.5px;
    color: var(--gold-lo);
    margin: clamp(20px, 2.5vw, 32px) 0 0;
    padding-top: clamp(20px, 2.5vw, 28px);
    border-top: 1px solid var(--line-gold);
  }
  :root[data-theme="night"] .eg-why__coda { color: var(--gold); }

  /* EG-HOW body — columns */

  /* EG-HOW */
  .eg-how {
    padding: clamp(36px, 4.5vw, 56px) 0;
    border-top: 1px solid var(--line);
  }
  .eg-how > .container > .s-head__title {
    margin: 0 0 clamp(28px, 3.5vw, 44px);
  }
  .eg-how__body {
    columns: 2;
    column-gap: clamp(32px, 5vw, 64px);
    column-rule: 1px solid var(--line);
  }
  @media (max-width: 720px) { .eg-how__body { columns: 1; } }
  .eg-how__body p {
    font-size: 16px;
    line-height: 1.7;
    color: var(--ink-2);
    margin: 0 0 14px;
    text-wrap: pretty;
  }
  .eg-how__body p:last-child { margin-bottom: 0; }
  .eg-how__body a {
    color: var(--gold-lo);
    border-bottom: 1px solid var(--line-gold);
    transition: color var(--t-fast) var(--ease);
  }
  .eg-how__body a:hover { color: var(--ink); }
  :root[data-theme="night"] .eg-how__body a { color: var(--gold); }

  /* EG-POLUS */
  .eg-polus {
    padding: clamp(56px, 7vw, 96px) 0;
    border-top: 1px solid var(--line);
  }
  .eg-polus > .container > .s-head__title {
    margin: 0 0 clamp(22px, 2.8vw, 36px);
    padding-bottom: clamp(18px, 2.2vw, 28px);
    border-bottom: 1px solid var(--line-gold);
  }
  .eg-polus__layout {
    display: flex;
    flex-direction: column;
    gap: clamp(32px, 4vw, 52px);
  }
  .eg-polus__text {
    font-size: 17.5px;
    line-height: 1.7;
    color: var(--ink-2);
    margin: 0;
    text-wrap: pretty;
  }
  .eg-polus__layout .pull-quote {
    margin: 0;
    text-align: left;
  }

  /* EG-CONTEXT */
  .eg-context {
    background: var(--bg-1);
    padding: clamp(56px, 7vw, 96px) 0;
    border-top: 1px solid var(--line);
  }
  .eg-context > .container > .s-head__title {
    margin: 0 0 clamp(28px, 3.5vw, 44px);
  }
  .eg-context__cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(32px, 5vw, 72px);
    align-items: start;
    border-top: 1px solid var(--line-gold);
    padding-top: clamp(22px, 2.8vw, 36px);
  }
  .eg-context__col p {
    font-size: 16.5px;
    line-height: 1.72;
    color: var(--ink-2);
    margin: 0 0 16px;
    text-wrap: pretty;
  }
  .eg-context__col p:first-child { font-size: 18px; color: var(--ink); line-height: 1.6; }
  .eg-context__col p:last-child { margin-bottom: 0; }
  @media (max-width: 720px) {
    .eg-context__cols { grid-template-columns: 1fr; gap: 24px; }
  }

}