/* ══════════════════════════════════════════════
   KALENDER – Schulkalender Jahnschule
   Inline-Sektion + Navbar-Dropdown
══════════════════════════════════════════════ */

/* ── Sektion ─────────────────────────────────── */
.kalender-section {
  background: linear-gradient(135deg, #f0f4ff 0%, #fff8e7 100%);
  position: relative;
  overflow: hidden;
}
.kalender-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 10% 80%, rgba(43,91,168,0.08) 0%, transparent 55%),
    radial-gradient(ellipse at 90% 20%, rgba(245,200,66,0.12) 0%, transparent 55%);
  pointer-events: none;
}

/* ── Widget-Wrapper ──────────────────────────── */
.cal-widget {
  background: #fff;
  border-radius: 24px;
  box-shadow:
    0 2px 0 3px #1A3282,
    0 8px 40px rgba(26,50,130,0.12);
  overflow: hidden;
  max-width: 900px;
  margin: 0 auto;
}

/* ── Header ──────────────────────────────────── */
.cal-widget__header {
  background: linear-gradient(135deg, #1A3282 0%, #2B5BA8 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  gap: 1rem;
}
.cal-widget__title {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}
.cal-widget__nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.cal-nav-btn {
  background: rgba(255,255,255,0.15);
  border: none;
  border-radius: 10px;
  color: #fff;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}
.cal-nav-btn:hover { background: rgba(255,255,255,0.28); }
.cal-widget__month-label {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  min-width: 160px;
  text-align: center;
}

/* Google Calendar Badge */
.cal-widget__gcal-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255,255,255,0.12);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  white-space: nowrap;
}
.cal-widget__gcal-badge svg { flex-shrink: 0; }

/* ── Grid ────────────────────────────────────── */
.cal-widget__body {
  padding: 1.25rem 1.5rem 1.5rem;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-grid__weekday {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
  padding: 0.5rem 0.25rem;
}
.cal-day {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 6px;
  border-radius: 12px;
  cursor: default;
  transition: background 0.15s;
  min-height: 48px;
}
.cal-day--other-month { opacity: 0.3; }
.cal-day--today {
  background: linear-gradient(135deg, #1A3282 0%, #2B5BA8 100%);
  color: #fff;
}
.cal-day--today .cal-day__num { color: #fff; font-weight: 800; }
.cal-day--has-event { cursor: pointer; }
.cal-day--has-event:not(.cal-day--today):hover { background: #f0f4ff; }
.cal-day__num {
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  color: #1e293b;
  line-height: 1;
}
.cal-day--weekend:not(.cal-day--today) .cal-day__num { color: #94a3b8; }

/* Event dots */
.cal-day__dots {
  display: flex;
  gap: 3px;
  margin-top: 4px;
  flex-wrap: wrap;
  justify-content: center;
}
.cal-day__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Event List ──────────────────────────────── */
.cal-events {
  margin-top: 1.25rem;
  border-top: 2px solid #f1f5f9;
  padding-top: 1.25rem;
}
.cal-events__title {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  color: #1e293b;
  margin-bottom: 0.75rem;
}
.cal-events__list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.cal-event-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.9rem;
  border-radius: 12px;
  background: #f8fafc;
  border-left: 4px solid;
  cursor: default;
  transition: transform 0.15s, box-shadow 0.15s;
}
.cal-event-item:hover {
  transform: translateX(3px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}
.cal-event-item__date {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 0.8rem;
  color: #64748b;
  min-width: 48px;
}
.cal-event-item__name {
  font-weight: 600;
  font-size: 0.88rem;
  color: #1e293b;
  flex: 1;
}
.cal-event-item__cat {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}

/* Kategorie-Farben */
.cat--ferien    { background:#fef3c7; color:#92400e; border-color:#F5C842; }
.cat--event     { background:#dbeafe; color:#1e40af; border-color:#2B5BA8; }
.cat--eltern    { background:#dcfce7; color:#166534; border-color:#22A855; }
.cat--schule    { background:#fce7f3; color:#9d174d; border-color:#D12830; }

.cal-events__empty {
  color: #94a3b8;
  font-size: 0.875rem;
  text-align: center;
  padding: 1rem;
}

/* ── Navbar Kalender-Button ──────────────────── */
.navbar__cal-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 10px;
  color: var(--blue);
  display: flex;
  align-items: center;
  transition: background 0.2s, color 0.2s;
  position: relative;
}
.navbar__cal-btn:hover {
  background: rgba(26,50,130,0.08);
}
.navbar.scrolled .navbar__cal-btn { color: var(--blue); }

/* Tooltip */
.navbar__cal-btn::after {
  content: 'Kalender';
  position: absolute;
  bottom: -2rem;
  left: 50%;
  transform: translateX(-50%);
  background: #1e293b;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.navbar__cal-btn:hover::after { opacity: 1; }

/* ── Navbar Dropdown ─────────────────────────── */
.cal-dropdown {
  position: fixed;
  top: 72px;
  right: 1rem;
  width: min(420px, calc(100vw - 2rem));
  background: #fff;
  border-radius: 20px;
  box-shadow:
    0 2px 0 3px #1A3282,
    0 12px 48px rgba(26,50,130,0.18);
  z-index: 9000;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-12px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.cal-dropdown.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.cal-dropdown .cal-widget__body {
  padding: 1rem 1.25rem 1.25rem;
}
.cal-dropdown .cal-day {
  min-height: 38px;
  border-radius: 8px;
}
.cal-dropdown .cal-day__num { font-size: 0.8rem; }
.cal-dropdown .cal-events { margin-top: 1rem; }

/* Backdrop */
.cal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 8999;
  background: rgba(0,0,0,0.15);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s;
}
.cal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* ── Google Calendar Connect-Banner ─────────────── */
.cal-gcal-hint {
  background: linear-gradient(135deg, #f0f4ff, #e8f5ff);
  border: 2px dashed #2B5BA8;
  border-radius: 16px;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  font-size: 0.82rem;
  color: #1e40af;
  font-weight: 600;
}
.cal-gcal-hint svg { flex-shrink: 0; color: #2B5BA8; }

/* ── 2-Spalten-Layout (Sektion auf index.html) ── */
.cal-section-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2.5rem;
  align-items: start;
}
.cal-section-left { min-width: 0; }
.cal-section-right {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: sticky;
  top: 90px;
}

/* Info-Block (rechte Spalte) */
.cal-info-block {
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 2px 0 2px #1A3282, 0 6px 24px rgba(26,50,130,0.10);
  overflow: hidden;
}
.cal-info-block__head {
  background: linear-gradient(135deg, #1A3282, #2B5BA8);
  color: #fff;
  padding: 0.9rem 1.2rem;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.cal-info-block__body { padding: 1rem 1.1rem 1.1rem; }

/* Mini-Event-Zeilen */
.cal-mini-event {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  border-left: 4px solid;
  background: #f8fafc;
  margin-bottom: 0.45rem;
  transition: transform 0.15s;
}
.cal-mini-event:last-child { margin-bottom: 0; }
.cal-mini-event:hover { transform: translateX(3px); }
.cal-mini-event__date {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 0.72rem;
  color: #64748b;
  min-width: 38px;
  white-space: nowrap;
}
.cal-mini-event__name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #1e293b;
  flex: 1;
  line-height: 1.3;
}
.cal-mini-event__cat {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  white-space: nowrap;
}

/* Schulzeiten-Zeilen */
.cal-time-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.85rem;
}
.cal-time-row:last-child { border-bottom: none; }
.cal-time-row__label { color: #64748b; font-weight: 600; }
.cal-time-row__value {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  color: #1e293b;
}

/* CTA-Link zur Kalender-Seite */
.cal-full-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: linear-gradient(135deg, #1A3282, #2B5BA8);
  color: #fff;
  padding: 0.9rem 1.2rem;
  border-radius: 16px;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 0.9rem;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(26,50,130,0.25);
  transition: transform 0.18s, box-shadow 0.18s;
}
.cal-full-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(26,50,130,0.3);
}
.cal-full-link svg:last-child { margin-left: auto; }

@media (max-width: 900px) {
  .cal-section-layout {
    grid-template-columns: 1fr;
  }
  .cal-section-right { position: static; }
}

/* ── Tabs ────────────────────────────────────── */
.cal-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  background: rgba(255,255,255,0.7);
  border-radius: 14px;
  padding: 5px;
  width: fit-content;
  box-shadow: 0 1px 0 2px #e2e8f0, 0 2px 8px rgba(0,0,0,0.06);
}
.cal-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.2rem;
  border: none;
  border-radius: 10px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  background: transparent;
  color: #64748b;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}
.cal-tab--active {
  background: #1A3282;
  color: #fff;
  box-shadow: 0 2px 8px rgba(26,50,130,0.22);
}
.cal-tab:not(.cal-tab--active):hover {
  background: #f0f4ff;
  color: #1A3282;
}

/* ── Panel ───────────────────────────────────── */
.cal-panel { display: none; }
.cal-panel--active { display: block; }

/* ── Google Calendar iframe ──────────────────── */
.cal-gcal-embed-wrap {
  background: #fff;
  border-radius: 24px;
  box-shadow:
    0 2px 0 3px #1A3282,
    0 8px 40px rgba(26,50,130,0.12);
  overflow: hidden;
}
.cal-gcal-embed-wrap iframe {
  display: block;
  width: 100%;
  height: 620px;
  border: none;
}
.cal-gcal-embed-hint {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.25rem;
  background: #f8fafc;
  border-top: 2px solid #f1f5f9;
  font-size: 0.8rem;
  color: #64748b;
  font-weight: 500;
}
.cal-gcal-embed-hint svg { flex-shrink: 0; color: #2B5BA8; }

/* ── Responsive ──────────────────────────────── */
@media (max-width: 640px) {
  .cal-widget__header { flex-wrap: wrap; gap: 0.75rem; }
  .cal-widget__gcal-badge { display: none; }
  .cal-widget__body { padding: 1rem; }
  .cal-day { min-height: 36px; border-radius: 8px; }
  .cal-day__num { font-size: 0.78rem; }
  .cal-day__dot { width: 5px; height: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  .cal-dropdown,
  .cal-event-item { transition: none; }
}
