/* Blog pages are rendered by the CMS (api/blog.php) into the cms-shell page, so these styles are global and
   class-based (.bl-*). Tokens come from style.css (navy and gold). Copied to site/assets/css/blog.css by the build. */

/* ---------- Hero ---------- */
.bl-hero { background: radial-gradient(900px 420px at 90% -20%, #f4ebcf 0%, transparent 60%), #fffeec; padding: clamp(40px, 6vw, 76px) 0 clamp(40px, 6vw, 72px); border-bottom: 1px solid var(--line); text-align: center; }
.bl-hero h1 { font-size: clamp(2rem, 4.4vw, 3.4rem); max-width: 20ch; margin-inline: auto; }
.bl-hero .muted-title { color: var(--orange-500); }
.bl-hero .lead { margin: 4px auto 0; max-width: 56ch; }
.bl-crumbs { display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.86rem; color: var(--muted); margin-bottom: 20px; }
.bl-crumbs a { display: inline-block; padding: 9px 4px; margin: -9px -4px; color: var(--muted); }
.bl-crumbs a:hover { color: var(--orange-600); }
.bl-crumbs [aria-current] { color: var(--navy-900); font-weight: 500; }

/* ---------- Filters ---------- */
.bl-filters { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 28px; }
.bl-filters a { padding: 10px 18px; border-radius: var(--r-pill); font: 500 0.86rem/1 var(--font-head); background: #fff; border: 1px solid var(--line); color: var(--navy-900); transition: border-color 0.2s, background 0.2s; }
.bl-filters a small { opacity: 0.55; margin-left: 4px; font-size: 0.75rem; }
.bl-filters a:hover { border-color: var(--navy-800); }
.bl-filters a.on { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }

/* ---------- Listing ---------- */
.bl-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.bl-post { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm); transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease; color: inherit; }
.bl-post:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: #d9cca6; }
.bl-featured { grid-column: 1 / -1; flex-direction: row; }
.bl-featured .bl-cover { flex: 0 0 42%; height: auto; min-height: 300px; }
.bl-cover { position: relative; height: 200px; overflow: hidden; display: grid; place-items: center; }
.bl-cover > img { height: 56%; width: auto; opacity: 0.22; transition: transform 0.5s; }
.bl-post:hover .bl-cover > img { transform: scale(1.08); }
.bl-cover.navy { background: var(--grad-navy); }
.bl-cover.blue { background: linear-gradient(140deg, #001e3a, #3c5a78); }
.bl-cover.dark { background: linear-gradient(140deg, var(--navy-950), #001e3a); }
.bl-cover.gold { background: var(--grad-gold); }
.bl-cover.gold > img { opacity: 0.35; }
.bl-cover--img { background: var(--blue-100); }
.bl-cover--img > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 1; }
.bl-post:hover .bl-cover--img > img { transform: scale(1.05); }
.bl-cat { position: absolute; left: 16px; top: 16px; z-index: 1; padding: 6px 14px; background: #fff; border-radius: var(--r-pill); font: 500 0.78rem/1.2 var(--font-head); color: var(--navy-900); }
.bl-card-body { padding: clamp(20px, 3vw, 32px); display: flex; flex-direction: column; flex: 1; justify-content: center; }
.bl-meta { display: flex; gap: 8px; font-size: 0.8rem; color: var(--muted); margin-bottom: 10px; }
.bl-card-body h2 { font-size: clamp(1.2rem, 2vw, 1.5rem); margin-bottom: 0.5em; }
.bl-featured .bl-card-body h2 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); }
.bl-card-body p { color: var(--muted); font-size: 0.95rem; }
.bl-more, .bl-go { display: inline-flex; gap: 8px; align-items: center; font: 600 0.9rem/1 var(--font-head); color: var(--navy-800); }
.bl-more { margin-top: auto; }
.bl-more svg, .bl-go svg { width: 16px; height: 16px; transition: transform 0.25s; }
.bl-post:hover .bl-more { color: var(--orange-600); }
.bl-post:hover .bl-more svg { transform: translateX(5px); }
.bl-pager { display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 40px; }
.bl-pager a, .bl-pager span { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 0 14px; border-radius: var(--r-pill); font: 500 0.9rem/1 var(--font-head); background: #fff; border: 1px solid var(--line); color: var(--navy-900); }
.bl-pager a:hover { border-color: var(--navy-800); }
.bl-pager [aria-current] { background: var(--navy-800); color: #fff; border-color: var(--navy-800); }
.bl-empty { text-align: center; padding: 60px 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); }
.bl-empty a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Single post ---------- */
.bl-head { padding: clamp(40px, 6vw, 72px) 0 clamp(24px, 4vw, 44px); text-align: center; background: #fffeec; border-bottom: 1px solid var(--line); }
.bl-chips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.bl-chips a.chip { min-height: 40px; padding-inline: 14px; }
.bl-head h1 { font-size: clamp(1.9rem, 4vw, 3rem); max-width: 24ch; margin: 18px auto 18px; }
.bl-byline { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 0.88rem; color: var(--muted); margin: 0; }
.bl-by { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--navy-900); }
.bl-by img { height: 22px; width: auto; }
.bl-figure-wrap { padding-top: clamp(24px, 4vw, 40px); }
.bl-figure { max-width: 980px; margin: 0 auto; }
.bl-figure img { width: 100%; height: auto; border-radius: var(--r-lg); border: 1px solid var(--line); background: #fff; }
.bl-figure figcaption { text-align: center; font-size: 0.85rem; color: var(--muted); margin-top: 12px; }
.bl-body { padding-top: clamp(28px, 4vw, 48px); padding-bottom: clamp(32px, 5vw, 64px); }
.bl-prose { max-width: 820px; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(22px, 5vw, 56px); overflow-wrap: break-word; box-shadow: var(--shadow-sm); }
.bl-prose > :first-child { margin-top: 0; }
.bl-prose ul { list-style: disc; padding-left: 1.3em; margin-bottom: 1.2em; }
.bl-prose ol { list-style: decimal; padding-left: 1.4em; margin-bottom: 1.2em; }
.bl-prose li { margin-bottom: 0.45em; }
.bl-prose h4 { font-size: 1.15rem; margin-top: 1.6em; }
.bl-prose h5, .bl-prose h6 { font-size: 1rem; margin-top: 1.4em; }
.bl-prose img { max-width: 100%; height: auto; border-radius: var(--r-md); }
.bl-prose img.img-wide { width: 100%; }
.bl-prose figure { margin: 1.8em 0; }
.bl-prose figure img { margin-inline: auto; }
.bl-prose figcaption { font-size: 0.86rem; color: var(--muted); text-align: center; margin-top: 0.7em; }
.bl-prose blockquote { margin: 1.8em 0; padding: 16px 22px; border-left: 4px solid var(--matte-gold); background: var(--bg); border-radius: 0 var(--r-md) var(--r-md) 0; font-family: var(--font-head); }
.bl-prose blockquote p:last-child { margin: 0; }
.bl-prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.2em 0; }
.bl-prose table { width: 100%; border-collapse: collapse; margin: 1.6em 0; font-size: 0.95rem; display: block; overflow-x: auto; }
.bl-prose th, .bl-prose td { border: 1px solid var(--line); padding: 10px 14px; text-align: left; vertical-align: top; }
.bl-prose th { background: var(--bg); font-weight: 600; }
.bl-prose .table-wrap table { margin: 0; display: table; }
.bl-prose pre { background: var(--navy-950); color: #f1ecd9; padding: 18px 20px; border-radius: var(--r-md); overflow-x: auto; font-size: 0.88rem; line-height: 1.6; margin: 1.6em 0; }
.bl-prose code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88em; }
.bl-prose :not(pre) > code { background: var(--blue-50); padding: 2px 6px; border-radius: 6px; }
.bl-prose mark { background: #fff0b8; padding: 0 3px; border-radius: 3px; }
.bl-prose iframe { width: 100%; max-width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: var(--r-md); margin: 1.4em 0; }
.bl-prose .lead-p { font-size: 1.2rem; line-height: 1.6; color: var(--muted); }
.bl-prose .callout--tip { background: #e6f6ef; border-color: #b9e3d0; }
.bl-prose .callout--warn { background: #fdecec; border-color: #f4c4be; }
.bl-prose .cta-wrap { margin: 1.8em 0; }
.bl-prose a.btn { text-decoration: none; }
.bl-prose details { border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 20px; margin: 1em 0; background: var(--bg); }
.bl-prose details[open] { background: #fff; }
.bl-prose summary { font-weight: 600; cursor: pointer; font-family: var(--font-head); color: var(--navy-900); }
.bl-prose details > :last-child { margin-bottom: 0; }
.bl-prose details p { margin-top: 0.7em; }
.bl-prose [style*="text-align: center"] img, .bl-prose img[style*="margin"] { margin-inline: auto; }
.bl-prose .alignleft, .bl-prose img[style*="float: left"] { float: left; margin: 0.3em 1.4em 1em 0; }
.bl-prose .alignright, .bl-prose img[style*="float: right"] { float: right; margin: 0.3em 0 1em 1.4em; }
.bl-prose::after { content: ''; display: block; clear: both; }

.bl-toc { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px 22px; margin: 0 0 2em; }
.bl-toc strong { font-family: var(--font-head); font-size: 0.95rem; display: block; margin-bottom: 8px; color: var(--navy-900); }
.bl-toc ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.bl-toc li { margin: 0; font-size: 0.95rem; }
.bl-toc li.l3 { padding-left: 18px; font-size: 0.9rem; }
.bl-toc a { color: var(--navy-900); text-decoration: none; }
.bl-toc a:hover { color: var(--orange-600); text-decoration: underline; }

.bl-after { max-width: 820px; margin: 28px auto 0; display: grid; gap: 18px; }
.bl-tags, .bl-share { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 0.88rem; }
.bl-tags > span, .bl-share > span { font-weight: 600; margin-right: 4px; }
.bl-tags a, .bl-share a { padding: 10px 14px; border-radius: var(--r-pill); border: 1px solid var(--line); background: #fff; font-weight: 500; transition: all 0.2s; }
.bl-tags a:hover, .bl-share a:hover { border-color: var(--navy-800); background: var(--navy-800); color: #fff; }
.bl-author { display: flex; gap: 18px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px 26px; }
.bl-author img { height: 48px; width: 48px; flex: none; }
.bl-author p { margin: 4px 0 0; font-size: 0.9rem; color: var(--muted); }
.bl-author a { text-decoration: underline; text-underline-offset: 3px; }

.bl-more-title { font-size: clamp(1.5rem, 2.6vw, 2rem); margin-bottom: 24px; }
.bl-related { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.bl-related .card { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; padding: 24px; }
.bl-related .card h3 { margin: 0; flex: 1; font-size: 1.1rem; }
.bl-links .card p { margin: 0; }
.bl-audit { margin: 22px 0 0; color: var(--muted); }
.bl-audit a { text-decoration: underline; text-underline-offset: 3px; color: var(--navy-800); }

.bl-preview { position: sticky; top: 0; z-index: 50; background: var(--grad-gold); color: var(--navy-950); text-align: center; padding: 10px 16px; font-weight: 600; font-size: 0.88rem; }

@media (max-width: 800px) {
  .bl-grid { grid-template-columns: 1fr; }
  .bl-featured { flex-direction: column; }
  .bl-featured .bl-cover { min-height: 200px; flex: none; }
  .bl-related { grid-template-columns: 1fr; }
  .bl-author { flex-direction: column; text-align: center; }
}

/* ---- "Coming soon" page for CMS pages that are still drafts ---- */
.bl-soon { padding: clamp(56px, 9vw, 120px) 0; }
.bl-soon .bl-soon-note { margin: 18px auto 0; max-width: 52ch; font-weight: 500; color: var(--navy-900); }
.bl-soon .bl-soon-actions { justify-content: center; margin-top: 28px; }
.bl-soon .bl-soon-actions .btn { min-height: 48px; }
.cta-page .btn svg { width: 16px; height: 16px; }
.cta-page { grid-template-columns: 1fr; }
.bl-soon h1 { max-width: 26ch; }
