/* blog.css — From the Underwriting Desk
   Loads after /base.css and /style.css and only adds what the blog needs.
   Every value reads a site token first and falls back to the literal from the
   live white + green theme, so the blog renders correctly even if base.css is
   missing from the server. */

.blog-page {
  background: var(--color-bg, #ffffff);
  color: var(--color-text, #111111);
  font-family: var(--font-body, "DM Sans", system-ui, sans-serif);
  line-height: 1.75;
}

/* Clear the fixed site header */
.blog-page #main {
  padding-top: 116px; /* clears the 113px fixed site header */
}

.blog-page .section {
  padding-block: clamp(2.75rem, 6vw, 4.5rem);
}

.blog-page .container--narrow {
  max-width: var(--content-default, 46rem);
}

/* The mobile nav drawer in style.css is still dark from the previous theme.
   Keep it white on blog pages so the links stay readable. */
@media (max-width: 1024px) {
  .blog-page .main-nav {
    /* .site-header uses backdrop-filter, which makes it the containing block for
       position:fixed children — so bottom:0 only reaches the header's own height.
       Give the drawer an explicit viewport height instead. */
    height: 100vh;
    height: 100dvh;
    overflow-y: auto;
    background: #ffffff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-left: 1px solid var(--color-border, #e5e7eb);
    box-shadow: -18px 0 48px rgba(17, 17, 17, 0.14);
    z-index: 1002;
    padding-top: 5.5rem;
  }
  .blog-page .menu-toggle {
    color: var(--color-text, #111111);
    position: relative;
    z-index: 1003;
  }
  .blog-page .nav-overlay {
    background: rgba(17, 17, 17, 0.45);
    z-index: 999; /* must sit under .site-header (1000) so the drawer is not dimmed */
  }
  /* the desktop pipe separators between nav links do not belong in the drawer */
  .blog-page .main-nav .nav-link:not(:last-child)::after {
    display: none;
  }
  .blog-page .main-nav .nav-link {
    border-bottom: 1px solid var(--color-border, #e5e7eb);
  }
}

/* ── Shared meta bits ────────────────────────────── */
.kicker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-size: var(--text-xs, 0.75rem);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-faint, #6b7280);
  margin: 0 0 1rem;
}
.kicker time {
  color: var(--color-text-muted, #4b5563);
}
.dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--color-accent, #15803d);
  display: inline-block;
}
.tag {
  color: var(--color-accent, #15803d);
  background: var(--color-surface-2, #f2faf3);
  border: 1px solid rgba(21, 128, 61, 0.18);
  border-radius: var(--radius-sm, 4px);
  padding: 0.22rem 0.55rem;
  letter-spacing: 0.12em;
}
.stand {
  font-family: var(--font-display, "Playfair Display", Georgia, serif);
  font-size: clamp(1.12rem, 2vw, 1.38rem);
  line-height: 1.5;
  font-style: italic;
  color: var(--color-text-muted, #4b5563);
  margin: 0 0 2rem;
  max-width: 36rem;
}
.more {
  font-size: var(--text-sm, 0.875rem);
  font-weight: 500;
  margin: 1.1rem 0 0;
}
.more a span {
  display: inline-block;
  margin-left: 0.4rem;
  transition: transform var(--transition-interactive, 0.25s ease);
}
.more a:hover span {
  transform: translateX(4px);
}
.more em {
  color: var(--color-text-faint, #6b7280);
  font-style: normal;
  margin-left: 0.6rem;
}

/* the site's .btn base lives in style.css; make sure it renders as a button */
.blog-page .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.6rem;
  border-radius: var(--radius-md, 8px);
  font-size: var(--text-sm, 0.875rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: background var(--transition-interactive, 0.25s ease), transform 0.2s ease;
}
.blog-page .btn--primary {
  background: var(--color-accent, #15803d);
  color: #ffffff;
}
.blog-page .btn--primary:hover {
  background: var(--color-accent-hover, #166534);
  color: #ffffff;
}

/* ── Landing page ────────────────────────────────── */
.masthead {
  padding-bottom: clamp(2rem, 4vw, 3rem) !important;
}
.masthead h1 {
  font-family: var(--font-display, "Playfair Display", Georgia, serif);
  font-size: clamp(2.3rem, 5.6vw, 3.9rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin: 0 0 1.35rem;
  max-width: 22ch;
}
.masthead .lede {
  font-size: var(--text-lg, 1.1875rem);
  color: var(--color-text-muted, #4b5563);
  max-width: 40rem;
  margin: 0 0 1.6rem;
  line-height: 1.7;
}
.meta-line {
  font-size: var(--text-xs, 0.75rem);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-faint, #6b7280);
  margin: 0;
}

.lead {
  border-top: 1px solid rgba(21, 128, 61, 0.1);
  border-bottom: 1px solid rgba(21, 128, 61, 0.1);
  background: linear-gradient(to bottom, #ffffff 0%, var(--color-surface-2, #f2faf3) 100%);
}
.lead h2 {
  font-family: var(--font-display, "Playfair Display", Georgia, serif);
  font-size: clamp(1.75rem, 4vw, 2.6rem);
  font-weight: 700;
  line-height: 1.12;
  margin: 0 0 1.15rem;
  max-width: 28ch;
}
.lead h2 a {
  color: var(--color-text, #111111);
}
.lead h2 a:hover {
  color: var(--color-accent, #15803d);
}

.archive .rule {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  font-family: var(--font-body, "DM Sans", sans-serif);
  font-size: var(--text-xs, 0.75rem);
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-accent, #15803d);
  margin: 0 0 2.25rem;
}
.archive .rule::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(21, 128, 61, 0.35), transparent);
}
.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
  gap: 1.25rem;
}
.card {
  display: flex;
  flex-direction: column;
  background: var(--color-bg, #ffffff);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: var(--radius-lg, 14px);
  padding: 1.75rem 1.6rem;
  transition: border-color var(--transition-interactive, 0.25s ease),
    box-shadow var(--transition-interactive, 0.25s ease), transform 0.25s ease;
}
.card:hover {
  border-color: rgba(21, 128, 61, 0.35);
  box-shadow: 0 12px 32px rgba(17, 17, 17, 0.07);
  transform: translateY(-2px);
}
.card .kicker {
  gap: 0.7rem;
  margin-bottom: 0.8rem;
}
.card .kicker .dot {
  display: none;
}
.card .kicker > *:last-child {
  color: var(--color-accent, #15803d);
}
.card h3 {
  font-family: var(--font-display, "Playfair Display", Georgia, serif);
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 0.75rem;
}
.card h3 a {
  color: var(--color-text, #111111);
}
.card h3 a:hover {
  color: var(--color-accent, #15803d);
}
.card > p {
  font-size: var(--text-sm, 0.875rem);
  color: var(--color-text-muted, #4b5563);
  margin: 0;
  line-height: 1.65;
}
.card .more {
  margin-top: auto;
  padding-top: 1.1rem;
}

.blog-page .cta-section {
  background: linear-gradient(to bottom, #ffffff 0%, var(--color-surface-2, #f2faf3) 55%, #e4f5e7 100%);
  border-top: 1px solid rgba(21, 128, 61, 0.1);
  text-align: left;
}
.blog-page .cta-section h2 {
  font-family: var(--font-display, "Playfair Display", Georgia, serif);
  font-size: clamp(1.5rem, 3.2vw, 2.15rem);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 0.9rem;
  max-width: 32ch;
}
.blog-page .cta-section p {
  color: var(--color-text-muted, #4b5563);
  max-width: 44rem;
  margin: 0 0 1.5rem;
}

/* ── Post page ───────────────────────────────────── */
.crumb {
  font-size: var(--text-xs, 0.75rem);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 0 0 1.75rem;
}
.post h1 {
  font-family: var(--font-display, "Playfair Display", Georgia, serif);
  font-size: clamp(2rem, 5vw, 3.1rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0 0 1.3rem;
  max-width: 26ch;
}

.prose {
  font-size: var(--text-base, 1.0625rem);
  color: var(--color-text, #111111);
}
.prose h2 {
  font-family: var(--font-display, "Playfair Display", Georgia, serif);
  font-size: clamp(1.35rem, 2.6vw, 1.7rem);
  font-weight: 600;
  line-height: 1.25;
  margin: 2.9rem 0 1rem;
}
.prose h3 {
  font-family: var(--font-body, "DM Sans", sans-serif);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 2.2rem 0 0.7rem;
}
.prose p {
  margin: 0 0 1.3rem;
  color: var(--color-text-muted, #4b5563);
}
.prose strong {
  color: var(--color-text, #111111);
  font-weight: 600;
}
.prose a {
  color: var(--color-accent, #15803d);
  border-bottom: 1px solid rgba(21, 128, 61, 0.28);
}
.prose a:hover {
  border-bottom-color: var(--color-accent-hover, #166534);
}
.prose ul,
.prose ol {
  margin: 0 0 1.5rem;
  padding-left: 1.2rem;
  color: var(--color-text-muted, #4b5563);
}
.prose li {
  margin: 0 0 0.6rem;
  padding-left: 0.25rem;
}
.prose li::marker {
  color: var(--color-accent, #15803d);
}
.prose blockquote {
  margin: 2rem 0;
  padding: 0.4rem 0 0.4rem 1.4rem;
  border-left: 2px solid var(--color-accent, #15803d);
  color: var(--color-text-muted, #4b5563);
  font-style: italic;
}
.prose code {
  background: var(--color-surface, #f8faf8);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: var(--radius-sm, 4px);
  padding: 0.08rem 0.35rem;
  font-size: 0.9em;
}
.prose p.sig {
  font-size: var(--text-xs, 0.75rem);
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--color-accent, #15803d);
  margin: 2rem 0 0;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0 1.25rem;
  font-size: var(--text-sm, 0.875rem);
  font-variant-numeric: tabular-nums;
}
.prose thead th {
  text-align: left;
  font-family: var(--font-body, "DM Sans", sans-serif);
  font-size: var(--text-xs, 0.75rem);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent, #15803d);
  padding: 0 1rem 0.7rem 0;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
}
.prose tbody td {
  padding: 0.8rem 1rem 0.8rem 0;
  border-bottom: 1px solid var(--color-border, #e5e7eb);
  vertical-align: top;
  color: var(--color-text-muted, #4b5563);
}
.prose tbody tr:last-child td {
  border-bottom: 0;
}
.prose tbody td:first-child {
  color: var(--color-text, #111111);
  font-weight: 500;
}
.prose tbody td:last-child,
.prose thead th:last-child {
  width: 9.5rem;
  text-align: right;
  padding-right: 0;
}
.prose table.prose-table tbody td:last-child,
.prose table.prose-table thead th:last-child {
  width: auto;
  text-align: left;
  padding-right: 0;
}
.prose table.prose-table {
  table-layout: fixed;
}

/* "The box this week" */
.prose h2.box-head {
  margin-top: 3.1rem;
  padding-top: 2.1rem;
  border-top: 1px solid var(--color-border, #e5e7eb);
}
.prose h2.box-head + ul {
  list-style: none;
  padding: 1.5rem 1.7rem;
  margin: 0 0 1.5rem;
  background: var(--color-surface-2, #f2faf3);
  border: 1px solid rgba(21, 128, 61, 0.14);
  border-left: 3px solid var(--color-accent, #15803d);
  border-radius: var(--radius-md, 8px);
}
.prose h2.box-head + ul li {
  margin: 0 0 0.65rem;
  padding: 0;
  font-size: var(--text-sm, 0.875rem);
}
.prose h2.box-head + ul li:last-child {
  margin-bottom: 0;
}

/* Byline + disclaimer */
.byline {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin: 3rem 0 0;
  padding-top: 1.9rem;
  border-top: 1px solid var(--color-border, #e5e7eb);
}
.avatar {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--color-surface-2, #f2faf3);
  border: 1px solid rgba(21, 128, 61, 0.2);
  color: var(--color-accent, #15803d);
  display: grid;
  place-items: center;
  font-size: var(--text-xs, 0.75rem);
  font-weight: 600;
  letter-spacing: 0.06em;
}
.byline p {
  margin: 0;
  font-size: var(--text-sm, 0.875rem);
  color: var(--color-text-muted, #4b5563);
}
.byline strong {
  color: var(--color-text, #111111);
}
.disclaimer {
  margin: 1.6rem 0 0;
  font-size: var(--text-xs, 0.75rem);
  line-height: 1.65;
  color: var(--color-text-faint, #6b7280);
  font-style: italic;
}

/* Earlier / later */
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 3rem 0 0;
}
.pager a {
  background: var(--color-surface, #f8faf8);
  border: 1px solid var(--color-border, #e5e7eb);
  border-radius: var(--radius-lg, 14px);
  padding: 1.35rem 1.4rem;
  color: var(--color-text, #111111);
  font-family: var(--font-display, "Playfair Display", Georgia, serif);
  font-size: 1.05rem;
  line-height: 1.3;
  transition: border-color var(--transition-interactive, 0.25s ease),
    background var(--transition-interactive, 0.25s ease);
}
.pager a:hover {
  border-color: rgba(21, 128, 61, 0.35);
  background: var(--color-surface-2, #f2faf3);
  color: var(--color-accent, #15803d);
}
.pager a.next {
  text-align: right;
}
.pager span {
  display: block;
  font-family: var(--font-body, "DM Sans", sans-serif);
  font-size: var(--text-xs, 0.75rem);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-accent, #15803d);
  margin-bottom: 0.45rem;
}

/* Footer additions */
.blog-page .footer-legal {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(21, 128, 61, 0.12);
  font-size: var(--text-xs, 0.75rem);
  line-height: 1.65;
  color: var(--color-text-faint, #6b7280);
}
.blog-page .site-logo-footer {
  height: 34px;
}

@media (max-width: 640px) {
  .blog-page #main {
    padding-top: 108px;
  }
  .pager {
    grid-template-columns: 1fr;
  }
  .pager a.next {
    text-align: left;
  }
  .prose table {
    display: block;
    overflow-x: auto;
  }
}

@media print {
  .site-header,
  .site-footer,
  .pager,
  .crumb {
    display: none;
  }
  .blog-page #main {
    padding-top: 0;
  }
}
