/* =========================================
   Blog post overflow fixes (sidebar-safe)
   Loaded only on single blog posts
   ========================================= */

/* Keep Gutenberg full/wide blocks inside the content column */
.single-post .content .entry-content .alignfull,
.single-post .content .entry-content .alignwide {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Media should never overflow into sidebar */
.single-post .content .entry-content img {
  max-width: 100% !important;
  height: auto;
  display: block;
}

/* Responsive embeds */
.single-post .content .entry-content iframe,
.single-post .content .entry-content embed,
.single-post .content .entry-content object,
.single-post .content .entry-content video {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  display: block;
}


/* Tables/code often break layouts */
.single-post .content .entry-content table {
  width: 100%;
  max-width: 100%;
  display: block;
  overflow-x: auto;
}

.single-post .content .entry-content pre,
.single-post .content .entry-content code {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre;
}

/* Long URLs/words */
.single-post .content .entry-content {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* HARD CONTAINMENT for Gutenberg blocks */
.single-post .blog-layout .entry-content {
  position: relative;
  overflow: visible;
  overflow-x: clip;
}
.single-post .content .entry-content figure,
.single-post .content .entry-content .wp-block-image {
  max-width: 100%;
}


/* Ordered list: restore numbering + tighten spacing */
.single-post ol {
  list-style: decimal !important;
  list-style-position: inside;
  margin-left: 1.25rem !important;
  padding-left: 0.5rem !important;
}

.single-post ol > li {
  list-style: decimal !important;
  margin: 0 0 0.4rem 0 !important;
  padding-left: 0.25rem !important;
  line-height: 1.5 !important;
  background: none !important;
}

.single-post ol > li::before {
  content: none !important;
}

.single-post ol > li::marker {
  color: inherit !important;
}

/* =====================================
   BLOG: Table styling
   ===================================== */

.single-post .entry-content table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  margin: 1.25rem 0;
  font-size: 0.95rem;
}

/* Cell spacing + borders */
.single-post .entry-content th,
.single-post .entry-content td {
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(0,0,0,0.12);
  text-align: left;
  vertical-align: top;
}

/* Header row */
.single-post .entry-content thead th {
  font-weight: 600;
  background: rgba(0,0,0,0.04);
}

/* Zebra rows for readability */
.single-post .entry-content tbody tr:nth-child(even) td {
  background: rgba(0,0,0,0.02);
}

/* Prevent ugly overflow: allow horizontal scroll on small screens */
.single-post .entry-content table {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Keep columns readable */
.single-post .entry-content th {
  white-space: nowrap;
}

/* Optional: remove extra spacing on last row */
.single-post .entry-content tbody tr:last-child td {
  border-bottom-width: 1px;
}

/* =====================================
   FIX: Prevent blog images from cropping
   ===================================== */

.single-post .entry-content figure.wp-block-image img,
.single-post .entry-content .wp-block-image img,
.single-post .entry-content img {
  height: auto !important;
  max-width: 100% !important;
  width: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
}
.single-post .entry-content figure,
.single-post .entry-content .wp-block-image {
  height: auto !important;
  overflow: visible !important;
}

/* Ensure content column does not clip images */
.single-post .blog-layout .content,
.single-post .blog-layout .entry-content {
  min-width: 0;
}

/* =====================================
   Classic Editor: [caption] support
   Prevent crop + allow caption to wrap
   ===================================== */
.single-post .entry-content .wp-caption {
  max-width: 100% !important;
  width: auto !important;
}

.single-post .entry-content .wp-caption img {
  display: block;
  max-width: 100% !important;
  width: 100% !important;   /* fill the content column */
  height: auto !important;  /* preserve aspect ratio */
  object-fit: contain !important; /* override theme "cover" rules */
  object-position: center center !important;
}

.single-post .entry-content .wp-caption .wp-caption-text {
  display: block;
  max-width: 100%;
  margin-top: 0.5rem;
  overflow-wrap: anywhere;  /* wrap long caption text */
  word-break: break-word;
}


/* SINGLE POST ONLY: Sidebar service card - overlay sits inside image */
.single-post .single_sidebar_service .service-item {
  position: relative;
  overflow: hidden;
}

.single-post .single_sidebar_service .service-item .service-member-content {
  bottom: 0 !important;              /* override bottom:-110px */
  left: 0 !important;
  right: 0 !important;
  padding: 22px 16px 18px !important;

  /* smoother overlay fade */
  background: linear-gradient(
    180deg,
    rgba(143, 116, 220, 0.09),
    #4c2432 50%
  ) !important;

  overflow-wrap: anywhere;
  word-break: break-word;
}

.single-post .banner-main-wrap-all {
  padding: clamp(70px, 8vw, 130px) 20px;
}

/* =========================================
   Single Post Banner Overlay + Spacing
========================================= */

.single-post .banner-main-wrap-all {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: clamp(160px, 32vh, 520px) !important;
  padding: clamp(60px, 7vw, 120px) 20px !important;
  margin-top: clamp(54px, 5vw, 120px) !important;
  background-position: center center !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
}

/* Overlay layer */
.single-post .banner-main-wrap-all::before {
  content: "" !important;
  position: absolute !important;
  inset: 0;
  background: rgba(76, 36, 50, 0.9) !important; /* brand color overlay */
  z-index: 1;
}

/* Ensure text sits above overlay */
.single-post .banner-main-wrap-all h1,
.single-post .banner-main-wrap-all .page-title,
.single-post .banner-main-wrap-all .container {
  font-size: clamp(28px, 3.5vw, 48px) !important;
  position: relative;
  z-index: 2;
  color: #fff;
}

/* Improve title readability */
.single-post .banner-main-wrap-all h1 {
  font-weight: 600;
  letter-spacing: 1px;
}

/* Single Post: stack sidebar BELOW content on tablet + mobile */
@media (max-width: 991px) {
  .single-post .blog-layout .main-row {
    display: flex;
    flex-direction: column;
  }

  .single-post .blog-layout .content {
    order: 1;
    width: 100% !important;
  }

  .single-post .blog-layout .sidebar {
    order: 2;
    width: 100% !important;
    margin-top: 24px;
  }
}

/* Single post: iPad/tablet sidebar widgets in 2 columns */
@media (min-width: 768px) and (max-width: 991px) {
  .single-post .blog-layout .sidebar {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: stretch;
  }

  .single-post .blog-layout .sidebar > * {
    flex: 0 0 calc(50% - 12px);
    max-width: calc(50% - 12px);
  }

  /* Make the service card + review card fill their column nicely */
  .single-post .blog-layout .sidebar .single_sidebar_service,
  .single-post .blog-layout .sidebar .widget,
  .single-post .blog-layout .sidebar .wpb_widgetised_column {
    width: 100%;
  }
}