/* ============================================================
   welly — Журнал (blog) section
   16personalities-style Knowledge Base: rubricator hub + article reader.
   Reuses tokens.css + styles.css (nav/btn/footer). Self-contained components
   are namespaced (.bl-*, .bcard, .article) to avoid clashing with the SPA.
   ============================================================ */

/* per-view switch (mirrors styles.css .view) */
.bview { display: none; }
.bview.is-active { display: block; animation: viewIn .45s cubic-bezier(.2,.7,.2,1); }

/* hue set by JS per rubric (--accent), with a sensible default */
#blog { --accent: var(--sleep); }

/* ───────────────────────── Blog hero ───────────────────────── */
/* hero — same teal "one world" language as the home page (index .lead-hero) */
.bl-hero {
  position: relative; overflow: hidden; color: #fff; text-align: center;
  padding: clamp(52px, 11vh, 116px) 22px 0;
  background:
    radial-gradient(120% 90% at 50% -8%, rgba(6, 40, 46, .34), transparent 58%),
    linear-gradient(168deg, #1f8a93 0%, #2c9c8c 52%, #45b07e 100%);
}
.bl-hero__copy { position: relative; z-index: 2; max-width: 880px; margin: 0 auto; }
.bl-hero__eyebrow {
  font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  font-size: 13px; opacity: .92; margin-bottom: 14px;
}
.bl-hero h1 {
  font-family: var(--font-display); font-size: clamp(31px, 4.8vw, 54px);
  max-width: 15em; margin: 0 auto; color: #fff; text-shadow: 0 2px 18px rgba(6, 40, 46, .4);
}
.bl-hero__sub {
  margin: clamp(14px, 2.4vh, 22px) auto 0; font-size: clamp(16px, 1.9vw, 20px);
  color: #fff; max-width: 32em; line-height: 1.55; text-shadow: 0 1px 10px rgba(6, 40, 46, .36);
}
.bl-hero .btn--hero { margin-top: clamp(20px, 3.2vh, 32px); }
.bl-hero__count { margin-top: clamp(16px, 2.4vh, 22px); font-size: 14px; font-weight: 700; opacity: .85; }
/* scattered mascot scene melting into the rubricator (раскидал маскотов) */
.bl-hero__mascots {
  position: relative; z-index: 1; margin: clamp(22px, 4vh, 46px) auto clamp(42px, 5.6vw, 66px);
  display: flex; align-items: flex-end; justify-content: center; gap: clamp(4px, 1.4vw, 20px);
  max-width: 980px; padding: 0 8px;
}
.bl-hero__mascots img {
  width: clamp(50px, 8vw, 100px); height: auto; flex: 0 0 auto;
  filter: drop-shadow(0 14px 22px rgba(6, 40, 46, .3));
}
.bl-hero__mascots img:nth-child(even) { transform: translateY(-16px); }
.bl-hero__mascots img:nth-child(3n)   { width: clamp(60px, 9.6vw, 122px); }
.bl-hero__wave { position: absolute; left: 0; bottom: -1px; width: 100%; height: clamp(36px, 4.8vw, 60px); z-index: 3; display: block; pointer-events: none; }
@media (max-width: 600px) {
  .bl-hero__mascots img:nth-child(n+6) { display: none; } /* keep 5 on mobile */
}

/* ───────────────────────── Rubricator (category=list) ───────────────────────── */
.bl-wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }
.bl-section { padding: clamp(40px, 6vh, 68px) 0; }
.bl-section__head { margin-bottom: 26px; }
.bl-section__head h2 { font-family: var(--font-display); font-size: clamp(24px, 3.4vw, 34px); }
.bl-section__head p { margin-top: 8px; color: var(--ink-soft); font-size: 17px; }

.rubrics {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 16px;
}
.rubric {
  --rc: var(--sleep);
  position: relative; text-align: left;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 20px 18px; cursor: pointer; overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, box-shadow .22s ease, border-color .2s ease;
}
.rubric::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--rc); }
.rubric:hover { transform: translateY(-4px); box-shadow: 0 18px 38px color-mix(in srgb, var(--rc) 24%, transparent); border-color: transparent; }
.rubric__icon {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; margin-bottom: 13px;
  color: var(--rc); background: color-mix(in srgb, var(--rc) 13%, #fff);
}
.rubric__icon svg { width: 24px; height: 24px; }
.rubric__title { font-size: 18px; font-weight: 800; }
.rubric__dek { margin-top: 6px; color: var(--ink-soft); font-size: 14.5px; line-height: 1.5; }
.rubric__count { margin-top: 12px; font-size: 12.5px; font-weight: 700; color: var(--ink-dim); }

/* ───────────────────────── Filter chips ───────────────────────── */
.bl-filter {
  position: sticky; top: 64px; z-index: 30;
  display: flex; gap: 9px; flex-wrap: wrap; padding: 14px 0;
  background: color-mix(in srgb, var(--bg-alt) 70%, #fff); backdrop-filter: blur(8px);
}
.chip {
  font-weight: 700; font-size: 14px; color: var(--ink-soft);
  padding: 8px 15px; border-radius: 999px; background: #fff;
  border: 1px solid var(--line); transition: all .16s ease; white-space: nowrap;
}
.chip:hover { color: var(--ink); border-color: var(--ink-dim); }
.chip.is-on { color: #fff; background: var(--accent); border-color: transparent; box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 34%, transparent); }
.chip__n { opacity: .7; font-weight: 700; margin-left: 4px; }

/* ───────────────────────── Featured article ───────────────────────── */
.feat {
  --fc: var(--sleep);
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 0;
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md);
  background: #fff; border: 1px solid var(--line); cursor: pointer; margin-bottom: 30px;
  transition: transform .2s ease, box-shadow .25s ease;
}
.feat:hover { transform: translateY(-3px); box-shadow: 0 28px 60px color-mix(in srgb, var(--fc) 22%, transparent); }
.feat__art {
  position: relative; min-height: 280px; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(120% 100% at 50% 120%, color-mix(in srgb, var(--fc) 30%, #fff), color-mix(in srgb, var(--fc) 12%, #fff));
}
.feat__art img { width: 60%; max-width: 230px; height: auto; object-fit: contain; filter: drop-shadow(0 16px 26px color-mix(in srgb, var(--fc) 36%, transparent)); }
.feat__body { padding: clamp(24px, 3vw, 40px); display: flex; flex-direction: column; gap: 12px; align-self: center; }
.feat__flag { align-self: flex-start; font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--fc); }
.feat__title { font-family: var(--font-display); font-size: clamp(24px, 3vw, 34px); line-height: 1.12; }
.feat__dek { color: var(--ink-soft); font-size: 17px; line-height: 1.55; }
.feat__meta { display: flex; align-items: center; gap: 10px; color: var(--ink-dim); font-size: 13.5px; font-weight: 600; margin-top: 4px; }

/* ───────────────────────── Article cards grid ───────────────────────── */
.bcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.bcard {
  --cc: var(--sleep);
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; display: flex; flex-direction: column;
  box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .22s ease;
}
.bcard:hover { transform: translateY(-5px); box-shadow: 0 22px 44px color-mix(in srgb, var(--cc) 22%, transparent); }
.bcard__banner {
  height: 150px; position: relative; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(120% 96% at 50% 120%, color-mix(in srgb, var(--cc) 26%, #fff), color-mix(in srgb, var(--cc) 9%, #fff));
}
.bcard__banner img { width: 116px; height: 116px; object-fit: contain; filter: drop-shadow(0 10px 16px color-mix(in srgb, var(--cc) 34%, transparent)); }
.bcard__banner .bcard__glyph { color: var(--cc); }
.bcard__banner .bcard__glyph svg { width: 56px; height: 56px; }
.bcard__rub {
  position: absolute; top: 12px; left: 12px;
  font-size: 11.5px; font-weight: 800; letter-spacing: .02em;
  color: var(--cc); background: #fff; padding: 5px 11px; border-radius: 999px; box-shadow: var(--shadow-sm);
}
.bcard__body { padding: 17px 18px 18px; display: flex; flex-direction: column; flex: 1; gap: 8px; }
.bcard__title { font-size: 18.5px; font-weight: 800; line-height: 1.2; }
.bcard__dek { color: var(--ink-soft); font-size: 14.5px; line-height: 1.5; flex: 1; }
.bcard__meta { display: flex; align-items: center; gap: 8px; color: var(--ink-dim); font-size: 13px; font-weight: 600; margin-top: 4px; }
.bcard__meta svg { width: 14px; height: 14px; }

/* ───────────────────────── Article reader ───────────────────────── */
.article { background: #fff; }
.article__hero {
  --hc: var(--sleep); position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(140deg, var(--hc) 0%, color-mix(in srgb, var(--hc) 58%, #1a1f44) 120%);
}
.article__hero::before { content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%; background: rgba(255,255,255,.1); top: -130px; right: -50px; }
.article__hero-in {
  position: relative; max-width: 820px; margin: 0 auto; padding: clamp(28px, 5vh, 56px) 22px clamp(34px, 6vh, 62px);
  display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center;
}
.article__crumb { font-size: 13.5px; font-weight: 700; opacity: .9; margin-bottom: 14px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.article__crumb a { opacity: .9; }
.article__crumb a:hover { opacity: 1; text-decoration: underline; }
.article__rubchip { display: inline-flex; align-items: center; gap: 7px; background: rgba(255,255,255,.18); padding: 5px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; }
.article__h1 { font-family: var(--font-display); font-size: clamp(28px, 4.6vw, 46px); line-height: 1.08; margin-top: 16px; }
.article__dek { font-size: clamp(17px, 2vw, 20px); opacity: .94; line-height: 1.5; margin-top: 14px; max-width: 32em; }
.article__meta { margin-top: 18px; display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; font-weight: 600; opacity: .9; }
.article__meta span { display: inline-flex; align-items: center; gap: 6px; }
.article__meta svg { width: 15px; height: 15px; }
.article__mascot { width: clamp(96px, 16vw, 150px); height: auto; object-fit: contain; filter: drop-shadow(0 14px 24px rgba(0,0,0,.28)); }

/* body typography */
.article__body { max-width: 720px; margin: 0 auto; padding: clamp(34px, 6vh, 60px) 22px; font-size: 18px; line-height: 1.72; color: var(--ink); }
.article__body > * + * { margin-top: 1.15em; }
.article__body h2 { font-family: var(--font-display); font-size: clamp(23px, 3vw, 30px); line-height: 1.18; margin-top: 1.7em; }
.article__body h3 { font-size: clamp(19px, 2.2vw, 23px); font-weight: 800; margin-top: 1.5em; }
.article__body p { color: #353944; }
.article__body a { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.article__body ul, .article__body ol { padding-left: 1.3em; }
.article__body li + li { margin-top: .5em; }
.article__body strong { font-weight: 700; }
.article__body blockquote {
  margin: 1.4em 0; padding: 4px 0 4px 22px; border-left: 4px solid var(--accent);
  font-size: 20px; line-height: 1.5; color: var(--ink); font-style: italic;
}
.article__body sup[data-fn] { font-size: .62em; font-weight: 700; color: var(--accent); cursor: pointer; vertical-align: super; padding: 0 1px; }
.art-note {
  background: color-mix(in srgb, var(--accent) 8%, #fff); border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  border-radius: 16px; padding: 18px 20px; font-size: 16.5px; line-height: 1.6; color: var(--ink-soft);
}
.art-note::before { content: "ℹ"; display: inline-flex; margin-right: 8px; color: var(--accent); font-weight: 800; }
.art-steps { counter-reset: st; list-style: none; padding-left: 0; }
.art-steps li {
  position: relative; padding: 14px 16px 14px 56px; background: var(--bg-alt); border-radius: 14px;
}
.art-steps li + li { margin-top: 12px; }
.art-steps li::before {
  counter-increment: st; content: counter(st);
  position: absolute; left: 14px; top: 14px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 800; font-size: 14px; display: grid; place-items: center;
}

/* funnel CTA */
.art-cta {
  max-width: 720px; margin: 8px auto 0; padding: 0 22px;
}
.art-cta__box {
  --cc: var(--accent); position: relative; overflow: hidden;
  border-radius: var(--radius-lg); padding: clamp(24px, 4vw, 36px);
  background: linear-gradient(135deg, var(--cc), color-mix(in srgb, var(--cc) 62%, #1a1f44));
  color: #fff; display: flex; gap: 20px; align-items: center; flex-wrap: wrap;
}
.art-cta__txt { flex: 1; min-width: 220px; }
.art-cta__txt h3 { font-family: var(--font-display); font-size: clamp(20px, 2.6vw, 27px); }
.art-cta__txt p { margin-top: 8px; opacity: .92; font-size: 16px; line-height: 1.5; }
.art-cta .btn--primary { background: #fff; color: var(--ink); box-shadow: 0 12px 26px rgba(0,0,0,.2); }
.art-cta .btn--primary:hover { background: #fff; }
.art-cta__note { max-width: 720px; margin: 14px auto 0; padding: 0 22px; color: var(--ink-dim); font-size: 13.5px; line-height: 1.55; }

/* sources + disclaimer */
.art-sources { max-width: 720px; margin: 40px auto 0; padding: 0 22px; }
.art-sources h3 { font-size: 14px; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-dim); margin-bottom: 12px; }
.art-sources ol { padding-left: 1.4em; color: var(--ink-soft); font-size: 14.5px; line-height: 1.6; }
.art-sources li { margin-top: 6px; }
.art-sources a { color: var(--accent); word-break: break-word; }
.art-disclaimer { max-width: 720px; margin: 28px auto 0; padding: 16px 22px; color: var(--ink-dim); font-size: 13.5px; line-height: 1.6; border-top: 1px solid var(--line); }

/* related */
.art-related { background: var(--bg-alt); }
.art-related .bl-wrap { padding-top: clamp(40px, 6vh, 64px); padding-bottom: clamp(48px, 7vh, 80px); }

.bl-back { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; color: var(--ink-soft); margin: 26px 0; }
.bl-back:hover { color: var(--ink); }
.bl-back svg { width: 18px; height: 18px; }

.bl-empty { text-align: center; color: var(--ink-dim); padding: 60px 22px; font-size: 16px; }

/* ───────────────────────── Responsive ───────────────────────── */
@media (max-width: 820px) {
  .feat { grid-template-columns: 1fr; }
  .feat__art { min-height: 200px; }
  .article__hero-in { grid-template-columns: 1fr; }
  .article__mascot { display: none; }
  .bl-filter { top: 56px; }
}
@media (max-width: 560px) {
  .rubrics { grid-template-columns: 1fr; }
  .article__body { font-size: 17px; }
}
