/* MarginStay blog. Loaded after styles.css, so the header, footer, buttons and .ha graphics come from there. */

.blog-main { padding-block: clamp(1.25rem, 3.5vh, 2.5rem) var(--sec-pad); overflow-x: clip; }

/* Breadcrumbs */
.crumbs { display: flex; flex-wrap: wrap; gap: .3rem .5rem; margin-bottom: clamp(1rem, 3vh, 1.8rem); font-size: .9rem; color: var(--muted); }
.crumbs li { display: inline-flex; align-items: center; gap: .5rem; }
.crumbs li + li::before { content: "/"; color: var(--rule); }
.crumbs a { text-decoration: none; transition: color .3s; }
.crumbs a:hover { color: var(--gold-ink); }

/* Article header */
.post-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 1rem 3rem; padding-bottom: clamp(1.5rem, 4vh, 2.5rem); border-bottom: 1px solid var(--ink); margin-bottom: clamp(1.5rem, 4vh, 2.75rem); }
.post-head .head-text { gap: .7rem; }
.post-head:not(:has(.ha)) { grid-template-columns: minmax(0, 1fr); }
.blog-hero:not(:has(.ha)) { grid-template-columns: minmax(0, 1fr); }
.kicker { color: var(--gold-ink); font-weight: 500; font-size: .92rem; letter-spacing: .01em; }
.post-head h1, .blog-hero h1 { font-size: clamp(1.9rem, 3.1rem, 8vw); line-height: 1.08; max-width: 24ch; }
.byline { display: flex; flex-wrap: wrap; gap: .25rem 0; color: var(--muted); font-size: .95rem; }
.byline .grp { display: flex; flex-wrap: nowrap; }
.byline .grp > span + span, .byline .grp + .grp { margin-left: .9rem; padding-left: .9rem; border-left: 1px solid rgba(95, 99, 103, .4); }
@media (max-width: 620px) {
  .byline .grp + .grp { flex-basis: 100%; margin-left: 0; padding-left: 0; border-left: 0; flex-direction: column; gap: .2rem; }
  .byline .grp + .grp > span + span { margin-left: 0; padding-left: 0; border-left: 0; }
}
.byline b { font-weight: 500; color: var(--ink); }

/* Layout: article plus a sticky side column on laptops, so the width is used */
.post-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem 4rem; }
@media (min-width: 1024px) {
  .post-layout { grid-template-columns: minmax(0, 50rem) minmax(15rem, 22rem); justify-content: space-between; align-items: start; }
  .post-aside { position: sticky; top: calc(var(--header-h) + 1.5rem); }
}
.post-aside { display: flex; flex-direction: column; gap: 1.2rem; }
.toc, .side-cta { border: 1px solid var(--rule); background: var(--cell); padding: 1.1rem 1.2rem; }
.toc h2 { font-size: .95rem; font-weight: 500; letter-spacing: 0; color: var(--muted); margin-bottom: .7rem; }
.toc li + li { margin-top: .5rem; }
.toc a { text-decoration: none; font-size: .98rem; line-height: 1.35; display: block; transition: color .3s; }
.toc a:hover { color: var(--gold-ink); }
.side-cta { border-color: var(--ink); }
.side-cta p { font-size: 1.05rem; line-height: 1.4; margin-bottom: 1rem; }
.side-cta .btn { width: 100%; }
/* below laptop width the article ends with its own call to action, so the side column is hidden */
@media (max-width: 1023px) { .post-aside { display: none; } }

/* Article body */
.prose > * + * { margin-top: 1.15rem; }
.prose p, .prose li { font-size: 1.1rem; line-height: 1.72; }
.prose h2 { font-size: clamp(1.5rem, 2rem, 6vw); line-height: 1.15; margin-top: 2.6rem; scroll-margin-top: calc(var(--header-h) + 1rem); }
.prose h3 { font-size: 1.28rem; font-weight: 500; letter-spacing: -0.02em; margin-top: 1.9rem; }
.prose h2 + *, .prose h3 + * { margin-top: .8rem; }
.prose a { text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 1.5px; text-underline-offset: .2em; transition: color .3s; }
.prose a:hover { color: var(--gold-ink); }
.prose a.btn { text-decoration: none; }
.prose a.btn-gold:hover { color: var(--gold-lit); }
.prose strong { font-weight: 500; }
.prose ul li, .prose ol li { position: relative; padding-left: 1.4rem; }
.prose ul li + li, .prose ol li + li { margin-top: .5rem; }
.prose ul li::before { content: ""; position: absolute; left: 0; top: .78em; width: .45rem; height: .45rem; background: var(--gold); }
.prose ol { counter-reset: n; }
.prose ol li { counter-increment: n; }
.prose ol li::before { content: counter(n); position: absolute; left: 0; top: 0; color: var(--gold-ink); font-weight: 500; }

.answer, .callout { border: 1px solid var(--rule); border-left: 3px solid var(--gold); background: var(--cell); padding: 1.1rem 1.3rem; }
.answer-label, .callout-label { display: block; margin-bottom: .4rem; color: var(--gold-ink); font-size: .85rem; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; }
.answer p, .callout p { font-size: 1.12rem; line-height: 1.6; }
.callout { border-left-color: var(--ink); }
.callout-label { color: var(--ink); }

.tbl { overflow-x: auto; border: 1px solid var(--rule); background: var(--cell); -webkit-overflow-scrolling: touch; }
.tbl table { width: 100%; border-collapse: collapse; min-width: 30rem; font-size: 1rem; }
.tbl th, .tbl td { padding: .75rem 1rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--rule); line-height: 1.45; }
.tbl thead th { background: var(--paper); font-weight: 500; border-bottom: 1px solid var(--ink); }
.tbl tbody tr:last-child td, .tbl tbody tr:last-child th { border-bottom: 0; }
.tbl tbody th { font-weight: 500; }
.tbl .hl { background: #F5E6B8; }
.tbl-note { font-size: .9rem; color: var(--muted); margin-top: .5rem !important; }

/* A paragraph, example or callout beside a small graphic (optional, see guide section 14) */
.with-art { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1.2rem 2.5rem; }
.with-art .ha { width: clamp(8rem, 13vw, 12rem); }
@media (max-width: 620px) { .with-art { grid-template-columns: minmax(0, 1fr); } .with-art .ha { order: -1; width: 8rem; justify-self: center; } }

/* FAQ */
.post-faq { margin-top: 2.6rem; }
.post-faq > h2 { margin-top: 0; margin-bottom: 1rem; }
.post-faq details { border-bottom: 1px solid var(--rule); }
.post-faq details:first-of-type { border-top: 1px solid var(--ink); }
.post-faq summary { list-style: none; cursor: pointer; padding: 1rem 0; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; font-size: 1.15rem; letter-spacing: -0.02em; transition: color .3s; }
.post-faq summary::-webkit-details-marker { display: none; }
.post-faq summary::after { content: ""; flex: none; width: 14px; height: 14px; background: linear-gradient(var(--ink), var(--ink)) center / 100% 1.5px no-repeat, linear-gradient(var(--ink), var(--ink)) center / 1.5px 100% no-repeat; transition: transform .5s var(--ease); }
.post-faq details[open] summary::after { transform: rotate(135deg); }
.post-faq summary:hover { color: var(--gold-ink); }
.post-faq details p { color: var(--muted); padding: 0 2rem 1.3rem 0; font-size: 1.05rem; }

/* Closing CTA and sources */
.post-cta { margin-top: 2.6rem; padding: clamp(1.4rem, 3vw, 2.2rem); display: flex; flex-direction: column; align-items: flex-start; gap: .9rem; }
.post-cta h2 { font-size: clamp(1.5rem, 2rem, 6vw); margin: 0; color: #F2F0EB; }
.post-cta p { color: var(--dark-muted); font-size: 1.08rem; max-width: 46ch; }
.post-cta .actions { margin-top: .4rem; }
.post-cta .btn-line { color: #F2F0EB; border-color: #F2F0EB; }
.post-cta .btn-line:hover { background: #F2F0EB; color: var(--ink); }
.sources { margin-top: 2.4rem; padding-top: 1.2rem; border-top: 1px solid var(--rule); }
.sources h2 { font-size: 1.1rem; font-weight: 500; letter-spacing: 0; margin: 0 0 .6rem; }
.sources li { font-size: .95rem; line-height: 1.5; color: var(--muted); }
.sources li + li { margin-top: .35rem; }
.sources a { color: var(--ink); text-underline-offset: .2em; }
.page-prose { max-width: 50rem; }
.related { margin-top: 2.4rem; padding-top: 1.2rem; border-top: 1px solid var(--rule); }
.related h2 { font-size: 1.1rem; font-weight: 500; letter-spacing: 0; margin: 0 0 .7rem; }
.related li + li { margin-top: .5rem; }
.related a { font-size: 1.05rem; }
.disclosure { font-size: .95rem; color: var(--muted); margin-top: 1.6rem; }

/* Blog index */
.blog-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 1rem 3rem; padding-bottom: clamp(1.5rem, 4vh, 2.5rem); border-bottom: 1px solid var(--ink); }
.blog-hero p { color: var(--muted); max-width: 56ch; font-size: 1.1rem; margin-top: .8rem; }
.post-list { display: grid; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1024px) { .post-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(2rem, 4vw, 4rem); } }
.post-card { padding-block: 1.5rem; border-bottom: 1px solid var(--rule); display: flex; flex-direction: column; gap: .5rem; }
.post-card h2 { font-size: clamp(1.35rem, 1.6rem, 6vw); line-height: 1.2; }
.post-card h2 a { text-decoration: none; transition: color .3s; }
.post-card h2 a:hover { color: var(--gold-ink); }
.post-card p { color: var(--muted); max-width: 60ch; }
.post-card .meta { font-size: .9rem; color: var(--muted); }
.empty { padding-block: clamp(2rem, 6vh, 4rem); max-width: 48ch; }
.empty p { color: var(--muted); font-size: 1.1rem; margin-bottom: 1.2rem; }

/* Phones and small tablets */
@media (max-width: 1000px) {
  .post-head, .blog-hero { grid-template-columns: minmax(0, 1fr); gap: 1.1rem; }
  .post-head .ha, .blog-hero .ha { width: 9.5rem; justify-self: start; order: -1; }
}
@media (max-width: 620px) {
  /* tables shrink to fit the screen instead of scrolling sideways */
  .tbl table { min-width: 0; font-size: .86rem; }
  .tbl th, .tbl td { padding: .6rem .5rem; }
  .prose p, .prose li { font-size: 1.05rem; }
  .post-cta .actions .btn { flex: 1 1 auto; }
}

/* Reveal on scroll, same motion as the home page. blog.js adds .is-in as elements come into view. */
.js .crumbs, .js .post-head .kicker, .js .post-head .byline, .js .blog-hero p, .js .blog-hero .ha,
.js .prose > *, .js .post-aside > *, .js .post-card, .js .empty {
  opacity: 0; transform: translateY(1.8rem);
  transition: opacity 1s var(--ease), transform 1s var(--ease); transition-delay: var(--d, 0ms);
}
.js .post-head h1, .js .blog-hero h1 {
  clip-path: inset(0 0 100% 0); transform: translateY(.45em);
  transition: clip-path 1.2s var(--ease), transform 1.2s var(--ease); transition-delay: var(--d, 0ms);
}
/* raised specificity so it beats the starting rules above, which also carry a class or element name */
.js .is-in.is-in.is-in { opacity: 1; transform: none; }
.js .post-head h1.is-in.is-in, .js .blog-hero h1.is-in.is-in { clip-path: inset(0 0 -0.2em 0); }
.post-faq details { overflow: hidden; }
.post-faq details.closing summary::after { transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js .crumbs, .js .post-head .kicker, .js .post-head .byline, .js .blog-hero p, .js .blog-hero .ha,
  .js .prose > *, .js .post-aside > *, .js .post-card, .js .empty, .js .post-head h1, .js .blog-hero h1 {
    opacity: 1; transform: none; clip-path: none; transition: none;
  }
}
