/*
Theme Name: Helges Connected Node
Theme URI: https://helg.es
Author: Helge
Description: Skreddersydd homelab, smarthjem og tech-tema med Connected Node-profil og Day/Night-bryter.
Version: 1.0.0
Text Domain: helges-node
*/

:root, [data-theme="dark"] {
  --bg-main: #0A0D14;
  --bg-card: #121723;
  --bg-card-hover: #171E2E;
  --border-color: #232A3B;
  --border-glow: rgba(217, 70, 239, 0.45);
  --text-primary: #F3F4F6;
  --text-secondary: #9CA3AF;
  --text-muted: #64748B;
  --accent-pink: #FF00AA;
  --accent-purple: #9333EA;
  --accent-gradient: linear-gradient(135deg, #FF00AA 0%, #9333EA 100%);
  --pill-bg: rgba(147, 51, 234, 0.15);
  --pill-border: rgba(217, 70, 239, 0.35);
  --dot-grid: rgba(255, 255, 255, 0.07);
}

[data-theme="light"] {
  --bg-main: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F1F5F9;
  --border-color: #E2E8F0;
  --border-glow: rgba(147, 51, 234, 0.4);
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --accent-pink: #D9008F;
  --accent-purple: #7E22CE;
  --accent-gradient: linear-gradient(135deg, #D9008F 0%, #7E22CE 100%);
  --pill-bg: rgba(147, 51, 234, 0.08);
  --pill-border: rgba(147, 51, 234, 0.25);
  --dot-grid: rgba(15, 23, 42, 0.08);
}

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

body {
  background-color: var(--bg-main);
  background-image: radial-gradient(var(--dot-grid) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--text-primary);
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
  line-height: 1.65;
  transition: background-color 0.25s ease, color 0.25s ease;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.site-container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- TOPPMENY & HEADER --- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 0;
  border-bottom: 1px solid var(--border-color);
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-link svg {
  height: 38px;
  width: auto;
}

/* Justering av SVG-tekst i lys modus */
[data-theme="light"] .brand-link .helg,
[data-theme="light"] .brand-link .mono-stem {
  fill: #0F172A;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 28px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.nav-links a:hover,
.nav-links .current-menu-item a {
  color: var(--text-primary);
}

/* --- SMARTHJEM DAY/NIGHT-BRYTER --- */
.theme-switch-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Geist Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.smart-toggle {
  position: relative;
  width: 48px;
  height: 26px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  cursor: pointer;
  padding: 3px;
  transition: all 0.25s ease;
}

.smart-toggle:hover {
  border-color: var(--accent-pink);
}

.toggle-knob {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-gradient);
  box-shadow: 0 0 10px var(--accent-pink);
  transform: translateX(22px);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="light"] .toggle-knob {
  transform: translateX(0);
}

/* --- HOVEDLAYOUT (VENSTRE INNHOLD + HØYRE HOMELAB SIDEBAR) --- */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 48px;
  padding: 56px 0 80px;
}

@media (max-width: 960px) {
  .main-grid {
    grid-template-columns: 1fr;
  }
}

/* --- HERO-SEKSJON --- */
.hero-section {
  margin-bottom: 48px;
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 16px;
}

.hero-title .dot {
  color: var(--accent-pink);
  text-shadow: 0 0 14px rgba(255, 0, 170, 0.6);
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin-bottom: 24px;
}

.tag-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-family: 'Geist Mono', monospace;
  font-size: 0.8rem;
}

.pill {
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  color: var(--text-primary);
}

.pill.status-online {
  border-color: var(--accent-pink);
  box-shadow: 0 0 12px rgba(255, 0, 170, 0.25);
  font-weight: 600;
}

/* --- BLOGGKORT (BENTO-GRID) --- */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.post-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-glow);
  box-shadow: 0 10px 30px -10px rgba(147, 51, 234, 0.2);
}

.post-thumbnail {
  width: 100%;
  height: 170px;
  border-radius: 8px;
  background: #090C12;
  border: 1px solid var(--border-color);
  margin-bottom: 18px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-card h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.post-excerpt {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Geist Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
}

/* --- HOMELAB SIDEBAR WIDGETS --- */
.homelab-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.lab-widget {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 20px;
}

.widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.metric-bar {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 9px 12px;
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  font-family: 'Geist Mono', monospace;
  font-size: 0.8rem;
}

.metric-fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  background: linear-gradient(90deg, rgba(147, 51, 234, 0.35), rgba(255, 0, 170, 0.45));
  border-left: 3px solid var(--accent-pink);
  z-index: 0;
}

.metric-bar span {
  position: relative;
  z-index: 1;
}

.mono-stats {
  font-family: 'Geist Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.mono-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
}

/* --- ENKELTARTIKKEL (SINGLE POST) --- */
.single-article {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 40px;
}

.single-article h1 {
  font-size: 2.4rem;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.entry-content {
  margin-top: 28px;
  font-size: 1.05rem;
}

.entry-content p, .entry-content pre, .entry-content ul {
  margin-bottom: 20px;
}

.entry-content pre {
  background: #07090E;
  border: 1px solid var(--border-color);
  padding: 18px;
  border-radius: 10px;
  overflow-x: auto;
  font-family: 'Geist Mono', monospace;
  font-size: 0.88rem;
}

.site-footer {
  border-top: 1px solid var(--border-color);
  padding: 32px 0;
  text-align: center;
  font-family: 'Geist Mono', monospace;
  font-size: 0.82rem;
  color: var(--text-muted);
}