/* ========================================================================== 
   SitePulse Labs v1.3.4 — appearance toggle, dark palette, and restrained
   editorial card interactions. Loaded after the core page styles.
   ========================================================================== */

/* Header appearance control. */
.theme-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: var(--sp-radius-button);
	color: var(--sp-color-ink-navy);
	cursor: pointer;
}
.theme-toggle:hover,
.theme-toggle:focus-visible { color: var(--sp-color-signal-teal); }
.theme-toggle__icon { display: block; }
.theme-toggle__icon--sun { display: none; }
html[data-theme="dark"] .theme-toggle__icon--moon { display: none; }
html[data-theme="dark"] .theme-toggle__icon--sun { display: block; }

/* Read More controls. */
.article-card__read,
.latest-read,
.latest-list__read {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .5rem;
	min-height: 40px;
	padding: .55rem .8rem;
	border: 1px solid var(--sp-color-ink-navy);
	border-radius: var(--sp-radius-button);
	background: transparent;
	color: var(--sp-color-ink-navy);
	font: 600 .72rem/1.4 var(--sp-font-data);
	letter-spacing: .075em;
	text-transform: uppercase;
	text-decoration: none;
}
.article-card__read { margin-top: auto; }
.latest-read { margin-top: .35rem; }
.latest-list__read { min-height: 34px; padding: .4rem .6rem; margin-top: .8rem; }
.article-card__read span,
.latest-read span,
.latest-list__read span { transition: transform 160ms ease-out; }
.article-card__read:hover,
.article-card__read:focus-visible,
.latest-read:hover,
.latest-read:focus-visible,
.latest-list__read:hover,
.latest-list__read:focus-visible {
	border-color: var(--sp-color-signal-teal);
	background: var(--sp-color-signal-teal);
	color: #fff;
}
.article-card__read:hover span,
.article-card__read:focus-visible span,
.latest-read:hover span,
.latest-read:focus-visible span,
.latest-list__read:hover span,
.latest-list__read:focus-visible span { transform: translateX(3px); }

/* Reveal is progressive enhancement: cards are visible unless JS opts in. */
.sp-reveal-pending {
	opacity: 0;
	transform: translateY(14px);
	transition: opacity 420ms ease, transform 420ms cubic-bezier(.2,.7,.2,1);
}
.sp-reveal-pending.sp-reveal-visible { opacity: 1; transform: translateY(0); }

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
	.article-card,
	.latest-lead,
	.latest-list article {
		transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
	}
	.article-card:hover,
	.latest-lead:hover,
	.latest-list article:hover {
		transform: translateY(-4px);
		border-color: rgba(15,168,140,.62);
		box-shadow: 0 12px 28px rgba(11,30,51,.12);
	}
	.article-card__image img,
	.article-card__image .post-image-fallback,
	.latest-lead__media img,
	.latest-lead__fallback {
		transition: transform 260ms cubic-bezier(.2,.7,.2,1);
	}
	.article-card:hover .article-card__image img,
	.article-card:hover .article-card__image .post-image-fallback,
	.latest-lead:hover .latest-lead__media img,
	.latest-lead:hover .latest-lead__fallback { transform: scale(1.025); }
	.archive-featured__image img,
	.archive-featured__image .post-image-fallback { transition: transform 260ms cubic-bezier(.2,.7,.2,1); }
	.archive-featured:hover .archive-featured__image img,
	.archive-featured:hover .archive-featured__image .post-image-fallback { transform: scale(1.02); }
}

/* --------------------------------------------------------------------------
   Dark appearance. The existing ink laboratory section and footer already use
   dark editorial surfaces, so these overrides focus on light page surfaces.
   -------------------------------------------------------------------------- */
html[data-theme="dark"] { color-scheme: dark; background: #06111d; }
html[data-theme="dark"] body { background: #071626; color: #e8f0f4; }
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] h4,
html[data-theme="dark"] h5,
html[data-theme="dark"] h6 { color: #f5f8fa; }
html[data-theme="dark"] p,
html[data-theme="dark"] li { color: inherit; }
html[data-theme="dark"] a { color: #61d0bd; }
html[data-theme="dark"] a:hover { color: #8ce3d3; }
html[data-theme="dark"] small,
html[data-theme="dark"] .sp-caption,
html[data-theme="dark"] .sp-eyebrow,
html[data-theme="dark"] .post-meta,
html[data-theme="dark"] .post-meta__item,
html[data-theme="dark"] .latest-meta,
html[data-theme="dark"] .archive-hero__count,
html[data-theme="dark"] .author-hero__count { color: #9fb0bd; }

html[data-theme="dark"] .site-header { background: #0a1b2c; border-color: #294156; box-shadow: 0 1px 0 rgba(255,255,255,.06); }
html[data-theme="dark"] .site-logo,
html[data-theme="dark"] .site-logo--svg,
html[data-theme="dark"] .primary-nav__list > .menu-item > a,
html[data-theme="dark"] .primary-nav__list > .menu-item > .nav-dropdown-toggle,
html[data-theme="dark"] .search-toggle,
html[data-theme="dark"] .theme-toggle,
html[data-theme="dark"] .mobile-menu-toggle { color: #f4f8fa; }
html[data-theme="dark"] .mobile-menu-toggle .bar { background: #f4f8fa; }
html[data-theme="dark"] .site-nav,
html[data-theme="dark"] .nav-dropdown__menu { background: #0a1b2c; }
html[data-theme="dark"] .nav-dropdown__menu { border-color: #294156; box-shadow: 0 16px 36px rgba(0,0,0,.36); }
html[data-theme="dark"] .nav-dropdown__menu a,
html[data-theme="dark"] .nav-dropdown__menu .nav-item-label { color: #edf4f7; }
html[data-theme="dark"] .nav-dropdown__menu .nav-item-description { color: #a7b6c2; }
html[data-theme="dark"] .site-search-panel { background: #0d2336; border-color: #294156; }
html[data-theme="dark"] .site-search-form__input,
html[data-theme="dark"] .content-search-form input { background: #071626; border-color: #345067; color: #edf4f7; }
html[data-theme="dark"] .site-search-form__input::placeholder,
html[data-theme="dark"] .content-search-form input::placeholder { color: #8094a3; }

html[data-theme="dark"] .home-band--mist,
html[data-theme="dark"] .archive-hero,
html[data-theme="dark"] .author-hero,
html[data-theme="dark"] .standard-page__hero,
html[data-theme="dark"] .error-page { background: #0a1b2c; }
html[data-theme="dark"] .sp-grid-field:not(.sp-grid-field--dark) {
	background-image: linear-gradient(to right,rgba(255,255,255,.045) 1px,transparent 1px),linear-gradient(to bottom,rgba(255,255,255,.045) 1px,transparent 1px);
}
html[data-theme="dark"] .home-hero,
html[data-theme="dark"] .archive-hero,
html[data-theme="dark"] .article-hero,
html[data-theme="dark"] .standard-page__hero,
html[data-theme="dark"] .section-heading,
html[data-theme="dark"] .home-section-head > div { border-color: #294156; }
html[data-theme="dark"] .home-hero__lede,
html[data-theme="dark"] .home-guide__intro,
html[data-theme="dark"] .archive-hero__description,
html[data-theme="dark"] .standard-page__hero p,
html[data-theme="dark"] .article-hero__summary,
html[data-theme="dark"] .archive-featured__body > p:not(.sp-eyebrow),
html[data-theme="dark"] .author-hero__profile > div:last-child > p,
html[data-theme="dark"] .error-page__inner > p:not(.error-page__code):not(.sp-eyebrow) { color: #b7c5cf; }
html[data-theme="dark"] .sp-button--outline { background: transparent; border-color: #3b566c; color: #edf4f7; }
html[data-theme="dark"] .sp-button--outline:hover { border-color: #61d0bd; color: #8ce3d3; }

html[data-theme="dark"] .vitals-figure,
html[data-theme="dark"] .diagnostic-art__sheet,
html[data-theme="dark"] .topic-card,
html[data-theme="dark"] .latest-lead,
html[data-theme="dark"] .latest-list article,
html[data-theme="dark"] .tool-register article,
html[data-theme="dark"] .trust-grid article,
html[data-theme="dark"] .home-empty-state,
html[data-theme="dark"] .article-card,
html[data-theme="dark"] .content-none,
html[data-theme="dark"] .entry-content details,
html[data-theme="dark"] .entry-content input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="dark"] .entry-content select,
html[data-theme="dark"] .entry-content textarea { background: #0d2336; border-color: #2c455a; color: #e8f0f4; }
html[data-theme="dark"] .vitals-figure__caption,
html[data-theme="dark"] .vitals-row,
html[data-theme="dark"] .vitals-figure__note,
html[data-theme="dark"] .guide-chapters,
html[data-theme="dark"] .guide-chapters li,
html[data-theme="dark"] .topic-card,
html[data-theme="dark"] .latest-list article,
html[data-theme="dark"] .tool-register article,
html[data-theme="dark"] .trust-grid article,
html[data-theme="dark"] .article-card__image,
html[data-theme="dark"] .content-none,
html[data-theme="dark"] .entry-content details,
html[data-theme="dark"] .article-navigation,
html[data-theme="dark"] .article-tags { border-color: #2c455a; }
html[data-theme="dark"] .diagnostic-art,
html[data-theme="dark"] .post-image-fallback,
html[data-theme="dark"] .latest-lead__fallback { background-color: #122a3e; }
html[data-theme="dark"] .guide-chapters a,
html[data-theme="dark"] .topic-card h3,
html[data-theme="dark"] .topic-card h3 a,
html[data-theme="dark"] .latest-lead h3 a,
html[data-theme="dark"] .latest-list h3 a,
html[data-theme="dark"] .article-card__title a,
html[data-theme="dark"] .archive-featured h2 a { color: #f2f7f9; }
html[data-theme="dark"] .topic-card p,
html[data-theme="dark"] .latest-lead > p,
html[data-theme="dark"] .article-card__excerpt,
html[data-theme="dark"] .home-section-head > p:last-child { color: #aebdC8; }
html[data-theme="dark"] .tool-register__head { background: #102b43; color: #b5c4ce; }
html[data-theme="dark"] .home-tools { background: #091a2a; }
html[data-theme="dark"] .home-trust { background: #071626; }

html[data-theme="dark"] .archive-content,
html[data-theme="dark"] .standard-page,
html[data-theme="dark"] .article-page,
html[data-theme="dark"] .author-page,
html[data-theme="dark"] .search-page { background: #071626; }
html[data-theme="dark"] .article-hero { background: linear-gradient(to bottom,#0a1b2c,#071626); }
html[data-theme="dark"] .article-featured-image img,
html[data-theme="dark"] .entry-content img { border-color: #2c455a; }
html[data-theme="dark"] .entry-content blockquote,
html[data-theme="dark"] .entry-content code:not(pre code),
html[data-theme="dark"] .entry-content th,
html[data-theme="dark"] .author-box { background: #0d2336; color: #c5d1d9; }
html[data-theme="dark"] .entry-content th,
html[data-theme="dark"] .entry-content td,
html[data-theme="dark"] .table-scroll,
html[data-theme="dark"] .entry-content .wp-block-group.has-background,
html[data-theme="dark"] .entry-content .wp-block-columns,
html[data-theme="dark"] .author-box,
html[data-theme="dark"] .article-navigation__item,
html[data-theme="dark"] .topic-switcher,
html[data-theme="dark"] .topic-switcher a { border-color: #2c455a; }
html[data-theme="dark"] .article-navigation__item,
html[data-theme="dark"] .topic-switcher a,
html[data-theme="dark"] .article-tags a { color: #edf4f7; }
html[data-theme="dark"] .entry-content input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="dark"] .entry-content select,
html[data-theme="dark"] .entry-content textarea { color: #edf4f7; }

html[data-theme="dark"] .article-card__read,
html[data-theme="dark"] .latest-read,
html[data-theme="dark"] .latest-list__read { border-color: #61d0bd; color: #7ddbc9; }
html[data-theme="dark"] .article-card__read:hover,
html[data-theme="dark"] .latest-read:hover,
html[data-theme="dark"] .latest-list__read:hover { color: #071626; background: #61d0bd; }

@media (max-width: 1023px) {
	html[data-theme="dark"] .site-nav { background: #071626; }
}

@media (prefers-reduced-motion: reduce) {
	.sp-reveal-pending { opacity: 1; transform: none; }
}

/* Three compact header actions still fit cleanly at the 360px baseline. */
@media (max-width: 767px) {
	.site-header__inner { gap: .5rem; }
	.site-header__actions { gap: .25rem; }
	.site-logo__compact svg {
		width: 130px;
		max-width: min(130px, calc(100vw - 190px));
	}
}


/* v1.3.5 — topic hub redesign dark mode */
html[data-theme="dark"] .topic-card{background:linear-gradient(180deg,#0d2336 0%,#0b1f31 100%);box-shadow:0 8px 24px rgba(0,0,0,.22)}
html[data-theme="dark"] .topic-card:before{background:linear-gradient(90deg,var(--sp-color-signal-teal),rgba(97,208,189,.08))}
html[data-theme="dark"] .topic-card__icon{background:rgba(97,208,189,.08);border-color:rgba(97,208,189,.2);color:#8ce3d3}
html[data-theme="dark"] .topic-card__meta{border-top-color:#2c455a}
html[data-theme="dark"] .topic-card__cta{color:#eef5f8}
html[data-theme="dark"] .topic-card:hover,
html[data-theme="dark"] .topic-card:focus-visible{background:linear-gradient(180deg,#11283b 0%,#0d2336 100%);border-color:rgba(97,208,189,.34);box-shadow:0 16px 36px rgba(0,0,0,.28)}


/* v1.3.6 — clearer article cards and latest-publication hierarchy */
.article-card{position:relative;overflow:hidden;box-shadow:0 8px 24px rgba(11,30,51,.055)}
.article-card:before{content:"";position:absolute;z-index:2;top:0;left:0;width:100%;height:3px;background:linear-gradient(90deg,var(--sp-color-signal-teal),rgba(15,168,140,.08))}
.article-card__body{position:relative}
.article-card__meta .post-meta__category{display:inline-flex;padding:.24rem .45rem;border:1px solid rgba(15,168,140,.24);background:rgba(15,168,140,.06);color:var(--sp-color-teal-ink);text-decoration:none}
.article-card__title{font-size:clamp(1.25rem,2.4vw,1.45rem)}
.article-card__read{width:100%;justify-content:space-between;margin-top:1rem;padding:.66rem .8rem}
.latest-layout{align-items:start}
.latest-lead{position:relative;padding:1rem;border:1px solid var(--sp-color-rule);background:#fff;box-shadow:0 10px 30px rgba(11,30,51,.07);overflow:hidden}
.latest-lead:before{content:"Featured";position:absolute;z-index:3;top:1.75rem;left:1.75rem;padding:.32rem .5rem;background:var(--sp-color-ink-navy);color:#fff;font:600 .62rem/1.2 var(--sp-font-data);letter-spacing:.1em;text-transform:uppercase}
.latest-lead__media{border:0}
.latest-lead h3{margin-bottom:.65rem}
.latest-read{width:100%;justify-content:space-between;margin-top:1rem}
.latest-list{counter-reset:latest-item;border-top:0;display:grid;gap:.75rem}
.latest-list article{counter-increment:latest-item;position:relative;padding:1rem 1rem 1rem 3.6rem;border:1px solid var(--sp-color-rule);background:#fff;box-shadow:0 6px 18px rgba(11,30,51,.04)}
.latest-list article:before{content:counter(latest-item,decimal-leading-zero);position:absolute;left:1rem;top:1.1rem;font:600 .72rem/1 var(--sp-font-data);letter-spacing:.08em;color:var(--sp-color-teal-ink)}
.latest-list__read{border:0;padding:0;min-height:0;color:var(--sp-color-teal-ink)}
.latest-list__read:hover,.latest-list__read:focus-visible{background:transparent;color:var(--sp-color-ink-navy)}
.home-empty-state{display:grid;grid-template-columns:auto minmax(0,1fr);gap:1.15rem;align-items:start;padding:1.5rem;background:linear-gradient(135deg,var(--sp-color-mist-gray),#fff);border-left:3px solid var(--sp-color-signal-teal)}
.home-empty-state__icon{display:grid;place-items:center;width:3.25rem;height:3.25rem;border:1px solid rgba(15,168,140,.24);background:rgba(15,168,140,.08);color:var(--sp-color-teal-ink)}
.home-empty-state__icon svg{width:1.65rem;height:1.65rem;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.home-empty-state .sp-eyebrow{margin-bottom:.35rem}
.home-empty-state h3{margin:.1rem 0 .45rem}
.home-empty-state p:not(.sp-eyebrow){margin:0;color:var(--sp-color-slate)}
.home-empty-state>.sp-button{grid-column:1/-1;justify-self:start;margin-top:.25rem}
@media(min-width:768px){.home-empty-state{grid-template-columns:auto minmax(0,1fr) auto;align-items:center;padding:1.75rem}.home-empty-state>.sp-button{grid-column:auto;margin:0}.latest-lead{padding:1.15rem}.article-card__read{width:auto}}

/* Make the appearance control unmistakably visible on small screens. */
@media(max-width:767px){.theme-toggle{border:1px solid var(--sp-color-rule);background:var(--sp-color-mist-gray);min-width:42px;min-height:42px}.site-header__actions{gap:.15rem}.search-toggle,.mobile-menu-toggle{min-width:42px;min-height:42px}}

html[data-theme="dark"] .sp-button--primary{color:#fff!important}
html[data-theme="dark"] .site-nav__mobile-head{background:linear-gradient(135deg,#06111d,#102b43)}
html[data-theme="dark"] .site-nav__quick-links a{background:#0d2336;border-color:#2c455a;color:#edf4f7}
html[data-theme="dark"] .nav-dropdown-caret{background:#132d42;color:#dce8ee}
html[data-theme="dark"] .nav-dropdown__menu{background:#091a2a;border-color:#2c455a}
html[data-theme="dark"] .nav-dropdown__menu a{background:#0d2336}
html[data-theme="dark"] .nav-dropdown__menu a:hover{background:#112b40}
html[data-theme="dark"] .latest-lead,
html[data-theme="dark"] .latest-list article{background:#0d2336;border-color:#2c455a;box-shadow:0 10px 28px rgba(0,0,0,.22)}
html[data-theme="dark"] .home-empty-state{background:linear-gradient(135deg,#0d2336,#0a1b2c);border-color:#61d0bd}
html[data-theme="dark"] .home-empty-state__icon{background:rgba(97,208,189,.08);border-color:rgba(97,208,189,.2);color:#8ce3d3}
html[data-theme="dark"] .theme-toggle{background:#0d2336;border-color:#2c455a}


/* v1.3.7 — consistent homepage Latest cards */
.latest-grid{display:grid;grid-template-columns:1fr;gap:1.25rem}
.latest-card{position:relative;display:flex;flex-direction:column;min-width:0;overflow:hidden;border:1px solid var(--sp-color-rule);background:#fff;box-shadow:0 8px 24px rgba(11,30,51,.055);transition:transform .22s ease,border-color .22s ease,box-shadow .22s ease}
.latest-card:before{content:"";position:absolute;z-index:3;top:0;left:0;width:100%;height:3px;background:linear-gradient(90deg,var(--sp-color-signal-teal),rgba(15,168,140,.08))}
.latest-card--featured:after{content:"Featured";position:absolute;z-index:4;top:1rem;left:1rem;padding:.32rem .5rem;background:var(--sp-color-ink-navy);color:#fff;font:600 .62rem/1.2 var(--sp-font-data);letter-spacing:.1em;text-transform:uppercase}
.latest-card__media{display:block;aspect-ratio:16/9;overflow:hidden;background:var(--sp-color-mist-gray);border-bottom:1px solid var(--sp-color-rule)}
.latest-card__media img{width:100%;height:100%;object-fit:cover;border-radius:0;transition:transform .35s ease}
.latest-card__body{display:flex;flex:1;flex-direction:column;padding:1.15rem}
.latest-card .latest-meta{margin:0 0 .65rem}
.latest-card h3{margin:0 0 .7rem;font-size:clamp(1.28rem,2.3vw,1.55rem);line-height:1.18}
.latest-card h3 a{color:var(--sp-color-ink-navy);text-decoration:none}
.latest-card p{flex:1;margin:0;color:#2c4055;font-size:.94rem;line-height:1.62}
.latest-card .latest-read{margin-top:1.05rem}
.latest-card:hover,.latest-card:focus-within{transform:translateY(-4px);border-color:rgba(15,168,140,.34);box-shadow:0 18px 38px rgba(11,30,51,.11)}
.latest-card:hover .latest-card__media img,.latest-card:focus-within .latest-card__media img{transform:scale(1.035)}
@media(min-width:700px){.latest-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(min-width:1100px){.latest-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:1.4rem}}
@media(hover:none){.latest-card:hover{transform:none;box-shadow:0 8px 24px rgba(11,30,51,.055)}.latest-card:hover .latest-card__media img{transform:none}}
@media(prefers-reduced-motion:reduce){.latest-card,.latest-card__media img{transition:none}}
html[data-theme="dark"] .latest-card{background:#0d2336;border-color:#2c455a;box-shadow:0 10px 28px rgba(0,0,0,.22)}
html[data-theme="dark"] .latest-card__media{border-bottom-color:#2c455a}
html[data-theme="dark"] .latest-card p{color:#b8c7d1}
html[data-theme="dark"] .latest-card:hover,html[data-theme="dark"] .latest-card:focus-within{border-color:rgba(97,208,189,.34);box-shadow:0 18px 38px rgba(0,0,0,.3)}
