/* soltider.no — Amber/Gold sol-tema */
:root {
  --brand: #D97706;
  --brand-rgb: 217, 119, 6;
  --brand-hover: #B45309;
  --brand-deep: #92400E;
  --brand-light: #FFFBEB;
  --brand-mid: #FDE68A;
  --brand-warm: #FBBF24;
  --sunrise-start: #FDE68A;
  --sunrise-mid: #FB923C;
  --sunrise-end: #7C3AED;
  --golden: #F59E0B;
  --golden-bg: #FEF3C7;
  --text-primary: #111827;
  --text-secondary: #374151;
  --text-muted: #6B7280;
  --border: #E5E7EB;
  --bg-main: #FFFBEB;
  --bg-secondary: #FEF3C7;
  --surface: #FFFFFF;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 2.5rem;
  --space-3xl: 3rem;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(217,119,6,0.1);
  --shadow-lg: 0 8px 24px rgba(217,119,6,0.15);
}

@media (prefers-color-scheme: dark) {
  :root {
    --text-primary: #F9FAFB;
    --text-secondary: #D1D5DB;
    --text-muted: #9CA3AF;
    --border: #374151;
    --bg-main: #111827;
    --bg-secondary: #1F2937;
    --surface: #1F2937;
    --brand-light: #451A03;
    --brand-mid: #92400E;
    --golden-bg: #451A03;
  }
}

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

body {
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  background: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  color: var(--brand-hover);
  text-decoration: underline;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  height: 48px;
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 var(--space-md);
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--brand-deep);
  text-decoration: none;
}

.logo:hover { text-decoration: none; color: var(--brand); }
.logo-icon { flex-shrink: 0; }

.header-search {
  position: relative;
}

.header-search input {
  font-family: inherit;
  font-size: 0.875rem;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-main);
  color: var(--text-primary);
  width: 180px;
  outline: none;
  transition: border-color 0.2s;
}

.header-search input:focus {
  border-color: var(--brand);
}

.search-results {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  min-width: 200px;
  z-index: 200;
}

.search-result-item {
  display: block;
  padding: 8px 12px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.9rem;
}

.search-result-item:hover {
  background: var(--bg-secondary);
  text-decoration: none;
}

/* Hero */
.hero {
  background: linear-gradient(180deg, #7C3AED 0%, #FB923C 60%, #FDE68A 100%);
  color: white;
  padding: var(--space-3xl) var(--space-lg);
  text-align: center;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.hero h1 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
  text-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.hero-date {
  font-size: 1rem;
  opacity: 0.9;
  margin-bottom: var(--space-xl);
}

.hero-midnight {
  background: linear-gradient(180deg, #1E1B4B 0%, #FB923C 70%, #FDE68A 100%);
}

.hero-polar {
  background: linear-gradient(180deg, #0F172A 0%, #1E3A5F 50%, #4338CA 100%);
}

.hero-daylight {
  background: linear-gradient(180deg, #7C3AED 0%, #FBBF24 100%);
}

/* Breadcrumbs */
.breadcrumbs {
  font-size: 0.85rem;
  margin-bottom: var(--space-md);
  opacity: 0.85;
}

.breadcrumbs a {
  color: white;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.breadcrumbs a:hover { opacity: 0.8; }

/* Sun cards */
.sun-cards {
  display: flex;
  gap: var(--space-lg);
  justify-content: center;
  margin-bottom: var(--space-lg);
}

.sun-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-xl);
  min-width: 140px;
}

.sun-icon {
  font-size: 1.5rem;
  margin-bottom: var(--space-xs);
}

.sun-card .time {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.sun-card .label {
  font-size: 0.875rem;
  opacity: 0.9;
  margin-top: var(--space-xs);
}

/* Daylight info */
.daylight-info {
  font-size: 1.1rem;
  margin-bottom: var(--space-md);
  font-weight: 500;
}

.golden-info, .special-info {
  font-size: 0.9rem;
  opacity: 0.85;
  margin-top: var(--space-sm);
}

/* Daylight bar */
.daylight-bar {
  height: 8px;
  background: rgba(255,255,255,0.2);
  border-radius: 4px;
  position: relative;
  max-width: 480px;
  width: 100%;
  margin: 0 auto var(--space-md);
}

.daylight-bar .light {
  position: absolute;
  height: 100%;
  background: var(--brand-warm);
  border-radius: 4px;
}

/* Detail cards */
.detail-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  max-width: 720px;
  margin: var(--space-2xl) auto;
  padding: 0 var(--space-md);
}

.detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  text-align: center;
}

.detail-card h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.detail-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--brand);
  line-height: 1.2;
}

.detail-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: var(--space-xs);
}

/* Week table */
.week-section, .content-section {
  max-width: 720px;
  margin: var(--space-2xl) auto;
  padding: 0 var(--space-md);
}

.week-section h2, .content-section h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

.week-table-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.week-table {
  width: 100%;
  border-collapse: collapse;
}

.week-table th {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--space-sm) var(--space-md);
  text-align: left;
}

.week-table td {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
}

.week-table .today {
  background: var(--golden-bg);
  font-weight: 600;
}

.week-table .change-positive { color: #16A34A; }
.week-table .change-negative { color: #DC2626; }

.week-table a {
  color: var(--text-primary);
  font-weight: 500;
}

.week-table a:hover {
  color: var(--brand);
}

/* City grid */
.city-section {
  max-width: 900px;
  margin: var(--space-3xl) auto;
  padding: 0 var(--space-md);
}

.city-section h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
}

.city-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}

.city-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  text-decoration: none;
  color: var(--text-primary);
  transition: box-shadow 0.2s, border-color 0.2s;
  display: block;
}

.city-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.city-name {
  font-weight: 600;
  font-size: 1rem;
  display: block;
  margin-bottom: var(--space-sm);
}

.time-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.city-daylight {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

/* Theme links */
.theme-links {
  max-width: 900px;
  margin: var(--space-3xl) auto;
  padding: 0 var(--space-md);
}

.theme-links h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

.theme-card {
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  color: white;
  text-decoration: none;
  transition: transform 0.2s;
}

.theme-card:hover {
  transform: translateY(-2px);
  text-decoration: none;
  color: white;
}

.theme-card h3 {
  font-size: 1.1rem;
  margin-bottom: var(--space-xs);
}

.theme-card p {
  font-size: 0.85rem;
  opacity: 0.9;
}

.theme-midnight {
  background: linear-gradient(135deg, #FB923C, #F59E0B);
}

.theme-polar {
  background: linear-gradient(135deg, #1E3A5F, #4338CA);
}

.theme-daylight {
  background: linear-gradient(135deg, #7C3AED, #D97706);
}

/* Daylight chart */
.daylight-chart, .daylight-chart-large {
  max-width: 720px;
  margin: var(--space-2xl) auto;
  padding: 0 var(--space-md);
}

.daylight-chart h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
}

/* Chart controls */
.chart-controls {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
}

.chart-controls label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.city-select {
  font-family: inherit;
  font-size: 0.85rem;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-primary);
}

/* Nearby */
.nearby-section {
  max-width: 720px;
  margin: var(--space-2xl) auto;
  padding: 0 var(--space-md);
}

.nearby-section h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
}

.nearby-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.nearby-links a {
  display: inline-block;
  padding: 6px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-primary);
  text-decoration: none;
  transition: border-color 0.2s;
}

.nearby-links a:hover {
  border-color: var(--brand);
  text-decoration: none;
}

/* FAQ */
.faq-section {
  max-width: 720px;
  margin: var(--space-3xl) auto;
  padding: 0 var(--space-md);
}

.faq-section h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
}

.faq-item {
  border-bottom: 1px solid var(--border);
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-lg) 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  line-height: 1.4;
}

.faq-question::after {
  content: "+";
  font-size: 1.25rem;
  color: var(--text-muted);
  transition: transform 0.2s;
  flex-shrink: 0;
  margin-left: var(--space-md);
}

.faq-item.open .faq-question::after {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.95rem;
}

.faq-item.open .faq-answer {
  max-height: 400px;
  padding-bottom: var(--space-lg);
}

/* Prose */
.prose {
  margin: var(--space-xl) 0;
  line-height: 1.7;
}

.prose p {
  margin-bottom: var(--space-md);
  color: var(--text-secondary);
}

.prose h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: var(--space-2xl) 0 var(--space-md);
  color: var(--text-primary);
}

.prose ul {
  padding-left: var(--space-xl);
  margin-bottom: var(--space-md);
}

.prose li {
  margin-bottom: var(--space-sm);
  color: var(--text-secondary);
}

/* Footer */
.site-footer {
  background: var(--brand-deep);
  color: rgba(255,255,255,0.9);
  padding: var(--space-2xl) var(--space-md);
  margin-top: var(--space-3xl);
}

.footer-inner {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.footer-brand {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: var(--space-md);
}

.footer-cities, .footer-links {
  margin-bottom: var(--space-md);
  font-size: 0.85rem;
}

.footer-cities a, .footer-links a {
  color: rgba(255,255,255,0.8);
}

.footer-cities a:hover, .footer-links a:hover {
  color: white;
}

.footer-beep {
  margin: var(--space-md) 0;
  font-size: 0.85rem;
}

.footer-beep a {
  color: var(--brand-mid);
}

.footer-copy {
  font-size: 0.8rem;
  opacity: 0.6;
  margin-top: var(--space-md);
}

/* Mobile */
@media (max-width: 640px) {
  .hero {
    min-height: 360px;
    padding: var(--space-xl) var(--space-md);
  }

  .hero h1 { font-size: 1.4rem; }

  .sun-cards {
    flex-direction: column;
    gap: var(--space-md);
    align-items: center;
  }

  .sun-card .time { font-size: 2rem; }

  .detail-cards {
    grid-template-columns: 1fr;
  }

  .city-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }

  .theme-grid {
    grid-template-columns: 1fr;
  }

  .week-table-wrapper {
    margin: 0 calc(-1 * var(--space-md));
    padding: 0 var(--space-md);
  }

  .chart-controls {
    flex-direction: column;
    align-items: flex-start;
  }

  .header-search input { width: 140px; }
}

@media (max-width: 768px) {
  .city-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .theme-grid {
    grid-template-columns: 1fr;
  }
}
