/*
Theme Name: CMG Journal
Theme URI: https://confluencemediagroup.net/blog/
Author: Confluence Media Group
Author URI: https://confluencemediagroup.net/
Description: The house journal theme for Confluence Media Group. Dark CMG parent chrome (matching the static site at the domain root) with a light, readable article surface and a per-category accent layer so each imprint threads its own color (gardening→forest, foraging→oxblood, flock→ochre, …) while the house frame stays constant. Built to be the durable home for CMG's blogging routines.
Version: 1.0.0
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: cmg-journal
*/

/* ============================================================
   Design tokens — mirrored from the static site (globals.css)
   ============================================================ */
:root {
  /* CMG parent (neutral house spine) */
  --cmg-bg: #0B0B0C;
  --cmg-ink: #F4EFE7;
  --cmg-muted: #A39C90;
  --cmg-accent: #EAE4D8;
  --cmg-hair: rgba(244, 239, 231, 0.13);

  /* Light reading surface (house-neutral warm paper) */
  --paper: #F6F1E6;
  --paper-2: #F7F0DE;       /* card */
  --paper-3: #EDE4CF;
  --ink: #2A2A2E;           /* slate */
  --ink-2: #3B3B41;
  --mute: #6F6A5B;
  --hair: rgba(42, 42, 46, 0.15);
  --hair-2: rgba(42, 42, 46, 0.26);

  /* Imprint / topic accents (set per-post; default = house slate) */
  --forest: #2D4A36;        /* Gardening */
  --oxblood: #7C2128;       /* Foraging */
  --ochre: #B8821A;         /* Flock */
  --ember: #D8762E;         /* Creative */
  --accent: #2A2A2E;        /* default house accent; overridden inline per category */

  --max: 1120px;
  --read: 720px;            /* article reading column */
  --radius: 8px;
  --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(--ink); font-weight: 600; }
p { margin: 0 0 1.15em; }
hr { border: 0; border-top: 1px solid var(--hair); margin: 2em 0; }
.cmg-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; }

/* ============================================================
   House header (dark CMG chrome — matches the static site)
   ============================================================ */
.cmg-header {
  background: var(--cmg-bg);
  color: var(--cmg-ink);
  border-bottom: 1px solid var(--cmg-hair);
}
.cmg-header__bar {
  max-width: var(--max);
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.cmg-wordmark {
  font-family: var(--serif);
  font-size: 0.84rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--cmg-ink);
  text-decoration: none;
  white-space: nowrap;
}
.cmg-nav { display: flex; align-items: center; gap: 26px; }
.cmg-nav ul, .cmg-nav__list { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 26px; }
.cmg-nav a {
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--cmg-muted);
  text-decoration: none;
  transition: color 0.18s ease;
}
.cmg-nav a:hover, .cmg-nav a[aria-current="page"] { color: var(--cmg-accent); }
.cmg-nav a.is-here { color: var(--cmg-ink); }
@media (max-width: 640px) {
  .cmg-nav { gap: 16px; }
  .cmg-nav a { font-size: 0.66rem; letter-spacing: 0.08em; }
  .cmg-wordmark { font-size: 0.72rem; letter-spacing: 0.16em; }
}

/* ============================================================
   Journal masthead (index / archive only)
   ============================================================ */
.journal-masthead {
  background: var(--cmg-bg);
  color: var(--cmg-ink);
  border-bottom: 1px solid var(--cmg-hair);
  padding: 38px 0 46px;
}
.journal-masthead__eyebrow {
  font-size: 0.66rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.22em; color: var(--cmg-muted);
}
.journal-masthead h1 {
  color: var(--cmg-ink);
  font-size: clamp(2.1rem, 5vw, 3.1rem);
  margin: 12px 0 0;
  letter-spacing: -0.01em;
}
.journal-masthead p {
  margin: 12px 0 0; max-width: 56ch;
  color: var(--cmg-muted); font-size: 1rem; line-height: 1.5;
}

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

/* ---- Post grid (index / archive) ---- */
.post-grid {
  display: grid; gap: 26px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.post-card {
  --accent: var(--ink);
  display: flex; flex-direction: column;
  background: var(--paper-2);
  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 18px 40px -28px rgba(0, 0, 0, 0.5);
  border-color: var(--hair-2);
}
.post-card__media { aspect-ratio: 16 / 9; background: var(--paper-3); 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(--ink); text-decoration: none; }
.post-card__title a:hover { color: var(--accent); }
.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.62rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  padding: 3px 9px; border-radius: 999px; text-decoration: none;
}
a.cat-chip:hover { background: color-mix(in srgb, var(--accent) 16%, 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(--accent);
  font-size: 0.82rem; color: var(--mute);
}
.article__meta .byline { font-weight: 700; color: var(--ink); }
.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(--accent); font-weight: 600;
}
.prose h2 { font-size: 1.62rem; margin: 1.7em 0 0.5em; }
.prose h3 { font-size: 1.28rem; margin: 1.5em 0 0.4em; }
.prose h2::after { content: ""; display: block; width: 44px; height: 3px; background: var(--accent); margin-top: 12px; border-radius: 2px; }
.prose a { color: var(--accent); 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(--accent);
  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 figure { margin: 1.6em 0; }
.prose figcaption { font-size: 0.82rem; color: var(--mute); margin-top: 8px; text-align: center; }
.prose code { background: var(--paper-3); padding: 0.12em 0.4em; border-radius: 4px; font-size: 0.9em; }
.prose pre { background: var(--cmg-bg); color: var(--cmg-ink); 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-3); flex-shrink: 0; }
.author-card__name { font-family: var(--serif); font-size: 1.1rem; color: var(--ink); 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(--accent); text-decoration: none; }
.back-link:hover { text-decoration: underline; }

/* ============================================================
   Pagination
   ============================================================ */
.cmg-pagination { display: flex; justify-content: center; gap: 8px; margin-top: 52px; flex-wrap: wrap; }
.cmg-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(--ink); font-size: 0.85rem; font-weight: 600;
}
.cmg-pagination .page-numbers.current { background: var(--accent); color: #fff; border-color: var(--accent); }
.cmg-pagination .page-numbers:hover:not(.current) { border-color: var(--hair-2); }

/* ============================================================
   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(--accent); color: #fff; font-weight: 700; cursor: pointer; }

/* ============================================================
   House footer (dark — matches the static site CmgFooter)
   ============================================================ */
.cmg-footer { background: var(--cmg-bg); color: #cfc8bd; }
.cmg-footer__grid {
  max-width: var(--max); margin: 0 auto; padding: 46px 24px 26px;
  display: grid; gap: 30px;
  grid-template-columns: 1.7fr 1fr 1fr 1fr;
}
.cmg-footer__brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 1.12rem; color: #fff; }
.cmg-footer__colophon { width: 26px; height: 26px; flex-shrink: 0; }
.cmg-footer__tagline { margin: 11px 0 0; max-width: 34ch; font-size: 0.83rem; line-height: 1.5; color: #8b857b; }
.cmg-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: #8b857b; }
.cmg-footer a { display: block; padding: 4px 0; font-size: 0.85rem; color: #cfc8bd; text-decoration: none; }
.cmg-footer a:hover { color: #fff; }
.cmg-footer__bottom { border-top: 1px solid var(--cmg-hair); padding: 18px; text-align: center; font-size: 0.77rem; color: #7c766c; }
@media (max-width: 860px) { .cmg-footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .cmg-footer__grid { grid-template-columns: 1fr; } }
