/* Blog detail layout. Every rule is scoped under .bd so header.php / footer.php are not affected. */
.bd{
  --navy:#0a1230;--blue:#3b6bf0;--violet:#7b5cf0;--ink:#101426;--muted:#5b6178;--line:#e3e7f2;--mist:#f4f6fb;--sky:#eef3ff;--lilac:#f2eeff;
  --grad:linear-gradient(90deg,#3b6bf0,#7b5cf0);
  /* Space reserved for the site header. Raise these two values if the header is taller on your site. */
  --hdr:92px;
  --side-top:84px; /* distance from the top of the window where the sticky sidebar sits; lower it if there is a gap under your header */
  --gutter:clamp(16px,4vw,28px);
  background:#fff;color:var(--ink);line-height:1.6;font-size:16px;
  -webkit-text-size-adjust:100%;text-size-adjust:100%;overflow-x:clip;
}
@media(max-width:640px){.bd{--hdr:76px}}
.bd *,.bd *::before,.bd *::after{box-sizing:border-box}
.bd h1,.bd h2,.bd h3{font-weight:800;letter-spacing:-.02em;line-height:1.15;margin:0 0 .4em;overflow-wrap:anywhere}
.bd a{color:inherit;text-decoration:none}
.bd img,.bd svg,.bd video{max-width:100%;height:auto}
.bd .wrap{max-width:1160px;margin:0 auto;padding:0 var(--gutter)}
.bd .btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;padding:13px 22px;min-height:46px;border-radius:8px;font-weight:700;font-size:15px;line-height:1.2;text-align:center;border:0;cursor:pointer;font-family:inherit}
.bd .btn-sun{background:var(--navy);color:#fff}.bd .btn-sun:hover{background:#16205a}
.bd .btn:focus-visible,.bd a:focus-visible,.bd summary:focus-visible,.bd .share button:focus-visible{outline:3px solid var(--blue);outline-offset:2px}

/* hero (top padding clears the fixed/sticky site header) */
.bd .ahero{background:#fff;color:var(--ink);padding:calc(var(--hdr) + clamp(20px,4vw,44px)) 0 8px}
.bd .crumb{font-size:13px;color:var(--muted);margin-bottom:14px;line-height:1.7}.bd .crumb a{color:var(--muted)}.bd .crumb a:hover{color:var(--navy)}.bd .crumb span{margin:0 6px;opacity:.6}
.bd .ctag{display:inline-block;font-size:11.5px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--blue)}
.bd .ahero h1{font-size:clamp(26px,4.4vw,46px);max-width:860px;margin:10px 0 12px;color:var(--navy);text-wrap:balance}
.bd .ahero .sub{color:var(--muted);font-size:clamp(16px,1.8vw,18px);max-width:760px;margin:0 0 18px}
.bd .byline{display:flex;align-items:center;gap:12px;font-size:14px;color:var(--muted);flex-wrap:wrap;max-width:780px;border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:14px 0;margin-top:6px}
.bd .byline b{color:var(--navy)}
.bd .byline .av{flex-shrink:0;width:40px;height:40px;border-radius:50%;background:var(--sky);color:var(--blue);display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:800}
.bd .tags{display:flex;gap:8px;flex-wrap:wrap;margin-top:16px}.bd .tags span{border:1px solid var(--line);border-radius:999px;padding:4px 12px;font-size:13px;font-weight:600;color:#3a3f5c}
.bd .abanner{margin:22px 0 0;border-radius:16px;overflow:hidden;border:1px solid var(--line);background:var(--mist);aspect-ratio:1200/460;line-height:0}
.bd .abanner img{width:100%;height:100%;object-fit:cover;display:block}

/* article layout */
.bd .alayout > *{min-width:0}
.bd .alayout{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:clamp(24px,4vw,40px);padding:clamp(24px,4vw,40px) var(--gutter);max-width:1160px;margin:0 auto}
.bd .article{min-width:0;font-size:17px;line-height:1.75;color:#24283d;overflow-wrap:break-word;word-wrap:break-word}
.bd .article h2{font-size:clamp(23px,3vw,28px);color:var(--navy);margin:38px 0 12px;scroll-margin-top:calc(var(--hdr) + 12px)}
.bd .article h3{font-size:clamp(18px,2.4vw,21px);color:var(--navy);margin:26px 0 8px;scroll-margin-top:calc(var(--hdr) + 12px)}
.bd .article > h2:first-child{margin-top:0}
.bd .article p{margin:0 0 16px}
.bd .article ul,.bd .article ol{margin:0 0 18px;padding-left:22px}.bd .article li{margin-bottom:6px}
.bd .article a:not(.btn){color:var(--blue);text-decoration:underline;text-underline-offset:2px;overflow-wrap:anywhere}
.bd .article td b,.bd .article li b{color:var(--navy)}
.bd .answer{background:#fff;border:1px solid var(--line);border-left:3px solid var(--navy);border-radius:10px;padding:16px 18px;margin:0 0 24px}
.bd .answer b{display:block;color:var(--navy);margin-bottom:4px;font-size:15px;text-transform:uppercase;letter-spacing:.05em}
.bd .takeaways{background:var(--mist);border-radius:12px;padding:18px 20px;margin:0 0 24px}.bd .takeaways b{color:var(--navy)}
.bd .takeaways ul{margin:8px 0 0}

/* tables: keep readable and scroll sideways inside their own box on small screens */
.bd .tablewrap{overflow-x:auto;-webkit-overflow-scrolling:touch;margin:0 0 20px;border-radius:8px;max-width:100%}
.bd .article table{width:100%;border-collapse:collapse;margin:0 0 20px;font-size:15.5px}
.bd .tablewrap table{margin:0;min-width:540px}
.bd .article th,.bd .article td{border:1px solid var(--line);padding:10px 12px;text-align:left;vertical-align:top}
.bd .article th{background:var(--mist);color:var(--navy)}
.bd .article table.weeks td{font-size:14.5px;vertical-align:top}
.bd .article table.weeks tr.ph td{background:var(--sky);color:var(--navy);font-weight:700;font-size:13px;letter-spacing:.06em;text-transform:uppercase}
.bd .note-src{font-size:15px;color:var(--muted);background:var(--mist);border-radius:10px;padding:12px 14px}
.bd .article ul.checks{list-style:none;padding-left:0}
.bd .article ul.checks li{position:relative;padding-left:32px}
.bd .article ul.checks li:before{content:"✓";position:absolute;left:0;top:3px;width:22px;height:22px;border-radius:50%;background:var(--sky);color:var(--blue);font-weight:800;font-size:12px;display:flex;align-items:center;justify-content:center}
.bd .stepper{list-style:none;padding:0;margin:0 0 20px;counter-reset:s}
.bd .article .stepper li{position:relative;padding:0 0 18px 56px;margin:0;counter-increment:s}
.bd .stepper li:before{content:counter(s);position:absolute;left:0;top:0;width:38px;height:38px;border-radius:10px;background:var(--grad);color:#fff;font-weight:800;display:flex;align-items:center;justify-content:center}
.bd .stepper h3{margin:0 0 4px;font-size:19px}.bd .stepper p{margin:0}
.bd .inline-cta{display:flex;gap:16px;align-items:center;justify-content:space-between;flex-wrap:wrap;background:#fff;border:1px solid var(--line);border-radius:12px;padding:18px 20px;margin:26px 0}
.bd .inline-cta > div{flex:1 1 260px;min-width:0}
.bd .inline-cta b{color:var(--navy);display:block}.bd .inline-cta span{color:var(--muted);font-size:15px}
.bd .article .inline-cta a.btn{color:#fff;flex:0 0 auto}

/* faq */
.bd .article details{background:#fff;border:1px solid var(--line);border-radius:10px;padding:16px 20px;margin-bottom:10px}
.bd .article summary{font-weight:700;cursor:pointer;list-style:none;display:flex;justify-content:space-between;align-items:flex-start;gap:12px;color:var(--navy)}
.bd .article summary::-webkit-details-marker{display:none}
.bd .article summary:after{content:"+";font-size:22px;color:var(--blue);line-height:1;flex-shrink:0}
.bd .article details[open] summary:after{content:"–"}
.bd .article details p{margin:10px 0 0;color:var(--muted)}

/* planner form */
.bd .planner{display:grid;grid-template-columns:1fr 1fr;gap:24px;align-items:center;background:var(--mist);border:1px solid var(--line);border-radius:16px;padding:28px;margin:34px 0 10px}
.bd .planner > div,.bd .planner form{min-width:0}
.bd .planner h2{margin:6px 0 8px;font-size:clamp(21px,2.6vw,26px)}.bd .planner>div>b{font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--blue)}
.bd .planner p{margin:0;color:var(--muted);font-size:15.5px}
.bd .planner form{background:#fff;border:1px solid var(--line);border-radius:12px;padding:18px}
.bd .planner label{display:block;font-size:13px;font-weight:600;margin:8px 0 4px;color:#2b3050}
.bd .planner input:not([type=checkbox]){width:100%;height:46px;padding:0 12px;border:1.5px solid #dfe3ef;border-radius:8px;font:inherit;font-size:16px;background:#fff} /* 16px stops iOS zooming on focus */
.bd .planner input:focus{outline:none;border-color:var(--blue)}
.bd .planner .phone{display:flex}
.bd .planner .phone span{padding:0 12px;display:flex;align-items:center;height:46px;border:1.5px solid #dfe3ef;border-right:0;border-radius:8px 0 0 8px;background:#f6f7fb;font-weight:600}
.bd .planner .phone input{border-radius:0 8px 8px 0;min-width:0}
.bd .planner .consent{display:flex;gap:8px;align-items:flex-start;font-weight:500;font-size:12.5px;color:var(--muted);margin-top:12px}
.bd .planner .consent input{margin-top:3px;flex-shrink:0}
.bd .planner .btn{width:100%;margin-top:12px}.bd .planner .ok{color:var(--navy);font-weight:600;margin:0}

/* author + share */
.bd .author{display:flex;gap:16px;background:#fff;border:1px solid var(--line);border-radius:12px;padding:20px;margin-top:30px}
.bd .author .av{flex-shrink:0;width:72px;height:72px;border-radius:50%;background:var(--sky);display:flex;align-items:center;justify-content:center;color:var(--muted);font-size:11px;text-align:center}
.bd .author b{color:var(--navy);font-size:17px}.bd .author p{margin:4px 0 0;font-size:15px;color:var(--muted)}
.bd .share{display:flex;gap:8px;flex-wrap:wrap;margin-top:18px}
.bd .share a,.bd .share button{border:1px solid var(--line);border-radius:8px;padding:8px 12px;font:inherit;font-size:13px;color:var(--muted);background:#fff;cursor:pointer}
.bd .share a:hover,.bd .share button:hover{border-color:var(--navy);color:var(--navy)}

/* sidebar (sticky below the header on desktop, normal flow on tablet/mobile) */
.bd .side{position:static;align-self:start;display:grid;grid-template-columns:minmax(0,1fr);gap:16px;width:100%;min-width:0;max-width:100%}
.bd aside.side{margin:0;padding:0;border:0;background:transparent;box-shadow:none;border-radius:0;transform:none;left:auto;right:auto;float:none;overflow:visible;box-sizing:border-box}
.bd aside.side > *{min-width:0;max-width:100%;width:100%;margin:0;box-sizing:border-box}
.bd .toc{padding:0 0 0 2px}
.bd .toc b{display:block;color:var(--navy);margin-bottom:8px}
.bd .toc a{display:block;overflow-wrap:anywhere;color:var(--muted);font-size:14.5px;padding:5px 0 5px 10px;border-left:2px solid var(--line)}
.bd .toc a:hover{color:var(--blue);border-color:var(--blue)}
.bd .sidecta{background:var(--navy);color:#fff;border-radius:12px;padding:18px;overflow-wrap:anywhere}
.bd .sidecta b{display:block;font-size:18px;margin-bottom:6px}
.bd .sidecta p{color:#c9d0ec;font-size:14.5px;margin:0 0 14px}
.bd .sidecta .btn{width:100%;background:#fff;color:var(--navy)}

/* DESKTOP: sidebar is always sticky and exactly as tall as the visible area under the header.
   Row 1 = the links list (scrolls inside), remaining rows = the blue box(es), pinned at the bottom. */
@media(min-width:981px){
  .bd aside.side{
    position:sticky;top:var(--side-top);align-self:start;
    display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr);grid-auto-rows:auto;gap:16px;
    height:calc(100vh - var(--side-top) - 16px);height:calc(100dvh - var(--side-top) - 16px)}
  .bd aside.side .toc{min-height:0;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#c9d3f2 transparent;padding:0 6px 0 2px}
  .bd aside.side .toc b{position:sticky;top:0;z-index:1;background:#fff;padding-bottom:8px;margin-bottom:0}
}
/* short desktop windows: keep only the last blue box and tighten it so the links still get room */
@media(min-width:981px) and (max-height:760px){
  .bd aside.side .sidecta:not(:last-child){display:none}
  .bd aside.side .sidecta{padding:14px}
  .bd aside.side .sidecta b{font-size:16px}
  .bd aside.side .sidecta p{font-size:13.5px;margin-bottom:10px}
}

/* related guides */
.bd section.alt{background:#fff;border-top:1px solid var(--line);padding:clamp(36px,6vw,56px) 0}
.bd .head{text-align:center;max-width:980px;margin:0 auto 34px;padding:0 var(--gutter)}
.bd .head h2{font-size:clamp(24px,3.2vw,36px);color:var(--navy)}
.bd .kicker{font-size:13px;font-weight:700;letter-spacing:.08em;color:var(--muted);text-transform:uppercase;margin-bottom:6px}
.bd .bgrid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px}
.bd .post{display:flex;flex-direction:column;background:#fff;border:1px solid var(--line);border-radius:14px;overflow:hidden;min-width:0}
.bd .post:hover{border-color:#c9d3f2}
.bd .post .thumb{height:130px;display:flex;align-items:center;justify-content:center}
.bd .post .pb{padding:18px;display:flex;flex-direction:column;flex:1}
.bd .post h3{font-size:18px;color:var(--navy);margin:10px 0 8px;line-height:1.3}
.bd .post p{color:var(--muted);font-size:14.5px;margin:0 0 14px;flex:1}
.bd .post .ctag{align-self:flex-start}
.bd .post .meta{font-size:13px;color:var(--muted)}

/* large screens */
@media(min-width:1400px){.bd .wrap,.bd .alayout{max-width:1240px}}

/* tablet */
@media(max-width:980px){
  .bd .alayout{grid-template-columns:minmax(0,1fr)}
  .bd .side{grid-template-columns:repeat(2,minmax(0,1fr));align-items:start}
  .bd .side .toc{grid-column:1/-1;background:var(--mist);border-radius:12px;padding:16px 18px}
  .bd .bgrid{grid-template-columns:1fr 1fr}
}
@media(max-width:780px){
  .bd .planner{grid-template-columns:1fr;padding:20px}
  .bd .side{grid-template-columns:minmax(0,1fr)}
}

/* phone */
@media(max-width:640px){
  .bd .article{font-size:16px;line-height:1.7}
  .bd .article h2{margin-top:30px}
  .bd .bgrid{grid-template-columns:1fr}
  .bd .author{flex-direction:column}
  .bd .answer,.bd .takeaways{padding:14px 16px}
  .bd .inline-cta{padding:16px}
  .bd .inline-cta .btn{width:100%}
  .bd .article table{font-size:14.5px}
  .bd .article th,.bd .article td{padding:8px 10px}
  .bd .article .stepper li{padding-left:50px}
  .bd .share a,.bd .share button{flex:1 1 auto;text-align:center}
  .bd .byline{font-size:13.5px}
}
@media(max-width:380px){
  .bd .ahero h1{font-size:25px}
  .bd .btn{padding:12px 16px}
}

/* landscape phones: don't let the header eat the screen */
@media(max-height:480px) and (orientation:landscape){.bd{--hdr:64px}}

/* respect users who prefer less motion */
@media(prefers-reduced-motion:reduce){.bd *{scroll-behavior:auto!important;transition:none!important;animation:none!important}}

/* printing */
@media print{
  .bd .side,.bd .share,.bd .inline-cta,.bd .planner,.bd section.alt{display:none}
  .bd .alayout{display:block}
  .bd .ahero{padding-top:0}
}