/* ============================================================
   CUSTOM PROPERTIES
   ============================================================ */
:root {
  --color-navy:          #0a2540;
  --color-nyheder:       #ff4d00;
  --color-guides:        #00b4d8;
  --color-tests:         #00d132;
  --color-bedst-i-test:  #a78bfa;
  --color-bg:            #f7f7f5;
  --color-surface:       #ffffff;
  --color-surface-warm:  #fff8f5;
  --color-text:          #1a1a2e;
  --color-text-muted:    #666666;
  --color-border:        #e8e8e8;

  --font-headline: 'IBM Plex Mono', monospace;
  --font-body:     'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --max-width: 1200px;
  --radius: 4px;
}

/* Section accent helpers — set --accent for child elements */
.type-nyheder      { --accent: var(--color-nyheder); }
.type-guides       { --accent: var(--color-guides); }
.type-tests        { --accent: var(--color-tests); }
.type-bedst-i-test { --accent: var(--color-bedst-i-test); }

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scrollbar-gutter: stable;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1; }

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-headline);
  font-weight: 700;
  line-height: 1.2;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }

p { margin-bottom: 1rem; }

ul, ol { padding-left: 1.5rem; margin-bottom: 1rem; }
li { margin-bottom: 0.25rem; }


.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ============================================================
   HEADER / NAV
   ============================================================ */
.site-header {
  background: var(--color-navy);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0.75rem 0;
  position: relative;
}

.nav-logo {
  font-family: var(--font-headline);
  font-weight: 700;
  font-size: 1.1rem;
  color: #ffffff;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 1.25rem;
  margin-left: auto;
  align-items: center;
}

.nav-link {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #ffffff;
  text-transform: uppercase;
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
  transition: opacity 0.15s;
}

.nav-link:hover { opacity: 0.8; }

.nav-link.type-nyheder      { border-bottom-color: var(--color-nyheder); }
.nav-link.type-guides       { border-bottom-color: var(--color-guides); }
.nav-link.type-tests        { border-bottom-color: var(--color-tests); }
.nav-link.type-bedst-i-test { border-bottom-color: var(--color-bedst-i-test); }
.nav-link.nav-link-soeg     { opacity: 0.7; }

/* Hamburger — hidden on desktop */
.nav-toggle-checkbox { display: none; }

.nav-toggle-label {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  margin-left: auto;
  padding: 4px;
}

.nav-toggle-label span {
  display: block;
  width: 22px;
  height: 2px;
  background: #ffffff;
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--color-navy);
  color: rgba(255,255,255,0.5);
  font-size: 0.85rem;
  padding: 1.5rem 0;
  margin-top: 3rem;
  text-align: center;
}

.footer-link {
  color: rgba(255,255,255,0.5);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-link:hover { color: #ffffff; }

/* ============================================================
   BADGE
   ============================================================ */
.badge {
  display: inline-block;
  background: var(--accent, var(--color-nyheder));
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 0.2em 0.55em;
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
}

/* ============================================================
   ARTICLE CARD
   ============================================================ */
.article-card {
  background: var(--color-surface);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.article-card-image-link { display: block; }

.article-card-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.article-card-body {
  padding: 0.875rem 1rem 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.article-card-title {
  font-family: var(--font-headline);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.article-card-title a:hover { color: var(--accent, var(--color-nyheder)); }

.article-card-meta {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: auto;
}

/* ============================================================
   ARTICLE GRID
   ============================================================ */
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

/* ============================================================
   HOMEPAGE
   ============================================================ */
.home-top {
  display: grid;
  grid-template-columns: 58% 42%;
  background: var(--color-surface);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 1.5rem 0 1rem;
}

.home-hero {
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
}

.home-hero-image-link { display: block; }

.home-hero-image {
  width: 100%;
  height: 240px;
  object-fit: cover;
}

.home-hero-body {
  padding: 1.25rem;
  flex: 1;
}

.home-hero-title {
  font-family: var(--font-headline);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
  margin-bottom: 0.6rem;
}

.home-hero-body-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.home-hero-body-link:hover .home-hero-title { color: var(--accent, var(--color-nyheder)); }

.home-hero-summary {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.55;
  margin-bottom: 0.75rem;
}

.home-hero-meta {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.home-recent {
  background: #fafaf8;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
}

.home-sidebar-label {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
}

.home-recent-item {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border);
}

.home-recent-item:last-child { border-bottom: none; }

.home-recent-thumb {
  width: 60px;
  height: 48px;
  object-fit: cover;
  border-radius: var(--radius);
  flex-shrink: 0;
}

.home-recent-body { flex: 1; }
.home-recent-body .badge { margin-bottom: 0.25rem; }

.home-recent-title {
  font-family: var(--font-headline);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
  margin-bottom: 0.2rem;
}

.home-recent-item:hover .home-recent-title { color: var(--accent, var(--color-nyheder)); }

.home-recent-date {
  font-size: 0.7rem;
  color: var(--color-text-muted);
}

.home-content-row {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.home-section-label {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 0.875rem;
}

.home-picks-sidebar {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  align-self: start;
  border-top: 3px solid var(--accent, var(--color-bedst-i-test));
}

.home-picks-list { list-style: none; padding: 0; margin: 0; }

.home-picks-list li {
  border-bottom: 1px solid var(--color-border);
  padding: 0.6rem 0;
}

.home-picks-list li:last-child { border-bottom: none; }

.home-picks-link {
  font-family: var(--font-headline);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
}

.home-picks-link:hover { color: var(--color-bedst-i-test); }

/* ============================================================
   ARTICLE SIDEBAR
   ============================================================ */
.featured-banner {
  background: var(--color-surface-warm);
  border-left: 4px solid var(--accent, var(--color-nyheder));
  border-radius: var(--radius);
  padding: 0.875rem 1rem;
  margin-bottom: 1.25rem;
}

.featured-banner-label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent, var(--color-nyheder));
  margin-bottom: 0.35rem;
}

.featured-banner-link {
  font-family: var(--font-headline);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
}

.featured-banner-link:hover { color: var(--accent, var(--color-nyheder)); }

.sidebar-label {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
}

.sidebar-item {
  display: flex;
  gap: 0.625rem;
  align-items: flex-start;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--color-border);
}

.sidebar-item:last-child { border-bottom: none; }

.sidebar-item-thumb {
  width: 56px;
  height: 44px;
  object-fit: cover;
  border-radius: var(--radius);
  flex-shrink: 0;
}

.sidebar-item-body { flex: 1; }
.sidebar-item-body .badge { margin-bottom: 0.2rem; }

.sidebar-item-title {
  font-family: var(--font-headline);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
  margin-bottom: 0.15rem;
}

.sidebar-item:hover .sidebar-item-title { color: var(--accent, var(--color-nyheder)); }

.sidebar-item-date {
  font-size: 0.7rem;
  color: var(--color-text-muted);
}

/* ============================================================
   ARTICLE SINGLE PAGE
   ============================================================ */
.article-layout {
  display: grid;
  grid-template-columns: 65fr 35fr;
  gap: 2rem;
  padding: 2rem 0;
}

.article { min-width: 0; }

.article-header { margin-bottom: 1.5rem; }

.article-title {
  font-family: var(--font-headline);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
  margin: 0.5rem 0 0.75rem;
}

.article-meta {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.article-category {
  background: #f0f0ee;
  padding: 0.1em 0.5em;
  border-radius: var(--radius);
  font-size: 0.8rem;
}

.article-hero { margin-bottom: 2rem; }

.article-hero img {
  width: 100%;
  border-radius: var(--radius);
}

.image-credit {
  text-align: right;
  font-size: 0.75rem;
  color: #aaa;
  margin-top: 0.25rem;
}

.article-content {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--color-text);
}

.article-content h2 { margin-top: 2rem; margin-bottom: 0.75rem; font-size: 1.3rem; }
.article-content h3 { margin-top: 1.5rem; margin-bottom: 0.5rem; font-size: 1.05rem; }
.article-content p { margin-bottom: 1.1rem; }

.article-content a {
  color: var(--accent, var(--color-nyheder));
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ToC */
.toc {
  background: #f8f8f6;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
}

.toc h2 {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 0.5rem;
  color: var(--color-text-muted);
}

.toc ul { padding-left: 1.25rem; }
.toc a { color: var(--color-text); }
.toc a:hover { color: var(--accent, var(--color-nyheder)); }

/* Affiliate box */
.affiliate-box {
  background: #f8f8f6;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 2rem 0;
}

.affiliate-notice { font-size: 0.75rem; color: #aaa; margin-bottom: 0.5rem; }
.affiliate-links { list-style: none; padding: 0; }
.affiliate-links li { margin-bottom: 0.5rem; }

.affiliate-links a {
  display: inline-block;
  background: var(--accent, var(--color-nyheder));
  color: white;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
}

.affiliate-links a:hover { opacity: 0.85; }

/* Tags */
.article-tags {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag {
  background: #f0f0ee;
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

.tag:hover { background: #e4e4e2; }

/* ============================================================
   SECTION LIST PAGE
   ============================================================ */
.section-page { padding: 2rem 0; }

.section-header {
  margin-bottom: 1.75rem;
  padding-bottom: 0.875rem;
  border-bottom: 3px solid var(--accent, var(--color-text));
}

.section-title {
  font-family: var(--font-headline);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text);
}

.section-description {
  font-size: 1rem;
  color: var(--color-text-muted);
  margin-top: 0.4rem;
  margin-bottom: 0;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 2.5rem;
  list-style: none;
}

.page-item a,
.page-item span {
  display: block;
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--color-text-muted);
  background: var(--color-surface);
}

.page-item a:hover {
  border-color: var(--accent, var(--color-navy));
  color: var(--color-text);
}

.page-item.active span {
  background: var(--accent, var(--color-navy));
  color: #ffffff;
  border-color: var(--accent, var(--color-navy));
}

/* ============================================================
   RESPONSIVE — MOBILE (≤ 768px)
   ============================================================ */
@media (max-width: 768px) {

  /* Show hamburger, hide links */
  .nav-toggle-label { display: flex; }

  .nav-links {
    display: none;
    flex-direction: column;
    gap: 0;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-navy);
    padding: 0.5rem 1.25rem 1rem;
  }

  .nav-links li { border-top: 1px solid rgba(255,255,255,0.08); }

  .nav-link {
    display: block;
    padding: 0.65rem 0 0.65rem 0.75rem;
    border-bottom: none;
    border-left: 3px solid transparent;
  }

  .nav-link.type-nyheder      { border-left-color: var(--color-nyheder); }
  .nav-link.type-guides       { border-left-color: var(--color-guides); }
  .nav-link.type-tests        { border-left-color: var(--color-tests); }
  .nav-link.type-bedst-i-test { border-left-color: var(--color-bedst-i-test); }

  /* Open nav when checkbox checked */
  .nav-toggle-checkbox:checked ~ .nav-links { display: flex; }

  /* Hamburger → X */
  .nav-toggle-checkbox:checked ~ .nav-toggle-label span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .nav-toggle-checkbox:checked ~ .nav-toggle-label span:nth-child(2) {
    opacity: 0;
  }
  .nav-toggle-checkbox:checked ~ .nav-toggle-label span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* Homepage top: stack vertically */
  .home-top { grid-template-columns: 1fr; }
  .home-hero { border-right: none; border-bottom: 1px solid var(--color-border); }
  .home-hero-image { height: 200px; }

  /* Content row: single column, picks sidebar first */
  .home-content-row { grid-template-columns: 1fr; }
  .home-picks-sidebar { order: -1; }

  /* Article grid: 1 column */
  .article-grid { grid-template-columns: 1fr; }

  /* Article layout: stack, sidebar below content */
  .article-layout { grid-template-columns: 1fr; }
  .article-title { font-size: 1.5rem; }

  /* Section list */
  .section-title { font-size: 1.4rem; }
}

/* ============================================================
   404 PAGE
   ============================================================ */
.error-page {
  text-align: center;
  padding: 5rem 0;
}

.error-page h1 {
  font-family: var(--font-headline);
  font-size: 5rem;
  color: var(--color-border);
  line-height: 1;
  margin-bottom: 1rem;
}

.error-page p {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}

.error-home-link {
  display: inline-block;
  background: var(--color-navy);
  color: #ffffff;
  padding: 0.6rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
}

.error-home-link:hover { opacity: 0.85; }

/* ============================================================
   SEARCH PAGE
   ============================================================ */
.search-page { padding: 2rem 0; }

.search-title {
  font-family: var(--font-headline);
  font-size: 1.75rem;
  margin-bottom: 1.5rem;
}
