/* KE Blog (v11) — loads after ke-home.css / ke-home-rtl.css.
   Upload path: wp-content/themes/astra-child/ke-blog/ke-blog.css */

.ke-blog nav.primary a[aria-current="page"] { color:var(--gold-light); box-shadow:inset 0 -2px 0 var(--gold); }

/* Hero */
.kb-hero { padding:18px 0 44px; }
.kb-hero h1 { max-width:22ch; margin-bottom:14px; }
.kb-hero .sub { max-width:44rem; margin-bottom:8px; }
.kb-crumb { display:flex; flex-wrap:wrap; gap:8px; font-size:.82rem; color:#B7C4D6; margin-bottom:18px; }
.kb-crumb a { color:#E8EEF6; font-weight:600; }
.kb-crumb a:hover { color:var(--gold-light); }
.kb-post-hero { padding-bottom:36px; }
.kb-post-hero h1 { max-width:none; font-size:clamp(1.75rem, 3.4vw, 2.6rem); }
.kb-post-meta { display:flex; flex-wrap:wrap; gap:6px 10px; color:#D5DEE9; font-size:.9rem; }
.kb-narrow { max-width:1160px; }

/* Cards */
.kb-list { padding-top:56px; }
.kb-head { margin-top:44px; }
.kb-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:20px; }
.kb-card { background:#fff; border:1px solid #E6EEF5; border-radius:20px; overflow:hidden; box-shadow:var(--shadow-sm); display:flex; flex-direction:column; transition:transform .25s, box-shadow .25s; }
.kb-card:hover { transform:translateY(-4px); box-shadow:var(--shadow); }
.kb-media { display:block; position:relative; aspect-ratio:16/9; background:#d9e3ee; overflow:hidden; }
.kb-media > img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.kb-noimg {
  position:absolute; inset:0; display:flex; flex-direction:column; align-items:flex-start; justify-content:space-between; padding:18px 20px;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(201,162,39,.28) 0%, rgba(201,162,39,0) 55%),
    repeating-linear-gradient(135deg, rgba(255,255,255,.035) 0 2px, transparent 2px 14px),
    linear-gradient(160deg, var(--navy) 0%, var(--navy-mid) 100%);
}
.kb-noimg img { width:44px; height:44px; border-radius:50%; opacity:.95; }
.kb-noimg-cat { font-family:"Playfair Display", Georgia, serif; font-style:italic; color:var(--gold-light); font-size:clamp(1.05rem, 1.6vw, 1.35rem); line-height:1.25; max-width:90%; }
.kb-card-featured .kb-noimg { padding:28px; }
.kb-card-featured .kb-noimg-cat { font-size:clamp(1.4rem, 2.4vw, 2rem); }
html[dir="rtl"] .kb-noimg-cat { font-family:Cairo, sans-serif; font-style:normal; font-weight:600; }
.kb-body { padding:18px 18px 18px; display:flex; flex-direction:column; gap:10px; flex:1; }
.kb-body .tag { align-self:flex-start; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; text-decoration:none; }
.kb-body h3 { font-size:1.05rem; line-height:1.35; letter-spacing:-0.01em; }
.kb-body h3 a { color:var(--navy); }
.kb-body h3 a:hover { color:var(--gold-dark); }
.kb-excerpt { color:var(--muted); font-size:.9rem; line-height:1.55; display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden; }
.kb-meta { margin-top:auto; display:flex; gap:8px; font-size:.8rem; color:var(--muted); font-weight:600; }
.kb-card-featured { display:grid; grid-template-columns:minmax(0,1.15fr) minmax(0,1fr); }
.kb-card-featured .kb-media { aspect-ratio:auto; min-height:320px; }
.kb-card-featured .kb-body { padding:30px 30px 26px; justify-content:center; gap:14px; }
.kb-card-featured h3 { font-size:clamp(1.3rem, 2vw, 1.7rem); line-height:1.25; }
.kb-card-featured .kb-excerpt { -webkit-line-clamp:5; font-size:1rem; }
.kb-card-featured .kb-meta { margin-top:6px; }
.kb-empty { color:var(--muted); }

/* Pagination (core paginate_links markup) */
.kb-pager { display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:6px; margin-top:32px; }
.kb-pager .page-numbers { min-width:40px; height:40px; padding:0 12px; display:inline-flex; align-items:center; justify-content:center; border-radius:999px; border:1px solid var(--line); background:#fff; color:var(--navy); font-weight:600; font-size:.9rem; }
.kb-pager a.page-numbers:hover { border-color:var(--gold); color:var(--gold-dark); }
.kb-pager .page-numbers.current { background:var(--navy); border-color:var(--navy); color:#fff; }
.kb-pager .page-numbers.dots { border:0; background:transparent; min-width:0; padding:0 2px; color:var(--muted); }

/* Single post layout */
.kb-post { padding:48px 0 64px; }
.kb-layout { display:grid; grid-template-columns:minmax(0,1fr) 300px; gap:48px; align-items:start; }
.kb-article { min-width:0; max-width:760px; }
.kb-feature { margin:0 0 28px; border-radius:20px; overflow:hidden; box-shadow:var(--shadow-sm); }
.kb-feature img { width:100%; height:auto; }
.kb-side { position:sticky; top:calc(var(--header-h) + 20px); display:flex; flex-direction:column; gap:16px; }
.kb-toc, .kb-advisor { background:#fff; border:1px solid var(--line); border-radius:18px; padding:18px; box-shadow:var(--shadow-sm); }
.kb-toc ol { list-style:none; display:flex; flex-direction:column; gap:8px; max-height:50vh; overflow:auto; counter-reset:t; }
.kb-toc li { counter-increment:t; display:flex; gap:8px; font-size:.86rem; line-height:1.4; }
.kb-toc li::before { content:counter(t); color:var(--gold-dark); font-weight:700; min-width:1.2em; }
.kb-toc a { color:var(--navy); }
.kb-toc a:hover { color:var(--gold-dark); }
.kb-advisor { background:linear-gradient(160deg, var(--navy) 0%, var(--navy-mid) 100%); border-color:rgba(201,162,39,.35); color:#E8EEF6; display:flex; flex-direction:column; gap:10px; }
.kb-advisor h2 { color:#fff; font-size:1.1rem; margin:0; }
.kb-advisor p { font-size:.88rem; color:#D5DEE9; }
.kb-advisor .btn { width:100%; }
.kb-advisor .btn-outline { background:transparent; color:#fff; border-color:rgba(255,255,255,.4); }
.kb-advisor .btn-outline:hover { color:var(--gold-light); border-color:var(--gold); }
.kb-browse { color:var(--gold-light); font-weight:600; font-size:.9rem; text-align:center; }
.kb-back { margin-top:36px; font-weight:600; }
.kb-back a { color:var(--navy); }

/* Article typography — normalises old editor formatting (display only) */
.kb-content { font-size:1.05rem; line-height:1.75; color:var(--text); overflow-wrap:anywhere; }
.kb-content > * + * { margin-top:1.1em; }
.kb-content h2 { font-size:clamp(1.35rem, 2.2vw, 1.7rem); margin-top:1.9em; margin-bottom:.2em; scroll-margin-top:calc(var(--header-h) + 16px); }
.kb-content h3 { font-size:1.2rem; margin-top:1.6em; }
.kb-content h4, .kb-content h5, .kb-content h6 { font-size:1.05rem; color:var(--navy); margin-top:1.4em; }
.kb-content h2:first-child, .kb-content h3:first-child { margin-top:0; }
.kb-content [style*="color"] { color:inherit !important; }
.kb-content [style*="font-family"] { font-family:inherit !important; }
.kb-content [style*="font-size"] { font-size:inherit !important; }
.kb-content p, .kb-content li { color:var(--text); }
.kb-content a { color:var(--navy-mid); text-decoration:underline; text-decoration-color:var(--gold); text-underline-offset:3px; }
.kb-content a:hover { color:var(--gold-dark); }
.kb-content ul, .kb-content ol { padding-inline-start:1.4em; }
.kb-content li + li { margin-top:.35em; }
.kb-content li::marker { color:var(--gold-dark); }
.kb-content img { border-radius:14px; height:auto; margin-inline:auto; }
.kb-content figure { margin:1.4em 0; }
.kb-content figcaption, .kb-content .wp-caption-text { font-size:.85rem; color:var(--muted); text-align:center; margin-top:6px; }
.kb-content .aligncenter { margin-inline:auto; }
.kb-content blockquote { border-inline-start:4px solid var(--gold); background:var(--bg-soft); padding:16px 20px; border-radius:0 12px 12px 0; color:var(--navy); }
.kb-content strong, .kb-content b { color:var(--navy); }
.kb-table { overflow-x:auto; -webkit-overflow-scrolling:touch; border:1px solid var(--line); border-radius:12px; }
.kb-content table { width:100%; border-collapse:collapse; font-size:.92rem; min-width:520px; }
.kb-content th, .kb-content td { border-bottom:1px solid var(--line); padding:10px 12px; text-align:start; vertical-align:top; }
.kb-content th, .kb-content thead td { background:var(--bg-soft); color:var(--navy); font-weight:700; }
.kb-content iframe, .kb-content video { max-width:100%; }
.kb-related { padding:56px 0; }

/* RTL */
html[dir="rtl"] .kb-content blockquote { border-radius:12px 0 0 12px; }
html[dir="rtl"] .kb-back a, html[dir="rtl"] .kb-browse { unicode-bidi:plaintext; }
html[dir="rtl"] .kb-content { font-family:Cairo, Inter, sans-serif; }
html[dir="rtl"] .kb-body h3, html[dir="rtl"] .kb-advisor h2 { font-weight:600; letter-spacing:0; }

/* Responsive */
@media (max-width:1100px) {
  .kb-layout { grid-template-columns:minmax(0,1fr) 260px; gap:32px; }
}
@media (max-width:960px) {
  .kb-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .kb-card-featured { grid-template-columns:minmax(0,1fr); }
  .kb-card-featured .kb-media { min-height:0; aspect-ratio:16/9; }
  .kb-layout { grid-template-columns:minmax(0,1fr); }
  .kb-side { position:static; }
  .kb-article { max-width:none; }
}
@media (max-width:820px) {
  .kb-hero { padding-bottom:32px; }
  .kb-post { padding:28px 0 44px; }
  .kb-card-featured .kb-body { padding:20px 18px; }
}
@media (max-width:600px) {
  .kb-grid { grid-template-columns:minmax(0,1fr); gap:14px; }
  .kb-content { font-size:1rem; line-height:1.7; }
  .kb-card:hover { transform:none; }
}
@media (max-width:960px) { .kb-toc { display:none; } }
