/* KSTONE Dark Pages V1.4 — scoped ONLY to blog/video. HOME V6 editorial palette. */
body.kdp-dark{--kdp-bg:#131415;--kdp-panel:#202123;--kdp-line:#343638;--kdp-text:#fafafa;--kdp-muted:#b5b6b9;background:var(--kdp-bg)!important;color:var(--kdp-text)!important;font-family:Roboto,Arial,sans-serif;}
body.kdp-dark #page,body.kdp-dark #wrapper,body.kdp-dark .site,body.kdp-dark .site-wrapper,body.kdp-dark .site-content,body.kdp-dark #content,body.kdp-dark .content-area,body.kdp-dark .site-main,body.kdp-dark main,body.kdp-dark .page-wrapper,body.kdp-dark .page-content,body.kdp-dark .entry-content,body.kdp-dark .elementor-location-single{background-color:var(--kdp-bg)!important;color:var(--kdp-text)!important;}
/* Theme / page-builder containers known to carry a white surface. Do not target the header. */
body.kdp-dark .kdp-content-scope{background:var(--kdp-bg)!important;color:var(--kdp-text)!important;}
body.kdp-dark .kdp-content-scope :is(.elementor-section,.elementor-container,.elementor-widget-wrap,.elementor-widget-container,.e-con,.wp-block-group,.wp-block-cover,.entry-content,.site-content,.page-content):not(.kdp-editorial-card):not(.kdp-card-media){background-color:transparent!important;}
body.kdp-dark .kdp-content-scope .kdp-pale-surface{background-color:transparent!important;box-shadow:none!important;}
body.kdp-dark .kdp-content-scope .kdp-pale-card{background-color:transparent!important;}
/* Robust text contrast in archive content. No global text override of KING STONE header. */
body.kdp-dark .kdp-content-scope :is(h1,h2,h3,h4,h5,h6,.entry-title,.entry-title a,.elementor-heading-title){color:var(--kdp-text)!important;}
body.kdp-dark .kdp-content-scope :is(p,.entry-meta,.date,time,.post-date,.video-meta,.excerpt){color:var(--kdp-muted)!important;}
body.kdp-dark .kdp-content-scope :is(a){text-decoration:none;}
body.kdp-dark .kdp-content-scope .kdp-contrast-text{color:var(--kdp-text)!important;}
body.kdp-dark .kdp-content-scope a:hover{color:#fff;}
body.kdp-dark .kdp-content-scope a:focus-visible{outline:2px solid #fff;outline-offset:3px;}
body.kdp-dark .kdp-content-scope :is(hr,.separator){border-color:var(--kdp-line)!important;}
/* Content sizing: preserve original header/navigation widths and the full-size source image. */
body.kdp-dark :is(.site-content,.entry-content,.page-content,main) > .container{max-width:var(--kdp-max-width,1320px)!important;margin-inline:auto;}
body.kdp-dark .kdp-content-scope img{filter:none!important;image-rendering:auto;}
/* Fallback for unfamiliar theme card classes (before JS detects the card). */
body.kdp-dark .kdp-content-scope :is(article,.post-card,.blog-card,.news-card,.video-card,[class*="news-card"],[class*="video-card"],[class*="post-card"]){color:var(--kdp-text);border-color:var(--kdp-line);}
body.kdp-dark .kdp-content-scope :is(.post-card,.blog-card,.news-card,.video-card) :is(h2,h3,a){color:var(--kdp-text)!important;}
/* JS marks actual cards; these rules prevail over inline white panels without affecting the header. */
body.kdp-dark .kdp-editorial-card{position:relative!important;display:block;isolation:isolate;min-width:0;aspect-ratio:16/10;background:#0e0f10!important;border:1px solid #414244!important;border-radius:11px!important;overflow:hidden!important;box-shadow:none!important;transition:border-color .22s ease,transform .22s ease;}
body.kdp-dark .kdp-editorial-card:hover{border-color:#848587!important;transform:translateY(-2px);}
body.kdp-dark .kdp-editorial-card::after{content:"";position:absolute;z-index:1;inset:35% 0 0;background:linear-gradient(180deg,transparent 0%,rgba(0,0,0,.18) 15%,rgba(0,0,0,.80) 72%,rgba(0,0,0,.94) 100%);pointer-events:none;}
body.kdp-dark .kdp-editorial-card .kdp-card-media{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;margin:0!important;padding:0!important;background:#0b0c0d!important;z-index:0!important;overflow:hidden!important;border:none!important;border-radius:0!important;}
body.kdp-dark .kdp-editorial-card .kdp-card-media img{display:block!important;width:100%!important;height:100%!important;max-height:100%!important;object-fit:cover!important;object-position:center!important;filter:none!important;transition:transform .32s ease!important;border-radius:0!important;}
body.kdp-dark.kdp-full-images .kdp-editorial-card .kdp-card-media img{object-fit:contain!important;}
body.kdp-dark .kdp-editorial-card:hover .kdp-card-media img{transform:scale(1.014);}
body.kdp-dark .kdp-editorial-card .kdp-card-body{position:absolute!important;inset:auto 0 0!important;z-index:2!important;display:flex!important;flex-direction:column!important;align-items:flex-start!important;justify-content:flex-end!important;gap:7px!important;width:100%!important;max-height:85%!important;overflow:visible!important;padding:16px 19px 19px!important;margin:0!important;background:transparent!important;border:0!important;box-shadow:none!important;color:#fff!important;pointer-events:none;}
body.kdp-dark .kdp-editorial-card .kdp-card-body *{background-color:transparent!important;box-shadow:none!important;color:#fff!important;}
body.kdp-dark .kdp-editorial-card .kdp-card-body :is(h2,h3,h4,.entry-title,.post-title,.title,a){font-size:clamp(16px,1.45vw,22px)!important;font-weight:800!important;letter-spacing:-.4px!important;line-height:1.25!important;color:#fff!important;margin:0!important;text-shadow:0 1px 8px rgba(0,0,0,.55);}
body.kdp-dark .kdp-editorial-card .kdp-card-body :is(time,.date,.post-date,.entry-meta){font-size:12px!important;font-weight:400!important;color:#d2d2d2!important;}
body.kdp-dark .kdp-editorial-card .kdp-card-body :is(a,button){pointer-events:auto;}
body.kdp-dark .kdp-editorial-card .kdp-card-body :is(.category,.tag,.badge,[class*="category"],[class*="tag"]){display:inline-block!important;width:max-content;max-width:100%;padding:4px 8px!important;background:#fff!important;color:#111!important;font-size:10px!important;font-weight:800!important;letter-spacing:.8px!important;border-radius:3px!important;text-transform:uppercase;}
body.kdp-dark .kdp-editorial-card :is(.play,.play-btn,.play-button,[class*="play-button"],[class*="play-icon"]){position:relative;z-index:4;}
/* In unpredictable markup keep a solid dark fallback if overlay body was not detected. */
body.kdp-dark .kdp-detected-card:not(.kdp-editorial-card){background:var(--kdp-panel)!important;color:var(--kdp-text)!important;border:1px solid var(--kdp-line)!important;border-radius:11px!important;overflow:hidden!important;}
body.kdp-dark .kdp-detected-card:not(.kdp-editorial-card) .kdp-card-body{background:var(--kdp-panel)!important;color:#fff!important;padding:16px 18px!important;}
body.kdp-dark .kdp-detected-card:not(.kdp-editorial-card) .kdp-card-body *{color:inherit!important;}
/* In case original content provides a two- or three-card grid, expand it to the full width. */
body.kdp-dark .kdp-editorial-grid{display:grid!important;gap:20px!important;align-items:stretch!important;width:100%;}
body.kdp-blog .kdp-editorial-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important;}
body.kdp-video .kdp-editorial-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}
body.kdp-dark .kdp-editorial-grid > *{min-width:0!important;max-width:none!important;width:auto!important;}
/* Strong scoped safety: neutralize white page section surfaces even if Elementor inline CSS supplied them. */
body.kdp-video .kdp-content-scope :is(.kdp-page-section,.kdp-page-surface){background:transparent!important;color:#fff!important;}
body.kdp-blog .kdp-content-scope :is(.kdp-page-section,.kdp-page-surface){background:transparent!important;color:#fff!important;}
@media(min-width:1024px){body.kdp-dark .kdp-content-scope{max-width:var(--kdp-max-width,1320px);margin-inline:auto;}}
@media(max-width:950px){body.kdp-blog .kdp-editorial-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;}body.kdp-dark .kdp-editorial-card{aspect-ratio:16/11;}}
@media(max-width:640px){body.kdp-dark .kdp-content-scope{max-width:100%;}body.kdp-dark .kdp-editorial-grid{grid-template-columns:minmax(0,1fr)!important;gap:15px!important;}body.kdp-dark .kdp-editorial-card{aspect-ratio:16/10;}body.kdp-dark .kdp-editorial-card .kdp-card-body{padding:13px 14px 16px!important;}body.kdp-dark .kdp-editorial-card .kdp-card-body :is(h2,h3,h4,.entry-title,.post-title,.title,a){font-size:18px!important;}}
@media(prefers-reduced-motion:reduce){body.kdp-dark .kdp-editorial-card,body.kdp-dark .kdp-editorial-card .kdp-card-media img{transition:none!important;}}
