/*
Theme Name: CardFlow
Description: Matches the CardFlow marketing chrome so /blog does not read as a different site.
Version: 1.0
*/

/* ═══════════════════════════════════════════════════════════════════════
   MIRRORED FROM web/app/globals.css. That file is the source of truth.

   This is the drift tax we accepted when choosing WordPress over a custom
   blog: the header and footer now exist twice, in two languages. If you
   change the nav, the logo, the palette or the button styles there, change
   them here too, or a reader clicking from an article to /pricing will
   watch the site change shape under them.

   Mirrored below: the :root tokens, .cf-header, .cf-nav, .cf-btn,
   .cf-footer. Everything after the BLOG-ONLY marker is ours alone and has
   no counterpart to keep in step.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  --navy: #0f182a;
  --blue: #2563eb;
  --teal: #00d8cc;
  --purple: #7b59ff;

  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #f9fafc;
  --line: #e6e9f0;
  --text: #0f182a;
  --muted: #687087;
  --muted-2: #9aa1b2;
  --blue-bg: #eef2ff;
  --blue-bg-soft: #f5f8ff;

  --grad-brand: linear-gradient(120deg, var(--blue) 0%, var(--teal) 100%);
  --grad-brand-2: linear-gradient(120deg, var(--blue) 0%, var(--purple) 100%);

  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 24, 42, 0.06), 0 1px 3px rgba(15, 24, 42, 0.05);
  --shadow-md: 0 4px 16px rgba(15, 24, 42, 0.08);

  /* Loaded from Google Fonts in functions.php rather than self-hosted by
     next/font. Same families, so the nav renders identically. */
  --font-head: "Space Grotesk", ui-sans-serif, system-ui, sans-serif;
  --font-body: "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ── Chrome: mirrored, keep in step with globals.css ─────────────────── */

.cf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 68px;
  padding: 0 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.cf-header__brand { display: flex; align-items: center; gap: 1.25rem; }
.cf-header__logo { height: 40px; width: auto; display: block; }
.cf-nav { display: flex; gap: 0.35rem; }
.cf-nav__link {
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}
.cf-nav__link:hover { color: var(--navy); background: var(--surface-2); text-decoration: none; }
.cf-nav__link--active { color: var(--blue); background: var(--blue-bg); }
.cf-nav--public { margin-left: 0.5rem; }
@media (max-width: 640px) {
  .cf-nav--public { margin-left: 0.15rem; gap: 0.1rem; }
  .cf-nav--public .cf-nav__link { padding: 0.35rem 0.45rem; font-size: 0.85rem; }
  .cf-nav--public .cf-nav__link:last-child { display: none; }
}
.cf-header__right { display: flex; align-items: center; gap: 0.85rem; }

.cf-btn {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.6rem 1.1rem;
  cursor: pointer;
  color: #fff;
  background: var(--grad-brand-2);
  transition: filter 0.15s, transform 0.05s, box-shadow 0.15s;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  display: inline-block;
}
.cf-btn:hover { filter: brightness(1.05); box-shadow: var(--shadow-md); }
.cf-btn:active { transform: translateY(1px); }
.cf-btn--ghost {
  background: var(--surface);
  color: var(--navy);
  border: 1px solid var(--line);
  box-shadow: none;
}
.cf-btn--ghost:hover { background: var(--surface-2); filter: none; }

.cf-footer {
  min-height: 64px;
  padding: 0.6rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.cf-footer__links {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--muted-2);
}
.cf-footer__links a { color: var(--muted); text-decoration: none; font-weight: 500; }
.cf-footer__links a:hover { color: var(--text); text-decoration: underline; }

/* ═══ BLOG-ONLY from here. Nothing below mirrors globals.css. ═══════════ */

/* Narrower than the marketing .cf-main (960px) on purpose: prose wants a
   measure around 70 characters, and 960 is too wide to read comfortably. */
.cf-blog {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
  min-height: calc(100vh - 68px - 64px);
}

.cf-post + .cf-post { margin-top: 3rem; padding-top: 3rem; border-top: 1px solid var(--line); }

/* ── Index cards ─────────────────────────────────────────────────────── */

.cf-blog__intro { margin-bottom: 2.5rem; }
.cf-blog__title {
  font-family: var(--font-head);
  font-size: 2.4rem;
  letter-spacing: -0.02em;
  margin: 0 0 0.4rem;
}
.cf-blog__sub { color: var(--muted); margin: 0; font-size: 1.02rem; }

.cf-cards { display: flex; flex-direction: column; gap: 1.5rem; }

.cf-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s, transform 0.05s;
}
.cf-card:hover { box-shadow: var(--shadow-md); }

.cf-card__media { display: block; }
.cf-card__media img {
  display: block;
  width: 100%;
  /* Fixed ratio so a portrait scan and a landscape composite do not produce
     wildly different card heights down the list. */
  aspect-ratio: 16 / 7;
  object-fit: cover;
}

.cf-card__body { padding: 1.4rem 1.5rem 1.5rem; }

.cf-card__title {
  font-family: var(--font-head);
  font-size: 1.45rem;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0 0 0.35rem;
}
.cf-card__title a { color: var(--text); text-decoration: none; }
.cf-card__title a:hover { color: var(--blue); }

.cf-card__excerpt { color: var(--muted); font-size: 1rem; }
.cf-card__excerpt p { margin: 0; }

/* Separated from the excerpt by a rule so the card still has structure when
   there is no image to divide it. */
.cf-card__cta {
  margin: 1.25rem 0 0;
  padding-top: 1.15rem;
  border-top: 1px solid var(--line);
}
.cf-btn--sm { padding: 0.45rem 0.9rem; font-size: 0.88rem; }

.cf-post__title {
  font-family: var(--font-head);
  font-size: 2.1rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}
.cf-post__title a { color: var(--text); text-decoration: none; }
.cf-post__title a:hover { color: var(--blue); }

.cf-post__meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted-2);
  margin: 0 0 1.75rem;
}

/* Article body. Element selectors scoped to .cf-prose so WordPress block
   markup styles without needing a class on every element. */
.cf-prose { font-size: 1.05rem; color: var(--text); }
.cf-prose > * + * { margin-top: 1.25rem; }
.cf-prose h2,
.cf-prose h3,
.cf-prose h4 {
  font-family: var(--font-head);
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}
.cf-prose h2 { font-size: 1.5rem; }
.cf-prose h3 { font-size: 1.2rem; }
.cf-prose h4 { font-size: 1.05rem; }
.cf-prose a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
.cf-prose ul, .cf-prose ol { padding-left: 1.4rem; }
.cf-prose li + li { margin-top: 0.4rem; }
.cf-prose img { max-width: 100%; height: auto; border-radius: var(--radius); display: block; }
.cf-prose figure { margin: 2rem 0; }
.cf-prose figcaption {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.6rem;
  text-align: center;
}
.cf-prose blockquote {
  margin: 2rem 0;
  padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 3px solid var(--blue);
  color: var(--muted);
}
.cf-prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--blue-bg-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}
.cf-prose pre {
  background: var(--navy);
  color: #e8ecf5;
  padding: 1rem 1.15rem;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 0.88rem;
}
.cf-prose pre code { background: none; border: none; padding: 0; color: inherit; }
.cf-prose hr { border: none; border-top: 1px solid var(--line); margin: 2.5rem 0; }

/* Tables carry the spec answers these posts exist to give (weight limits,
   dimensions), so they need to survive a phone. */
.cf-prose table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.cf-prose th, .cf-prose td { border: 1px solid var(--line); padding: 0.55rem 0.7rem; text-align: left; }
.cf-prose th { background: var(--surface-2); font-family: var(--font-head); font-weight: 600; }
.cf-prose .wp-block-table { overflow-x: auto; }

/* WordPress block alignment classes. Without these, a wide image simply
   ignores the alignment the editor promised. */
.cf-prose .alignwide { max-width: min(100vw - 2.5rem, 880px); margin-left: 50%; transform: translateX(-50%); }
.cf-prose .alignfull { max-width: 100vw; margin-left: 50%; transform: translateX(-50%); border-radius: 0; }
.cf-prose .aligncenter { margin-left: auto; margin-right: auto; }

.cf-pagination { margin-top: 3rem; display: flex; gap: 0.75rem; justify-content: center; }
.cf-pagination a, .cf-pagination span {
  font-family: var(--font-head);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--muted);
}
.cf-pagination a:hover { background: var(--surface-2); color: var(--navy); }
.cf-pagination .current { background: var(--blue-bg); color: var(--blue); }
