/* WindowPermitGuide.pages.dev — styles.css */
/* Aesthetic: Editorial Utilitarian — trustworthy, readable, authoritative */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Source+Serif+4:ital,opsz,wght@0,8..60,300;0,8..60,400;0,8..60,600;1,8..60,400&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── TOKENS ── */
:root {
  --slate:       #1e2d3d;
  --slate-mid:   #2e4560;
  --slate-light: #4a6080;
  --amber:       #d4840a;
  --amber-light: #f0a832;
  --cream:       #faf8f4;
  --warm-white:  #ffffff;
  --border:      #ddd8d0;
  --border-dark: #b8b0a4;
  --text:        #1a1a1a;
  --text-muted:  #5a5650;
  --text-light:  #8a8480;
  --success:     #2d7a4f;
  --warning:     #b85c00;
  --error:       #9b2335;
  --info:        #1e4d8c;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Source Serif 4', Georgia, serif;
  --font-mono:    'JetBrains Mono', 'Courier New', monospace;

  --max-w: 860px;
  --max-w-wide: 1100px;
  --gap: 2rem;
  --radius: 4px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow:    0 3px 12px rgba(0,0,0,0.10);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 17px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--cream);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--slate-mid); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--amber); }

/* ── HEADER ── */
.site-header {
  background: var(--slate);
  color: var(--warm-white);
  border-bottom: 3px solid var(--amber);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.header-inner {
  max-width: var(--max-w-wide);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 1rem;
}
.site-logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--warm-white);
  text-decoration: none;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
.site-logo span { color: var(--amber-light); }
.site-nav { display: flex; gap: 0.25rem; align-items: center; }
.site-nav a {
  color: rgba(255,255,255,0.82);
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 400;
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius);
  transition: color 0.15s, background 0.15s;
  letter-spacing: 0.01em;
}
.site-nav a:hover { color: var(--warm-white); background: rgba(255,255,255,0.1); }
.nav-cta {
  background: var(--amber) !important;
  color: var(--warm-white) !important;
  font-weight: 600 !important;
  padding: 0.35rem 0.9rem !important;
}
.nav-cta:hover { background: var(--amber-light) !important; }
.hamburger { display: none; background: none; border: none; color: white; cursor: pointer; padding: 0.5rem; }

/* ── HERO ── */
.hero {
  background: var(--slate);
  color: var(--warm-white);
  padding: 4rem 1.5rem 3.5rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 40px,
    rgba(255,255,255,0.015) 40px,
    rgba(255,255,255,0.015) 80px
  );
  pointer-events: none;
}
.hero-inner {
  max-width: var(--max-w-wide);
  margin: 0 auto;
  position: relative;
}
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--amber-light);
  margin-bottom: 1rem;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1.25rem;
  max-width: 720px;
}
.hero-sub {
  font-size: 1.15rem;
  color: rgba(255,255,255,0.8);
  max-width: 620px;
  margin-bottom: 2rem;
  line-height: 1.65;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.15s;
  line-height: 1;
}
.btn-primary { background: var(--amber); color: white; border-color: var(--amber); }
.btn-primary:hover { background: var(--amber-light); border-color: var(--amber-light); color: white; }
.btn-outline { background: transparent; color: white; border-color: rgba(255,255,255,0.5); }
.btn-outline:hover { background: rgba(255,255,255,0.1); border-color: white; color: white; }
.btn-slate { background: var(--slate); color: white; border-color: var(--slate); }
.btn-slate:hover { background: var(--slate-mid); border-color: var(--slate-mid); color: white; }

/* ── ALERT BANNER ── */
.alert {
  padding: 0.9rem 1.25rem;
  border-left: 4px solid;
  border-radius: var(--radius);
  margin: 1.5rem 0;
  font-size: 0.93rem;
}
.alert-info    { background: #e8f0f9; border-color: var(--info);    color: #1a3560; }
.alert-warning { background: #fdf3e3; border-color: var(--amber);   color: #6b3a00; }
.alert-success { background: #e6f4ec; border-color: var(--success); color: #1a4a30; }
.alert strong  { font-weight: 600; }

/* ── LAYOUT ── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }
.container-wide { max-width: var(--max-w-wide); margin: 0 auto; padding: 0 1.5rem; }
.page-body { padding: 3rem 0 5rem; }

/* ── BREADCRUMB ── */
.breadcrumb {
  background: var(--warm-white);
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.breadcrumb-inner { max-width: var(--max-w-wide); margin: 0 auto; padding: 0 1.5rem; }
.breadcrumb a { color: var(--slate-mid); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { margin: 0 0.4rem; color: var(--text-light); }

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.3;
  color: var(--slate);
}
.article-body h1 { font-size: 2.1rem; margin-bottom: 1.5rem; }
.article-body h2 { font-size: 1.5rem; margin: 2.5rem 0 1rem; padding-top: 0.5rem; border-top: 1px solid var(--border); }
.article-body h3 { font-size: 1.15rem; margin: 1.75rem 0 0.6rem; color: var(--slate-mid); }
.article-body h4 { font-size: 1rem; margin: 1.25rem 0 0.4rem; color: var(--slate-light); font-weight: 600; }
.article-body p  { margin-bottom: 1.1rem; }
.article-body ul, .article-body ol { margin: 0.75rem 0 1.1rem 1.5rem; }
.article-body li { margin-bottom: 0.4rem; }
.article-body strong { color: var(--slate); font-weight: 600; }
.article-body a { color: var(--slate-mid); }

/* ── TABLE ── */
.table-wrap { overflow-x: auto; margin: 1.5rem 0; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; background: white; }
th {
  background: var(--slate);
  color: white;
  font-family: var(--font-body);
  font-weight: 600;
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}
td { padding: 0.65rem 1rem; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: none; }
tr:nth-child(even) td { background: #f8f6f2; }
.badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 3px;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--font-mono);
}
.badge-yes     { background: #d4edda; color: #155724; }
.badge-no      { background: #f8d7da; color: #721c24; }
.badge-maybe   { background: #fff3cd; color: #856404; }
.badge-varies  { background: #d1ecf1; color: #0c5460; }

/* ── CARD GRID ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
}
.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); color: inherit; }
.card-icon { font-size: 1.75rem; margin-bottom: 0.75rem; }
.card h3 { font-size: 1.05rem; margin-bottom: 0.5rem; color: var(--slate); }
.card p  { font-size: 0.88rem; color: var(--text-muted); line-height: 1.5; margin: 0; }
.card-arrow { color: var(--amber); font-size: 1.1rem; margin-top: 0.75rem; display: block; }

/* ── SECTION HEADER ── */
.section-header { margin: 3rem 0 1.5rem; }
.section-header h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--slate);
  margin-bottom: 0.4rem;
}
.section-header p { color: var(--text-muted); font-size: 0.95rem; }
.section-divider {
  width: 48px;
  height: 3px;
  background: var(--amber);
  margin: 0.6rem 0 0;
  border-radius: 2px;
}

/* ── FAQ ── */
.faq-section { margin: 3rem 0; }
.faq-section h2 { font-family: var(--font-display); font-size: 1.5rem; margin-bottom: 1.25rem; color: var(--slate); }
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.6rem;
  background: white;
  overflow: hidden;
}
.faq-q {
  width: 100%;
  background: none;
  border: none;
  padding: 1rem 1.25rem;
  text-align: left;
  font-family: var(--font-body);
  font-size: 0.97rem;
  font-weight: 600;
  color: var(--slate);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  transition: background 0.15s;
}
.faq-q:hover { background: #f5f3ef; }
.faq-q .faq-icon { color: var(--amber); font-size: 1.2rem; flex-shrink: 0; transition: transform 0.2s; }
.faq-q[aria-expanded="true"] .faq-icon { transform: rotate(45deg); }
.faq-a {
  padding: 0 1.25rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.2s;
  font-size: 0.93rem;
  color: var(--text);
}
.faq-a.open { max-height: 600px; padding: 0 1.25rem 1.1rem; }

/* ── TOOL CARD ── */
.tool-box {
  background: white;
  border: 2px solid var(--slate);
  border-radius: var(--radius);
  padding: 2rem;
  margin: 2rem 0;
  box-shadow: var(--shadow);
}
.tool-box h2 { font-size: 1.3rem; margin-bottom: 0.4rem; }
.tool-box .tool-desc { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; }
.form-row { margin-bottom: 1.1rem; }
.form-row label { display: block; font-size: 0.87rem; font-weight: 600; color: var(--slate); margin-bottom: 0.35rem; font-family: var(--font-body); }
.form-row input, .form-row select {
  width: 100%;
  padding: 0.65rem 0.9rem;
  border: 1.5px solid var(--border-dark);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--cream);
  color: var(--text);
  transition: border-color 0.15s;
}
.form-row input:focus, .form-row select:focus {
  outline: none;
  border-color: var(--slate-mid);
  background: white;
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.tool-result {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border-radius: var(--radius);
  display: none;
  animation: fadeIn 0.25s ease;
}
.tool-result.compliant   { background: #e6f4ec; border: 2px solid var(--success); }
.tool-result.noncompliant{ background: #fde8ea; border: 2px solid var(--error); }
.tool-result.marginal    { background: #fdf3e3; border: 2px solid var(--amber); }
.result-label { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; margin-bottom: 0.5rem; }
.result-detail { font-size: 0.9rem; line-height: 1.6; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ── PDF DOWNLOAD ── */
.pdf-banner {
  background: linear-gradient(135deg, var(--slate) 0%, var(--slate-mid) 100%);
  color: white;
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin: 2rem 0;
  box-shadow: var(--shadow);
}
.pdf-icon { font-size: 2.5rem; flex-shrink: 0; }
.pdf-text h3 { font-family: var(--font-display); font-size: 1.15rem; margin-bottom: 0.3rem; color: white; }
.pdf-text p  { font-size: 0.88rem; color: rgba(255,255,255,0.8); margin: 0 0 0.9rem; }

/* ── STATE INDEX ── */
.state-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
  margin: 1.5rem 0;
}
.state-link {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: var(--slate-mid);
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
}
.state-link:hover { background: var(--slate); color: white; transform: translateY(-1px); box-shadow: var(--shadow); }
.state-flag { font-size: 1.2rem; }

/* ── SIDEBAR LAYOUT ── */
.content-with-sidebar {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  align-items: start;
}
.sidebar { position: sticky; top: 80px; }
.sidebar-box {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.sidebar-box h4 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--amber);
  color: var(--slate);
}
.sidebar-box ul { list-style: none; padding: 0; margin: 0; }
.sidebar-box ul li { margin-bottom: 0.4rem; }
.sidebar-box ul li a { font-size: 0.87rem; color: var(--slate-mid); text-decoration: none; }
.sidebar-box ul li a:hover { color: var(--amber); text-decoration: underline; }
.toc-link { display: block; padding: 0.2rem 0; border-left: 2px solid transparent; padding-left: 0.6rem; }
.toc-link:hover { border-left-color: var(--amber); }

/* ── FOOTER ── */
.site-footer {
  background: var(--slate);
  color: rgba(255,255,255,0.75);
  padding: 3rem 1.5rem 2rem;
  margin-top: 4rem;
}
.footer-inner {
  max-width: var(--max-w-wide);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2rem;
}
.footer-brand .site-logo { font-size: 1.1rem; margin-bottom: 0.75rem; display: block; }
.footer-brand p { font-size: 0.82rem; line-height: 1.6; color: rgba(255,255,255,0.6); }
.footer-col h5 {
  font-family: var(--font-display);
  color: white;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  letter-spacing: 0.03em;
}
.footer-col ul { list-style: none; padding: 0; }
.footer-col ul li { margin-bottom: 0.35rem; }
.footer-col ul li a { color: rgba(255,255,255,0.65); text-decoration: none; font-size: 0.83rem; }
.footer-col ul li a:hover { color: var(--amber-light); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.45);
}
.footer-disclaimer {
  max-width: var(--max-w-wide);
  margin: 0 auto 1.5rem;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.45);
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.25rem;
  line-height: 1.6;
}

/* ── CHECKLIST (PDF page) ── */
.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}
.checklist-item:last-child { border-bottom: none; }
.check-box {
  width: 20px; height: 20px;
  border: 2px solid var(--border-dark);
  border-radius: 3px;
  flex-shrink: 0;
  margin-top: 2px;
  cursor: pointer;
  transition: all 0.15s;
}
.check-box.checked { background: var(--success); border-color: var(--success); }
.check-label { font-size: 0.93rem; }

/* ── PROGRESS BAR ── */
.progress-track { background: var(--border); border-radius: 10px; height: 8px; margin: 0.4rem 0 1rem; overflow: hidden; }
.progress-bar   { height: 100%; background: var(--amber); border-radius: 10px; transition: width 0.4s ease; }

/* ── MOBILE ── */
@media (max-width: 768px) {
  .site-nav { display: none; }
  .site-nav.open { display: flex; flex-direction: column; position: absolute; top: 60px; left: 0; right: 0; background: var(--slate); padding: 1rem; gap: 0.25rem; border-bottom: 3px solid var(--amber); }
  .hamburger { display: block; }
  .header-inner { position: relative; }
  .content-with-sidebar { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .form-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .pdf-banner { flex-direction: column; text-align: center; }
  .hero { padding: 2.5rem 1.25rem 2rem; }
}
@media (max-width: 480px) {
  .footer-inner { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.8rem; }
}

/* ── PRINT ── */
@media print {
  .site-header, .site-footer, .sidebar, .hero-actions, .breadcrumb { display: none; }
  body { background: white; font-size: 12pt; }
  .article-body h2 { page-break-before: auto; }
}

/* ── ANALYTICS PLACEHOLDER ── */
/* GA4 and AdSense placeholders are in each page <head> — commented out until Phase 3 */
