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

:root {
  /* Jysk Energi brand palette */
  --brand: #093E6C;
  --brand-mid: #1A588E;
  --brand-light: #92AAC5;
  --brand-wash: #C9D5E2;
  --brand-faint: #E3EAF0;

  --green: #80C18E;
  --green-light: #E2EEE4;

  --text: #121212;
  --text-secondary: #4b5563;
  --text-muted: #787e8b;

  --bg: #FFFFFF;
  --bg-surface: #F7F7F7;
  --bg-elevated: #FFFFFF;
  --border: #e5e7eb;
  --border-light: #f3f4f6;
}

html, body {
  width: 1920px;
  height: 1080px;
  overflow: hidden;
  font-family: 'Nunito Sans', 'Texta Alt', system-ui, sans-serif;
  font-optical-sizing: auto;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  width: 1920px;
  height: 1080px;
  position: relative;
  overflow: hidden;
}

/* ===== LOADER ===== */
#loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 28px;
  background: var(--bg);
}

#loader p {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.loader-pulse {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--brand);
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.4; }
}

/* ===== SLIDES ===== */
.slide {
  position: absolute;
  inset: 0;
  width: 1920px;
  height: 1080px;
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
  background: var(--bg);
}

.slide.active {
  opacity: 1;
  pointer-events: auto;
}

/* Entry animations for cards */
.slide.active .overview-card {
  animation: cardReveal 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.slide.active .overview-card:nth-child(1) { animation-delay: 0.1s; }
.slide.active .overview-card:nth-child(2) { animation-delay: 0.2s; }
.slide.active .overview-card:nth-child(3) { animation-delay: 0.3s; }
.slide.active .overview-card:nth-child(4) { animation-delay: 0.4s; }

@keyframes cardReveal {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.slide.active .article-body {
  animation: contentFade 0.8s ease 0.2s both;
}

@keyframes contentFade {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== OVERVIEW SLIDE ===== */
.overview {
  display: flex;
  flex-direction: column;
  padding: 64px 80px 48px;
  gap: 0;
  background: var(--bg-surface);
}

.overview-header {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 44px;
}

.overview-logo {
  height: 40px;
  margin-right: 32px;
}

.overview-header h1 {
  font-size: 38px;
  font-weight: 800;
  color: var(--brand);
  letter-spacing: -0.02em;
  position: relative;
}

.overview-header h1::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 32px;
  background: var(--brand);
  border-radius: 2px;
}

.overview-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  flex: 1;
}

.overview-card {
  display: flex;
  background: var(--bg-elevated);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  opacity: 0;
  transition: box-shadow 0.4s ease, border-color 0.4s ease;
}

.overview-card.next {
  border-color: var(--brand);
  box-shadow:
    0 0 0 1px var(--brand),
    0 8px 32px rgba(9, 62, 108, 0.12);
}

.card-image-wrap {
  width: 320px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-image-wrap .card-number {
  position: absolute;
  top: 16px;
  left: 16px;
}

.card-body {
  padding: 32px 36px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.card-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 800;
  flex-shrink: 0;
}

.overview-card.next .card-number {
  background: var(--brand);
  color: #fff;
}

.card-label {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--brand-mid);
}

.card-title {
  font-size: 25px;
  font-weight: 700;
  line-height: 1.28;
  color: var(--brand);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: -0.01em;
}

.card-teaser {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-date {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: auto;
}

.overview-card.next .card-label {
  color: var(--brand);
}

.overview-card.next .card-title {
  color: var(--brand);
}

/* ===== ARTICLE SLIDE ===== */
.article-slide {
  display: flex;
  height: 1080px;
  overflow: hidden;
  background: var(--bg);
}

/* Main content area */
.article-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.article-hero {
  flex-shrink: 0;
  padding: 40px 140px 0;
}

.article-hero img {
  width: 100%;
  height: 500px;
  object-fit: cover;
  display: block;
  border-radius: 10px;
}

.article-no-hero {
  height: 32px;
  flex-shrink: 0;
  background: var(--bg);
}

.article-body {
  flex: 1;
  padding: 16px 140px 48px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-width: 1400px;
}

.article-title {
  font-size: 46px;
  font-weight: 800;
  line-height: 1.15;
  margin-top: 20px;
  margin-bottom: 24px;
  letter-spacing: -0.025em;
  color: var(--brand);
}

.article-has-hero .article-title {
  margin-top: 0;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--brand-faint);
}

.article-meta-label {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand);
  background: var(--brand-faint);
  padding: 6px 14px;
  border-radius: 6px;
}

.article-meta-date {
  font-size: 15px;
  color: var(--text-muted);
  font-weight: 600;
}

.article-content {
  flex: 1;
  overflow: hidden;
  font-size: 22px;
  line-height: 1.65;
  color: var(--text);
  columns: auto;
}

.article-content p {
  margin-bottom: 12px;
}

.article-content strong {
  color: var(--text);
  font-weight: 700;
}

.article-content em {
  color: var(--text-secondary);
}

/* Right-side image sidebar for page 2+ */
.article-sidebar {
  width: 400px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 64px 32px 0;
}

.article-sidebar img {
  width: 100%;
  max-height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Hide sidebar on page 1 (hero is full-width) */
.article-has-hero .article-sidebar {
  display: none;
}

.article-content h2, .article-content h3, .article-content h4 {
  font-size: 26px;
  font-weight: 700;
  margin: 16px 0 10px;
  color: var(--brand);
  letter-spacing: -0.01em;
}

.article-content ul, .article-content ol {
  margin-left: 28px;
  margin-bottom: 16px;
}

.article-content li {
  margin-bottom: 6px;
}

/* ===== PAGE INDICATOR ===== */
.page-indicator {
  position: absolute;
  bottom: 24px;
  right: 32px;
  font-size: 15px;
  font-weight: 700;
  color: var(--brand);
  background: var(--brand-faint);
  padding: 8px 18px;
  border-radius: 8px;
  z-index: 10;
  letter-spacing: 0.02em;
}

/* ===== PROGRESS BAR ===== */
.progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--brand);
  z-index: 20;
}

/* ===== BOTTOM BRAND BAR (overview) ===== */
.overview-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 20px;
  margin-top: auto;
}

.overview-footer-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.overview-footer-logo {
  height: 30px;
}

.overview-footer-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
}

.overview-footer-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.overview-footer-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
  margin-right: 6px;
  animation: dotPulse 2s ease infinite;
}

@keyframes dotPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ===== NEXT-UP INDICATOR ON OVERVIEW ===== */
.next-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand);
}

.next-indicator-arrow {
  display: inline-flex;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  animation: arrowBounce 1.5s ease infinite;
}

@keyframes arrowBounce {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(3px); }
}

/* ===== DEBUG OVERLAY ===== */
#debug-overlay {
  position: fixed;
  top: 16px;
  left: 16px;
  background: rgba(9, 62, 108, 0.94);
  color: #E3EAF0;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 13px;
  padding: 20px 24px;
  border-radius: 10px;
  z-index: 1000;
  max-width: 480px;
  line-height: 1.7;
  border: 1px solid rgba(146, 170, 197, 0.3);
  backdrop-filter: blur(8px);
}

#debug-overlay.hidden {
  display: none;
}
