/* Блог: картки статей (головна блогу, «Свіже з блогу» на головній, «Читайте також») і сторінка статті.
   Підключається після landing.css; токени — tokens.css і :root у landing.css. Сторінки збирає blog-src/build_blog.py. */

/* ── картка ─────────────────────────────────────────────── */
.bgrid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: clamp(18px, 2.2vw, 28px); }
.bcard { position: relative; border-radius: 26px; border: 1px solid var(--line); background: var(--card); overflow: hidden; isolation: isolate;
  transition: transform .45s var(--ease), border-color .35s, box-shadow .45s var(--ease); }
.bcard:hover { transform: translateY(-4px); border-color: rgba(var(--tint, 61, 139, 255), .45); box-shadow: 0 30px 70px -30px rgba(var(--tint, 61, 139, 255), .55); }
.bcard__link { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; }
.bcard__link:focus-visible { outline: 2px solid var(--accent-2); outline-offset: -2px; border-radius: 26px; }

/* обкладинка (картка й стаття): фон у кольорах бренду, заголовок угорі, вирізаний 3D-предмет справа внизу, знак VOCARA */
.bcover { position: relative; overflow: hidden; isolation: isolate; aspect-ratio: 16 / 10; container-type: inline-size;
  background:
    radial-gradient(70% 85% at 92% 105%, rgba(var(--tint, 61, 139, 255), .55), transparent 62%),
    radial-gradient(55% 70% at 8% -10%, rgba(127, 180, 255, .16), transparent 60%),
    linear-gradient(158deg, #070a18 0%, #0b1230 46%, #16124a 100%); }
.bcover::before { content: ""; position: absolute; z-index: -1; inset: 0; pointer-events: none; opacity: .9;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 500' preserveAspectRatio='none'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%23fff' stop-opacity='0'/%3E%3Cstop offset='.55' stop-color='%23fff' stop-opacity='.16'/%3E%3Cstop offset='1' stop-color='%23fff' stop-opacity='0'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg fill='none' stroke='url(%23g)'%3E%3Ccircle cx='760' cy='520' r='300' stroke-width='1.2'/%3E%3Ccircle cx='760' cy='520' r='420' stroke-width='1'/%3E%3Ccircle cx='760' cy='520' r='560' stroke-width='.8'/%3E%3C/g%3E%3C/svg%3E") center / 100% 100% no-repeat; }
.bcover::after { content: ""; position: absolute; z-index: -1; inset: 0; pointer-events: none;
  background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, .06) 50%, transparent 62%); }
.bcover__tag { position: absolute; z-index: 2; top: 6.5cqw; left: 6cqw; margin: 0; display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px 7px 10px; border-radius: 999px; font: 600 12.5px/1 var(--font); color: #e8eefc;
  border: 1px solid rgba(255, 255, 255, .28); background: rgba(255, 255, 255, .06); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.bcover__tag svg { width: 13px; height: 13px; color: #fff; }
.bcover__t { position: absolute; z-index: 2; top: 16cqw; left: 6cqw; width: 50%; margin: 0;
  font: 500 clamp(16px, 5.4cqw, 40px)/1.14 var(--font-display); letter-spacing: -.02em; color: #fff; text-wrap: balance; }
.bcover__obj { position: absolute; z-index: 1; right: -4%; bottom: -9%; width: 52%; height: auto; pointer-events: none;
  filter: drop-shadow(0 18px 28px rgba(3, 5, 20, .55)); transition: transform .8s var(--ease); }
.bcover__logo { position: absolute; z-index: 2; left: 6cqw; bottom: 6cqw; width: 9cqw; height: 9cqw; min-width: 30px; min-height: 30px; max-width: 46px; max-height: 46px;
  display: grid; place-items: center; border-radius: 28%; background: linear-gradient(145deg, #5aa0ff, #3d6bff 55%, #7a5cff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 8px 22px -8px rgba(61, 139, 255, .9); }
.bcover__logo svg { width: 58%; height: 58%; color: #fff; }
.bcard .bcover { border-bottom: 1px solid var(--line); }
.bcard:hover .bcover__obj { transform: translate(-1.5%, -2%) scale(1.04); }

.bcard__body { display: flex; flex-direction: column; flex: 1; padding: 22px 24px 24px; }
.bcard__body h2, .bcard__body h3 { margin: 0; font: 700 clamp(18px, 1.5vw, 20px)/1.3 var(--font-display); letter-spacing: -.01em; color: var(--text); text-wrap: balance; }
.bcard__body > p { margin: 12px 0 0; color: var(--muted); font-size: 15.5px; line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bcard__foot { margin-top: auto; padding-top: 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bcard__more { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; color: var(--accent-2); }
.bcard__more svg { width: 18px; height: 18px; transition: transform .3s var(--ease); }
.bcard:hover .bcard__more svg { transform: translateX(4px); }
.bcard__time { font: 500 12px var(--mono); color: var(--dim); }

/* картка-заклик у кінці сітки */
.bcard--cta { display: flex; min-height: 420px; border-color: rgba(127, 180, 255, .3);
  background: radial-gradient(90% 70% at 100% 0%, rgba(143, 124, 255, .28), transparent 70%), radial-gradient(90% 70% at 0% 100%, rgba(61, 139, 255, .26), transparent 70%), #05070b; }
.bcard__wave { position: absolute; z-index: -1; inset: auto -20% 30% -20%; width: 140%; height: auto; opacity: .55; mix-blend-mode: screen; pointer-events: none; }
.bcard__cta { margin-top: auto; padding: 28px; display: grid; gap: 14px; justify-items: start; }
.bcard__cta h2 { margin: 0; font: 800 clamp(26px, 2.4vw, 34px)/1.08 var(--font-display); letter-spacing: -.02em; color: #fff; }
.bcard__cta p { margin: 0; color: #c4c9d1; font-size: 15.5px; line-height: 1.6; }
.bcard__cta .btn { margin-top: 6px; }

/* перша стаття на головній блогу — широка */
@media (min-width: 900px) {
  .bgrid--hub .bcard:first-child { grid-column: 1 / -1; }
  .bgrid--hub .bcard:first-child .bcard__link { flex-direction: row; }
  .bgrid--hub .bcard:first-child .bcover { flex: 0 0 58%; aspect-ratio: 16 / 10; border-bottom: 0; border-right: 1px solid var(--line); }
  .bgrid--hub .bcard:first-child .bcard__body { padding: clamp(28px, 3vw, 44px); justify-content: center; }
  .bgrid--hub .bcard:first-child .bcard__body h2 { font-size: clamp(22px, 2.2vw, 30px); }
  .bgrid--hub .bcard:first-child .bcard__body > p { -webkit-line-clamp: 5; font-size: 17px; }
  .bgrid--hub .bcard:first-child .bcard__foot { margin-top: 28px; }
}

/* ── головна блогу ──────────────────────────────────────── */
.bhub { position: relative; padding: calc(var(--hdr-h) + clamp(40px, 6vw, 80px)) 0 var(--sec-y); isolation: isolate; }
.bhub::before { content: ""; position: absolute; z-index: -1; left: 50%; top: 0; width: min(1100px, 120vw); height: 520px; transform: translateX(-50%);
  background: radial-gradient(50% 60% at 50% 0%, rgba(61, 139, 255, .22), transparent 70%); pointer-events: none; }
.bhub__head { max-width: 780px; margin-bottom: clamp(36px, 5vw, 60px); }
.bhub__head h1 { font-size: clamp(34px, 5.4vw, 64px); line-height: 1.05; }
.bhub__head .lead { max-width: 640px; }

.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 22px; padding: 0; list-style: none; font: 500 13px var(--mono); color: var(--dim); }
.crumbs a { color: var(--muted); text-decoration: none; transition: color .2s; }
.crumbs a:hover { color: #fff; }
.crumbs li + li::before { content: "/"; margin-right: 8px; color: var(--dim); }
.crumbs [aria-current] { color: var(--muted); max-width: 40ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── стаття ─────────────────────────────────────────────── */
.post { position: relative; padding: calc(var(--hdr-h) + clamp(32px, 5vw, 64px)) 0 clamp(48px, 6vw, 80px); isolation: isolate; }
.post::before { content: ""; position: absolute; z-index: -1; left: 50%; top: 0; width: min(1100px, 120vw); height: 600px; transform: translateX(-50%);
  background: radial-gradient(50% 55% at 50% 0%, rgba(var(--tint, 61, 139, 255), .2), transparent 70%); pointer-events: none; }
.post__head { max-width: 820px; }
.post__tag { display: inline-flex; margin: 0 0 18px; padding: 7px 12px; border-radius: 999px; font: 600 12px/1 var(--mono); color: #dbe9ff;
  background: rgba(var(--tint, 61, 139, 255), .18); border: 1px solid rgba(var(--tint, 61, 139, 255), .36); }
.post h1 { font-size: clamp(32px, 5vw, 58px); line-height: 1.06; text-wrap: balance; }
.post__lead { margin: 22px 0 0; font-size: clamp(18px, 1.7vw, 21px); line-height: 1.6; color: #c4c9d1; max-width: 720px; }
.post__meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 22px 0 0; padding: 0; list-style: none; font: 500 13px var(--mono); color: var(--muted); }
.post__meta li { display: inline-flex; align-items: center; gap: 8px; }
.post__meta svg { width: 16px; height: 16px; color: var(--accent-2); }

.post__cover { margin: clamp(32px, 4vw, 52px) 0 0; border-radius: clamp(20px, 2.4vw, 32px); overflow: hidden; border: 1px solid var(--line-2);
  box-shadow: 0 50px 120px -50px rgba(var(--tint, 61, 139, 255), .6); }
.post__cover .bcover { aspect-ratio: 21 / 9; }
.post__cover .bcover__t { width: 50%; top: 13cqw; font-size: clamp(22px, 4.2cqw, 50px); }
.post__cover .bcover__tag { top: 5cqw; left: 5cqw; font-size: 14px; padding: 9px 16px 9px 12px; }
.post__cover .bcover__obj { width: 46%; right: 2%; bottom: -12%; }
.post__cover .bcover__logo { left: 5cqw; bottom: 5cqw; }

.post__grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: clamp(32px, 5vw, 72px); align-items: start; margin-top: clamp(36px, 5vw, 64px); }
.post__aside { position: sticky; top: calc(var(--hdr-h) + 24px); display: grid; gap: 16px; }
.toc { padding: 20px 22px; border-radius: 22px; border: 1px solid var(--line); background: var(--card); }
.toc b { display: block; margin-bottom: 12px; font: 600 12px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: toc; }
.toc li { counter-increment: toc; display: grid; grid-template-columns: 22px 1fr; font-size: 14.5px; line-height: 1.4; }
.toc li::before { content: counter(toc, decimal-leading-zero); font: 500 11px/1.9 var(--mono); color: var(--accent-2); }
.toc a { color: #c4c9d1; text-decoration: none; transition: color .2s; }
.toc a:hover { color: #fff; }
.aside-cta { padding: 22px; border-radius: 22px; border: 1px solid rgba(127, 180, 255, .28);
  background: radial-gradient(90% 80% at 0% 0%, rgba(61, 139, 255, .2), transparent 70%), var(--card); }
.aside-cta p { margin: 0 0 16px; font: 700 17px/1.35 var(--font-display); color: #fff; }
.aside-cta .btn { width: 100%; justify-content: center; }
@media (max-width: 980px) {
  .post__grid { grid-template-columns: minmax(0, 1fr); }
  .post__aside { display: none; }
  .post__cover .bcover { aspect-ratio: 16 / 10; }
  .post__cover .bcover__obj { width: 52%; right: -4%; bottom: -9%; }
  .post__cover .bcover__t { width: 50%; top: 16cqw; font-size: clamp(16px, 5.4cqw, 40px); }
}

/* текст статті */
.prose { max-width: 740px; font-size: clamp(17px, 1.35vw, 18.5px); line-height: 1.78; color: #c4c9d1; }
.prose > :first-child { margin-top: 0; }
.prose h2 { margin: 2.6em 0 0; font-size: clamp(24px, 2.6vw, 32px); line-height: 1.2; color: #fff; scroll-margin-top: calc(var(--hdr-h) + 24px); text-wrap: balance; }
.prose h3 { margin: 1.9em 0 0; font-size: clamp(19px, 1.8vw, 22px); line-height: 1.3; color: #fff; }
.prose p { margin: 1.05em 0 0; }
.prose b, .prose strong { color: #fff; font-weight: 700; }
.prose a { color: var(--accent-2); text-decoration: underline; text-decoration-color: rgba(127, 180, 255, .4); text-underline-offset: 3px; transition: text-decoration-color .2s; }
.prose a:hover { text-decoration-color: currentColor; }
.prose ul, .prose ol { margin: 1.05em 0 0; padding-left: 1.3em; display: grid; gap: .5em; }
.prose li::marker { color: var(--accent-2); font-weight: 700; }
.prose code { font: 500 .86em var(--mono); padding: .15em .45em; border-radius: 8px; color: #dbe9ff; background: rgba(61, 139, 255, .14); border: 1px solid rgba(61, 139, 255, .22); }
.prose pre { margin: 1.4em 0 0; padding: 20px 22px; border-radius: 18px; border: 1px solid var(--line-2); background: #05070a; overflow-x: auto; font: 500 14.5px/1.7 var(--mono); color: #dbe9ff; }
.prose pre code { padding: 0; border: 0; background: none; font-size: inherit; }

/* кроки 1-2-3 */
.prose ol.howto { list-style: none; padding: 0; counter-reset: st; gap: 14px; margin-top: 1.4em; }
.prose ol.howto > li { counter-increment: st; position: relative; padding: 18px 20px 18px 66px; border-radius: 20px; border: 1px solid var(--line); background: var(--card); }
.prose ol.howto > li::before { content: counter(st); position: absolute; left: 18px; top: 16px; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%;
  font: 700 14px var(--font-display); color: #fff; background: linear-gradient(140deg, var(--accent), #8f7cff); box-shadow: 0 6px 20px -6px var(--accent-glow); }

.prose ol.howto { grid-template-columns: minmax(0, 1fr); }
.prose .pcta .btn { color: #05070b; text-decoration: none; flex: none; }

/* підказка й порада */
.prose .tip { margin: 1.6em 0 0; padding: 20px 22px 20px 58px; position: relative; border-radius: 20px; border: 1px solid rgba(127, 180, 255, .28);
  background: radial-gradient(90% 100% at 0% 0%, rgba(61, 139, 255, .16), transparent 70%), var(--card); color: #d6dbe2; }
.prose .tip::before { content: ""; position: absolute; left: 22px; top: 22px; width: 20px; height: 20px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff, var(--accent-2) 40%, var(--accent) 75%); box-shadow: 0 0 18px var(--accent-glow); }
.prose .tip p:first-child { margin-top: 0; }

/* порівняльна таблиця */
.prose .tbl { margin: 1.4em 0 0; overflow-x: auto; border-radius: 18px; border: 1px solid var(--line); }
.prose table { width: 100%; border-collapse: collapse; font-size: 15.5px; line-height: 1.5; }
.prose th, .prose td { padding: 13px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.prose th { font: 600 12px var(--mono); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); background: rgba(255, 255, 255, .025); }
.prose tr:last-child td { border-bottom: 0; }
.prose td:first-child { color: #fff; font-weight: 600; }

/* заклик усередині статті */
.pcta { margin: 2.2em 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 18px 24px; padding: 24px 26px; border-radius: 24px;
  border: 1px solid rgba(127, 180, 255, .3); background: radial-gradient(70% 120% at 100% 0%, rgba(143, 124, 255, .18), transparent 65%),
  radial-gradient(70% 120% at 0% 100%, rgba(61, 139, 255, .2), transparent 65%), var(--card); }
.pcta p { flex: 1 1 280px; margin: 0; color: #d6dbe2; font-size: 16.5px; line-height: 1.55; }
.pcta p b { display: block; margin-bottom: 4px; font: 700 19px/1.3 var(--font-display); color: #fff; }

/* читайте також */
.more { padding: clamp(40px, 6vw, 80px) 0 var(--sec-y); }
.more h2 { font-size: clamp(26px, 3.4vw, 40px); margin-bottom: clamp(24px, 3vw, 36px); }
