/* Codzea — blog (listing + article). Loaded after styles.css on /blog pages. */

.nav-links a[aria-current="page"] { color: var(--accent); }

/* Listing */
.blog-hero { padding-top: clamp(40px, 7vw, 96px); }
.blog-hero h1 { margin-top: 24px; max-width: 13ch; }
.blog-hero .lead { margin-top: 24px; max-width: 36em; }

.posts { margin-top: clamp(40px, 6vw, 72px); grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.post-card { display: flex; flex-direction: column; overflow: hidden; transition: transform .6s var(--ease), box-shadow .6s var(--ease); }
.post-card:hover { transform: translateY(-4px); box-shadow: 0 24px 48px -32px rgba(0, 0, 0, .35); }
.post-cover { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-2); }
.post-cover img { width: 100%; height: 100%; object-fit: cover; transform: scale(1.001); transition: transform 1.1s var(--ease); }
.post-card:hover .post-cover img { transform: scale(1.045); }
.post-text { display: flex; flex-direction: column; gap: 16px; flex: 1; padding: 24px 28px 28px; }
.post-card h2 { font-size: clamp(22px, 2vw, 26px); line-height: 1.15; letter-spacing: -.03em; text-wrap: balance; transition: color .4s var(--ease); }
.post-card:hover h2 { color: var(--accent); }
.post-card p { color: var(--muted); line-height: 1.55; }
.post-card .post-meta { margin-top: auto; }
.post-card.featured { background: var(--dark); color: #fff; }
.post-card.featured:hover h2 { color: var(--lilac); }
.post-card.featured p, .post-card.featured .post-meta { color: var(--dark-muted); }
.post-card.featured .tag { background: var(--dark-3); color: #fff; }
.post-card.featured .tag-accent { background: var(--lilac); color: var(--ink); }
@media (min-width: 900px) {
  .post-card.featured { grid-column: span 2; display: grid; grid-template-columns: 1.15fr 1fr; }
  .post-card.featured .post-cover { aspect-ratio: auto; height: 100%; min-height: 360px; }
  .post-card.featured .post-text { padding: 36px; justify-content: center; }
  .post-card.featured h2 { font-size: clamp(28px, 3vw, 40px); max-width: 16ch; }
}
.post-meta { margin-top: auto; }
.post-card.featured { background: var(--dark); color: #fff; }
.post-card.featured p, .post-card.featured .post-meta { color: var(--dark-muted); }
.post-card.featured .tag { background: var(--dark-3); color: #fff; }
.post-card.featured .tag-accent { background: var(--lilac); color: var(--ink); }
@media (min-width: 900px) {
  .post-card.featured { grid-column: span 2; }
  .post-card.featured h2 { font-size: clamp(28px, 3vw, 40px); max-width: 18ch; }
}
.post-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; color: var(--muted); }

/* Pagination + load more (blog.js builds the pager; without JS all posts show) */
.posts > [hidden] { display: none; }
.posts { scroll-margin-top: 120px; }
.posts > .appear { animation: rise .7s var(--ease) both; }
.pager { display: grid; justify-items: center; gap: 16px; margin-top: clamp(32px, 5vw, 56px); }
.pager [hidden] { display: none; }
.pager-status { font-size: 14px; color: var(--muted); }
.pager-pages { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; list-style: none; margin: 0; padding: 0; }
.pager-pages a {
  display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line-2); font-size: 15px; font-weight: 600; color: var(--ink-2);
  transition: background .2s, color .2s, border-color .2s;
}
.pager-pages a:hover { border-color: var(--ink); color: var(--ink); }
.pager-pages a.on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* Article */
.article-head { padding-top: clamp(32px, 6vw, 80px); }
.article-head > * { max-width: 880px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.lang-link { display: inline-flex; margin-top: 14px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--muted); }
.lang-link:hover { color: var(--accent); border-color: currentColor; }
.article-head .tags { margin-top: 28px; }
.article-head h1 { margin-top: 20px; font-size: clamp(34px, 5vw, 64px); line-height: 1.02; letter-spacing: -.045em; text-wrap: balance; }
.article-head .lead { margin-top: 24px; }
.article-head .post-meta { margin-top: 28px; align-items: center; }
.article-head .post-meta img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.article-head .post-meta b { color: var(--ink); font-weight: 600; }

.article-cover { margin-top: clamp(32px, 5vw, 56px); }
.article-cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--r-lg); }

.article-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; margin-top: clamp(40px, 6vw, 64px); }
@media (min-width: 1060px) {
  .article-layout { grid-template-columns: minmax(0, 720px) 1fr; gap: 80px; }
  .toc { position: sticky; top: 120px; align-self: start; }
}

.prose { font-size: 18px; line-height: 1.72; color: var(--ink-2); }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { margin-top: 2.2em; font-size: clamp(26px, 2.6vw, 34px); line-height: 1.12; letter-spacing: -.035em; color: var(--ink); scroll-margin-top: 110px; }
.prose h3 { margin-top: 1.8em; font-size: 21px; line-height: 1.25; letter-spacing: -.02em; color: var(--ink); }
.prose h2 + *, .prose h3 + * { margin-top: .6em; }
.prose strong { color: var(--ink); }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose a:hover { color: var(--accent-ink); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .45em; }
.prose li::marker { color: var(--accent); font-weight: 700; }
.prose blockquote { margin-left: 0; margin-right: 0; padding: 20px 24px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--ink); font-weight: 500; }
.prose .callout { padding: 24px 28px; background: var(--surface); border-radius: var(--r-md); font-size: 17px; }
.prose .callout > * + * { margin-top: .7em; }
.prose .callout b:first-child { display: block; color: var(--ink); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }

/* Free check offer inside an article */
.prose .offer { display: grid; gap: 12px; margin-top: 2em; padding: clamp(22px, 3vw, 30px); background: var(--accent-soft); border-radius: var(--r-md); border: 1px solid rgba(75, 47, 224, .18); }
.prose .offer > * + * { margin-top: 0; }
.prose .offer h3 { margin-top: 0; font-size: clamp(22px, 2.2vw, 26px); letter-spacing: -.03em; }
.prose .offer p { font-size: 17px; line-height: 1.6; }
.prose .offer .btn { justify-self: start; margin-top: 4px; color: #fff; text-decoration: none; }

.prose .table-scroll { overflow-x: auto; background: var(--surface); border-radius: var(--r-md); }
.prose table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 15px; line-height: 1.45; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.prose thead th { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.prose tbody tr:last-child > * { border-bottom: 0; }
.prose tbody th { color: var(--ink); font-weight: 700; }

.prose figure { margin: 2em 0; }
.prose figure img { width: 100%; border-radius: var(--r-md); background: var(--surface); box-shadow: 0 1px 0 var(--line), 0 18px 40px -30px rgba(0, 0, 0, .3); }
.prose figcaption { margin-top: 12px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.prose .fig-phones > div { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(8px, 2vw, 20px); padding: clamp(16px, 3vw, 32px); background: var(--accent-soft); border-radius: var(--r-md); }
.prose .fig-phones img { border-radius: 18px; box-shadow: 0 14px 30px -20px rgba(0, 0, 0, .35); }

.toc { font-size: 15px; }
.toc b { display: block; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.toc ol { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; border-left: 1px solid var(--line-2); }
.toc a { display: block; padding-left: 16px; color: var(--ink-2); line-height: 1.35; }
.toc a { transition: color .3s var(--ease), border-color .3s var(--ease); border-left: 2px solid transparent; margin-left: -1px; }
.toc a:hover { color: var(--accent); }
.toc a.on { color: var(--ink); font-weight: 600; border-left-color: var(--accent); }
@media (max-width: 1059px) { .toc { display: none; } }

/* Article CTA */
.article-cta { margin-top: 64px; padding: clamp(28px, 4vw, 44px); background: var(--dark); color: #fff; border-radius: var(--r-lg); display: grid; gap: 20px; }
.article-cta h2 { font-size: clamp(28px, 3.4vw, 42px); line-height: 1.05; letter-spacing: -.04em; max-width: 16ch; }
.article-cta p { color: var(--dark-muted); max-width: 32em; line-height: 1.6; }
.article-cta .btn { justify-self: start; }

.related h2 { font-size: clamp(28px, 3.4vw, 44px); letter-spacing: -.04em; }
.related .posts { margin-top: 32px; }

/* Custom cursor over article cards (fine pointers only; JS adds .has-cursor) */
.cursor {
  position: fixed; left: 0; top: 0; z-index: 50; pointer-events: none;
  width: 92px; height: 92px; margin: -46px 0 0 -46px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent); color: #fff;
  font-size: 14px; font-weight: 700; letter-spacing: .01em;
  transform: translate3d(var(--x, -200px), var(--y, -200px), 0) scale(0); opacity: 0;
  transition: transform .45s var(--ease), opacity .3s var(--ease);
}
.cursor.on { transform: translate3d(var(--x), var(--y), 0) scale(1); opacity: 1; }
.cursor.press { transform: translate3d(var(--x), var(--y), 0) scale(.86); }
.cursor.dark { background: var(--lilac); color: var(--ink); }
.has-cursor [data-cursor], .has-cursor [data-cursor] * { cursor: none; }

/* Reading progress */
.progress { position: fixed; left: 0; top: 0; z-index: 30; width: 100%; height: 3px; background: var(--accent); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); pointer-events: none; }

/* Entrance + scroll reveal */
.blog-hero > *, .article-head > *, .article-cover { animation: rise .9s var(--ease) both; }
.blog-hero > :nth-child(2), .article-head > :nth-child(2) { animation-delay: .06s; }
.blog-hero > :nth-child(3), .article-head > :nth-child(3) { animation-delay: .12s; }
.blog-hero > :nth-child(4), .article-head > :nth-child(4) { animation-delay: .18s; }
.article-head > :nth-child(n+5) { animation-delay: .24s; }
.article-cover { animation-delay: .3s; }
.article-cover img { animation: settle 1.6s .3s var(--ease) both; }
@keyframes settle { from { transform: scale(1.04); } to { transform: none; } }
.js .soft { opacity: 0; transform: translateY(18px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
.js .soft.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .post-card, .post-cover img, .cursor { transition: none; }
  .post-card:hover { transform: none; }
  .post-card:hover .post-cover img { transform: none; }
  .js .soft { opacity: 1; transform: none; }
  .posts > .appear { animation: none; }
  .progress { display: none; }
}
