/* ============================================================
   IT-Sicherheitsportal für KMU – Globales Stylesheet
   Keine externen Abhängigkeiten. Kein JavaScript erforderlich.
   ============================================================ */

/* ---- Custom Properties ---- */
:root {
  --bg-base:        #0a0f0a;
  --bg-card:        #111811;
  --bg-hover:       #162016;
  --bg-nav:         #090d09;

  --green-primary:  #22c55e;
  --green-secondary:#16a34a;
  --green-subtle:   #14532d;
  --green-muted:    #4ade80;

  --text-primary:   #f0fdf4;
  --text-secondary: #86efac;
  --text-muted:     #4ade80;
  --text-dim:       #6b7280;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;

  --sidebar-width: 260px;
  --max-width:  900px;
  --radius:     4px;

  --transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --transition: none;
  }
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro',
               Menlo, Consolas, 'DejaVu Sans Mono', monospace;
  font-size: 1rem;
  line-height: 1.7;
  min-height: 100vh;
}

a {
  color: var(--green-primary);
  text-decoration: none;
  transition: var(--transition);
}

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

a:focus-visible {
  outline: 2px solid var(--green-primary);
  outline-offset: 2px;
  border-radius: 2px;
}

ul, ol {
  list-style: none;
}

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

/* ---- Layout Container ---- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---- Sidebar Navigation ---- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background-color: var(--bg-nav);
  border-right: 1px solid var(--green-subtle);
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
  padding-bottom: var(--space-md);
}

.sidebar__brand {
  padding: var(--space-sm);
  border-bottom: 1px solid var(--green-subtle);
  margin-bottom: var(--space-xs);
  flex-shrink: 0;
}

.sidebar__brand a {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--green-primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-decoration: none;
  display: block;
  text-align: center;
}

.sidebar__brand a img {
  width: 45%;
  display: block;
  margin: 0 auto 0.4rem;
}

.sidebar__brand a:hover {
  color: var(--text-primary);
  text-decoration: none;
}

.sidebar__section {
  padding: 0 var(--space-xs);
  margin-bottom: var(--space-xs);
}

.sidebar__label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-bottom: 0.25rem;
  padding: 0.4rem var(--space-xs) 0;
}

.sidebar__link {
  display: block;
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding: 0.3rem var(--space-xs);
  border-radius: var(--radius);
  text-decoration: none;
  transition: var(--transition);
  border-left: 2px solid transparent;
}

.sidebar__link:hover {
  color: var(--green-primary);
  background-color: var(--bg-hover);
  text-decoration: none;
}

.sidebar__link.active {
  color: var(--text-primary);
  background-color: var(--bg-hover);
  border-left-color: var(--green-primary);
}

.sidebar__divider {
  height: 1px;
  background-color: var(--green-subtle);
  margin: var(--space-xs);
}

/* Mobile nav (CSS-only via details/summary) */
.sidebar__mobile {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background-color: var(--bg-nav);
  border-bottom: 1px solid var(--green-subtle);
}

.sidebar__mobile > summary {
  list-style: none;
  cursor: pointer;
  padding: 0 1.5rem;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--green-primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  user-select: none;
}

.sidebar__mobile > summary::-webkit-details-marker {
  display: none;
}

.sidebar__mobile > summary::after {
  content: '[ Menu ]';
  font-size: 0.72rem;
  color: var(--text-muted);
}

.sidebar__mobile[open] > summary::after {
  content: '[ Schließen ]';
}

.sidebar__mobile__nav {
  padding: var(--space-xs) 1.5rem var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
}

.sidebar__mobile__label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-top: var(--space-xs);
  padding: 0.3rem 0 0.15rem;
  border-top: 1px solid var(--bg-card);
}

.sidebar__mobile__nav a {
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 0.3rem 0;
  text-decoration: none;
  transition: var(--transition);
}

.sidebar__mobile__nav a:hover {
  color: var(--green-primary);
}

@media (max-width: 720px) {
  .sidebar {
    display: none;
  }
  .sidebar__mobile {
    display: block;
  }
  main {
    margin-left: 0 !important;
    padding-top: 48px;
  }
  .footer {
    margin-left: 0;
  }
}

/* ---- Main Content Offset ---- */
main {
  margin-left: var(--sidebar-width);
}

/* ---- Hero ---- */
.hero {
  padding: var(--space-xl) 0 var(--space-lg);
  text-align: center;
  border-bottom: 1px solid var(--green-subtle);
}

.hero__label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin-bottom: var(--space-sm);
}

.hero__title {
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.3;
  margin-bottom: var(--space-sm);
}

.hero__title span {
  color: var(--green-primary);
}

.hero__subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto var(--space-md);
}

.hero__cta {
  display: inline-flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  justify-content: center;
}

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  border: 1px solid transparent;
}

.btn--primary {
  background-color: var(--green-primary);
  color: var(--bg-base);
  border-color: var(--green-primary);
}

.btn--primary:hover {
  background-color: var(--green-secondary);
  border-color: var(--green-secondary);
  color: var(--bg-base);
  text-decoration: none;
}

.btn--outline {
  background-color: transparent;
  color: var(--green-primary);
  border-color: var(--green-subtle);
}

.btn--outline:hover {
  border-color: var(--green-primary);
  color: var(--text-primary);
  text-decoration: none;
}

/* ---- Sections ---- */
.section {
  padding: var(--space-lg) 0;
  border-bottom: 1px solid var(--green-subtle);
}

.section:last-of-type {
  border-bottom: none;
}

.section__header {
  margin-bottom: var(--space-md);
}

.section__title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-left: var(--space-sm);
  border-left: 3px solid var(--green-primary);
  line-height: 1.3;
}

.section__desc {
  margin-top: var(--space-xs);
  color: var(--text-secondary);
  padding-left: var(--space-sm);
  font-size: 0.95rem;
}

/* ---- Cards ---- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-sm);
}

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--green-subtle);
  border-left: 3px solid var(--green-primary);
  border-radius: var(--radius);
  padding: var(--space-sm) var(--space-md) var(--space-sm) var(--space-sm);
  transition: var(--transition);
}

.card:hover {
  background-color: var(--bg-hover);
  border-color: var(--green-secondary);
  border-left-color: var(--green-primary);
}

.card--link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.card--link:hover {
  text-decoration: none;
  color: inherit;
}

.card__tag {
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
  white-space: nowrap;
}

.card__title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--green-primary);
  margin-bottom: var(--space-xs);
}

.card--link:hover .card__title {
  color: var(--text-primary);
}

.card__body {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  overflow-wrap: break-word;
}

.card__footer {
  margin-top: var(--space-xs);
  display: flex;
  gap: var(--space-xs);
  flex-wrap: wrap;
  align-items: center;
}

/* ---- Badges ---- */
.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.5rem;
  border-radius: 2px;
  border: 1px solid transparent;
}

.badge--high {
  background-color: var(--green-primary);
  color: var(--bg-base);
  border-color: var(--green-primary);
}

.badge--medium {
  background-color: transparent;
  color: var(--green-primary);
  border-color: var(--green-primary);
}

.badge--low {
  background-color: transparent;
  color: var(--text-dim);
  border-color: var(--text-dim);
}

/* ---- Accordion (details/summary) ---- */
.accordion {
  border: 1px solid var(--green-subtle);
  border-left: 3px solid var(--green-primary);
  border-radius: var(--radius);
  background-color: var(--bg-card);
  margin-bottom: var(--space-xs);
  overflow: hidden;
}

.accordion summary {
  list-style: none;
  cursor: pointer;
  padding: var(--space-sm);
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  transition: var(--transition);
  user-select: none;
}

.accordion summary::-webkit-details-marker {
  display: none;
}

.accordion summary::before {
  content: '+';
  color: var(--green-primary);
  font-size: 1.1rem;
  font-weight: 700;
  flex-shrink: 0;
  width: 1.2em;
  text-align: center;
}

.accordion[open] summary::before {
  content: '−';
}

.accordion summary:hover {
  color: var(--text-primary);
  background-color: var(--bg-hover);
}

.accordion__body {
  padding: 0 var(--space-sm) var(--space-sm);
  color: var(--text-secondary);
  font-size: 0.95rem;
  border-top: 1px solid var(--green-subtle);
}

.accordion__body p,
.accordion__body ul,
.accordion__body ol {
  margin-top: var(--space-xs);
}

/* ---- Checklists ---- */
.checklist {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.checklist__item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  background-color: var(--bg-card);
  border: 1px solid var(--green-subtle);
  border-radius: var(--radius);
  transition: var(--transition);
  cursor: pointer;
}

.checklist__item:hover {
  background-color: var(--bg-hover);
}

.checklist__item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.1rem;
  height: 1.1rem;
  border: 1px solid var(--green-subtle);
  border-radius: 2px;
  background-color: var(--bg-base);
  flex-shrink: 0;
  margin-top: 0.2rem;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
}

.checklist__item input[type="checkbox"]:checked {
  background-color: var(--green-primary);
  border-color: var(--green-primary);
}

.checklist__item input[type="checkbox"]:checked::before {
  content: '';
  display: block;
  position: absolute;
  left: 3px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: 2px solid var(--bg-base);
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.checklist__item input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--green-primary);
  outline-offset: 2px;
}

.checklist__label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  cursor: pointer;
}

.checklist__item:has(input:checked) .checklist__label {
  color: var(--text-dim);
  text-decoration: line-through;
}

/* ---- Info Boxes ---- */
.infobox {
  background-color: var(--bg-card);
  border: 1px solid var(--green-subtle);
  border-left: 3px solid var(--green-primary);
  border-radius: var(--radius);
  padding: var(--space-sm);
  margin: var(--space-md) 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.infobox--warn {
  border-left-color: #f59e0b;
}

.infobox--warn .infobox__label {
  color: #f59e0b;
}

.infobox__label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--green-primary);
  margin-bottom: var(--space-xs);
}

/* ---- Stat Grid ---- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-sm);
  margin: var(--space-md) 0;
}

.stat {
  background-color: var(--bg-card);
  border: 1px solid var(--green-subtle);
  border-radius: var(--radius);
  padding: var(--space-sm);
  text-align: center;
}

.stat__number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--green-primary);
  line-height: 1.2;
}

.stat__label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: var(--space-xs);
}

/* ---- Content Prose (for detail pages) ---- */
.prose h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-left: var(--space-sm);
  border-left: 3px solid var(--green-primary);
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
  line-height: 1.3;
}

.prose h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--green-primary);
  margin-top: var(--space-md);
  margin-bottom: var(--space-xs);
}

.prose p {
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
  font-size: 0.95rem;
}

.prose ul {
  list-style: none;
  margin-bottom: var(--space-sm);
}

.prose ul li {
  color: var(--text-secondary);
  font-size: 0.95rem;
  padding-left: 1.5rem;
  position: relative;
  margin-bottom: 0.4rem;
}

.prose ul li::before {
  content: '›';
  color: var(--green-primary);
  position: absolute;
  left: 0;
  font-weight: 700;
}

.prose ol {
  list-style: none;
  counter-reset: prose-counter;
  margin-bottom: var(--space-sm);
}

.prose ol li {
  counter-increment: prose-counter;
  color: var(--text-secondary);
  font-size: 0.95rem;
  padding-left: 2rem;
  position: relative;
  margin-bottom: 0.4rem;
}

.prose ol li::before {
  content: counter(prose-counter, decimal-leading-zero);
  color: var(--green-primary);
  position: absolute;
  left: 0;
  font-size: 0.85rem;
  font-weight: 700;
}

/* ---- Page Header (for sub-pages) ---- */
.page-header {
  padding: var(--space-lg) 0 var(--space-md);
  border-bottom: 1px solid var(--green-subtle);
}

.page-header__breadcrumb {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-xs);
}

.page-header__breadcrumb a {
  color: var(--text-dim);
}

.page-header__breadcrumb a:hover {
  color: var(--green-primary);
  text-decoration: none;
}

.page-header__breadcrumb span {
  color: var(--text-muted);
}

.page-header__label {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  margin-bottom: var(--space-xs);
}

.page-header__title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.3;
  margin-bottom: var(--space-xs);
}

.page-header__title span {
  color: var(--green-primary);
}

.page-header__meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  align-items: center;
  margin-top: var(--space-xs);
}

/* ---- Quick-Check ---- */
.quickcheck {
  background-color: var(--bg-card);
  border: 1px solid var(--green-subtle);
  border-left: 3px solid var(--green-primary);
  border-radius: var(--radius);
  padding: var(--space-md);
}

.quickcheck__question {
  font-size: 0.95rem;
  color: var(--text-secondary);
  padding: var(--space-xs) 0;
  border-bottom: 1px solid var(--bg-base);
  display: flex;
  align-items: flex-start;
  gap: var(--space-xs);
}

.quickcheck__question:last-child {
  border-bottom: none;
}

.quickcheck__question input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.1rem;
  height: 1.1rem;
  border: 1px solid var(--green-subtle);
  border-radius: 2px;
  background-color: var(--bg-base);
  flex-shrink: 0;
  margin-top: 0.2rem;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
}

.quickcheck__question input[type="checkbox"]:checked {
  background-color: var(--green-primary);
  border-color: var(--green-primary);
}

.quickcheck__question input[type="checkbox"]:checked::before {
  content: '';
  display: block;
  position: absolute;
  left: 3px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: 2px solid var(--bg-base);
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

/* ---- Footer ---- */
.footer {
  padding: var(--space-md) 0;
  border-top: 1px solid var(--green-subtle);
  margin-top: var(--space-lg);
}

.footer__inner {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.footer {
  margin-left: var(--sidebar-width);
}

.footer .container {
  max-width: none;
  padding: 0 1.5rem;
}

/* ---- Utility ---- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.text-green { color: var(--green-primary); }
.text-muted { color: var(--text-dim); }
.text-secondary { color: var(--text-secondary); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
