/* ===================================================
   BurnPermitGuide.com — Main Stylesheet
   Aesthetic: Warm editorial / field-manual authority
   Palette: Charcoal, ember orange, parchment, smoke
   =================================================== */

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

/* ── CSS Custom Properties ── */
:root {
  --ember:      #C94F1A;
  --ember-deep: #9E3A0E;
  --ember-glow: #E8723A;
  --char:       #1C1A18;
  --char-mid:   #2F2C28;
  --char-soft:  #4A4540;
  --smoke:      #7A7268;
  --parch:      #F5F0E8;
  --parch-deep: #EDE5D4;
  --parch-border: #D9CDB8;
  --white:      #FDFAF6;
  --warn-bg:    #FFF8F0;
  --warn-border:#C94F1A;
  --ok-bg:      #F0F7F0;
  --ok-border:  #3A7A3A;
  --link:       #9E3A0E;
  --link-hover: #C94F1A;

  --ff-display: 'Playfair Display', Georgia, serif;
  --ff-body:    'Source Serif 4', Georgia, serif;
  --ff-mono:    'IBM Plex Mono', Courier, monospace;

  --max-w:      1080px;
  --col-w:      680px;
  --sidebar-w:  280px;
  --gap:        2rem;
  --section-gap:4rem;

  --radius:     4px;
  --radius-lg:  8px;
  --shadow:     0 2px 12px rgba(28,26,24,0.10);
  --shadow-lg:  0 8px 32px rgba(28,26,24,0.15);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 17px; scroll-behavior: smooth; }

body {
  font-family: var(--ff-body);
  background: var(--parch);
  color: var(--char);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--link); text-decoration: underline; text-decoration-color: transparent; transition: color .2s, text-decoration-color .2s; }
a:hover { color: var(--link-hover); text-decoration-color: var(--link-hover); }

/* ── Typography Scale ── */
h1, h2, h3, h4, h5 {
  font-family: var(--ff-display);
  line-height: 1.2;
  color: var(--char);
}
h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-weight: 900; }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); font-weight: 700; }
h3 { font-size: clamp(1.15rem, 2.5vw, 1.5rem); font-weight: 700; }
h4 { font-size: 1.1rem; font-weight: 700; }
h5 { font-size: 1rem; font-weight: 700; }

p { margin-bottom: 1.25rem; }
p:last-child { margin-bottom: 0; }

ul, ol { padding-left: 1.5rem; margin-bottom: 1.25rem; }
li { margin-bottom: .35rem; }
li:last-child { margin-bottom: 0; }

strong { font-weight: 600; color: var(--char); }
em { font-style: italic; }

code, .mono {
  font-family: var(--ff-mono);
  font-size: .88em;
  background: var(--parch-deep);
  padding: .1em .4em;
  border-radius: 3px;
  border: 1px solid var(--parch-border);
}

hr {
  border: none;
  border-top: 1px solid var(--parch-border);
  margin: 2.5rem 0;
}

/* ── Layout Utilities ── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.5rem; }
.container--narrow { max-width: var(--col-w); margin: 0 auto; padding: 0 1.5rem; }

.layout-article {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-w);
  gap: var(--gap);
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}
.layout-article .article-body { min-width: 0; }
.layout-article .article-sidebar { min-width: 0; }

/* ── Site Header ── */
.site-header {
  background: var(--char);
  color: var(--white);
  border-bottom: 3px solid var(--ember);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: .9rem 1.5rem;
  gap: 1rem;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
}
.site-logo__icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}
.site-logo__text {
  font-family: var(--ff-display);
  font-weight: 900;
  font-size: 1.15rem;
  color: var(--white);
  line-height: 1;
}
.site-logo__text span { color: var(--ember-glow); }

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.site-nav a {
  color: #C8C2B8;
  text-decoration: none;
  font-size: .9rem;
  font-family: var(--ff-body);
  letter-spacing: .02em;
  transition: color .2s;
}
.site-nav a:hover { color: var(--ember-glow); }
.site-nav a.active { color: var(--ember-glow); font-weight: 600; }

.site-nav__cta {
  background: var(--ember);
  color: var(--white) !important;
  padding: .4rem .9rem;
  border-radius: var(--radius);
  font-weight: 600 !important;
  transition: background .2s !important;
}
.site-nav__cta:hover { background: var(--ember-glow) !important; color: var(--white) !important; }

/* ── Breadcrumb ── */
.breadcrumb {
  background: var(--parch-deep);
  border-bottom: 1px solid var(--parch-border);
  padding: .55rem 0;
  font-size: .82rem;
  color: var(--smoke);
}
.breadcrumb ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .3rem; }
.breadcrumb li::after { content: '›'; margin-left: .3rem; color: var(--parch-border); }
.breadcrumb li:last-child::after { display: none; }
.breadcrumb a { color: var(--smoke); }
.breadcrumb a:hover { color: var(--ember); }

/* ── Hero Sections ── */
.hero {
  background: var(--char);
  color: var(--white);
  padding: 4rem 0 3rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(201,79,26,.25) 0%, transparent 65%),
              url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

.hero__content { position: relative; z-index: 1; }

.hero__eyebrow {
  display: inline-block;
  font-family: var(--ff-mono);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--ember-glow);
  margin-bottom: .75rem;
}

.hero h1 { color: var(--white); margin-bottom: 1rem; }
.hero__lead {
  font-size: 1.15rem;
  color: #C8C2B8;
  max-width: 600px;
  margin-bottom: 1.75rem;
  line-height: 1.65;
}

.hero__actions { display: flex; gap: .75rem; flex-wrap: wrap; }

/* ── Buttons ── */
.btn {
  display: inline-block;
  padding: .65rem 1.4rem;
  border-radius: var(--radius);
  font-family: var(--ff-body);
  font-size: .95rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .2s, color .2s, transform .15s, box-shadow .2s;
  cursor: pointer;
  border: none;
  line-height: 1.3;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--ember);
  color: var(--white);
  box-shadow: 0 2px 8px rgba(201,79,26,.35);
}
.btn--primary:hover { background: var(--ember-glow); color: var(--white); box-shadow: 0 4px 16px rgba(201,79,26,.45); }

.btn--secondary {
  background: transparent;
  color: var(--white);
  border: 1.5px solid rgba(255,255,255,.35);
}
.btn--secondary:hover { border-color: var(--ember-glow); color: var(--ember-glow); }

.btn--outline {
  background: transparent;
  color: var(--ember);
  border: 1.5px solid var(--ember);
}
.btn--outline:hover { background: var(--ember); color: var(--white); }

.btn--sm { padding: .45rem 1rem; font-size: .88rem; }

/* ── Alert / Notice Boxes ── */
.notice {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-lg);
  border-left: 4px solid;
  margin: 1.5rem 0;
  font-size: .95rem;
}
.notice p:last-child { margin-bottom: 0; }
.notice strong { display: block; margin-bottom: .3rem; }

.notice--warn { background: var(--warn-bg); border-color: var(--warn-border); }
.notice--warn strong { color: var(--ember-deep); }

.notice--ok { background: var(--ok-bg); border-color: var(--ok-border); }
.notice--ok strong { color: #2A5A2A; }

.notice--info { background: #EFF5FF; border-color: #3A6ABA; }
.notice--info strong { color: #1E3A6A; }

.notice--neutral { background: var(--parch-deep); border-color: var(--smoke); }

/* ── Cards ── */
.card {
  background: var(--white);
  border: 1px solid var(--parch-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: box-shadow .2s, transform .2s;
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.card__tag {
  font-family: var(--ff-mono);
  font-size: .73rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--smoke);
  margin-bottom: .5rem;
}
.card__title {
  font-family: var(--ff-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: .5rem;
  color: var(--char);
}
.card__title a { text-decoration: none; color: inherit; }
.card__title a:hover { color: var(--ember); }
.card__desc { font-size: .9rem; color: var(--char-soft); line-height: 1.55; }

.card-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

/* ── State Grid ── */
.state-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: .75rem;
}
.state-item {
  background: var(--white);
  border: 1px solid var(--parch-border);
  border-radius: var(--radius);
  padding: .65rem 1rem;
  text-decoration: none;
  color: var(--char);
  font-size: .9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: .5rem;
  transition: border-color .2s, background .2s, color .2s;
}
.state-item:hover { border-color: var(--ember); background: var(--warn-bg); color: var(--ember-deep); }
.state-item__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.state-item__dot--free { background: #3A7A3A; }
.state-item__dot--req  { background: var(--ember); }
.state-item__dot--ban  { background: #999; }

/* ── FAQ Accordion ── */
.faq { border: 1px solid var(--parch-border); border-radius: var(--radius-lg); overflow: hidden; }
.faq-item { border-bottom: 1px solid var(--parch-border); }
.faq-item:last-child { border-bottom: none; }

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  cursor: pointer;
  font-family: var(--ff-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--char);
  background: var(--white);
  border: none;
  width: 100%;
  text-align: left;
  gap: 1rem;
  transition: background .2s;
}
.faq-question:hover { background: var(--parch); }
.faq-question[aria-expanded="true"] { background: var(--parch); color: var(--ember-deep); }

.faq-icon {
  font-size: 1.2rem;
  color: var(--ember);
  flex-shrink: 0;
  transition: transform .25s;
  font-style: normal;
}
.faq-question[aria-expanded="true"] .faq-icon { transform: rotate(45deg); }

.faq-answer {
  padding: 0 1.25rem;
  max-height: 0;
  overflow: hidden;
  background: var(--parch);
  transition: max-height .35s ease, padding .35s ease;
}
.faq-answer.open {
  padding: 1rem 1.25rem 1.25rem;
  max-height: 600px;
}
.faq-answer p:last-child { margin-bottom: 0; }

/* ── Steps List ── */
.steps { list-style: none; padding: 0; counter-reset: step; }
.steps li {
  counter-increment: step;
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: flex-start;
}
.steps li::before {
  content: counter(step);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--ember);
  color: var(--white);
  font-family: var(--ff-mono);
  font-size: .85rem;
  font-weight: 500;
  flex-shrink: 0;
  margin-top: .1rem;
}
.steps li:last-child { margin-bottom: 0; }

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

/* ── Table ── */
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table th {
  background: var(--char);
  color: var(--white);
  padding: .65rem .9rem;
  text-align: left;
  font-family: var(--ff-mono);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  font-weight: 500;
}
.data-table td {
  padding: .65rem .9rem;
  border-bottom: 1px solid var(--parch-border);
  vertical-align: top;
}
.data-table tr:nth-child(even) td { background: var(--parch-deep); }
.data-table tr:hover td { background: var(--warn-bg); }
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--parch-border); box-shadow: var(--shadow); }

/* ── Sidebar ── */
.sidebar-box {
  background: var(--white);
  border: 1px solid var(--parch-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow);
}
.sidebar-box__title {
  font-family: var(--ff-mono);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--smoke);
  margin-bottom: .85rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--parch-border);
}
.sidebar-box ul { list-style: none; padding: 0; margin: 0; }
.sidebar-box ul li { margin-bottom: .4rem; }
.sidebar-box ul li a { font-size: .9rem; }
.sidebar-cta {
  background: var(--ember);
  color: var(--white);
  border-color: var(--ember);
}
.sidebar-cta .sidebar-box__title { color: rgba(255,255,255,.7); border-color: rgba(255,255,255,.2); }
.sidebar-cta p { font-size: .9rem; color: rgba(255,255,255,.88); margin-bottom: .85rem; }
.sidebar-cta .btn { background: var(--white); color: var(--ember-deep); width: 100%; text-align: center; }
.sidebar-cta .btn:hover { background: var(--parch); }

/* ── Pull Quote ── */
.pull-quote {
  border-left: 4px solid var(--ember);
  padding: .75rem 1.25rem;
  margin: 2rem 0;
  background: var(--parch-deep);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}
.pull-quote p {
  font-size: 1.05rem;
  font-style: italic;
  color: var(--char-mid);
  margin: 0;
}

/* ── Content Sections ── */
.section { padding: var(--section-gap) 0; }
.section--alt { background: var(--parch-deep); }
.section--dark { background: var(--char); color: var(--white); }
.section--dark h2, .section--dark h3 { color: var(--white); }

.section__header { margin-bottom: 2rem; }
.section__eyebrow {
  display: inline-block;
  font-family: var(--ff-mono);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--ember);
  margin-bottom: .5rem;
}
.section__title { margin-bottom: .5rem; }
.section__lead { font-size: 1.05rem; color: var(--char-soft); max-width: 600px; }

/* ── Tool Widget ── */
.tool-panel {
  background: var(--white);
  border: 2px solid var(--parch-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
}
.tool-panel h3 { margin-bottom: 1rem; }

.tool-select {
  width: 100%;
  padding: .65rem 1rem;
  border: 1.5px solid var(--parch-border);
  border-radius: var(--radius);
  background: var(--white);
  font-family: var(--ff-body);
  font-size: 1rem;
  color: var(--char);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%234A4540' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
  transition: border-color .2s;
  margin-bottom: 1rem;
  cursor: pointer;
}
.tool-select:focus { outline: none; border-color: var(--ember); box-shadow: 0 0 0 3px rgba(201,79,26,.15); }

.tool-result {
  margin-top: 1.5rem;
  display: none;
  animation: fadeIn .3s ease;
}
.tool-result.visible { display: block; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ── Status Badge ── */
.badge {
  display: inline-block;
  padding: .2rem .65rem;
  border-radius: 20px;
  font-family: var(--ff-mono);
  font-size: .75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.badge--req   { background: #FDEEE7; color: var(--ember-deep); }
.badge--free  { background: var(--ok-bg); color: #2A5A2A; }
.badge--ban   { background: #F0F0F0; color: var(--smoke); }
.badge--vary  { background: #FFF8E8; color: #7A5A00; }

/* ── Stat Block ── */
.stat-row { display: flex; gap: 1rem; flex-wrap: wrap; margin: 2rem 0; }
.stat-box {
  flex: 1;
  min-width: 140px;
  background: var(--char-mid);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  text-align: center;
}
.stat-box__num {
  font-family: var(--ff-display);
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--ember-glow);
  line-height: 1;
  margin-bottom: .25rem;
}
.stat-box__label {
  font-family: var(--ff-mono);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #C8C2B8;
}

/* ── Footer ── */
.site-footer {
  background: var(--char);
  color: #C8C2B8;
  padding: 3rem 0 1.5rem;
  margin-top: var(--section-gap);
  border-top: 3px solid var(--ember);
}
.site-footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}
.footer-col__title {
  font-family: var(--ff-mono);
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ember-glow);
  margin-bottom: .85rem;
}
.footer-col ul { list-style: none; padding: 0; }
.footer-col ul li { margin-bottom: .4rem; }
.footer-col ul a { color: #A8A09A; font-size: .88rem; text-decoration: none; transition: color .2s; }
.footer-col ul a:hover { color: var(--ember-glow); }
.footer-col p { font-size: .88rem; line-height: 1.6; color: #A8A09A; }
.footer-brand { font-family: var(--ff-display); font-size: 1.2rem; font-weight: 900; color: var(--white); margin-bottom: .5rem; }
.footer-brand span { color: var(--ember-glow); }

.site-footer__bottom {
  border-top: 1px solid #3A3630;
  padding-top: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem;
  font-size: .8rem;
  color: var(--smoke);
}
.site-footer__bottom a { color: var(--smoke); }
.site-footer__bottom a:hover { color: var(--ember-glow); }

/* ── Disclaimer ── */
.disclaimer {
  background: var(--parch-deep);
  border: 1px solid var(--parch-border);
  border-radius: var(--radius);
  padding: .85rem 1rem;
  font-size: .82rem;
  color: var(--smoke);
  margin: 2rem 0;
  line-height: 1.6;
}

/* ── Responsive ── */
@media (max-width: 860px) {
  .layout-article { grid-template-columns: 1fr; }
  .layout-article .article-sidebar { order: -1; }
  .site-footer__grid { grid-template-columns: 1fr 1fr; }
  .stat-row { gap: .75rem; }
}

@media (max-width: 640px) {
  html { font-size: 16px; }
  .site-header__inner { flex-direction: column; align-items: flex-start; gap: .75rem; }
  .site-nav { gap: 1rem; }
  .hero { padding: 2.5rem 0 2rem; }
  .site-footer__grid { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .state-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .layout-article { padding: 0 1rem; }
}

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