/* blog.css — loaded AFTER style.css, never instead of it.
   Every colour here is a var from style.css's :root so the blog cannot drift
   from the studio site. Add nothing that duplicates a rule already in style.css. */

/* ---- Layout ---------------------------------------------------------- */

.blog-wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.article-wrap { max-width: 760px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 760px) { .blog-wrap, .article-wrap { padding: 0 20px; } }

/* The post h1 is styled by an inline attribute from bin/build-posts.php, which
   never carries this, so it belongs here. balance only — a max-width guard
   costs four posts an extra line. */
.article-wrap h1 { text-wrap: balance; }

/* The h1 had no max-width, so on a desktop it ran the full viewport and broke
   with one orphaned word on the second line, while the lead beneath it was
   capped at 640px — the two blocks disagreed about where the page ended. Both
   are measured now, and the hero carries the same trust row as the
   /free-themes and /apps hubs so the three read as one site. */
/* ⚠️ padding-block, NEVER the padding shorthand.
   This rule sits on the SAME element as .blog-wrap (<div class="blog-wrap
   blog-hero">). Both are single-class specificity and this one comes later in
   the file, so a `padding: TOP 0 BOTTOM` shorthand here silently reset
   .blog-wrap's horizontal padding to zero and the whole hero rendered flush
   against both screen edges. Only the block axis belongs to the hero; the
   inline axis belongs to the wrap. */
.blog-hero { padding-block: clamp(34px, 6vw, 64px) clamp(28px, 4vw, 44px); }
.blog-hero h1 {
  font-family: var(--font-type);
  font-weight: 800; letter-spacing: -.035em; line-height: 1.04;
  font-size: clamp(2rem, 1.3rem + 2.8vw, 3.2rem); margin: 10px 0 16px;
  max-width: 20ch; text-wrap: balance;
}
.blog-hero p.lead { max-width: 62ch; font-size: clamp(1rem, .97rem + .3vw, 1.15rem); }

.blog-trust {
  display: flex; flex-wrap: wrap; gap: 10px 28px;
  margin-top: 24px; color: var(--muted); font-size: .9rem;
}
.blog-trust strong { color: var(--accent-2); }

.blog-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

@media (max-width: 700px) {
  .blog-trust { gap: 8px 18px; font-size: .84rem; }
  .blog-hero-actions .btn { flex: 1 1 auto; justify-content: center; }
}

/* ---- Breadcrumb ------------------------------------------------------ */

.crumbs { font-size: .82rem; font-weight: 700; color: var(--muted-2); margin-bottom: 6px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--txt); }
.crumbs span { margin: 0 8px; opacity: .5; }

/* ---- Index grid ------------------------------------------------------ */

.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 20px; }
.post-card {
  display: flex; flex-direction: column; gap: 12px;
  background:var(--panel);
  border: 1px solid var(--border); border-radius: var(--r); padding: 26px;
  text-decoration: none; color: inherit;
  box-shadow:none;
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.post-card:hover {
  transform:none; border-color: var(--accent-ink);
  box-shadow:none;
}
.post-card h2 {
  font-family: var(--font-type);
  font-size: 1.3rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; margin: 0;
}
.post-card p { color: var(--muted); font-size: .93rem; margin: 0; }
.post-meta { font-size: .74rem; font-weight: 800; letter-spacing: .09em;
             text-transform: uppercase; color: var(--muted-2); }
.post-card .go { margin-top: auto; font-weight: 800; font-size: .88rem; color: var(--accent-3); }

/* ---- Article body ---------------------------------------------------- */

.article-body { padding-bottom: 40px; }
.article-body > p, .article-body > ul, .article-body > ol {
  color:var(--txt); font-size: 1.05rem; line-height: 1.75; margin: 0 0 20px;
}
.article-body h2 {
  font-family: var(--font-type);
  font-size: 1.85rem; font-weight: 800; letter-spacing: -.035em;
  margin: 46px 0 16px; scroll-margin-top: 90px;
}
.article-body h3 { font-size: 1.15rem; font-weight: 800; margin: 28px 0 10px; }
.article-body a { color: var(--accent-3); text-decoration: underline; text-underline-offset: 3px; }
.article-body a:hover { color: var(--txt); }
.article-body strong { color: var(--txt); font-weight: 700; }

/* Honesty note — deliberately plain, not a decorated "callout". A disclosure
   that looks like marketing furniture reads as marketing. */
.disclosure {
  border-left: 3px solid var(--accent);
  background:var(--panel-2);
  padding: 16px 20px; border-radius: 0 12px 12px 0;
  color: var(--muted); font-size: .93rem; line-height: 1.65; margin: 0 0 28px;
}
.disclosure strong { color: var(--txt); }

/* ---- Contents -------------------------------------------------------- */

.toc { border: 1px solid var(--border); border-radius: 16px; padding: 20px 24px; margin: 0 0 34px;
       background:var(--panel-2); }
.toc h2 { font-size: .74rem !important; letter-spacing: .11em; text-transform: uppercase;
          color: var(--muted-2); margin: 0 0 12px !important; font-weight: 900; }
.toc ol { margin: 0; padding-left: 20px; }
.toc li { margin: 6px 0; color: var(--muted); font-size: .95rem; }
.toc a { color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--txt); text-decoration: underline; }

/* ---- App entry ------------------------------------------------------- */

.app-entry {
  border: 1px solid var(--border); border-radius: var(--r);
  background:var(--panel);
  padding: 26px; margin: 0 0 20px;
  box-shadow:none;
}
/* Our own app is visually distinct so a reader can see at a glance which entry
   is the publisher's — the disclosure says it, this shows it. */
.app-entry.is-ours { border-color: var(--accent-ink); background:var(--panel-2); }

.app-entry-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.app-rank { font-family: var(--font-type);
            font-size: 1.5rem; font-weight: 800; color: var(--accent-3); line-height: 1; }
.app-entry h3 { margin: 0 !important; font-size: 1.35rem !important; }
.app-badge { font-size: .68rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase;
             padding: 4px 9px; border-radius: 999px; background:var(--panel-2);
             color:var(--accent-3); border: 1px solid var(--accent); }
.app-badge.ours { background: var(--border); color: var(--accent-3);
                  border-color: var(--border); }

.app-entry dl { margin: 14px 0 0; display: grid; grid-template-columns: 108px 1fr; gap: 8px 16px; }
.app-entry dt { font-size: .72rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase;
                color: var(--muted-2); padding-top: 3px; }
.app-entry dd { margin: 0; color:var(--txt); font-size: .96rem; line-height: 1.6; }
.app-entry dd ul { margin: 0; padding-left: 18px; }
.app-entry dd li { margin: 3px 0; }
@media (max-width: 560px) {
  .app-entry dl { grid-template-columns: 1fr; gap: 2px 0; }
  .app-entry dt { padding-top: 12px; }
}

.app-links { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }

/* ⚠️ .btn in style.css sets white-space:nowrap, which is right for nav pills
   and hero buttons but not for a 56-character label like "View Rocket Money -
   Bills & Budgets on the App Store". On a phone those ran clean off the screen
   and the App Store link became unreachable. Scoped here so the site-wide .btn
   rule is untouched. */
.article-body .app-links .btn {
  white-space: normal;
  max-width: 100%;
  text-align: center;
  overflow-wrap: anywhere;
}

/* ---- Comparison table ------------------------------------------------ */

/* Wide content must scroll inside itself; the page body must never scroll sideways. */
.table-scroll { overflow-x: auto; margin: 0 0 28px; border: 1px solid var(--border); border-radius: 16px; }
.cmp { width: 100%; border-collapse: collapse; min-width: 560px; font-size: .92rem; }
.cmp th, .cmp td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.cmp th { font-size: .72rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase;
          color: var(--muted-2); background:var(--panel-2); }
.cmp tbody tr:last-child td { border-bottom: 0; }
.cmp tbody tr.is-ours { background:var(--panel-2); }
.cmp td { color:var(--txt); }
.cmp td a { color: var(--accent-3); text-decoration: none; font-weight: 700; }
.cmp td a:hover { text-decoration: underline; }

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

.faq-list { margin: 0 0 34px; }
.faq-list details {
  border: 1px solid var(--border); border-radius: 14px; padding: 0; margin-bottom: 10px;
  background:var(--panel-2);
}
.faq-list summary {
  cursor: pointer; padding: 16px 20px; font-weight: 700; color: var(--txt);
  list-style: none; display: flex; justify-content: space-between; gap: 14px; align-items: center;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: '+'; color: var(--muted-2); font-weight: 800; font-size: 1.2rem; }
.faq-list details[open] summary::after { content: '\2212'; }
.faq-list details p { padding: 0 20px 18px; margin: 0; color: var(--muted); line-height: 1.7; }

/* ---- Related --------------------------------------------------------- */

.related { border-top: 1px solid var(--border); padding-top: 34px; margin-top: 10px; }
.related h2 { font-size: 1.3rem !important; margin-top: 0 !important; }
.related-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 14px; }
.related-list a {
  display: block; padding: 16px 18px; border: 1px solid var(--border); border-radius: 14px;
  color: var(--txt); text-decoration: none; font-weight: 700; font-size: .95rem; line-height: 1.4;
  background:var(--panel-2); transition: border-color .2s ease, transform .2s ease;
}
.related-list a:hover { border-color: var(--accent-ink); transform:none; }

@media (prefers-reduced-motion: reduce) {
  .post-card, .related-list a, .app-entry { transition: none !important; }
  .post-card:hover, .related-list a:hover { transform: none; }
}


/* ---- Publisher's app strip ------------------------------------------
   Sits at the top of every post, under the byline. Disclosed rather than
   disguised: it says whose app it is before it says anything else, and it is
   visually a note from the publisher, not an ad unit dropped into the page.
   Kalend's own vermilion, so it reads as the app rather than as site chrome. */
.kalend-strip { margin: 22px 0 4px; }

.kalend-strip a {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 18px; text-decoration: none;
  border: 1px solid rgba(255,145,102,.28);
  border-left: 3px solid #ff9166;
  border-radius: 14px;
  background: linear-gradient(90deg, rgba(255,145,102,.09), rgba(255,145,102,.02) 62%, transparent);
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.kalend-strip a:hover {
  border-color: rgba(255,145,102,.5);
  background: linear-gradient(90deg, rgba(255,145,102,.15), rgba(255,145,102,.04) 62%, transparent);
}
/* Honour a reduced-motion preference: no lift, colour still responds. */
@media (prefers-reduced-motion: no-preference) {
  .kalend-strip a:hover { transform:none; }
}

.kalend-strip .ks-icon {
  flex: 0 0 auto; display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 11px;
  background: rgba(255,145,102,.13);
  border: 1px solid rgba(255,145,102,.3);
  color:var(--accent-2);
}
.kalend-strip .ks-icon svg { width: 24px; height: 24px; display: block; }

.kalend-strip .ks-text { min-width: 0; flex: 1 1 auto; }
.kalend-strip .ks-eyebrow {
  display: block; font-size: .66rem; font-weight: 900;
  letter-spacing: .11em; text-transform: uppercase;
  color:var(--accent-2); margin-bottom: 3px;
}
.kalend-strip .ks-name {
  display: block; color: var(--txt); font-weight: 700;
  font-size: 1.02rem; line-height: 1.3;
}
.kalend-strip .ks-facts {
  display: block; color: var(--muted); font-size: .85rem;
  margin-top: 3px; line-height: 1.4;
}
.kalend-strip .ks-go {
  flex: 0 0 auto; color:var(--accent-2); font-weight: 800;
  font-size: .82rem; letter-spacing: .02em; white-space: nowrap;
}

@media (max-width: 620px) {
  .kalend-strip a { gap: 13px; padding: 14px; align-items: flex-start; }
  .kalend-strip .ks-icon { width: 38px; height: 38px; border-radius: 9px; }
  .kalend-strip .ks-icon svg { width: 20px; height: 20px; }
  .kalend-strip .ks-name { font-size: .96rem; }
  /* The arrow has nowhere to sit on a narrow screen; the whole row is the link. */
  .kalend-strip .ks-go { display: none; }
}

/* The "Ours" badge was indigo text on an indigo tint — 2.04:1. It is the one
   label a reader most needs to notice, so it gets ink on paper with a coloured
   edge, the same treatment as the platform badges on the themes hub. */
.app-badge, .app-badge.ours {
  background: var(--panel-2);
  color: var(--txt);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent-3);
}

/* Conversion block at the foot of every roundup that features one of our apps.
   The roundup earns the reader's attention; this is where it gets asked for
   something. Deliberately at the END — a reader who has got this far has read
   the comparison, which is when an ask is welcome rather than an interruption. */
.post-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  margin: 40px 0;
  padding: clamp(22px, 3vw, 32px);
  border: 1.5px solid var(--txt);
  border-radius: var(--r);
  background: var(--panel);
  box-shadow: 5px 5px 0 var(--border);
}

.post-cta-body { flex: 1 1 300px; min-width: 0; }
.post-cta h2 { margin: 0 0 6px !important; font-size: 1.5rem !important; }
.post-cta p { margin: 0 0 6px; color: var(--txt); }
.post-cta-terms { color: var(--muted-2) !important; font-size: .88rem; }
.post-cta .btn { flex: 0 0 auto; }

@media (max-width: 560px) {
  .post-cta { flex-direction: column; align-items: stretch; }
  .post-cta .btn { width: 100%; }
}

/* ---------------------------------------------------------------------------
   Post headline typography.

   ⚠️ This used to live in a style="" attribute on every one of the 36 post H1s,
   pinned to the pre-redesign face:

       font-family:'Bricolage Grotesque','Inter',sans-serif; font-weight:800;
       letter-spacing:-.045em; …

   An inline declaration outranks any stylesheet rule short of !important, so
   every headline on the blog was still rendering in the old sans face months
   after the typewriter redesign shipped — and it was the single largest text on
   the page. bin/drop-webfonts.php strips the attribute; the type has to be
   restated here or the H1 falls back to the browser default.

   Tight tracking is deliberately NOT carried over. American Typewriter is a
   slab at a fixed rhythm; negative letter-spacing collapses it into mush.
   --------------------------------------------------------------------------- */
.article-wrap h1,
.post-head h1 {
  font-family: var(--font-type, 'American Typewriter', 'Courier New', ui-monospace, monospace);
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.14;
  font-size: clamp(1.75rem, 4.4vw, 2.6rem);
  color: var(--ink, #1d1a15);
  margin: 8px 0 18px;
  text-wrap: balance;
}

/* ---------------------------------------------------------------------------
   Answer box — the passage an AI answer engine is meant to lift.

   Styled as a margin note in a diary rather than a callout card: a single
   accent rule down the left, no fill, no border box. It has to read as the
   author's own summary, because a block that looks like an advert gets skipped
   by readers and discounted by the models that grade page quality.

   The left rule is the ONLY decoration. Do not add a background tint here —
   the earlier grey-on-cream contrast failure came from exactly that instinct.
   --------------------------------------------------------------------------- */
.answer-box {
  border-left: 3px solid var(--accent, #0a6fd8);
  padding: 2px 0 2px 18px;
  margin: 22px 0 26px;
}
.answer-box .answer-label {
  font-family: var(--font-type, 'American Typewriter', 'Courier New', monospace);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent, #0a6fd8);
  margin: 0 0 6px;
}
.answer-box p:not(.answer-label) {
  font-size: 1.06rem;
  line-height: 1.62;
  color: var(--txt, #1d1a15);
  margin: 0;
}
.answer-box strong { font-weight: 700; }

@media (max-width: 560px) {
  .answer-box { padding-left: 14px; margin: 18px 0 22px; }
  .answer-box p:not(.answer-label) { font-size: 1rem; }
}
