/* OGC Blog mobile layout refinement V8 */
.ogcb-article-wrap,
.ogcb-article-wrap * {
  box-sizing: border-box;
}
.ogcb-article-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: clip;
}
.ogcb-article-wrap > .container {
  width: min(1380px, calc(100% - 40px));
  max-width: 1380px;
  padding-left: 0;
  padding-right: 0;
}

/* Desktop retains the three-column article, share rail and OGC partner sidebar. */
.ogcb-article-layout {
  width: min(1380px, calc(100% - 64px));
  max-width: 1380px;
  margin-left: auto;
  margin-right: auto;
  min-width: 0;
}
.ogcb-article-body,
.ogcb-rich-content,
.ogcb-article-sidebar {
  min-width: 0;
  max-width: 100%;
}
.ogcb-rich-content {
  overflow-wrap: anywhere;
}
.ogcb-rich-content img,
.ogcb-rich-content video,
.ogcb-rich-content iframe,
.ogcb-rich-content table {
  max-width: 100%;
}
.ogcb-rich-content img,
.ogcb-rich-content video,
.ogcb-rich-content iframe {
  height: auto;
}
.ogcb-article-sidebar {
  width: 100%;
}
.ogcb-ad-card {
  min-width: 0;
  max-width: 100%;
  width: 100%;
}
.ogcb-ad-slot {
  width: 100%;
  max-width: 100%;
}

/* Tablet and mobile: stack all columns and let the ad cards span the content width. */
@media (max-width: 900px) {
  .ogcb-article-layout {
    width: calc(100% - 36px) !important;
    max-width: 760px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 22px !important;
    margin: 28px auto 0 !important;
    padding: 0 !important;
  }
  .ogcb-article-share,
  .ogcb-article-body,
  .ogcb-article-sidebar {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  .ogcb-article-share {
    position: static !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
    order: 0;
  }
  .ogcb-article-body {
    order: 1;
  }
  .ogcb-article-sidebar {
    position: static !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: start !important;
    gap: 16px !important;
    order: 2;
    padding-bottom: 116px !important;
  }
  .ogcb-ad-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 17px !important;
    overflow: hidden;
  }
  .ogcb-ad-slot {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 230px !important;
    padding: 18px !important;
  }
  .ogcb-ad-slot--tall {
    min-height: 250px !important;
  }
  .ogcb-ad-cta {
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 48px;
    box-sizing: border-box !important;
    white-space: normal !important;
  }
  .ogcb-related {
    width: calc(100% - 36px) !important;
    max-width: 760px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

/* Narrow phones: compact typography and no edge-to-edge overflow. */
@media (max-width: 600px) {
  .ogcb-article-wrap > .container {
    width: calc(100% - 30px) !important;
  }
  .ogcb-article-header--hero {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: -50vw !important;
    left: 50% !important;
    min-height: 390px !important;
    padding: 48px 0 42px !important;
  }
  .ogcb-article-hero-inner {
    width: calc(100% - 32px) !important;
    max-width: 100% !important;
  }
  .ogcb-article-header--hero h1 {
    font-size: clamp(29px, 8vw, 38px) !important;
    line-height: 1.1 !important;
    overflow-wrap: anywhere;
  }
  .ogcb-article-header--hero .ogcb-article-deck {
    font-size: 14px !important;
    line-height: 1.6 !important;
  }
  .ogcb-article-header--hero .ogcb-article-byline {
    justify-content: center !important;
    gap: 9px 12px !important;
  }
  .ogcb-article-layout {
    width: calc(100% - 30px) !important;
    max-width: 560px !important;
    margin-top: 24px !important;
    margin-bottom: 0 !important;
    gap: 20px !important;
  }
  .ogcb-article-body,
  .ogcb-rich-content {
    width: 100% !important;
    max-width: 100% !important;
  }
  .ogcb-rich-content {
    font-size: 15px !important;
    line-height: 1.78 !important;
  }
  .ogcb-article-sidebar {
    width: 100% !important;
    max-width: 100% !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px !important;
    padding-bottom: 132px !important;
  }
  .ogcb-ad-card {
    border-radius: 15px !important;
    padding: 16px !important;
  }
  .ogcb-ad-card h3 {
    font-size: 19px !important;
    line-height: 1.25 !important;
  }
  .ogcb-ad-card p {
    font-size: 13px !important;
    line-height: 1.65 !important;
  }
  .ogcb-ad-slot {
    min-height: 225px !important;
    border-radius: 11px !important;
  }
  .ogcb-ad-slot--tall {
    min-height: 245px !important;
  }
  .ogcb-ad-cta {
    min-height: 50px !important;
    padding: 12px 14px !important;
    font-size: 13px !important;
    line-height: 1.35 !important;
  }
  .ogcb-related {
    width: calc(100% - 30px) !important;
  }
}
