/** D4C Network World editorial presentation — v3.9.6.0
 * Audited against BuddyX Pro 5.1.7 single.php.
 * Presentation only: .site-sub-header is the BuddyX title strip;
 * .single-post-main-wrapper is the authoritative single-entry layout wrapper.
 */

/* BuddyX's actual single-entry wrapper owns the Network World environment. */
body.d4c-network-editorial .single-post-main-wrapper {
    position: relative;
    background-color: #edf7fb;
    background-image:
        linear-gradient(90deg, rgba(239,248,252,.72) 0%, rgba(247,251,253,.58) 48%, rgba(239,248,252,.88) 100%),
        url("images/d4c-two-worlds-globe.webp");
    background-repeat: no-repeat, no-repeat;
    background-position: center, 24% 42px;
    background-size: cover, 660px auto;
}

/* BuddyX Pro 5.1.7 outputs this exact title/breadcrumb strip from single.php. */
body.d4c-network-editorial .site-sub-header {
    display: none !important;
}

/* Blog posts have an additional parent-theme entry header before #primary. */
body.d4c-network-editorial > #page .single-post-main-wrapper > .entry-header,
body.d4c-network-editorial .single-post-main-wrapper > .entry-header--default {
    display: none !important;
}

body.d4c-network-editorial #primary.site-main {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(49,104,136,.28);
    border-radius: 18px;
    background: rgba(255,255,255,.82);
    box-shadow: 0 22px 55px rgba(24,65,89,.16);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
body.d4c-network-editorial #primary.site-main::before {
    display: none !important;
    content: none !important;
}
body.d4c-network-editorial #primary .entry {
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}
body.d4c-network-editorial #primary .entry-content {
    padding: 0 !important;
    color: #263b48;
    font-size: 16px;
    line-height: 1.75;
}

body.d4c-network-editorial .d4c-editorial-masthead {
    padding: 24px 30px 20px;
    border-bottom: 1px solid rgba(49,104,136,.2);
    background: linear-gradient(105deg,rgba(221,241,251,.94),rgba(255,255,255,.86));
}
body.d4c-network-editorial .d4c-editorial-kicker {
    color:#17618b;font-size:12px;font-weight:800;letter-spacing:.15em;text-transform:uppercase;margin-bottom:8px;
}
body.d4c-network-editorial .d4c-editorial-title {
    margin:0;color:#103e5c;font-size:clamp(26px,2.25vw,38px);line-height:1.15;font-weight:700;
}
body.d4c-network-editorial .d4c-editorial-date {
    margin-top:9px;color:#607985;font-size:13px;
}
body.d4c-network-editorial .d4c-editorial-copy {
    min-height:260px;padding:30px;
}
body.d4c-network-editorial .d4c-editorial-copy a {font-weight:700;}
body.d4c-network-editorial .d4c-editorial-return {padding:0 30px 30px;}
body.d4c-network-editorial .d4c-editorial-return a {
    display:inline-block;padding:10px 16px;border:1px solid rgba(27,93,130,.3);border-radius:8px;
    background:rgba(236,247,252,.92);color:#155879;font-weight:700;text-decoration:none;
}
body.d4c-network-editorial .d4c-editorial-return a:hover {background:#fff;}

/* Sidebar remains BuddyX-owned; only its visual surface is coordinated. */
body.d4c-network-editorial .primary-sidebar .widget,
body.d4c-network-editorial .left-sidebar .widget {
    border-radius:12px;
    box-shadow:0 10px 30px rgba(25,67,92,.09);
    background:rgba(255,255,255,.92);
}

@media (max-width:1024px) {
    body.d4c-network-editorial .single-post-main-wrapper {
        background-position:center, 50% 34px;
        background-size:cover, 600px auto;
    }
}
@media (max-width:767px) {
    body.d4c-network-editorial .single-post-main-wrapper {
        background-position:center, 50% 30px;
        background-size:cover, 500px auto;
    }
    body.d4c-network-editorial #primary.site-main {border-radius:12px;}
    body.d4c-network-editorial .d4c-editorial-masthead {padding:19px 18px 17px;}
    body.d4c-network-editorial .d4c-editorial-copy {padding:22px 18px;min-height:180px;font-size:15px;line-height:1.68;}
    body.d4c-network-editorial .d4c-editorial-return {padding:0 18px 24px;}
}

/* v3.9.6.3: Additive Network World globe surfaces. No ancestor is hidden,
 * repositioned, or replaced by these rules. The existing title, body,
 * controls, sidebar and footer retain their v3.9.6.0 rendering. */
body.d4c-network-announcement .d4c-editorial-masthead,
body.d4c-network-blog .d4c-editorial-masthead {
    position:relative;isolation:isolate;overflow:hidden;
    min-height:250px;box-sizing:border-box;
    display:flex;flex-direction:column;justify-content:center;
    padding:30px clamp(20px,3vw,42px);
    background:radial-gradient(circle at 79% 51%,rgba(40,145,205,.24),transparent 25%),
      linear-gradient(110deg,#f7fcff 0%,#e6f4fb 62%,#bedff0 100%);
}
body.d4c-network-announcement .d4c-editorial-masthead::before,
body.d4c-network-blog .d4c-editorial-masthead::before {
    content:"";position:absolute;z-index:-1;right:6%;top:50%;
    width:211px;height:211px;transform:translateY(-50%);
    background:url("images/d4c-two-worlds-globe.webp") center/contain no-repeat;
    filter:drop-shadow(0 7px 18px rgba(23,99,148,.24));
}
body.d4c-network-announcement .d4c-editorial-masthead > *,
body.d4c-network-blog .d4c-editorial-masthead > * {position:relative;max-width:60%;}
/* These are the BuddyPress Member Blog plugin's exact root wrappers. */
body.d4c-network-blog-dashboard .member-blog-dashboard-wrapper {
    border:1px solid #aacfe0;border-radius:14px;overflow:hidden;
    background:#f7fbfe;
}
body.d4c-network-blog-dashboard .member-blog-dashboard-wrapper::before {
    content:"";display:block;height:225px;border-bottom:1px solid #a9cfe1;
    background:radial-gradient(circle at 50% 50%,rgba(70,160,213,.2),transparent 25%),
      url("images/d4c-two-worlds-globe.webp") center/211px 211px no-repeat,
      linear-gradient(110deg,#f4fbff,#d2eaf7);
}
body.d4c-network-member-blog .bpmb-writer-header {
    position:relative;isolation:isolate;overflow:hidden;
    min-height:220px;box-sizing:border-box;
    padding-right:230px;
    border:1px solid #aacfe0;border-radius:14px;
    background:radial-gradient(circle at 87% 50%,rgba(70,160,213,.2),transparent 22%),
      url("images/d4c-two-worlds-globe.webp") right 15px center/195px 195px no-repeat,
      linear-gradient(110deg,#f7fcff,#d9eef9);
}
@media(max-width:767px) {
  body.d4c-network-announcement .d4c-editorial-masthead,
  body.d4c-network-blog .d4c-editorial-masthead {min-height:0;padding:230px 20px 22px;}
  body.d4c-network-announcement .d4c-editorial-masthead::before,
  body.d4c-network-blog .d4c-editorial-masthead::before {
    top:108px;right:50%;width:190px;height:190px;transform:translate(50%,-50%);
  }
  body.d4c-network-announcement .d4c-editorial-masthead > *,
  body.d4c-network-blog .d4c-editorial-masthead > * {max-width:100%;}
  body.d4c-network-blog-dashboard .member-blog-dashboard-wrapper::before {
    height:200px;background-size:auto,185px 185px,cover;
  }
  body.d4c-network-member-blog .bpmb-writer-header {
    min-height:0;padding:205px 18px 20px;
    background-position:center,center 12px,center;
    background-size:auto,180px 180px,cover;
  }
}

/* BuddyPress Nouveau owns the Activity form, filters and stream.
 * This decorative scene precedes them without changing their controls. */
body.d4c-network-activity #buddypress::before {
  content:"";display:block;min-height:225px;margin:0 0 22px;
  border:1px solid #a9cfe1;border-radius:14px;
  background:radial-gradient(circle at 50% 50%,rgba(70,160,213,.2),transparent 25%),
    url("images/d4c-two-worlds-globe.webp") center/211px 211px no-repeat,
    linear-gradient(110deg,#f4fbff,#d2eaf7);
}
@media(max-width:767px){body.d4c-network-activity #buddypress::before {min-height:200px;background-size:auto,185px 185px,cover;}}

/* Match the approved full-page preview on desktop single entries. The stone
 * images sit at the two outer edges; the existing content grid stays intact. */
@media (min-width:1025px) {
  body.d4c-network-editorial .single-post-main-wrapper {
    background-color:#edf7fb;
    background-image:url("images/d4c-network-stone-left.webp"),
      url("images/d4c-network-stone-right.webp"),
      linear-gradient(90deg,#eaf6fc 0%,#f5fbfe 50%,#eaf6fc 100%);
    background-repeat:repeat-y,repeat-y,no-repeat;
    background-position:left top,right top,center;
    background-size:145px auto,145px auto,cover;
  }
}

/* Phone composition: scene first, then full-width content and controls. */
@media (max-width:480px) {
  body.d4c-network-editorial .d4c-editorial-masthead {
    padding:205px 18px 24px;
  }
  body.d4c-network-editorial .d4c-editorial-masthead::before {
    top:96px;width:175px;height:175px;
  }
  body.d4c-network-editorial .d4c-editorial-title {
    font-size:clamp(25px,7vw,32px);
    overflow-wrap:anywhere;
  }
  body.d4c-network-editorial .d4c-editorial-copy {
    padding:22px 18px;min-height:0;
  }
  body.d4c-network-editorial .d4c-editorial-return {padding:0 18px 24px;}
  body.d4c-network-editorial .d4c-editorial-return a {
    max-width:100%;box-sizing:border-box;white-space:normal;
  }
  body.d4c-network-blog-dashboard .member-blog-dashboard-wrapper,
  body.d4c-network-member-blog .bpmb-writer-header,
  body.d4c-network-activity #buddypress::before {
    max-width:100%;box-sizing:border-box;
  }
}

/* v3.9.6.4: Activity title is now real markup inside the globe banner. */
body.d4c-network-activity .site-sub-header {display:none;}
body.d4c-network-activity #buddypress::before {display:none;}
body.d4c-network-activity .d4c-network-activity-heading {
  box-sizing:border-box;min-height:225px;margin:0 0 22px;
  padding:48px clamp(22px,4vw,54px);
  border:1px solid #a9cfe1;border-radius:14px;
  background:radial-gradient(circle at 78% 50%,rgba(70,160,213,.18),transparent 25%),
    url("images/d4c-two-worlds-globe.webp") right 20% center/211px 211px no-repeat,
    linear-gradient(110deg,#f4fbff,#d2eaf7);
  color:#163c56;
}
body.d4c-network-activity .d4c-network-activity-kicker {
  display:block;margin-bottom:10px;color:#17618b;
  font-size:12px;font-weight:800;letter-spacing:.15em;text-transform:uppercase;
}
body.d4c-network-activity .d4c-network-activity-heading h1 {
  margin:0 0 8px;color:#103e5c;font-size:clamp(28px,2.25vw,38px);
}
body.d4c-network-activity .d4c-network-activity-heading p {
  margin:0;color:#486b7d;font-size:16px;
}
@media (max-width:767px) {
  body.d4c-network-activity .d4c-network-activity-heading {
    min-height:0;padding:200px 20px 24px;
    background-position:center,center 12px,center;
    background-size:auto,180px 180px,cover;
  }
}

/* v3.9.6.8: Give Activity's right widget column room for the Lucky Wheel form.
 * BuddyX Pro owns the grid and uses this variable for its sidebar track. */
@media (min-width:1200px) {
  body.d4c-network-activity {
    --global-sidebar-width: 450px;
  }
}


/* D4C v3.9.6.21 — Single Blog duplicate-heading correction.
 * BuddyX Pro 5.1.7 renders its native single-post heading inside
 * .container > .buddyx-post-section before #primary. The D4C article
 * already supplies its own masthead inside the content, so suppress only
 * that native single-post presentation block on standard Blog posts. */
body.d4c-network-blog .single-post-main-wrapper > .container > .buddyx-post-section {
    display: none !important;
}


/* D4C v3.9.6.22 — single Blog background-layer correction.
 * The shared Network World body already owns the outer stone/dark environment.
 * Remove the older editorial wrapper scene only on standard Blog posts so the
 * D4C article card sits directly on that environment without a second pale
 * centre column or duplicate inner stone gutters. Announcements and other
 * editorial surfaces retain their existing presentation. */
body.d4c-network-blog .single-post-main-wrapper {
    background-color: transparent !important;
    background-image: none !important;
}


/* D4C v3.9.6.23 — single Blog natural-height correction.
 * Standard Blog posts already have their D4C masthead and Return to Blog control.
 * Remove the legacy minimum copy height and unused BuddyX entry footer so short
 * posts finish naturally instead of carrying a large empty lower panel.
 * Scope is standard single Blog posts only. */
body.d4c-network-blog .d4c-editorial-copy {
    min-height: 0 !important;
}
body.d4c-network-blog #primary .entry-footer {
    display: none !important;
}


/* D4C v3.9.6.24 — single Blog phantom-height correction.
 * BuddyX injects .sticky-social-box-wrap as a floated zero-width spacer with
 * an inline height on single posts. Even when the social control is not visibly
 * occupying that space, the float still extends the entry-content height and
 * leaves a large empty grey area below short D4C posts. Remove only that spacer
 * on standard D4C Blog single posts; the visible D4C article and return control
 * remain unchanged. */
body.d4c-network-blog #primary .sticky-social-box-wrap {
    display: none !important;
    float: none !important;
    width: 0 !important;
    height: 0 !important;
}
