/* ==========================================================================
   Global Website Agency: blog detail page (single post)
   Loaded only on single blog posts, after style.css, so it can use its tokens
   (--navy, --blue-strong, --tint, --line, --radius, --header-h ...).

   Layout classes (used by single.php, do not add them to posts):
     .blog-hero  .blog-layout  .blog-main  .blog-aside  .blog-progress
     .blog-author  .blog-endnav

   Content classes (paste into the post, in the Code tab):
     .gwa-summary    short answer box           .gwa-takeaways  key points list
     .gwa-callout    tip / warning / note        .gwa-steps      numbered process
     .gwa-checklist  ticked list                 .gwa-redflags   red-flag list
     .gwa-proscons   pros and cons               .gwa-compare    side-by-side cards
     .gwa-table      responsive table wrapper    .gwa-stats      number highlights
     .gwa-cards      link cards                  .gwa-cta        inline call to action
     .gwa-faq        question and answer list    .gwa-quote      pull quote
   See blog-snippets.html for copy-paste markup.
   ========================================================================== */

/* ---------- 1. Reading progress bar (CSS only, progressive enhancement) ---------- */
.blog-progress { position: fixed; inset: 0 0 auto 0; height: 4px; z-index: 60; background: transparent; pointer-events: none; }
.blog-progress::after { content: ""; display: block; height: 100%; background: var(--blue-strong); transform-origin: 0 50%; transform: scaleX(0); }
@supports (animation-timeline: scroll()) {
  .blog-progress::after { animation: blog-progress linear both; animation-timeline: scroll(root block); }
  @keyframes blog-progress { to { transform: scaleX(1); } }
}

/* ---------- 2. Hero ---------- */
.blog-hero { padding-block: clamp(2rem, 5vw, 3.75rem) clamp(1.5rem, 4vw, 2.5rem); background: linear-gradient(180deg, var(--tint), #fff); border-bottom: 1px solid var(--line); }
.blog-hero h1 { font-size: clamp(1.9rem, 1.2rem + 3.2vw, 3rem); margin-bottom: .45em; text-wrap: balance; }
.blog-cat { display: inline-block; margin: 0 0 1rem; padding: .3rem .85rem; border-radius: 999px; background: var(--blue-soft); color: var(--blue-dark); font-size: .875rem; font-weight: 650; text-decoration: none; }
.blog-cat:hover { background: var(--blue-strong); color: #fff; }
.blog-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem 1rem; margin: 0; padding: 0; list-style: none; font-size: .95rem; color: var(--muted); }
.blog-meta li { display: inline-flex; align-items: center; gap: .4rem; margin: 0; }
.blog-meta a { color: var(--navy); font-weight: 650; text-decoration: none; }
.blog-meta a:hover { text-decoration: underline; }
.blog-meta li + li::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: #9fb0c8; margin-right: .6rem; }
.blog-avatar { display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--navy); color: #fff; font-size: .8rem; font-weight: 750; letter-spacing: .02em; flex: none; }

/* ---------- 3. Layout ---------- */
.blog-body { padding-block: clamp(1.75rem, 5vw, 3.5rem) clamp(3rem, 7vw, 5rem); }
.blog-layout { display: grid; gap: 1.5rem clamp(2rem, 4vw, 3.5rem); align-items: start; }
.blog-main { min-width: 0; }
.blog-figure { margin: 0 0 2rem; }
.blog-figure img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--radius-lg); border: 1px solid var(--line); }
@media (min-width: 1040px) {
  .blog-layout { grid-template-columns: minmax(0, 1fr) 320px; }
  .blog-main { grid-column: 1; grid-row: 1; }
  .blog-aside { grid-column: 2; grid-row: 1; position: sticky; top: calc(var(--header-h) + 1.25rem); max-height: calc(100vh - var(--header-h) - 2rem); overflow-y: auto; overscroll-behavior: contain; padding-bottom: .25rem; }
}

/* ---------- 4. Sidebar: table of contents + CTA ---------- */
.blog-aside .toc { margin: 0 0 1.25rem; padding: 0; }
.toc__details { padding: 0; }
.toc__summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 48px; padding: .75rem 1.1rem; cursor: pointer; list-style: none; font-size: .8rem; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.toc__summary::-webkit-details-marker { display: none; }
.toc__summary::after { content: ""; width: .6rem; height: .6rem; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s; margin-right: .2rem; }
.toc__details[open] .toc__summary::after { transform: rotate(-135deg); }
.toc--blog ol { padding: 0 1.1rem 1rem; max-height: 22rem; overflow-y: auto; }
.toc--blog a { padding: .4rem 0 .4rem .75rem; border-left: 3px solid transparent; font-size: .96rem; line-height: 1.35; }
.toc--blog a:hover { text-decoration: none; border-left-color: #b9d4ff; }
.toc--blog a[aria-current="true"] { border-left-color: var(--blue-strong); color: var(--blue-strong); }
.toc--blog .toc__l3 a { padding-left: 1.5rem; font-size: .92rem; }
.blog-side-cta { padding: 1.4rem; border-radius: var(--radius); background: var(--navy) radial-gradient(18rem 10rem at 100% 0, rgba(1, 114, 254, .5), transparent 70%); color: #fff; }
.blog-side-cta h2 { margin: 0 0 .4em; font-size: 2rem; color: #fff; letter-spacing: -.01em; }
.blog-side-cta p { margin: 0 0 1rem; color: #c9d4e8; font-size: .98rem; }
.blog-side-cta .btn { width: 100%; }
.blog-side-cta .text-link { display: inline-block; margin-top: .85rem; color: #fff; font-weight: 650; }
@media (max-width: 1039.98px) { .blog-side-cta { display: none; } }

/* ---------- 5. Article typography (applies to every post, even without classes) ---------- */
.blog-content { font-size: clamp(1.0625rem, 1rem + .2vw, 1.15rem);}
.blog-content > * + * { margin-top: 1.15em; }
.blog-content h2 { margin: 2.2em 0 .6em; font-size: clamp(1.5rem, 1.2rem + 1.1vw, 2rem); padding-top: .2em; }
.blog-content h3 { margin: 1.8em 0 .5em; font-size: clamp(1.18rem, 1.08rem + .45vw, 1.4rem); }
.blog-content > h2:first-child, .blog-content > .gwa-summary + h2 { margin-top: 1.6em; }
.blog-content p, .blog-content li { overflow-wrap: anywhere; hyphens: auto; }
.blog-content ul, .blog-content ol { padding-left: 1.35em; }
.blog-content li { margin: .4em 0; padding-left: .2em; }
.blog-content li::marker { color: var(--blue-strong); font-weight: 700; }
.blog-content a { font-weight: 600; text-decoration-thickness: 1px; }
.blog-content img, .blog-content figure img { border-radius: var(--radius); }
.blog-content figure { margin-inline: 0; }
.blog-content figcaption { margin-top: .6rem; font-size: .92rem; color: var(--muted); }
.blog-content hr { margin: 2.5rem 0; }
.blog-content mark { background: #fff3c4; color: var(--ink); padding: .05em .25em; border-radius: 4px; }
.blog-content h2[id], .blog-content h3[id] { scroll-margin-top: calc(var(--header-h) + 1.25rem); }

/* Plain tables (no wrapper) scroll sideways on small screens instead of breaking the layout */
.blog-content table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .98rem; line-height: 1.5; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.blog-content th, .blog-content td { padding: .8rem 1rem; border: 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.blog-content tr:last-child td { border-bottom: 0; }
.blog-content th { background: var(--tint); color: var(--navy); font-weight: 700; }
.blog-content tbody tr:nth-child(even) td { background: #fafcff; }
.blog-content td:first-child { font-weight: 650; color: var(--navy); }
@media (max-width: 720px) {
  .blog-content table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: normal; }
  .blog-content th, .blog-content td { min-width: 9.5rem; }
}

/* ---------- 6. Components: summary, takeaways, callouts ---------- */
.gwa-summary { padding: 1.25rem 1.4rem; border: 1px solid #b9d4ff; border-left: 6px solid var(--blue-strong); border-radius: var(--radius); background: var(--blue-soft); }
.gwa-summary__label { display: block; margin: 0 0 .35rem; font-size: .8rem; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; color: var(--blue-dark); }
.gwa-summary p:last-child { margin-bottom: 0; }
.gwa-summary p { color: var(--ink); font-size: 1.08em; }

.gwa-takeaways { padding: 1.4rem 1.5rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--tint); }
.gwa-takeaways__title { margin: 0 0 .7rem !important; font-size: 1.1rem !important; letter-spacing: -.01em; }
.gwa-takeaways ul { margin: 0; padding: 0; list-style: none; }
.gwa-takeaways li { position: relative; margin: .55rem 0; padding-left: 1.9rem; }
.gwa-takeaways li::before { content: ""; position: absolute; left: 0; top: .35em; width: 1.15rem; height: 1.15rem; border-radius: 50%; background: var(--blue-strong) no-repeat center / .7rem url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E"); }

.gwa-callout { position: relative; padding: 1.1rem 1.3rem 1.1rem 1.3rem; border: 1px solid var(--line); border-left-width: 6px; border-radius: var(--radius); background: #fff; }
.gwa-callout__title { display: block; margin: 0 0 .25rem; font-weight: 750; color: var(--navy); }
.gwa-callout p:last-child, .gwa-callout ul:last-child { margin-bottom: 0; }
.gwa-callout--tip  { border-left-color: #12805c; background: #effaf5; }
.gwa-callout--tip .gwa-callout__title { color: #0b6246; }
.gwa-callout--warn { border-left-color: #b7791f; background: #fff8ea; }
.gwa-callout--warn .gwa-callout__title { color: #8a5a10; }
.gwa-callout--note { border-left-color: var(--blue-strong); background: var(--tint); }

/* ---------- 7. Components: steps, checklist, red flags ---------- */
.gwa-steps { list-style: none; margin: 0; padding: 0; counter-reset: gwa-step; }
.gwa-steps > li { position: relative; margin: 0; padding: 0 0 1.5rem 3.4rem; counter-increment: gwa-step; }
.gwa-steps > li::before { content: counter(gwa-step); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 750; font-size: 1rem; }
.gwa-steps > li::after { content: ""; position: absolute; left: 1.15rem; top: 2.6rem; bottom: .2rem; width: 2px; background: var(--line); }
.gwa-steps > li:last-child { padding-bottom: 0; }
.gwa-steps > li:last-child::after { display: none; }
.gwa-steps strong:first-child { display: block; color: var(--navy); font-size: 1.08em; margin-bottom: .15rem; }

.gwa-checklist, .gwa-redflags { list-style: none; margin: 0; padding: 0; }
.gwa-checklist li, .gwa-redflags li { position: relative; margin: .55rem 0; padding: .7rem 1rem .7rem 2.9rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.gwa-checklist li::before, .gwa-redflags li::before { content: ""; position: absolute; left: .9rem; top: .95rem; width: 1.25rem; height: 1.25rem; border-radius: 6px; background-repeat: no-repeat; background-position: center; background-size: .8rem; }
.gwa-checklist li::before { background-color: var(--blue-strong); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E"); }
.gwa-redflags li { border-color: #f0cccc; background: #fff7f7; }
.gwa-redflags li::before { background-color: #b42318; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round'%3E%3Cpath d='M12 6v7M12 18v.5'/%3E%3C/svg%3E"); }
.gwa-checklist strong, .gwa-redflags strong { color: var(--navy); }

/* ---------- 8. Components: pros/cons, compare, stats, cards ---------- */
.gwa-proscons, .gwa-compare { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .gwa-proscons, .gwa-compare { grid-template-columns: 1fr 1fr; } }
.gwa-proscons > div, .gwa-compare > div { padding: 1.25rem 1.35rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.gwa-proscons h3, .gwa-compare h3 { margin: 0 0 .6rem !important; font-size: 1.1rem !important; }
.gwa-proscons ul, .gwa-compare ul { margin: 0; padding-left: 1.2em; }
.gwa-proscons__pros { border-top: 5px solid #12805c !important; }
.gwa-proscons__cons { border-top: 5px solid #b42318 !important; }
.gwa-compare > div:first-child { border-top: 5px solid var(--blue-strong); }
.gwa-compare > div:last-child { border-top: 5px solid var(--navy); }
.gwa-compare__label { display: inline-block; margin: 0 0 .5rem; padding: .15rem .6rem; border-radius: 999px; background: var(--tint); color: var(--muted); font-size: .8rem; font-weight: 700; }

.gwa-stats { display: grid; gap: .85rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); margin: 0; padding: 0; list-style: none; }
.gwa-stats li { margin: 0; padding: 1.1rem 1.15rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--tint); text-align: left; }
.gwa-stats strong { display: block; color: var(--blue-strong); font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); line-height: 1.1; letter-spacing: -.02em; }
.gwa-stats span { display: block; margin-top: .3rem; font-size: .95rem; color: var(--muted); line-height: 1.4; }

.gwa-cards { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.gwa-cards a { display: block; padding: 1.1rem 1.2rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--navy); text-decoration: none; font-weight: 700; line-height: 1.35; transition: border-color .2s, box-shadow .2s, transform .2s; }
.gwa-cards a span { display: block; margin-top: .3rem; font-weight: 450; font-size: .95rem; color: var(--muted); }
.gwa-cards a:hover, .gwa-cards a:focus-visible { border-color: #b9d4ff; box-shadow: var(--shadow); transform: translateY(-2px); color: var(--blue-strong); }
img.blog-avatar { object-fit: cover; background: var(--tint); }
/* ---------- 9. Components: responsive table wrapper, quote, FAQ ---------- */
.gwa-table { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius); }
.gwa-table table { border: 0; border-radius: 0; display: table; min-width: 34rem; }
.gwa-table:focus-visible { outline: 3px solid var(--blue-strong); outline-offset: 2px; }
/* Optional stacked cards on phones: add class gwa-table--stack and data-label="Column name" to every td */
@media (max-width: 640px) {
  .gwa-table--stack { overflow: visible; border: 0; }
  .gwa-table--stack table { display: block; min-width: 0; border: 0; }
  .gwa-table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .gwa-table--stack tbody, .gwa-table--stack tr, .gwa-table--stack td { display: block; }
  .gwa-table--stack tr { margin-bottom: .9rem; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
  .gwa-table--stack td { min-width: 0; padding: .65rem 1rem; border-bottom: 1px solid var(--line); background: #fff !important; }
  .gwa-table--stack td:last-child { border-bottom: 0; }
  .gwa-table--stack td::before { content: attr(data-label); display: block; margin-bottom: .15rem; font-size: .78rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
  .gwa-table--stack td:first-child { background: var(--tint) !important; }
}

.gwa-quote { margin-inline: 0; padding: 1.2rem 1.4rem; border-left: 5px solid var(--blue-strong); border-radius: 0 var(--radius) var(--radius) 0; background: var(--tint); }
.gwa-quote p { margin: 0; color: var(--ink); font-size: 1.2em; line-height: 1.5; font-weight: 600; }
.gwa-quote cite { display: block; margin-top: .6rem; font-size: .92rem; font-style: normal; color: var(--muted); }

.gwa-faq details { border-bottom: 1px solid var(--line); }
.gwa-faq details:first-child { border-top: 1px solid var(--line); }
.gwa-faq summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 56px; padding: 1rem .25rem; cursor: pointer; list-style: none; color: var(--navy); font-weight: 700; font-size: 1.08em; line-height: 1.35; }
.gwa-faq summary::-webkit-details-marker { display: none; }
.gwa-faq summary::after { content: ""; flex: none; width: 1.4rem; height: 1.4rem; background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230166fe' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E"); transition: transform .2s; }
.gwa-faq details[open] summary::after { transform: rotate(45deg); }
.gwa-faq details > div { padding: 0 .25rem 1.2rem; color: var(--muted); }
.gwa-faq details > div p:last-child { margin-bottom: 0; }

/* ---------- 10. Inline call to action (convert readers mid-article) ---------- */
.gwa-cta { display: grid; gap: 1rem; align-items: center; padding: clamp(1.25rem, 3vw, 1.75rem); border-radius: var(--radius-lg); background: var(--navy) radial-gradient(24rem 12rem at 100% 0, rgba(1, 114, 254, .5), transparent 70%); color: #fff; }
.gwa-cta h3, .gwa-cta__title { margin: 0 0 .3em !important; color: #fff !important; font-size: clamp(1.2rem, 1.1rem + .5vw, 1.45rem) !important; }
.gwa-cta p { margin: 0; color: #c9d4e8; font-size: 1rem; }
.gwa-cta a:not(.btn) { color: #fff; }
.gwa-cta .btn, .blog-content .gwa-cta a.btn { justify-self: start; text-decoration: none; }
.blog-content .gwa-cta .btn--light, .blog-content .gwa-cta .btn--light:hover { color: var(--navy); }
.blog-content .gwa-cta .btn--primary { color: #fff; }
@media (min-width: 720px) { .gwa-cta { grid-template-columns: 1fr auto; } .gwa-cta .btn { justify-self: end; } }
.gwa-cta--soft { background: var(--blue-soft); color: var(--ink); border: 1px solid #b9d4ff; }
.gwa-cta--soft h3, .gwa-cta--soft .gwa-cta__title { color: var(--navy) !important; }
.gwa-cta--soft p { color: var(--text); }

/* ---------- 11. End of article: tags, author, next/previous ---------- */
.blog-tags { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 2.25rem 0 0; padding: 0; list-style: none;  }
.blog-tags li { margin: 0; }
.blog-tags a { display: inline-block; padding: .3rem .8rem; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); font-size: .9rem; text-decoration: none; }
.blog-tags a:hover { border-color: var(--blue-strong); color: var(--blue-strong); }
.blog-author { display: flex; gap: 1rem; align-items: flex-start; margin-top: 2.25rem; padding: 1.35rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--tint); }
.blog-author .blog-avatar { width: 3.25rem; height: 3.25rem; font-size: 1rem; }
.blog-author__name { margin: 0 0 .2rem; font-weight: 750; color: var(--navy); }
.blog-author__name span { font-weight: 500; color: var(--muted); }
.blog-author p:last-child { margin: 0; color: var(--muted); font-size: .98rem; }

/* ---------- 12. Small screens, motion and print ---------- */
@media (max-width: 520px) {
  .blog-author { flex-direction: column; }
  .gwa-steps > li { padding-left: 3rem; }
  .gwa-callout, .gwa-summary, .gwa-takeaways { padding-inline: 1.05rem; }
}
@media (prefers-reduced-motion: reduce) {
  .gwa-cards a, .toc__summary::after, .gwa-faq summary::after { transition: none; }
  .gwa-cards a:hover { transform: none; }
  .blog-progress { display: none; }
}
@media print {
  .blog-progress, .blog-aside, .gwa-cta, .blog-endnav { display: none !important; }
  .blog-layout { display: block; }
  .blog-content { max-width: none; }
  .gwa-faq details { display: block; }
  .gwa-faq details > div { display: block; }
}
