/* ══════════════════════════════════════════════════════════════
   Resource library — editorial layout for the hub + article pages.
   Layers on top of pm-site.css (which owns the tokens and chrome).
   ══════════════════════════════════════════════════════════════ */

:root {
  --pm-prose: 68ch;          /* 65–75 char measure for long-form reading */
  --pm-read-size: 1.0625rem; /* 17px mobile floor */
  --pm-read-lh: 1.75;
  --pm-z-nav: 50;
  --pm-z-toc: 20;
}

/* ── Shared page shell ───────────────────────────────────────── */
.pm-res-main {
  padding-top: 1.5rem;
  padding-bottom: 4rem;
}

.pm-res-wrap {
  width: min(100% - 2.5rem, 1180px);
  margin-inline: auto;
}

/* ── Breadcrumbs ─────────────────────────────────────────────── */
.pm-crumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--pm-muted);
  margin-bottom: 1.5rem;
}
.pm-crumbs a {
  color: var(--pm-green-600);
  text-decoration: none;
  transition: color 180ms ease;
}
.pm-crumbs a:hover { color: var(--pm-green-800); text-decoration: underline; }
.pm-crumbs svg { width: 14px; height: 14px; opacity: 0.5; flex: none; }

/* ── Hub hero ────────────────────────────────────────────────── */
.pm-res-hero {
  background: var(--pm-grad);
  color: var(--pm-white);
  padding: 3.5rem 0 4rem;
  margin-bottom: -2.5rem;
}
.pm-res-hero .pm-res-wrap { position: relative; z-index: 1; }
.pm-res-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.24);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  margin-bottom: 1.1rem;
  backdrop-filter: blur(20px);
}
.pm-res-eyebrow svg { width: 15px; height: 15px; }
.pm-res-hero h1 {
  font-size: clamp(2rem, 5vw, 3.1rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.12;
  max-width: 20ch;
  margin-bottom: 0.9rem;
}
.pm-res-hero p {
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.65;
  max-width: 62ch;
  color: rgba(255, 255, 255, 0.92);
}

/* ── Category filter ─────────────────────────────────────────── */
.pm-cat-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 3.5rem 0 2rem;
}
.pm-cat-chip {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--pm-slate);
  background: var(--pm-white);
  border: 1px solid var(--pm-line);
  border-radius: 999px;
  padding: 0.6rem 1.15rem;
  min-height: 44px;
  cursor: pointer;
  transition: background 200ms ease, color 200ms ease, border-color 200ms ease;
}
.pm-cat-chip:hover { border-color: var(--pm-mint); color: var(--pm-green-700); }
.pm-cat-chip:focus-visible { outline: 3px solid var(--pm-mint); outline-offset: 2px; }
.pm-cat-chip[aria-pressed="true"] {
  background: var(--pm-green-700);
  border-color: var(--pm-green-700);
  color: var(--pm-white);
}

/* ── Article card grid ───────────────────────────────────────── */
.pm-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.4rem;
}
.pm-res-card {
  display: flex;
  flex-direction: column;
  background: var(--pm-white);
  border: 1px solid var(--pm-line);
  border-radius: 18px;
  padding: 1.6rem 1.5rem 1.4rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--pm-shadow-sm);
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 220ms ease, border-color 220ms ease;
  cursor: pointer;
}
.pm-res-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--pm-shadow-md);
  border-color: var(--pm-mint-300);
}
.pm-res-card:focus-visible { outline: 3px solid var(--pm-mint); outline-offset: 3px; }
.pm-res-card-tag {
  align-self: flex-start;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--pm-green-700);
  background: var(--pm-mint-100);
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 0.9rem;
}
.pm-res-card h2,
.pm-res-card h3 {
  font-size: 1.18rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
  color: var(--pm-ink);
  margin-bottom: 0.55rem;
}
.pm-res-card p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--pm-slate);
  margin-bottom: 1.1rem;
  flex: 1;
}
.pm-res-card-meta {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--pm-green-600);
}
.pm-res-card-meta svg { width: 15px; height: 15px; }
.pm-res-card-arrow { margin-left: auto; transition: transform 200ms ease; }
.pm-res-card:hover .pm-res-card-arrow { transform: translateX(3px); }

/* ── Article layout ──────────────────────────────────────────── */
.pm-article-head {
  border-bottom: 1px solid var(--pm-line);
  padding-bottom: 2rem;
  margin-bottom: 2.5rem;
}
.pm-article-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--pm-green-700);
  background: var(--pm-mint-100);
  padding: 0.34rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}
.pm-article-head h1 {
  font-size: clamp(1.85rem, 4.4vw, 2.85rem);
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -0.025em;
  color: var(--pm-ink);
  max-width: 24ch;
  margin-bottom: 1rem;
}
.pm-article-standfirst {
  font-size: clamp(1.05rem, 2.2vw, 1.2rem);
  line-height: 1.6;
  color: var(--pm-slate);
  max-width: min(var(--pm-prose), 100%);
}
.pm-article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.1rem;
  margin-top: 1.4rem;
  font-size: 0.85rem;
  color: var(--pm-muted);
}
.pm-article-meta span { display: inline-flex; align-items: center; gap: 0.4rem; }
.pm-article-meta svg { width: 15px; height: 15px; opacity: 0.7; }

.pm-article-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3rem;
  align-items: start;
}
/* Grid items default to min-width:auto, which lets wide children (the tables,
   whose headers are nowrap) push the column past the viewport. Body has
   overflow-x:hidden, so that overflow silently clips text instead of scrolling.
   min-width:0 lets these columns shrink properly. */
.pm-article-grid > * { min-width: 0; }

/* ── Prose ───────────────────────────────────────────────────── */
.pm-prose {
  max-width: min(var(--pm-prose), 100%);
  min-width: 0;
  font-size: var(--pm-read-size);
  line-height: var(--pm-read-lh);
  color: #263449;
}
.pm-prose > * + * { margin-top: 1.35em; }
.pm-prose h2 {
  font-size: clamp(1.35rem, 3vw, 1.7rem);
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -0.015em;
  color: var(--pm-ink);
  margin-top: 2.6em;
  margin-bottom: 0.15em;
  scroll-margin-top: 6rem;
}
.pm-prose h2::after {
  content: "";
  display: block;
  width: 42px;
  height: 3px;
  border-radius: 2px;
  background: var(--pm-grad);
  margin-top: 0.6rem;
}
.pm-prose h3 {
  font-size: clamp(1.1rem, 2.4vw, 1.28rem);
  font-weight: 700;
  line-height: 1.35;
  color: var(--pm-ink);
  margin-top: 2em;
  margin-bottom: 0.1em;
  scroll-margin-top: 6rem;
}
.pm-prose p { margin-top: 1.15em; }
.pm-prose strong { font-weight: 600; color: var(--pm-ink); }
.pm-prose a {
  color: var(--pm-green-600);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  transition: color 180ms ease;
}
.pm-prose a:hover { color: var(--pm-green-800); }
.pm-prose ul, .pm-prose ol { padding-left: 1.35em; }
.pm-prose li { margin-top: 0.55em; }
.pm-prose li::marker { color: var(--pm-green-500); font-weight: 600; }

/* Tables scroll inside their own container, never the page */
.pm-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--pm-line);
  border-radius: 14px;
  background: var(--pm-white);
  -webkit-overflow-scrolling: touch;
}
.pm-prose table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
.pm-prose thead th {
  text-align: left;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--pm-green-800);
  background: var(--pm-mint-100);
  padding: 0.85rem 1rem;
  white-space: nowrap;
}
.pm-prose tbody td {
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--pm-line);
  vertical-align: top;
  line-height: 1.55;
}
.pm-prose tbody tr:nth-child(even) { background: #fafdfb; }

/* Callouts */
.pm-callout {
  display: flex;
  gap: 0.9rem;
  background: var(--pm-white);
  border: 1px solid var(--pm-line);
  border-left: 4px solid var(--pm-mint);
  border-radius: 12px;
  padding: 1.15rem 1.25rem;
  font-size: 1rem;
  line-height: 1.65;
}
.pm-callout svg { width: 21px; height: 21px; flex: none; color: var(--pm-green-600); margin-top: 2px; }
.pm-callout p { margin: 0 !important; }
.pm-callout p + p { margin-top: 0.7em !important; }
.pm-callout--warn { border-left-color: #d97706; background: #fffbeb; }
.pm-callout--warn svg { color: #b45309; }

/* Pull quote */
.pm-pullquote {
  border: 0;
  border-left: 4px solid var(--pm-mint-300);
  padding: 0.3rem 0 0.3rem 1.4rem;
  font-size: 1.22rem;
  line-height: 1.55;
  font-weight: 500;
  color: var(--pm-green-800);
  font-style: normal;
}

/* Key-takeaways box */
.pm-takeaways {
  background: linear-gradient(160deg, #f0fdf7, #ecfdf5);
  border: 1px solid var(--pm-mint-200);
  border-radius: 16px;
  padding: 1.5rem 1.6rem;
}
.pm-takeaways .pm-tk-h {
  margin: 0 0 0.9rem;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pm-green-800);
}
.pm-takeaways .pm-tk-h::after { display: none; }
.pm-takeaways ul { margin: 0; padding-left: 1.2em; }
.pm-takeaways li { font-size: 0.98rem; }

/* Disclaimer */
.pm-disclaimer {
  margin-top: 3rem;
  padding: 1.15rem 1.25rem;
  border: 1px dashed var(--pm-line);
  border-radius: 12px;
  background: #fbfdfc;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--pm-muted);
  max-width: min(var(--pm-prose), 100%);
}
.pm-disclaimer strong { color: var(--pm-slate); }

/* ── Ad slots ────────────────────────────────────────────────── */
/* Contained, labeled, and spaced well clear of links and CTAs so
   nothing reads as an accidental-click trap. */
.pm-ad-slot {
  margin: 2.75rem 0;
  padding: 0.65rem;
  background: #f7faf8;
  border: 1px solid var(--pm-line);
  border-radius: 14px;
  max-width: min(var(--pm-prose), 100%);
  overflow: hidden;
}
.pm-ad-slot--rail { margin: 0 0 1.5rem; max-width: none; }
.pm-ad-label {
  display: block;
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9aa8a1;
  text-align: center;
  margin-bottom: 0.55rem;
}
.pm-ad-slot ins { display: block; width: 100%; min-height: 250px; }
.pm-ad-slot--rail ins { min-height: 600px; }

/* ── Sidebar rail ────────────────────────────────────────────── */
.pm-rail { display: flex; flex-direction: column; gap: 1.5rem; }
.pm-toc {
  background: var(--pm-white);
  border: 1px solid var(--pm-line);
  border-radius: 16px;
  padding: 1.3rem 1.4rem;
}
.pm-toc h2 {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--pm-muted);
  margin-bottom: 0.85rem;
}
.pm-toc ol { list-style: none; padding: 0; margin: 0; counter-reset: toc; }
.pm-toc li { counter-increment: toc; margin-bottom: 0.15rem; }
.pm-toc a {
  display: flex;
  gap: 0.6rem;
  padding: 0.5rem 0.55rem;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--pm-slate);
  text-decoration: none;
  transition: background 180ms ease, color 180ms ease;
}
.pm-toc a::before {
  content: counter(toc);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--pm-mint);
  padding-top: 2px;
}
.pm-toc a:hover { background: var(--pm-mint-100); color: var(--pm-green-800); }
.pm-toc a:focus-visible { outline: 2px solid var(--pm-mint); outline-offset: 1px; }

/* Consult CTA — the page's real conversion goal */
.pm-consult {
  background: var(--pm-green-800);
  color: var(--pm-white);
  border-radius: 16px;
  padding: 1.5rem 1.4rem;
  box-shadow: var(--pm-shadow-md);
}
.pm-consult h2 { font-size: 1.1rem; font-weight: 700; line-height: 1.35; margin-bottom: 0.5rem; }
.pm-consult p { font-size: 0.92rem; line-height: 1.6; color: rgba(255, 255, 255, 0.85); margin-bottom: 1.1rem; }
.pm-consult-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 46px;
  padding: 0.7rem 1.1rem;
  background: var(--pm-mint);
  color: #04301f;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 10px;
  text-decoration: none;
  cursor: pointer;
  transition: background 200ms ease, transform 200ms ease;
}
.pm-consult-btn:hover { background: var(--pm-mint-300); transform: translateY(-2px); }
.pm-consult-btn:focus-visible { outline: 3px solid var(--pm-white); outline-offset: 2px; }
.pm-consult-btn svg { width: 17px; height: 17px; }
.pm-consult-tel {
  display: block;
  margin-top: 0.8rem;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--pm-mint-200);
  text-decoration: none;
}
.pm-consult-tel:hover { color: var(--pm-white); text-decoration: underline; }

/* ── Related articles ────────────────────────────────────────── */
.pm-related {
  margin-top: 4rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--pm-line);
}
.pm-related > h2 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--pm-ink);
  margin-bottom: 1.4rem;
}

/* ── Language switch (hreflang sibling) ──────────────────────── */
.pm-lang-alt {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--pm-green-700);
  background: var(--pm-mint-100);
  border: 1px solid var(--pm-mint-200);
  border-radius: 999px;
  padding: 0.5rem 0.95rem;
  min-height: 40px;
  text-decoration: none;
  cursor: pointer;
  transition: background 200ms ease, border-color 200ms ease;
}
.pm-lang-alt:hover { background: var(--pm-mint-200); border-color: var(--pm-mint); }
.pm-lang-alt:focus-visible { outline: 3px solid var(--pm-mint); outline-offset: 2px; }
.pm-lang-alt svg { width: 16px; height: 16px; }

/* ── Entrance animation ──────────────────────────────────────── */
@keyframes pmResRise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
[data-res-reveal] { opacity: 0; }
[data-res-reveal].is-in {
  animation: pmResRise 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* ── Breakpoints ─────────────────────────────────────────────── */
@media (min-width: 700px) {
  :root { --pm-read-size: 1.125rem; } /* 18px on larger screens */
  .pm-card-grid { grid-template-columns: repeat(2, 1fr); }
  .pm-res-main { padding-top: 2rem; }
}

@media (min-width: 900px) {
  .pm-article-grid { grid-template-columns: minmax(0, 1fr) 320px; gap: 3.5rem; }
  .pm-rail { position: sticky; top: 6rem; }
}

@media (min-width: 1200px) {
  .pm-card-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  [data-res-reveal] { opacity: 1; animation: none !important; }
  .pm-res-card:hover, .pm-consult-btn:hover { transform: none; }
  * { scroll-behavior: auto !important; }
}

/* ── Print ───────────────────────────────────────────────────── */
@media print {
  .pm-topbar, .pm-nav, .pm-footer, .pm-rail, .pm-ad-slot, .pm-related { display: none !important; }
  .pm-prose { max-width: none; font-size: 11pt; }
}
