/* ============================================
   POOL PERMIT HUB — styles.css
   Theme: Trustworthy Civic / Warm Authority
   Palette: Deep Navy + Warm Amber + Clean White
   Fonts: Playfair Display + Source Sans 3
============================================ */

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

/* ---- TOKENS ---- */
:root {
  --navy:       #0d2340;
  --navy-mid:   #163558;
  --navy-light: #1e4a73;
  --amber:      #e8922a;
  --amber-light:#f5b060;
  --amber-pale: #fdf3e7;
  --white:      #ffffff;
  --off-white:  #f8f9fb;
  --gray-100:   #f0f2f5;
  --gray-200:   #dde1e7;
  --gray-400:   #8a9ab0;
  --gray-600:   #4a5a6e;
  --gray-800:   #1e2d3d;
  --green:      #2a7a4b;
  --green-pale: #eaf4ef;
  --red:        #b83232;
  --red-pale:   #fdeaea;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Source Sans 3', 'Segoe UI', sans-serif;

  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  16px;
  --shadow-sm:  0 1px 4px rgba(13,35,64,.08);
  --shadow-md:  0 4px 16px rgba(13,35,64,.12);
  --shadow-lg:  0 8px 32px rgba(13,35,64,.16);

  --max-w:      1120px;
  --content-w:  760px;
}

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

/* ---- SITE HEADER ---- */
.site-header {
  background: var(--navy);
  color: var(--white);
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 2rem;
}
.site-logo {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--white);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: -.01em;
}
.site-logo span { color: var(--amber); }
.site-logo:hover { color: var(--amber-light); }

.main-nav { display: flex; gap: .25rem; align-items: center; flex-wrap: wrap; }
.main-nav a {
  color: rgba(255,255,255,.85);
  text-decoration: none;
  font-size: .88rem;
  font-weight: 600;
  padding: .4rem .75rem;
  border-radius: var(--radius-sm);
  transition: background .15s, color .15s;
  letter-spacing: .02em;
}
.main-nav a:hover { background: rgba(255,255,255,.1); color: var(--white); }
.main-nav a.active { color: var(--amber); }

.nav-cta {
  background: var(--amber) !important;
  color: var(--navy) !important;
  border-radius: var(--radius-sm) !important;
}
.nav-cta:hover { background: var(--amber-light) !important; }

/* hamburger */
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: .5rem; }
.nav-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--white); margin: 5px 0;
  transition: transform .2s, opacity .2s;
}

/* ---- HERO ---- */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 60%, var(--navy-light) 100%);
  color: var(--white);
  padding: 4rem 1.5rem 3.5rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: 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.03'%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");
}
.hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  position: relative;
}
.hero-tag {
  display: inline-block;
  background: rgba(232,146,42,.2);
  color: var(--amber-light);
  border: 1px solid rgba(232,146,42,.35);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: .3rem .85rem;
  border-radius: 50px;
  margin-bottom: 1.2rem;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
  max-width: 720px;
  margin-bottom: 1.1rem;
}
.hero h1 em { color: var(--amber); font-style: normal; }
.hero-sub {
  font-size: 1.1rem;
  color: rgba(255,255,255,.8);
  max-width: 580px;
  margin-bottom: 2rem;
  line-height: 1.6;
}
.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; align-items: center; }
.btn-primary {
  background: var(--amber);
  color: var(--navy);
  font-weight: 700;
  font-family: var(--font-body);
  font-size: .95rem;
  padding: .75rem 1.6rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  border: none; cursor: pointer;
  transition: background .15s, transform .1s;
  letter-spacing: .02em;
  display: inline-block;
}
.btn-primary:hover { background: var(--amber-light); color: var(--navy); transform: translateY(-1px); }
.btn-secondary {
  background: transparent;
  color: rgba(255,255,255,.9);
  border: 1px solid rgba(255,255,255,.3);
  font-weight: 600;
  font-family: var(--font-body);
  font-size: .95rem;
  padding: .75rem 1.6rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  display: inline-block;
}
.btn-secondary:hover { border-color: rgba(255,255,255,.6); background: rgba(255,255,255,.08); color: var(--white); }

/* ---- TRUST BAR ---- */
.trust-bar {
  background: var(--amber-pale);
  border-top: 3px solid var(--amber);
  padding: 1.2rem 1.5rem;
}
.trust-bar-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}
.trust-item {
  display: flex; align-items: center; gap: .5rem;
  font-size: .85rem; font-weight: 600; color: var(--navy-mid);
}
.trust-item svg { color: var(--amber); flex-shrink: 0; }

/* ---- LAYOUT WRAPPERS ---- */
.page-wrapper {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  align-items: start;
}
.page-wrapper.no-sidebar {
  grid-template-columns: 1fr;
  max-width: var(--content-w);
}
.full-width-section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

/* ---- ARTICLE / CONTENT ---- */
.article-header { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 2px solid var(--gray-200); }
.article-meta {
  display: flex; gap: 1.2rem; flex-wrap: wrap; align-items: center;
  font-size: .82rem; color: var(--gray-400); font-weight: 600;
  letter-spacing: .03em; text-transform: uppercase; margin-bottom: 1rem;
}
.meta-tag {
  background: var(--gray-100); color: var(--navy-mid);
  padding: .2rem .65rem; border-radius: 50px; font-size: .78rem;
}
.article-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.4rem);
  line-height: 1.25;
  color: var(--navy);
  margin-bottom: .75rem;
}
.article-header .lede {
  font-size: 1.1rem; color: var(--gray-600); line-height: 1.65; max-width: 640px;
}

.article-body h2 {
  font-family: var(--font-display);
  font-size: 1.45rem;
  color: var(--navy);
  margin: 2.5rem 0 .8rem;
  padding-top: .5rem;
  border-top: 2px solid var(--gray-100);
}
.article-body h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy-mid);
  margin: 1.8rem 0 .5rem;
}
.article-body p { margin-bottom: 1.1rem; }
.article-body ul, .article-body ol {
  margin: .5rem 0 1.2rem 1.5rem;
  display: flex; flex-direction: column; gap: .4rem;
}
.article-body li::marker { color: var(--amber); }

/* ---- CALLOUT BOXES ---- */
.callout {
  border-left: 4px solid var(--amber);
  background: var(--amber-pale);
  padding: 1.1rem 1.3rem;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 1.5rem 0;
  font-size: .95rem;
}
.callout.info { border-color: var(--navy-light); background: #edf3fa; }
.callout.warn { border-color: var(--red); background: var(--red-pale); }
.callout.good { border-color: var(--green); background: var(--green-pale); }
.callout strong { display: block; margin-bottom: .3rem; font-size: .9rem; letter-spacing: .04em; text-transform: uppercase; }
.callout.warn strong { color: var(--red); }
.callout.good strong { color: var(--green); }
.callout.info strong { color: var(--navy-light); }

/* ---- DATA TABLES ---- */
.data-table-wrap { overflow-x: auto; margin: 1.5rem 0; border-radius: var(--radius-md); border: 1px solid var(--gray-200); }
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table thead { background: var(--navy); color: var(--white); }
.data-table th { padding: .8rem 1rem; text-align: left; font-weight: 700; font-size: .82rem; letter-spacing: .04em; text-transform: uppercase; }
.data-table td { padding: .75rem 1rem; border-bottom: 1px solid var(--gray-200); vertical-align: top; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:nth-child(even) { background: var(--off-white); }
.data-table tbody tr:hover { background: var(--amber-pale); }
.tag-req  { background: var(--red-pale);   color: var(--red);   font-size:.78rem; font-weight:700; padding:.15rem .5rem; border-radius:50px; white-space:nowrap; }
.tag-opt  { background: #fffbea; color:#7a5c00; font-size:.78rem; font-weight:700; padding:.15rem .5rem; border-radius:50px; white-space:nowrap; }
.tag-none { background: var(--green-pale); color:var(--green); font-size:.78rem; font-weight:700; padding:.15rem .5rem; border-radius:50px; white-space:nowrap; }

/* ---- FAQ ---- */
.faq-section { margin: 2.5rem 0; }
.faq-section h2 {
  font-family: var(--font-display);
  font-size: 1.5rem; color: var(--navy);
  margin-bottom: 1.2rem;
}
.faq-item { border: 1px solid var(--gray-200); border-radius: var(--radius-md); margin-bottom: .75rem; overflow: hidden; }
.faq-question {
  width: 100%; background: none; border: none; cursor: pointer;
  text-align: left; padding: 1.1rem 1.3rem;
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--font-body); font-size: 1rem; font-weight: 700;
  color: var(--navy); gap: 1rem;
  transition: background .15s;
}
.faq-question:hover { background: var(--off-white); }
.faq-question[aria-expanded="true"] { background: var(--amber-pale); }
.faq-icon { flex-shrink: 0; width: 22px; height: 22px; transition: transform .2s; color: var(--amber); }
.faq-question[aria-expanded="true"] .faq-icon { transform: rotate(45deg); }
.faq-answer { display: none; padding: 0 1.3rem 1.2rem; font-size: .95rem; color: var(--gray-600); line-height: 1.65; }
.faq-answer.open { display: block; }

/* ---- CARDS GRID ---- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.5rem;
}
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, transform .2s, border-color .2s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: var(--amber);
  color: inherit;
}
.card-icon {
  width: 44px; height: 44px;
  background: var(--amber-pale);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem;
  font-size: 1.4rem;
}
.card h3 { font-size: 1.05rem; color: var(--navy); margin-bottom: .4rem; font-weight: 700; }
.card p  { font-size: .88rem; color: var(--gray-600); line-height: 1.55; }

/* ---- SIDEBAR ---- */
.sidebar { display: flex; flex-direction: column; gap: 1.5rem; }
.sidebar-box {
  background: var(--off-white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 1.3rem;
}
.sidebar-box h3 {
  font-size: .88rem; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--navy); margin-bottom: 1rem;
  padding-bottom: .6rem; border-bottom: 2px solid var(--gray-200);
}
.sidebar-box ul { list-style: none; display: flex; flex-direction: column; gap: .4rem; }
.sidebar-box ul li a {
  font-size: .9rem; color: var(--gray-600); text-decoration: none;
  display: flex; gap: .5rem; align-items: flex-start;
  padding: .3rem 0; transition: color .15s;
}
.sidebar-box ul li a::before { content: '→'; color: var(--amber); flex-shrink: 0; margin-top: 1px; }
.sidebar-box ul li a:hover { color: var(--navy); }

.sidebar-cta {
  background: var(--navy);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  color: var(--white);
}
.sidebar-cta h3 { color: var(--white); font-size: 1rem; margin-bottom: .5rem; border-bottom: none; text-transform: none; letter-spacing: 0; }
.sidebar-cta p { font-size: .85rem; color: rgba(255,255,255,.75); margin-bottom: 1rem; }

/* ---- STATE GRID (hub page) ---- */
.state-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: .75rem;
}
.state-link {
  display: block;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: .8rem 1rem;
  text-decoration: none;
  color: var(--navy-mid);
  font-size: .9rem;
  font-weight: 600;
  text-align: center;
  transition: all .15s;
  box-shadow: var(--shadow-sm);
}
.state-link:hover {
  background: var(--amber-pale);
  border-color: var(--amber);
  color: var(--navy);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ---- SECTION LABELS ---- */
.section-label {
  display: inline-block;
  font-size: .75rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--amber);
  margin-bottom: .5rem;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: var(--navy);
  margin-bottom: .6rem;
  line-height: 1.25;
}
.section-sub {
  font-size: 1rem; color: var(--gray-600); max-width: 560px; line-height: 1.6;
}
.section-header { margin-bottom: 2rem; }

/* ---- BREADCRUMB ---- */
.breadcrumb {
  background: var(--off-white);
  padding: .7rem 1.5rem;
  border-bottom: 1px solid var(--gray-200);
  font-size: .82rem;
}
.breadcrumb-inner { max-width: var(--max-w); margin: 0 auto; display: flex; gap: .5rem; flex-wrap: wrap; }
.breadcrumb a { color: var(--gray-400); text-decoration: none; font-weight: 600; }
.breadcrumb a:hover { color: var(--navy); }
.breadcrumb span { color: var(--gray-400); }
.breadcrumb .current { color: var(--gray-800); font-weight: 600; }

/* ---- DISCLAIMER ---- */
.disclaimer {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 1rem 1.2rem;
  font-size: .82rem;
  color: var(--gray-600);
  margin: 2rem 0;
  line-height: 1.55;
}
.disclaimer strong { color: var(--gray-800); }

/* ---- CHECKLIST ---- */
.checklist { list-style: none; display: flex; flex-direction: column; gap: .5rem; margin: 1rem 0; }
.checklist li {
  display: flex; gap: .75rem; align-items: flex-start;
  padding: .6rem .85rem;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: .93rem;
}
.checklist li::before {
  content: '☐';
  color: var(--amber);
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ---- WIZARD ---- */
.wizard-wrap {
  background: var(--navy);
  border-radius: var(--radius-lg);
  padding: 2rem;
  color: var(--white);
}
.wizard-wrap h2 { font-family: var(--font-display); font-size: 1.5rem; margin-bottom: .5rem; color: var(--white); }
.wizard-wrap p.sub { color: rgba(255,255,255,.7); font-size: .95rem; margin-bottom: 1.5rem; }
.wizard-step { display: none; }
.wizard-step.active { display: block; }
.wizard-q { font-weight: 700; font-size: 1.05rem; margin-bottom: 1rem; }
.wizard-options { display: flex; flex-direction: column; gap: .6rem; }
.wizard-opt {
  background: rgba(255,255,255,.08);
  border: 1.5px solid rgba(255,255,255,.2);
  border-radius: var(--radius-md);
  padding: .85rem 1.1rem;
  color: var(--white);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: .95rem;
  text-align: left;
  transition: all .15s;
}
.wizard-opt:hover { background: rgba(232,146,42,.25); border-color: var(--amber); }
.wizard-opt.selected { background: rgba(232,146,42,.3); border-color: var(--amber); }
.wizard-nav { display: flex; gap: 1rem; margin-top: 1.5rem; align-items: center; }
.wizard-back { background: none; border: 1px solid rgba(255,255,255,.3); color: rgba(255,255,255,.7); padding: .6rem 1.2rem; border-radius: var(--radius-sm); cursor: pointer; font-family: var(--font-body); font-size: .9rem; transition: all .15s; }
.wizard-back:hover { border-color: rgba(255,255,255,.6); color: var(--white); }
.wizard-progress { font-size: .82rem; color: rgba(255,255,255,.5); margin-left: auto; }
.wizard-result { display: none; background: rgba(255,255,255,.06); border-radius: var(--radius-md); padding: 1.5rem; margin-top: 1rem; }
.wizard-result.show { display: block; }
.wizard-result h3 { font-family: var(--font-display); font-size: 1.2rem; color: var(--amber); margin-bottom: .75rem; }
.wizard-result ul { list-style: none; display: flex; flex-direction: column; gap: .4rem; }
.wizard-result ul li { font-size: .92rem; padding: .3rem 0; border-bottom: 1px solid rgba(255,255,255,.08); color: rgba(255,255,255,.9); }
.wizard-result ul li::before { content: '✓ '; color: var(--amber); font-weight: 700; }

/* ---- SITE FOOTER ---- */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,.65);
  padding: 3rem 1.5rem 1.5rem;
  margin-top: 4rem;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(3, 1fr);
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}
.footer-brand .site-logo { font-size: 1.1rem; display: block; margin-bottom: .75rem; }
.footer-brand p { font-size: .85rem; line-height: 1.6; }
.footer-col h4 {
  font-size: .8rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--white); margin-bottom: .85rem;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: .4rem; }
.footer-col ul li a { font-size: .88rem; color: rgba(255,255,255,.6); text-decoration: none; transition: color .15s; }
.footer-col ul li a:hover { color: var(--amber); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 1.2rem;
  display: flex; justify-content: space-between; flex-wrap: wrap;
  gap: .75rem; font-size: .8rem; color: rgba(255,255,255,.4);
}
.footer-bottom a { color: rgba(255,255,255,.4); text-decoration: none; }
.footer-bottom a:hover { color: var(--amber); }

/* ---- RESPONSIVE ---- */
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .page-wrapper { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}
@media (max-width: 680px) {
  .main-nav { display: none; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: var(--navy-mid); padding: 1rem; }
  .main-nav.open { display: flex; }
  .nav-toggle { display: block; }
  .hero { padding: 2.5rem 1.25rem 2rem; }
  .footer-grid { grid-template-columns: 1fr; }
  .cards-grid { grid-template-columns: 1fr; }
  .state-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .trust-bar-inner { gap: 1rem; }
  .hero-actions { flex-direction: column; align-items: flex-start; }
}

/* ---- UTILITIES ---- */
.text-center { text-align: center; }
.mb-0 { margin-bottom: 0 !important; }
.mt-2 { margin-top: 2rem; }
.section-divider { border: none; border-top: 2px solid var(--gray-100); margin: 3rem 0; }
.highlight { background: var(--amber-pale); padding: 0 .25rem; border-radius: 2px; }

/* ---- ADS ---- */
/* Analytics & AdSense placeholders activated in Phase 3 */
