/* DrivewaypermitGuide.pages.dev — Main Stylesheet */
/* Design: Utilitarian-editorial. Think a well-funded public works office meets a consumer magazine. */
/* Palette: Deep slate, warm concrete, asphalt black, bright safety-orange accent */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --asphalt:     #1a1c1e;
  --slate:       #2d3139;
  --concrete:    #f2f0ec;
  --sand:        #e8e4dc;
  --orange:      #e85d04;
  --orange-lt:   #ff7b26;
  --white:       #ffffff;
  --muted:       #6b7280;
  --border:      #ddd8cf;
  --link:        #1d4ed8;
  --link-hover:  #1e3a8a;

  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body:    'IBM Plex Sans', system-ui, sans-serif;
  --font-mono:    'IBM Plex Mono', monospace;

  --max-w: 1100px;
  --radius: 4px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  color: var(--asphalt);
  background: var(--white);
}

/* ===================== TYPOGRAPHY ===================== */
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); color: var(--asphalt); margin-bottom: 1rem; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); color: var(--asphalt); margin: 2.5rem 0 0.75rem; }
h3 { font-size: clamp(1.1rem, 2vw, 1.35rem); color: var(--slate); margin: 2rem 0 0.5rem; }
h4 { font-size: 1rem; font-family: var(--font-body); font-weight: 600; margin: 1.5rem 0 0.4rem; }

p { margin-bottom: 1.2rem; }
a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--link-hover); }
strong { font-weight: 600; }

ul, ol { padding-left: 1.5rem; margin-bottom: 1.2rem; }
li { margin-bottom: 0.4rem; }

/* ===================== LAYOUT ===================== */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.25rem; }

/* ===================== HEADER / NAV ===================== */
.site-header {
  background: var(--asphalt);
  border-bottom: 3px solid var(--orange);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
  gap: 1rem;
}
.site-logo {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--white);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.site-logo span.accent { color: var(--orange); }
.site-logo .logo-icon {
  width: 28px; height: 28px;
  background: var(--orange);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  display: flex; align-items: center; justify-content: center;
}

nav { display: flex; gap: 0.1rem; flex-wrap: wrap; }
nav a {
  color: #c8ccd4;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius);
  transition: background 0.15s, color 0.15s;
}
nav a:hover { background: rgba(255,255,255,0.1); color: var(--white); }
nav a.active { color: var(--orange); }

.nav-toggle { display: none; background: none; border: none; cursor: pointer; color: var(--white); font-size: 1.4rem; }

/* ===================== HERO ===================== */
.hero {
  background: var(--asphalt);
  color: var(--white);
  padding: 4.5rem 0 3.5rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 40px,
    rgba(255,255,255,0.015) 40px,
    rgba(255,255,255,0.015) 41px
  );
}
.hero .container { position: relative; z-index: 1; }
.hero-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--orange);
  color: var(--white);
  padding: 0.25rem 0.75rem;
  border-radius: 2px;
  margin-bottom: 1.25rem;
}
.hero h1 { color: var(--white); max-width: 750px; }
.hero h1 em { color: var(--orange); font-style: normal; }
.hero-sub { font-size: 1.1rem; color: #b0b8c4; max-width: 620px; margin-bottom: 2rem; }
.hero-cta { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.btn-primary {
  background: var(--orange);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.15s, transform 0.1s;
  border: none; cursor: pointer;
}
.btn-primary:hover { background: var(--orange-lt); color: var(--white); transform: translateY(-1px); }
.btn-secondary {
  background: transparent;
  color: var(--white);
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  border: 1.5px solid rgba(255,255,255,0.3);
  transition: border-color 0.15s, background 0.15s;
}
.btn-secondary:hover { border-color: var(--white); background: rgba(255,255,255,0.07); color: var(--white); }

/* ===================== QUICK STATS BAR ===================== */
.stats-bar {
  background: var(--sand);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}
.stats-bar .container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.5rem;
}
.stat-item {
  text-align: center;
  padding: 0.5rem 1rem;
}
.stat-item .num {
  font-family: var(--font-display);
  font-size: 1.9rem;
  color: var(--orange);
  line-height: 1;
}
.stat-item .label {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ===================== MAIN CONTENT AREA ===================== */
.page-body { padding: 3rem 0 4rem; }
.content-grid {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  align-items: start;
}

/* ===================== ARTICLE CONTENT ===================== */
.article-content { min-width: 0; }

/* ===================== SIDEBAR ===================== */
.sidebar { position: sticky; top: 80px; }
.sidebar-widget {
  background: var(--concrete);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.sidebar-widget h3 { font-size: 1rem; margin-top: 0; margin-bottom: 0.75rem; }
.sidebar-widget ul { padding-left: 0; list-style: none; }
.sidebar-widget ul li { margin-bottom: 0.4rem; border-bottom: 1px solid var(--border); padding-bottom: 0.4rem; }
.sidebar-widget ul li:last-child { border-bottom: none; padding-bottom: 0; }
.sidebar-widget ul li a { font-size: 0.9rem; }

.alert-box {
  border-left: 4px solid var(--orange);
  background: #fff7f3;
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 1.5rem;
}
.alert-box p { margin: 0; font-size: 0.9rem; }
.alert-box strong { color: var(--orange); }

/* ===================== CARDS & GRIDS ===================== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  background: var(--white);
  transition: box-shadow 0.15s, border-color 0.15s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); border-color: var(--orange); }
.card-icon { font-size: 1.75rem; margin-bottom: 0.75rem; }
.card h3 { font-size: 1.05rem; margin-top: 0; margin-bottom: 0.4rem; }
.card p { font-size: 0.88rem; color: var(--muted); margin: 0; }

/* ===================== STATE GRID ===================== */
.state-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
  margin: 1.5rem 0;
}
.state-card {
  display: block;
  padding: 0.75rem 1rem;
  background: var(--concrete);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--asphalt);
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s;
}
.state-card:hover { background: var(--orange); color: var(--white); border-color: var(--orange); }

/* ===================== FAQ ===================== */
.faq-section { margin: 2.5rem 0; }
details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.6rem;
  overflow: hidden;
}
details[open] { border-color: var(--orange); }
summary {
  font-weight: 600;
  padding: 1rem 1.25rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.95rem;
  background: var(--concrete);
}
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; font-size: 1.2rem; color: var(--orange); transition: transform 0.2s; }
details[open] summary::after { content: '−'; }
details p { padding: 1rem 1.25rem; font-size: 0.93rem; margin: 0; }

/* ===================== CHECKLIST TABLE ===================== */
.checklist-table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.9rem; }
.checklist-table th {
  background: var(--asphalt);
  color: var(--white);
  padding: 0.65rem 1rem;
  text-align: left;
  font-weight: 600;
  font-family: var(--font-body);
}
.checklist-table td { padding: 0.65rem 1rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.checklist-table tr:nth-child(even) td { background: var(--concrete); }
.checklist-table tr:last-child td { border-bottom: none; }
.badge { display: inline-block; padding: 0.15rem 0.55rem; border-radius: 2px; font-size: 0.78rem; font-weight: 600; }
.badge-yes { background: #d1fae5; color: #065f46; }
.badge-sometimes { background: #fef3c7; color: #78350f; }
.badge-no { background: #fee2e2; color: #991b1b; }

/* ===================== STEP BLOCK ===================== */
.steps { counter-reset: step-counter; margin: 1.5rem 0; }
.step {
  display: flex; gap: 1rem; margin-bottom: 1.5rem;
  padding-bottom: 1.5rem; border-bottom: 1px solid var(--border);
}
.step:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.step-num {
  flex-shrink: 0;
  width: 36px; height: 36px;
  background: var(--orange);
  color: var(--white);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 0.95rem;
  margin-top: 0.1rem;
}
.step-body h4 { margin-top: 0; margin-bottom: 0.3rem; }
.step-body p { margin: 0; font-size: 0.93rem; }

/* ===================== TOOL / CALCULATOR ===================== */
.tool-frame {
  background: var(--concrete);
  border: 2px solid var(--border);
  border-radius: 6px;
  padding: 2rem;
  margin: 2rem 0;
}
.tool-frame h2 { margin-top: 0; }
.tool-question { font-weight: 600; margin-bottom: 0.75rem; }
.tool-options { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 1.25rem; }
.tool-option {
  display: flex; align-items: center; gap: 0.65rem;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 1rem;
  cursor: pointer;
  font-size: 0.93rem;
  transition: border-color 0.15s;
}
.tool-option:hover { border-color: var(--orange); }
.tool-option input[type="radio"] { accent-color: var(--orange); }
.tool-option.selected { border-color: var(--orange); background: #fff7f3; }
#tool-result {
  background: var(--asphalt);
  color: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: none;
}
#tool-result.show { display: block; }
#tool-result h3 { color: var(--orange-lt); margin-top: 0; }
#tool-result p { margin-bottom: 0.5rem; font-size: 0.93rem; }

/* ===================== BREADCRUMB ===================== */
.breadcrumb {
  font-size: 0.83rem;
  color: var(--muted);
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2rem;
}
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--orange); }
.breadcrumb span { margin: 0 0.4rem; }

/* ===================== PAGE HERO (inner pages) ===================== */
.page-hero {
  background: var(--asphalt);
  color: var(--white);
  padding: 2.5rem 0 2rem;
}
.page-hero h1 { color: var(--white); font-size: clamp(1.6rem, 4vw, 2.4rem); margin-bottom: 0.5rem; }
.page-hero p { color: #b0b8c4; margin: 0; font-size: 1rem; }
.page-hero .hero-tag { margin-bottom: 0.75rem; }

/* ===================== DISCLAIMER ===================== */
.disclaimer {
  font-size: 0.82rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  margin-top: 3rem;
  font-style: italic;
}

/* ===================== FOOTER ===================== */
.site-footer {
  background: var(--asphalt);
  color: #8a9099;
  padding: 3rem 0 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}
.footer-brand p { font-size: 0.88rem; margin-top: 0.75rem; max-width: 280px; }
.footer-col h4 {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #c8ccd4;
  margin-bottom: 0.75rem;
}
.footer-col ul { list-style: none; padding: 0; }
.footer-col ul li { margin-bottom: 0.4rem; }
.footer-col ul li a { color: #8a9099; text-decoration: none; font-size: 0.88rem; }
.footer-col ul li a:hover { color: var(--orange); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 1.5rem;
  font-size: 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ===================== ANALYTICS PLACEHOLDER ===================== */
/* ANALYTICS PLACEHOLDER — uncomment to activate */
/*
  <!-- Google tag (gtag.js) -->
  <script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"></script>
  <script>
    window.dataLayer = window.dataLayer || [];
    function gtag(){dataLayer.push(arguments);}
    gtag('js', new Date());
    gtag('config', 'G-XXXXXXXXXX');
  </script>
*/

/* ===================== RESPONSIVE ===================== */
@media (max-width: 900px) {
  .content-grid { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  nav { display: none; }
  nav.open { display: flex; flex-direction: column; }
  .nav-toggle { display: block; }
  .hero { padding: 2.5rem 0 2rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
}

/* ===================== PRINT ===================== */
@media print {
  .site-header, .sidebar, .site-footer, nav { display: none; }
  .content-grid { grid-template-columns: 1fr; }
}
