/* ===============================================
   PG Familienseite – angepasstes Intranet-Design
   =============================================== */

/* Farben */
:root {
  --color-light-bg: linear-gradient(to bottom, #e7ece8 0%, #cde2d0 100%);
  --color-dark-bg: linear-gradient(to bottom, #27382e 0%, #1c3a23 100%);
  --color-light-text: #1a1a1a;
  --color-dark-text: #e0e0e0;
  --accent-color: #6a8b6c;
  --footer-bg-light: rgba(240,240,240,0.9);
  --footer-bg-dark: rgba(20,30,25,0.9);
  --card-bg-light: rgba(255,255,255,0.85);
  --card-bg-dark: rgba(25,40,35,0.85);
  --transition: 0.3s;
  --max-width: 900px; /* vorher 1200px */
}

/* ===============================
   Basis Layout
   =============================== */
html, body {
  margin: 0;
  padding: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--color-light-text);
  background: var(--color-light-bg);
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}

/* Wasserzeichen */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 50%;
  width: 400px;
  height: auto;
  max-height: 100%;
  transform: translateX(-50%);
  pointer-events: none;
  background-repeat: no-repeat;
  background-position: center center;
  background-size: contain;
  z-index: -1;
  background-image: url('../images/wappen-light.png');
}

/* Dark Mode */
body.dark-mode {
  color: var(--color-dark-text);
  background: var(--color-dark-bg);
}

body.dark-mode::before {
  background-image: url('../images/wappen-dark.png');
}

/* ===============================
   Header
   =============================== */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background-color: rgba(255,255,255,0.9);
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  transition: background var(--transition);
}

body.dark-mode header {
  background-color: rgba(30,40,35,0.9);
}

.header-left {
  display: flex;
  align-items: center;
}

.header-left .logo {
  width: 50px;
  height: 50px;
  margin-right: 10px;
}

.header-left h1 {
  font-size: 1.8em;
  font-family: 'Georgia', serif;
  letter-spacing: 1px;
  margin: 0;
}

.header-actions .theme-toggle {
  cursor: pointer;
  font-size: 28px;
  display: flex;
  align-items: center;
}

/* ===============================
   Navigation / Tabs
   =============================== */
nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  background-color: rgba(255,255,255,0.9);
  border-bottom: 1px solid #6a8b6c;
  transition: background var(--transition), border-color var(--transition);
}

body.dark-mode nav {
  background-color: rgba(30,40,35,0.9);
  border-color: #9abc8f;
}

nav a {
  padding: 0.8rem 1.2rem;
  text-decoration: none;
  color: inherit;
  font-weight: 500;
  border-bottom: 3px solid transparent;
  transition: background 0.2s, border-color 0.2s;
}

nav a.active {
  border-bottom: 3px solid var(--accent-color);
}

nav a:hover {
  background-color: rgba(0,0,0,0.05);
}

body.dark-mode nav a:hover {
  background-color: rgba(255,255,255,0.1);
}

/* ===============================
   Main Inhalt
   =============================== */
main {
  max-width: var(--max-width);
  margin: 20px auto 60px auto;
  padding: 15px; /* vorher 20px */
  background-color: var(--card-bg-light);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: background var(--transition);
}

body.dark-mode main {
  background-color: var(--card-bg-dark);
}

main h1 {
  margin-top: 0;
}

main p {
  line-height: 1.6;
  font-size: 1rem;
}

/* ===============================
   Karten-Grid
   =============================== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, 180px); /* feste Breite */
  gap: 15px;
  justify-content: start; /* linksbündig */
}

/* ===============================
   Karten
   =============================== */
.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  padding: 15px;
  border-radius: 12px;
  background-color: var(--card-bg-light);
  color: var(--color-light-text);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;

  width: 180px;     /* genau so breit wie die Grid-Spalte */
  max-width: none;  /* entfernt Begrenzung */
  margin: 0;        /* keine automatische Zentrierung */
  box-sizing: border-box; /* Padding wird zur Breite dazu gerechnet */
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.card .icon {
  font-size: 40px;
  margin-bottom: 10px;
}

.card .label {
  text-align: center;
  word-break: break-word;
  width: 100%; /* passt sich der Kartenbreite an */
}

/* Dark Mode für Karten */
body.dark-mode .card {
  background-color: rgba(40,55,45,0.9); /* etwas heller */
  color: var(--color-dark-text);
}


/* ===============================
   Footer
   =============================== */
footer {
  width: 100%;
  text-align: center;
  padding: 6px 0; /* schmaler */
  font-size: 0.9em;
  color: #333;
  background-color: var(--footer-bg-light);
  position: fixed;
  bottom: 0;
  left: 0;
  line-height: 0.8; /* dichter */
}

body.dark-mode footer {
  background-color: var(--footer-bg-dark);
  color: #ccc;
}

/* Stil für den Impressum-Link */
footer a[href="impressum.html"] {
  color: inherit;               /* Gleiche Farbe wie der Text im Footer */
  text-decoration: none;        /* Kein Unterstrich */
  font-weight: normal;          /* Normale Schriftstärke */
  transition: color 0.3s ease;  /* Sanfte Farbänderung beim Hover */
}

/* Hover-Effekt für den Impressum-Link */
footer a[href="impressum.html"]:hover {
  color: #007BFF;               /* Blaue Farbe beim Hover */
}

/* ===============================
   Responsive
   =============================== */
@media (max-width: 700px) {
  nav {
    flex-direction: column;
    align-items: stretch;
  }

  nav a {
    border-bottom: 1px solid #6a8b6c;
  }

  main {
    margin: 80px 10px 80px 10px;
    padding: 15px;
  }
}
