/* Professional CSS Template für fackis.de */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Skip-Link: nur sichtbar beim Fokus (Tastatur) */
.skip-link {
  position: absolute;
  top: -4rem;
  left: 1rem;
  z-index: 100;
  padding: 0.75rem 1.25rem;
  background: var(--color-accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  border-radius: 4px;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 1rem;
  outline: 3px solid #fff;
  outline-offset: 2px;
}

:root {
  --color-primary: #2c3e50;
  --color-secondary: #34495e;
  --color-accent: #3498db;
  --color-text: #333333;
  --color-text-light: #666666;
  --color-border: #e0e0e0;
  --color-bg: #ffffff;
  --color-bg-light: #f8f9fa;
  --font-primary: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-size-base: 16px;
  --line-height-base: 1.6;
  --spacing-unit: 1rem;
  --max-width: 1000px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  padding: 0;
  margin: 0;
}

::selection {
  background-color: var(--color-accent);
  color: #fff;
}

/* Fokus sichtbar für Tastatur, dezent bei Maus */
:focus {
  outline: none;
}
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Container */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-unit);
}

/* Sticky Header + Nav (Wrapper) */
.sticky-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.3s ease;
}

.sticky-header.scrolled {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Header */
.sticky-header header {
  position: relative;
  background-color: transparent;
  padding: 2rem 0;
  margin-bottom: 0;
  transition: padding 0.3s ease;
}

.sticky-header.scrolled header {
  padding: 0.5rem 0;
}

header .container {
  text-align: center;
}

header a {
  display: inline-block;
  text-decoration: none;
}

.sticky-header header img {
  max-width: 250px;
  height: auto;
  display: block;
  transition: max-width 0.3s ease;
}

.sticky-header.scrolled header img {
  max-width: 120px;
}

/* Dezente Datum/Uhrzeit oben rechts im Header */
.header-datetime {
  position: absolute;
  top: 0.5rem;
  right: 1rem;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.65);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .header-datetime {
    font-size: 0.65rem;
    right: 0.5rem;
  }
}

/* Navigation */
.sticky-header nav {
  background-color: transparent;
  padding: 0;
  margin-bottom: 2rem;
}

nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0;
  margin: 0;
  padding: 0;
}

nav li {
  margin: 0;
}

nav a {
  position: relative;
  display: block;
  padding: 1rem 2rem;
  color: #ffffff;
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.3s ease, color 0.2s ease;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

/* Animierte Unterstreichung (reines CSS) */
nav a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.9);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.3s ease;
}

nav a:hover::after,
nav a:focus-visible::after {
  transform: scaleX(1);
  transform-origin: left;
}

nav li:last-child a {
  border-right: none;
}

/* Hover: Akzentfarbe als Hintergrund – weißer Text bleibt gut lesbar */
nav a:hover,
nav a:focus-visible {
  background-color: var(--color-accent);
  color: #ffffff;
  text-decoration: none;
}

/* Main Content */
main {
  padding: 0 0 3rem;
}

main .container {
  padding-top: 1rem;
}

h1 {
  font-size: 2rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 3px solid var(--color-accent);
}

/* Article grid (index: 3 pro Zeile) */
.article-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.article-grid article {
  flex: 0 1 calc((100% - 3rem) / 3); /* 3 Spalten, 2 Lücken à 1.5rem */
  min-width: 260px;
}

/* Articles */
article {
  background-color: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 2rem;
  margin-bottom: 2rem;
  transition: box-shadow 0.3s ease, transform 0.2s ease;
}

.article-grid article {
  margin-bottom: 0;
}

article:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

article:last-of-type {
  margin-bottom: 0;
}

.meta {
  font-size: 0.875rem;
  color: var(--color-text-light);
  margin-bottom: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

article h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 1rem;
  line-height: 1.3;
}

article h2 a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

article h2 a:hover {
  color: var(--color-accent);
  text-decoration: none;
}

article p {
  margin-bottom: 1rem;
  line-height: 1.7;
}

article p:last-of-type {
  margin-bottom: 1.5rem;
}

article img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5rem 0;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

article a img {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

article a:hover img {
  transform: scale(1.02);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.read-more {
  display: inline-block;
  margin-top: 1rem;
  color: var(--color-accent);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

.read-more:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

.read-more::after {
  content: " →";
  transition: transform 0.2s ease;
  display: inline-block;
}

.read-more:hover::after {
  transform: translateX(4px);
}

/* Weniger Bewegung bei Nutzer-Präferenz */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
}

/* Footer */
footer {
  background-color: var(--color-bg-light);
  border-top: 2px solid var(--color-border);
  padding: 2rem 0;
  margin-top: 4rem;
}

footer .container {
  text-align: center;
}

footer nav {
  background-color: transparent;
  margin-bottom: 0;
}

footer nav ul {
  justify-content: center;
}

footer nav a {
  color: var(--color-text-light);
  padding: 0.5rem 1rem;
  border-right: 1px solid var(--color-border);
}

footer nav a:hover {
  color: var(--color-accent);
  background-color: transparent;
}

footer nav li:last-child a {
  border-right: none;
}

/* Dezenter Hinweis: vibegecoded */
.vibegecoded {
  margin-top: 1rem;
  font-size: 0.7rem;
  color: var(--color-text-light);
  opacity: 0.75;
}

/* Detail Page Styles */
.detail-page h1 {
  font-size: 2.25rem;
  margin-bottom: 1rem;
}

.detail-page .meta {
  margin-bottom: 1.5rem;
}

.detail-page .content {
  font-size: 1.0625rem;
}

.detail-page .content h2 {
  font-size: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--color-primary);
}

.detail-page .content h3 {
  font-size: 1.25rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--color-secondary);
}

.detail-page .content p {
  margin-bottom: 1.25rem;
}

.detail-page .content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 2rem 0;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.back-link {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}

.back-link a {
  display: inline-flex;
  align-items: center;
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.back-link a:hover {
  color: var(--color-primary);
  text-decoration: none;
}

.back-link a::before {
  content: "← ";
  margin-right: 0.5rem;
  transition: transform 0.2s ease;
}

.back-link a:hover::before {
  transform: translateX(-4px);
}

/* Links */
a {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

/* Responsive Design */
/* Artikel-Grid: ab ~900px 2 Spalten, ab ~600px 1 Spalte */
@media (max-width: 900px) {
  .article-grid article {
    flex: 0 1 calc((100% - 1.5rem) / 2);
    min-width: 220px;
  }
}

@media (max-width: 600px) {
  .article-grid article {
    flex: 1 1 100%;
    min-width: 0;
  }
}

@media (max-width: 768px) {
  :root {
    --font-size-base: 15px;
    --spacing-unit: 0.75rem;
  }

  header {
    padding: 1.5rem 0;
  }

  header img {
    max-width: 200px;
  }

  nav ul {
    flex-direction: column;
  }

  nav a {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.875rem 1.5rem;
  }

  nav li:last-child a {
    border-bottom: none;
  }

  h1 {
    font-size: 1.75rem;
  }

  article {
    padding: 1.5rem;
  }

  article h2 {
    font-size: 1.25rem;
  }

  .detail-page h1 {
    font-size: 1.875rem;
  }
}

@media (max-width: 480px) {
  header img {
    max-width: 150px;
  }

  article {
    padding: 1rem;
  }

  h1 {
    font-size: 1.5rem;
  }
}

/* Print Styles */
@media print {
  nav,
  footer,
  .header-datetime {
    display: none;
  }

  article {
    page-break-inside: avoid;
    border: none;
    padding: 0;
  }
}
