/*
Theme Name: Vermilleon
Theme URI: https://vermilleon.com
Author: Vermilleon
Author URI: https://vermilleon.com
Description: Bespoke editorial theme for the Vermilleon Journal — a faithful port of the vermilleon.com design system (Bodoni Moda / Geist, warm near-black + aged ivory + a single vermilion signal, film grain, machine-annotation register).
Version: 1.0.0
Requires at least: 6.4
Tested up to: 7.0
Requires PHP: 8.0
License: Proprietary
Text Domain: vermilleon
*/

/* ============================================================
   TOKENS — mirror app/globals.css
   ============================================================ */
:root {
  --ink:      #0B0908;
  --ink2:     #120F0D;
  --ink3:     #1A1613;
  --ivory:    #EBE4D3;
  --ivorydim: #C0B8A5;
  --stone:    #8B8477;
  --stone2:   #605A4F;
  --umber:    #3B3125;
  --verm:     #CE3A1E;
  --vermbright:#D93A1B;
  --line:     rgba(235, 228, 211, 0.10);
  --line2:    rgba(235, 228, 211, 0.05);

  --font-display: "Bodoni Moda", Georgia, "Times New Roman", serif;
  --font-sans:    "Geist", ui-sans-serif, system-ui, sans-serif;
  --font-mono:    "Geist Mono", ui-monospace, "SF Mono", monospace;

  --nav-h: 64px;
  --maxw: 1280px;
  --measure: 44rem;
  color-scheme: dark;
}

/* ============================================================
   RESET / BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
* { -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto !important; } }

body {
  margin: 0;
  background: var(--ink);
  color: var(--ivory);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
::selection { background: var(--verm); color: #0B0908; }
h1, h2, h3, h4, p, figure, ul, ol { margin: 0; }

/* film grain over everything (matches .grain::after) */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  opacity: 0.045; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ============================================================
   HELPERS
   ============================================================ */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
@media (min-width: 640px) { .container { padding: 0 40px; } }
.measure { max-width: var(--measure); }
.display { font-family: var(--font-display); font-weight: 600; line-height: 1.02; letter-spacing: -0.018em; text-wrap: balance; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.label { font-family: var(--font-mono); font-size: 0.66rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--stone); }
.tick { display: inline-block; width: 6px; height: 6px; background: var(--verm); }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 12px; z-index: 10000; background: var(--ink3); color: var(--ivory); padding: 8px 12px; border: 1px solid var(--line); }
/* keyboard focus — Safari renders no ring on links by default */
a:focus-visible, .nav-cta:focus-visible, .cta-btn:focus-visible, .footer-cta:focus-visible, .pagination .page-numbers:focus-visible { outline: 2px solid var(--ivory); outline-offset: 3px; border-radius: 1px; }
.entry-title a:focus-visible { background-size: 100% 1px; }

/* ============================================================
   NAV — mirror components/nav.tsx
   ============================================================ */
.site-nav { position: fixed; inset: 0 0 auto 0; z-index: 50; transition: background-color .5s ease, backdrop-filter .5s ease; background: transparent; }
.site-nav.scrolled { background: rgba(11, 9, 8, 0.72); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: var(--nav-h); max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
@media (min-width: 640px) { .nav-inner { padding: 0 40px; } }
.mark { width: 16px; height: 16px; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.wordmark-text { font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.34em; color: var(--ivory); }
.nav-links { display: flex; align-items: center; gap: 24px; }
.nav-links a { font-family: var(--font-mono); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.2em; text-decoration: none; }
.nav-links .nav-link { color: var(--ivorydim); transition: color .3s ease; }
.nav-links .nav-link:hover { color: var(--ivory); }
.nav-cta { display: inline-flex; align-items: center; gap: 8px; color: var(--ivory) !important; }
.nav-cta .dot { width: 4px; height: 4px; background: var(--verm); transition: transform .5s ease; }
.nav-cta:hover .dot { transform: scale(1.5); }
@media (max-width: 639px) { .nav-links .nav-link { display: none; } }

/* ============================================================
   MASTHEAD (blog index / archive header)
   ============================================================ */
.masthead { position: relative; padding: clamp(7.5rem, 15vh, 11rem) 0 clamp(2.6rem, 6vh, 4rem); border-bottom: 1px solid var(--line); }
.masthead .eyebrow { display: inline-flex; align-items: center; gap: 12px; margin-bottom: 1.4rem; }
.masthead h1 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.022em; line-height: 1.0; font-size: clamp(2.6rem, 7vw, 4.8rem); color: var(--ivory); max-width: 18ch; }
.masthead .dek { margin-top: 1.5rem; max-width: 42rem; color: var(--ivorydim); font-size: 1.06rem; line-height: 1.7; }
.masthead .dek em { color: var(--ivory); font-style: normal; }

/* ============================================================
   POST LIST — editorial, type-led
   ============================================================ */
.post-list { max-width: 52rem; margin: 0 auto; padding: 1rem 0 2rem; }
.entry { padding: 2.8rem 0; border-top: 1px solid var(--line); }
.entry:first-child { border-top: 0; }
.entry-eyebrow { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; font-family: var(--font-mono); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.2em; color: var(--stone); }
.entry-eyebrow a { color: var(--stone); text-decoration: none; }
.entry-eyebrow a:hover { color: var(--verm); }
.entry-eyebrow .sep { width: 4px; height: 4px; background: var(--stone2); border-radius: 0; }
.entry-title { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.018em; line-height: 1.05; font-size: clamp(1.7rem, 3.4vw, 2.5rem); margin: 0.7rem 0 0; color: var(--ivory); }
.entry-title a { color: inherit; text-decoration: none; background-image: linear-gradient(var(--verm), var(--verm)); background-size: 0% 1px; background-position: 0 100%; background-repeat: no-repeat; transition: background-size .4s ease; padding-bottom: 2px; }
.entry-title a:hover { background-size: 100% 1px; }
.entry-dek { margin-top: 0.9rem; max-width: 46rem; color: var(--ivorydim); font-size: 1.02rem; line-height: 1.7; }
.entry-more { display: inline-flex; align-items: center; gap: 8px; margin-top: 1.3rem; font-family: var(--font-mono); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.2em; color: var(--ivory); text-decoration: none; }
.entry-more .arrow { transition: transform .5s ease; }
.entry-more:hover .arrow { transform: translateX(4px); }
.entry-thumb { margin-top: 1.6rem; border: 1px solid var(--line); }
.entry-thumb img { width: 100%; }

/* empty state */
.empty { max-width: 52rem; margin: 0 auto; padding: 3rem 0 6rem; color: var(--stone); font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.06em; }

/* ============================================================
   SINGLE ARTICLE
   ============================================================ */
.article { padding-top: clamp(6.5rem, 12vh, 9rem); }
.article-head { max-width: var(--measure); margin: 0 auto; }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; font-family: var(--font-mono); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.2em; color: var(--stone); }
.breadcrumb a { color: var(--stone); text-decoration: none; }
.breadcrumb a:hover { color: var(--verm); }
.breadcrumb .sep { width: 4px; height: 4px; background: var(--stone2); }
.article-title { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; line-height: 1.03; font-size: clamp(2.3rem, 5.4vw, 3.5rem); color: var(--ivory); margin: 1.3rem 0 0; }
.article-lede { margin-top: 1.4rem; color: var(--ivorydim); font-size: 1.22rem; line-height: 1.55; font-family: var(--font-display); font-style: italic; font-weight: 500; }
.article-featured { max-width: 60rem; margin: 3rem auto 0; border: 1px solid var(--line); }
.article-body { max-width: var(--measure); margin: 0 auto; }

/* prose — mirror .prose-legal, generalized to WP markup */
.prose { color: var(--ivorydim); font-size: 1.05rem; line-height: 1.8; margin-top: 2.6rem; }
.prose > * + * { margin-top: 0.9em; }
.prose h1, .prose h2, .prose h3, .prose h4 { color: var(--ivory); }
.prose h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.7rem; letter-spacing: -.01em; margin: 2.2em 0 .5em; padding-top: 1.1em; border-top: 1px solid var(--line); }
.prose h3 { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .14em; font-size: .82rem; margin: 1.9em 0 .5em; }
.prose h4 { font-weight: 600; color: var(--ivorydim); font-size: .92rem; margin: 1.2em 0 .2em; }
.prose p { margin: .7em 0; }
.prose strong { color: var(--ivory); font-weight: 600; }
.prose em { font-style: italic; }
.prose a { color: var(--ivory); text-decoration: underline; text-decoration-color: rgba(235,228,211,.25); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--verm); }
.prose ul, .prose ol { margin: .6em 0 1.1em; padding-left: 1.3em; }
.prose li { margin: .3em 0; }
.prose li::marker { color: var(--verm); }
.prose code { font-family: var(--font-mono); font-size: .85em; background: rgba(235,228,211,.06); border: 1px solid var(--line); border-radius: 4px; padding: .05em .4em; color: #e7dcc8; }
.prose pre { background: var(--ink2); border: 1px solid var(--line); border-radius: 8px; padding: 18px; overflow-x: auto; }
.prose pre code { background: none; border: 0; padding: 0; }
.prose blockquote { background: rgba(235,228,211,.03); border: 1px solid var(--line); border-left: 2px solid var(--verm); padding: 18px 22px; margin: 1.5em 0; }
.prose blockquote p:first-child { margin-top: 0; } .prose blockquote p:last-child { margin-bottom: 0; }
.prose hr { border: 0; height: 1px; background: var(--line); margin: 2em 0; }
.prose img { border: 1px solid var(--line); margin: 1.5em 0; }
.prose figure { margin: 1.5em 0; }
.prose figcaption { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .06em; color: var(--stone); margin-top: .6em; text-transform: uppercase; }
.prose table { width: 100%; border-collapse: collapse; font-size: .85rem; margin: 1.2em 0; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 10px 13px; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { color: var(--ivory); font-weight: 600; font-family: var(--font-mono); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }

/* WordPress core-block niceties inside prose */
.prose .wp-block-pullquote { border: 0; border-left: 2px solid var(--verm); padding: 4px 22px; }
.prose .wp-block-image { margin: 1.5em 0; }
.prose .wp-block-separator { border: 0; height: 1px; background: var(--line); }
.prose .wp-block-button__link { display: inline-block; font-family: var(--font-mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .18em; color: var(--ivory); border: 1px solid var(--line); padding: 12px 20px; text-decoration: none; }
.prose .wp-block-button__link:hover { border-color: var(--verm); }

/* article foot: product CTA + prev/next */
.article-foot { max-width: var(--measure); margin: 3.5rem auto 0; }
.cta-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; border: 1px solid var(--line); background: rgba(235,228,211,.02); padding: 28px 30px; }
.cta-card .cta-copy { max-width: 34ch; }
.cta-card .cta-eyebrow { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.cta-card .cta-line { font-family: var(--font-display); font-size: 1.35rem; line-height: 1.2; color: var(--ivory); }
.cta-btn { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.2em; color: var(--ivory); text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 6px; transition: border-color .4s ease; white-space: nowrap; }
.cta-btn:hover { border-color: var(--verm); }
.cta-btn .arrow { transition: transform .5s ease; }
.cta-btn:hover .arrow { transform: translateX(4px); }

.postnav { display: flex; justify-content: space-between; gap: 20px; margin-top: 2.6rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.postnav a { text-decoration: none; max-width: 46%; }
.postnav .pn-label { font-family: var(--font-mono); font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.2em; color: var(--stone); }
.postnav .pn-title { display: block; margin-top: 6px; font-family: var(--font-display); font-size: 1.05rem; color: var(--ivorydim); line-height: 1.3; }
.postnav a:hover .pn-title { color: var(--ivory); }
.postnav .next { text-align: right; margin-left: auto; }

/* ============================================================
   PAGE (generic) uses .prose too
   ============================================================ */
.page-wrap { padding-top: clamp(6.5rem, 12vh, 9rem); }
.page-title { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; line-height: 1.03; font-size: clamp(2.2rem, 5vw, 3.4rem); color: var(--ivory); max-width: var(--measure); margin: 0 auto; }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination { max-width: 52rem; margin: 1rem auto 0; padding: 2rem 0 1rem; border-top: 1px solid var(--line); display: flex; gap: 10px; flex-wrap: wrap; font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; }
.pagination .page-numbers { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; padding: 0 10px; border: 1px solid var(--line); color: var(--ivorydim); text-decoration: none; transition: border-color .3s ease, color .3s ease; }
.pagination .page-numbers:hover { color: var(--ivory); border-color: var(--stone2); }
.pagination .page-numbers.current { color: var(--ink); background: var(--ivory); border-color: var(--ivory); }

/* ============================================================
   FOOTER — mirror components/footer.tsx
   ============================================================ */
.site-footer { position: relative; border-top: 1px solid var(--line); padding: 80px 0 56px; margin-top: clamp(4rem, 10vh, 8rem); }
.footer-grid { display: flex; flex-direction: column; gap: 56px; }
@media (min-width: 768px) { .footer-grid { flex-direction: row; align-items: flex-end; justify-content: space-between; } }
.footer-brand { max-width: 28rem; }
.footer-word { display: flex; align-items: center; gap: 12px; color: var(--ivory); }
.footer-word .mark { width: 20px; height: 20px; }
.footer-word span { font-family: var(--font-display); font-size: 1.5rem; }
.footer-tag { margin-top: 20px; font-size: 0.875rem; line-height: 1.7; color: var(--stone); }
.footer-cta { display: inline-flex; align-items: center; gap: 12px; margin-top: 32px; font-family: var(--font-mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.2em; color: var(--ivory); text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 4px; transition: border-color .4s ease; }
.footer-cta:hover { border-color: var(--verm); }
.footer-cta .arrow { transition: transform .5s ease; }
.footer-cta:hover .arrow { transform: translateX(4px); }
.footer-nav { display: flex; gap: 56px; font-family: var(--font-mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--stone); }
.footer-nav .col { display: flex; flex-direction: column; gap: 12px; }
.footer-nav .col-head { color: var(--stone); }
.footer-nav a { color: var(--stone); text-decoration: none; transition: color .3s ease; }
.footer-nav a:hover { color: var(--ivory); }
.footer-bottom { display: flex; flex-direction: column; gap: 16px; margin-top: 64px; padding-top: 32px; border-top: 1px solid var(--line); font-size: 0.68rem; color: var(--stone); }
@media (min-width: 640px) { .footer-bottom { flex-direction: row; justify-content: space-between; } }
.footer-bottom .disclaimer { max-width: 64ch; line-height: 1.6; }
.footer-bottom .copy { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.14em; white-space: nowrap; }

/* WordPress admin bar offset */
body.admin-bar .site-nav { top: 32px; }
@media (max-width: 782px) { body.admin-bar .site-nav { top: 46px; } }
