/* ============================================================
   Schule Theme – Mobile First
   ============================================================ */

/* 1. Custom Properties
============================================================ */
:root {
  --primary:       #1e7d5f;
  --primary-dark:  #145a43;
  --primary-light: #eaf6f1;
  --accent:        #e07b39;
  --text:          #1c2b24;
  --text-muted:    #5a7066;
  --bg:            #ffffff;
  --bg-alt:        #f5fbf8;
  --border:        #cce5d8;
  --shadow-sm:     0 1px 4px rgba(30, 125, 95, 0.10);
  --shadow:        0 2px 12px rgba(30, 125, 95, 0.12);
  --radius:        8px;
  --max-w:         860px;
  --font:          -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, sans-serif;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font);
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--primary); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--primary-dark); }

/* 3. Admin Bar
============================================================ */
.admin-bar {
  background: #2c3e35;
  color: rgba(255,255,255,0.7);
  padding: 0.35rem 1.25rem;
  font-size: 0.8rem;
  text-align: right;
}
.admin-bar a { color: #a8e6cf; text-decoration: none; }
.admin-bar a:hover { color: #fff; }

/* 4. Header & Navigation
============================================================ */
.site-header {
  background: var(--primary);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  flex-wrap: wrap;
  gap: 0;
}

/* Logo */
.site-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.01em;
  padding: 1rem 0;
  flex-shrink: 0;
  z-index: 2;
}
.site-logo:hover { color: rgba(255,255,255,0.82); }
.site-logo img { height: 36px; width: auto; }

/* Hamburger – pure CSS checkbox trick */
.nav-toggle-input { display: none; }

.nav-toggle-label {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  padding: 10px 4px;
  z-index: 2;
}
.nav-toggle-label span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.15s ease;
  transform-origin: center;
}
.nav-toggle-input:checked ~ .nav-toggle-label span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle-input:checked ~ .nav-toggle-label span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle-input:checked ~ .nav-toggle-label span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav – hidden by default */
.site-nav {
  display: none;
  width: 100%;
  border-top: 1px solid rgba(255,255,255,0.15);
  padding: 0.4rem 0 0.75rem;
}
.nav-toggle-input:checked ~ .site-nav { display: block; }

.site-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
}
.site-nav ul li a {
  display: block;
  padding: 0.55rem 0;
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  transition: color 0.15s;
}
.site-nav ul li a:hover { color: #fff; }
.site-nav ul li.active > a,
.site-nav ul li.active-parent > a { color: #fff; font-weight: 700; }

/* Desktop nav */
@media (min-width: 680px) {
  .nav-toggle-label { display: none; }

  .site-nav {
    display: flex !important;
    width: auto;
    border-top: none;
    padding: 0;
    align-items: stretch;
  }

  .site-nav ul {
    flex-direction: row;
    align-items: stretch;
    height: 60px;
  }

  .site-nav ul li {
    display: flex;
    align-items: stretch;
  }

  .site-nav ul li a {
    display: flex;
    align-items: center;
    padding: 0 1rem;
    height: 60px;
    border-bottom: 3px solid transparent;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.15s, border-color 0.15s;
  }

  .site-nav ul li a:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
  }

  .site-nav ul li.active > a {
    border-bottom-color: rgba(255,255,255,0.8);
    font-weight: 700;
    color: #fff;
  }
}

/* 5. Main & Container
============================================================ */
.site-main {
  min-height: calc(100vh - 60px - 180px);
  padding: 2rem 1.25rem 3rem;
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
}

/* 6. Breadcrumb
============================================================ */
.breadcrumb { margin-bottom: 1.75rem; }

.breadcrumb-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.breadcrumb-list li { display: flex; align-items: center; }
.breadcrumb-list li + li::before { content: '›'; margin-right: 0.25rem; color: var(--border); }
.breadcrumb-list a { color: var(--text-muted); text-decoration: none; }
.breadcrumb-list a:hover { color: var(--primary); text-decoration: underline; }
.breadcrumb-list span { color: var(--text); }

/* 7. Content / Article
============================================================ */
.content h1 {
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 1.25rem;
}
.content h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-dark);
  margin-top: 2.75rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--border);
}
.content h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-top: 1.75rem;
  margin-bottom: 0.5rem;
}
.content h4, .content h5, .content h6 {
  font-weight: 700;
  margin-top: 1.25rem;
  margin-bottom: 0.4rem;
}
.content p { margin-bottom: 1.1rem; }
.content ul, .content ol { margin: 0 0 1.1rem 1.5rem; }
.content li { margin-bottom: 0.3rem; }
.content strong { font-weight: 700; }
.content em { font-style: italic; }

.content hr {
  border: none;
  border-top: 2px solid var(--border);
  margin: 2.5rem 0;
}

.content a { color: var(--primary); }
.content a:hover { color: var(--primary-dark); }

.content blockquote {
  border-left: 4px solid var(--primary);
  margin: 1.75rem 0;
  padding: 0.75rem 1.25rem;
  background: var(--primary-light);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text-muted);
}

.content code {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-size: 0.875em;
  font-family: 'SF Mono', 'Fira Code', Consolas, monospace;
}
.content pre {
  background: #1c2b24;
  color: #a8e6cf;
  padding: 1.25rem;
  border-radius: var(--radius);
  overflow-x: auto;
  margin-bottom: 1.5rem;
}
.content pre code { background: none; border: none; padding: 0; color: inherit; font-size: 0.9em; }

.content img {
  border-radius: var(--radius);
  margin: 1.5rem 0;
  box-shadow: var(--shadow-sm);
}

/* Tables */
.content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.75rem;
  font-size: 0.95rem;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.content th {
  background: var(--primary);
  color: #fff;
  text-align: left;
  padding: 0.65rem 1rem;
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
}
.content td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.content tr:last-child td { border-bottom: none; }
.content tr:nth-child(even) td { background: var(--bg-alt); }

/* 8. Homepage Extras
============================================================ */
.site-home .content h1 {
  font-size: 2.1rem;
  color: var(--primary-dark);
}

/* Subtitle – erste Zeile nach H1 */
.site-home .content > p:first-of-type {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* CTA-Buttons: zwei Links in einem Absatz */
.site-home .content > p > a {
  display: inline-block;
  padding: 0.55rem 1.3rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  margin: 0.3rem 0.4rem 0.3rem 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.site-home .content > p > a:first-of-type {
  background: var(--primary);
  color: #fff;
}
.site-home .content > p > a:first-of-type:hover { background: var(--primary-dark); }
.site-home .content > p > a:last-of-type {
  background: #fff;
  color: var(--primary);
  border: 2px solid var(--primary);
}
.site-home .content > p > a:last-of-type:hover { background: var(--primary-light); }

/* Feature-Blöcke: Absätze die mit einem Strong beginnen */
.site-home .content p:has(> strong:first-child) {
  background: var(--bg-alt);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0.85rem 1.1rem;
  margin-bottom: 0.75rem;
}

/* Aktuelles-Karte: H2 nach hr gefolgt von Bold+Text */
.site-home .content h2 + p strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

/* Zahlen & Fakten letzte Zeile */
.site-home .content > p:last-child {
  font-size: 0.9rem;
  color: var(--text-muted);
  background: var(--bg-alt);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

/* 9. Flat Nav (Ordner-Indexseiten)
============================================================ */
.flat-nav { margin-top: 2rem; display: flex; flex-wrap: wrap; gap: 0.75rem; }

.flat-nav-item {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--primary-light);
  color: var(--primary);
  text-decoration: none;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  transition: background 0.15s, color 0.15s;
}
.flat-nav-item:hover { background: var(--primary); color: #fff; }

/* 10. Page Navigation (Vor/Zurück)
============================================================ */
.page-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--border);
  flex-wrap: wrap;
}

.page-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--primary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.page-nav a:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.page-nav-next { margin-left: auto; }

/* 11. Post List
============================================================ */
.post-list { list-style: none; margin-top: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }

.post-item {
  padding: 1rem 1.25rem;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.post-item a { font-weight: 600; text-decoration: none; font-size: 1.05rem; }
.post-item a:hover { text-decoration: underline; }
.post-item p { font-size: 0.9rem; color: var(--text-muted); margin-top: 0.25rem; margin-bottom: 0; }

/* 12. Footer
============================================================ */
.site-footer {
  background: var(--primary-dark);
  color: rgba(255,255,255,0.75);
  padding: 2.5rem 1.25rem 0;
  margin-top: 2rem;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding-bottom: 2rem;
}
.footer-inner strong { color: #fff; font-size: 1rem; display: block; margin-bottom: 0.3rem; }
.footer-inner p { font-size: 0.88rem; margin-bottom: 0.3rem; }
.footer-inner a { color: rgba(255,255,255,0.6); }
.footer-inner a:hover { color: #fff; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 1rem 0 1.25rem;
}
.footer-bottom-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
}
.footer-bottom nav { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.footer-bottom nav a { color: rgba(255,255,255,0.4); text-decoration: none; transition: color 0.15s; }
.footer-bottom nav a:hover { color: rgba(255,255,255,0.8); }

/* 13. 404-Seite
============================================================ */
.page-404 {
  text-align: center;
  padding: 5rem 1rem;
}
.page-404 .error-code {
  font-size: 6rem;
  font-weight: 900;
  color: var(--border);
  line-height: 1;
  margin-bottom: 0.5rem;
}
.page-404 h1 {
  font-size: 1.75rem;
  color: var(--text);
  margin-bottom: 0.75rem;
}
.page-404 p {
  color: var(--text-muted);
  margin-bottom: 2rem;
}
.page-404 a {
  display: inline-block;
  padding: 0.65rem 1.75rem;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  transition: background 0.15s;
}
.page-404 a:hover { background: var(--primary-dark); color: #fff; }

/* 14. Responsive Adjustments
============================================================ */
@media (min-width: 600px) {
  .content h1 { font-size: 2.25rem; }
  .site-home .content h1 { font-size: 2.6rem; }
  .site-main { padding: 2.5rem 1.5rem 4rem; }
}

@media (min-width: 860px) {
  .site-main { padding: 3rem 0 4rem; }
}
