/* ==========================================================================
   Shaping Cool Cities — Reveal.js Custom Theme v4
   Light Architectural Minimalism
   Terracotta (#c4513a) + Teal (#2a7f6f) + Blue (#3a6fa0)
   ========================================================================== */

/* ---------- VARIABLES ---------- */
:root {
  --bg-primary: #fafafa;
  --bg-secondary: #f5f5f0;
  --bg-card: #ffffff;
  --text-primary: #1a1a1a;
  --text-secondary: #555555;
  --text-tertiary: #767676;
  --accent: #c4513a;
  --accent-light: #d4695a;
  --teal: #2a7f6f;
  --blue: #3a6fa0;
  --border: rgba(0,0,0,0.08);
  --shadow: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
}

/* ---------- BASE OVERRIDES ---------- */
.reveal {
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  font-size: 32px;
  color: var(--text-primary);
}

.reveal .slides section {
  box-sizing: border-box;
  padding-left: 40px !important;
  padding-right: 40px !important;
}

.reveal .slides {
  text-align: left;
}

.reveal h1, .reveal h2, .reveal h3 {
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 700;
  text-transform: none;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.reveal h2 {
  font-size: 1.8em;
  margin-bottom: 0.8em;
  border-bottom: 3px solid var(--accent);
  padding-bottom: 0.3em;
  display: inline-block;
}

.reveal h3 {
  font-size: 1.1em;
  margin-bottom: 0.4em;
}

.reveal p {
  line-height: 1.6;
  margin-bottom: 0.6em;
}

.reveal ul, .reveal ol {
  display: block;
  margin-left: 1em;
}

.reveal li {
  margin-bottom: 0.4em;
  line-height: 1.5;
}

.reveal strong {
  color: var(--text-primary);
}

.reveal section {
  padding: 40px 60px;
}

.reveal blockquote {
  border-left: 4px solid var(--accent);
  padding: 0.5em 1em;
  margin: 1em 0;
  font-style: italic;
  color: var(--text-secondary);
  background: rgba(196, 81, 58, 0.06);
  border-radius: 0 4px 4px 0;
  width: 90%;
}

/* ---------- ACCENT ---------- */
.accent {
  color: var(--accent) !important;
}

/* ---------- HOOK SLIDE ---------- */
.hook-slide {
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 70vh;
}

.large-number {
  font-size: 5em !important;
  font-weight: 800;
  color: var(--accent);
  margin: 0;
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.hook-text {
  font-size: 1.3em;
  color: var(--text-primary);
  margin-top: 0.5em;
}

/* ---------- SOURCE CITATION ---------- */
.source {
  font-size: 0.5em;
  color: var(--text-tertiary);
  margin-top: 2em;
  opacity: 0.7;
}

/* ---------- SLIDE REFERENCE FOOTER ---------- */
.slide-ref {
  position: absolute;
  bottom: 12px;
  left: 60px;
  right: 60px;
  font-size: 0.42em;
  color: var(--text-tertiary);
  line-height: 1.4;
  opacity: 0.65;
  border-top: 1px solid var(--border);
  padding-top: 6px;
}

.slide-ref a {
  color: var(--text-tertiary);
  text-decoration: none;
}

/* ---------- REFERENCES SLIDE ---------- */
.references-list {
  column-count: 2;
  column-gap: 2em;
  font-size: 0.52em;
  color: var(--text-secondary);
  line-height: 1.7;
  text-align: left;
}

.references-list p {
  margin-bottom: 0.4em;
  text-indent: -1.5em;
  padding-left: 1.5em;
  break-inside: avoid;
}

.references-list .ref-number {
  color: var(--accent);
  font-weight: 700;
}

/* ---------- RESULTS TABLE ---------- */
.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75em;
  margin-top: 0.8em;
}

.results-table th {
  background: rgba(196, 81, 58, 0.1);
  color: var(--text-primary);
  padding: 0.5em 1em;
  text-align: left;
  font-weight: 700;
  border-bottom: 2px solid var(--accent);
}

.results-table td {
  padding: 0.4em 1em;
  border-bottom: 1px solid var(--border);
}

.highlight-row {
  background: rgba(196, 81, 58, 0.06) !important;
}

.highlight-row td {
  color: var(--accent);
  font-weight: 600;
}

/* ---------- GAP ITEMS ---------- */
.gap-item {
  background: var(--bg-card);
  padding: 0.6em 1.2em;
  margin-bottom: 0.6em;
  border-radius: 0 6px 6px 0;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  box-shadow: var(--shadow);
}

.gap-item h3 {
  margin-bottom: 0.2em;
}

.gap-item p {
  font-size: 0.8em;
  color: var(--text-secondary);
  margin: 0;
}

/* ---------- SPLIT SLIDE ---------- */
.split-slide {
  display: flex;
  gap: 1.5em;
  align-items: center;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.split-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  word-wrap: break-word;
}

.split-image {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.split-image img {
  max-width: 100%;
  max-height: 65vh;
  object-fit: contain;
}

/* No shadow or border on any images */
.reveal img {
  box-shadow: none !important;
  border: none !important;
}

/* ---------- KEY FINDING ---------- */
.key-finding {
  font-size: 1em;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 1em;
  padding: 0.6em 1em;
  background: rgba(196, 81, 58, 0.06);
  border-left: 4px solid var(--accent);
  border-radius: 0 6px 6px 0;
}

/* ---------- TAKEAWAY NUMBER ---------- */
.takeaway-num {
  font-size: 2em;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  flex-shrink: 0;
  width: 1.2em;
  text-align: center;
}

/* ---------- STAT CALLOUT ---------- */
.stat-callout {
  display: inline-block;
  text-align: center;
  padding: 0.6em 1.5em;
  background: var(--bg-card);
  border: 2px solid var(--accent);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin: 0.5em 0;
}

.stat-callout .stat-number {
  font-size: 2.5em;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.2;
}

.stat-callout .stat-desc {
  font-size: 0.65em;
  color: var(--text-secondary);
}

/* ---------- TOOL SLIDE SOURCE/DERIVED TRANSITIONS ---------- */
.reveal .fragment.source-fade-out {
  opacity: 1;
  visibility: inherit;
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal .fragment.source-fade-out.visible {
  opacity: 0;
  pointer-events: none;
  transform: scale(1.02);
}

.reveal .fragment.derived-fade-in {
  transition: opacity 0.6s ease, transform 0.6s ease;
  transform: scale(0.98);
}

.reveal .fragment.derived-fade-in.visible {
  opacity: 1;
  transform: scale(1);
}

/* ---------- FRAGMENTS ENHANCEMENT ---------- */
.reveal .fragment {
  transition: all 0.4s ease;
}

.reveal .fragment.fade-right {
  transform: translateX(-30px);
}

.reveal .fragment.fade-right.visible {
  transform: translateX(0);
}

/* ---------- FRAMEWORK THUMBNAIL (tool slides) ---------- */
.framework-thumb {
  position: absolute;
  top: 50px;
  right: 16px;
  width: 160px;
  opacity: 0.7;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  z-index: 10;
  transition: opacity 0.3s;
}

.framework-thumb:hover {
  opacity: 1;
}

/* ---------- PIPELINE STAGE INDICATOR ---------- */
.reveal .pipeline-stage {
  display: flex;
  gap: 0.15em;
  align-items: center;
  position: absolute;
  top: 12px;
  left: 60px;
  z-index: 10;
  font-size: 0.38em;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.reveal .pipeline-stage span {
  padding: 0.2em 0.55em;
  border-radius: 3px;
  color: var(--text-tertiary);
  opacity: 0.35;
}

.reveal .pipeline-stage span.active {
  background: var(--accent);
  color: #fff;
  opacity: 1;
}

.reveal .pipeline-stage .pipe-arrow {
  padding: 0;
  background: none;
  opacity: 0.25;
  font-size: 0.9em;
}

/* ---------- PROGRESS BAR ---------- */
.reveal .progress {
  height: 4px;
  color: var(--accent);
}

.reveal .progress span {
  background: var(--accent);
}

/* ---------- CONTROLS ---------- */
.reveal .controls {
  color: var(--accent);
}

/* ---------- BACKUP SLIDES ---------- */
.reveal section.backup-slide h2 {
  font-size: 1.4em;
}

/* ---------- SLIDE NUMBER ---------- */
.reveal .slide-number {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--text-tertiary);
  background: transparent;
}

/* ---------- ACT MARKER (persistent structure indicator) ---------- */
.act-marker {
  position: absolute;
  top: 10px;
  right: 80px;
  font-size: 0.4em;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  z-index: 10;
  display: flex;
  gap: 0.5em;
  align-items: center;
}

.act-marker span {
  padding: 0.2em 0.6em;
  border-radius: 3px;
  color: var(--text-tertiary);
  opacity: 0.3;
}

.act-marker span.current {
  background: var(--accent);
  color: #fff;
  opacity: 1;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1200px) {
  .split-slide {
    flex-direction: column;
  }

  .split-image img {
    max-height: 40vh;
  }
}

/* ---------- LEAFLET MAP ---------- */
#priority-map {
  z-index: 1;
}

.city-tooltip {
  background: rgba(255, 255, 255, 0.96) !important;
  border: 1px solid var(--border) !important;
  border-radius: 6px !important;
  box-shadow: var(--shadow-md) !important;
  padding: 8px 12px !important;
  color: var(--text-primary) !important;
}

.city-tooltip::before {
  border-top-color: rgba(255, 255, 255, 0.96) !important;
}

.city-label span {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.8);
  display: block;
  text-align: center;
}

.leaflet-container {
  background: var(--bg-secondary) !important;
  font-family: 'Inter', sans-serif;
}

/* ---------- PRINT / PDF ---------- */
@media print {
  .reveal .slide-background {
    background-color: white !important;
  }

  .reveal, .reveal h1, .reveal h2, .reveal h3, .reveal p, .reveal li {
    color: #333 !important;
  }

  .accent {
    color: var(--accent) !important;
  }

  .reveal .fragment {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
  }

  .reveal .fragment.source-fade-out {
    opacity: 0 !important;
    display: none !important;
  }

  #presentation-timer,
  .reveal .controls,
  .reveal .progress {
    display: none !important;
  }

  .reveal section[data-background-color="#1a1a1a"] h2,
  .reveal section[data-background-color="#1a1a1a"] p {
    color: #333 !important;
  }

  .reveal img {
    max-width: 100%;
    page-break-inside: avoid;
  }

  .reveal section {
    page-break-after: always;
  }
}
