/* Phase 3R.6N: shared single-post shell styling. Divi module internals are intentionally excluded. */
body.single-post {
  --dbc-post-cream: #f8f3e8;
  --dbc-post-white: #fff;
  --dbc-post-charcoal: #252525;
  --dbc-post-gold: #bd9f6a;
  --dbc-post-border: #e5dccb;
  --dbc-post-muted: #665f55;
}

body.single-post #main-content {
  background: var(--dbc-post-cream);
}

body.single-post #main-content > .container {
  width: min(1120px, calc(100% - 48px));
  max-width: 1120px;
  padding-top: 48px;
}

body.single-post #left-area > article.et_pb_post {
  margin-bottom: 48px;
  overflow-wrap: anywhere;
}

/*
 * Keep the first Divi section available for a full-width featured image while
 * giving subsequent article sections a consistent outer reading gutter.
 * Padding is applied to the section shell, never to nested modules/cards.
 */
body.single-post.et_pb_pagebuilder_layout #left-area > article > .entry-content > .et-l > .et_builder_inner_content > .et_pb_section:not(:first-child) {
  box-sizing: border-box;
  padding-right: 36px;
  padding-left: 36px;
}

/* Legacy editor articles do not have Divi section shells. */
body.single-post:not(.et_pb_pagebuilder_layout) #left-area > article > .entry-content {
  box-sizing: border-box;
  padding-right: 36px;
  padding-left: 36px;
}

body.single-post #left-area > article > .et_post_meta_wrapper:first-child {
  margin-bottom: 28px;
  padding: 32px;
  background: var(--dbc-post-white);
  border-top: 4px solid var(--dbc-post-gold);
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(30, 26, 20, 0.09);
}

body.single-post #left-area > article > .et_post_meta_wrapper:first-child .entry-title {
  margin: 0 0 12px;
  padding: 0;
  color: var(--dbc-post-charcoal);
  font-size: clamp(2.15rem, 4.4vw, 3.35rem);
  line-height: 1.12;
  text-align: left;
}

body.single-post #left-area > article > .et_post_meta_wrapper:first-child .post-meta {
  margin: 0 0 20px;
  color: var(--dbc-post-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

body.single-post #left-area > article > .et_post_meta_wrapper:first-child > img,
body.single-post #left-area > article > .et_post_meta_wrapper:first-child .et_featured_image {
  display: block;
  width: 100%;
  height: auto;
  margin: 24px 0 0;
  border-radius: 10px;
}

/* Limit prose rules to direct editor output so embedded Divi sections and service cards retain their settings. */
body.single-post #left-area > article > .entry-content > :where(p, ul, ol, blockquote, figure, table) {
  max-width: 74ch;
  margin-right: auto;
  margin-left: auto;
}

body.single-post #left-area > article > .entry-content > p {
  margin-bottom: 1.25em;
  color: #38342f;
  font-size: 1.05rem;
  line-height: 1.8;
}

body.single-post #left-area > article > .entry-content > :where(h2, h3, h4) {
  max-width: 74ch;
  margin: 1.55em auto 0.55em;
  color: var(--dbc-post-charcoal);
  line-height: 1.25;
}

body.single-post #left-area > article > .entry-content > h2 {
  font-size: clamp(1.65rem, 3vw, 2.25rem);
}

body.single-post #left-area > article > .entry-content > h3 {
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
}

body.single-post #left-area > article > .entry-content > :where(ul, ol) {
  margin-bottom: 1.4em;
  padding-left: 1.5em;
  color: #38342f;
  font-size: 1.03rem;
  line-height: 1.75;
}

body.single-post #left-area > article > .entry-content > blockquote {
  padding: 18px 22px;
  background: var(--dbc-post-white);
  border-left: 4px solid var(--dbc-post-gold);
  color: #403a32;
}

body.single-post #left-area > article > .entry-content > :where(figure, p) img,
body.single-post #left-area > article > .entry-content > video,
body.single-post #left-area > article > .entry-content > iframe {
  max-width: 100%;
  height: auto;
}

body.single-post #left-area > article > .entry-content > figure figcaption,
body.single-post #left-area > article > .entry-content > .wp-caption .wp-caption-text {
  margin-top: 8px;
  color: var(--dbc-post-muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

body.single-post #left-area > article > .entry-content > table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  -webkit-overflow-scrolling: touch;
}

body.single-post #left-area > article > .entry-content > :where(p, ul, ol, blockquote) a {
  color: #5d471c;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

body.single-post #left-area a:focus-visible,
body.single-post #sidebar a:focus-visible {
  outline: 3px solid var(--dbc-post-gold);
  outline-offset: 4px;
}

body.single-post.et_right_sidebar #sidebar {
  margin-bottom: 48px;
  padding: 28px;
  background: var(--dbc-post-white);
  border: 1px solid var(--dbc-post-border);
  border-top: 4px solid var(--dbc-post-gold);
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(30, 26, 20, 0.08);
}

body.single-post.et_right_sidebar #sidebar .et_pb_widget {
  margin-bottom: 28px;
}

body.single-post.et_right_sidebar #sidebar .et_pb_widget:last-child {
  margin-bottom: 0;
}

body.single-post.et_right_sidebar #sidebar :where(h2, h3, h4) {
  margin-bottom: 12px;
  color: var(--dbc-post-charcoal);
  font-size: 1.15rem;
  line-height: 1.3;
}

body.single-post.et_right_sidebar #sidebar a {
  color: #4f3e1d;
  line-height: 1.55;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

@media (max-width: 980px) {
  body.single-post #main-content > .container {
    width: min(100% - 40px, 760px);
    padding-top: 36px;
  }

  body.single-post.et_right_sidebar #sidebar {
    margin-top: 20px;
    padding: 24px;
  }

  body.single-post.et_pb_pagebuilder_layout #left-area > article > .entry-content > .et-l > .et_builder_inner_content > .et_pb_section:not(:first-child),
  body.single-post:not(.et_pb_pagebuilder_layout) #left-area > article > .entry-content {
    padding-right: 26px;
    padding-left: 26px;
  }
}

@media (max-width: 767px) {
  body.single-post #main-content > .container {
    width: calc(100% - 32px);
    padding-top: 28px;
  }

  body.single-post #left-area > article > .et_post_meta_wrapper:first-child {
    margin-bottom: 22px;
    padding: 24px;
  }

  body.single-post #left-area > article > .et_post_meta_wrapper:first-child .entry-title {
    font-size: clamp(2rem, 9vw, 2.65rem);
  }

  body.single-post #left-area > article > .entry-content > p {
    font-size: 1rem;
    line-height: 1.75;
  }

  body.single-post.et_right_sidebar #sidebar {
    padding: 24px;
  }

  body.single-post.et_pb_pagebuilder_layout #left-area > article > .entry-content > .et-l > .et_builder_inner_content > .et_pb_section:not(:first-child),
  body.single-post:not(.et_pb_pagebuilder_layout) #left-area > article > .entry-content {
    padding-right: 18px;
    padding-left: 18px;
  }
}
