/* HAG Energy — the blog (/blog and /blog/<article>), served by the Next.js app in next/.
   Linked only from the blog template, after site.css, brand.css and components.css, so it uses the same tokens
   (--bg2, --ink*, --or, --r-card, --r-pill, --hair-d, --t-*, --measure ...) and the same section system as the inner pages.
   The header band is the inner pages' .pg-head, made shorter; the cards echo the home page's teaser cards (.post).
   Logical properties throughout: the page is right-to-left in Arabic. */

/* ---------- the page header: shorter than the inner pages' hero, no illustration ---------- */
.pg-head--blog{min-height:0;padding-block-end:clamp(2.5rem,5vw,4rem)}
.pg-head--blog .hero2{grid-template-columns:minmax(0,1fr);padding-block:0}
.pg-head--blog .pg-title{max-width:22ch;font-size:clamp(2.1rem,1.4rem + 3vw,3.75rem)}
.pg-head--blog .pg-lead{max-width:40rem}
.pg-head--post .pg-title{max-width:26ch}
.bback{display:inline-flex;align-items:center;gap:.4rem;color:var(--ink-3);font-weight:700;transition:color .2s var(--e-ui)}
.bback::before{content:"";width:6px;height:10px;background:currentColor;clip-path:polygon(100% 0,100% 100%,0 50%);transform:scaleX(var(--flip))}
.bback:hover{color:var(--or)}

/* ---------- category links: pills ---------- */
.bchips{display:flex;flex-wrap:wrap;gap:.5rem;margin-block-end:clamp(1.75rem,3vw,2.5rem)}
.bchips a{display:inline-flex;align-items:center;min-height:40px;padding-inline:18px;border-radius:var(--r-pill);background:var(--fill-d);color:var(--ink-2);font-size:var(--t-small);font-weight:700;line-height:1;transition:background-color .2s var(--e-ui),color .2s var(--e-ui)}
.bchips a:hover{background:rgba(255,255,255,.14);color:var(--ink)}
.bchips a[aria-current]{background:var(--or);color:#141416}
.bchips a:focus-visible{outline:0;box-shadow:var(--ring)}

/* ---------- article cards ---------- */
.bposts{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,21rem),1fr));gap:16px}
.bpost{position:relative;display:flex;flex-direction:column;gap:.75rem;padding:28px;border-radius:var(--r-card);background:var(--bg2);transition:background-color .25s var(--e-ui),transform .25s var(--e-out)}
.bpost:hover{background:var(--bg3);transform:translateY(-2px)}
.bpost__fig{margin:-28px -28px .5rem;overflow:hidden;border-radius:var(--r-card) var(--r-card) 0 0;aspect-ratio:3/2;background:var(--bg3)}
.bpost__fig img{display:block;width:100%;height:100%;object-fit:cover}
.bpost__meta{display:flex;flex-wrap:wrap;gap:2px 10px;margin:0;color:var(--ink-3);font-size:.8125rem;font-weight:700}
.bpost__meta span+span::before{content:"·";margin-inline-end:10px;opacity:.6}
.bpost h3{margin:0;font-size:var(--t-h3);font-weight:800;line-height:1.4;text-wrap:balance}
/* the title is the link and stretches over the whole card: one tab stop per card */
.bpost h3 a::after{content:"";position:absolute;inset:0;border-radius:var(--r-card)}
.bpost h3 a:focus-visible{outline:0}
.bpost h3 a:focus-visible::after{box-shadow:var(--ring)}
.bpost__x{margin:0;color:var(--ink-2)}
.bpost__go{display:inline-flex;align-items:center;gap:6px;margin-block-start:auto;padding-block-start:.5rem;color:var(--or);font-size:var(--t-small);font-weight:700}
.bpost__go .chev{width:6px;height:10px;flex:none;transform:scaleX(var(--flip));transition:translate .2s var(--e-ui)}
.bpost:hover .bpost__go .chev{translate:calc(2px*var(--flip)) 0}
.bempty{margin:0;padding:48px 28px;border-radius:var(--r-card);background:var(--bg2);color:var(--ink-2);text-align:center}

/* ---------- one article ---------- */
.bpost__meta--head{margin-block-start:1.5rem}
.bnote{display:inline-flex;align-items:center;height:28px;margin:1rem 0 0;padding-inline:12px;border-radius:var(--r-pill);background:var(--fill-d);color:var(--ink-3);font-size:.8125rem;font-weight:700}
.bart{display:grid;grid-template-columns:minmax(0,15rem) minmax(0,var(--measure));justify-content:center;gap:clamp(2rem,5vw,5rem)}
.bart__hero{grid-column:1/-1;margin:0 0 clamp(1.5rem,3vw,2.5rem);overflow:hidden;border-radius:var(--r-lg)}
.bart__hero img{display:block;width:100%;max-height:min(60vh,560px);object-fit:cover}
.bart>.btoc{grid-column:1;grid-row:2}
.bart__body{grid-column:2;grid-row:2;min-width:0;color:var(--ink-2);font-size:var(--t-lead);line-height:1.85}
.bart__body>*:first-child{margin-block-start:0}
.bart__body h2,.bart__body h3,.bart__body h4{margin:2.4em 0 .6em;color:var(--ink);font-weight:800;line-height:1.35;scroll-margin-block-start:calc(var(--nav-h) + 24px);text-wrap:balance}
.bart__body h2{font-size:var(--t-title)}
.bart__body h3{font-size:var(--t-h3)}
.bart__body p{margin:0 0 1.15em;max-width:none}
.bart__body a{color:var(--or);text-decoration:underline;text-underline-offset:3px;text-decoration-thickness:1px}
.bart__body a:hover{text-decoration-thickness:2px}
.bart__body strong{color:var(--ink)}
.bart__body mark{padding:0 .15em;border-radius:4px;color:#141416}
.bart__body ul,.bart__body ol{margin:0 0 1.3em;padding-inline-start:1.4em}
.bart__body ul{list-style:disc}
.bart__body ol{list-style:decimal}
.bart__body li{margin:.35em 0}
.bart__body li::marker{color:var(--or)}
.bart__body li>p{margin:0}
.bart__body blockquote{margin:1.8em 0;padding-block:.4em;padding-inline:1.4em 0;border-inline-start:3px solid var(--or);color:var(--ink);font-weight:600}
.bart__body figure{margin:2em 0}
.bart__body figure img{display:block;width:100%;border-radius:var(--r-card)}
.bart__body figcaption{margin-block-start:.6rem;color:var(--ink-3);font-size:var(--t-small)}
.bart__body hr{height:1px;margin:2.5em 0;border:0;background:var(--hair-d)}

/* ---------- the contents list beside an article ---------- */
.btoc{align-self:start;position:sticky;inset-block-start:calc(var(--nav-h) + 24px)}
.btoc__t{margin:0 0 .75rem;color:var(--ink-3);font-size:.8125rem;font-weight:700}
.btoc ol{margin:0;padding:0;list-style:none;border-inline-start:1px solid var(--hair-d)}
.btoc li{margin:0}
.btoc a{display:block;padding-block:.4rem;padding-inline:1rem 0;color:var(--ink-2);font-size:var(--t-small);line-height:1.5;transition:color .2s var(--e-ui)}
.btoc a:hover{color:var(--or)}
.btoc li[data-depth="1"] a{padding-inline-start:2rem}
.btoc li[data-depth="2"] a{padding-inline-start:3rem}

@media (max-width:1000px){
  .bart{grid-template-columns:minmax(0,1fr)}
  .bart>.btoc,.bart__body{grid-column:1;grid-row:auto}
  .btoc{position:static;margin-block-end:1.5rem}
}
@media (max-width:760px){
  .bpost{padding:22px}
  .bpost__fig{margin:-22px -22px .5rem}
  .bart__body{font-size:var(--t-body)}
}
@media (prefers-reduced-motion:reduce){
  .bpost,.bpost__go .chev{transition:none}
  .bpost:hover{transform:none}
}
