/* Desert Race Day Survival Guide — Styles */
:root {
  --sand-50: #FDF8F0;
  --sand-100: #F5E6CC;
  --sand-200: #E8CFA0;
  --sand-300: #D4AD6A;
  --sand-400: #C4913E;
  --sand-500: #A6732A;
  --sand-600: #7D5620;
  --sand-700: #5C3F18;
  --sand-800: #3D2A10;
  --sand-900: #1F1508;
  --flame-500: #E85D04;
  --flame-600: #D14D00;
  --flame-700: #B03D00;
  --sky-500: #0077B6;
  --sky-600: #005F8A;
  --danger: #D00000;
  --success: #2D6A4F;
  --text: #1F1508;
  --text-light: #5C3F18;
  --text-muted: #7D5620;
  --bg: var(--sand-50);
  --bg-card: #FFFFFF;
  --bg-alt: var(--sand-100);
  --border: var(--sand-200);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 8px rgba(31, 21, 8, 0.08);
  --shadow-lg: 0 8px 32px rgba(31, 21, 8, 0.12);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
  --max-width: 1100px;
  --header-height: 64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 16px); }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--flame-600); text-decoration: none; }
a:hover, a:focus-visible { color: var(--flame-700); text-decoration: underline; }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(253, 248, 240, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  height: var(--header-height);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}

.logo:hover, .logo:focus-visible { color: var(--text); text-decoration: none; }

.main-nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.main-nav a {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-light);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.main-nav a:hover, .main-nav a:focus-visible {
  background: var(--sand-100);
  color: var(--text);
  text-decoration: none;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  line-height: 1.3;
}

.btn:hover, .btn:focus-visible { text-decoration: none; }

.btn-primary {
  background: var(--flame-500);
  color: #fff;
  border-color: var(--flame-500);
}

.btn-primary:hover, .btn-primary:focus-visible {
  background: var(--flame-600);
  border-color: var(--flame-600);
  color: #fff;
}

.btn-secondary {
  background: transparent;
  color: var(--flame-600);
  border-color: var(--flame-500);
}

.btn-secondary:hover, .btn-secondary:focus-visible {
  background: var(--flame-500);
  color: #fff;
}

/* Hero */
.hero {
  padding: 80px 0 60px;
  background: linear-gradient(135deg, var(--sand-100) 0%, var(--sand-50) 60%, #FFF 100%);
  text-align: center;
}

.hero-tag {
  display: inline-block;
  background: var(--flame-500);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 14px;
  border-radius: 20px;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
  color: var(--sand-900);
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--text-light);
  max-width: 640px;
  margin: 0 auto 28px;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.hero-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Section styles */
section { padding: 60px 0; }
section:nth-child(even) { background: var(--bg-alt); }

.section-intro {
  color: var(--text-light);
  max-width: 680px;
  margin-bottom: 32px;
  font-size: 1.05rem;
}

h2 {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--sand-900);
  line-height: 1.2;
}

h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--sand-800);
}

/* Checklist */
.checklist-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.checklist-progress {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: auto;
}

.checklist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.checklist-category {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.checklist-category h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--flame-600);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--sand-100);
}

.checklist-category ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checklist-category label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 4px 0;
  line-height: 1.4;
}

.checklist-category input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--flame-500);
  cursor: pointer;
}

.checklist-category label.checked {
  color: var(--text-muted);
  text-decoration: line-through;
}

/* Timeline */
.timeline {
  position: relative;
  max-width: 720px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 72px;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--sand-200);
  border-radius: 2px;
}

.timeline-item {
  display: flex;
  gap: 20px;
  margin-bottom: 28px;
  position: relative;
}

.timeline-time {
  flex-shrink: 0;
  width: 60px;
  text-align: right;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--flame-600);
  padding-top: 2px;
}

.timeline-body {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  flex: 1;
  position: relative;
}

.timeline-body::before {
  content: '';
  position: absolute;
  left: -27px;
  top: 18px;
  width: 12px;
  height: 12px;
  background: var(--flame-500);
  border-radius: 50%;
  border: 3px solid var(--bg-alt);
}

.timeline-body h3 {
  margin-bottom: 4px;
}

.timeline-body p {
  color: var(--text-light);
  font-size: 0.95rem;
}

/* Budget table */
.budget-table-wrapper {
  overflow-x: auto;
  margin-bottom: 32px;
}

.budget-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  font-size: 0.9rem;
}

.budget-table th {
  background: var(--sand-800);
  color: #fff;
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
}

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

.budget-table tr:last-child td { border-bottom: none; }
.budget-table tbody tr:hover { background: var(--sand-50); }
.budget-table tfoot td { background: var(--sand-100); font-weight: 700; }

.budget-tip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.budget-tip h3 {
  color: var(--flame-600);
  margin-bottom: 12px;
}

.budget-tip ul {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--text-light);
}

/* Mistakes */
.mistakes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.mistake-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s;
}

.mistake-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.mistake-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.mistake-card h3 {
  margin-bottom: 8px;
}

.mistake-card p {
  color: var(--text-light);
  font-size: 0.9rem;
  line-height: 1.55;
}

/* Edge cases */
.edge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.edge-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--flame-500);
}

.edge-card h3 {
  color: var(--flame-600);
  margin-bottom: 8px;
}

.edge-card p {
  color: var(--text-light);
  font-size: 0.9rem;
  line-height: 1.55;
}

/* Share */
.share-section {
  text-align: center;
  background: linear-gradient(135deg, var(--sand-800), var(--sand-900));
  color: #fff;
}

.share-section h2 { color: #fff; }
.share-section p { color: var(--sand-200); max-width: 500px; margin: 0 auto 24px; }
.share-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Footer */
.site-footer {
  background: var(--sand-900);
  color: var(--sand-200);
  padding: 48px 0 24px;
  font-size: 0.85rem;
}

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

.footer-brand {
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  margin-bottom: 8px;
}

.footer-desc { line-height: 1.55; }

.site-footer h4 {
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.footer-links { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.footer-links a { color: var(--sand-300); }
.footer-links a:hover, .footer-links a:focus-visible { color: #fff; }

.footer-bottom {
  border-top: 1px solid var(--sand-700);
  padding-top: 20px;
  text-align: center;
  color: var(--sand-400);
}

.footer-bottom a { color: var(--sand-300); }
.footer-bottom a:hover { color: #fff; }

/* Print styles */
@media print {
  .site-header, .site-footer, .share-section, .hero-actions, .hero-meta, .checklist-controls, .nav-toggle { display: none !important; }
  body { background: #fff; color: #000; }
  .hero { padding: 20px 0; text-align: left; }
  .hero h1 { font-size: 1.8rem; }
  section { padding: 16px 0; break-inside: avoid; }
  .checklist-category, .timeline-body, .mistake-card, .edge-card { break-inside: avoid; box-shadow: none; border: 1px solid #ccc; }
  .checklist-category label.checked { text-decoration: line-through; color: #888; }
  h2 { font-size: 1.3rem; }
  .timeline::before { display: none; }
  .timeline-time { text-align: left; }
  .timeline-body::before { display: none; }
}

/* Responsive */
@media (max-width: 768px) {
  .main-nav { display: none; }
  .nav-toggle { display: flex; }
  .main-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 12px 20px;
    box-shadow: var(--shadow-lg);
  }
  .hero { padding: 48px 0 40px; }
  .hero h1 { font-size: 1.8rem; }
  .hero-sub { font-size: 1rem; }
  section { padding: 40px 0; }
  .checklist-grid, .mistakes-grid, .edge-grid { grid-template-columns: 1fr; }
  .timeline::before { left: 56px; }
  .timeline-time { width: 48px; font-size: 0.75rem; }
  .timeline-body { padding: 12px 16px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .checklist-progress { margin-left: 0; width: 100%; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero-actions { flex-direction: column; align-items: center; }
  .checklist-controls { flex-direction: column; align-items: flex-start; }
  .budget-table { font-size: 0.8rem; }
  .budget-table th, .budget-table td { padding: 8px 10px; }
}

/* Focus styles */
*:focus-visible {
  outline: 3px solid var(--flame-500);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
