/* EmergencyToolbox — Global Stylesheet
 * Design tokens and component styles shared across dynamic templates.
 * Mirrors the design system in BaseLayout.astro and WritersLayout.astro.
 */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

/* ── Design tokens ── */
:root {
  --ink:        #0b0f19;
  --ink-mid:    #1a2235;
  --paper:      #f4f1ea;
  --teal:       #0d8a8e;
  --teal-dark:  #0a6b6e;
  --teal-light: #e0f5f5;
  --amber:      #d4870a;
  --chalk:      #ffffff;
  --mist:       rgba(255,255,255,0.55);
  --ghost:      rgba(255,255,255,0.1);
  --rule:       rgba(255,255,255,0.1);
  --rule-light: rgba(0,0,0,0.09);
  --font-head:  'Libre Baskerville', Georgia, serif;
  --font-body:  'Source Sans 3', system-ui, sans-serif;
  --ease:       cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Base ── */
body {
  font-family: var(--font-body, -apple-system, sans-serif);
  font-size: 1rem; line-height: 1.7;
  background: var(--chalk); color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { font-family: var(--font-head, sans-serif); line-height: 1.2; }
h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); font-weight: 800; margin-bottom: 1rem; }
h2 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); font-weight: 700; margin: 2rem 0 0.75rem; }
h3 { font-size: 1.05rem; font-weight: 700; margin: 1.5rem 0 0.5rem; }
p  { margin-bottom: 1rem; }
a  { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Header ── */
.et-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: 58px; display: flex; align-items: center;
  background: rgba(11,15,25,0.94);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}
.et-header__inner {
  width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
}
.et-header__logo {
  font-family: var(--font-head); font-weight: 800; font-size: 1.05rem;
  letter-spacing: -0.01em; color: var(--chalk); text-decoration: none;
}
.et-header__logo span { color: var(--teal); }
.et-nav { display: flex; align-items: center; gap: 0.25rem; list-style: none; }
.et-nav a {
  font-family: var(--font-body); font-weight: 500; font-size: 0.875rem;
  color: var(--mist); padding: 0.4rem 0.7rem; border-radius: 5px;
  transition: color 0.15s, background 0.15s;
}
.et-nav a:hover { color: var(--chalk); background: var(--ghost); text-decoration: none; }
.et-nav .et-nav__cta { background: var(--teal); color: var(--chalk) !important; font-weight: 600; margin-left: 0.5rem; }
.et-nav .et-nav__cta:hover { background: var(--teal-dark); }
.et-nav-toggle { display: none; background: none; border: none; color: var(--mist); font-size: 1.4rem; cursor: pointer; padding: 0.25rem; line-height: 1; }
@media (max-width: 680px) {
  .et-nav { display: none; }
  .et-nav.open { display: flex; flex-direction: column; align-items: flex-start; position: fixed; top: 58px; left: 0; right: 0; background: var(--ink); padding: 1rem 1.5rem 1.5rem; border-bottom: 1px solid var(--rule); }
  .et-nav-toggle { display: block; }
}

/* ── Page layout ── */
.et-page {
  max-width: 800px; margin: 0 auto;
  padding: calc(58px + 2.5rem) 1.5rem 5rem;
}

/* ── Breadcrumb ── */
.breadcrumb-nav, .breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 0.3rem; }
.breadcrumb { list-style: none; font-size: 0.78rem; color: rgba(11,15,25,0.4); margin-bottom: 1.75rem; }
.breadcrumb a { color: var(--teal); }
.breadcrumb .active { color: rgba(11,15,25,0.5); }

/* ── Hero ── */
.et-hero {
  background: var(--ink);
  border-radius: 10px; padding: 2rem; margin-bottom: 2rem;
  position: relative; overflow: hidden;
}
.et-hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 60% at 10% 50%, rgba(13,138,142,0.2), transparent 65%);
  pointer-events: none;
}
.et-hero__inner { position: relative; z-index: 1; }
.et-hero__badge { display: flex; gap: 0.5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.et-badge {
  font-family: var(--font-head); font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.07em;
  padding: 0.2rem 0.55rem; border-radius: 3px;
}
.et-badge--urgent { background: rgba(212,135,10,0.15); color: var(--amber); }
.et-badge--state  { background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.7); }
.et-hero__title { color: var(--chalk); margin-bottom: 0.75rem; }
.et-hero__desc { color: rgba(255,255,255,0.6); font-size: 1rem; max-width: 560px; margin-bottom: 0.75rem; }
.et-hero__law { font-size: 0.8rem; color: rgba(255,255,255,0.5); background: rgba(255,255,255,0.06); padding: 0.25rem 0.6rem; border-radius: 4px; }

/* ── State box ── */
.et-state-box {
  background: var(--teal-light); border-left: 3px solid var(--teal);
  border-radius: 0 8px 8px 0; padding: 1.25rem 1.5rem; margin-bottom: 2rem;
}
.et-state-box__title { font-family: var(--font-head); font-size: 0.85rem; font-weight: 700; color: var(--teal-dark); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 0.85rem; }
.et-state-box__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.75rem; }
.et-state-box__item { background: var(--chalk); border-radius: 6px; padding: 0.75rem 1rem; }
.et-state-box__label { font-size: 0.68rem; color: var(--teal-dark); text-transform: uppercase; letter-spacing: 0.06em; display: block; margin-bottom: 0.25rem; }
.et-state-box__value { font-family: var(--font-head); font-size: 1rem; font-weight: 700; color: var(--ink); display: block; }
.et-state-box__value--yes { color: #15803d; }
.et-state-box__value--no  { color: #dc2626; }
.et-state-box__note { font-size: 0.73rem; color: rgba(11,15,25,0.5); display: block; margin-top: 0.25rem; }
.et-state-box__notes { margin-top: 0.85rem; font-size: 0.85rem; color: rgba(11,15,25,0.7); background: rgba(255,255,255,0.6); padding: 0.75rem; border-radius: 5px; }

/* ── Sections ── */
.et-assessment, .et-response-paths, .et-calculator-section,
.et-affiliate-cta, .et-resources, .et-faq, .et-other-states {
  margin-bottom: 2.5rem; padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--rule-light);
}
.et-assessment__checklist { background: var(--paper); border-radius: 8px; padding: 1.25rem; margin-top: 1rem; }
.et-assessment__checklist ul { padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 0.4rem; margin: 0.5rem 0; }
.et-assessment__note { font-size: 0.85rem; color: var(--teal-dark); font-weight: 500; margin-top: 0.75rem; }

/* ── Response paths ── */
.et-response-paths__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1px; background: var(--rule-light); border: 1px solid var(--rule-light); margin-top: 1rem; }
.et-response-path { background: var(--chalk); padding: 1.25rem; }
.et-response-path__number { font-family: var(--font-head); font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--teal); margin-bottom: 0.4rem; }
.et-response-path__title { font-family: var(--font-head); font-weight: 700; font-size: 0.95rem; margin-bottom: 0.4rem; }
.et-response-path__desc { font-size: 0.83rem; color: rgba(11,15,25,0.55); margin-bottom: 0.85rem; }

/* ── Buttons ── */
.et-btn {
  display: inline-block; font-family: var(--font-head); font-weight: 700; font-size: 0.85rem;
  padding: 0.6rem 1.25rem; border-radius: 5px; cursor: pointer; transition: background 0.15s, color 0.15s;
  text-decoration: none;
}
.et-btn--primary { background: var(--teal); color: var(--chalk); }
.et-btn--primary:hover { background: var(--teal-dark); text-decoration: none; }
.et-btn--outline { background: transparent; color: var(--teal); border: 1.5px solid var(--teal); }
.et-btn--outline:hover { background: var(--teal); color: var(--chalk); text-decoration: none; }

/* ── Affiliate CTA ── */
.et-affiliate-cta { background: var(--paper); border-radius: 8px; padding: 1.5rem; }
.et-affiliate-cta__inner { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; }
.et-affiliate-cta__text h3 { font-family: var(--font-head); font-weight: 700; margin-bottom: 0.3rem; }
.et-affiliate-cta__text p { font-size: 0.875rem; color: rgba(11,15,25,0.6); margin: 0; }

/* ── Resources list ── */
.et-resources__list { list-style: none; display: flex; flex-direction: column; gap: 0; border-top: 1px solid var(--rule-light); }
.et-resources__list li { padding: 0.65rem 0; border-bottom: 1px solid var(--rule-light); font-size: 0.875rem; }

/* ── FAQ ── */
.et-faq__item { border-bottom: 1px solid var(--rule-light); }
.et-faq__item summary { cursor: pointer; padding: 0.85rem 0; font-family: var(--font-head); font-weight: 700; font-size: 0.9rem; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.et-faq__item summary::after { content: '+'; color: var(--teal); font-size: 1.2rem; flex-shrink: 0; }
.et-faq__item[open] summary::after { content: '−'; }
.et-faq__item p { padding: 0 0 1rem; font-size: 0.875rem; color: rgba(11,15,25,0.7); }

/* ── Other states ── */
.et-other-states__grid { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1rem; }
.et-other-states__link {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.35rem 0.75rem; border: 1px solid rgba(0,0,0,0.12); border-radius: 4px;
  font-size: 0.78rem; font-weight: 500; color: rgba(11,15,25,0.65);
  text-decoration: none; transition: all 0.15s;
}
.et-other-states__link:hover { border-color: var(--teal); color: var(--teal); text-decoration: none; }
.et-other-states__link--all { font-weight: 700; color: var(--teal); border-color: var(--teal); }

/* ── Footer ── */
.et-footer {
  background: var(--ink); color: rgba(255,255,255,0.4);
  padding: 3rem 1.5rem 2rem;
}
.et-footer__inner { max-width: 1140px; margin: 0 auto; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 2.5rem; }
.et-footer__col h4 { font-family: var(--font-head); font-size: 0.7rem; font-weight: 700; color: rgba(255,255,255,0.55); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 1rem; }
.et-footer__col ul { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.et-footer__col a { font-size: 0.83rem; color: rgba(255,255,255,0.38); transition: color 0.15s; }
.et-footer__col a:hover { color: var(--chalk); text-decoration: none; }
.et-footer__bottom { max-width: 1140px; margin: 2.5rem auto 0; padding-top: 1.5rem; border-top: 1px solid var(--rule); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem; }
.et-footer__bottom p { font-size: 0.73rem; color: rgba(255,255,255,0.28); }
.et-footer__links { display: flex; gap: 1.25rem; }
.et-footer__links a { font-size: 0.73rem; color: rgba(255,255,255,0.3); }
.et-footer__links a:hover { color: var(--chalk); text-decoration: none; }

/* ── Calculator embed ── */
.et-calculator-embed { min-height: 100px; }

/* ── How-to specific ── */
.et-howto-hero { background: var(--ink); border-radius: 10px; padding: 2rem; margin-bottom: 2rem; }
.et-howto-hero h1 { color: var(--chalk); margin-bottom: 0.5rem; }
.et-howto-hero p { color: rgba(255,255,255,0.6); }
.et-step { display: flex; gap: 1rem; margin-bottom: 1.5rem; }
.et-step__num { width: 32px; height: 32px; flex-shrink: 0; background: var(--ink); color: var(--chalk); font-family: var(--font-head); font-weight: 700; font-size: 0.8rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-top: 0.15rem; }
.et-step__body h3 { margin-top: 0; }
.et-callout { border-radius: 6px; padding: 1rem 1.25rem; margin: 1.25rem 0; }
.et-callout--green  { background: #d1fae5; border-left: 3px solid #10b981; }
.et-callout--yellow { background: #fef9c3; border-left: 3px solid var(--amber); }
.et-callout--blue   { background: #dbeafe; border-left: 3px solid #3b82f6; }
.et-callout--red    { background: #fee2e2; border-left: 3px solid #ef4444; }
