/* =========================================================
   Technoknowledge: blog.css  (blog list + blog posts)
   ========================================================= */

/* ---------- covers: brand braces from the logo + topic icon ---------- */
.pcover { --c1: var(--navy); --c2: #24467A; --ink: var(--yellow);
  position: relative; display: flex; align-items: center; justify-content: center; gap: 6%;
  aspect-ratio: 16 / 9; overflow: hidden; color: var(--ink);
  background:
    radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.16), transparent 40%),
    radial-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1.4px) 0 0 / 16px 16px,
    linear-gradient(135deg, var(--c1), var(--c2)); }
.pcover__brace { font-family: var(--font-heading); font-weight: 800; font-size: clamp(3rem, 7vw, 4.6rem); line-height: 1; opacity: 0.9; transition: transform 500ms var(--ease); }
.pcover__icon { width: 30%; max-width: 92px; aspect-ratio: 1; border-radius: 22%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.16); border: 1px solid rgba(255, 255, 255, 0.25); }
.pcover__icon svg { width: 52%; height: 52%; }
.pcover--navy   { --c1: #13294B; --c2: #24467A; --ink: #FFD400; }
.pcover--orange { --c1: #E24700; --c2: #FF7A3D; --ink: #fff; }
.pcover--green  { --c1: #237047; --c2: #3AA56A; --ink: #fff; }
.pcover--sky    { --c1: #0086C2; --c2: #29B6F0; --ink: #fff; }
.pcover--yellow { --c1: #FFC400; --c2: #FFE066; --ink: #13294B; }
.pcover--blue   { --c1: #1F6CB0; --c2: #4A92D4; --ink: #fff; }
.pcover--red    { --c1: #B02A1A; --c2: #E0533F; --ink: #fff; }
a:hover .pcover__brace { transform: translateX(-6px); }
a:hover .pcover__brace--r { transform: translateX(6px); }

/* ---------- list page hero ---------- */
.blog-hero { padding-bottom: clamp(56px, 6vw, 88px); }
.code-card { max-width: 460px; margin-left: auto; border-radius: 14px; background: #0B1A30; border: 1px solid rgba(255, 255, 255, 0.1); box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35); overflow: hidden; transform: rotate(-1.5deg); }
.code-card__bar { display: flex; align-items: center; gap: 6px; padding: 10px 14px; background: rgba(255, 255, 255, 0.06); }
.code-card__bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--orange); }
.code-card__bar i:nth-child(2) { background: var(--yellow); } .code-card__bar i:nth-child(3) { background: var(--green); }
.code-card__bar span { margin-left: 8px; font-size: 12px; color: #8FA0BA; }
.code-card pre { margin: 0; padding: 20px 22px 24px; font: 500 14px/1.75 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: #DCE3EE; white-space: pre; overflow-x: auto; }
.code-card b { color: var(--sky); font-weight: 600; } .code-card em { color: #FF8FB0; font-style: normal; }
.code-card s { color: var(--yellow); text-decoration: none; } .code-card u { color: #6E86A8; text-decoration: none; }
@media (max-width: 1099px) { .blog-hero__media { display: none; } }

/* ---------- featured post ---------- */
.feature-post { display: grid; border-radius: var(--radius-lg); overflow: hidden; background: #fff; border: 1px solid var(--border); text-decoration: none; color: inherit; transition: box-shadow var(--t-med), transform var(--t-med) var(--ease); }
.feature-post:hover { box-shadow: var(--shadow-lg); transform: translateY(-3px); }
@media (min-width: 900px) { .feature-post { grid-template-columns: 1.05fr 1fr; } .feature-post .pcover { aspect-ratio: auto; min-height: 100%; } }
.feature-post__body { padding: clamp(24px, 3vw, 40px); display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.feature-post h2 { font-size: var(--fs-h3); }
.feature-post__body > p:not(.bcard__cat):not(.bcard__meta) { color: var(--text-muted); }
.feature-post__more { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; font-weight: 800; color: var(--blue); }
.feature-post__more svg { width: 18px; height: 18px; transition: transform var(--t-fast); }
.feature-post:hover .feature-post__more svg { transform: translateX(4px); }
.pcover--feature .pcover__brace { font-size: clamp(4rem, 9vw, 7rem); }

/* ---------- tools: topics + search ---------- */
.blog-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin: 40px 0 24px; }
.topics { display: flex; flex-wrap: wrap; gap: 8px; }
.topic { min-height: 40px; padding: 6px 14px; border-radius: var(--radius-pill); border: 1.5px solid var(--border-strong); background: #fff; color: var(--navy); font-family: var(--font-heading); font-weight: 700; font-size: var(--fs-sm); cursor: pointer; transition: all var(--t-fast); }
.topic small { margin-left: 2px; font-weight: 600; opacity: 0.6; }
.topic:hover { border-color: var(--navy); }
.topic[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.blog-search { position: relative; flex: 0 1 280px; }
.blog-search span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); display: grid; }
.blog-search svg { width: 18px; height: 18px; }
.blog-search input { width: 100%; min-height: 44px; padding: 8px 14px 8px 42px; border-radius: var(--radius-pill); border: 1.5px solid var(--border-strong); font: inherit; background: #fff; }
.blog-search input:focus { outline: none; border-color: var(--blue); box-shadow: var(--focus-ring); }
.no-js .blog-tools { display: none; }
.blog-empty { margin-top: 24px; padding: 28px; text-align: center; border-radius: var(--radius-md); background: var(--bg-soft); color: var(--text-muted); font-weight: 700; }

/* ---------- cards ---------- */
.bgrid { list-style: none; padding: 0; display: grid; gap: 20px; }
@media (min-width: 640px) { .bgrid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .bgrid { grid-template-columns: repeat(3, 1fr); gap: 24px; } }
.bcard[hidden] { display: none; }
.bcard__link { height: 100%; display: flex; flex-direction: column; border-radius: var(--radius-lg); overflow: hidden; background: #fff; border: 1px solid var(--border); text-decoration: none; color: inherit; transition: transform var(--t-med) var(--ease), box-shadow var(--t-med); }
.bcard__link:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.bcard__link:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.bcard__body { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 20px 22px 22px; }
.bcard__cat { font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--blue); }
.bcard__new { margin-left: 6px; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--yellow); color: var(--navy); letter-spacing: 0.04em; }
.bcard h3 { font-size: 1.15rem; line-height: 1.35; }
.bcard__desc { color: var(--text-muted); font-size: var(--fs-sm); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.bcard__meta { margin-top: auto; padding-top: 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; color: var(--text-soft, #6B7385); font-size: 13px; font-weight: 600; }
.bcard__meta svg { width: 15px; height: 15px; }
.bcard--sm .bcard__body { padding: 16px 18px 18px; }
.bcard--sm .pcover__brace { font-size: 2.6rem; }
.js .bcard:not([hidden]) { animation: tk-fade-up 380ms var(--ease); }

/* ---------- next steps ---------- */
.blog-next { list-style: none; padding: 0; display: grid; gap: 18px; }
@media (min-width: 900px) { .blog-next { grid-template-columns: repeat(3, 1fr); } }
.blog-next__card { height: 100%; display: flex; flex-direction: column; gap: 8px; padding: 26px; border-radius: var(--radius-lg); text-decoration: none; color: #fff; transition: transform var(--t-med) var(--ease); }
.blog-next__card:hover { transform: translateY(-4px); }
.blog-next__card strong { font-family: var(--font-heading); font-size: var(--fs-h4); }
.blog-next__card span { opacity: 0.9; }
.blog-next__card em { margin-top: auto; padding-top: 10px; display: inline-flex; align-items: center; gap: 8px; font-style: normal; font-weight: 800; }
.blog-next__card em svg { width: 18px; height: 18px; }
.blog-next__card--navy { background: var(--navy); } .blog-next__card--navy em { color: var(--yellow); }
.blog-next__card--orange { background: #D94400; }
.blog-next__card--green { background: var(--green); }

/* =========================================================
   Blog post page
   ========================================================= */
.read-progress { position: fixed; inset: 0 0 auto; height: 4px; z-index: 200; pointer-events: none; }
.read-progress span { display: block; height: 100%; background: var(--yellow); transform: scaleX(0); transform-origin: left; }

.post-hero { position: relative; overflow: hidden; background: var(--navy); color: #C9D3E3; padding: clamp(24px, 4vw, 48px) 0 clamp(40px, 5vw, 64px); }
.post-hero__inner { display: grid; gap: 32px; align-items: center; }
@media (min-width: 1000px) { .post-hero__inner { grid-template-columns: 1.4fr 0.8fr; gap: 56px; } }
.post-hero__cat { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; padding: 5px 14px 5px 6px; border-radius: var(--radius-pill); background: rgba(255, 255, 255, 0.1); color: #fff; font-weight: 700; font-size: var(--fs-sm); text-decoration: none; }
.post-hero__cat:hover { background: rgba(255, 255, 255, 0.18); }
.post-hero__cat span { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--yellow); color: var(--navy); }
.post-hero__cat svg { width: 16px; height: 16px; }
.post-hero h1 { margin-top: 14px; color: #fff; font-size: clamp(2rem, 1.4rem + 2.4vw, 3.1rem); line-height: 1.15; letter-spacing: -0.02em; }
.post-hero__lead { margin-top: 14px; font-size: var(--fs-lg); line-height: 1.6; max-width: 62ch; }
.post-hero__meta { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: var(--fs-sm); font-weight: 600; }
.post-hero__meta span { display: inline-flex; align-items: center; gap: 7px; }
.post-hero__meta svg { width: 16px; height: 16px; color: var(--yellow); }
.pcover--hero { border-radius: var(--radius-lg); box-shadow: 0 24px 50px rgba(0, 0, 0, 0.3); }
@media (max-width: 999px) { .pcover--hero { display: none; } }

.post-layout { display: grid; gap: 32px; padding-block: clamp(36px, 5vw, 64px); }
@media (min-width: 1000px) { .post-layout { grid-template-columns: 250px minmax(0, 1fr); gap: 56px; } }
.post-aside { align-self: start; display: grid; gap: 24px; }
@media (min-width: 1000px) { .post-aside { position: sticky; top: calc(var(--header-h) + 24px); max-height: calc(100vh - var(--header-h) - 48px); overflow: auto; } }
.toc__title { font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px; }
.toc ol { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--border); }
.toc a { display: block; padding: 6px 0 6px 14px; margin-left: -2px; border-left: 2px solid transparent; color: var(--text-muted); font-size: var(--fs-sm); line-height: 1.4; text-decoration: none; transition: color var(--t-fast), border-color var(--t-fast); }
.toc a:hover { color: var(--navy); }
.toc a.is-current { color: var(--navy); font-weight: 700; border-color: var(--yellow); }
@media (max-width: 999px) {
  .toc { padding: 18px 20px; border-radius: var(--radius-md); background: var(--bg-soft); }
  .toc ol { max-height: 220px; overflow: auto; }
  .share { order: 2; }
}
.share__row { display: flex; flex-wrap: wrap; gap: 8px; }
.share__btn { height: 40px; min-width: 40px; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: var(--radius-pill); border: 1.5px solid var(--border-strong); background: #fff; color: var(--navy); font: 700 13px var(--font-body); cursor: pointer; text-decoration: none; transition: all var(--t-fast); }
.share__btn svg { width: 18px; height: 18px; }
.share__btn:hover { border-color: var(--navy); background: var(--navy); color: #fff; }
.share__btn--wa:hover { background: var(--whatsapp); border-color: var(--whatsapp); }

/* readable article text */
.prose { max-width: 72ch; font-size: 1.075rem; line-height: 1.8; color: var(--text); }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { margin-top: 2.2em; font-size: clamp(1.45rem, 1.2rem + 0.9vw, 1.9rem); line-height: 1.25; scroll-margin-top: calc(var(--header-h) + 20px); }
.prose h2::before { content: ""; display: block; width: 44px; height: 4px; border-radius: 2px; background: var(--yellow); margin-bottom: 14px; }
.prose h3 { margin-top: 1.8em; font-size: 1.25rem; line-height: 1.35; }
.prose h4 { margin-top: 1.4em; font-size: 1.08rem; }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: 0.6em; }
.prose p, .prose li { color: #2E3546; }
.prose strong { color: var(--navy); }
.prose a { color: var(--blue); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.prose a:hover { color: var(--navy); }
.prose ul, .prose ol { padding-left: 0; list-style: none; }
.prose li { position: relative; padding-left: 28px; }
.prose li + li { margin-top: 0.5em; }
.prose ul > li::before { content: ""; position: absolute; left: 6px; top: 0.72em; width: 8px; height: 8px; border-radius: 2px; background: var(--yellow); transform: rotate(45deg); }
.prose ol { counter-reset: n; }
.prose ol > li { counter-increment: n; }
.prose ol > li::before { content: counter(n); position: absolute; left: 0; top: 0.2em; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: #fff; font-size: 12px; font-weight: 800; }
.prose code { padding: 2px 6px; border-radius: 6px; background: var(--navy-soft); color: var(--navy); font-size: 0.9em; }
.prose em { color: var(--text-muted); }
.prose > p:first-child { font-size: 1.15rem; color: var(--text); }

.post-cta { margin-top: 3em !important; display: grid; gap: 18px; align-items: center; padding: 28px; border-radius: var(--radius-lg); background: var(--navy); color: #C9D3E3; }
@media (min-width: 700px) { .post-cta { grid-template-columns: 1fr auto; } }
.prose .post-cta__title { margin: 0; color: #fff; font-size: 1.35rem; }
.prose .post-cta__title::before { display: none; }
.post-cta p { margin-top: 6px; color: #C9D3E3; }

.related__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.related__head h2 { font-size: var(--fs-h2); }

@media print {
  .site-header, .site-footer, .post-aside, .read-progress, .wa-float, section.section--soft, .post-cta { display: none !important; }
  .post-hero { background: none; color: #000; } .post-hero h1 { color: #000; }
}

/* refinements */
.bgrid .pcover { aspect-ratio: 16 / 7; }
.bgrid .pcover__brace { font-size: clamp(2.4rem, 4.5vw, 3.2rem); }
.bgrid .pcover__icon { width: 22%; max-width: 64px; }
.prose .post-cta a.btn { color: var(--navy); text-decoration: none; }
.prose ol > li { padding-left: 34px; }
.prose ol > li::before { top: 0.3em; width: 22px; height: 22px; }

/* typing caret for the code card (typer.js) */
.typer-caret { display: inline-block; width: 0.55em; height: 1.15em; margin-left: 1px; vertical-align: -0.2em; background: var(--yellow); animation: typer-blink 1s steps(1) infinite; }
.typer-caret:not(.is-done) { animation: none; }
@keyframes typer-blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .typer-caret { animation: none; } }
