/* Dawuh Guru v6.0 — unified editorial design system */
:root{
  --dg-bg:#fff;--dg-surface:#fff;--dg-surface-2:#f7f6f2;--dg-text:#111;--dg-muted:#6f6f6f;
  --dg-line:#e9e5dd;--dg-gold:#c59a46;--dg-black:#0b0b0b;--dg-radius-sm:8px;--dg-radius-md:12px;--dg-radius-lg:18px;
  --dg-shadow:0 12px 34px rgba(18,18,18,.07);--dg-content:740px;--dg-wide:1280px;
  --dg-space-1:8px;--dg-space-2:12px;--dg-space-3:16px;--dg-space-4:24px;--dg-space-5:40px;--dg-space-6:64px;
}
html[data-theme="dark"]{--dg-bg:#0c0c0c;--dg-surface:#121212;--dg-surface-2:#181818;--dg-text:#f7f7f5;--dg-muted:#aaa;--dg-line:#292929;--dg-shadow:none}
body{background:var(--dg-bg);color:var(--dg-text)}
.dg-reading-progress{position:fixed;top:0;left:0;right:0;height:3px;z-index:10050;pointer-events:none}.dg-reading-progress span{display:block;width:0;height:100%;background:var(--accent,var(--dg-gold));transition:width .08s linear}
.dg-skip-link:focus{position:fixed!important;left:12px;top:12px;width:auto;height:auto;clip:auto;padding:10px 14px;background:#fff;color:#111;z-index:11000;border:2px solid var(--dg-gold)}

/* One media system for all previews */
.dg-media{display:block;position:relative;overflow:hidden;background:var(--dg-surface-2);border-radius:var(--dg-radius-sm);width:100%}
.dg-media--45{aspect-ratio:4/5}.dg-media--hero{aspect-ratio:16/9}.dg-media--discover{aspect-ratio:16/9}.dg-media__img,.dg-media__placeholder{width:100%!important;height:100%!important;display:block!important;object-fit:cover!important;object-position:center!important;margin:0!important}
.dg-media__placeholder{display:grid!important;place-items:center!important;background:linear-gradient(145deg,#f4efe4,#e7dcc6);color:#a77e2f}.dg-media__placeholder span{display:grid;place-items:center;width:48px;height:48px;border:1px solid currentColor;border-radius:50%;font-size:11px;font-weight:900;letter-spacing:.08em}
.story-thumb>.dg-media,.list-thumb>.dg-media,.latest-thumb>.dg-media,.popular-thumb>.dg-media,.inline-related-thumb>.dg-media,.dg-showcase-thumb>.dg-media{height:100%}
.story-thumb,.list-thumb,.latest-thumb,.popular-thumb,.inline-related-thumb,.dg-showcase-thumb{background:transparent!important}
.story-thumb img,.list-thumb img,.latest-thumb img,.popular-thumb img,.inline-related-thumb img,.dg-showcase-thumb img{transition:transform .28s ease}
a:hover>.dg-media img{transform:scale(1.025)}

/* Hero can breathe independently from 4:5 feed cards */
.dg-editorial-lead-media{aspect-ratio:16/9!important}.dg-editorial-lead-media img{aspect-ratio:auto!important;height:100%!important}
.dg-editorial-side-media{aspect-ratio:4/5!important}.dg-editorial-side-media img{aspect-ratio:auto!important;height:100%!important}

/* Responsive card density from Homepage Builder v3 */
.news-grid,.dg-focus-list{grid-template-columns:repeat(var(--dg-home-cols-desktop,3),minmax(0,1fr))}
@media(max-width:980px){.news-grid,.dg-focus-list{grid-template-columns:repeat(var(--dg-home-cols-tablet,2),minmax(0,1fr))}}
@media(max-width:640px){.news-grid,.dg-focus-list{grid-template-columns:repeat(var(--dg-home-cols-mobile,1),minmax(0,1fr))}}

/* Reading-first single article */
.single-post:not(.dg-content-quote) .article-main{max-width:var(--dg-content)}
.single-post .article-content{font-size:19px;line-height:1.8;text-wrap:pretty}.single-post .article-content p{max-width:72ch}.single-post .article-content h2,.single-post .article-content h3{scroll-margin-top:120px}
.single-post .article-header h1{text-wrap:balance}.single-post .article-hero{box-shadow:0 0 0 1px var(--dg-line)}
.article-author-card{border:1px solid var(--dg-line);background:var(--dg-surface);box-shadow:var(--dg-shadow)}

/* Dedicated quote reading experience */
.dg-quote-page{padding:46px 0 70px;max-width:1180px}.dg-quote-main{max-width:1040px;margin:auto}.dg-quote-header{max-width:800px;margin:0 auto 28px;text-align:center}.dg-quote-header h1{font-family:var(--serif);font-size:clamp(38px,5vw,62px);line-height:1.02;letter-spacing:-.045em;margin:10px 0 14px}.dg-quote-layout{display:grid;grid-template-columns:minmax(260px,420px) minmax(0,1fr);gap:44px;align-items:center}.dg-quote-media{margin:0}.dg-quote-media figcaption{font-size:11px;color:var(--muted);margin-top:8px}.dg-quote-statement{position:relative;padding:30px 0}.dg-quote-mark{font:700 88px/1 var(--serif);color:var(--accent);position:absolute;top:-8px;left:-12px;opacity:.28}.dg-quote-statement blockquote{font:700 clamp(30px,4vw,52px)/1.14 var(--serif);letter-spacing:-.035em;margin:0 0 20px}.dg-quote-statement cite{font-style:normal;font-weight:800;color:var(--accent)}.dg-quote-share{margin-top:28px}.dg-quote-context{max-width:760px;margin:58px auto 0;border-top:1px solid var(--dg-line);padding-top:30px}
@media(max-width:780px){.dg-quote-layout{grid-template-columns:1fr;gap:24px}.dg-quote-media{max-width:420px;margin:auto}.dg-quote-statement{text-align:center}.dg-quote-mark{left:0}.dg-quote-header{text-align:left}.dg-quote-page{padding-top:28px}}

/* Sponsored distinction */
.story-card.is-sponsored,.dg-stream-story:has(.is-sponsored){background:#fff9eb;border:1px solid #ecd9a8;border-radius:var(--dg-radius-md);padding:12px}.dg-editorial-badge.is-sponsored{font-weight:900}

/* Smart sidebars */
.dg-smart-sidebar{align-self:start}.dg-smart-sidebar>*{max-width:100%}.home-stream .popular-column{overscroll-behavior:contain}

/* Performance and motion */
[data-v6-reveal]{opacity:0;transform:translateY(10px);transition:opacity .42s ease,transform .42s ease}[data-v6-reveal].is-inview{opacity:1;transform:none}.dg-motion-off [data-v6-reveal],.dg-performance-mode [data-v6-reveal]{opacity:1;transform:none;transition:none}
@media(prefers-reduced-motion:reduce){[data-v6-reveal]{opacity:1!important;transform:none!important;transition:none!important}*{scroll-behavior:auto!important}}

/* Cleaner mobile hierarchy */
@media(max-width:900px){.article-wrap{grid-template-columns:1fr!important}.sidebar-clean{display:none}.article-header h1{font-size:clamp(36px,9vw,52px)}.article-content{font-size:18px}.dg-editorial-hero{grid-template-columns:1fr!important}.dg-editorial-side,.hero-latest{border-left:0!important;padding-left:0!important}}

/* Dawuh Guru v6.0.1 — recovery: stable direct-child media contract
   v6.0.0 wrapped images inside .dg-media, which broke the proven v5.5.x
   component selectors. The renderer now returns the image directly and the
   parent component owns the aspect ratio. */
:where(
  .story-thumb,.latest-thumb,.list-thumb,.quick-thumb,.category-featured-media,
  .category-list-thumb,.index-item-media,.ranking-post-thumb,.inline-related-thumb,
  .dg-editorial-side-media,.dg-focus-thumb,.dg-showcase-thumb,.popular-thumb
){
  aspect-ratio:4/5!important;
  overflow:hidden!important;
  position:relative!important;
  display:block!important;
  background:var(--dg-surface-2,#f5f4f0)!important;
}
:where(
  .story-thumb,.latest-thumb,.list-thumb,.quick-thumb,.category-featured-media,
  .category-list-thumb,.index-item-media,.ranking-post-thumb,.inline-related-thumb,
  .dg-editorial-side-media,.dg-focus-thumb,.dg-showcase-thumb,.popular-thumb
)>:is(img,.media-placeholder,.dg-media__placeholder){
  width:100%!important;
  height:100%!important;
  min-width:0!important;
  min-height:0!important;
  max-width:none!important;
  max-height:none!important;
  display:block!important;
  object-fit:cover!important;
  object-position:center center!important;
  aspect-ratio:auto!important;
  margin:0!important;
  border-radius:inherit!important;
}
.dg-editorial-lead-media,.hero-media{aspect-ratio:16/9!important;overflow:hidden!important;display:block!important;position:relative!important}
.dg-editorial-lead-media>:is(img,.media-placeholder,.dg-media__placeholder),.hero-media>:is(img,.media-placeholder,.dg-media__placeholder){width:100%!important;height:100%!important;object-fit:cover!important;object-position:center!important;aspect-ratio:auto!important;display:block!important}
/* Quote single keeps a portrait editorial image without nesting a second ratio box. */
.dg-quote-media{aspect-ratio:4/5;overflow:hidden;border-radius:var(--dg-radius-md);background:var(--dg-surface-2)}
.dg-quote-media>:is(img,.media-placeholder,.dg-media__placeholder){width:100%!important;height:100%!important;object-fit:cover!important;object-position:center!important;display:block!important;aspect-ratio:auto!important}
.dg-quote-media figcaption{position:absolute;left:10px;right:10px;bottom:8px;z-index:2;padding:6px 8px;border-radius:7px;background:rgba(0,0,0,.62);color:#fff!important;margin:0!important;font-size:10px!important}
/* Preserve original ratio on the main article image. */
.single-post:not(.dg-content-quote) .article-hero,.single-post:not(.dg-content-quote) .article-hero img,.single-post .article-content img{aspect-ratio:auto!important;height:auto!important;object-fit:initial!important}
/* Recovery CTAs on the Quote template. */
.dg-quote-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-top:24px}.dg-quote-actions .icon-btn{border-radius:10px}.dg-quote-author-link{font-weight:800;text-decoration:none}.dg-quote-author-link:hover{color:var(--accent)}
.dg-quote-media{position:relative!important}
.dg-author-profile-actions{display:flex;gap:14px;align-items:center;flex-wrap:wrap;margin-top:8px}.dg-author-profile-actions .author-profile-link{display:inline-flex;align-items:center;gap:6px}.dg-author-profile-actions .author-profile-link svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}


/* Dawuh Guru v6.0.6 — canonical single + homepage 4:5
   This block is intentionally last because v6.css loads after style.css. */
.single-post .article-main{max-width:var(--dg-content)!important}
.single-post .article-header,.single-post .article-action-bar,.single-post .article-byline{box-sizing:border-box}
.single-post.dg-content-quote .article-hero{aspect-ratio:4/5!important;max-width:min(100%,760px)!important;height:auto!important;margin:24px auto 30px!important;overflow:hidden!important;border-radius:18px!important;background:var(--dg-surface-2,#f5f4f0)!important}
.single-post.dg-content-quote .article-hero img{width:100%!important;height:100%!important;max-height:none!important;object-fit:cover!important;object-position:center top!important;aspect-ratio:auto!important;display:block!important}
.single-post:not(.dg-content-quote) .article-hero,.single-post:not(.dg-content-quote) .article-hero img{aspect-ratio:auto!important;height:auto!important;object-fit:initial!important}

/* Every image-bearing module on the public homepage uses one portrait contract. */
.dg-home-hero .dg-editorial-lead-media,
.dg-home-hero .dg-editorial-side-media,
.dg-home-hero .latest-thumb,
.dg-focus-section .dg-focus-thumb,
.dg-showcase-section .dg-showcase-thumb,
.home-stream .list-thumb,
.home-stream .popular-thumb,
.home .story-thumb,
.home .inline-related-thumb{
  aspect-ratio:4/5!important;
  overflow:hidden!important;
  position:relative!important;
  display:block!important;
  background:var(--dg-surface-2,#f5f4f0)!important;
  border-radius:10px!important;
}
.dg-home-hero .dg-editorial-lead-media>:is(img,.media-placeholder,.dg-media__placeholder),
.dg-home-hero .dg-editorial-side-media>:is(img,.media-placeholder,.dg-media__placeholder),
.dg-home-hero .latest-thumb>:is(img,.media-placeholder,.dg-media__placeholder),
.dg-focus-section .dg-focus-thumb>:is(img,.media-placeholder,.dg-media__placeholder),
.dg-showcase-section .dg-showcase-thumb>:is(img,.media-placeholder,.dg-media__placeholder),
.home-stream .list-thumb>:is(img,.media-placeholder,.dg-media__placeholder),
.home-stream .popular-thumb>:is(img,.media-placeholder,.dg-media__placeholder),
.home .story-thumb>:is(img,.media-placeholder,.dg-media__placeholder),
.home .inline-related-thumb>:is(img,.media-placeholder,.dg-media__placeholder){
  width:100%!important;
  height:100%!important;
  min-width:0!important;
  min-height:0!important;
  max-width:none!important;
  max-height:none!important;
  aspect-ratio:auto!important;
  object-fit:cover!important;
  object-position:center center!important;
  display:block!important;
  margin:0!important;
}
/* Override the old v6 lead rule that forced 16:9. */
.dg-home-hero .dg-editorial-lead-media,.home .hero-media{aspect-ratio:4/5!important}
.dg-home-hero .dg-editorial-lead-media>img,.home .hero-media>img{height:100%!important;object-fit:cover!important;aspect-ratio:auto!important}

/* Layout proportions around portrait thumbnails. */
.dg-home-hero .dg-editorial-hero{align-items:start}
.dg-home-hero .dg-editorial-lead-media{max-width:100%}
.dg-home-hero .dg-latest-card{grid-template-columns:104px minmax(0,1fr)!important;align-items:start!important}
.home-stream .dg-stream-story{grid-template-columns:160px minmax(0,1fr)!important;align-items:start!important}
.home-stream .dg-terminal-item{grid-template-columns:88px minmax(0,1fr)!important;align-items:start!important}
@media(max-width:900px){
  .home-stream .dg-stream-story{grid-template-columns:120px minmax(0,1fr)!important}
  .dg-home-hero .dg-latest-card{grid-template-columns:92px minmax(0,1fr)!important}
}
@media(max-width:640px){
  .home-stream .dg-stream-story{grid-template-columns:105px minmax(0,1fr)!important}
  .home-stream .dg-terminal-item{grid-template-columns:68px minmax(0,1fr)!important}
  .dg-home-hero .dg-latest-card{grid-template-columns:88px minmax(0,1fr)!important}
}
