/**
 * Blog post (single) redesign — preview only, hand-written, unbuilt CSS.
 * No Sass, no Tailwind, no npm step — enqueued directly, same pattern as
 * dist/blog-redesign.css. Only loaded on template-blog-post-redesign.php
 * (see includes/lib/post-redesign.php). Colours are the theme's existing
 * tokens (tailwind.config.js) copied as literal values so this still reads
 * as on-brand without depending on the Tailwind build.
 *
 * Headings/body copy inside the article reuse the theme's already-compiled
 * .h2/.h3/.h6/.subtext type classes (scss/components/_typography.scss) —
 * everything here is layout and the new box components (disclaimer, TL;DR,
 * FAQ, CTAs, TOC, author cards) that don't exist yet.
 */

.post2 {
  --post2-teal: #075056;
  --post2-default-high: #033438;
  --post2-default-med: #4C6769;
  --post2-primary: #FF5900;
  --post2-primary-dark: #D94E00;
  --post2-on-teal-high: #D0F8FB;
  --post2-on-teal-med: #A8D6DA;
  --post2-grey: #f7f7f7;
  --post2-border: #E3E6E2;
  --post2-tint-bg: #EAF4F4;
  --post2-tint-border: #D7E8E8;

  color: var(--post2-default-high);
}

/* :where(a), not a bare "a" — keeps this selector's specificity at zero
   for the element part, so it only ties (rather than beats) the single
   class selectors below it (.post2-category-pill, .post2-bottom-cta__button,
   etc.) and loses that tie by source order instead of silently winning.
   A plain ".post2 a" is a class+element selector, which is MORE specific
   than those single-class component rules — it was overriding every pill/
   button's own text color with this teal, which is how a white-on-teal
   pill and a white-on-orange CTA button both ended up rendering as
   invisible/wrong-colored teal text. */
.post2 :where(a) {
  color: var(--post2-teal);
}

/* ---------- Header: breadcrumb, meta row, title, author ---------- */

.post2-header {
  background: var(--post2-tint-bg);
  border-bottom: 1px solid var(--post2-tint-border);
  padding: 40px 0 48px;
}

.post2-breadcrumb {
  font-family: "Source Code Pro", monospace;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--post2-default-med);
  margin-bottom: 24px;
}

.post2-breadcrumb a {
  color: var(--post2-default-med);
  font-weight: 700;
  text-decoration: none;
}

.post2-meta-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.post2-category-pill {
  font-size: 14px;
  background: var(--post2-teal);
  color: #FFFFFF;
  padding: 7px 14px;
  border-radius: 6px;
  text-decoration: none;
}

.post2-read-time {
  font-size: 15px;
  color: var(--post2-default-med);
}

.post2-title {
  max-width: 880px;
  margin-bottom: 32px !important;
}

.post2-author-row {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  margin-bottom: 36px;
}

.post2-author-link {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.post2-author-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--post2-teal);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px #FFFFFF;
  object-fit: cover;
}

.post2-author-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--post2-default-high);
  text-decoration: underline;
  text-decoration-color: var(--post2-tint-border);
  text-underline-offset: 3px;
}

.post2-author-date {
  font-size: 14px;
  color: var(--post2-default-med);
}

.post2-author-card {
  position: absolute;
  top: 60px;
  left: 0;
  width: 320px;
  background: #FFFFFF;
  border: 1px solid var(--post2-tint-border);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(7, 80, 86, 0.16);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10;
}

.post2-author-card[hidden] {
  display: none;
}

.post2-author-card__eyebrow {
  font-family: "Source Code Pro", monospace;
  font-size: 11px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--post2-default-med);
}

.post2-author-card__name {
  font-size: 16px;
  font-weight: 600;
  color: var(--post2-default-high);
}

.post2-author-card__role {
  font-size: 14px;
  color: var(--post2-default-med);
}

.post2-author-card__bio {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--post2-default-med);
}

.post2-author-card__link {
  font-size: 14px;
  font-weight: 600;
}

/* ---------- Body layout: article + sidebar ---------- */

.post2-body {
  max-width: 1200px;
  margin: 0 auto;
  padding: 56px 32px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 64px;
  align-items: flex-start;
}

.post2-article {
  flex: 1 1 620px;
  min-width: 0;
  max-width: 760px;
}

.post2-content img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 8px 0 32px;
}

/* ---------- Disclaimer box ---------- */

.post2-disclaimer-box {
  background: var(--post2-grey);
  border-radius: 10px;
  padding: 16px 20px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 36px;
}

.post2-disclaimer-box svg {
  flex-shrink: 0;
  margin-top: 2px;
}

.post2-disclaimer-box p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--post2-default-med);
}

/* ---------- TL;DR ---------- */

.post2-tldr-box {
  border: 1px solid var(--post2-tint-border);
  background: #FFFFFF;
  border-radius: 10px;
  padding: 26px 28px;
  margin-bottom: 44px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.post2-tldr-box__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.post2-tldr-box__eyebrow {
  font-family: "Source Code Pro", monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--post2-teal);
}

.post2-tldr-box__skip {
  font-size: 14px;
}

.post2-tldr-box ul {
  margin: 0;
  padding-left: 20px;
  font-size: 16px;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ---------- FAQ accordion ---------- */

.post2-faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 24px 0 44px;
}

.post2-faq-item {
  background: var(--post2-grey);
  border-radius: 14px;
}

.post2-faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  padding: 22px 26px;
  min-height: 44px;
  font-family: inherit;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--post2-default-high);
}

.post2-faq-question svg {
  flex-shrink: 0;
}

.post2-faq-icon-minus {
  display: none;
}

.post2-faq-question.active .post2-faq-icon-plus {
  display: none;
}

.post2-faq-question.active .post2-faq-icon-minus {
  display: block;
}

/* jQuery slideToggle()/slideUp() on this element (see initFaq() in
   js/post-redesign.js) — same technique as the homepage FAQ block
   (includes/blocks/home-faq-block), not a CSS transition. overflow: hidden
   is still needed so content doesn't spill out mid-slide, but there's no
   padding/max-height/transition here: slideUp/slideToggle also animates
   whichever element they're called on's own height AND padding together,
   so this element is kept padding-free on purpose — all of it lives on
   .post2-faq-answer-inner instead, which avoids the box-sizing/padding
   bugs the earlier CSS-only attempts at this kept running into. */
.post2-faq-answer {
  overflow: hidden;
  font-size: 16px;
  line-height: 1.6;
  color: var(--post2-default-med);
}

.post2-faq-answer-inner {
  padding: 0 26px 24px;
}

.post2-faq-answer-inner p:last-child {
  margin-bottom: 0;
}

/* ---------- Bottom in-article CTA ---------- */

.post2-bottom-cta {
  background: var(--post2-teal);
  border-radius: 10px;
  padding: 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 44px;
}

.post2-bottom-cta__text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 440px;
}

.post2-bottom-cta__eyebrow {
  font-family: "Source Code Pro", monospace;
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--post2-on-teal-high);
}

.post2-bottom-cta__title {
  font-size: 22px;
  font-weight: 600;
  color: #FFFFFF;
  line-height: 1.25;
}

.post2-bottom-cta__sub {
  font-size: 15px;
  color: var(--post2-on-teal-med);
}

.post2-bottom-cta__button {
  font-family: "Source Code Pro", monospace;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: var(--post2-primary);
  color: #FFFFFF;
  padding: 15px 20px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 700;
  display: inline-block;
}

.post2-bottom-cta__button:hover {
  background: var(--post2-primary-dark);
}

/* ---------- Sources + legal disclaimer ---------- */

.post2-sources-box {
  background: var(--post2-grey);
  border-radius: 10px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin-bottom: 40px;
}

.post2-sources-box .post2-eyebrow {
  font-family: "Source Code Pro", monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--post2-teal);
  margin-bottom: 10px;
  display: block;
}

.post2-sources-box p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--post2-default-high);
}

.post2-sources-divider {
  height: 1px;
  background: var(--post2-border);
}

.post2-sources-box ol {
  margin: 0;
  padding-left: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--post2-default-high);
  display: flex;
  flex-direction: column;
  gap: 4px;
  word-break: break-word;
  list-style: none;
  counter-reset: post2-sources;
}

.post2-sources-box ol li {
  counter-increment: post2-sources;
  padding-left: 22px;
  text-indent: -22px;
}

.post2-sources-box ol li::before {
  content: counter(post2-sources) ". ";
}

/* ---------- Author box ---------- */

.post2-author-box {
  border-top: 1px solid var(--post2-border);
  padding-top: 32px;
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.post2-author-box__avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--post2-teal);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
  flex-shrink: 0;
  text-decoration: none;
  object-fit: cover;
}

.post2-author-box__content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.post2-author-box__label {
  font-family: "Source Code Pro", monospace;
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--post2-default-med);
}

.post2-author-box__name {
  font-size: 19px;
  font-weight: 600;
  color: var(--post2-default-high);
  text-decoration: none;
}

.post2-author-box__role {
  font-size: 15px;
  color: var(--post2-default-med);
}

.post2-author-box__bio {
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
}

.post2-author-box__links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.post2-author-box__links a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  min-height: 44px;
  text-decoration: none;
}

/* ---------- Sidebar ---------- */

.post2-sidebar {
  flex: 0 1 320px;
  min-width: 260px;
  position: sticky;
  top: 24px;
  /* Caps the whole sticky column (TOC + CTA) to the viewport height, minus
     the same 24px gap mirrored at the bottom — so on short viewports the
     TOC list (which shrinks itself below) gives way before the CTA card
     ever gets pushed out of view. */
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.post2-toc {
  border: 1px solid var(--post2-tint-border);
  border-radius: 10px;
  padding: 22px 22px 18px;
  /* Flex column so post2-toc__list below can be told to shrink (min-height:
     0 overrides flex's default content-based floor) instead of forcing
     this box past the sidebar's max-height. */
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.post2-toc__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.post2-toc__title {
  font-size: 18px;
  font-weight: 600;
  color: var(--post2-default-high);
}

.post2-toc__toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: "Source Code Pro", monospace;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--post2-default-med);
  padding: 10px 0 10px 8px;
  min-height: 44px;
}

.post2-toc__toggle svg {
  transition: transform .2s;
}

.post2-toc[data-open="false"] .post2-toc__toggle svg {
  transform: rotate(180deg);
}

.post2-toc__list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  /* Was a fixed max-height: shrinks to whatever space the sidebar's own
     max-height leaves after the CTA card below, instead of a fixed size
     that could push the CTA off-screen on shorter viewports. */
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.post2-toc[data-open="false"] .post2-toc__list {
  display: none;
}

.post2-toc__list a {
  display: block;
  font-size: 15px;
  line-height: 1.4;
  text-decoration: none;
  padding: 9px 0 9px 12px;
  color: var(--post2-default-med);
  box-shadow: inset 2px 0 0 var(--post2-border);
}

.post2-toc__list a[aria-current="true"] {
  color: var(--post2-default-high);
  font-weight: 600;
  box-shadow: inset 2px 0 0 var(--post2-primary);
}

.post2-sidebar-cta {
  background: var(--post2-teal);
  border-radius: 10px;
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  /* Never shrinks — the TOC list above gives way first so this card stays
     fully visible. */
  flex: 0 0 auto;
}

.post2-sidebar-cta__eyebrow {
  font-family: "Source Code Pro", monospace;
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--post2-on-teal-high);
}

.post2-sidebar-cta__title {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.25;
  color: #FFFFFF;
}

.post2-sidebar-cta__sub {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--post2-on-teal-med);
}

.post2-sidebar-cta__button {
  font-family: "Source Code Pro", monospace;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: var(--post2-primary);
  color: #FFFFFF;
  padding: 15px 18px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 700;
  display: inline-block;
  text-align: center;
}

.post2-sidebar-cta__button:hover {
  background: var(--post2-primary-dark);
}

.post2-sidebar-cta__secondary {
  font-size: 14px;
  color: #FFFFFF;
  text-align: center;
  padding: 6px 0;
  text-decoration: underline;
}

/* ---------- Similar content ---------- */

.post2-related {
  max-width: 1200px;
  margin: 0 auto;
  padding: 72px 32px 88px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.post2-related__label {
  font-family: "Source Code Pro", monospace;
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--post2-default-med);
}

.post2-related__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.post2-related-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-decoration: none;
}

.post2-related-card__image {
  display: block;
  width: 100%;
  aspect-ratio: 339 / 254;
  object-fit: cover;
  border-radius: 10px;
  background: var(--post2-tint-bg);
}

.post2-related-card__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.post2-related-card__title {
  font-size: 18px;
  line-height: 1.35;
  color: var(--post2-default-high);
}

.post2-related-card__tag {
  font-size: 13px;
  background: var(--post2-teal);
  color: #FFFFFF;
  padding: 6px 12px;
  border-radius: 6px;
  flex-shrink: 0;
  white-space: nowrap;
}

/* ---------- Mobile ---------- */

@media (max-width: 767px) {
  .post2-sidebar {
    display: none !important;
  }

  .post2-header {
    background: #FFFFFF !important;
    border-bottom-color: var(--post2-border);
  }

  .post2-author-avatar,
  .post2-author-card,
  .post2-tldr-box__skip,
  .post2-author-box {
    display: none !important;
  }

  .post2-body {
    gap: 0;
  }
}
