/*
Theme Name: AlgoCademy 2026
Description: The blog in the AlgoCademy site's design: the site's header, footer, palette and fonts (landing.css and algocademy.css from the site's root), posts set for reading, and a box per post with the free lesson on its topic.
Version: 2.0.0
Text Domain: algocademy
*/

/* The site's palette (landing.css :root): --paper, --ink, --muted, --line, --blue, --lime. */
.blog-page { --card: #fff; --soft: #eef2e8; --code-bg: #141b24; --code-text: #e3e8ef; background: var(--paper); }
.blog-main { display: block; min-height: 60vh; }
.site-header nav a[aria-current="page"] { color: var(--blue); }

/* ---- Lists: the blog's home, search, archives ------------------------------------------------ */
.blog-hero { text-align: center; padding-block: 56px 40px; border-bottom: 1px solid var(--line); }
.blog-hero .eyebrow { margin-bottom: 22px; text-transform: uppercase; letter-spacing: 1px; font-size: 11px; }
.blog-hero .eyebrow .dot, .blog-offer .eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: #6d8b3a; }
.blog-hero h1 { font-size: clamp(34px, 5vw, 56px); line-height: 1.05; letter-spacing: -2px; margin-bottom: 14px; }
.blog-hero-lead { font-size: 17px; color: var(--muted); margin-bottom: 0; }
.blog-search { position: relative; width: min(560px, 100%); margin: 28px auto 0; }
.blog-search svg { position: absolute; left: 16px; top: 50%; width: 19px; height: 19px; transform: translateY(-50%); color: var(--muted); }
.blog-search input { width: 100%; height: 52px; padding: 0 18px 0 46px; border: 1px solid #cfd8cc; border-radius: 12px; background: #fff; color: var(--ink); font-size: 15px; outline: none; }
.blog-search input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px #076b951a; }
.blog-list { padding-block: 44px 70px; }
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.blog-card { display: flex; flex-direction: column; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: 16px; transition: transform .18s, box-shadow .18s, border-color .18s; }
.blog-card:hover { transform: translateY(-3px); border-color: #c5d2c1; box-shadow: 0 14px 30px #172e3612; }
.blog-card-image { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: var(--soft); }
.blog-card-blank { background: linear-gradient(135deg, #e7f0d2, #dbe9ef); }
.blog-card-body { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px 20px; flex: 1; }
.blog-card-title { font-size: 18px; line-height: 1.35; font-weight: 650; letter-spacing: -.2px; }
.blog-card-meta { margin-top: auto; font-size: 13px; color: var(--muted); }
.blog-pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 44px; }
.blog-pagination .page-numbers { min-width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 14px; font-weight: 600; }
.blog-pagination .page-numbers.current { background: var(--ink); border-color: var(--ink); color: #fff; }
.blog-pagination a.page-numbers:hover { border-color: var(--blue); color: var(--blue); }
.blog-pagination .dots { border: 0; background: none; }
.blog-empty { text-align: center; color: var(--muted); font-size: 17px; }
.blog-empty a { color: var(--blue); text-decoration: underline; }

/* ---- A post ------------------------------------------------------------------------------------ */
.post-article { width: min(760px, calc(100% - 40px)); margin: 0 auto; padding-block: 52px 30px; }
.post-kicker { margin-bottom: 18px; font-size: 12px; font-weight: 700; letter-spacing: 1.3px; text-transform: uppercase; }
.post-kicker a { color: var(--blue); }
.post-title { font-size: clamp(32px, 5vw, 48px); line-height: 1.1; letter-spacing: -1.6px; margin-bottom: 18px; }
.post-meta { color: var(--muted); font-size: 14px; margin-bottom: 30px; }
.post-image { margin: 0 0 38px; }
.post-image img { display: block; width: 100%; height: auto; max-height: 440px; object-fit: cover; border-radius: 18px; border: 1px solid var(--line); }
.post-body { font-size: 18px; line-height: 1.75; color: #2a3c41; overflow-wrap: break-word; }
.post-body > * + * { margin-top: 1.1em; }
.post-body p { line-height: 1.75; margin-bottom: 0; }
.post-body h2 { font-size: 28px; line-height: 1.25; letter-spacing: -.6px; margin: 1.9em 0 .2em; color: var(--ink); }
.post-body h3 { font-size: 21px; line-height: 1.3; letter-spacing: -.3px; margin: 1.6em 0 .1em; color: var(--ink); }
.post-body h4 { font-size: 18px; margin: 1.4em 0 0; color: var(--ink); }
.post-body a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.post-body a:hover { text-decoration-thickness: 2px; }
.post-body ul, .post-body ol { padding-left: 1.4em; }
.post-body li + li { margin-top: .45em; }
.post-body strong { color: var(--ink); font-weight: 650; }
.post-body blockquote { margin-left: 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--lime); color: var(--muted); font-style: italic; }
.post-body img { max-width: 100%; height: auto; border-radius: 12px; }
.post-body figure { margin-inline: 0; }
.post-body figcaption { font-size: 14px; color: var(--muted); text-align: center; margin-top: 8px; }
.post-body hr { border: 0; border-top: 1px solid var(--line); margin-block: 2.2em; }
.post-body table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.post-body th, .post-body td { padding: 9px 12px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.post-body th { background: var(--soft); font-weight: 650; }
.post-body :not(pre) > code { padding: 2px 6px; border-radius: 6px; background: #e9eee4; color: #1d3b44; font: .86em/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
/* Code blocks, dark like the app's editor; Code Prettify's sons-of-obsidian skin colors them. */
.post-body pre, .post-body pre.prettyprint { margin-block: 1.4em; padding: 18px 20px; overflow-x: auto; border: 0 !important; border-radius: 14px; background: var(--code-bg) !important; color: var(--code-text); font: 14.5px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; tab-size: 4; }
.post-body pre code { padding: 0; background: none; color: inherit; font: inherit; white-space: pre; }
.post-body pre.prettyprint .pln { color: var(--code-text); }

/* The "try it" box: the free lesson on the post's topic (functions.php ac_blog_try_box). */
.try-box { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 24px; margin-block: 2.2em; padding: 24px 26px; border: 1px solid #d5e4ad; border-radius: 18px; background: linear-gradient(135deg, #f3f8e4, #eef5f6); }
.try-box > div { flex: 1 1 300px; }
.try-box .try-kicker { margin: 0 0 6px; font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: #557124; }
.try-box .try-heading { margin: 0 0 6px; font-size: 20px; line-height: 1.35; font-weight: 650; letter-spacing: -.3px; color: var(--ink); }
.try-box .try-text { margin: 0; font-size: 15px; line-height: 1.55; color: var(--muted); }
.post-body .try-box a, .try-box .try-button { color: #fff; text-decoration: none; }
.try-button { flex-shrink: 0; min-height: 48px; gap: 16px; font-size: 14px; }
.try-box-end { margin-top: 2.6em; }

.post-related { width: min(1160px, calc(100% - 40px)); margin: 0 auto; padding-block: 34px 70px; border-top: 1px solid var(--line); }
.post-related h2 { font-size: 26px; letter-spacing: -.6px; margin-bottom: 22px; }

/* ---- The offer as a reader leaves (desktop) and the bar past half a post (phones) ---------------- */
.blog-offer { width: min(600px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; padding: 34px 34px 30px; border: 0; border-radius: 22px; background: var(--paper); color: var(--ink); text-align: center; box-shadow: 0 30px 80px #0b1d2440; }
.blog-offer::backdrop { background: #172e368c; }
.blog-offer .eyebrow { margin-bottom: 18px; text-transform: uppercase; letter-spacing: 1px; font-size: 11px; }
.blog-offer h2 { font-size: 36px; line-height: 1.08; letter-spacing: -1.4px; margin-bottom: 14px; }
.blog-offer h2 span { color: var(--blue); }
.blog-offer-text { color: var(--muted); font-size: 16px; margin-bottom: 22px; }
.blog-offer .button { gap: 18px; }
.blog-offer-shot { display: block; width: 100%; height: auto; margin-top: 26px; border-radius: 12px; border: 1px solid var(--line); box-shadow: 0 10px 30px #172e3614; }
.blog-offer-close { position: absolute; top: 14px; right: 16px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: #e9eee4; color: var(--ink); font-size: 22px; line-height: 1; }
.blog-offer-close:hover { background: #dfe7d8; }
.blog-bar { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 30; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 16px; border-radius: 14px; background: var(--ink); color: #fff; box-shadow: 0 12px 30px #0b1d2440; }
.blog-bar p { flex: 1; margin: 0; font-size: 14px; font-weight: 600; line-height: 1.35; }
.blog-bar .button { background: var(--lime); color: var(--ink); flex-shrink: 0; }
.blog-bar-close { width: 32px; height: 32px; border: 0; border-radius: 50%; background: #ffffff1f; color: #fff; font-size: 18px; line-height: 1; flex-shrink: 0; }

@media (max-width: 760px) {
  .blog-hero { padding-block: 38px 30px; }
  .blog-hero h1 { letter-spacing: -1.2px; }
  .blog-list { padding-block: 28px 50px; }
  .blog-grid { grid-template-columns: 1fr; gap: 16px; }
  .post-article { padding-block: 34px 20px; }
  .post-title { letter-spacing: -1px; }
  .post-body { font-size: 17px; }
  .post-body h2 { font-size: 24px; }
  .post-body pre { font-size: 13px; padding: 14px 16px; border-radius: 12px; }
  .try-box { padding: 20px; }
  .try-button { width: 100%; }
}
