/*
Theme Name: TCA Journal
Theme URI: https://thomasclarkadvisor.com/
Author: Confluence Media Group
Author URI: https://confluencemediagroup.net/
Description: The post + page theme for thomasclarkadvisor.com — navy/gold chrome that matches the static Next.js hub front (header, footer, palette) so a blog post, the calculator page, and the hub pages read as one site. Warm paper reading surface, navy headings, gold accents. Forked from CMG Journal; re-skinned to the Thomas D. Clark "Social Security Decisions" palette. Publishing/education posture: Series 65 = author-bio disclosure only, no advisory CTA.
Version: 1.0.3
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
License: Proprietary — © Confluence Media Group LLC. All rights reserved.
Text Domain: tca-journal
*/

/* ============================================================
   Design tokens — mirrored from the Next site (tokens.ts / globals.css)
   ============================================================ */
:root {
  /* Navy chrome (matches TcaHeader / TcaFooter) */
  --navy: #00132D;
  --navy-2: #0A2A4E;
  --navy-ink: #c7d0de;      /* body text on navy */
  --navy-mute: #8b96a8;     /* muted text on navy */
  --navy-hair: rgba(247, 243, 234, 0.16);

  /* Warm paper reading surface */
  --paper: #F7F3EA;
  --card: #FCFAF4;
  --paper-2: #ECE4D4;
  --ink: #16243A;           /* body text on paper */
  --ink-2: #243349;
  --mute: #5B6472;
  --hair: rgba(0, 19, 45, 0.14);
  --hair-2: rgba(0, 19, 45, 0.24);

  /* Gold */
  --gold: #C6A052;
  --gold-d: #A8842F;        /* accent on light surfaces (links/chips/dropcap) */
  --gold-2: #D8B872;        /* gold on navy */

  /* Single brand accent on the reading surface (no per-imprint multicolor — TCA is one brand). */
  --accent: var(--gold-d);

  --max: 1120px;
  --read: 720px;            /* article reading column */
  --radius: 6px;
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", "Segoe UI", "Helvetica Neue", system-ui, sans-serif;
}

/* ============================================================
   Base
   ============================================================ */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.62;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-underline-offset: 2px; }
h1, h2, h3, h4 { font-family: var(--serif); line-height: 1.12; margin: 0; color: var(--navy); font-weight: 600; }
p { margin: 0 0 1.15em; }
hr { border: 0; border-top: 1px solid var(--hair); margin: 2em 0; }
.tcaj-wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 12px; top: 12px; background: #fff; padding: 8px 12px; z-index: 999; border-radius: 6px; }

/* ============================================================
   Navy header (matches the Next TcaHeader)
   ============================================================ */
.tcaj-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(0, 19, 45, 0.95);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--navy-hair);
}
.tcaj-header__bar {
  max-width: var(--max);
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.tcaj-logo,
.tcaj-header__bar .custom-logo-link { display: inline-flex; align-items: center; text-decoration: none; }
/* Match the Next TcaHeader exactly: 34px base, 40px at md (≥768px). max-height caps it so a
   plugin/LiteSpeed `img{height:auto}` in the WP environment can't blow the logo (and the header) up.
   MUST cover BOTH the fallback markup (.tcaj-logo img) AND WordPress's Customizer custom-logo
   output (img.custom-logo) — header.php uses the_custom_logo() whenever a logo is set, and WP
   renders that with its own classes + baked-in width/height attrs, bypassing .tcaj-logo entirely. */
.tcaj-logo img,
.tcaj-header__bar img.custom-logo { height: 34px; max-height: 34px; width: auto; display: block; }
@media (min-width: 768px) {
  .tcaj-logo img,
  .tcaj-header__bar img.custom-logo { height: 40px; max-height: 40px; }
}
/* Type-only fallback if the logo asset is missing */
.tcaj-wordmark { font-family: var(--serif); font-size: 1.05rem; font-weight: 600; color: #fff; text-decoration: none; }
.tcaj-wordmark span { font-size: 0.55rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.3em; color: var(--gold-2); margin-left: 6px; }
.tcaj-nav { display: flex; align-items: center; gap: 18px; }
.tcaj-nav ul, .tcaj-nav__list { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 18px; }
.tcaj-nav a {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--navy-ink);
  text-decoration: none;
  transition: color 0.18s ease;
}
.tcaj-nav a:hover, .tcaj-nav a[aria-current="page"], .tcaj-nav a.is-here { color: var(--gold-2); }
@media (max-width: 720px) {
  .tcaj-nav { gap: 13px; }
  .tcaj-nav a { font-size: 0.62rem; letter-spacing: 0.05em; }
}
@media (max-width: 520px) {
  /* Drop the dense pillar nav on phones; keep Blog + Calculator reachable. */
  .tcaj-nav a.tcaj-nav--secondary { display: none; }
}

/* ============================================================
   Masthead (index / archive / search)
   ============================================================ */
.tcaj-masthead {
  background: var(--navy);
  color: #fff;
  border-bottom: 1px solid var(--navy-hair);
  padding: 40px 0 48px;
  position: relative;
  overflow: hidden;
}
.tcaj-masthead__eyebrow {
  font-size: 0.66rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.22em; color: var(--gold-2);
}
.tcaj-masthead h1 {
  color: #fff;
  font-size: clamp(2.1rem, 5vw, 3.1rem);
  margin: 12px 0 0;
  letter-spacing: -0.01em;
}
.tcaj-masthead p {
  margin: 12px 0 0; max-width: 60ch;
  color: var(--navy-ink); font-size: 1rem; line-height: 1.5;
}

/* ============================================================
   Content shell
   ============================================================ */
.tcaj-main { padding: 46px 0 72px; }

/* ---- Post grid (index / archive) ---- */
.post-grid {
  display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.post-card {
  display: flex; flex-direction: column;
  background: var(--card);
  border: 1px solid var(--hair);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 44px -30px rgba(0, 19, 45, 0.5);
  border-color: var(--gold-d);
}
.post-card__media { aspect-ratio: 16 / 9; background: var(--paper-2); border-bottom: 1px solid var(--hair); }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; }
.post-card__body { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px 20px; flex: 1; }
.post-card__title { font-size: 1.16rem; }
.post-card__title a { color: var(--navy); text-decoration: none; }
.post-card__title a:hover { color: var(--gold-d); }
.post-card__excerpt { color: var(--mute); font-size: 0.92rem; line-height: 1.5; margin: 0; }
.post-card__meta { margin-top: auto; display: flex; align-items: center; gap: 10px; font-size: 0.74rem; color: var(--mute); padding-top: 6px; }

/* ---- Category chip ---- */
.cat-chip {
  display: inline-block;
  font-size: 0.6rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--gold-d);
  border: 1px solid color-mix(in srgb, var(--gold-d) 40%, transparent);
  background: color-mix(in srgb, var(--gold-d) 9%, transparent);
  padding: 3px 9px; border-radius: 999px; text-decoration: none;
}
a.cat-chip:hover { background: color-mix(in srgb, var(--gold-d) 17%, transparent); }

/* ============================================================
   Single post — reading surface
   ============================================================ */
.article { max-width: var(--read); margin: 0 auto; }
.article__head { margin-bottom: 30px; }
.article__kicker { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; }
.article__title { font-size: clamp(2rem, 4.6vw, 2.85rem); letter-spacing: -0.012em; }
.article__dek { font-family: var(--serif); font-style: italic; color: var(--ink-2); font-size: 1.2rem; line-height: 1.45; margin: 16px 0 0; }
.article__meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px;
  margin-top: 20px; padding-top: 18px; border-top: 2px solid var(--gold-d);
  font-size: 0.82rem; color: var(--mute);
}
.article__meta .byline { font-weight: 700; color: var(--navy); }
.article__hero { margin: 0 0 30px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--hair); }

/* prose */
.prose { font-size: 1.06rem; line-height: 1.72; color: var(--ink); }
.prose > p:first-of-type::first-letter {
  font-family: var(--serif); float: left; font-size: 3.3em; line-height: 0.82;
  padding: 0.06em 0.12em 0 0; color: var(--gold-d); font-weight: 600;
}
.prose h2 { font-size: 1.62rem; margin: 1.7em 0 0.5em; color: var(--navy); }
.prose h3 { font-size: 1.28rem; margin: 1.5em 0 0.4em; color: var(--navy); }
.prose h2::after { content: ""; display: block; width: 44px; height: 3px; background: var(--gold-d); margin-top: 12px; border-radius: 2px; }
.prose a { color: var(--gold-d); font-weight: 600; }
.prose ul, .prose ol { margin: 0 0 1.15em; padding-left: 1.3em; }
.prose li { margin: 0.3em 0; }
.prose blockquote {
  margin: 1.6em 0; padding: 4px 0 4px 22px;
  border-left: 3px solid var(--gold-d);
  font-family: var(--serif); font-style: italic; font-size: 1.18rem; color: var(--ink-2);
}
.prose img, .prose figure { border-radius: var(--radius); margin: 1.6em 0; }
.prose figcaption { font-size: 0.82rem; color: var(--mute); margin-top: 8px; text-align: center; }
.prose code { background: var(--paper-2); padding: 0.12em 0.4em; border-radius: 4px; font-size: 0.9em; }
.prose pre { background: var(--navy); color: #fff; padding: 18px; border-radius: var(--radius); overflow: auto; }
.prose pre code { background: none; padding: 0; }

/* article footer (author card + back link) */
.article__foot { max-width: var(--read); margin: 48px auto 0; padding-top: 26px; border-top: 1px solid var(--hair); }
.author-card { display: flex; gap: 16px; align-items: flex-start; }
.author-card__avatar { width: 64px; height: 64px; border-radius: 999px; object-fit: cover; border: 1px solid var(--hair); background: var(--paper-2); flex-shrink: 0; }
.author-card__name { font-family: var(--serif); font-size: 1.1rem; color: var(--navy); margin: 0 0 4px; }
.author-card__bio { font-size: 0.9rem; color: var(--mute); margin: 0; line-height: 1.5; }
.back-link { display: inline-block; margin-top: 30px; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; color: var(--gold-d); text-decoration: none; }
.back-link:hover { text-decoration: underline; }

/* ---- Cross-sell strip on posts (book + calculator) ---- */
.tcaj-crosssell {
  max-width: var(--read); margin: 44px auto 0;
  display: grid; gap: 14px; grid-template-columns: 1fr 1fr;
}
.tcaj-crosssell__card {
  display: block; padding: 20px; border-radius: var(--radius);
  background: var(--navy); color: #fff; text-decoration: none;
  border: 1px solid var(--navy-hair);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.tcaj-crosssell__card:hover { transform: translateY(-3px); box-shadow: 0 22px 44px -30px rgba(0, 19, 45, 0.6); }
.tcaj-crosssell__eyebrow { font-size: 0.6rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.18em; color: var(--gold-2); }
.tcaj-crosssell__title { font-family: var(--serif); font-size: 1.18rem; color: #fff; margin: 8px 0 6px; }
.tcaj-crosssell__cta { font-size: 0.82rem; font-weight: 700; color: var(--gold-2); }
@media (max-width: 560px) { .tcaj-crosssell { grid-template-columns: 1fr; } }

/* ============================================================
   Pagination
   ============================================================ */
.tcaj-pagination { display: flex; justify-content: center; gap: 8px; margin-top: 52px; flex-wrap: wrap; }
.tcaj-pagination .page-numbers {
  min-width: 40px; text-align: center; padding: 8px 12px;
  border: 1px solid var(--hair); border-radius: 6px; text-decoration: none;
  color: var(--navy); font-size: 0.85rem; font-weight: 600;
}
.tcaj-pagination .page-numbers.current { background: var(--navy); color: #fff; border-color: var(--navy); }
.tcaj-pagination .page-numbers:hover:not(.current) { border-color: var(--gold-d); }

/* ============================================================
   Page (static) + search + 404
   ============================================================ */
.page-body { max-width: var(--read); margin: 0 auto; }
.page-title { font-size: clamp(2rem, 4.4vw, 2.7rem); margin-bottom: 8px; }
.notice { max-width: var(--read); margin: 0 auto; text-align: center; padding: 40px 0; }
.notice h1 { font-size: 2.2rem; margin-bottom: 10px; }
.notice p { color: var(--mute); }
.search-form { display: flex; gap: 8px; max-width: 420px; margin: 18px auto 0; }
.search-form input[type="search"] { flex: 1; padding: 10px 14px; border: 1px solid var(--hair-2); border-radius: 6px; font-size: 0.95rem; background: #fff; }
.search-form button { padding: 10px 18px; border: 0; border-radius: 6px; background: var(--navy); color: #fff; font-weight: 700; cursor: pointer; }

/* ============================================================
   Navy footer (matches the Next TcaFooter — disclaimer + columns)
   ============================================================ */
.tcaj-footer { background: var(--navy); color: var(--navy-ink); }
.tcaj-footer__grid {
  max-width: var(--max); margin: 0 auto; padding: 48px 24px 30px;
  display: grid; gap: 30px;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
}
.tcaj-footer__brand img { height: 40px; width: auto; }
.tcaj-footer__tagline { margin: 16px 0 0; max-width: 40ch; font-size: 0.83rem; line-height: 1.55; color: var(--navy-mute); }
/* a.tcaj-footer__email (0,2,1) so the gold beats the generic `.tcaj-footer a` (#c7d0de, 0,1,1)
   rule below. Without this the email link renders pale blue instead of gold, flattening the
   footer and mismatching the Next footer's gold email link. */
.tcaj-footer a.tcaj-footer__email { margin-top: 12px; display: inline-block; font-size: 0.82rem; color: var(--gold-2); text-decoration: none; }
.tcaj-footer a.tcaj-footer__email:hover { color: #fff; }
.tcaj-footer h5 { font-family: var(--sans); margin: 0 0 14px; font-size: 0.64rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.17em; color: var(--gold-2); }
.tcaj-footer a { display: block; padding: 4px 0; font-size: 0.85rem; color: var(--navy-ink); text-decoration: none; }
.tcaj-footer a:hover { color: #fff; }
.tcaj-footer__legal { border-top: 1px solid var(--navy-hair); }
.tcaj-footer__legal-inner { max-width: var(--max); margin: 0 auto; padding: 20px 24px; }
.tcaj-footer__disclaimer { max-width: 92ch; font-size: 0.72rem; line-height: 1.6; color: var(--navy-mute); margin: 0 0 10px; }
.tcaj-footer__copy { margin-top: 14px; font-size: 0.72rem; color: #6f7a8c; }
@media (max-width: 860px) { .tcaj-footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .tcaj-footer__grid { grid-template-columns: 1fr; } }
