/* ============================================================
   FencePermitHub — styles.css
   Aesthetic: Clean municipal authority — trustworthy, structured,
   warm enough to feel human. Think a well-funded county office
   redesigned by someone who cares about UX.
   ============================================================ */

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

/* ── Variables ── */
:root {
  --ink:        #1a1a18;
  --ink-soft:   #3d3d38;
  --ink-faint:  #6b6b62;
  --cream:      #faf8f3;
  --cream-mid:  #f0ece0;
  --cream-dark: #e2dccf;
  --sage:       #4a6741;
  --sage-light: #6b8f61;
  --sage-pale:  #e8f0e6;
  --amber:      #c47c2b;
  --amber-pale: #fdf3e3;
  --rule:       #d4cfc0;
  --white:      #ffffff;
  --max-w:      1140px;
  --col-gap:    2rem;
  --radius:     4px;
  --radius-lg:  10px;
  --shadow-sm:  0 1px 4px rgba(26,26,24,.08);
  --shadow-md:  0 4px 18px rgba(26,26,24,.12);
  --shadow-lg:  0 12px 40px rgba(26,26,24,.16);
  --font-head:  'Playfair Display', Georgia, serif;
  --font-body:  'Source Sans 3', 'Georgia', sans-serif;
  --font-mono:  'JetBrains Mono', monospace;
  --transition: 220ms cubic-bezier(.4,0,.2,1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.72;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--sage); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--sage-light); }
ul, ol { padding-left: 1.5rem; }
li { margin-bottom: .35rem; }
p { margin-bottom: 1.1rem; }
p:last-child { margin-bottom: 0; }
strong { font-weight: 700; }
em { font-style: italic; }

/* ── Typography Scale ── */
h1,h2,h3,h4,h5 {
  font-family: var(--font-head);
  line-height: 1.22;
  color: var(--ink);
  margin-bottom: .6em;
}
h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 900; }
h2 { font-size: clamp(1.4rem, 2.8vw, 2rem); font-weight: 700; margin-top: 2.4rem; }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); font-weight: 700; margin-top: 1.8rem; }
h4 { font-size: 1.05rem; font-weight: 700; margin-top: 1.4rem; }

/* ── Layout ── */
.container { width: 92%; max-width: var(--max-w); margin: 0 auto; }
.container--narrow { width: 92%; max-width: 780px; margin: 0 auto; }

.layout-sidebar {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: var(--col-gap);
  align-items: start;
}
@media (max-width: 860px) {
  .layout-sidebar { grid-template-columns: 1fr; }
  .sidebar { order: -1; }
}

/* ── Site Header ── */
.site-header {
  background: var(--ink);
  color: var(--cream);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 3px solid var(--sage);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9rem 0;
  gap: 1rem;
}
.site-logo {
  font-family: var(--font-head);
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--cream) !important;
  text-decoration: none;
  letter-spacing: -.02em;
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-shrink: 0;
}
.site-logo .logo-mark {
  width: 34px; height: 34px;
  background: var(--sage);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem;
}
.site-logo span.accent { color: var(--amber); }

.site-nav { display: flex; align-items: center; gap: 1.6rem; }
.site-nav a {
  color: var(--cream-dark);
  text-decoration: none;
  font-size: .92rem;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  transition: color var(--transition);
}
.site-nav a:hover { color: var(--amber); }

.nav-cta {
  background: var(--sage);
  color: var(--white) !important;
  padding: .45rem 1rem;
  border-radius: var(--radius);
  transition: background var(--transition) !important;
}
.nav-cta:hover { background: var(--sage-light) !important; }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--cream);
  padding: .4rem;
}
@media (max-width: 700px) {
  .site-nav { display: none; flex-direction: column; align-items: flex-start; gap: .8rem;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--ink); padding: 1rem 4%; border-top: 1px solid #333; }
  .site-nav.open { display: flex; }
  .nav-toggle { display: block; }
}

/* ── Hero ── */
.hero {
  background: var(--ink);
  color: var(--cream);
  padding: 4.5rem 0 4rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -60px; right: -80px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(74,103,65,.35) 0%, transparent 70%);
  pointer-events: none;
}
.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3rem;
  align-items: center;
}
@media (max-width: 780px) { .hero-inner { grid-template-columns: 1fr; } .hero-badge { display: none; } }
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: .8rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.hero-eyebrow::before { content: ''; display: block; width: 28px; height: 2px; background: var(--amber); }
.hero h1 { color: var(--white); margin-bottom: 1.1rem; }
.hero h1 em { color: var(--amber); font-style: normal; }
.hero-lead { font-size: 1.15rem; color: var(--cream-dark); line-height: 1.6; max-width: 560px; margin-bottom: 2rem; }
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: .95rem;
  text-decoration: none;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  font-family: var(--font-body);
}
.btn-primary { background: var(--sage); color: var(--white); }
.btn-primary:hover { background: var(--sage-light); color: var(--white); }
.btn-outline { background: transparent; color: var(--cream); border: 2px solid rgba(255,255,255,.3); }
.btn-outline:hover { border-color: var(--amber); color: var(--amber); }
.btn-amber { background: var(--amber); color: var(--white); }
.btn-amber:hover { background: #d4893a; color: var(--white); }

.hero-badge {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  text-align: center;
  min-width: 200px;
}
.hero-badge-num { font-family: var(--font-head); font-size: 3.5rem; font-weight: 900; color: var(--amber); line-height: 1; }
.hero-badge-label { font-size: .82rem; color: var(--cream-dark); margin-top: .4rem; }

/* ── Breadcrumb ── */
.breadcrumb {
  background: var(--cream-mid);
  border-bottom: 1px solid var(--rule);
  padding: .6rem 0;
  font-size: .84rem;
  color: var(--ink-faint);
}
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: .3rem; list-style: none; padding: 0; margin: 0; }
.breadcrumb li::after { content: '›'; margin-left: .3rem; color: var(--rule); }
.breadcrumb li:last-child::after { display: none; }
.breadcrumb a { color: var(--sage); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* ── Page Header (interior pages) ── */
.page-header {
  background: var(--ink);
  color: var(--cream);
  padding: 3rem 0 2.5rem;
  border-bottom: 3px solid var(--sage);
}
.page-header .eyebrow {
  font-family: var(--font-mono);
  font-size: .76rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: .7rem;
}
.page-header h1 { color: var(--white); font-size: clamp(1.7rem,3.5vw,2.5rem); }
.page-header .subtitle { color: var(--cream-dark); font-size: 1.05rem; margin-top: .6rem; max-width: 600px; }

/* ── Main Content ── */
.content-section { padding: 3.5rem 0; }
.content-section + .content-section { border-top: 1px solid var(--rule); }

/* ── Cards ── */
.card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
  transition: box-shadow var(--transition), transform var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
}
.card-icon { font-size: 2rem; margin-bottom: .8rem; }
.card h3 { font-size: 1.1rem; margin-top: 0; }
.card p { font-size: .93rem; color: var(--ink-soft); }
.card a.card-link {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .88rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--sage);
  margin-top: .8rem;
}
.card a.card-link:hover { color: var(--sage-light); }

/* ── Info Box ── */
.info-box {
  border-left: 4px solid var(--sage);
  background: var(--sage-pale);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.2rem 1.4rem;
  margin: 1.8rem 0;
}
.info-box.warning { border-color: var(--amber); background: var(--amber-pale); }
.info-box.tip { border-color: #5b8fa8; background: #e8f4f8; }
.info-box-title {
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--sage);
  margin-bottom: .5rem;
}
.info-box.warning .info-box-title { color: var(--amber); }
.info-box.tip .info-box-title { color: #5b8fa8; }
.info-box p { margin: 0; font-size: .94rem; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1.5rem 0; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: .93rem;
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
thead { background: var(--ink); color: var(--cream); }
thead th { padding: .85rem 1rem; text-align: left; font-family: var(--font-mono); font-size: .8rem; letter-spacing: .06em; font-weight: 500; text-transform: uppercase; }
tbody tr { border-bottom: 1px solid var(--cream-dark); }
tbody tr:last-child { border-bottom: none; }
tbody tr:nth-child(even) { background: var(--cream); }
tbody td { padding: .75rem 1rem; vertical-align: top; }
.tag {
  display: inline-block;
  padding: .18rem .55rem;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: .04em;
}
.tag-required { background: #fde8e8; color: #c0392b; }
.tag-exempt { background: #e8f5e9; color: #2e7d32; }
.tag-varies { background: var(--amber-pale); color: var(--amber); }

/* ── Sidebar ── */
.sidebar { display: flex; flex-direction: column; gap: 1.4rem; }
.sidebar-widget {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 1.4rem;
}
.sidebar-widget h4 {
  font-family: var(--font-mono);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-faint);
  margin-bottom: 1rem;
  margin-top: 0;
  padding-bottom: .6rem;
  border-bottom: 1px solid var(--rule);
}
.sidebar-widget ul { list-style: none; padding: 0; margin: 0; }
.sidebar-widget ul li { padding: .35rem 0; border-bottom: 1px solid var(--cream-mid); font-size: .9rem; }
.sidebar-widget ul li:last-child { border-bottom: none; }

/* ── FAQ ── */
.faq-list { margin: 1.5rem 0; }
.faq-item {
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  margin-bottom: .6rem;
  background: var(--white);
  overflow: hidden;
}
.faq-q {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 1.1rem 1.3rem;
  font-family: var(--font-body);
  font-size: .97rem;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  transition: background var(--transition);
}
.faq-q:hover { background: var(--cream); }
.faq-q[aria-expanded="true"] { background: var(--sage-pale); color: var(--sage); }
.faq-q .faq-icon { flex-shrink: 0; transition: transform var(--transition); }
.faq-q[aria-expanded="true"] .faq-icon { transform: rotate(45deg); }
.faq-a {
  display: none;
  padding: 0 1.3rem 1.2rem;
  font-size: .94rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--cream-dark);
}
.faq-a.open { display: block; }

/* ── Step List ── */
.step-list { list-style: none; padding: 0; counter-reset: steps; }
.step-list li {
  counter-increment: steps;
  padding: 1rem 1rem 1rem 3.5rem;
  position: relative;
  border-bottom: 1px solid var(--cream-dark);
  font-size: .96rem;
}
.step-list li:last-child { border-bottom: none; }
.step-list li::before {
  content: counter(steps);
  position: absolute;
  left: 0;
  top: 1rem;
  width: 2rem; height: 2rem;
  background: var(--sage);
  color: var(--white);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: .82rem;
  font-family: var(--font-mono);
}
.step-list strong { display: block; margin-bottom: .3rem; }

/* ── Checklist ── */
.checklist { list-style: none; padding: 0; }
.checklist li {
  padding: .5rem 0 .5rem 2rem;
  position: relative;
  font-size: .95rem;
  border-bottom: 1px solid var(--cream-mid);
}
.checklist li:last-child { border-bottom: none; }
.checklist li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--sage);
  font-weight: 700;
}

/* ── Permit Finder Tool ── */
.tool-wrapper {
  background: var(--white);
  border: 2px solid var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.tool-header {
  background: var(--ink);
  color: var(--cream);
  padding: 1.4rem 1.8rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.tool-header h2 { color: var(--white); margin: 0; font-size: 1.2rem; }
.tool-header .tool-icon { font-size: 1.6rem; }
.tool-body { padding: 2rem; }
.tool-step { display: none; }
.tool-step.active { display: block; }
.tool-step-label {
  font-family: var(--font-mono);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--sage);
  margin-bottom: 1rem;
}
.tool-step h3 { margin-top: 0; font-size: 1.05rem; }
.tool-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .7rem;
  margin: 1rem 0;
}
.tool-option {
  border: 2px solid var(--rule);
  border-radius: var(--radius);
  padding: .9rem 1rem;
  cursor: pointer;
  font-size: .92rem;
  font-weight: 600;
  text-align: center;
  transition: all var(--transition);
  background: var(--cream);
  color: var(--ink);
}
.tool-option:hover { border-color: var(--sage); background: var(--sage-pale); }
.tool-option.selected { border-color: var(--sage); background: var(--sage); color: var(--white); }
.tool-select {
  width: 100%;
  padding: .75rem 1rem;
  border: 2px solid var(--rule);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 1rem;
  background: var(--cream);
  color: var(--ink);
  cursor: pointer;
}
.tool-select:focus { outline: 2px solid var(--sage); border-color: var(--sage); }
.tool-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.5rem;
}
.tool-progress {
  display: flex;
  gap: .4rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}
.tool-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--rule);
  transition: background var(--transition);
}
.tool-dot.active { background: var(--sage); }
.tool-result {
  background: var(--sage-pale);
  border: 2px solid var(--sage);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  display: none;
}
.tool-result.show { display: block; }
.tool-result h3 { margin-top: 0; color: var(--sage); }
.result-verdict {
  font-size: 1.4rem;
  font-family: var(--font-head);
  font-weight: 900;
  margin: .5rem 0 1rem;
}
.verdict-required { color: #c0392b; }
.verdict-likely { color: var(--amber); }
.verdict-exempt { color: var(--sage); }

/* ── State Grid ── */
.state-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: .7rem;
  margin: 1.5rem 0;
}
.state-card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: .9rem 1rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  font-size: .9rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  transition: all var(--transition);
}
.state-card:hover {
  border-color: var(--sage);
  background: var(--sage-pale);
  color: var(--sage);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.state-card .state-flag { font-size: 1.2rem; }

/* ── Section Labels ── */
.section-label {
  font-family: var(--font-mono);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--sage);
  margin-bottom: .8rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--rule); }

/* ── Pull Quote ── */
.pull-quote {
  border-left: 5px solid var(--amber);
  margin: 2rem 0;
  padding: 1.2rem 1.5rem;
  background: var(--amber-pale);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 1.1rem;
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.4;
}

/* ── Disclaimer ── */
.disclaimer {
  background: var(--cream-mid);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1rem 1.3rem;
  font-size: .83rem;
  color: var(--ink-faint);
  margin: 2rem 0;
}
.disclaimer strong { color: var(--ink-soft); }

/* ── Download CTA ── */
.download-cta {
  background: var(--amber-pale);
  border: 2px solid var(--amber);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin: 2rem 0;
}
.download-cta .dl-icon { font-size: 3rem; flex-shrink: 0; }
.download-cta h3 { margin: 0 0 .3rem; font-size: 1.1rem; }
.download-cta p { margin: 0 0 .8rem; font-size: .9rem; color: var(--ink-soft); }
@media (max-width: 560px) { .download-cta { flex-direction: column; } }

/* ── Footer ── */
.site-footer {
  background: var(--ink);
  color: var(--cream-dark);
  padding: 3.5rem 0 2rem;
  margin-top: 4rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 460px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand .site-logo { font-size: 1.2rem; margin-bottom: .8rem; }
.footer-brand p { font-size: .87rem; line-height: 1.6; color: #8a8a7e; max-width: 260px; }
.footer-col h5 {
  font-family: var(--font-mono);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #6b6b5e;
  margin-bottom: .9rem;
  margin-top: 0;
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col ul li { margin-bottom: .4rem; }
.footer-col ul li a { color: #a0a090; text-decoration: none; font-size: .88rem; transition: color var(--transition); }
.footer-col ul li a:hover { color: var(--cream); }
.footer-bottom {
  border-top: 1px solid #2a2a24;
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .82rem;
  color: #5a5a50;
  flex-wrap: wrap;
  gap: .5rem;
}
.footer-bottom a { color: #5a5a50; }
.footer-bottom a:hover { color: var(--cream); }

/* ── Utilities ── */
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.text-center { text-align: center; }
.text-muted { color: var(--ink-faint); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.highlight { background: linear-gradient(120deg, #f6d365 0%, #fda085 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* ── Animations ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp .55s cubic-bezier(.4,0,.2,1) both; }
.fade-up-d1 { animation-delay: .1s; }
.fade-up-d2 { animation-delay: .2s; }
.fade-up-d3 { animation-delay: .3s; }

/* ── Print ── */
@media print {
  .site-header, .site-footer, .sidebar, .tool-wrapper { display: none; }
  body { font-size: 12pt; }
  a { color: inherit; text-decoration: none; }
}
