/* ============================================================
   Digital Försvar – style.css
   ============================================================ */

:root {
  --bg:        #0d1117;
  --bg2:       #161b22;
  --bg3:       #1c2128;
  --border:    #30363d;
  --border2:   #21262d;
  --text:      #e6edf3;
  --muted:     #7d8590;
  --accent:    #3fb950;
  --accent2:   #58a6ff;
  --accent3:   #f78166;
  --warn:      #d29922;
  --mono:      'JetBrains Mono', monospace;
  --sans:      'IBM Plex Sans', sans-serif;
  --max-width: 900px;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}

/* Scanline overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent, transparent 2px,
    rgba(0,0,0,.04) 2px, rgba(0,0,0,.04) 4px
  );
  pointer-events: none;
  z-index: 999;
}

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4 {
  font-family: var(--mono);
  letter-spacing: -.02em;
  line-height: 1.25;
}

a { color: var(--accent2); }
a:hover { color: var(--text); }

code, pre {
  font-family: var(--mono);
  font-size: .85em;
}

/* ── NAV ── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13,17,23,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 56px;
}

.nav-logo {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: .5rem;
  letter-spacing: -.01em;
  white-space: nowrap;
}

.nav-logo::before {
  content: '>';
  color: var(--muted);
  animation: blink 1.2s step-end infinite;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin-left: auto;
}

.nav-links a {
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s;
  letter-spacing: .03em;
}

.nav-links a:hover,
.nav-links a.active { color: var(--text); }

/* Hamburger (mobile) */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  margin-left: auto;
  padding: .25rem;
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--muted);
  transition: transform .2s, opacity .2s;
}

/* ── MOBILE NAV ── */
@media (max-width: 640px) {
  .nav-toggle { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: 56px;
    left: 0; right: 0;
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    gap: 0;
    margin-left: 0;
    padding: .5rem 0;
  }

  .nav-links.open { display: flex; }

  .nav-links li a {
    display: block;
    padding: .75rem 2rem;
    font-size: .85rem;
    border-bottom: 1px solid var(--border2);
  }

  .nav-links li:last-child a { border-bottom: none; }
}

/* ── PAGE WRAPPER ── */
.page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 2rem 6rem;
}

/* ── HERO ── */
.hero {
  border-bottom: 1px solid var(--border);
  padding: 5rem 2rem 4rem;
  max-width: var(--max-width);
  margin: 0 auto;
  animation: fadeUp .5s ease both;
}

.hero-tag {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--accent);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.hero-tag::before {
  content: '';
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--accent);
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  margin-bottom: 1.25rem;
}

.hero h1 span { color: var(--accent); }

.hero-desc {
  font-size: 1rem;
  color: var(--muted);
  max-width: 560px;
  line-height: 1.7;
  margin-bottom: 2rem;
}

.hero-meta {
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--muted);
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.hero-meta span { display: flex; align-items: center; gap: .4rem; }
.hero-meta .dot { color: var(--accent); }

/* ── SECTION LABEL ── */
.section-label {
  font-family: var(--mono);
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border2);
}

/* ── GUIDE CARDS ── */
.guides {
  display: grid;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 3rem;
  animation: fadeUp .5s .1s ease both;
}

.guide-card {
  background: var(--bg2);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: background .12s;
}

.guide-card:hover { background: var(--bg3); }

.guide-card.coming-soon {
  opacity: .5;
  cursor: default;
  pointer-events: none;
}

.guide-num {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--muted);
  min-width: 24px;
  padding-top: .15rem;
  user-select: none;
}

.guide-body { flex: 1; }

.guide-title {
  font-family: var(--mono);
  font-size: .95rem;
  font-weight: 600;
  color: var(--accent2);
  margin-bottom: .3rem;
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
}

.guide-card:hover .guide-title { color: var(--text); }

.guide-desc {
  font-size: .85rem;
  color: var(--muted);
  line-height: 1.55;
}

.guide-arrow {
  font-family: var(--mono);
  color: #555e6a;
  font-size: 1rem;
  padding-top: .1rem;
  transition: color .12s, transform .12s;
}

.guide-card:hover .guide-arrow {
  color: var(--accent);
  transform: translateX(3px);
}

.guide-sub {
  background: var(--bg);
  border-left: 3px solid var(--border2);
}

/* ── BADGES ── */
.badge {
  font-size: .6rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: .15rem .45rem;
  border-radius: 2px;
  font-weight: 500;
  white-space: nowrap;
}

.badge-new  { background: rgba(63,185,80,.15);  color: var(--accent);  border: 1px solid rgba(63,185,80,.3); }
.badge-soon { background: rgba(210,153,34,.1);  color: var(--warn);    border: 1px solid rgba(210,153,34,.3); }
.badge-sub  { background: rgba(88,166,255,.1);  color: var(--accent2); border: 1px solid rgba(88,166,255,.25); }

/* ── REF GRID ── */
.ref-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 3rem;
  animation: fadeUp .5s .2s ease both;
}

.ref-card {
  background: var(--bg2);
  padding: 1.25rem 1.5rem;
  text-decoration: none;
  color: inherit;
  transition: background .12s;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

.ref-card:hover { background: var(--bg3); }
.ref-card.coming-soon { opacity: .5; pointer-events: none; }

.ref-icon { font-size: 1rem; margin-bottom: .2rem; }

.ref-title {
  font-family: var(--mono);
  font-size: .88rem;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.ref-desc {
  font-size: .8rem;
  color: var(--muted);
  line-height: 1.5;
}

/* ── TERMINAL BLOCK ── */
.terminal {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 3rem;
  animation: fadeUp .5s .3s ease both;
}

.terminal-bar {
  background: var(--bg3);
  border-bottom: 1px solid var(--border);
  padding: .5rem 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.terminal-dot { width: 10px; height: 10px; border-radius: 50%; }
.td-red    { background: #ff5f56; }
.td-yellow { background: #ffbd2e; }
.td-green  { background: #27c93f; }

.terminal-title {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--muted);
  margin-left: .5rem;
}

.terminal-body {
  padding: 1.25rem 1.5rem;
  font-family: var(--mono);
  font-size: .82rem;
  line-height: 1.8;
}

.t-prompt { color: var(--accent); }
.t-cmd    { color: var(--text); }
.t-out    { color: var(--muted); }
.t-link   { color: var(--accent2); }
.t-warn   { color: var(--warn); }

/* ── GUIDE PAGE (mall) ── */
.guide-page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 2rem 6rem;
  animation: fadeUp .4s ease both;
}

.guide-page-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 2rem;
  margin-bottom: 2.5rem;
}

.guide-page-tag {
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--muted);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: .75rem;
}

.guide-page-tag a {
  color: var(--muted);
  text-decoration: none;
}

.guide-page-tag a:hover { color: var(--accent); }
.guide-page-tag .sep { margin: 0 .4rem; }

.guide-page h1 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  margin-bottom: .75rem;
}

.guide-page h1 span { color: var(--accent); }

.guide-page-meta {
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--muted);
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

/* Guide content */
.guide-content { max-width: 720px; }

.guide-content h2 {
  font-size: 1.1rem;
  color: var(--text);
  margin: 2.5rem 0 1rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border2);
  display: flex;
  align-items: center;
  gap: .6rem;
}

.guide-content h2::before {
  content: '##';
  color: var(--muted);
  font-size: .75rem;
}

.guide-content h3 {
  font-size: .95rem;
  color: var(--accent2);
  margin: 1.75rem 0 .6rem;
}

.guide-content p {
  color: var(--muted);
  margin-bottom: 1rem;
  line-height: 1.75;
}

.guide-content strong { color: var(--text); font-weight: 600; }

.guide-content ol,
.guide-content ul {
  margin: 0 0 1.25rem 1.25rem;
  color: var(--muted);
  line-height: 1.8;
}

.guide-content li { margin-bottom: .2rem; }

/* Callout boxes */
.callout {
  border-left: 3px solid;
  padding: .75rem 1rem;
  margin: 1.25rem 0;
  border-radius: 0 4px 4px 0;
  font-size: .875rem;
}

.callout-tip   { border-color: var(--accent);  background: rgba(63,185,80,.07);  color: var(--accent); }
.callout-warn  { border-color: var(--warn);    background: rgba(210,153,34,.07); color: var(--warn); }
.callout-info  { border-color: var(--accent2); background: rgba(88,166,255,.07); color: var(--accent2); }
.callout-title { font-family: var(--mono); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: .3rem; }
.callout p     { color: inherit; margin: 0; line-height: 1.6; }

/* Step counter */
.steps { counter-reset: step; list-style: none; margin: 0 0 1.5rem; padding: 0; }

.steps li {
  counter-increment: step;
  padding: .6rem 0 .6rem 2.5rem;
  position: relative;
  color: var(--muted);
  border-bottom: 1px solid var(--border2);
  line-height: 1.65;
}

.steps li:last-child { border-bottom: none; }

.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: .65rem;
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--accent);
}

/* Inline code */
.guide-content code {
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: .1rem .4rem;
  border-radius: 3px;
  color: var(--accent3);
}

/* Table */
.guide-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: .85rem;
}

.guide-content th {
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: .5rem .75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.guide-content td {
  padding: .65rem .75rem;
  border-bottom: 1px solid var(--border2);
  color: var(--muted);
  vertical-align: top;
}

.guide-content tr:hover td { background: var(--bg2); }

/* Checklist */
.checklist { list-style: none; margin: 0 0 1.5rem; padding: 0; }

.checklist li {
  padding: .4rem 0 .4rem 1.75rem;
  position: relative;
  color: var(--muted);
  border-bottom: 1px solid var(--border2);
  font-size: .875rem;
}

.checklist li:last-child { border-bottom: none; }

.checklist li::before {
  content: '☐';
  position: absolute;
  left: 0;
  font-family: var(--mono);
  color: #555e6a;
}

/* ── FOOTER ── */
footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  font-family: var(--mono);
  font-size: .72rem;
  color: var(--muted);
  line-height: 2;
}

footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--accent); }

/* ── ANIMATIONS ── */
@keyframes blink {
  0%,100% { opacity: 1; }
  50%      { opacity: 0; }
}

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

/* ── RESPONSIVE ── */
@media (max-width: 640px) {
  .hero { padding: 3rem 1rem 2.5rem; }
  .page,
  .guide-page { padding: 2rem 1rem 4rem; }
  .guide-card { padding: 1rem 1.1rem; }
  .guide-page-meta { gap: 1rem; }
  .hero-meta { gap: 1rem; }
}

/* ── SIDEBAR LAYOUT ── */
.topbar {
  display: none;
}

.site-wrapper {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 280px;
  min-width: 280px;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 1.25rem 1.25rem .75rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-nav {
  padding: 1rem 0;
  overflow-y: auto;
  flex: 1;
}

.sidebar-section {
  font-family: var(--mono);
  font-size: .6rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 1rem 1.25rem .4rem;
}

.sidebar-nav ul {
  list-style: none;
  padding: 0;
  margin: 0 0 .5rem;
}

.sidebar-nav ul li a {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem 1.25rem;
  font-family: var(--mono);
  font-size: .78rem;
  color: var(--muted);
  text-decoration: none;
  transition: background .1s, color .1s;
  line-height: 1.4;
}

.sidebar-nav ul li a:hover {
  background: var(--bg3);
  color: var(--text);
}

.sidebar-nav ul li.sidebar-coming a {
  opacity: .5;
  pointer-events: none;
}

.sidebar-num {
  font-size: .65rem;
  color: #555e6a;
  min-width: 18px;
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
}

.sidebar-footer a {
  font-family: var(--mono);
  font-size: .75rem;
  color: var(--muted);
  text-decoration: none;
}

.sidebar-footer a:hover { color: var(--accent); }

.site-content {
  flex: 1;
  min-width: 0;
  overflow-x: hidden;
}


/* ── MOBILE SIDEBAR ── */
@media (max-width: 768px) {
  .topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    height: 52px;
    background: rgba(13,17,23,.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 200;
  }

  .site-wrapper {
    display: block;
  }

  .sidebar {
    position: fixed;
    top: 52px;
    left: -280px;
    height: calc(100vh - 52px);
    z-index: 150;
    transition: left .25s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,.4);
  }

  .sidebar.open {
    left: 0;
  }

  .sidebar-logo {
    display: none;
  }

  .site-content {
    width: 100%;
  }
}


.sidebar-nav {
  display: flex;
  flex-direction: column;
}

.dotted-term {
    text-decoration: underline dotted #00ff00; /* Grön prickad linje som matchar ditt index */
    cursor: help;
    position: relative;
}

/* Note */
.dotted-term:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: #fff;
    padding: 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    white-space: nowrap;
    z-index: 10;
    border: 1px solid #00ff00;
}