/* Theme "apex": an original, fully dark briefing-room premium-news
   identity — built from scratch for this network. Near-black background
   throughout (not just the header, unlike every other theme this session),
   a saturated violet spot color, and italic Playfair Display serif
   headlines for an after-hours-newsroom feel. The homepage hero is a
   numbered "Top Stories" stack (pure ranked typography, no imagery) beside
   a single large "Spotlight" image card — a structural break from the
   lead-story layouts every other theme uses. --accent is the site's
   configurable color (drives numerals, rules, buttons, links); overridden
   per-site by documentShell's inline :root style. Playfair Display + Inter
   are the only two webfonts this network loads globally, via
   documentShell. Same
   renderHome/renderCategory/renderPost/renderTag/renderSearch/renderAbout
   contract as every other theme (see functions/_themes/apex.js). */

:root {
  --ink-900:#f5f5f7; --ink-800:#e2e2e8; --ink-700:#c2c2cc; --ink-600:#9a9aa6;
  --ink-500:#76767f; --ink-400:#57575f; --ink-300:#3a3a42; --ink-200:#26262d; --ink-100:#1a1a20;
  --paper:#0d0d12; --paper-raised:#151519;
  --accent: #7c3aed; /* overridden per-site by documentShell's inline :root style */
  --radius: 3px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--paper); color: var(--ink-900); }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4, p { margin: 0; }
ul { list-style: none; margin: 0; padding: 0; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ---- Placeholder image system ---- */
.ph {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 100%; object-fit: cover; overflow: hidden; border-radius: var(--radius);
  background: linear-gradient(135deg,#1c1a24,#302b40 60%,#1c1a24); color: rgba(255,255,255,.28);
}
.ph.tone-a { background: linear-gradient(135deg,#241830,#3d2850 60%,#241830); }
.ph.tone-b { background: linear-gradient(135deg,#0f1f22,#1a3438 60%,#0f1f22); }
.ph.tone-c { background: linear-gradient(135deg,#231517,#3d2226 60%,#231517); }
.ph svg { width: 24%; }
img.ph { background: none; }
.ratio-16-9 { aspect-ratio: 16/9; }
.ratio-4-3 { aspect-ratio: 4/3; }
.ratio-1-1 { aspect-ratio: 1/1; }
.ratio-3-2 { aspect-ratio: 3/2; }

/* ---- Utility bar ---- */
.utility-bar { background: #000; color: var(--ink-600); font-size: 12px; border-bottom: 1px solid var(--ink-200); }
.utility-bar .wrap { display: flex; align-items: center; justify-content: space-between; height: 34px; gap: 12px; flex-wrap: wrap; }
.utility-date { color: var(--ink-500); letter-spacing: .01em; }
.utility-right { display: flex; align-items: center; gap: 12px; }
.utility-right a:not(.btn-subscribe) { color: var(--ink-600); font-weight: 600; }
.utility-right a:not(.btn-subscribe):hover { color: var(--ink-900); }
.icon-dot { width: 20px; height: 20px; border-radius: 50%; background: var(--ink-200); display: inline-flex; align-items: center; justify-content: center; font-size: 9.5px; font-weight: 800; color: var(--ink-800); }
.icon-dot:hover { background: var(--accent); color: #fff; }
.btn-subscribe { background: var(--accent); color: #fff; font-weight: 800; font-size: 11px; letter-spacing: .02em; padding: 4px 12px; border-radius: 3px; }
.btn-subscribe:hover { filter: brightness(1.12); }

/* ---- Masthead ---- */
.masthead { background: var(--paper); border-bottom: 1px solid var(--ink-200); }
.masthead .wrap { display: flex; justify-content: center; padding: 26px 20px 22px; }
.logo-group { display: flex; align-items: center; gap: 14px; }
.logo-box { width: 48px; height: 48px; border-radius: 3px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-family: 'Playfair Display', Georgia, serif; font-style: italic; font-weight: 800; font-size: 21px; }
.logo-img { height: 72px; width: auto; max-width: 420px; object-fit: contain; }
.site-name { font-family: 'Playfair Display', Georgia, serif; font-style: italic; font-weight: 800; font-size: clamp(26px,3.6vw,38px); letter-spacing: -0.01em; color: var(--ink-900); }
.site-tagline { font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-500); margin-top: 3px; }

/* ---- Primary nav ---- */
.primary-nav { background: var(--paper-raised); border-bottom: 1px solid var(--ink-200); }
.primary-nav .wrap { display: flex; justify-content: center; }
.nav-list { display: flex; align-items: stretch; flex-wrap: wrap; justify-content: center; }
.nav-list a { display: flex; align-items: center; height: 44px; padding: 0 16px; color: var(--ink-700); font-weight: 600; font-size: 13px; border-bottom: 2px solid transparent; white-space: nowrap; }
.nav-list a:hover, .nav-list a.home { color: var(--ink-900); border-bottom-color: var(--accent); }

/* ---- Kickers & meta ---- */
.kicker-label { font-size: 10.5px; font-weight: 800; letter-spacing: .08em; color: var(--accent); }
.row-kicker { margin-bottom: 7px; }
.meta-row { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; font-size: 11.5px; color: var(--ink-500); }
.meta-row .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-400); }
.editors-pick { display: inline-block; background: var(--accent); color: #fff; font-size: 9.5px; font-weight: 800; letter-spacing: .05em; padding: 3px 8px; border-radius: 3px; margin-left: 6px; }

/* ---- Hero: Top Stories stack + Spotlight card ---- */
.hero-section { padding: 36px 0 8px; }
.hero-wrap { display: grid; grid-template-columns: 1.5fr 1fr; gap: 40px; align-items: start; }
.top-stack { display: flex; flex-direction: column; }
.stack-label { font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-500); padding-bottom: 12px; margin-bottom: 6px; border-bottom: 2px solid var(--ink-200); }
.top-item { display: grid; grid-template-columns: 40px 1fr; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--ink-200); align-items: start; }
.top-item:first-child { padding-top: 0; }
.top-item:last-child { border-bottom: none; padding-bottom: 0; }
.top-num { font-family: 'Playfair Display', Georgia, serif; font-style: italic; font-weight: 800; font-size: 26px; color: var(--accent); line-height: 1.2; }
.top-body h2 { font-family: 'Playfair Display', Georgia, serif; font-style: italic; font-weight: 700; font-size: 21px; line-height: 1.28; color: var(--ink-900); margin: 0 0 8px; }
.top-body h2 a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.spotlight-card { display: block; background: var(--paper-raised); border: 1px solid var(--ink-200); border-radius: var(--radius); overflow: hidden; }
.spotlight-body { padding: 18px; }
.spotlight-flag { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.spotlight-body h3 { font-family: 'Playfair Display', Georgia, serif; font-style: italic; font-weight: 700; font-size: 19px; line-height: 1.3; color: var(--ink-900); }
.spotlight-card:hover .spotlight-body h3 { text-decoration: underline; text-decoration-color: var(--accent); }

/* ---- Sections ---- */
.section { padding: 40px 0; }
.section-rule { border-top: 1px solid var(--ink-200); border-bottom: 1px solid var(--ink-200); background: var(--paper-raised); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; padding-bottom: 10px; border-bottom: 2px solid var(--ink-200); }
.section-title { font-family: 'Playfair Display', Georgia, serif; font-style: italic; font-size: 21px; font-weight: 700; color: var(--ink-900); }
.section-viewall { font-size: 12px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.section-viewall:hover { text-decoration: underline; }

/* ---- Briefs: key-line callout cards ---- */
.brief-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: 22px; }
.brief-card { background: var(--paper-raised); border: 1px solid var(--ink-200); border-radius: var(--radius); padding: 18px; }
.brief-card h3 { font-family: 'Playfair Display', Georgia, serif; font-style: italic; font-weight: 700; font-size: 16px; line-height: 1.32; color: var(--ink-900); margin: 0 0 10px; }
.brief-card h3 a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.key-line { border-left: 3px solid var(--accent); padding-left: 11px; font-size: 13px; font-weight: 600; color: var(--ink-700); line-height: 1.5; margin: 0 0 12px; }

/* ---- Type row: dense reading list ---- */
.type-list { display: flex; flex-direction: column; }
.type-row { display: grid; grid-template-columns: 1fr; align-items: start; gap: 12px; padding: 15px 0; border-bottom: 1px solid var(--ink-200); }
.type-row.has-num { grid-template-columns: 28px 1fr; }
.type-row:first-child { padding-top: 0; }
.type-row:last-child { border-bottom: none; padding-bottom: 0; }
.row-num { font-family: 'Playfair Display', Georgia, serif; font-style: italic; font-weight: 800; font-size: 18px; color: var(--ink-400); line-height: 1.3; }
.row-body h3 { font-weight: 700; font-size: 15.5px; line-height: 1.34; color: var(--ink-900); margin: 0 0 6px; }
.row-body h3 a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.row-body p { font-size: 13px; color: var(--ink-600); line-height: 1.55; margin: 0 0 6px; }
.ranked-list .type-row { padding: 11px 0; }
.ranked-list .row-body h3 { font-size: 14px; }

/* ---- Main grid: feed + sidebar ---- */
.main-grid { display: grid; grid-template-columns: 1fr 320px; gap: 36px; align-items: start; }

/* ---- Sidebar widgets ---- */
.sidebar { display: flex; flex-direction: column; }
.widget { background: var(--paper-raised); border: 1px solid var(--ink-200); padding: 20px; margin-bottom: 20px; border-radius: var(--radius); }
.widget h3 { font-size: 13px; font-weight: 800; color: var(--ink-900); margin-bottom: 14px; text-transform: uppercase; letter-spacing: .03em; padding-bottom: 10px; border-bottom: 2px solid var(--ink-200); }
.newsletter-widget { background: linear-gradient(160deg, var(--ink-100), var(--paper-raised)); border-color: var(--accent); }
.newsletter-widget h3 { border-bottom-color: var(--accent); }
.newsletter-widget p { font-size: 12.5px; color: var(--ink-600); line-height: 1.5; margin-bottom: 12px; }
.newsletter-form { display: flex; flex-direction: column; gap: 9px; }
.newsletter-form input { padding: 10px 12px; border-radius: 3px; border: 1px solid var(--ink-300); background: var(--ink-100); color: var(--ink-900); font-size: 13px; font-family: inherit; }
.newsletter-form input::placeholder { color: var(--ink-500); }
.newsletter-form button { background: var(--accent); color: #fff; padding: 10px; border-radius: 3px; font-weight: 800; font-size: 13px; cursor: pointer; border: none; }
.newsletter-form button:hover:not(:disabled) { filter: brightness(1.1); }
.newsletter-fine { font-size: 10.5px; color: var(--ink-500); margin-top: 9px; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-cloud a { background: var(--ink-100); border: 1px solid var(--ink-300); border-radius: 3px; padding: 5px 12px; font-size: 12px; font-weight: 700; color: var(--ink-700); }
.tag-cloud a:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.ad-widget { border: 1px dashed var(--ink-300); background: transparent; text-align: center; color: var(--ink-500); font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: 48px 10px; border-radius: var(--radius); }

/* ---- Category / tag / search listing pages ---- */
.category-title { font-family: 'Playfair Display', Georgia, serif; font-style: italic; font-size: 28px; font-weight: 700; color: var(--ink-900); margin: 0 0 18px; }
.search-form { display: flex; gap: 10px; margin: 0 0 24px; max-width: 520px; }
.search-form input { flex: 1; padding: 11px 15px; border: 1px solid var(--ink-300); border-radius: 3px; font-size: 14.5px; font-family: inherit; background: var(--ink-100); color: var(--ink-900); }
.search-form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.search-form button { background: var(--accent); color: #fff; border: none; border-radius: 3px; padding: 0 20px; font-weight: 700; cursor: pointer; }
.pagination { display: flex; justify-content: space-between; margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--ink-200); font-weight: 700; font-size: 13px; }
.pagination a { color: var(--accent); }
.empty-state { text-align: center; padding: 76px 20px; color: var(--ink-500); }
.empty-state h1 { color: var(--ink-900); font-family: 'Playfair Display', Georgia, serif; font-style: italic; font-size: 25px; margin-bottom: 8px; }
.btn { display: inline-block; margin-top: 14px; background: var(--accent); color: #fff; padding: 9px 18px; border-radius: 3px; font-weight: 700; font-size: 13px; }

/* ---- Single post ---- */
.single-post { max-width: 720px; margin: 0 auto; }
.breadcrumb { font-size: 11.5px; color: var(--ink-500); margin-bottom: 14px; }
.breadcrumb a { font-weight: 700; color: var(--ink-700); }
.single-post-header h1 { font-family: 'Playfair Display', Georgia, serif; font-style: italic; font-size: clamp(25px,3.8vw,36px); line-height: 1.22; margin: 8px 0 14px; color: var(--ink-900); font-weight: 700; }
.single-post-headline { width: 100%; max-height: 440px; object-fit: cover; margin: 20px 0 26px; border-radius: var(--radius); }
.single-post-content { font-size: 17px; color: var(--ink-800); }
.single-post-content p { margin: 0 0 20px; }
.single-post-content h2 { font-family: 'Playfair Display', Georgia, serif; font-style: italic; font-size: 22px; margin: 30px 0 12px; font-weight: 700; color: var(--ink-900); }
.single-post-content h3 { font-size: 18px; margin: 22px 0 10px; font-weight: 700; color: var(--ink-900); }
.single-post-content img { margin: 22px 0; width: 100%; border-radius: var(--radius); }
.single-post-content a { color: var(--accent); text-decoration: underline; }
.single-post-content blockquote { border-left: 3px solid var(--accent); margin: 24px 0; padding-left: 18px; font-style: italic; color: var(--ink-600); }

.post-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--ink-200); }
.tag-pill-link { background: var(--ink-100); color: var(--ink-700); font-size: 12px; font-weight: 700; padding: 5px 13px; border-radius: 3px; }
.tag-pill-link:hover { background: var(--accent); color: #fff; }

.related-posts { max-width: 720px; margin: 50px auto 0; border-top: 1px solid var(--ink-200); padding-top: 24px; }
.related-posts h2 { font-family: 'Playfair Display', Georgia, serif; font-style: italic; font-size: 18px; margin-bottom: 14px; font-weight: 700; color: var(--ink-900); }

/* ---- Layout wrapper for inner pages ---- */
.page-layout { max-width: 1200px; margin: 0 auto; padding: 32px 20px 56px; }

/* ---- Footer ---- */
.site-footer { background: #000; color: var(--ink-500); padding: 42px 0 0; margin-top: 8px; border-top: 1px solid var(--ink-200); }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1.3fr; gap: 30px; padding-bottom: 26px; border-bottom: 1px solid var(--ink-200); }
.footer-grid h4 { color: var(--ink-800); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; margin: 0 0 13px; }
.footer-grid p { font-size: 12.5px; color: var(--ink-500); line-height: 1.6; }
.footer-grid ul { display: flex; flex-direction: column; gap: 8px; }
.footer-grid li a:hover { color: var(--ink-900); }
.footer-logo { font-family: 'Playfair Display', Georgia, serif; font-style: italic; font-weight: 800; font-size: 20px; color: var(--ink-900); margin-bottom: 9px; }
.footer-social { display: flex; gap: 8px; margin-top: 12px; }
.footer-recent-item { display: flex; flex-direction: column; gap: 2px; margin-bottom: 12px; }
.footer-recent-item a { font-size: 12.5px; font-weight: 600; line-height: 1.4; color: var(--ink-700); }
.footer-recent-item a:hover { color: var(--ink-900); }
.footer-recent-item span { font-size: 11px; color: var(--ink-500); }
.footer-bottom { padding: 16px 0; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 11.5px; color: var(--ink-500); }

@media (max-width: 1080px) {
  .main-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .hero-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .brief-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .type-row.has-num { grid-template-columns: 24px 1fr; }
  .top-item { grid-template-columns: 32px 1fr; }
}
