/* ============================================
   DeckPermitGuide.pages.dev — Main Stylesheet
   Aesthetic: Editorial / Utilitarian
   Palette: Warm oak, slate, cream, accent amber
   ============================================ */

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

/* ── CSS Variables ── */
:root {
  --oak:       #8B5E3C;
  --oak-dark:  #5C3D1E;
  --oak-light: #C9956A;
  --cream:     #F8F4EE;
  --cream-dark:#EDE5D8;
  --slate:     #2C3039;
  --slate-mid: #4A5260;
  --slate-light:#7A8494;
  --amber:     #D4840A;
  --amber-lt:  #F5A623;
  --green:     #2D6A4F;
  --red:       #C0392B;
  --white:     #FFFFFF;
  --border:    #D6C9B8;
  --shadow:    rgba(44,48,57,0.12);

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'IBM Plex Serif', Georgia, serif;
  --font-mono:    'IBM Plex Mono', 'Courier New', monospace;

  --max-width: 1100px;
  --col-main:  680px;
  --radius:    4px;
  --transition: 0.2s ease;
}

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

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

body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--slate);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--oak); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--amber); }

/* ── Site Header ── */
.site-header {
  background: var(--slate);
  border-bottom: 3px solid var(--oak);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px var(--shadow);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
}

.site-logo {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--cream);
  text-decoration: none;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-logo .logo-accent {
  display: inline-block;
  background: var(--oak);
  color: var(--cream);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: var(--radius);
}

.site-logo:hover { color: var(--cream-dark); text-decoration: none; }

.site-nav {
  display: flex;
  gap: 6px;
  align-items: center;
}

.site-nav a {
  color: var(--slate-light);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: var(--radius);
  transition: background var(--transition), color var(--transition);
}

.site-nav a:hover {
  background: rgba(255,255,255,0.08);
  color: var(--cream);
}

.nav-cta {
  background: var(--oak) !important;
  color: var(--cream) !important;
}
.nav-cta:hover {
  background: var(--oak-dark) !important;
}

/* ── Hero ── */
.hero {
  background: var(--slate);
  color: var(--cream);
  padding: 72px 24px 64px;
  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
  );
  pointer-events: none;
}

.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  position: relative;
}

.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--oak-light);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-eyebrow::before {
  content: '';
  display: inline-block;
  width: 28px;
  height: 2px;
  background: var(--oak-light);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 900;
  line-height: 1.12;
  letter-spacing: -0.02em;
  max-width: 720px;
  margin-bottom: 24px;
}

.hero h1 em {
  font-style: italic;
  color: var(--oak-light);
}

.hero-sub {
  font-size: 1.05rem;
  color: rgba(248,244,238,0.78);
  max-width: 580px;
  margin-bottom: 36px;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
}

.btn-primary {
  background: var(--oak);
  color: var(--cream);
  border-color: var(--oak);
}
.btn-primary:hover {
  background: var(--oak-dark);
  border-color: var(--oak-dark);
  color: var(--cream);
  text-decoration: none;
}

.btn-outline {
  background: transparent;
  color: var(--cream);
  border-color: rgba(248,244,238,0.4);
}
.btn-outline:hover {
  border-color: var(--cream);
  color: var(--cream);
  text-decoration: none;
}

.btn-amber {
  background: var(--amber);
  color: var(--white);
  border-color: var(--amber);
}
.btn-amber:hover {
  background: var(--oak);
  border-color: var(--oak);
  color: var(--white);
  text-decoration: none;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.72rem;
}

/* ── Page Layout ── */
.page-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 56px 24px;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 56px;
  align-items: start;
}

.page-wrapper.no-sidebar {
  grid-template-columns: 1fr;
  max-width: 780px;
}

.page-wrapper.full-width {
  grid-template-columns: 1fr;
  max-width: var(--max-width);
}

/* ── Article / Prose ── */
.article-header {
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 2px solid var(--border);
}

.article-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--oak);
  margin-bottom: 12px;
  display: block;
}

.article-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.article-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--slate-light);
  letter-spacing: 0.04em;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.article-meta span::before {
  content: '— ';
  color: var(--border);
}
.article-meta span:first-child::before { content: ''; }

/* Prose styles */
.prose h2 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 48px 0 18px;
  padding-top: 8px;
  border-top: 2px solid var(--border);
  color: var(--slate);
}

.prose h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  margin: 32px 0 12px;
  color: var(--oak-dark);
}

.prose p {
  margin-bottom: 20px;
  line-height: 1.8;
}

.prose ul, .prose ol {
  margin: 0 0 20px 0;
  padding-left: 24px;
}

.prose li {
  margin-bottom: 8px;
  line-height: 1.7;
}

.prose strong { font-weight: 600; color: var(--slate); }

.prose em { font-style: italic; }

.prose a { color: var(--oak); }

.prose blockquote {
  border-left: 4px solid var(--oak);
  padding: 16px 20px;
  margin: 28px 0;
  background: var(--cream-dark);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
}

.prose blockquote p { margin-bottom: 0; }

/* ── Info Boxes ── */
.info-box {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 28px 0;
  background: var(--white);
}

.info-box.warning {
  border-color: var(--amber);
  background: #FFF9EF;
}

.info-box.success {
  border-color: var(--green);
  background: #F0FAF5;
}

.info-box.danger {
  border-color: var(--red);
  background: #FDF3F2;
}

.info-box-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 8px;
  display: block;
}

.info-box.warning .info-box-label { color: var(--amber); }
.info-box.success .info-box-label { color: var(--green); }
.info-box.danger .info-box-label  { color: var(--red); }
.info-box .info-box-label         { color: var(--oak); }

.info-box p { margin-bottom: 0; font-size: 0.95rem; }

/* ── Data Tables ── */
.data-table-wrap {
  overflow-x: auto;
  margin: 28px 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th {
  background: var(--slate);
  color: var(--cream);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 12px 16px;
  text-align: left;
}

.data-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:nth-child(even) td { background: var(--cream-dark); }

/* ── FAQ Section ── */
.faq-section {
  margin: 48px 0;
}

.faq-section h2 {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 700;
  margin-bottom: 28px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border);
}

.faq-item {
  border-bottom: 1px solid var(--border);
  padding: 20px 0;
}

.faq-q {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  user-select: none;
}

.faq-q .faq-icon {
  font-size: 1.2rem;
  font-weight: 400;
  flex-shrink: 0;
  margin-top: 2px;
  transition: transform var(--transition);
  color: var(--oak);
}

.faq-a {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.faq-a-inner {
  padding: 14px 0 4px;
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--slate-mid);
}

.faq-item.open .faq-icon { transform: rotate(45deg); }
.faq-item.open .faq-a   { max-height: 600px; }

/* ── Sidebar ── */
.sidebar { position: sticky; top: 84px; }

.sidebar-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
}

.sidebar-card h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}

.sidebar-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-card ul li {
  border-bottom: 1px solid var(--cream-dark);
  padding: 8px 0;
}

.sidebar-card ul li:last-child { border-bottom: none; }

.sidebar-card ul a {
  font-size: 0.88rem;
  color: var(--slate-mid);
  text-decoration: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-card ul a:hover { color: var(--oak); }

.sidebar-card ul a .arrow {
  font-size: 0.75rem;
  color: var(--border);
}

.sidebar-tool-card {
  background: var(--slate);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  color: var(--cream);
}

.sidebar-tool-card h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--cream);
}

.sidebar-tool-card p {
  font-size: 0.85rem;
  color: rgba(248,244,238,0.7);
  margin-bottom: 16px;
  line-height: 1.6;
}

/* ── Checklist ── */
.checklist {
  list-style: none;
  padding: 0;
  margin: 20px 0;
}

.checklist li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--cream-dark);
  font-size: 0.95rem;
}

.checklist li:last-child { border-bottom: none; }

.checklist li::before {
  content: '☐';
  font-size: 1rem;
  color: var(--oak);
  flex-shrink: 0;
  margin-top: 1px;
}

.checklist li.checked::before { content: '☑'; color: var(--green); }

/* ── Section Dividers ── */
.section-divider {
  border: none;
  border-top: 2px solid var(--border);
  margin: 48px 0;
}

/* ── State Grid ── */
.state-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin: 28px 0;
}

.state-card {
  display: block;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-decoration: none;
  transition: all var(--transition);
}

.state-card:hover {
  border-color: var(--oak);
  box-shadow: 0 2px 12px var(--shadow);
  text-decoration: none;
  transform: translateY(-1px);
}

.state-card .state-abbr {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--oak);
  margin-bottom: 4px;
  display: block;
}

.state-card .state-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--slate);
  display: block;
}

.state-card .state-status {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--slate-light);
  margin-top: 4px;
  display: block;
}

/* ── Feature Cards ── */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin: 32px 0;
}

.feature-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: box-shadow var(--transition);
}

.feature-card:hover {
  box-shadow: 0 4px 20px var(--shadow);
}

.feature-icon {
  font-size: 1.8rem;
  margin-bottom: 14px;
  display: block;
}

.feature-card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 0.88rem;
  color: var(--slate-mid);
  line-height: 1.65;
}

/* ── Breadcrumbs ── */
.breadcrumb {
  background: var(--cream-dark);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
}

.breadcrumb-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--slate-light);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.breadcrumb-inner a {
  color: var(--slate-light);
  text-decoration: none;
}
.breadcrumb-inner a:hover { color: var(--oak); }
.breadcrumb-inner .sep { color: var(--border); }
.breadcrumb-inner .current { color: var(--slate); }

/* ── Tool Widget ── */
.tool-widget {
  background: var(--white);
  border: 2px solid var(--oak);
  border-radius: var(--radius);
  padding: 32px;
  margin: 40px 0;
}

.tool-widget h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.tool-widget .tool-desc {
  font-size: 0.9rem;
  color: var(--slate-mid);
  margin-bottom: 28px;
}

.tool-step {
  margin-bottom: 22px;
}

.tool-step label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate);
  margin-bottom: 8px;
}

.tool-step select,
.tool-step input[type="number"],
.tool-step input[type="text"] {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.95rem;
  background: var(--cream);
  color: var(--slate);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color var(--transition);
}

.tool-step select:focus,
.tool-step input:focus {
  outline: none;
  border-color: var(--oak);
}

.tool-radio-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.tool-radio {
  flex: 1;
  min-width: 120px;
}

.tool-radio input[type="radio"] { display: none; }

.tool-radio label {
  display: block;
  padding: 10px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: all var(--transition);
  color: var(--slate-mid);
}

.tool-radio input:checked + label {
  border-color: var(--oak);
  background: var(--oak);
  color: var(--cream);
}

.tool-result {
  display: none;
  background: var(--cream);
  border: 2px solid var(--oak);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 24px;
}

.tool-result.show { display: block; }

.tool-result-verdict {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.verdict-yes  { color: var(--red); }
.verdict-no   { color: var(--green); }
.verdict-maybe{ color: var(--amber); }

.tool-result-detail {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--slate-mid);
}

/* ── Site Footer ── */
.site-footer {
  background: var(--slate);
  color: rgba(248,244,238,0.65);
  margin-top: 80px;
  padding: 56px 24px 32px;
  border-top: 3px solid var(--oak);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}

.footer-brand h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--cream);
  margin-bottom: 12px;
}

.footer-brand p {
  font-size: 0.85rem;
  line-height: 1.7;
  max-width: 280px;
}

.footer-col h3 {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--oak-light);
  margin-bottom: 16px;
}

.footer-col ul {
  list-style: none;
  padding: 0;
}

.footer-col ul li {
  margin-bottom: 8px;
}

.footer-col a {
  color: rgba(248,244,238,0.6);
  text-decoration: none;
  font-size: 0.88rem;
  transition: color var(--transition);
}

.footer-col a:hover { color: var(--cream); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
}

.footer-disclaimer {
  font-size: 0.78rem;
  color: rgba(248,244,238,0.4);
  margin-bottom: 24px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  line-height: 1.7;
}

/* ── Analytics placeholder ── */
/* 
  ANALYTICS PLACEHOLDER — activate after AdSense approval
  Replace tokens below:
    G-XXXXXXXXXX     → Google Analytics 4 Measurement ID
    pub-XXXXXXXX     → Google AdSense Publisher ID
    CLARITY-ID       → Microsoft Clarity Project ID
    GSC-TOKEN        → Google Search Console verification token
*/

/* ── Utility Classes ── */
.text-center  { text-align: center; }
.text-mono    { font-family: var(--font-mono); }
.text-sm      { font-size: 0.88rem; }
.text-muted   { color: var(--slate-light); }
.text-amber   { color: var(--amber); }
.text-oak     { color: var(--oak); }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mt-32{ margin-top: 32px; }
.badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 2px;
  vertical-align: middle;
}
.badge-required { background: #FDECEA; color: var(--red); }
.badge-maybe    { background: #FFF3E0; color: var(--amber); }
.badge-exempt   { background: #E8F5E9; color: var(--green); }

/* ── Responsive ── */
@media (max-width: 900px) {
  .page-wrapper {
    grid-template-columns: 1fr;
  }
  .sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .header-inner { padding: 0 16px; }
  .site-nav { display: none; }
  .hero { padding: 48px 16px; }
  .page-wrapper { padding: 32px 16px; }
  .footer-grid { grid-template-columns: 1fr; }
  .state-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .feature-grid { grid-template-columns: 1fr; }
  .tool-radio-group { flex-direction: column; }
}
