/* ==========================================================================
   chrome.css - canonical site header + footer styling
   Single source of truth for shared chrome on dantepinto.com.
   Namespaced (--dpc-* tokens, chrome-scoped reset) so it can be safely
   linked into legacy pages WITHOUT disturbing their existing body design.
   Do NOT add bare element selectors (section, *, body) or unscoped
   .container / .btn / .label rules here - legacy pages use those names.
   ========================================================================== */

:root {
  --dpc-brand:        #2C2C2C;
  --dpc-accent:       #8B6914;
  --dpc-accent-light: #C9A96E;
  --dpc-accent-pale:  #fdf6ec;
  --dpc-warm-white:   #F8F6F2;
  --dpc-light-border: #E4DDD4;
  --dpc-text-muted:   #6B6B63;
  --dpc-ease:         cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* ── Chrome-scoped reset (affects ONLY header/footer/menu subtrees) ── */
.site-header, .site-header *,
.site-footer, .site-footer *,
.mobile-menu, .mobile-menu *,
.skip-link {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
.site-header, .site-footer, .mobile-menu, .skip-link {
  font-family: 'Cormorant Garamond', serif;
  font-weight: 300;
  line-height: 1.55;
  letter-spacing: normal;
}
.site-header img, .site-footer img { max-width: 100%; display: block; }
.site-header svg, .site-footer svg, .mobile-menu svg { display: block; }

/* ── Skip link ── */
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 2000;
  background: var(--dpc-brand); color: var(--dpc-warm-white);
  padding: 12px 20px; text-decoration: none; font-size: 13px;
  letter-spacing: 2px; text-transform: uppercase; transition: top 0.2s ease;
}
.skip-link:focus { top: 16px; }

/* ── Header ── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--dpc-warm-white);
  border-bottom: 1px solid var(--dpc-light-border);
  transition: box-shadow 0.3s var(--dpc-ease);
}
.site-header.scrolled { box-shadow: 0 6px 26px rgba(28,28,28,0.08); }
.site-header .header-inner {
  max-width: 1440px; margin: 0 auto; padding: 0 40px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; min-height: 84px;
}
.site-header .brand { display: flex; align-items: center; gap: 14px; text-decoration: none; flex-shrink: 0; }
.site-header .brand-mark { height: 48px; width: auto; flex-shrink: 0; }
.site-header .brand-wordmark { display: flex; flex-direction: column; line-height: 1; }
.site-header .brand-wordmark .bw-name {
  font-size: 24px; font-weight: 500; letter-spacing: 4px;
  text-transform: uppercase; color: var(--dpc-brand);
}
.site-header .brand-wordmark .bw-sub {
  font-size: 10px; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--dpc-text-muted); margin-top: 5px; font-weight: 500;
}

.site-header .primary-nav { display: flex; align-items: center; gap: 26px; }
.site-header .primary-nav a {
  font-size: 14.5px; letter-spacing: 0.6px; color: var(--dpc-brand);
  text-decoration: none; font-weight: 400; position: relative; padding: 6px 0;
  transition: color 0.2s ease;
}
.site-header .primary-nav a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 0;
  background: var(--dpc-accent); transition: width 0.25s var(--dpc-ease);
}
.site-header .primary-nav a:hover { color: var(--dpc-accent); }
.site-header .primary-nav a:hover::after { width: 100%; }
.site-header .primary-nav a[aria-current="page"] { color: var(--dpc-accent); }
.site-header .primary-nav a[aria-current="page"]::after { width: 100%; }

.site-header .header-utility { display: flex; align-items: center; gap: 20px; flex-shrink: 0; }
.site-header .call-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--dpc-brand); text-decoration: none; font-weight: 500; white-space: nowrap;
  min-height: 44px;
}
.site-header .call-link svg { width: 15px; height: 15px; stroke: var(--dpc-accent); fill: none; stroke-width: 1.6; }
.site-header .call-link:hover { color: var(--dpc-accent); }
.site-header .social-row { display: flex; align-items: center; gap: 12px; }
.site-header .social-row a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border: 1px solid var(--dpc-light-border); border-radius: 50%;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s var(--dpc-ease);
}
.site-header .social-row a:hover { border-color: var(--dpc-accent); background: var(--dpc-accent-pale); transform: translateY(-2px); }
.site-header .social-row svg { width: 15px; height: 15px; fill: var(--dpc-brand); }

.site-header .nav-toggle {
  display: none; width: 44px; height: 44px; border: none; background: transparent;
  cursor: pointer; align-items: center; justify-content: center; flex-shrink: 0;
}
.site-header .nav-toggle svg { width: 26px; height: 26px; stroke: var(--dpc-brand); stroke-width: 1.5; fill: none; }

.site-header .mobile-menu { display: none; border-top: 1px solid var(--dpc-light-border); background: var(--dpc-warm-white); }
.site-header .mobile-menu.open { display: block; }
.site-header .mobile-menu nav { display: flex; flex-direction: column; padding: 8px 40px 24px; }
.site-header .mobile-menu nav a {
  padding: 15px 0; font-size: 18px; color: var(--dpc-brand); text-decoration: none;
  border-bottom: 1px solid var(--dpc-light-border); letter-spacing: 0.4px;
}
.site-header .mobile-menu nav a[aria-current="page"] { color: var(--dpc-accent); }
.site-header .mobile-menu .mm-utility { display: flex; align-items: center; justify-content: space-between; padding: 20px 40px 28px; flex-wrap: wrap; gap: 16px; }
.site-header .mobile-menu .call-link { min-height: 44px; }

/* ── Footer ── */
.site-footer { background: var(--dpc-brand); color: rgba(248,246,242,0.7); padding: 80px 0 48px; }
/* Footer inner wrapper - scoped to .site-footer so legacy .container rules are untouched */
.site-footer .container { max-width: 1280px; margin: 0 auto; padding: 0 48px; }
.site-footer .footer-top { display: flex; justify-content: space-between; gap: 48px; flex-wrap: wrap; padding-bottom: 48px; border-bottom: 1px solid rgba(248,246,242,0.14); }
.site-footer .footer-mark { height: 54px; width: auto; margin-bottom: 20px; }
.site-footer .footer-brand .bw-name { font-size: 22px; font-weight: 500; letter-spacing: 4px; text-transform: uppercase; color: var(--dpc-warm-white); }
.site-footer .footer-brand .bw-sub { font-size: 10px; letter-spacing: 2.5px; text-transform: uppercase; color: rgba(248,246,242,0.55); margin-top: 7px; font-weight: 500; }
.site-footer .footer-brand .footer-social { display: flex; gap: 12px; margin-top: 26px; }
.site-footer .footer-brand .footer-social a { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1px solid rgba(248,246,242,0.22); border-radius: 50%; transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s var(--dpc-ease); }
.site-footer .footer-brand .footer-social a:hover { border-color: var(--dpc-accent-light); background: rgba(248,246,242,0.06); transform: translateY(-2px); }
.site-footer .footer-brand .footer-social svg { width: 15px; height: 15px; fill: var(--dpc-warm-white); }
.site-footer .footer-nav-label { font-size: 10px; letter-spacing: 3px; text-transform: uppercase; color: var(--dpc-accent-light); font-weight: 500; margin-bottom: 22px; }
.site-footer .footer-links { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 44px; }
.site-footer .footer-links a { font-size: 15px; color: rgba(248,246,242,0.8); text-decoration: none; transition: color 0.2s ease; padding: 4px 0; }
.site-footer .footer-links a:hover { color: var(--dpc-accent-light); }
.site-footer .footer-service { padding-top: 40px; font-size: 15px; line-height: 1.7; color: rgba(248,246,242,0.82); font-weight: 300; max-width: 820px; }
.site-footer .footer-service strong { color: var(--dpc-warm-white); font-weight: 400; }
.site-footer .footer-disclosure { padding-top: 20px; font-size: 12.5px; line-height: 1.7; color: rgba(248,246,242,0.5); max-width: 1000px; }
.site-footer .footer-disclosure a { color: inherit; text-decoration: underline; text-underline-offset: 2px; transition: color 0.2s ease; }
.site-footer .footer-disclosure a:hover { color: var(--dpc-accent-light); }

/* ── Focus states (chrome) ── */
.site-header a:focus-visible, .site-header button:focus-visible,
.skip-link:focus-visible { outline: 2px solid var(--dpc-accent); outline-offset: 3px; }
.site-footer a:focus-visible { outline: 2px solid var(--dpc-accent-light); outline-offset: 3px; }

/* ── Responsive ── */
@media (max-width: 1080px) {
  .site-header .primary-nav, .site-header .header-utility { display: none; }
  .site-header .nav-toggle { display: inline-flex; }
}
@media (max-width: 820px) {
  .site-header .header-inner { padding: 0 26px; min-height: 72px; }
  .site-header .brand { gap: 11px; }
  .site-header .brand-mark { height: 40px; }
  .site-header .brand-wordmark .bw-name { font-size: 20px; letter-spacing: 3px; }
  .site-footer .container { padding: 0 26px; }
  .site-footer .footer-links { grid-template-columns: 1fr; }
  .site-header .social-row a, .site-footer .footer-brand .footer-social a { width: 44px; height: 44px; }
}
@media (max-width: 500px) {
  .site-header .brand-wordmark .bw-sub { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .site-header, .site-header *, .site-footer, .site-footer *, .skip-link { transition: none !important; }
}

/* ── Post reading aids: scroll-progress bar, collapsible TOC, related posts ──
   Loaded sitewide but only activated on posts: chrome.js gates the bar + TOC on
   the presence of a #post-toc placeholder, and the related-posts markup is
   stamped only into post pages by build.js. chrome.css is linked AFTER each
   post's inline <style>, so these rules win ties against the posts' own
   .post-body link styling (.related-card is scoped to beat .post-body a). */
.post-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: var(--dpc-accent); z-index: 1000;
  transition: width 0.08s linear;
}

.post-toc {
  margin: 4px 0 36px; border: 1px solid var(--dpc-light-border);
  background: var(--dpc-warm-white); border-radius: 3px;
}
.post-toc summary {
  cursor: pointer; list-style: none; display: flex; align-items: center;
  justify-content: space-between; gap: 14px; padding: 15px 20px;
  font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase;
  font-weight: 500; color: var(--dpc-accent);
}
.post-toc summary::-webkit-details-marker { display: none; }
.post-toc .toc-caret {
  width: 8px; height: 8px; flex-shrink: 0;
  border-right: 1.5px solid var(--dpc-accent);
  border-bottom: 1.5px solid var(--dpc-accent);
  transform: rotate(45deg); transition: transform 0.2s var(--dpc-ease);
}
.post-toc[open] .toc-caret { transform: rotate(-135deg); }
.post-toc ol { list-style: none; margin: 0; padding: 2px 20px 16px; }
.post-toc li { margin: 0; }
.post-toc a {
  display: block; padding: 8px 0; font-size: 16px; line-height: 1.4;
  color: var(--dpc-brand); text-decoration: none; border-bottom: 0;
  transition: color 0.2s ease;
}
.post-toc a:hover { color: var(--dpc-accent); }
.post-toc a:focus-visible { outline: 2px solid var(--dpc-accent); outline-offset: 3px; }

.related-posts { margin: 46px 0 8px; }
.related-posts .related-label {
  font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase;
  font-weight: 500; color: var(--dpc-accent); margin-bottom: 16px;
}
.related-posts .related-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.related-posts a.related-card {
  display: flex; flex-direction: column; gap: 8px; padding: 22px 22px 24px;
  border: 1px solid var(--dpc-light-border); background: var(--dpc-warm-white);
  border-radius: 3px; text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s var(--dpc-ease);
}
.related-posts a.related-card:hover { border-color: var(--dpc-accent-light); transform: translateY(-2px); }
.related-posts a.related-card:focus-visible { outline: 2px solid var(--dpc-accent); outline-offset: 3px; }
.related-posts .related-cat {
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dpc-accent);
}
.related-posts .related-title { font-size: 21px; line-height: 1.25; color: var(--dpc-brand); font-weight: 500; }
.related-posts .related-note { font-size: 15px; line-height: 1.5; color: var(--dpc-text-muted); font-weight: 300; }

@media (max-width: 640px) {
  .related-posts .related-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .post-progress, .post-toc .toc-caret, .related-posts a.related-card { transition: none !important; }
}
