/* ============================================================
   iPänz e.V. – Stylesheet
   ============================================================ */

/* === 1. CSS Variables ====================================== */
:root {
  --c-orange:  #e87500;
  --c-pink:    #e2007a;
  --c-cyan:    #0099bb;
  --c-purple:  #7b3fa0;
  --c-green:   #3e9b3e;
  --c-red:     #c0392b;

  --c-text:    #333333;
  --c-muted:   #666666;
  --c-bg:      #f7f7f7;
  --c-white:   #ffffff;
  --c-border:  #dddddd;
  --c-light:   #f0f0f0;

  --accent:    var(--c-orange);   /* overridden per page */

  --radius:    8px;
  --shadow:    0 2px 8px rgba(0,0,0,.10);
  --shadow-md: 0 4px 16px rgba(0,0,0,.12);

  --sidebar-w: 270px;
  --max-w:     1160px;
  --nav-h:     64px;
}

/* === Page-specific accent ================================== */
body.page-die-kinder,
body.page-home        { --accent: var(--c-orange); }
body.page-das-team    { --accent: var(--c-pink);   }
body.page-der-anfang  { --accent: var(--c-cyan);   }
body.page-kontakt,
body.page-impressum,
body.page-datenschutz { --accent: var(--c-purple); }
body.page-kalender    { --accent: var(--c-green);  }
body.page-eltern      { --accent: var(--c-green);  }
body.page-admin       { --accent: #555555;          }
body.page-die-spende  { --accent: var(--c-red);    }


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

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  color: var(--c-text);
  background: var(--c-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img  { max-width: 100%; height: auto; display: block; }
a    { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { padding-left: 1.4rem; }
ul { list-style: disc; }
ol { list-style: decimal; }
p  { margin-bottom: .9rem; }
p:last-child { margin-bottom: 0; }

h1 { font-size: 1.75rem; font-weight: 700; color: var(--accent); margin-bottom: .6rem; line-height: 1.25; }
h2 { font-size: 1.35rem; font-weight: 700; color: var(--accent); margin-bottom: .5rem; }
h3 { font-size: 1.1rem;  font-weight: 700; color: var(--c-text); margin-bottom: .4rem; }
h4 { font-size: 1rem;    font-weight: 700; color: var(--c-text); margin-bottom: .3rem; }
h5 { font-size: .95rem;  font-weight: 700; color: var(--c-text); margin-bottom: .3rem; }

dl     { display: grid; grid-template-columns: auto 1fr; gap: .2rem 1rem; }
dt     { font-weight: 600; color: var(--c-muted); white-space: nowrap; }
dd     { margin: 0; }

hr {
  border: none;
  border-top: 2px solid var(--accent);
  margin: 1.5rem 0;
  opacity: .3;
}

/* === 3. Layout ============================================= */
.site-wrapper {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1rem;
  width: 100%;
}

.site-main {
  flex: 1;
  padding: 2rem 0 3rem;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-w);
  gap: 2rem;
  align-items: start;
}

/* === 4. Top Navigation ===================================== */
.site-header {
  background: var(--c-white);
  border-bottom: 3px solid var(--accent);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
  transition: border-color .3s;
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  height: var(--nav-h);
  gap: 1rem;
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
}

.logo-i    { color: var(--c-orange); }
.logo-p    { color: var(--c-pink);   }
.logo-ae   { color: var(--c-cyan);   }
.logo-nz   { color: var(--c-purple); }
.logo-ev   { font-size: .85rem; font-weight: 400; color: var(--c-muted); display: block; }

.logo-sub {
  font-size: .7rem;
  color: var(--c-muted);
  line-height: 1.2;
  max-width: 160px;
}

/* Nav links */
.main-nav {
  display: flex;
  align-items: center;
  gap: .25rem;
  margin-left: auto;
  list-style: none;
  padding: 0;
}

.main-nav a {
  display: block;
  padding: .5rem .85rem;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 600;
  color: var(--c-muted);
  text-decoration: none;
  transition: background .15s, color .15s;
  white-space: nowrap;
}

.main-nav a:hover { background: var(--c-light); }

.main-nav li.nav-die-kinder   a { color: var(--c-orange); }
.main-nav li.nav-das-team     a { color: var(--c-pink);   }
.main-nav li.nav-der-anfang   a { color: var(--c-cyan);   }
.main-nav li.nav-der-kontakt  a { color: var(--c-purple); }

.main-nav li.nav-die-kinder   a:hover,
.main-nav li.nav-die-kinder   a.active { background: #fff2e0; }
.main-nav li.nav-das-team     a:hover,
.main-nav li.nav-das-team     a.active { background: #ffe0f0; }
.main-nav li.nav-der-anfang   a:hover,
.main-nav li.nav-der-anfang   a.active { background: #ddf5fb; }
.main-nav li.nav-der-kontakt  a:hover,
.main-nav li.nav-der-kontakt  a.active { background: #f0e8f8; }

.main-nav li.nav-login a {
  background: var(--accent);
  color: var(--c-white);
  border-radius: 2rem;
  padding: .4rem 1rem;
}
.main-nav li.nav-login a:hover { opacity: .85; text-decoration: none; }

/* Hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: .4rem;
  margin-left: auto;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--c-text);
  margin: 5px 0;
  transition: .3s;
}

/* === 5. Sidebar ============================================ */
.sidebar { display: flex; flex-direction: column; gap: 1rem; }

.sidebar-block {
  background: var(--c-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.sidebar-block-header {
  background: var(--accent);
  color: var(--c-white);
  padding: .6rem 1rem;
  font-weight: 700;
  font-size: .9rem;
}

.sidebar-block-body {
  padding: .85rem 1rem;
  font-size: .88rem;
  color: var(--c-muted);
  line-height: 1.55;
}

.sidebar-block-body a { color: var(--accent); }

.sidebar-block-body dl { grid-template-columns: auto 1fr; font-size: .88rem; }

/* === 6. Accordion (details/summary) ======================== */
.accordion { display: flex; flex-direction: column; gap: .5rem; }

.accordion details {
  background: var(--c-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border-left: 4px solid var(--c-border);
  transition: border-color .2s;
}

.accordion details[open] {
  border-left-color: var(--accent);
}

.accordion summary {
  list-style: none;
  cursor: pointer;
  padding: 1rem 1.2rem;
  font-weight: 700;
  font-size: 1rem;
  color: var(--c-text);
  display: flex;
  align-items: center;
  gap: .75rem;
  user-select: none;
  transition: background .15s;
}

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

.accordion summary:hover { background: var(--c-light); }

.accordion details[open] summary { color: var(--accent); }

.accordion summary::after {
  content: '›';
  margin-left: auto;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--c-border);
  transition: transform .2s, color .2s;
}

.accordion details[open] summary::after {
  transform: rotate(90deg);
  color: var(--accent);
}

.accordion-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--c-light);
  flex-shrink: 0;
  font-size: 1.1rem;
}

.accordion details[open] .accordion-icon {
  background: var(--accent);
  color: var(--c-white);
}

.accordion-body {
  padding: 0 1.2rem 1.2rem 1.2rem;
  border-top: 1px solid var(--c-border);
  padding-top: 1rem;
}

.accordion-body h4 { margin-top: 1rem; color: var(--accent); }
.accordion-body h5 { margin-top: 1rem; color: var(--c-muted); }
.accordion-body ol, .accordion-body ul { margin-bottom: .9rem; }
.accordion-body li { margin-bottom: .3rem; }
.accordion-body dl { margin-bottom: 1rem; }
.accordion-body dt { padding: .15rem 0; }
.accordion-body dd { padding: .15rem 0; }

/* === 7. Cards (Homepage) =================================== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
}

.card {
  background: var(--c-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  text-decoration: none;
  color: var(--c-text);
  display: flex;
  flex-direction: column;
  gap: .5rem;
  border-top: 4px solid var(--card-color, var(--c-orange));
  transition: box-shadow .2s, transform .2s;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
}

.card-icon { font-size: 2rem; }
.card-title {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--card-color, var(--c-orange));
}

.card-desc { font-size: .88rem; color: var(--c-muted); }

.card-orange { --card-color: var(--c-orange); }
.card-pink   { --card-color: var(--c-pink);   }
.card-cyan   { --card-color: var(--c-cyan);   }
.card-purple { --card-color: var(--c-purple); }
.card-green  { --card-color: var(--c-green);  }

/* === 8. Hero (Homepage) ==================================== */
.hero {
  background: linear-gradient(135deg, #fff8f0 0%, #fce4f0 50%, #e8f7fc 100%);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  margin-bottom: 2rem;
  text-align: center;
  box-shadow: var(--shadow);
}

.hero-logo {
  font-size: 4rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: .5rem;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--c-muted);
  margin-bottom: 1.5rem;
}

.hero-tagline {
  font-size: .95rem;
  color: var(--c-muted);
  max-width: 500px;
  margin: 0 auto 1.5rem;
}

.btn {
  display: inline-block;
  padding: .65rem 1.5rem;
  border-radius: 2rem;
  font-weight: 700;
  font-size: .95rem;
  text-decoration: none;
  transition: opacity .15s, transform .15s;
  cursor: pointer;
  border: none;
}

.btn:hover { opacity: .85; transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: none; }

.btn-primary {
  background: var(--accent);
  color: var(--c-white);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}

.btn-sm { padding: .4rem 1rem; font-size: .85rem; }
.btn-danger { background: var(--c-red); color: var(--c-white); }

/* === 9. Forms ============================================== */
.form-group { margin-bottom: 1.1rem; }

.form-label {
  display: block;
  font-weight: 600;
  font-size: .9rem;
  margin-bottom: .35rem;
  color: var(--c-text);
}

.form-control {
  width: 100%;
  padding: .55rem .85rem;
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  color: var(--c-text);
  background: var(--c-white);
  transition: border-color .15s;
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}

select.form-control { cursor: pointer; }

.form-hint { font-size: .8rem; color: var(--c-muted); margin-top: .25rem; }

/* === 10. Alerts ============================================ */
.alert {
  border-radius: var(--radius);
  padding: .8rem 1rem;
  margin-bottom: 1rem;
  font-size: .9rem;
  display: flex;
  align-items: flex-start;
  gap: .5rem;
}

.alert-success { background: #e8f8e8; color: #256025; border-left: 4px solid var(--c-green); }
.alert-error   { background: #fce8e8; color: #8b0000; border-left: 4px solid var(--c-red);   }
.alert-info    { background: #e8f5fb; color: #005577; border-left: 4px solid var(--c-cyan);  }
.alert-warning { background: #fff8e0; color: #7a5700; border-left: 4px solid #f0b800;        }

/* === 11. Tables ============================================ */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}

th, td {
  padding: .65rem .85rem;
  text-align: left;
  border-bottom: 1px solid var(--c-border);
}

th {
  font-weight: 700;
  background: var(--c-light);
  color: var(--c-muted);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}

tr:hover td { background: var(--c-light); }

/* === 12. Calendar ========================================== */
#calendar-container {
  background: var(--c-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

.fc .fc-toolbar-title { font-size: 1.1rem; font-weight: 700; }
.fc .fc-button-primary { background: var(--accent); border-color: var(--accent); }
.fc .fc-button-primary:hover { opacity: .85; }
.fc .fc-button-primary:not(:disabled).fc-button-active { opacity: .7; }
.fc .fc-daygrid-day-number { color: var(--c-text); font-size: .85rem; }
.fc .fc-col-header-cell-cushion { font-size: .85rem; color: var(--c-muted); }
.fc-event { border-radius: 4px !important; font-size: .8rem; }

/* === 13. Login / Auth pages ================================ */
.auth-wrap {
  max-width: 400px;
  margin: 3rem auto;
  background: var(--c-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.auth-header {
  background: var(--accent);
  color: var(--c-white);
  padding: 1.5rem;
  text-align: center;
}

.auth-header h1 { color: var(--c-white); font-size: 1.3rem; margin: 0; }

.auth-body { padding: 1.5rem; }

/* === 14. Elternbereich / Admin layout ====================== */
.dashboard-tabs {
  display: flex;
  gap: .5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.tab-link {
  padding: .5rem 1.1rem;
  border-radius: 2rem;
  font-size: .9rem;
  font-weight: 600;
  color: var(--c-muted);
  background: var(--c-light);
  text-decoration: none;
  transition: background .15s, color .15s;
}

.tab-link:hover, .tab-link.active {
  background: var(--accent);
  color: var(--c-white);
  text-decoration: none;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.page-header h1 { margin: 0; }

/* === 15. File/Photo Grid =================================== */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.file-card {
  background: var(--c-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.file-card-thumb {
  aspect-ratio: 4/3;
  background: var(--c-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  overflow: hidden;
}

.file-card-thumb img { width: 100%; height: 100%; object-fit: cover; }

.file-card-info {
  padding: .6rem .75rem;
  font-size: .8rem;
  color: var(--c-muted);
}

.file-card-name { font-weight: 600; color: var(--c-text); word-break: break-all; }

.file-list { display: flex; flex-direction: column; gap: .5rem; }

.file-item {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: var(--c-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: .75rem 1rem;
  font-size: .9rem;
}

.file-item-icon { font-size: 1.5rem; flex-shrink: 0; }
.file-item-name { flex: 1; font-weight: 600; word-break: break-word; }
.file-item-meta { font-size: .8rem; color: var(--c-muted); white-space: nowrap; }

/* === 16. Admin specific ==================================== */
.admin-nav {
  background: #2d2d2d;
  color: #ccc;
  padding: 0 1rem;
}

.admin-nav .nav-inner { height: 52px; }

.admin-nav a {
  color: #ccc;
  font-size: .88rem;
  padding: .4rem .75rem;
  border-radius: var(--radius);
  text-decoration: none;
}

.admin-nav a:hover, .admin-nav a.active {
  background: rgba(255,255,255,.12);
  color: #fff;
}

.admin-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  border-radius: 2rem;
  padding: .1rem .5rem;
  vertical-align: middle;
}

/* === 17. Color swatch (admin calendar) ==================== */
.color-swatches { display: flex; gap: .5rem; flex-wrap: wrap; }
.color-swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: border-color .15s;
}
.color-swatch.selected, .color-swatch:hover { border-color: var(--c-text); }

/* === 18. Utility classes =================================== */
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-muted   { color: var(--c-muted); }
.text-accent  { color: var(--accent); }
.text-small   { font-size: .85rem; }
.text-bold    { font-weight: 700; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.hidden { display: none; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.w-full { width: 100%; }

/* === 19. Footer ============================================ */
.site-footer {
  background: #2d2d2d;
  color: #aaa;
  font-size: .85rem;
  padding: 1.5rem 0;
  margin-top: auto;
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links { display: flex; gap: 1.25rem; flex-wrap: wrap; }
.footer-links a { color: #aaa; text-decoration: none; transition: color .15s; }
.footer-links a:hover { color: var(--c-white); }

/* === 20. Responsive ======================================== */
@media (max-width: 900px) {
  .content-grid {
    grid-template-columns: 1fr;
  }
  .sidebar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    order: -1;
  }
}

@media (max-width: 720px) {
  .main-nav {
    display: none;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    top: var(--nav-h);
    left: 0; right: 0;
    background: var(--c-white);
    box-shadow: var(--shadow-md);
    padding: .75rem 1rem;
    gap: .25rem;
  }
  .main-nav.is-open { display: flex; }
  .main-nav a { padding: .65rem 1rem; border-radius: var(--radius); }
  .nav-toggle { display: block; }

  .hero { padding: 2rem 1rem; }
  .hero-logo { font-size: 2.8rem; }

  .cards { grid-template-columns: 1fr 1fr; }

  .file-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }

  .page-header { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  :root { --nav-h: 58px; }
  h1 { font-size: 1.45rem; }
  .cards { grid-template-columns: 1fr; }
  .auth-wrap { margin: 1rem; }
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-links { justify-content: center; }
}

/* === 21. Print ============================================= */
@media print {
  .site-header, .site-footer, .sidebar { display: none; }
  .content-grid { grid-template-columns: 1fr; }
  .accordion details { border: 1px solid #ccc; page-break-inside: avoid; }
  .accordion details[open] { display: block; }
}
