
/*
 * DogHealth Guides Site Polish — V1.9.0
 * Desktop single-post shell correction:
 * - widen Kadence's actual narrow parent container first
 * - white article card ~1000px
 * - title/header ~900px
 * - reading text ~780px
 * - visual blocks ~920px
 * - CTA / Similar Posts / navigation stay broad
 */

body.dhg-polish {
  --dhg-ink: #24322e;
  --dhg-muted: #68756f;
  --dhg-green: #315f52;
  --dhg-green-deep: #244a40;
  --dhg-sage: #eaf1ec;
  --dhg-sage-2: #f4f7f4;
  --dhg-sage-3: #dce9e0;
  --dhg-warm: #fbfaf6;
  --dhg-card: #ffffff;
  --dhg-line: #dfe7e1;
  --dhg-blue-note: #eef5f3;
  --dhg-shadow: 0 12px 34px rgba(31, 49, 43, 0.075);
  --dhg-shadow-soft: 0 5px 18px rgba(31, 49, 43, 0.055);
  --dhg-radius: 16px;
  --dhg-radius-sm: 10px;
  color: var(--dhg-ink);
  background: var(--dhg-warm);
}

body.dhg-polish a { text-underline-offset: .14em; }

body.dhg-polish :where(.content-area, #primary, .site-main) {
  min-width: 0;
}

body.dhg-polish :where(a, button, input, textarea, select):focus-visible {
  outline: 3px solid rgba(49,95,82,.28);
  outline-offset: 3px;
}

body.dhg-polish :where(button, input[type="submit"], .button, .wp-block-button__link) {
  border-radius: 999px;
}

/* HEADER */
body.dhg-polish :where(.site-header, #masthead, .main-header-bar) {
  background: rgba(251,250,246,.98);
  border-bottom: 1px solid var(--dhg-line);
  box-shadow: 0 2px 14px rgba(31,49,43,.03);
}

body.dhg-polish :where(.site-title, .site-title a, .site-branding a) {
  color: var(--dhg-green-deep);
  font-weight: 800;
  letter-spacing: -.018em;
}

body.dhg-polish :where(.primary-menu-container a, .main-header-menu a, nav a) {
  font-weight: 650;
}


/* ==========================================================
   V1.7 — HOMEPAGE EDITORIAL INTRO
   Compact, not a giant marketing hero.
   ========================================================== */
body.dhg-polish :where(.dhg-home-intro) {
  width: 100%;
  padding: 24px 24px 26px;
  background:
    radial-gradient(circle at 88% 18%, rgba(49,95,82,.075), transparent 30%),
    linear-gradient(180deg, #fbfaf6 0%, #f7f8f4 100%);
  border-bottom: 1px solid rgba(49,95,82,.08);
}

body.dhg-polish .dhg-home-intro-inner {
  width: min(100%, 1160px);
  margin: 0 auto;
}

body.dhg-polish .dhg-home-eyebrow {
  display: inline-block;
  margin-bottom: 11px;
  color: var(--dhg-green);
  font-size: .72rem;
  line-height: 1;
  font-weight: 850;
  letter-spacing: .13em;
}

body.dhg-polish .dhg-home-intro h1 {
  max-width: 780px;
  margin: 0;
  color: var(--dhg-green-deep);
  font-size: clamp(2rem, 3.4vw, 3rem);
  line-height: 1.06;
  letter-spacing: -.038em;
  text-wrap: balance;
}

body.dhg-polish .dhg-home-deck {
  max-width: 720px;
  margin: 15px 0 0;
  color: #56645f;
  font-size: clamp(1rem, 1.25vw, 1.08rem);
  line-height: 1.65;
}

body.dhg-polish .dhg-topic-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 22px;
}

body.dhg-polish .dhg-topic-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 13px;
  border: 1px solid #cfdbd4;
  border-radius: 999px;
  background: rgba(255,255,255,.78);
  color: var(--dhg-green-deep);
  font-size: .82rem;
  font-weight: 750;
  text-decoration: none;
  transition: background .16s ease, border-color .16s ease, transform .16s ease;
}

body.dhg-polish .dhg-topic-nav a:hover {
  transform: translateY(-1px);
  border-color: #afc4b8;
  background: #fff;
}

/* Home card excerpts should support scanning, not dominate the page.
   Kadence can output excerpts in several different wrappers, so V1.8
   targets all common variants and clamps the actual text block. */
body.dhg-polish :where(.home, .blog) :where(
  .entry-summary,
  .entry-content,
  .archive-entry-content,
  .post-excerpt
) {
  overflow: hidden;
}

body.dhg-polish :where(.home, .blog) :where(
  .entry-summary,
  .entry-summary p,
  .archive-entry-content,
  .archive-entry-content p,
  .post-excerpt,
  .post-excerpt p
) {
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 5 !important;
  overflow: hidden !important;
  max-height: calc(1.66em * 5) !important;
}

body.dhg-polish :where(.home, .blog) article.loop-entry .entry-content > p:not(.more-link-wrap):first-of-type,
body.dhg-polish :where(.home, .blog) article.entry .entry-content > p:not(.more-link-wrap):first-of-type,
body.dhg-polish :where(.home, .blog) .loop-entry .entry-content > p:first-child,
body.dhg-polish :where(.home, .blog) .entry-content-wrap .entry-content > p:first-child {
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 5 !important;
  overflow: hidden !important;
  max-height: calc(1.66em * 5) !important;
}

/* If Kadence renders excerpt text directly in .entry-content without a paragraph,
   cap the content block but keep Read More visible below. */
body.dhg-polish :where(.home, .blog) article.loop-entry .entry-content,
body.dhg-polish :where(.home, .blog) article.entry .entry-content {
  position: relative;
}

/* Tighter home ending now that the final orphan card is centered. */
body.dhg-polish :where(.home, .blog) :where(#primary, .content-area, .site-main) {
  padding-bottom: 8px;
  margin-bottom: 0;
}

body.dhg-polish :where(.home, .blog) .dhg-brand-footer {
  margin-top: 10px;
}

@media (max-width: 767px) {
  body.dhg-polish .dhg-home-intro {
    padding: 24px 18px 20px;
  }

  body.dhg-polish .dhg-home-intro h1 {
    font-size: clamp(1.85rem, 9vw, 2.35rem);
  }

  body.dhg-polish .dhg-home-deck {
    margin-top: 12px;
  }

  body.dhg-polish .dhg-topic-nav {
    gap: 7px;
    margin-top: 18px;
  }

  body.dhg-polish .dhg-topic-nav a {
    min-height: 34px;
    padding: 6px 11px;
    font-size: .78rem;
  }
}

/* HOME / ARCHIVE */
@media (min-width: 1025px) {
  body.dhg-polish :where(.home, .blog, .archive) :where(.content-container, .site-container, .content-wrap) {
    max-width: 1160px;
    margin-left: auto;
    margin-right: auto;
  }

  body.dhg-polish :where(.home, .blog, .archive) .dhg-orphan-grid-item {
    grid-column: 1 / -1 !important;
    justify-self: center !important;
  }
}

body.dhg-polish :where(.home, .blog, .archive) :where(article.loop-entry, .ast-article-post, article.entry) {
  background: var(--dhg-card);
  border: 1px solid var(--dhg-line);
  border-radius: var(--dhg-radius);
  box-shadow: var(--dhg-shadow-soft);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

body.dhg-polish :where(.home, .blog, .archive) :where(article.loop-entry, .ast-article-post, article.entry):hover {
  transform: translateY(-2px);
  box-shadow: var(--dhg-shadow);
  border-color: #cfded5;
}

body.dhg-polish :where(.home, .blog, .archive) :where(.entry-content-wrap) {
  padding: clamp(20px,2.3vw,30px);
}

body.dhg-polish :where(.home, .blog, .archive) :where(.entry-title, .entry-title a) {
  color: var(--dhg-ink);
  line-height: 1.17;
  letter-spacing: -.026em;
  font-weight: 780;
}

body.dhg-polish :where(.home, .blog, .archive) :where(.post-thumbnail img, .entry-media img) {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

body.dhg-polish :where(.entry-meta, .posted-on, .byline) {
  color: var(--dhg-muted);
  font-size: .86rem;
}

body.dhg-polish :where(.entry-summary, .archive .entry-content) {
  color: #4e5b56;
  line-height: 1.66;
}

body.dhg-polish :where(.entry-taxonomies a, .category-links a, .cat-links a, .entry-meta .category-links a) {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--dhg-sage);
  color: var(--dhg-green-deep);
  font-size: .75rem;
  font-weight: 780;
  letter-spacing: .02em;
  text-decoration: none;
}

body.dhg-polish :where(.more-link, .post-more-link, .read-more a) {
  color: var(--dhg-green);
  font-weight: 780;
}


/* ==========================================================
   V1.6 — KADENCE SINGLE-POST OUTER SHELL
   V1.5 widened children, but Kadence's narrow parent still
   capped the white article card. Widen the real parent first.
   ========================================================== */
@media (min-width: 1025px) {
  body.dhg-polish.single-post :where(
    .content-container.site-container,
    .site-container.content-container
  ) {
    width: calc(100% - 64px) !important;
    max-width: 1040px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  /* Kadence narrow-content body class can override container width. */
  body.dhg-polish.single-post.content-width-narrow :where(
    .content-container.site-container,
    .site-container.content-container
  ),
  body.dhg-polish.single-post.content-width-normal :where(
    .content-container.site-container,
    .site-container.content-container
  ) {
    max-width: 1040px !important;
  }

  body.dhg-polish.single-post :where(#primary, .content-area, .site-main) {
    width: 100% !important;
    max-width: none !important;
  }

  /* The visible white article card. */
  body.dhg-polish.single-post :where(
    article.entry,
    article.post,
    .single-entry
  ) {
    width: 100% !important;
    max-width: 1000px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  body.dhg-polish.single-post :where(
    article.entry > .entry-content-wrap,
    article.post > .entry-content-wrap,
    .single-entry > .entry-content-wrap
  ) {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Header gets more breathing room without becoming full-width. */
  body.dhg-polish.single-post :where(.entry-header) {
    width: calc(100% - 72px) !important;
    max-width: 900px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  body.dhg-polish.single-post :where(h1.entry-title, .entry-header h1) {
    max-width: 900px !important;
  }

  /* Main editorial canvas. */
  body.dhg-polish.single-post :where(.entry-content) {
    width: calc(100% - 72px) !important;
    max-width: 920px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  /* Comfortable reading measure. */
  body.dhg-polish.single-post .entry-content > :where(
    p, ul, ol, h2, h3, h4, blockquote
  ):not(.dhg-next-step):not(.dhg-similar-posts) {
    width: 100%;
    max-width: 780px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  /* Visual material uses the wider canvas. */
  body.dhg-polish.single-post .entry-content > :where(
    figure,
    .wp-block-image,
    .wp-block-gallery,
    .wp-block-table,
    .wp-block-columns,
    .wp-block-group,
    .wp-block-cover,
    .wp-block-media-text
  ) {
    width: 100% !important;
    max-width: 920px !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  body.dhg-polish.single-post .entry-content > :where(
    figure,
    .wp-block-image
  ) img {
    width: 100%;
    height: auto;
  }

  body.dhg-polish.single-post .entry-content > .dhg-next-step,
  body.dhg-polish.single-post .entry-content > .dhg-similar-posts {
    width: 100% !important;
    max-width: 920px !important;
  }

  body.dhg-polish.single-post :where(
    .post-navigation,
    .navigation.post-navigation
  ) {
    width: calc(100% - 80px) !important;
    max-width: 920px !important;
  }

  body.dhg-polish.single-post :where(.comments-area, #comments) {
    width: calc(100% - 120px) !important;
    max-width: 850px !important;
  }
}

/* SINGLE POST
   V1.3 intentionally uses a broad Kadence-specific selector.
   It only runs on single post pages. Archive thumbnails are unaffected. */
body.dhg-polish.single-post .post-thumbnail.article-post-thumbnail {
  display: none !important;
}

/* Backup selector for Kadence variants where the wrapper class changes
   but the image still has the standard post-top-featured class. */
body.dhg-polish.single-post .post-thumbnail:has(img.post-top-featured) {
  display: none !important;
}

/* Once the extra hero is removed, remove the old boxed-content overlap. */
body.dhg-polish.single-post.dhg-single-feature-hidden article.entry > .entry-content-wrap,
body.dhg-polish.single-post.dhg-single-feature-hidden article.post > .entry-content-wrap,
body.dhg-polish.single-post.dhg-single-feature-hidden .site-main > article > .entry-content-wrap {
  margin-top: 0 !important;
  transform: none !important;
}

/* Fallback if the thumbnail remains in DOM as a hidden sibling. */
body.dhg-polish.single-post .post-thumbnail.article-post-thumbnail + .entry-content-wrap {
  margin-top: 0 !important;
  transform: none !important;
}

body.dhg-polish.single-post :where(article.entry, article.post) {
  background: var(--dhg-card);
  border: 1px solid var(--dhg-line);
  border-radius: 18px;
  box-shadow: var(--dhg-shadow-soft);
  overflow: hidden;
}

body.dhg-polish.single-post :where(.entry-header) {
  padding-top: clamp(26px,3.6vw,46px);
}

body.dhg-polish.single-post :where(h1.entry-title, .entry-header h1) {
  max-width: 940px;
  color: var(--dhg-ink);
  font-size: clamp(2rem,4vw,3.15rem);
  line-height: 1.065;
  letter-spacing: -.038em;
  text-wrap: balance;
}

body.dhg-polish.single-post :where(.entry-content) {
  max-width: 960px;
  margin-left: auto;
  margin-right: auto;
  color: #2c3935;
  font-size: clamp(1.04rem,1.24vw,1.12rem);
  line-height: 1.78;
}

/* Editorial reading measure: text stays readable while visuals can go wider. */
@media (min-width: 900px) {
  body.dhg-polish.single-post .entry-content > :where(p, ul, ol, h2, h3, h4, blockquote) {
    max-width: 780px;
    margin-left: auto;
    margin-right: auto;
  }

  body.dhg-polish.single-post .entry-content > :where(
    figure, .wp-block-image, .wp-block-gallery, .wp-block-table,
    .wp-block-columns, .wp-block-group, .wp-block-cover, .wp-block-media-text
  ) {
    width: 100%;
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
  }
}

body.dhg-polish.single-post .entry-content > :where(p, ul, ol) {
  margin-bottom: 1.16em;
}

body.dhg-polish.single-post .entry-content :where(h2) {
  color: var(--dhg-green-deep);
  font-size: clamp(1.5rem,2.4vw,1.95rem);
  line-height: 1.22;
  letter-spacing: -.025em;
  margin-top: 2.05em;
  margin-bottom: .7em;
}

body.dhg-polish.single-post .entry-content :where(h3) {
  color: var(--dhg-ink);
  font-size: clamp(1.18rem,2vw,1.4rem);
  line-height: 1.3;
  margin-top: 1.65em;
  margin-bottom: .58em;
}

body.dhg-polish.single-post .entry-content :where(img) {
  border-radius: 13px;
}

body.dhg-polish.single-post .entry-content :where(figure, .wp-block-image) {
  margin-top: 1.55em;
  margin-bottom: 1.75em;
}

body.dhg-polish.single-post .entry-content :where(blockquote) {
  margin: 1.55em 0;
  padding: 18px 22px;
  border-left: 4px solid var(--dhg-green);
  border-radius: 0 var(--dhg-radius-sm) var(--dhg-radius-sm) 0;
  background: var(--dhg-sage-2);
  color: #32443d;
}

body.dhg-polish .dhg-bottom-line-heading {
  position: relative;
  padding-top: 26px;
}

body.dhg-polish .dhg-bottom-line-heading::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 54px;
  height: 4px;
  border-radius: 99px;
  background: var(--dhg-green);
}

body.dhg-polish .dhg-read-next {
  margin: 24px 0 12px !important;
  padding: 16px 18px;
  border: 1px solid var(--dhg-sage-3);
  border-radius: 12px;
  background: var(--dhg-sage-2);
  font-weight: 650;
}

body.dhg-polish .dhg-medical-note {
  margin-top: 18px !important;
  padding: 15px 18px;
  border-left: 3px solid #9ab7ad;
  border-radius: 0 10px 10px 0;
  background: var(--dhg-blue-note);
  color: #56655f;
  font-size: .89rem;
  line-height: 1.62;
}


/* WIDE EDITORIAL MODULES */
body.dhg-polish.single-post .entry-content > .dhg-next-step,
body.dhg-polish.single-post .entry-content > .dhg-similar-posts {
  width: 100%;
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
}

/* CTA */
body.dhg-polish .dhg-next-step {
  margin: 38px 0 30px;
  padding: clamp(23px,3.5vw,32px);
  border: 1px solid #d6e3db;
  border-radius: 17px;
  background:
    radial-gradient(circle at 95% 10%, rgba(49,95,82,.075), transparent 34%),
    var(--dhg-sage-2);
}

body.dhg-polish .dhg-eyebrow {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--dhg-green);
  font-size: .72rem;
  line-height: 1;
  font-weight: 850;
  letter-spacing: .12em;
}

body.dhg-polish .dhg-next-step h2,
body.dhg-polish .dhg-similar-posts h2 {
  margin: 0;
  color: var(--dhg-green-deep);
  font-size: clamp(1.4rem,2.4vw,1.82rem);
  line-height: 1.18;
  letter-spacing: -.028em;
}

body.dhg-polish .dhg-next-step p {
  max-width: 650px;
  margin: 11px 0 0;
  color: #52615b;
  line-height: 1.62;
}

body.dhg-polish .dhg-next-step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

body.dhg-polish .dhg-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 17px;
  border-radius: 999px;
  font-size: .88rem;
  font-weight: 760;
  text-decoration: none !important;
}

body.dhg-polish .dhg-button-primary {
  background: var(--dhg-green);
  color: #fff !important;
  border: 1px solid var(--dhg-green);
}

body.dhg-polish .dhg-button-secondary {
  color: var(--dhg-green-deep) !important;
  border: 1px solid #bfcfc6;
  background: rgba(255,255,255,.78);
}


/* KADENCE NATIVE RELATED POSTS
   DogHealth Guides now supplies its own related-reading module above navigation.
   Kadence's native .entry-related section was producing a second "Similar Posts"
   block after Previous/Next. Hide only the native Kadence block on single posts. */
body.dhg-polish.single-post .entry-related {
  display: none !important;
}

/* Defensive variants used by some Kadence releases/customizer outputs. */
body.dhg-polish.single-post :where(
  .entry-related-inner,
  .entry-related-post-wrap,
  .kadence-related-posts
) {
  display: none !important;
}

/* SIMILAR POSTS */
body.dhg-polish .dhg-similar-posts {
  margin: 34px 0 40px;
  padding-top: 2px;
}

body.dhg-polish .dhg-section-heading {
  margin-bottom: 18px;
}

body.dhg-polish .dhg-related-grid {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
  gap: 15px;
}

body.dhg-polish .dhg-related-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--dhg-line);
  border-radius: 14px;
  background: var(--dhg-card);
  box-shadow: 0 4px 14px rgba(31,49,43,.045);
}

body.dhg-polish .dhg-related-image {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--dhg-sage);
}

body.dhg-polish .dhg-related-image img,
body.dhg-polish .dhg-related-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0 !important;
}

body.dhg-polish .dhg-related-content {
  padding: 15px 16px 17px;
}

body.dhg-polish .dhg-related-category {
  display: inline-block;
  margin-bottom: 7px;
  color: var(--dhg-green);
  font-size: .67rem;
  font-weight: 820;
  text-transform: uppercase;
  letter-spacing: .06em;
}

body.dhg-polish .dhg-related-card h3 {
  margin: 0 0 12px !important;
  font-size: 1rem !important;
  line-height: 1.28 !important;
  letter-spacing: -.018em;
}

body.dhg-polish .dhg-related-card h3 a {
  color: var(--dhg-ink);
  text-decoration: none;
}

body.dhg-polish .dhg-related-read {
  color: var(--dhg-green);
  font-size: .81rem;
  font-weight: 760;
  text-decoration: none;
}

/* PREV / NEXT */
body.dhg-polish :where(.post-navigation, .navigation.post-navigation) {
  max-width: 920px;
  margin: 30px auto 22px;
}

body.dhg-polish :where(.post-navigation .nav-links) {
  gap: 12px;
}

body.dhg-polish :where(.post-navigation .nav-previous, .post-navigation .nav-next) {
  border: 1px solid var(--dhg-line);
  border-radius: 13px;
  background: var(--dhg-card);
  padding: 15px 17px;
}

/* COMMENTS */
body.dhg-polish :where(.comments-area, #comments) {
  max-width: 860px;
  margin: 20px auto 0;
  padding: 24px 26px 26px;
  border: 1px solid var(--dhg-line);
  border-radius: 14px;
  background: #fff;
}

body.dhg-polish :where(.comments-area textarea#comment, #comments textarea#comment) {
  min-height: 150px !important;
  height: 150px;
}

body.dhg-polish :where(.comments-area input[type="submit"]) {
  background: var(--dhg-green);
  border-color: var(--dhg-green);
  color: #fff;
  font-weight: 760;
}

/* FOOTER */
body.dhg-polish .dhg-brand-footer {
  margin-top: 54px;
  background: var(--dhg-green-deep);
  color: rgba(255,255,255,.82);
}

body.dhg-polish.single-post .dhg-brand-footer {
  margin-top: 22px;
}

body.dhg-polish .dhg-brand-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 42px 28px 22px;
}

body.dhg-polish .dhg-footer-brand {
  max-width: 580px;
}

body.dhg-polish .dhg-footer-logo {
  display: inline-block;
  color: #fff !important;
  font-size: 1.26rem;
  font-weight: 830;
  letter-spacing: -.025em;
  text-decoration: none;
}

body.dhg-polish .dhg-footer-brand p {
  margin: 9px 0 0;
  color: rgba(255,255,255,.72);
  line-height: 1.62;
}

body.dhg-polish .dhg-footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 26px;
}

body.dhg-polish .dhg-footer-nav a {
  color: rgba(255,255,255,.9) !important;
  font-size: .9rem;
  font-weight: 660;
  text-decoration: none;
}

body.dhg-polish .dhg-footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 32px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.58);
  font-size: .78rem;
  line-height: 1.5;
}

body.dhg-polish.dhg-custom-footer-ready :where(.site-footer, #colophon) {
  display: none !important;
}

/* MOBILE */

@media (max-width: 899px) {
  body.dhg-polish.single-post .entry-content {
    max-width: 100%;
  }

  body.dhg-polish.single-post .entry-content > :where(
    p, ul, ol, h2, h3, h4, blockquote, figure, .wp-block-image,
    .wp-block-gallery, .wp-block-table, .wp-block-columns, .wp-block-group,
    .wp-block-cover, .wp-block-media-text
  ) {
    max-width: 100%;
  }

  body.dhg-polish.single-post .entry-content > .dhg-next-step,
  body.dhg-polish.single-post .entry-content > .dhg-similar-posts {
    max-width: 100%;
  }
}

@media (max-width: 767px) {
  body.dhg-polish {
    --dhg-radius: 13px;
  }

  body.dhg-polish :where(.content-area, #primary) {
    padding-left: 13px;
    padding-right: 13px;
  }

  body.dhg-polish.single-post :where(article.entry, article.post) {
    border-radius: 13px;
  }

  body.dhg-polish.single-post :where(h1.entry-title, .entry-header h1) {
    font-size: clamp(1.82rem,9.2vw,2.4rem);
    line-height: 1.08;
  }

  body.dhg-polish.single-post :where(.entry-content) {
    font-size: 1.02rem;
    line-height: 1.72;
  }

  body.dhg-polish .dhg-next-step {
    margin-top: 32px;
    padding: 20px;
  }

  body.dhg-polish .dhg-related-grid {
    grid-template-columns: 1fr;
  }

  body.dhg-polish .dhg-related-card {
    display: grid;
    grid-template-columns: 112px minmax(0,1fr);
  }

  body.dhg-polish .dhg-related-image {
    height: 100%;
    min-height: 112px;
    aspect-ratio: auto;
  }

  body.dhg-polish :where(.post-navigation .nav-links) {
    display: grid;
    grid-template-columns: 1fr;
  }

  body.dhg-polish :where(.comments-area textarea#comment, #comments textarea#comment) {
    min-height: 130px !important;
    height: 130px;
  }

  body.dhg-polish .dhg-brand-footer-inner {
    padding: 34px 20px 20px;
  }

  body.dhg-polish .dhg-footer-bottom {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.dhg-polish *,
  body.dhg-polish *::before,
  body.dhg-polish *::after {
    transition-duration: .001ms !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
  }
}


/* V1.6 responsive safety */
@media (max-width: 1024px) {
  body.dhg-polish.single-post :where(
    .content-container.site-container,
    .site-container.content-container,
    #primary,
    .content-area,
    .site-main,
    article.entry,
    article.post,
    .single-entry,
    .entry-content-wrap,
    .entry-header,
    .entry-content
  ) {
    max-width: 100% !important;
  }
}



/* ==========================================================
   V1.9 — HOME STABILITY PATCH
   JS adds these classes to the actual live Kadence nodes.
   ========================================================== */

/* Hard clamp the actual excerpt paragraph found at runtime. */
body.dhg-polish .dhg-home-excerpt-clamp {
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 5 !important;
  overflow: hidden !important;
  line-height: 1.66 !important;
  max-height: calc(1.66em * 5) !important;
}

/* The real home post grid is marked at runtime, so no theme-class guessing. */
body.dhg-polish .dhg-home-post-grid {
  margin-bottom: 24px !important;
  padding-bottom: 0 !important;
}

/* Remove only bottom spacing on wrappers between the post grid and <main>. */
body.dhg-polish .dhg-home-bottom-shell {
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}

/* Keep a deliberate but compact handoff into the branded footer. */
body.dhg-polish.dhg-home-runtime-ready .dhg-brand-footer {
  margin-top: 14px !important;
}

