﻿/* =============================================================
   Klimasentralitet – CICERO
   Clean editorial design, Averta font, white background
   ============================================================= */

/* ---------- @font-face ---------- */
@font-face {
  font-family: 'Averta';
  src: url('../fonts/AvertaPE/regular.woff2') format('woff2'),
       url('../fonts/AvertaPE/regular.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Averta';
  src: url('../fonts/AvertaPE/semi-bold.woff2') format('woff2'),
       url('../fonts/AvertaPE/semi-bold.woff') format('woff');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Averta';
  src: url('../fonts/AvertaPE/bold.woff2') format('woff2'),
       url('../fonts/AvertaPE/bold.woff') format('woff');
  font-weight: bold;
  font-style: normal;
  font-display: swap;
}

/* ---------- Custom properties ---------- */
:root {
  --cicero-blue: #1d3461;
  --cicero-blue-mid: #2a4a8a;
  --bg: #ffffff;
  --bg-secondary: #f7f6f3;
  --text: #1a1a2e;
  --muted: #666666;
  --border: #e8e8e4;
  --ja: #f5c842;
  --nei: #1d3461;
  --irr: #b0b8c8;
  --s1: #5573e6;
  --s2: #fa6e3c;
  --s3: #fad250;
  --s4: #00785f;
  --s5: #5db3f5;
  --s6: #4c4c9d;
  --font: 'Averta', Arial, sans-serif;
  --header-h: 76px;
  --fixed-top: 76px; /* header only */
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  font-weight: normal;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--cicero-blue); text-decoration: none; }
button { font-family: var(--font); border: none; cursor: pointer; background: none; }

/* =============================================================
   HEADER
   ============================================================= */
#site-header {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 200;
  height: var(--header-h);
  background: var(--bg);
}
.header-inner {
  max-width: 1200px; margin: 0 auto;
  height: 100%; padding: 0 2rem;
  display: flex; align-items: center; justify-content: space-between;
}
.logo {
  display: flex; align-items: center;
  text-decoration: none;
}
.logo-img {
  height: 63px; width: auto;
}
.header-right {
  font-family: var(--font); font-size: 12px;
}
.header-right a {
  color: var(--muted); text-decoration: none;
}
.header-right a:hover { color: var(--cicero-blue); }

/* =============================================================
   HERO
   ============================================================= */
#hero {
  background: var(--bg);
  padding: calc(var(--fixed-top) + 3rem) 2rem 2.5rem;
}
.hero-inner {
  max-width: 640px; margin: 0 auto; text-align: left;
}
#hero h1 {
  font-size: clamp(26px, 3.5vw, 42px);
  font-weight: 700; color: var(--cicero-blue);
  line-height: 1.2; margin-bottom: 1rem;
}
.hero-lead {
  font-size: 18px; line-height: 1.7; font-weight: 300;
  color: #444;
}
.byline {
  font-size: 14px; color: var(--muted);
  margin-top: 0.75rem;
}
.byline a {
  color: var(--cicero-blue); text-decoration: none;
}
.byline a:hover { text-decoration: underline; }

/* =============================================================
   DROPDOWN (in sections panel)
   ============================================================= */
.select-label {
  font-size: 12px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 0.3rem;
}
.select-wrap { margin-bottom: 1.2rem; position: relative; }

/* Custom dropdown trigger */
.dropdown-trigger {
  font-family: var(--font);
  font-size: clamp(20px, 2.5vw, 28px); font-weight: 700;
  color: var(--cicero-blue); background: transparent;
  border: none; padding: 4px 32px 4px 0;
  width: 100%; text-align: left;
  cursor: pointer; outline: none;
  line-height: 1.3;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Cpath d='M1 1l6 6 6-6' stroke='%23999' stroke-width='2' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px top 50%;
}
.dropdown-trigger:hover { color: var(--cicero-blue-mid); }

/* Dropdown options list */
.dropdown-list {
  display: none; position: absolute;
  top: 100%; left: 0; right: 0;
  z-index: 100;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.1);
  max-height: 400px; overflow-y: auto;
  padding: 6px 0;
}
.dropdown-list.open { display: block; }
.dropdown-option {
  display: block; width: 100%;
  font-family: var(--font); font-size: 14px;
  color: var(--text); background: none;
  border: none; padding: 10px 16px;
  text-align: left; cursor: pointer;
  line-height: 1.4;
}
.dropdown-option:hover { background: var(--bg-secondary); }
.dropdown-option.active {
  color: var(--cicero-blue); font-weight: 600;
}

/* =============================================================
   SCROLLYTELLING LAYOUT
   ============================================================= */
#scrolly-wrapper {
  display: flex; align-items: flex-start;
  max-width: 1100px; margin: 0 auto;
  padding: 0 2rem;
  gap: 3rem;
}

/* ---------- Left column: sticky map ---------- */
#map-column {
  flex: 0 0 420px;
  position: sticky;
  top: calc(var(--fixed-top) + 1rem);
  align-self: stretch;
  display: flex; flex-direction: column; gap: 1rem;
}

#kart-container {
  flex: 1; overflow: hidden; background: var(--bg);
}
#kart-container svg {
  width: 100%; height: 100%;
  object-fit: contain;
}

/* ---------- Right column: step content ---------- */
#sections-panel {
  flex: 1; min-width: 0;
  padding-top: 2rem; padding-bottom: 2rem;
}

/* Static question heading */
.step-question {
  font-size: clamp(20px, 2.5vw, 28px);
  font-weight: 600; color: var(--cicero-blue);
  line-height: 1.3; margin-bottom: 0.4rem;
}
.step-source {
  font-size: 11px; color: var(--muted);
  margin-bottom: 1.5rem;
}

/* Step dots */
.dots-header-row {
  display: flex; align-items: baseline; gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.dots-heading {
  font-size: 14px; font-weight: 600; color: var(--text);
}
#step-dots {
  display: flex; gap: 6px; margin-bottom: 0.4rem;
}
.step-dot {
  width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid transparent;
  opacity: 0.35; transition: opacity .2s, border-color .2s, transform .2s;
  cursor: pointer;
  font-family: var(--font); font-size: 14px; font-weight: 700;
  color: #fff; line-height: 28px; text-align: center;
}
.step-dot:hover { opacity: 0.7; transform: scale(1.15); }
.step-dot.active {
  opacity: 1; border-color: var(--text);
  transform: scale(1.15);
}

/* Sentral–Usentral arrow beneath dots */
.dots-arrow-row {
  position: relative;
  width: calc(6 * 32px + 5 * 6px); /* match dots row: 222px */
  height: 14px;
  margin-bottom: 1.5rem;
}
.dots-arrow-label {
  position: absolute; top: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font); font-size: 10px;
  color: var(--muted); white-space: nowrap;
  line-height: 1; letter-spacing: 0.02em;
}
.dots-arrow-label:first-child { left: 16px; }    /* center of dot 1 */
.dots-arrow-label:last-child  { left: 206px; }   /* center of dot 6 */
.dots-arrow-line {
  position: absolute;
  left: 38px; right: calc(100% - 180px); /* inset past labels */
  top: 50%;
  border-top: 1px solid var(--muted);
}
.dots-arrow-line::before,
.dots-arrow-line::after {
  content: ''; position: absolute; top: -3.5px;
  width: 0; height: 0;
  border-top: 3px solid transparent;
  border-bottom: 3px solid transparent;
}
.dots-arrow-line::before {
  left: 0;
  border-right: 5px solid var(--muted);
}
.dots-arrow-line::after {
  right: 0;
  border-left: 5px solid var(--muted);
}

/* SSB description – collapsible */
.ssb-wrap {
  margin-bottom: 1.5rem;
}
.ssb-toggle {
  font-family: var(--font); font-size: 13px;
  color: var(--cicero-blue); background: none; border: none;
  cursor: pointer; padding: 0;
  text-decoration: underline;
}
.ssb-toggle:hover { color: var(--cicero-blue-mid); }
.ssb-desc {
  display: none;
  font-size: 12px; line-height: 1.6; color: var(--muted);
  margin-top: 0.5rem; max-width: 460px;
}
.ssb-wrap.open .ssb-desc {
  display: block;
}
.ssb-desc a {
  color: var(--cicero-blue); text-decoration: underline;
}

/* Step content area */
#step-content {
  min-height: 260px;
}

.s-badge {
  display: inline-block;
  font-size: 14px; font-weight: 700;
  margin-bottom: 1rem;
}

.s-body-wrap {
  font-size: 15px; line-height: 1.7;
  color: #444; margin-bottom: 1.5rem; max-width: 500px;
}
.s-body-rest {
  display: none;
}
.s-body-wrap.open .s-body-rest {
  display: inline;
}
.s-body-toggle {
  display: inline;
  font-family: var(--font); font-size: 14px;
  color: var(--cicero-blue); background: none; border: none;
  cursor: pointer; padding: 0; margin-left: 4px;
  text-decoration: underline;
}
.s-body-toggle:hover {
  color: var(--cicero-blue-mid);
}

/* ---------- Chart card ---------- */
.chart-card {
  background: var(--bg);
  padding: 1.5rem 0;
}
.chart-meta {
  font-size: 11px; color: var(--muted);
  margin-top: 1rem; text-align: right;
}
.chart-source {
  font-size: 11px; color: var(--muted);
  margin-bottom: 1.2rem;
}
.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: flex; align-items: center; gap: 10px; }
.bar-label {
  font-size: 13px; color: var(--text);
  width: 110px; flex-shrink: 0; text-align: right; line-height: 1.2;
}
.bar-track {
  flex: 1; height: 38px;
  background: #f0efeb;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  display: flex; align-items: center; padding-left: 10px;
  font-size: 14px; font-weight: 700;
  width: 0%; min-width: 0; white-space: nowrap; overflow: hidden;
  transition: width 1s cubic-bezier(.4,0,.2,1);
}

/* Bar fill color classes */
.bar-fill.bar-ja       { background: var(--ja); color: #1a1a2e; }
.bar-fill.bar-nei      { background: var(--nei); color: #fff; }
.bar-fill.bar-irr      { background: var(--irr); color: #444; }
.bar-fill.bar-snik     { background: var(--nei); color: #fff; }
.bar-fill.bar-verken   { background: var(--irr); color: #444; }
.bar-fill.bar-stemmer  { background: var(--ja); color: #1a1a2e; }
.bar-fill.bar-vetikke  { background: #e0e0d8; color: #666; }

/* =============================================================
   FOOTER
   ============================================================= */
#site-footer {
  background: #deebe4; color: rgba(0,0,0,.6);
  padding: 2rem;
}
.footer-inner {
  max-width: 1100px; margin: 0 auto;
  padding: 0 2rem;
  font-size: 13px; line-height: 1.7;
}
.footer-inner p { margin-bottom: 0.5rem; }
#site-footer a { color: var(--cicero-blue); }

/* =============================================================
   RESPONSIVE
   ============================================================= */
@media (max-width: 900px) {
  :root { --fixed-top: 56px; }
  #scrolly-wrapper {
    flex-direction: column; gap: 1.5rem;
    padding: 0 1rem;
  }

  #map-column {
    position: static;
    flex: none;
    order: 2;
    width: 100%;
    height: auto;
    max-height: 70vh;
    margin-bottom: 50px;
  }

  #sections-panel { padding-top: 1rem; order: 1; }
  .bar-label { width: 80px; font-size: 12px; }
  #hero { padding: calc(var(--fixed-top) + 2rem) 1rem 1.5rem; }
  .hero-inner { max-width: 100%; margin: 0; }
}

@media (max-width: 480px) {
  :root {
    --header-h: 48px;
    --fixed-top: 48px;
  }
  .bar-track { height: 32px; }
  .bar-label { width: 70px; font-size: 11px; }
  .bar-fill { font-size: 12px; }
  #topic-bar { padding: 0 0.75rem; }
  .tbtn { font-size: 12px; padding: 4px 10px; }
}

