/*
Theme Name: Zealtrack
Theme URI: https://zealtrack.io/blog/
Author: Zealtrack
Description: The zealtrack.io blog. The header, footer and stylesheet are the website's own (written by frontend/scripts/prerender.mjs into www/partials on every site build), so /blog looks like the rest of the site; this file only adds the blog list and article layouts, using the same design tokens.
Version: 1.0.0
Requires PHP: 8.1
Text Domain: zealtrack
*/

/* Page frame: the same wrapper the site's pages use (Site.tsx). */
.zt-page { background: var(--color-bg); color: var(--color-text); font-family: var(--font-body); font-size: 15px; line-height: 1.55; min-height: 100vh; display: flex; flex-direction: column; }
.zt-main { flex: 1; }
.zt-wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.admin-bar .zt-page > nav { top: 32px !important; }
@media (max-width: 782px) { .admin-bar .zt-page > nav { top: 46px !important; } }

/* Hero: breadcrumb, title, lead — as on every site page. */
.zt-hero { padding-top: 64px; padding-bottom: 24px; display: grid; gap: 12px; }
.zt-crumb { font-size: 13px; color: var(--color-neutral-600); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.zt-crumb a { color: inherit; }
.zt-crumb a:hover { color: var(--color-accent-700); }
.zt-hero h1 { font-size: clamp(34px, 4.4vw, 52px); line-height: 1.08; letter-spacing: -0.03em; font-weight: 700; margin: 0; max-width: 22ch; }
.zt-lead { font-size: 18px; color: var(--color-neutral-700); margin: 0; max-width: 64ch; }
.zt-meta { font-size: 13px; color: var(--color-neutral-600); display: flex; gap: 8px; flex-wrap: wrap; }
.zt-meta .zt-cat { color: var(--color-accent); font-weight: 600; }

/* Blog list */
.zt-section { padding-top: 40px; padding-bottom: 96px; display: grid; gap: 24px; }
.zt-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.zt-pill { border: 1px solid var(--color-divider); border-radius: 999px; background: var(--color-surface); color: inherit; padding: 6px 14px; font-size: 13px; font-weight: 500; }
.zt-pill:hover { color: inherit; border-color: var(--color-neutral-400); }
.zt-pill.is-active { border-color: var(--color-text); background: var(--color-text); color: var(--color-bg); }
.zt-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
@media (max-width: 1100px) { .zt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px) { .zt-grid { grid-template-columns: minmax(0, 1fr); } }
.zt-card { border: 1px solid var(--color-divider); border-radius: 16px; background: var(--color-surface); overflow: hidden; color: inherit; display: grid; align-content: start; transition: box-shadow .15s; }
.zt-card:hover { color: inherit; box-shadow: var(--shadow-md); }
.zt-thumb { aspect-ratio: 16 / 9; display: grid; place-items: center; background: var(--color-neutral-100); overflow: hidden; }
.zt-card:nth-child(even) .zt-thumb { background: var(--color-accent-100); }
.zt-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.zt-mono { font-family: var(--font-heading); font-weight: 700; font-size: 40px; letter-spacing: -0.03em; color: var(--color-accent-700); opacity: .5; }
.zt-card-body { padding: 20px; display: grid; gap: 8px; }
.zt-card h2 { margin: 0; font-size: 17px; line-height: 1.3; letter-spacing: -0.01em; font-weight: 700; }
.zt-card p { margin: 0; font-size: 14px; color: var(--color-neutral-700); }
.zt-empty { border: 1px solid var(--color-divider); border-radius: 16px; background: var(--color-surface); padding: 40px; display: grid; gap: 8px; justify-items: start; }
.zt-empty h2 { margin: 0; font-size: 22px; letter-spacing: -0.015em; }
.zt-empty p { margin: 0; color: var(--color-neutral-700); }

/* Pagination */
.zt-pages .nav-links { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.zt-pages .page-numbers { border: 1px solid var(--color-divider); border-radius: 999px; background: var(--color-surface); color: inherit; padding: 6px 14px; font-size: 13px; }
.zt-pages .page-numbers.current { background: var(--color-text); border-color: var(--color-text); color: var(--color-bg); }
.zt-pages .screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Search */
.zt-search { display: flex; gap: 8px; max-width: 480px; }
.zt-search input { flex: 1; min-height: 40px; }

/* Article */
.zt-article .zt-hero h1 { max-width: 26ch; }
.zt-cover { margin: 8px 0 0; border-radius: 16px; overflow: hidden; border: 1px solid var(--color-divider); }
.zt-cover img { width: 100%; height: auto; display: block; }
.zt-content { max-width: 72ch; padding: 32px 0 64px; font-size: 17px; line-height: 1.75; color: var(--color-neutral-800); }
.zt-content > * { margin: 0 0 1.1em; }
.zt-content h2 { font-size: 26px; line-height: 1.25; letter-spacing: -0.015em; margin: 1.8em 0 .6em; color: var(--color-text); }
.zt-content h3 { font-size: 20px; line-height: 1.3; margin: 1.6em 0 .5em; color: var(--color-text); }
.zt-content h4 { font-size: 17px; margin: 1.4em 0 .4em; color: var(--color-text); }
.zt-content a { text-decoration: underline; }
.zt-content ul, .zt-content ol { padding-left: 22px; }
.zt-content li { margin: .3em 0; }
.zt-content blockquote { margin-left: 0; border-left: 3px solid var(--color-accent); padding: 4px 0 4px 18px; color: var(--color-neutral-700); }
.zt-content img { max-width: 100%; height: auto; border-radius: 12px; }
.zt-content figure { margin-left: 0; margin-right: 0; }
.zt-content figcaption, .zt-content .wp-element-caption { font-size: 13px; color: var(--color-neutral-600); text-align: center; margin-top: 6px; }
.zt-content code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; background: var(--color-neutral-100); border-radius: 6px; padding: 2px 5px; }
.zt-content pre { background: var(--color-text); color: var(--color-bg); border-radius: 12px; padding: 16px 18px; overflow: auto; font-size: 14px; line-height: 1.6; }
.zt-content pre code { background: none; padding: 0; color: inherit; }
.zt-content hr { border: 0; height: 1px; background: var(--color-divider); margin: 2em 0; }
.zt-content table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 15px; border: 1px solid var(--color-divider); border-radius: 14px; overflow: hidden; background: var(--color-surface); }
.zt-content th, .zt-content td { padding: 10px 12px; border-bottom: 1px solid var(--color-divider); text-align: left; }
.zt-content tr:last-child td { border-bottom: 0; }
.zt-content .aligncenter { margin-left: auto; margin-right: auto; }
.zt-content .alignleft { float: left; margin: 0 1.2em 1em 0; }
.zt-content .alignright { float: right; margin: 0 0 1em 1.2em; }
.zt-content .alignwide, .zt-content .alignfull { max-width: none; }

/* Fill-in blanks in copyable templates (<mark>…</mark>): a soft blue field with a dashed edge. */
.zt-content mark { background: var(--color-accent-100); color: var(--color-accent-800); border: 1px dashed var(--color-accent-300); border-radius: 6px; padding: 0 6px; font-weight: 600; white-space: pre-wrap; }

/* In-article call to action: a highlighted box in the middle of a post (<div class="zt-box">). */
.zt-content .zt-box { margin: 32px 0; padding: 22px 24px; border: 1px solid var(--color-accent-300); border-left: 4px solid var(--color-accent); border-radius: 14px; background: var(--color-accent-100); display: grid; gap: 12px; }
.zt-content .zt-box p { margin: 0; }
.zt-content .zt-box strong { font-family: var(--font-heading); font-size: 18px; }
.zt-content .zt-box .zt-box-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; }
.zt-content .zt-box a.zt-box-btn { display: inline-flex; align-items: center; height: 42px; padding: 0 20px; border-radius: 10px; background: var(--color-accent); color: #fff; font-weight: 700; text-decoration: none; }
.zt-content .zt-box a.zt-box-btn:hover { background: var(--color-accent-600); }

/* Call to action under an article (same band as the site's feature pages). */
.zt-cta { background: var(--color-accent); color: #fff; border-radius: 24px; padding: 48px clamp(24px, 5vw, 64px); display: flex; gap: 24px; align-items: center; flex-wrap: wrap; margin-bottom: 96px; }
.zt-cta div { flex: 1; min-width: 260px; display: grid; gap: 6px; }
.zt-cta h2 { margin: 0; font-size: 28px; letter-spacing: -0.02em; color: #fff; }
.zt-cta p { margin: 0; opacity: .85; }
.zt-cta .btn { height: 46px; padding: 0 22px; display: inline-flex; align-items: center; }
.zt-cta .zt-cta-main { background: #fff; color: var(--color-accent-700); border: 0; }
.zt-cta .zt-cta-alt { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .6); }

/* Arabic posts (category "العربية"): <html lang="ar" dir="rtl"> from functions.php; the site's stylesheet already
   switches the fonts to IBM Plex Sans Arabic and drops letter-spacing. These rules mirror the article layout. */
[dir="rtl"] .zt-content { line-height: 1.95; }
[dir="rtl"] .zt-content ul, [dir="rtl"] .zt-content ol { padding-left: 0; padding-right: 22px; }
[dir="rtl"] .zt-content blockquote { margin-right: 0; border-left: 0; border-right: 3px solid var(--color-accent); padding: 4px 18px 4px 0; }
[dir="rtl"] .zt-content th, [dir="rtl"] .zt-content td { text-align: right; }
/* Formulas and code stay left to right inside Arabic text (otherwise "=" jumps to the end and brackets flip). */
[dir="rtl"] .zt-content code, [dir="rtl"] .zt-content pre { direction: ltr; unicode-bidi: isolate; text-align: left; }
[dir="rtl"] .zt-content td code { display: inline-block; overflow-wrap: anywhere; }
[dir="rtl"] .zt-content .zt-box { border-left: 1px solid var(--color-accent-300); border-right: 4px solid var(--color-accent); }
[dir="rtl"] .zt-content .alignleft { float: right; margin: 0 0 1em 1.2em; }
[dir="rtl"] .zt-content .alignright { float: left; margin: 0 1.2em 1em 0; }
