/* ==========================================================
   Blog — listing page (blog.php) and article pages.
   Loaded via $extraCss; uses the theme colours from style.css.
   ========================================================== */

.blog-page, .post-article, .blog-right {
  --deep: #002726;
  --brand-soft: #eaf6ff;
  --brand-line: #e2f0fb;
  --line: #eef2f7;
  --shadow-sm: 0 1px 2px rgba(11, 33, 48, .06);
  --shadow-md: 0 14px 34px -14px rgba(11, 33, 48, .22);
}
.blog-page svg, .blog-right svg { width: 18px; height: 18px; flex: none; }

/* ---------- Hero ---------- */
.b-hero {
  position: relative;
  padding: 56px 0 64px;
  text-align: center;
  background:
    radial-gradient(560px 320px at 85% 0%, rgba(11, 99, 182, .13), transparent 70%),
    radial-gradient(460px 300px at 5% 100%, rgba(0, 39, 38, .07), transparent 70%),
    linear-gradient(180deg, #f7fbff, #edf5fc);
  border-bottom: 1px solid #e2eef9;
}
.b-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(11, 99, 182, .12) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 80%);
  mask-image: linear-gradient(180deg, #000, transparent 80%);
  pointer-events: none;
}
.b-hero .container { position: relative; }
.b-crumbs { font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.b-crumbs a:hover { color: var(--brand); }
.b-eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--brand);
  background: #fff;
  border: 1px solid var(--brand-line);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.b-hero h1 { font-size: clamp(30px, 4.2vw, 46px) !important; line-height: 1.15; letter-spacing: -.02em; margin: 0 auto 12px; max-width: 760px; }
.b-hero p { color: var(--muted); font-size: 18px; margin: 0 auto 26px; max-width: 600px; }
.b-search {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 460px;
  margin: 0 auto;
  padding: 0 16px;
  background: #fff;
  border: 1px solid #dbe5ef;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  color: var(--muted);
  transition: border-color .2s, box-shadow .2s;
}
.b-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(11, 99, 182, .12); }
.b-search input { flex: 1; border: 0; padding: 14px 0; font: inherit; font-size: 16px; background: none; outline: none; color: var(--dark); }

.b-body { padding-top: 48px !important; padding-bottom: 72px !important; }

/* ---------- Shared bits ---------- */
.b-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13.5px; color: var(--muted); }
.b-meta span::before { content: "•"; margin-right: 14px; color: #c3d0dd; }
.b-noimg { display: grid; place-items: center; width: 100%; height: 100%; min-height: 200px; background: linear-gradient(135deg, var(--deep), var(--brand)); color: #fff; font-weight: 700; font-size: 20px; }
.b-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 10px;
  background: var(--deep);
  color: #fff;
  font-weight: 600;
  transition: background .2s, transform .2s;
}
.b-btn:hover { background: var(--brand); transform: translateY(-2px); }
.b-btn svg, .b-link svg { transition: transform .2s; }
.b-btn:hover svg, .b-link:hover svg { transform: translateX(3px); }
.b-link { display: inline-flex; align-items: center; gap: 6px; color: var(--brand); font-weight: 600; font-size: 15px; }

/* ---------- Featured (latest) post ---------- */
.b-featured {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 56px;
}
.b-featured-img { display: block; min-height: 320px; overflow: hidden; }
.b-featured-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s; }
.b-featured:hover .b-featured-img img { transform: scale(1.03); }
.b-featured-body { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: 36px; justify-content: center; }
.b-tag { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #0a7a4a; background: #e8f8ef; padding: 4px 10px; border-radius: 999px; }
.b-featured h2 { font-size: clamp(22px, 2.4vw, 28px) !important; line-height: 1.25; margin: 0; }
.b-featured h2 a:hover { color: var(--brand); }
.b-featured p { color: var(--muted); margin: 0; font-size: 16px; }

/* ---------- Grid ---------- */
.b-head { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; }
.b-head h2 { font-size: 24px !important; margin: 0; white-space: nowrap; }
.b-head::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.b-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.b-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .25s, box-shadow .25s;
}
.b-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.b-card-img { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--brand-soft); }
.b-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s; }
.b-card:hover .b-card-img img { transform: scale(1.05); }
.b-card-body { display: flex; flex-direction: column; gap: 10px; padding: 20px 22px 22px; flex: 1; }
.b-card h3 { font-size: 18px !important; line-height: 1.35; margin: 0; }
.b-card h3 a:hover { color: var(--brand); }
.b-card p { color: var(--muted); font-size: 15px; margin: 0; flex: 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.b-card [hidden], .b-item[hidden] { display: none !important; }
.b-empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* ---------- CTA band ---------- */
.b-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 64px;
  padding: 36px 40px;
  border-radius: 20px;
  color: #dbe7f1;
  background:
    radial-gradient(360px 220px at 100% 100%, rgba(11, 99, 182, .5), transparent 70%),
    linear-gradient(160deg, var(--deep), #0b2130);
}
.b-cta h2 { color: #fff; font-size: 26px !important; margin: 0 0 6px; }
.b-cta p { margin: 0; color: #a9c3d6; max-width: 560px; }
.b-btn-light { background: #fff; color: var(--deep); white-space: nowrap; }
.b-btn-light:hover { background: var(--brand-soft); color: var(--deep); }

/* ==========================================================
   Article pages (post.php + hand-written posts)
   ========================================================== */
body:has(.blog-left) { background: #f7fafc; }
body:has(.blog-left) main.container { padding-top: 32px; padding-bottom: 56px; }
.blog-left {
  background: #fff !important;
  box-shadow: none !important;
  border: 1px solid var(--line, #eef2f7);
  border-radius: 18px;
  padding: 32px 36px !important;
  margin-bottom: 24px;
}
.blog-left > .blog-banner:first-child { margin: -32px -36px 24px; }
.blog-left > .blog-banner:first-child img { border-radius: 18px 18px 0 0; }
.blog-left h1 { font-size: clamp(28px, 3.4vw, 38px) !important; line-height: 1.2; letter-spacing: -.01em; }
.blog-left h2 { font-size: 24px !important; line-height: 1.3; margin: 32px 0 10px; }
.blog-left p, .blog-left li { font-size: 17px; line-height: 1.75; color: #1f3344; }
.blog-left ul, .blog-left ol { padding-left: 22px; }
.blog-left li { margin-bottom: 6px; }
.blog-left li::marker { color: var(--brand); font-weight: 700; }

.blog-right {
  position: sticky;
  top: 20px;
  background: #fff !important;
  box-shadow: none !important;
  border: 1px solid var(--line, #eef2f7);
  border-radius: 18px;
  padding: 22px !important;
}
.blog-right .side-block { padding-bottom: 6px; }
.blog-right .side-posts li + li { border-top: 1px solid var(--line, #eef2f7); padding-top: 12px; }
.blog-right .side-cta { margin-bottom: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .b-grid { grid-template-columns: repeat(2, 1fr); }
  .b-featured { grid-template-columns: 1fr; }
  .b-featured-img { min-height: 0; aspect-ratio: 16 / 9; }
  .b-cta { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 767px) {
  .blog-right { position: static; }
}
@media (max-width: 600px) {
  .b-hero { padding: 40px 0 48px; }
  .b-hero p { font-size: 16.5px; }
  .b-body { padding-top: 32px !important; padding-bottom: 48px !important; }
  .b-grid { grid-template-columns: 1fr; }
  .b-featured-body { padding: 24px 22px; }
  .b-featured { margin-bottom: 40px; }
  .b-cta { padding: 28px 22px; margin-top: 48px; }
  .blog-left { padding: 22px 18px !important; }
  .blog-left > .blog-banner:first-child { margin: -22px -18px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .blog-page *, .blog-page *::before { transition: none !important; }
}
