/* ============================================================
   jeradhill.com — THEME STYLES
   Base + brand utilities + chrome + shared components.
   Section-specific styles are grouped at the bottom.
   Consumes tokens.css.
   ============================================================ */

/* ---------- RESET / BASE ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font-family: var(--font-sans); font-size: var(--fs-body);
  line-height: var(--lh-body); font-weight: var(--fw-regular);
  color: var(--text-primary); background: var(--surface-page);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
body.nav-locked { overflow: hidden; }
h1,h2,h3,h4,h5,h6 {
  margin: 0; font-family: var(--font-display); font-weight: var(--fw-extrabold);
  line-height: var(--lh-heading); letter-spacing: var(--ls-heading);
  color: var(--text-primary); text-wrap: balance;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }
p { margin: 0 0 1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }
a { color: var(--link); text-decoration: none; transition: color var(--dur) var(--ease); }
a:hover { color: var(--link-hover); }
strong, b { font-weight: var(--fw-bold); }
img { max-width: 100%; display: block; }
ul, ol { margin: 0; padding: 0; }
::selection { background: var(--ink); color: #fff; }
:focus-visible { outline: none; box-shadow: var(--shadow-ring); border-radius: var(--radius-xs); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------- BRAND UTILITIES ---------- */
.jh-container { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); width: 100%; }
.jh-container-narrow { max-width: var(--container-narrow); margin-inline: auto; padding-inline: var(--gutter); width: 100%; }
.jh-eyebrow { font-family: var(--font-sans); font-weight: var(--fw-bold); font-size: var(--fs-eyebrow);
  letter-spacing: var(--ls-eyebrow); text-transform: uppercase; color: var(--text-secondary); margin: 0; }
.jh-section-title { font-family: var(--font-display); font-weight: var(--fw-extrabold); font-size: var(--fs-h3);
  line-height: var(--lh-heading); text-transform: uppercase; letter-spacing: 0.01em; }
.jh-display { font-family: var(--font-display); font-weight: var(--fw-black); font-size: var(--fs-display);
  line-height: var(--lh-tight); letter-spacing: var(--ls-display); text-transform: uppercase; }
.jh-wordmark { font-family: var(--font-display); font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: var(--ls-wordmark); }
.jh-quote { font-family: var(--font-serif); font-style: italic; font-weight: var(--fw-regular);
  font-size: var(--fs-h4); line-height: var(--lh-snug); }
.jh-lead { font-size: var(--fs-lead); line-height: var(--lh-relaxed); color: var(--text-secondary); }
.jh-icon { display: inline-flex; vertical-align: middle; flex: none; }

.surface-muted { background: var(--surface-muted); }
.surface-inverse { background: var(--surface-inverse); color: var(--text-inverse); }
/* On dark bands, headings/eyebrows must flip to light (element rules set ink). */
.surface-inverse h1, .surface-inverse h2, .surface-inverse h3, .surface-inverse h4,
.surface-inverse .jh-section-title, .surface-inverse .jh-display { color: var(--text-inverse); }
.surface-inverse .jh-eyebrow { color: var(--text-on-inverse-muted); }

.jh-section { padding-block: var(--section-y); }
.jh-section-head { margin-bottom: var(--space-12); max-width: 760px; }
.jh-section-head--center { margin-inline: auto; text-align: center; }
.jh-section-head .jh-eyebrow { margin-bottom: var(--space-3); }

.skip-link { position: absolute; left: -9999px; top: 0; z-index: 100; background: var(--ink); color: #fff; padding: 12px 20px; }
.skip-link:focus { left: 12px; top: 12px; }

/* ---------- BUTTONS ---------- */
.jhbtn, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  background: var(--action); color: var(--action-contrast); font-family: var(--font-sans);
  font-weight: var(--fw-bold); font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 15px 24px; border: 1px solid var(--action); border-radius: var(--radius-sm);
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease), transform var(--dur-fast) var(--ease);
}
.jhbtn:hover, .btn:hover { background: var(--action-hover); border-color: var(--action-hover); color: #fff; }
.jhbtn:active, .btn:active { transform: translateY(1px); }
.jhbtn--inverse, .btn--inverse { background: transparent; color: #fff; border-color: #fff; }
.jhbtn--inverse:hover, .btn--inverse:hover { background: #fff; color: var(--ink); }
.jhbtn--ghost, .btn--ghost { background: transparent; color: var(--ink); border-color: var(--border-ink); }
.jhbtn--ghost:hover, .btn--ghost:hover { background: var(--ink); color: #fff; }
.jhbtn--sm, .btn--sm { padding: 11px 18px; font-size: 11px; }

.jh-readmore { font-size: 12px; font-weight: var(--fw-extrabold); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink); }
.jh-readmore:hover { color: var(--accent); }
.jh-arrow-link { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: var(--fw-bold);
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink); }
.jh-arrow-link:hover { color: var(--accent); }

/* ---------- HEADER ---------- */
.site-header { position: sticky; top: 0; z-index: 40; background: var(--white); border-bottom: 1px solid var(--border); }
.site-header__inner { height: 72px; display: flex; align-items: center; justify-content: space-between; gap: var(--space-8); }
.site-header__brand { font-size: 18px; text-decoration: none; color: var(--ink); }
.site-nav { display: flex; align-items: center; gap: var(--space-8); }
.site-nav ul { list-style: none; display: flex; align-items: center; gap: 34px; margin: 0; padding: 0; }
.site-nav a { text-decoration: none; font-size: 12px; font-weight: var(--fw-bold); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); }
.site-nav a:hover, .site-nav .current-menu-item > a { color: var(--ink); }
.nav-toggle { display: none; background: none; border: 0; cursor: pointer; color: var(--ink); width: 44px; height: 44px; margin-right: -8px; align-items: center; justify-content: center; }
.nav-toggle .jh-icon:last-child { display: none; }

/* ---------- TWO-TONE WORDMARK LOCKUP ---------- */
.jh-lockup {
  display: inline-flex; align-items: baseline; font-family: var(--font-display);
  text-transform: uppercase; letter-spacing: var(--ls-wordmark); font-size: 18px; text-decoration: none;
}
.jh-lockup__prefix { font-weight: var(--fw-extrabold); color: var(--ink); }
.jh-lockup__rest { font-weight: var(--fw-medium); color: var(--n400); }

/* ---------- NEWSLETTER BAND ---------- */
.newsletter-band { background: var(--surface-muted); border-top: 1px solid var(--border); padding-block: var(--space-20); }
.newsletter-band__inner { max-width: 720px; margin-inline: auto; text-align: center; display: flex; flex-direction: column; align-items: center; }
.newsletter-band__avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; margin-bottom: var(--space-4); }
.newsletter-band__eyebrow { margin-bottom: var(--space-3); }
.newsletter-band__title { font-size: var(--fs-h3); text-transform: uppercase; margin-bottom: var(--space-3); }
.newsletter-band__desc { color: var(--text-secondary); max-width: 520px; margin-bottom: var(--space-6); }

/* ---------- FOOTER ---------- */
.site-footer { border-top: 1px solid var(--border); padding-block: var(--space-14) var(--space-10); background: var(--white); }
.site-footer__cols { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-10); }
.site-footer__cols--four { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
.site-footer__brand { font-size: 16px; letter-spacing: 0.2em; margin-bottom: var(--space-4); }
.site-footer__blurb { font-size: var(--fs-small); color: var(--text-muted); max-width: 280px; margin: 0; }
.site-footer__head { margin-bottom: var(--space-5); }
.site-footer__links { list-style: none; display: flex; flex-direction: column; gap: 11px; margin: 0; padding: 0; }
.site-footer__col a, .site-footer__links a { text-decoration: none; color: var(--text-secondary); font-size: var(--fs-small); white-space: nowrap; }
.site-footer__col a:hover, .site-footer__links a:hover { color: var(--accent); }
.site-footer__social { display: flex; gap: 10px; }
.site-footer__social a { width: 36px; height: 36px; background: var(--ink); border-radius: var(--radius-sm); display: grid; place-items: center; color: #fff; }
.site-footer__social a:hover { background: var(--n700); }
.site-footer__base { margin-top: var(--space-12); padding-top: var(--space-5); border-top: 1px solid var(--border); font-size: 12px; color: var(--text-muted); text-align: center; }

/* ---------- POST CARD (shared) ---------- */
.post-card { border: 1px solid var(--border); box-shadow: var(--shadow-sm); overflow: hidden; display: flex; flex-direction: column; background: var(--surface-card);
  transition: box-shadow var(--dur) var(--ease), transform var(--dur) var(--ease), border-color var(--dur) var(--ease); text-decoration: none; color: inherit; }
.post-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--border-strong); }
.post-card__media { position: relative; }
.post-card__img { aspect-ratio: 16 / 9; width: 100%; height: auto; object-fit: cover; display: block; background: var(--n100); }
.post-card__cat { position: absolute; top: 12px; right: 12px; background: var(--ink); color: #fff; font-size: 10px; font-weight: var(--fw-bold);
  letter-spacing: 0.08em; text-transform: uppercase; padding: 5px 10px; border-radius: var(--radius-pill); }
.post-card__avatar { position: absolute; left: 22px; bottom: -18px; width: 44px; height: 44px; border-radius: 50%; border: 2px solid #fff; overflow: hidden; background: var(--n200); object-fit: cover; }
.post-card__body { padding: 30px 22px 22px; display: flex; flex-direction: column; flex: 1; }
.post-card__title { font-size: 19px; text-transform: uppercase; line-height: 1.15; margin-bottom: 10px; }
.post-card__excerpt { font-size: 14px; color: var(--text-secondary); margin-bottom: 16px; flex: 1; }
.post-card__meta { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-muted); }
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }

/* ---------- FORM FIELDS (shared, for GF/FF restyle + native) ---------- */
.jh-input, .jh-textarea, .jh-select {
  width: 100%; font-family: var(--font-sans); font-size: 15px; color: var(--text-primary);
  background: var(--white); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 11px 14px; line-height: 1.4; outline: none;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); -webkit-appearance: none; appearance: none;
}
.jh-input:focus, .jh-textarea:focus, .jh-select:focus { border-color: var(--border-ink); box-shadow: var(--shadow-ring); }
.jh-textarea { min-height: 140px; resize: vertical; line-height: var(--lh-body); }
.jh-field-label { font-size: 12px; font-weight: var(--fw-bold); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-secondary); }

/* ---------- RESPONSIVE CHROME ---------- */
@media (max-width: 900px) {
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .site-footer__cols, .site-footer__cols--four { grid-template-columns: 1fr 1fr; }
  .site-footer__brandcol { grid-column: 1 / -1; }
}
@media (max-width: 780px) {
  .nav-toggle { display: inline-flex; }
  .site-nav { position: fixed; inset: 72px 0 auto 0; flex-direction: column; align-items: stretch; gap: 0;
    background: #fff; border-bottom: 1px solid var(--border); padding: var(--space-4) var(--gutter) var(--space-8);
    transform: translateY(-12px); opacity: 0; pointer-events: none; box-shadow: var(--shadow-md);
    transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease); }
  .site-nav.is-open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; width: 100%; }
  .site-nav li { border-bottom: 1px solid var(--border); }
  .site-nav a { display: block; padding: var(--space-4) 0; font-size: 14px; }
  body.nav-locked .nav-toggle .jh-icon:first-child { display: none; }
  body.nav-locked .nav-toggle .jh-icon:last-child { display: inline-flex; }
}
@media (max-width: 640px) {
  .post-grid { grid-template-columns: 1fr; }
  .site-footer__cols, .site-footer__cols--four { grid-template-columns: 1fr; gap: var(--space-8); }
}

/* ---------- NAV DROPDOWNS (submenus, depth 2) ---------- */
.site-nav li { position: relative; }
.site-nav .menu-item-has-children > a { display: inline-flex; align-items: center; gap: 5px; }
.site-nav .menu-item-has-children > a::after {
  content: ""; width: 7px; height: 7px; flex: none;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}
@media (min-width: 781px) {
  /* Full-height hit area so the pointer never crosses a gap on the way down */
  .site-nav > ul > li { display: flex; align-items: center; height: 72px; }
  .site-nav .sub-menu {
    position: absolute; top: 100%; left: -18px; z-index: 60;
    min-width: 230px; margin: 0; padding: 10px 0;
    background: #fff; border: 1px solid var(--border); box-shadow: var(--shadow-md);
    display: flex; flex-direction: column; align-items: stretch; gap: 0;
    opacity: 0; visibility: hidden; transform: translateY(6px);
    transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease), visibility 0s linear var(--dur);
  }
  .site-nav li:hover > .sub-menu,
  .site-nav li:focus-within > .sub-menu {
    opacity: 1; visibility: visible; transform: translateY(0); transition-delay: 0s;
  }
  .site-nav .sub-menu li { width: 100%; }
  .site-nav .sub-menu a { display: block; padding: 10px 18px; font-size: 11px; }
  .site-nav .sub-menu a:hover { background: var(--surface-muted); color: var(--ink); }
  .site-nav .sub-menu .menu-item-has-children > a::after { display: none; } /* depth stops at 2 */
}
@media (max-width: 780px) {
  /* Mobile: submenu renders inline, indented under its parent */
  .site-nav .menu-item-has-children > a::after { transform: rotate(45deg); }
  .site-nav .sub-menu { list-style: none; margin: 0; padding: 0 0 var(--space-3) var(--space-5); display: block; }
  .site-nav .sub-menu li { border-bottom: 0; }
  .site-nav .sub-menu a { padding: var(--space-2) 0; font-size: 13px; }
}
