/*
Theme Name: Back Pain Sleep
Theme URI: https://backpainsleep.com
Description: A warm, editorial child theme for Back Pain Sleep. Cream canvas, ink type, Fraunces serif display. Child of Twenty Twenty-Five.
Author: Back Pain Sleep
Template: twentytwentyfive
Version: 2.0.0
Requires at least: 6.6
Requires PHP: 8.0
Text Domain: backpainsleep
*/

/* Fonts load locally via theme.json fontFace (Inter, Fraunces, Plus Jakarta Sans). */

:root{
  --bps-ink:#1C1B17;
  --bps-cream:#FBF8F3;
  --bps-sand:#F1EADD;
  --bps-line:#E6DECF;
  --bps-green:#33493F;
  --bps-clay:#B5673F;
  --bps-muted:#6E685C;
  --bps-radius:14px;
  --bps-radius-lg:22px;
  --bps-shadow:0 18px 50px -30px rgba(28,27,23,.30);
  --bps-shadow-lg:0 50px 90px -50px rgba(37,53,45,.45);
}
*{ box-sizing:border-box; }
html,body{ overflow-x:hidden; max-width:100%; }
body{ background:var(--wp--preset--color--base); color:var(--wp--preset--color--contrast); font-family:var(--wp--preset--font-family--body); -webkit-font-smoothing:antialiased; text-rendering:optimizeLegibility; }
img,svg,video,iframe{ max-width:100%; height:auto; }
main,.wp-block-group,.wp-block-columns,.wp-block-column{ max-width:100%; }

h1,h2,h3,.wp-block-heading{ font-family:var(--wp--preset--font-family--heading); font-weight:500; letter-spacing:-.012em; }
h1{ line-height:1.03; }

/* Header */
.bps-site-header{ position:sticky; top:0; z-index:100; background:rgba(251,248,243,.82); -webkit-backdrop-filter:saturate(140%) blur(12px); backdrop-filter:saturate(140%) blur(12px); border-bottom:1px solid var(--bps-line); }
.bps-logo a,.bps-logo a:hover{ text-decoration:none; font-family:var(--wp--preset--font-family--heading); font-weight:500; letter-spacing:-.01em; color:var(--bps-ink); }
.bps-nav a{ text-decoration:none; font-weight:500; font-size:.96rem; color:var(--bps-ink); font-family:var(--wp--preset--font-family--sans); transition:color .15s ease; }
.bps-nav a:hover{ color:var(--bps-green); }
.bps-header-cta{ display:inline-block; background:var(--bps-ink); color:var(--bps-cream) !important; text-decoration:none; font-family:var(--wp--preset--font-family--sans); font-weight:600; font-size:.9rem; padding:.62em 1.3em; border-radius:9999px; white-space:nowrap; transition:background-color .15s ease, transform .12s ease; }
.bps-header-cta:hover{ background:var(--bps-green); transform:translateY(-1px); color:var(--bps-cream) !important; }

/* Buttons */
.wp-block-button__link{ border-radius:9999px; font-weight:600; font-family:var(--wp--preset--font-family--sans); padding:.95em 1.9em; letter-spacing:.01em; box-shadow:none; transition:transform .12s ease, background-color .15s ease, color .15s ease; }
.wp-block-button:not(.is-style-outline) .wp-block-button__link{ background:var(--bps-ink); color:var(--bps-cream); }
.wp-block-button:not(.is-style-outline) .wp-block-button__link:hover{ background:var(--bps-green); color:var(--bps-cream); transform:translateY(-2px); }
.is-style-outline .wp-block-button__link{ background:transparent; border:1px solid var(--bps-ink); color:var(--bps-ink); }
.is-style-outline .wp-block-button__link:hover{ background:var(--bps-ink); color:var(--bps-cream); }

/* Section rhythm */
.bps-section{ padding-top:clamp(4rem,8vw,7.5rem); padding-bottom:clamp(4rem,8vw,7.5rem); }
.bps-bg-soft{ background:var(--bps-sand); }
.bps-section-head{ text-align:center; max-width:640px; margin:0 auto clamp(2.6rem,5vw,4rem); }
.bps-section-head h2{ margin:0 0 .8rem; font-size:clamp(2rem,4vw,3rem); }
.bps-section-head p{ color:var(--bps-muted); margin:0; font-size:1.12rem; line-height:1.6; }

/* Hero */
.bps-hero2{ position:relative; background:var(--wp--preset--color--base); }
.bps-hero2 .wp-block-columns{ align-items:center; }
.bps-hero2-eyebrow{ display:inline-block; font-family:var(--wp--preset--font-family--sans); text-transform:uppercase; letter-spacing:.18em; font-size:.72rem; font-weight:700; color:var(--bps-clay) !important; margin:0 0 1.4rem; }
.bps-hero2 h1{ font-size:clamp(2.8rem,6vw,4.6rem); line-height:1.02; margin:0; letter-spacing:-.02em; font-weight:500; }
.bps-hero2 .bps-lead{ font-size:clamp(1.12rem,1.6vw,1.3rem); color:#4a473f; line-height:1.62; margin:1.5rem 0 0; max-width:34ch; }
.bps-hero2 .bps-trustline{ font-family:var(--wp--preset--font-family--sans); font-size:.92rem; color:var(--bps-muted) !important; margin-top:1.7rem !important; }
.bps-hero2-photo{ position:relative; }
.bps-hero2-photo img{ border-radius:var(--bps-radius-lg); box-shadow:var(--bps-shadow-lg); width:100%; object-fit:cover; aspect-ratio:4/4.1; display:block; }
.bps-hero-badge{ position:absolute; left:-1rem; bottom:-1.2rem; background:var(--bps-cream); border:1px solid var(--bps-line); box-shadow:var(--bps-shadow); border-radius:16px; padding:.9rem 1.2rem; display:flex; flex-direction:column; line-height:1.05; }
.bps-hero-badge strong{ font-family:var(--wp--preset--font-family--heading); font-weight:500; font-size:1.8rem; color:var(--bps-green); letter-spacing:-.01em; }
.bps-hero-badge span{ font-family:var(--wp--preset--font-family--sans); font-size:.76rem; color:var(--bps-muted); max-width:15ch; margin-top:.25rem; }

/* Trust bar */
.bps-trustbar{ border-top:1px solid var(--bps-line); border-bottom:1px solid var(--bps-line); background:transparent; }
.bps-trustbar-inner{ display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:.6rem 1.6rem; padding:1.3rem 1.25rem; max-width:1000px; margin:0 auto; }
.bps-trustbar-inner span{ font-family:var(--wp--preset--font-family--sans); font-size:.72rem; text-transform:uppercase; letter-spacing:.16em; font-weight:700; color:var(--bps-muted); white-space:nowrap; }
.bps-trustbar-inner i{ width:5px; height:5px; border-radius:50%; background:var(--bps-clay); opacity:.6; }

/* Topic grid */
.bps-topic-grid{ display:grid; gap:1.1rem; grid-template-columns:repeat(5,1fr); max-width:1140px; margin-inline:auto; }
.bps-card{ display:flex; flex-direction:column; align-items:flex-start; height:100%; padding:2rem 1.6rem; background:var(--wp--preset--color--surface); border:1px solid var(--bps-line); border-radius:var(--bps-radius); text-decoration:none; transition:transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.bps-card:hover{ transform:translateY(-5px); box-shadow:var(--bps-shadow); border-color:#d8cdb8; }
.bps-card-icon{ width:54px; height:54px; border-radius:50%; display:flex; align-items:center; justify-content:center; color:var(--bps-green); background:var(--bps-sand); margin-bottom:1.3rem; }
.bps-card h3{ margin:0 0 .55rem; font-size:1.18rem; line-height:1.18; font-family:var(--wp--preset--font-family--heading); font-weight:500; color:var(--bps-ink); letter-spacing:-.01em; }
.bps-card p{ margin:0; color:var(--bps-muted); font-size:.92rem; line-height:1.55; flex:1; }
.bps-card .bps-arrow{ margin-top:1.3rem; color:var(--bps-clay); font-weight:600; font-family:var(--wp--preset--font-family--sans); font-size:.8rem; text-transform:uppercase; letter-spacing:.08em; transition:transform .15s ease; }
.bps-card:hover .bps-arrow{ transform:translateX(4px); }

/* Why band */
.bps-why .wp-block-columns{ align-items:center; }
.bps-why-photo img{ border-radius:var(--bps-radius-lg); box-shadow:var(--bps-shadow-lg); width:100%; aspect-ratio:4/4.2; object-fit:cover; display:block; }
.bps-benefits{ display:grid; grid-template-columns:1fr 1fr; gap:2rem 2.2rem; margin-top:2.2rem; }
.bps-benefit .bps-b-icon{ width:44px; height:44px; border-radius:50%; background:var(--bps-cream); border:1px solid var(--bps-line); display:flex; align-items:center; justify-content:center; font-size:20px; margin-bottom:.7rem; }
.bps-benefit h4{ margin:.1rem 0 .4rem; font-size:1.12rem; font-family:var(--wp--preset--font-family--heading); font-weight:500; color:var(--bps-ink); }
.bps-benefit p{ margin:0; color:var(--bps-muted); font-size:.95rem; line-height:1.55; }

/* Product / affiliate */
.bps-product{ border:1px solid var(--bps-line); border-radius:var(--bps-radius-lg); background:var(--wp--preset--color--surface); padding:2rem; margin:2rem 0; }
.bps-product.bps-toppick{ border-color:var(--bps-green); background:linear-gradient(180deg,#F6F4EC,#FFFFFF); }
.bps-ribbon{ display:inline-block; background:var(--bps-clay); color:#fff; font-family:var(--wp--preset--font-family--sans); font-weight:700; font-size:.68rem; letter-spacing:.12em; text-transform:uppercase; padding:.4em 1em; border-radius:9999px; margin-bottom:.9rem; }
.bps-product h3,.bps-product h4{ margin:.1rem 0 .55rem; font-size:1.5rem; font-family:var(--wp--preset--font-family--heading); font-weight:500; }
.bps-product p{ margin:.5rem 0 1rem; color:#4a473f; line-height:1.6; }
.bps-rating{ color:#C0883B; font-size:1rem; letter-spacing:.06em; margin-bottom:.5rem; }
.bps-rating span{ color:var(--bps-muted); font-family:var(--wp--preset--font-family--sans); font-size:.85rem; margin-left:.5rem; }
.bps-aff-btn,a.bps-aff-btn{ display:inline-block; background:var(--bps-clay); color:#fff !important; text-decoration:none !important; font-family:var(--wp--preset--font-family--sans); font-weight:600; padding:.85em 1.7em; border-radius:9999px; transition:transform .12s ease, background-color .15s ease; }
.bps-aff-btn:hover{ transform:translateY(-2px); background:#9f5836; color:#fff !important; }
.bps-aff-note{ font-size:.8rem; color:var(--bps-muted); font-family:var(--wp--preset--font-family--sans); margin-top:.6rem !important; }
.bps-pros-cons{ display:grid; grid-template-columns:1fr 1fr; gap:1rem; margin:1.4rem 0; }
.bps-pros,.bps-cons{ border-radius:12px; padding:1.1rem 1.2rem; }
.bps-pros{ background:#EEF3EC; } .bps-cons{ background:#F6ECE6; }
.bps-pros h4,.bps-cons h4{ margin:0 0 .5rem; font-size:1rem; font-family:var(--wp--preset--font-family--sans); font-weight:700; }
.bps-pros ul,.bps-cons ul{ margin:0; padding-left:1.1rem; }
.bps-pros li,.bps-cons li{ margin:.3rem 0; }

/* Post loop cards */
.bps-loop .wp-block-post-template,.bps-loop ul.wp-block-post-template{ display:grid !important; gap:1.8rem; grid-template-columns:repeat(auto-fill, minmax(min(18rem,100%),1fr)); margin:0; padding:0; list-style:none; }
.bps-loop li.wp-block-post{ margin:0; }
.bps-card-post{ border:1px solid var(--bps-line); border-radius:var(--bps-radius); overflow:hidden; background:var(--wp--preset--color--surface); height:100%; display:flex; flex-direction:column; transition:transform .2s ease, box-shadow .2s ease; }
.bps-card-post:hover{ transform:translateY(-5px); box-shadow:var(--bps-shadow); }
.bps-card-post .wp-block-post-featured-image{ margin:0; background:var(--bps-sand); min-height:200px; }
.bps-card-post .wp-block-post-featured-image img{ width:100%; height:210px; object-fit:cover; display:block; }
.bps-card-post .bps-card-body{ padding:1.4rem 1.5rem 1.6rem; display:flex; flex-direction:column; gap:.55rem; flex:1; }
.bps-card-post .wp-block-post-title{ font-size:1.22rem; line-height:1.24; margin:0; font-family:var(--wp--preset--font-family--heading); font-weight:500; }
.bps-card-post .wp-block-post-title a{ text-decoration:none; color:var(--bps-ink); }
.bps-card-post .wp-block-post-title a:hover{ color:var(--bps-green); }
.bps-card-post .wp-block-post-excerpt{ margin:0; }
.bps-card-post .wp-block-post-excerpt__excerpt{ color:var(--bps-muted); font-size:.94rem; line-height:1.55; }
.bps-card-post .wp-block-post-date{ font-family:var(--wp--preset--font-family--sans); font-size:.76rem; color:var(--bps-muted); margin-top:auto; padding-top:.4rem; }

/* Closing band */
.bps-closing{ position:relative; background:linear-gradient(150deg, rgba(37,53,45,.93), rgba(28,27,23,.88)), url('/wp-content/uploads/temp/calm.jpg'); background-size:cover; background-position:center; }
.bps-closing-inner{ max-width:680px; margin:0 auto; text-align:center; padding:clamp(4.5rem,8vw,7rem) 1.25rem; }
.bps-closing-inner h2{ color:var(--bps-cream); font-size:clamp(2.1rem,4vw,3.1rem); letter-spacing:-.02em; margin:0 0 1.1rem; font-weight:500; }
.bps-closing-inner p{ color:#DDD6C7; font-size:1.14rem; line-height:1.62; margin:0 auto 2.2rem; max-width:46ch; }
.bps-closing-btn{ display:inline-block; background:var(--bps-clay); color:#fff !important; text-decoration:none; font-family:var(--wp--preset--font-family--sans); font-weight:600; padding:1em 2.1em; border-radius:9999px; transition:transform .12s ease, background-color .15s ease; }
.bps-closing-btn:hover{ transform:translateY(-2px); background:#9f5836; color:#fff !important; }

/* Disclosure */
.bps-disclosure{ background:var(--bps-sand); border-left:3px solid var(--bps-green); padding:.8rem 1.1rem; border-radius:8px; font-size:.85rem; color:#4a473f; margin:1.5rem 0; }

/* Article */
.bps-article .wp-block-post-terms a{ display:inline-block; text-decoration:none; background:var(--bps-sand); color:var(--bps-green); padding:.3em .9em; border-radius:9999px; font-family:var(--wp--preset--font-family--sans); font-size:.72rem; font-weight:700; letter-spacing:.06em; text-transform:uppercase; }
.bps-article .wp-block-post-author-name a{ color:var(--bps-green); text-decoration:none; font-weight:600; font-family:var(--wp--preset--font-family--sans); }
.entry-content{ font-size:1.12rem; line-height:1.8; }
.entry-content h2{ margin-top:2.4em; font-size:1.9rem; }
.entry-content h3{ margin-top:1.7em; font-size:1.4rem; }
.entry-content a{ text-underline-offset:.18em; }
.entry-content ul li,.entry-content ol li{ margin:.45rem 0; }

/* TOC */
.bps-toc{ background:var(--wp--preset--color--surface); border:1px solid var(--bps-line); border-radius:14px; padding:1.2rem 1.4rem; margin:1.8rem 0 2.2rem; }
.bps-toc strong{ font-family:var(--wp--preset--font-family--heading); font-weight:500; display:block; margin-bottom:.5rem; }
.bps-toc ul{ margin:0; padding-left:1.1rem; }
.bps-toc a{ text-decoration:none; }

/* Tables */
.wp-block-table table{ border-collapse:collapse; width:100%; }
.wp-block-table th{ background:var(--bps-sand); font-family:var(--wp--preset--font-family--sans); font-weight:700; }
.wp-block-table th,.wp-block-table td{ border:1px solid var(--bps-line); padding:.8em 1em; text-align:left; }

/* Author box */
.bps-authorbox{ border:1px solid var(--bps-line); background:var(--wp--preset--color--surface); border-radius:var(--bps-radius); padding:1.6rem 1.7rem; margin-top:2.8rem; }
.bps-authorbox .wp-block-post-author__byline{ font-family:var(--wp--preset--font-family--sans); font-size:.72rem; text-transform:uppercase; letter-spacing:.14em; color:var(--bps-clay); margin:0 0 .3rem; font-weight:700; }
.bps-authorbox .wp-block-post-author__name{ font-family:var(--wp--preset--font-family--heading); font-weight:500; font-size:1.25rem; color:var(--bps-ink); }
.bps-authorbox .wp-block-post-author__name a{ text-decoration:none; color:var(--bps-ink); }
.bps-authorbox .wp-block-post-author__bio{ color:var(--bps-muted); font-size:.96rem; line-height:1.62; margin-top:.5rem; }

/* Footer */
.bps-footer{ background:var(--bps-ink); }
.bps-footer, .bps-footer :where(p,a,h2,h3,li){ color:#C9C2B4; }
.bps-footer a{ text-decoration:none; }
.bps-footer a:hover{ color:#fff; }
.bps-footer h3{ color:#F3EFE6; font-family:var(--wp--preset--font-family--heading); font-weight:500; }
.bps-footer ul.is-style-none, .bps-footer ul{ list-style:none; padding:0; margin:0; }
.bps-footer li{ margin:.5rem 0; }

/* Utilities + responsive */
.bps-muted{ color:var(--bps-muted); }
.bps-product > div{ min-width:0; }
.bps-article .entry-content .bps-product{ width:min(940px,94vw); margin-left:50%; transform:translateX(-50%); }

@media(max-width:1024px){
  .bps-topic-grid{ grid-template-columns:repeat(3,1fr); }
  .bps-header-cta{ display:none; }
}
@media(max-width:781px){
  .bps-hero2-photo{ margin-top:2.8rem; }
  .bps-hero2-photo img{ aspect-ratio:4/3.3; }
  .bps-benefits{ grid-template-columns:1fr 1fr; }
}
@media(max-width:680px){
  .bps-topic-grid{ grid-template-columns:repeat(2,1fr); }
}
@media(max-width:600px){
  .bps-pros-cons{ grid-template-columns:1fr; }
  .bps-product [style*="min-width"]{ min-width:0 !important; flex-basis:100% !important; }
  .bps-product > div{ flex-direction:column; }
  .bps-aff-btn{ display:block; text-align:center; }
}
@media(max-width:480px){
  .bps-benefits{ grid-template-columns:1fr; }
  .bps-topic-grid{ grid-template-columns:1fr; }
}


/* ---- consistency + wrapping (v2.1) ---- */
h1,h2,h3,h4,.wp-block-heading{ text-wrap:balance; }
.bps-card-post .wp-block-post-title,.bps-card h3{ text-wrap:balance; }
p,.bps-lead,.entry-content p,.wp-block-post-excerpt__excerpt{ text-wrap:pretty; }


/* force consistent 3-col post grids (v2.2) */
.bps-loop .wp-block-post-template{ grid-template-columns:repeat(3,1fr) !important; }
@media(max-width:900px){ .bps-loop .wp-block-post-template{ grid-template-columns:repeat(2,1fr) !important; } }
@media(max-width:560px){ .bps-loop .wp-block-post-template{ grid-template-columns:1fr !important; } }


/* full-bleed + logo + product placeholder (v2.3) */
main > .alignfull{ width:100vw !important; max-width:100vw !important; margin-left:calc(50% - 50vw) !important; margin-right:calc(50% - 50vw) !important; }
.bps-site-header .wp-block-site-logo{ line-height:0; }
.bps-site-header .wp-block-site-logo img{ width:auto !important; height:38px; max-height:38px; }
.bps-product a:has(> img[src*="/branded/"]){ display:none !important; }


/* alignment fix + breadcrumbs (v2.4) */
.bps-article .entry-content .bps-product{ width:auto !important; max-width:100% !important; margin-left:0 !important; margin-right:0 !important; transform:none !important; }
.bps-breadcrumb{ padding-top:1.6rem; }
.bps-breadcrumb .rank-math-breadcrumb, .bps-breadcrumb p{ font-family:var(--wp--preset--font-family--sans); font-size:.82rem; color:var(--bps-muted); margin:0; letter-spacing:.01em; }
.bps-breadcrumb a{ color:var(--bps-green); text-decoration:none; }
.bps-breadcrumb a:hover{ text-decoration:underline; }

/* tables refined + TOC (v2.5) */
.entry-content .wp-block-table{ margin:2rem 0; overflow-x:auto; }
.wp-block-table table{ width:100%; border-collapse:separate; border-spacing:0; background:#fff; border:1px solid var(--bps-line); border-radius:12px; overflow:hidden; font-size:.96rem; }
.wp-block-table th, .wp-block-table td{ border:0 !important; padding:.7em 1em; text-align:left; vertical-align:top; line-height:1.42; }
.wp-block-table thead th{ background:#F7F3EC; font-family:var(--wp--preset--font-family--sans); font-weight:700; font-size:.74rem; text-transform:uppercase; letter-spacing:.05em; color:var(--bps-ink); padding-top:.9em; padding-bottom:.9em; border-bottom:1px solid var(--bps-line) !important; }
.wp-block-table tbody td{ background:#fff !important; color:#3a382f; border-bottom:1px solid var(--bps-line) !important; }
.wp-block-table tbody tr:last-child td{ border-bottom:0 !important; }
.wp-block-table th + th, .wp-block-table td + td{ border-left:1px solid var(--bps-line) !important; }
.wp-block-table figcaption, .wp-block-table__caption{ font-family:var(--wp--preset--font-family--sans); font-size:.82rem; color:var(--bps-muted); margin-top:.85rem; text-align:left; line-height:1.5; }
.entry-content h2{ scroll-margin-top:90px; }
.bps-toc{ background:#fff; border:1px solid var(--bps-line); border-radius:12px; padding:1.3rem 1.5rem; margin:0 0 2.4rem; }
.bps-toc strong{ font-family:var(--wp--preset--font-family--sans); font-size:.72rem; text-transform:uppercase; letter-spacing:.13em; color:var(--bps-muted); font-weight:700; display:block; margin-bottom:.8rem; }
.bps-toc ul{ margin:0; padding:0; list-style:none; columns:2; column-gap:2.2rem; }
.bps-toc li{ margin:.32rem 0; break-inside:avoid; }
.bps-toc a{ font-family:var(--wp--preset--font-family--sans); font-size:.92rem; color:var(--bps-green); text-decoration:none; }
.bps-toc a:hover{ text-decoration:underline; }
@media(max-width:600px){ .bps-toc ul{ columns:1; } }

/* Key takeaways box (v2.6) */
.bps-takeaways{ background:#fff; border:1px solid var(--bps-line); border-left:4px solid var(--bps-green); border-radius:12px; padding:1.2rem 1.4rem; margin:0 0 2.2rem; }
.bps-takeaways strong{ font-family:var(--wp--preset--font-family--sans); font-size:.72rem; text-transform:uppercase; letter-spacing:.13em; color:var(--bps-green); display:block; margin-bottom:.6rem; }
.bps-takeaways ul{ margin:0; padding-left:1.15rem; }
.bps-takeaways li{ margin:.35rem 0; line-height:1.55; }

/* v2.7: wrapping, TOC clarity, spacing, image consistency */
h1,h2,h3,h4,.wp-block-heading,.bps-section-head h2,.bps-section-head p,.bps-hero2 .bps-lead,.bps-closing-inner h2,.bps-closing-inner p,.bps-card h3,.bps-card-post .wp-block-post-title,.bps-takeaways li{ text-wrap:balance; }
.entry-content p,.entry-content li,.wp-block-post-excerpt__excerpt{ text-wrap:pretty; }
.bps-takeaways,.bps-toc,.bps-disclosure,.bps-product,.entry-content .wp-block-table{ margin-top:2rem; margin-bottom:2rem; }
.bps-takeaways{ margin-top:0; }
.bps-toc{ padding:1.4rem 1.6rem; }
.bps-toc strong{ color:var(--bps-clay); }
.bps-toc ul{ list-style:none; margin:.5rem 0 0; padding:0; }
.bps-toc li{ position:relative; padding-left:1.4rem; margin:.5rem 0; break-inside:avoid; }
.bps-toc li::before{ content:"\2192"; position:absolute; left:0; top:0; color:var(--bps-clay); font-weight:700; }
.bps-toc a{ color:var(--bps-green); text-decoration:underline; text-decoration-color:rgba(51,73,63,.4); text-underline-offset:3px; }
.bps-toc a:hover{ color:var(--bps-clay); text-decoration-color:var(--bps-clay); }
.bps-article .wp-block-post-featured-image img{ border-radius:18px; }
@media(max-width:600px){ .bps-toc ul{ columns:1; } }

/* ========= UI enhancements v3.0 ========= */

/* Search toggle button */
.bps-search-toggle{ background:none; border:none; cursor:pointer; padding:.4rem; color:var(--bps-ink); display:flex; align-items:center; transition:color .15s ease; }
.bps-search-toggle:hover{ color:var(--bps-green); }

/* Search overlay */
.bps-search-overlay{ position:fixed; inset:0; background:rgba(28,27,23,.92); z-index:999; display:flex; align-items:flex-start; justify-content:center; padding-top:clamp(4rem,12vw,8rem); opacity:0; pointer-events:none; transition:opacity .22s ease; }
.bps-search-overlay.bps-search-open{ opacity:1; pointer-events:all; }
.bps-search-overlay-inner{ width:min(680px,90vw); position:relative; }
.bps-search-form-overlay{ display:flex; gap:.6rem; }
.bps-search-form-overlay input{ flex:1; font-family:var(--wp--preset--font-family--body); font-size:1.15rem; padding:.85em 1.1em; border:2px solid var(--bps-line); border-radius:var(--bps-radius); background:#fff; color:var(--bps-ink); outline:none; }
.bps-search-form-overlay input:focus{ border-color:var(--bps-green); }
.bps-search-form-overlay button{ font-family:var(--wp--preset--font-family--sans); font-weight:700; background:var(--bps-green); color:#fff; border:none; border-radius:var(--bps-radius); padding:.85em 1.4em; cursor:pointer; white-space:nowrap; font-size:1rem; }
.bps-search-form-overlay button:hover{ background:var(--bps-clay); }
.bps-search-close{ position:absolute; top:-2.5rem; right:0; background:none; border:none; color:#fff; font-size:2rem; cursor:pointer; line-height:1; padding:.25rem .5rem; }

/* Search results page */
.bps-search-form .wp-block-search__inside-wrapper{ border:1.5px solid var(--bps-line); border-radius:var(--bps-radius); overflow:hidden; display:flex; }
.bps-search-form .wp-block-search__input{ font-size:1.05rem; padding:.85em 1.1em; border:none; flex:1; outline:none; font-family:var(--wp--preset--font-family--body); }
.bps-search-form .wp-block-search__button{ background:var(--bps-green); color:#fff; border:none; padding:.85em 1.4em; font-family:var(--wp--preset--font-family--sans); font-weight:700; cursor:pointer; }

/* Reading progress bar */
.bps-progress-bar{ position:fixed; top:0; left:0; height:3px; background:linear-gradient(90deg,var(--bps-green),var(--bps-clay)); width:0%; z-index:200; transition:width .1s linear; }

/* Back to top button */
.bps-back-top{ position:fixed; bottom:1.8rem; right:1.8rem; width:46px; height:46px; background:var(--bps-ink); color:var(--bps-cream); border:none; border-radius:50%; cursor:pointer; display:flex; align-items:center; justify-content:center; box-shadow:0 4px 18px rgba(28,27,23,.35); opacity:0; transform:translateY(12px); transition:opacity .2s ease, transform .2s ease, background-color .15s ease; z-index:150; }
.bps-back-top.bps-visible{ opacity:1; transform:translateY(0); }
.bps-back-top:hover{ background:var(--bps-green); }

/* Sticky article CTA */
.bps-sticky-cta{ position:fixed; bottom:1.8rem; left:50%; transform:translateX(-50%) translateY(80px); background:var(--bps-green); color:var(--bps-cream) !important; font-family:var(--wp--preset--font-family--sans); font-weight:700; font-size:.88rem; padding:.7em 1.4em; border-radius:9999px; text-decoration:none; box-shadow:0 8px 24px rgba(37,53,45,.45); z-index:140; opacity:0; transition:opacity .25s ease, transform .25s ease; white-space:nowrap; }
.bps-sticky-cta.bps-visible{ opacity:1; transform:translateX(-50%) translateY(0); }
.bps-sticky-cta:hover{ background:var(--bps-clay); color:#fff !important; }
@media(max-width:600px){ .bps-sticky-cta{ bottom:5rem; } }

/* Smooth scroll */
html{ scroll-behavior:smooth; }

/* Reading time badge */
.bps-reading-time{ display:inline-flex; align-items:center; gap:.35rem; font-family:var(--wp--preset--font-family--sans); font-size:.78rem; color:var(--bps-muted); }
.bps-reading-time svg{ opacity:.6; }

/* Print styles */
@media print{
  .bps-site-header,.bps-footer,.bps-sticky-cta,.bps-back-top,.bps-progress-bar,.bps-closing{ display:none !important; }
  body{ font-size:12pt; line-height:1.5; }
  a[href]:after{ content:" ("attr(href)")"; font-size:.8em; }
}

/* ===== Share buttons ===== */
.bps-share{ margin:2.5rem 0; padding:1.5rem 1.7rem; background:var(--bps-sand); border-radius:var(--bps-radius); }
.bps-share-label{ font-family:var(--wp--preset--font-family--sans); font-size:.72rem; text-transform:uppercase; letter-spacing:.14em; color:var(--bps-muted); font-weight:700; display:block; margin-bottom:.9rem; }
.bps-share-btns{ display:flex; flex-wrap:wrap; gap:.6rem; }
.bps-share-btn{ display:inline-flex; align-items:center; gap:.45rem; font-family:var(--wp--preset--font-family--sans); font-size:.88rem; font-weight:600; padding:.55em 1.1em; border-radius:9999px; border:1.5px solid var(--bps-line); background:#fff; color:var(--bps-ink); cursor:pointer; text-decoration:none; transition:background-color .15s ease, color .15s ease, border-color .15s ease; }
.bps-share-btn:hover{ background:var(--bps-ink); color:var(--bps-cream); border-color:var(--bps-ink); }
.bps-share-btn.bps-copied{ background:var(--bps-green); color:var(--bps-cream); border-color:var(--bps-green); }
.bps-share-btn svg{ flex-shrink:0; }

/* ===== Was this helpful ===== */
.bps-helpful{ margin:2rem 0; padding:1.5rem 1.7rem; border:1px solid var(--bps-line); border-radius:var(--bps-radius); text-align:center; }
.bps-helpful-q{ font-family:var(--wp--preset--font-family--heading); font-size:1.15rem; font-weight:500; color:var(--bps-ink); margin-bottom:1rem; }
.bps-helpful-btns{ display:flex; justify-content:center; gap:.7rem; }
.bps-helpful-btn{ font-family:var(--wp--preset--font-family--sans); font-size:.92rem; font-weight:600; padding:.6em 1.6em; border-radius:9999px; border:1.5px solid var(--bps-line); background:#fff; color:var(--bps-ink); cursor:pointer; transition:all .15s ease; }
.bps-helpful-btn:hover,.bps-helpful-btn.selected{ background:var(--bps-green); color:#fff; border-color:var(--bps-green); }
.bps-helpful-thankyou{ font-family:var(--wp--preset--font-family--sans); color:var(--bps-green); font-weight:600; font-size:.95rem; display:none; }
.bps-helpful-thankyou.visible{ display:block; }

/* ===== Newsletter inline ===== */
.bps-newsletter{ margin:2.5rem 0; padding:1.8rem 2rem; background:linear-gradient(135deg,#EAF0EC,#F0EDE5); border-radius:var(--bps-radius-lg); border:1px solid rgba(51,73,63,.15); }
.bps-newsletter-eyebrow{ font-family:var(--wp--preset--font-family--sans); font-size:.72rem; text-transform:uppercase; letter-spacing:.14em; color:var(--bps-clay); font-weight:700; margin:0 0 .5rem; }
.bps-newsletter h3{ font-family:var(--wp--preset--font-family--heading); font-weight:500; font-size:1.35rem; color:var(--bps-ink); margin:0 0 .5rem; }
.bps-newsletter p{ font-size:.95rem; color:var(--bps-muted); margin:0 0 1.2rem; }
.bps-newsletter-form{ display:flex; gap:.6rem; flex-wrap:wrap; }
.bps-newsletter-form input[type=email]{ flex:1 1 220px; font-family:var(--wp--preset--font-family--body); font-size:.98rem; padding:.75em 1.1em; border:1.5px solid rgba(51,73,63,.25); border-radius:9999px; background:#fff; color:var(--bps-ink); outline:none; min-width:0; }
.bps-newsletter-form input[type=email]:focus{ border-color:var(--bps-green); }
.bps-newsletter-form button{ font-family:var(--wp--preset--font-family--sans); font-weight:700; font-size:.92rem; padding:.75em 1.6em; border-radius:9999px; background:var(--bps-green); color:#fff; border:none; cursor:pointer; white-space:nowrap; transition:background-color .15s ease; }
.bps-newsletter-form button:hover{ background:var(--bps-clay); }
.bps-newsletter-success{ font-family:var(--wp--preset--font-family--sans); color:var(--bps-green); font-weight:600; font-size:.95rem; display:none; }
.bps-newsletter-success.visible{ display:block; }
.bps-newsletter-note{ font-size:.76rem; color:var(--bps-muted); margin-top:.6rem; }

/* ===== Condition hub pages ===== */
.bps-hub-hero{ background:var(--bps-sand); }
.bps-hub-hero h1{ font-size:clamp(2rem,4vw,3rem); margin:0 0 .7rem; }
.bps-hub-hero p{ color:var(--bps-muted); font-size:1.1rem; margin:0; }
.bps-hub-pillar{ background:#fff; border:1.5px solid var(--bps-green); border-radius:var(--bps-radius-lg); padding:1.6rem 1.8rem; margin:2rem 0 2.5rem; display:flex; flex-wrap:wrap; gap:1rem; align-items:center; }
.bps-hub-pillar-label{ font-family:var(--wp--preset--font-family--sans); font-size:.7rem; text-transform:uppercase; letter-spacing:.14em; color:var(--bps-clay); font-weight:700; display:block; margin-bottom:.3rem; }
.bps-hub-pillar h2{ margin:0 0 .4rem; font-size:1.35rem; }
.bps-hub-pillar p{ margin:0 0 .9rem; color:var(--bps-muted); font-size:.95rem; }
.bps-hub-pillar a.bps-hub-link{ font-family:var(--wp--preset--font-family--sans); font-weight:700; font-size:.9rem; color:var(--bps-green); text-decoration:none; }
.bps-hub-pillar a.bps-hub-link:hover{ color:var(--bps-clay); }
.bps-hub-section-head{ font-family:var(--wp--preset--font-family--sans); font-size:.72rem; text-transform:uppercase; letter-spacing:.14em; color:var(--bps-muted); font-weight:700; border-bottom:1px solid var(--bps-line); padding-bottom:.6rem; margin:2rem 0 1.4rem; }