/* ============================================
   Old City Permitting Analysis — Shared Styles
   ============================================ */

:root {
  --navy: #1a1a2e;
  --red: #dc2626;
  --green: #16a34a;
  --orange: #f97316;
  --gray: #6b7280;
  --purple: #8b5cf6;
  --blue: #2563eb;
  --ctr-blue: #1f77b4;
  --light-bg: #f8f9fa;
  --border: #e5e7eb;
  --text: #333;
  --text-light: #666;
  --nav-height: 56px;
  --radius: 10px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --transition: 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- SMOOTH SCROLL ---- */
html { scroll-behavior: smooth; }

/* ---- LINKS ---- */
a {
  color: var(--blue);
  text-decoration-color: rgba(37, 99, 235, 0.3);
  text-underline-offset: 2px;
  transition: color var(--transition), text-decoration-color var(--transition);
}

a:hover {
  color: #1d4ed8;
  text-decoration-color: #1d4ed8;
}

/* ---- NAV BAR ---- */
.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2em;
  z-index: 9999;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
  backdrop-filter: blur(8px);
}

.nav-brand {
  color: white;
  font-weight: 700;
  font-size: 1.05em;
  text-decoration: none;
  letter-spacing: -0.02em;
  transition: opacity var(--transition);
  display: flex;
  align-items: center;
  gap: 0.7em;
}

.nav-logo {
  height: 28px;
  width: auto;
  display: block;
}

@media (max-width: 640px) {
  .nav-logo { height: 22px; }
}

.nav-brand:hover {
  opacity: 0.9;
  color: white;
}

.nav-links {
  display: flex;
  gap: 0.3em;
}

.nav-links a {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 0.85em;
  font-weight: 500;
  padding: 0.4em 0.9em;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.nav-links a:hover {
  color: white;
  background: rgba(255,255,255,0.12);
}

.nav-links a.active {
  color: white;
  background: rgba(255,255,255,0.18);
}

.nav-links a.external::after {
  content: " \2197";
  font-size: 0.8em;
}

/* ---- CONTENT PAGES (analysis, data) ---- */
.page-content {
  margin-top: var(--nav-height);
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
  padding: 2.5em 1.5em 5em;
}

.page-content h1 {
  font-size: 2em;
  color: var(--navy);
  margin-bottom: 0.3em;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 800;
}

.page-content h2 {
  font-size: 1.4em;
  color: var(--navy);
  margin-top: 2.5em;
  margin-bottom: 0.6em;
  padding-bottom: 0.35em;
  border-bottom: 3px solid var(--ctr-blue);
  letter-spacing: -0.01em;
  font-weight: 700;
}

.page-content h3 {
  font-size: 1.1em;
  color: var(--navy);
  margin-top: 1.5em;
  margin-bottom: 0.4em;
  font-weight: 600;
}

.page-content p {
  margin-bottom: 1em;
}

.page-content > p:first-of-type {
  font-size: 1.05em;
  color: var(--text-light);
}

.page-content ul, .page-content ol {
  margin-bottom: 1em;
  padding-left: 1.5em;
}

.page-content li {
  margin-bottom: 0.4em;
}

/* ---- TABLES ---- */
.page-content table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.2em 0;
  font-size: 0.9em;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.page-content th {
  background: var(--navy);
  color: white;
  padding: 0.7em 0.9em;
  text-align: left;
  font-weight: 600;
  font-size: 0.92em;
  letter-spacing: 0.01em;
}

.page-content td {
  padding: 0.6em 0.9em;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.page-content tr:nth-child(even) {
  background: var(--light-bg);
}

.page-content tbody tr:hover td {
  background: #eef2ff;
}

.page-content td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.page-content strong {
  color: var(--navy);
}

.page-content em {
  color: var(--text-light);
}

.page-content hr {
  border: none;
  border-top: 2px solid var(--border);
  margin: 2.5em 0;
}

/* ---- IMAGES ---- */
.page-content img {
  max-width: 100%;
  border-radius: var(--radius);
  margin: 1.2em 0;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.page-content img:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.page-content blockquote {
  border-left: 4px solid var(--blue);
  padding: 0.8em 1.2em;
  margin: 1em 0;
  background: #eff6ff;
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* ---- KEY STAT CALLOUTS ---- */
.key-stat {
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.8em 1.5em;
  text-align: center;
  margin: 1.5em 0;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}

.key-stat:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.key-stat .number {
  font-size: 2.8em;
  font-weight: 800;
  color: var(--ctr-blue);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.key-stat .label {
  font-size: 0.88em;
  color: var(--text-light);
  margin-top: 0.4em;
  line-height: 1.4;
}

.key-stat.warning .number {
  color: var(--red);
}

.stat-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5em;
  margin: 1.5em 0;
}

.stat-row.three {
  grid-template-columns: 1fr 1fr 1fr;
}

/* ---- PILLS / BADGES ---- */
.pill {
  display: inline-block;
  padding: 0.2em 0.7em;
  border-radius: 999px;
  font-size: 0.78em;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.pill.ctr { background: #eff6ff; color: var(--ctr-blue); }
.pill.nca { background: #fef2f2; color: var(--red); }
.pill.byright { background: #f0fdf4; color: var(--green); }
.pill.prohibited { background: #fef2f2; color: var(--red); }
.pill.se { background: #fffbeb; color: #d97706; }
.pill.variance { background: #fef2f2; color: #991b1b; }

/* ---- KEY POINT CALLOUTS ---- */
.key-point {
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
  padding: 1em 1.4em;
  margin: 1.2em 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 0.95em;
  line-height: 1.55;
}

/* ---- DATA PAGE ---- */
.download-card {
  background: white;
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 2.5em 2em;
  margin: 1.5em 0;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), border-color var(--transition);
  position: relative;
  overflow: hidden;
}

.download-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--ctr-blue), var(--blue));
}

.download-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #d1d5db;
}

.download-card h3 {
  margin-top: 0;
  margin-bottom: 0.5em;
  font-size: 1.2em;
}

.download-btn {
  display: inline-block;
  background: var(--blue);
  color: white;
  text-decoration: none;
  padding: 0.8em 2.2em;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1em;
  margin-top: 1em;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.25);
}

.download-btn:hover {
  background: #1d4ed8;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.download-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.25);
}

.meta-info {
  font-size: 0.82em;
  color: var(--text-light);
  margin-top: 0.6em;
}

/* ---- HERO / EXECUTIVE SUMMARY ---- */
.hero-stats {
  background: linear-gradient(135deg, #f0f4ff 0%, #fafbff 100%);
  border: 1px solid #dde4f0;
  border-radius: 16px;
  padding: 2em;
  margin: 1.5em 0;
}

.hero-stats .stat-row {
  margin: 0;
}

/* ---- ORDERED LIST STYLING (for key takeaways) ---- */
.page-content ol {
  counter-reset: takeaway;
  list-style: none;
  padding-left: 0;
}

.page-content ol li {
  counter-increment: takeaway;
  padding-left: 2.2em;
  position: relative;
  margin-bottom: 0.6em;
}

.page-content ol li::before {
  content: counter(takeaway);
  position: absolute;
  left: 0;
  top: 0.1em;
  width: 1.5em;
  height: 1.5em;
  background: var(--ctr-blue);
  color: white;
  border-radius: 50%;
  font-size: 0.75em;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- PRESENTATION PAGE ---- */
.presentation-frame {
  margin-top: var(--nav-height);
  width: 100%;
  height: calc(100vh - var(--nav-height));
  border: none;
}

/* ---- FADE-IN ANIMATION ---- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page-content h1 {
  animation: fadeInUp 0.5s ease-out;
}

.page-content h1 + p {
  animation: fadeInUp 0.5s ease-out 0.1s both;
}

.key-stat {
  animation: fadeInUp 0.4s ease-out 0.15s both;
}

/* ---- RESPONSIVE ---- */

/* Tablet */
@media (max-width: 900px) {
  .nav-brand {
    font-size: 0.9em;
  }

  .nav-links a {
    padding: 0.4em 0.5em;
    font-size: 0.78em;
  }

  .stat-row {
    grid-template-columns: 1fr;
  }

  .stat-row.three {
    grid-template-columns: 1fr;
  }
}

/* Mobile */
@media (max-width: 640px) {
  .site-nav {
    height: auto;
    flex-direction: column;
    padding: 0.5em 1em;
    gap: 0.3em;
  }

  .nav-brand {
    font-size: 0.85em;
    text-align: center;
  }

  .nav-links {
    gap: 0;
    flex-wrap: wrap;
    justify-content: center;
  }

  .nav-links a {
    padding: 0.3em 0.5em;
    font-size: 0.72em;
  }

  .page-content {
    padding: 1.2em 0.8em 3em;
    margin-top: 80px;
  }

  .page-content h1 {
    font-size: 1.5em;
  }

  .page-content h2 {
    font-size: 1.15em;
  }

  .page-content table {
    font-size: 0.78em;
  }

  .page-content img {
    margin: 0.5em 0;
  }

  .download-card {
    padding: 1.5em 1em;
  }

  .download-btn {
    padding: 0.6em 1.5em;
    font-size: 0.9em;
  }

  .presentation-frame {
    margin-top: 80px;
    height: calc(100vh - 80px);
  }

  .key-stat {
    padding: 1.2em 1em;
  }

  .key-stat .number {
    font-size: 2.2em;
  }

  .page-content ol li {
    padding-left: 1.8em;
  }
}
