/* ============================================================
   The Blueprint - Ghost theme
   All styles use the thp- prefix and reference :root tokens.
   ============================================================ */

:root {
  /* Palette */
  --thp-primary: #3B4DE0;
  --thp-primary-strong: #2E3EC8;
  --thp-ink: #152449;
  --thp-body: #29344F;
  --thp-muted: #5C6A88;
  --thp-bg: #E7EBF6;
  --thp-surface: #FFFFFF;
  --thp-surface-2: #F6F7FC;
  --thp-hero-1: #EEF2FD;
  --thp-hero-2: #E3EAFB;
  --thp-callout: #E9EDF9;
  --thp-line: #E2E6F1;
  --thp-line-strong: #D3D9EA;
  --thp-shadow: 0 6px 24px rgba(21, 36, 73, .07);
  --thp-shadow-lg: 0 14px 40px rgba(21, 36, 73, .10);

  /* Type */
  --thp-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --thp-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;

  /* Radii */
  --thp-r-card: 18px;
  --thp-r-btn: 10px;
  --thp-r-pill: 999px;
  --thp-r-input: 14px;

  /* Layout */
  --thp-wrap: 1200px;
  --thp-narrow: 850px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--thp-bg);
  color: var(--thp-body);
  font-family: var(--thp-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--thp-primary); text-decoration: none; }
a:hover { color: var(--thp-primary-strong); }

h1, h2, h3, h4 {
  font-family: var(--thp-serif);
  color: var(--thp-ink);
  font-weight: 800;
  line-height: 1.12;
  margin: 0 0 .5em;
  letter-spacing: -.01em;
}

p { margin: 0 0 1em; }

.thp-wrap { max-width: var(--thp-wrap); margin: 0 auto; padding: 0 24px; }
.thp-narrow { max-width: var(--thp-narrow); margin-left: auto; margin-right: auto; }
.thp-sec { padding: 72px 0; }
.thp-sec-tight { padding: 48px 0; }

/* ---------- Kicker pills ---------- */
.thp-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background: var(--thp-surface);
  border: 1px solid var(--thp-line-strong);
  border-radius: var(--thp-r-pill);
  font-size: 13px;
  font-weight: 600;
  color: var(--thp-ink);
  box-shadow: var(--thp-shadow);
}
.thp-pill svg { width: 16px; height: 16px; }

/* ---------- Buttons ---------- */
.thp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--thp-r-btn);
  font-family: var(--thp-sans);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
}
.thp-btn-primary { background: var(--thp-primary); color: #fff; }
.thp-btn-primary:hover { background: var(--thp-primary-strong); color: #fff; }
.thp-btn-ghost {
  background: transparent;
  color: var(--thp-muted);
  border-color: var(--thp-line-strong);
}
.thp-btn-ghost:hover { color: var(--thp-ink); border-color: var(--thp-primary); }
.thp-btn:focus-visible { outline: 2px solid var(--thp-primary); outline-offset: 2px; }

/* ---------- Subscribe form (Ghost Portal) ---------- */
.thp-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  background: var(--thp-surface);
  border: 1px solid var(--thp-line-strong);
  border-radius: var(--thp-r-input);
  padding: 6px 6px 6px 18px;
  box-shadow: var(--thp-shadow);
  max-width: 460px;
  gap: 8px;
}
.thp-form input[type="email"] {
  flex: 1 1 auto;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--thp-sans);
  font-size: 15px;
  color: var(--thp-ink);
  padding: 10px 0;
}
.thp-form input::placeholder { color: var(--thp-muted); }
.thp-form button {
  flex: 0 0 auto;
  border: none;
  background: var(--thp-primary);
  color: #fff;
  font-family: var(--thp-sans);
  font-size: 15px;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: 9px;
  cursor: pointer;
  transition: background .18s ease;
}
.thp-form button:hover { background: var(--thp-primary-strong); }
.thp-form.thp-form-center { margin-left: auto; margin-right: auto; }
.thp-success, .thp-error { width: 100%; font-size: 13px; margin: 8px 2px 0; }
.thp-success { color: #1f7a3d; display: none; }
.thp-error { color: #b3261e; display: none; }
form[data-members-form].success .thp-success { display: block; }
form[data-members-form].error .thp-error { display: block; }
[data-members-error]:not(:empty) { display: block; }

/* Branded placeholder when a post has no feature image */
.thp-ph {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(150deg, var(--thp-hero-1), var(--thp-hero-2));
}
.thp-ph .thp-brand-name { font-size: 26px; color: var(--thp-ink); opacity: .92; }
.thp-ph-sm .thp-brand-name { font-size: 15px; }

/* ============================================================
   NAV
   ============================================================ */
.thp-nav {
  background: var(--thp-surface);
  border-bottom: 1px solid var(--thp-line);
  position: sticky;
  top: 0;
  z-index: 50;
}
.thp-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 74px;
}
.thp-brand { display: inline-flex; align-items: center; gap: 12px; }
/* Square brand mark (theme SVG or Ghost publication icon) */
.thp-brand .thp-mark { width: 40px; height: 40px; border-radius: 11px; flex: 0 0 auto; }
/* Publication logo is usually a wordmark: scale by height, keep aspect ratio */
.thp-brand .thp-logo { height: 40px; width: auto; max-width: 300px; object-fit: contain; }
.thp-brand-name {
  font-family: var(--thp-serif);
  font-weight: 800;
  font-size: 24px;
  color: var(--thp-ink);
  letter-spacing: -.01em;
}
.thp-nav-links { display: flex; align-items: center; gap: 28px; }
.thp-nav-links a {
  font-size: 15px;
  font-weight: 500;
  color: var(--thp-ink);
}
.thp-nav-links a:hover { color: var(--thp-primary); }
.thp-nav-actions { display: flex; align-items: center; gap: 16px; }
.thp-nav-login { font-size: 15px; font-weight: 500; color: var(--thp-ink); }
.thp-nav-login:hover { color: var(--thp-primary); }

.thp-burger {
  display: none;
  width: 44px; height: 44px;
  border: 1px solid var(--thp-line-strong);
  border-radius: 10px;
  background: var(--thp-surface);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}
.thp-burger span { width: 20px; height: 2px; background: var(--thp-ink); border-radius: 2px; transition: transform .2s ease, opacity .2s ease; }
.thp-mobile-menu { display: none; }

/* ============================================================
   HERO
   ============================================================ */
.thp-hero {
  background: linear-gradient(160deg, var(--thp-hero-1), var(--thp-hero-2));
  border-radius: 22px;
  margin: 28px auto 0;
  padding: 64px 24px 72px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.thp-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(59, 77, 224, .05) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(59, 77, 224, .05) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
}
.thp-hero > * { position: relative; z-index: 1; }
.thp-hero h1 {
  font-size: clamp(34px, 5.6vw, 60px);
  margin: 22px auto 18px;
  max-width: 820px;
}
.thp-hero-sub {
  font-size: 18px;
  color: var(--thp-muted);
  max-width: 620px;
  margin: 0 auto 30px;
  line-height: 1.6;
}
.thp-hero .thp-form { margin: 0 auto; }

/* ============================================================
   SECTION HEADS
   ============================================================ */
.thp-headwrap { text-align: center; margin-bottom: 44px; }
.thp-headwrap.thp-left { text-align: left; }
.thp-h2 { font-size: clamp(28px, 4vw, 46px); margin: 18px 0 12px; }
.thp-sub { font-size: 17px; color: var(--thp-muted); max-width: 640px; margin: 0 auto; }
.thp-headwrap.thp-left .thp-sub { margin: 0; }

/* ============================================================
   POST CARDS
   ============================================================ */
.thp-card {
  display: flex;
  flex-direction: column;
  background: var(--thp-surface);
  border: 1px solid var(--thp-line);
  border-radius: var(--thp-r-card);
  padding: 26px 26px 26px;
  box-shadow: var(--thp-shadow);
  transition: transform .2s ease, box-shadow .2s ease;
  height: 100%;
  position: relative;
}
.thp-card:hover { transform: translateY(-3px); box-shadow: var(--thp-shadow-lg); }
.thp-card[hidden] { display: none; }
.thp-card-title { font-size: 22px; margin: 0 0 10px; }
.thp-card-title a { color: var(--thp-ink); }
.thp-card-title a:hover { color: var(--thp-primary); }
.thp-card-ex { color: var(--thp-muted); font-size: 15px; margin: 0 0 18px; }
.thp-card-img {
  border-radius: 12px;
  overflow: hidden;
  margin-top: auto;
  background: var(--thp-hero-2);
  aspect-ratio: 16 / 10;
}
.thp-card-img img { width: 100%; height: 100%; object-fit: cover; }
.thp-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  font-size: 12.5px;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--thp-muted);
  font-weight: 600;
}
.thp-card-arrow {
  position: absolute;
  top: 22px; right: 22px;
  width: 20px; height: 20px;
  color: var(--thp-primary);
  opacity: .8;
}

/* Compact horizontal card (image + text side by side) */
.thp-card-h { flex-direction: row; align-items: stretch; gap: 18px; padding: 18px; }
.thp-card-h .thp-card-img { margin: 0; flex: 0 0 40%; aspect-ratio: 1 / 1; align-self: stretch; }
.thp-card-h .thp-card-body { display: flex; flex-direction: column; justify-content: center; }
.thp-card-h .thp-card-title { font-size: 18px; }

/* Featured mixed layout */
.thp-featured {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
.thp-featured-side { display: flex; flex-direction: column; gap: 24px; }

/* Standard 3-col grid */
.thp-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.thp-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.thp-center-btn { text-align: center; margin-top: 44px; }
.thp-center-btn[hidden] { display: none; }
.thp-count { font-size: 14px; color: var(--thp-muted); margin: 14px 0 0; }

/* ============================================================
   SPLIT CTA SECTION
   ============================================================ */
.thp-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
.thp-split h2 { font-size: clamp(30px, 4.4vw, 50px); }
.thp-split p { color: var(--thp-muted); font-size: 17px; margin-bottom: 26px; }
.thp-split-visual { display: flex; justify-content: center; }
.thp-split-visual svg { width: 100%; max-width: 380px; height: auto; }

/* ============================================================
   CTA BAND (partial)
   ============================================================ */
.thp-ctaband {
  background: var(--thp-surface);
  border: 1px solid var(--thp-line);
  border-radius: var(--thp-r-card);
  box-shadow: var(--thp-shadow);
  padding: 40px 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
}
.thp-ctaband h2 { font-size: clamp(24px, 3.2vw, 34px); margin: 0; }
.thp-ctaband .thp-form { flex: 1 1 360px; margin: 0; }

/* ============================================================
   FOOTER
   ============================================================ */
.thp-footer { padding: 56px 0 64px; }
.thp-footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
}
.thp-footer-brand { display: inline-flex; align-items: center; gap: 12px; }
.thp-footer-brand .thp-mark { width: 44px; height: 44px; border-radius: 12px; flex: 0 0 auto; }
.thp-footer-brand .thp-logo { height: 44px; width: auto; max-width: 300px; object-fit: contain; }
.thp-footer-brand .thp-brand-name { font-size: 26px; }
.thp-footcol h4 {
  font-family: var(--thp-sans);
  font-size: 12px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--thp-muted);
  margin: 0 0 16px;
  font-weight: 700;
}
.thp-footcol ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.thp-footcol a { font-size: 15px; color: var(--thp-ink); }
.thp-footcol a:hover { color: var(--thp-primary); }
.thp-footer-legal {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--thp-line);
  font-size: 13px;
  color: var(--thp-muted);
}

/* ============================================================
   ARCHIVE
   ============================================================ */
.thp-archive-head { margin: 44px 0 32px; }
.thp-archive-head h1 { font-size: clamp(38px, 6vw, 64px); }
.thp-search {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--thp-surface);
  border: 1px solid var(--thp-line-strong);
  border-radius: 14px;
  padding: 16px 20px;
  margin-bottom: 32px;
  box-shadow: var(--thp-shadow);
}
.thp-search svg { width: 20px; height: 20px; color: var(--thp-muted); flex: 0 0 auto; }
.thp-search input {
  border: none; outline: none; background: transparent;
  font-family: var(--thp-sans); font-size: 16px; color: var(--thp-ink);
  width: 100%;
}
/* Search bar rendered as a link that opens Ghost's native search */
.thp-search-link { text-decoration: none; color: var(--thp-muted); font-size: 16px; }
.thp-search-link:hover { border-color: var(--thp-primary); color: var(--thp-ink); }

/* Native pagination (index, tag, author, archive channel) */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 48px;
  font-family: var(--thp-sans);
  font-size: 15px;
  color: var(--thp-muted);
}
.pagination a {
  display: inline-flex;
  align-items: center;
  padding: 11px 20px;
  background: var(--thp-surface);
  border: 1px solid var(--thp-line-strong);
  border-radius: var(--thp-r-btn);
  color: var(--thp-ink);
  font-weight: 600;
  box-shadow: var(--thp-shadow);
}
.pagination a:hover { border-color: var(--thp-primary); color: var(--thp-primary); }
.pagination .page-number { font-weight: 600; color: var(--thp-ink); }

.thp-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--thp-muted);
  border: 1px dashed var(--thp-line-strong);
  border-radius: var(--thp-r-card);
}

/* ============================================================
   POST PAGE
   ============================================================ */
.thp-article { background: var(--thp-surface); }
/* Outer is wide so wide/full cards have room; text stays at --thp-narrow */
.thp-article-inner { max-width: var(--thp-wrap); margin: 0 auto; padding: 48px 30px 72px; }
.thp-article-head { max-width: var(--thp-narrow); margin: 0 auto; }
.thp-article-meta {
  font-size: 14px;
  color: var(--thp-muted);
  margin-bottom: 18px;
  display: flex;
  gap: 14px;
  align-items: center;
}
.thp-article-meta .thp-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--thp-muted); display: inline-block; }
.thp-article h1.thp-article-title { font-size: clamp(32px, 5vw, 52px); margin: 0 0 18px; }
.thp-article-excerpt { font-size: 20px; color: var(--thp-muted); line-height: 1.5; margin-bottom: 8px; }
.thp-article-image {
  max-width: var(--thp-narrow);
  margin: 0 auto 30px;
  border-radius: 14px;
  overflow: hidden;
}
.thp-article-image img { width: 100%; max-height: 460px; object-fit: cover; }

/* Grid lets wide/full Ghost cards break out of the text column cleanly,
   with no negative margins and no horizontal overflow. */
.gh-content {
  display: grid;
  grid-template-columns:
    [full-start] minmax(0, 1fr)
    [wide-start] minmax(0, 100px)
    [main-start] min(var(--thp-narrow), 100%) [main-end]
    minmax(0, 100px) [wide-end]
    minmax(0, 1fr) [full-end];
  row-gap: 1.3em;
  color: var(--thp-body);
  font-size: 18px;
  line-height: 1.72;
}
.gh-content > * {
  grid-column: main-start / main-end;
  margin: 0;
  min-width: 0;
}
.gh-content > .kg-width-wide { grid-column: wide-start / wide-end; }
.gh-content > .kg-width-full { grid-column: full-start / full-end; }

.gh-content > h2 { font-size: 30px; margin-top: .7em; }
.gh-content > h3 { font-size: 23px; margin-top: .5em; }
.gh-content a { color: var(--thp-primary); text-decoration: underline; text-underline-offset: 2px; }
.gh-content ul, .gh-content ol { padding-left: 1.3em; }
.gh-content li + li { margin-top: .5em; }
.gh-content img { border-radius: 12px; }
.gh-content > .kg-width-full img { border-radius: 0; }
.gh-content blockquote {
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--thp-primary);
  color: var(--thp-ink);
  font-family: var(--thp-serif);
  font-size: 22px;
  font-style: italic;
}
.gh-content hr { border: none; border-top: 1px solid var(--thp-line); }
/* Callout box (kg-callout or a lavender highlight) */
.gh-content .kg-callout-card,
.gh-content .thp-callout {
  background: var(--thp-callout);
  border-radius: var(--thp-r-card);
  padding: 30px 34px;
}
.gh-content figcaption {
  font-size: 14px;
  color: var(--thp-muted);
  text-align: center;
  margin-top: 10px;
}

/* Paywall / gated post CTA */
.thp-gate {
  max-width: var(--thp-narrow);
  margin: 40px auto 0;
  background: var(--thp-callout);
  border: 1px solid var(--thp-line-strong);
  border-radius: var(--thp-r-card);
  padding: 36px 34px;
  text-align: center;
}
.thp-gate h2 { font-size: 28px; margin: 0 0 10px; }
.thp-gate p { color: var(--thp-muted); font-size: 17px; margin: 0 auto 22px; max-width: 460px; }
.thp-gate .thp-btn { margin: 0 6px 8px; }
.thp-gate .thp-btn-ghost { background: var(--thp-surface); }

/* ============================================================
   REVEAL ANIMATION
   ============================================================ */
.thp-reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.thp-reveal.thp-in { opacity: 1; transform: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .thp-nav-links, .thp-nav-actions .thp-nav-login, .thp-nav-actions .thp-btn { display: none; }
  .thp-burger { display: inline-flex; }
  .thp-mobile-menu {
    display: none;
    border-top: 1px solid var(--thp-line);
    background: var(--thp-surface);
    padding: 16px 24px 24px;
  }
  .thp-mobile-menu.thp-open { display: block; }
  .thp-mobile-menu a { display: block; padding: 12px 0; font-size: 16px; color: var(--thp-ink); border-bottom: 1px solid var(--thp-line); }
  .thp-mobile-menu .thp-btn { display: inline-flex; margin-top: 16px; width: 100%; }

  .thp-featured { grid-template-columns: 1fr; }
  .thp-grid-3 { grid-template-columns: 1fr; }
  .thp-grid-2 { grid-template-columns: 1fr; }
  .thp-split { grid-template-columns: 1fr; gap: 32px; }
  .thp-split-visual { order: -1; }
  .thp-footer-inner { grid-template-columns: 1fr 1fr; }
  .thp-footer-brand { grid-column: 1 / -1; margin-bottom: 8px; }
  .thp-ctaband { flex-direction: column; align-items: flex-start; }
  .thp-ctaband .thp-form { width: 100%; }
}

@media (max-width: 560px) {
  body { font-size: 15px; }
  .thp-sec { padding: 52px 0; }
  .thp-wrap { padding: 0 18px; }
  .thp-hero { padding: 48px 18px 54px; border-radius: 18px; }
  .thp-card-h { flex-direction: column; }
  .thp-card-h .thp-card-img { flex-basis: auto; aspect-ratio: 16 / 10; }
  .thp-footer-inner { grid-template-columns: 1fr; }
  .thp-article-inner { padding: 32px 20px 56px; }
  .thp-article-image { margin: 20px 0; }
  .gh-content { font-size: 17px; }
  .gh-content h2 { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
  .thp-reveal { transition: none; opacity: 1; transform: none; }
  .thp-card { transition: none; }
}

:focus-visible { outline: 2px solid var(--thp-primary); outline-offset: 2px; }
