/* PawWise editorial article layout v2
   Keeps the article header, reading column and sidebar on one shared grid. */

.article-page {
  --article-main-width: 820px;
  --article-sidebar-width: 286px;
  --article-gap: 48px;
}

.article-page > .breadcrumbs {
  width: min(calc(100% - 40px), 1240px);
  padding-top: 24px;
  font-size: .8rem;
  line-height: 1.5;
}

.article-page-hero {
  width: min(calc(100% - 40px), 1240px) !important;
  margin-inline: auto;
  padding: 34px 0 30px !important;
}

.article-page-hero::before {
  display: none !important;
}

.article-category-link {
  display: inline-flex;
  color: var(--accent-hover);
  font-size: .78rem;
  font-weight: 850;
  letter-spacing: .04em;
  text-decoration: none;
}

.article-category-link:hover {
  color: var(--brand-dark);
  text-decoration: underline;
}

.article-page-hero h1 {
  width: min(100%, 920px);
  max-width: none !important;
  margin: 10px 0 16px;
  color: var(--brand-deep);
  font-family: "Noto Sans TC", "DM Sans", ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(2.55rem, 4.35vw, 3.6rem) !important;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.055em;
  text-wrap: balance;
}

.article-page-hero .lead {
  width: min(100%, 780px);
  max-width: none !important;
  margin: 0;
  color: #536560;
  font-size: clamp(1rem, 1.35vw, 1.12rem);
  line-height: 1.78;
  text-wrap: pretty;
}

.article-page .article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0 !important;
  margin: 18px 0 0 !important;
}

.article-page .article-meta > span,
.article-page .article-meta > time {
  min-height: 0 !important;
  padding: 0 !important;
  color: var(--muted) !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  font-size: .78rem !important;
  font-weight: 700;
}

.article-page .article-meta > * + *::before {
  content: "•";
  margin: 0 .65rem;
  color: #a8b6b1;
}

.article-page .article-shell {
  grid-template-columns: minmax(0, var(--article-main-width)) var(--article-sidebar-width) !important;
  justify-content: space-between;
  gap: var(--article-gap) !important;
  align-items: start;
  padding-bottom: 78px;
}

.article-page .article-main {
  min-width: 0;
  padding: 34px 40px 48px !important;
  border: 1px solid var(--border);
  border-radius: 22px !important;
  background: rgba(255, 255, 255, .985);
  box-shadow: 0 18px 44px rgba(16, 58, 52, .075) !important;
}

.article-page .article-trust-panel {
  grid-template-columns: 38px minmax(0, 1fr) auto !important;
  gap: 14px !important;
  margin: 0 0 28px !important;
  padding: 0 0 20px !important;
  background: transparent !important;
  border: 0 !important;
  border-bottom: 1px solid var(--border) !important;
  border-radius: 0 !important;
}

.article-page .article-trust-icon {
  width: 38px !important;
  height: 38px !important;
  border-radius: 11px !important;
  box-shadow: none !important;
}

.article-page .article-trust-icon svg {
  width: 21px;
  height: 21px;
}

.article-page .article-trust-copy strong {
  font-size: .88rem;
}

.article-page .article-trust-copy p {
  margin-top: 2px;
  font-size: .76rem;
}

.article-page .article-trust-links {
  gap: 4px;
}

.article-page .article-trust-links a {
  font-size: .72rem;
}

.article-page .article-hero {
  margin-bottom: 34px !important;
  border-radius: 15px !important;
  box-shadow: none !important;
}

.article-page .article-main > .prose,
.article-page .article-main > .content-commerce,
.article-page .article-main > .quiz-cta,
.article-page .article-main > .affiliate-disclosure,
.article-page .article-main > .ad-slot,
.article-page .article-main > section.prose {
  width: min(100%, 720px);
  margin-inline: auto;
}

.article-page .article-main .prose {
  max-width: 720px !important;
  color: #293d38;
  font-size: 1.055rem;
  line-height: 1.86;
}

.article-page .article-main .prose h2 {
  position: relative;
  margin: 2.55em 0 .85em !important;
  padding: 0 0 .55em 18px !important;
  color: var(--brand-dark);
  background: transparent !important;
  border: 0 !important;
  border-bottom: 1px solid var(--border) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  font-size: clamp(1.65rem, 2.3vw, 2.15rem);
  line-height: 1.3;
}

.article-page .article-main .prose h2::before {
  content: "";
  position: absolute;
  top: .18em;
  bottom: .7em;
  left: 0;
  width: 4px;
  border-radius: 999px;
  background: var(--accent);
}

.article-page .article-main .prose h2::after {
  display: none !important;
}

.article-page .article-main .prose h3 {
  margin-top: 1.9em;
  color: var(--brand-dark);
  font-size: 1.3rem;
  line-height: 1.45;
}

.article-page .article-main .prose p,
.article-page .article-main .prose li {
  color: #30443f;
}

.article-page .article-main .prose blockquote {
  margin: 28px 0;
  padding: 18px 20px;
  border-left: 4px solid var(--accent);
  border-radius: 0 12px 12px 0;
  background: #f2f6f4;
}

.article-page .article-main .table-wrap {
  margin: 28px 0;
}

.article-sidebar {
  top: 126px;
  gap: 18px;
}

.article-sidebar-card {
  overflow: hidden;
  padding: 0 !important;
  border-radius: 17px !important;
}

.article-sidebar-section {
  padding: 22px;
}

.article-sidebar-section + .article-sidebar-section {
  border-top: 1px solid var(--border);
}

.article-sidebar-section > strong {
  display: block;
  color: var(--brand-dark);
}

.article-sidebar-section .tag-list {
  margin-top: 12px;
}

.article-sidebar-section .tag-list .badge {
  padding: 4px 8px;
  font-size: .7rem;
}

.article-sidebar .ad-slot {
  margin: 0;
}

.article-page .section-soft {
  background: rgba(255, 255, 255, .7);
}

/* CMS-rendered articles use the same editorial treatment. */
body.cms-article-document {
  --text: #172a27;
  --muted: #5d6d69;
  --brand: #174f46;
  --brand-dark: #103a34;
  --border: #dce5e1;
  --surface: #fff;
  --shadow: 0 18px 44px rgba(16, 58, 52, .075);
  color: var(--text);
  background: #f7f6f2;
}

.cms-article-document .site-header {
  background: rgba(255, 255, 255, .96);
  border-bottom-color: var(--border);
}

.cms-article-document .brand,
.cms-article-document .nav a {
  color: var(--brand-dark);
}

.cms-article-document .article-page-hero {
  width: min(calc(100% - 40px), 980px) !important;
}

.cms-article-document .cms-article-main {
  width: min(calc(100% - 40px), 820px) !important;
  margin: 0 auto 64px;
  padding: 34px 40px 48px !important;
  border: 1px solid var(--border);
  border-radius: 22px !important;
  background: #fff;
  box-shadow: var(--shadow);
}

.cms-article-document .cms-article-main .article-trust-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 26px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.cms-article-document .cms-article-main .article-trust-panel p {
  margin: 0;
  color: var(--muted);
  font-size: .8rem;
}

.cms-article-document .cms-article-main .article-trust-panel a {
  font-size: .75rem;
  font-weight: 800;
  white-space: nowrap;
}

.cms-article-document .cms-article-main .prose {
  max-width: 720px;
  margin-inline: auto;
  font-size: 1.055rem;
  line-height: 1.86;
}

@media (max-width: 1040px) {
  .article-page .article-shell {
    grid-template-columns: minmax(0, 1fr) !important;
    width: min(calc(100% - 40px), 900px);
  }

  .article-sidebar {
    position: static !important;
  }

  .article-sidebar-card {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .article-sidebar-section + .article-sidebar-section {
    border-top: 0;
    border-left: 1px solid var(--border);
  }
}

@media (max-width: 720px) {
  .article-page > .breadcrumbs,
  .article-page-hero,
  .article-page .article-shell,
  .cms-article-document .article-page-hero,
  .cms-article-document .cms-article-main {
    width: min(calc(100% - 28px), 100%) !important;
  }

  .article-page > .breadcrumbs {
    padding-top: 18px;
    font-size: .72rem;
  }

  .article-page-hero {
    padding: 26px 0 24px !important;
  }

  .article-page-hero h1 {
    width: 100%;
    margin: 8px 0 13px;
    font-size: clamp(2.05rem, 9.5vw, 2.75rem) !important;
    line-height: 1.13;
    letter-spacing: -.045em;
  }

  .article-page-hero .lead {
    font-size: .98rem;
    line-height: 1.68;
  }

  .article-page .article-meta {
    gap: .45rem .8rem !important;
  }

  .article-page .article-meta > * + *::before {
    display: none;
  }

  .article-page .article-main,
  .cms-article-document .cms-article-main {
    margin-inline: 0 !important;
    padding: 24px 18px 34px !important;
    border-radius: 18px !important;
  }

  .article-page .article-trust-panel {
    grid-template-columns: 34px minmax(0, 1fr) !important;
    gap: 11px !important;
  }

  .article-page .article-trust-links {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: flex-start;
    gap: 14px;
  }

  .article-page .article-hero {
    margin-bottom: 26px !important;
    border-radius: 12px !important;
  }

  .article-page .article-main .prose,
  .cms-article-document .cms-article-main .prose {
    font-size: 1rem;
    line-height: 1.82;
  }

  .article-page .article-main .prose h2 {
    margin-top: 2.2em !important;
    padding-left: 14px !important;
    font-size: 1.52rem;
  }

  .article-sidebar-card {
    grid-template-columns: 1fr;
  }

  .article-sidebar-section + .article-sidebar-section {
    border-top: 1px solid var(--border);
    border-left: 0;
  }
}
