/* =========================================================
   KGV Events – Frontend Styles
   ========================================================= */

/* Root / Reset */
.kgv-theme{
  --kgv-primary:#0ea5e9;
  --kgv-accent:#111827;
  --kgv-border:#e5e7eb;
  --kgv-bg:#fff;
  --kgv-text:#111827;
  --kgv-danger:#ef4444;
  --kgv-title-weight:700;
  color:var(--kgv-text);
}
.kgv-theme *{ box-shadow:none !important; }
.kgv-theme button,.kgv-theme input,.kgv-theme select,.kgv-theme a{ outline:none !important; }
.kgv-theme button,.kgv-theme input,.kgv-theme select{
  border-color:var(--kgv-border) !important;
  color:var(--kgv-text) !important;
  background:var(--kgv-bg) !important;
}

/* Sanftes Scrollen für Anker (Mobil hilfreich) */
html{ scroll-behavior:smooth; }

/* ---------------------------------------
   Toolbar
--------------------------------------- */
.kgv-theme .kgv-events-toolbar{ display:grid; gap:10px; margin-bottom:14px; }
.kgv-theme .kgv-toolbar-line1{ display:flex; gap:8px; align-items:center; flex-wrap:nowrap; }
.kgv-theme .kgv-toolbar-line2{ display:flex; gap:8px; align-items:center; justify-content:space-between; flex-wrap:wrap; }
.kgv-theme .kgv-month-title{ font-weight:700; font-size:1.1rem; padding:6px 10px; border-radius:999px; background:#f7f7f8; }
.kgv-theme .kgv-month-prev,.kgv-theme .kgv-month-next,.kgv-theme .kgv-today{
  padding:8px 12px; border:1px solid var(--kgv-border) !important; border-radius:999px; cursor:pointer;
}
.kgv-theme .kgv-today{ background:#f7f7f8 !important; }
.kgv-theme .kgv-toolbar-view{ display:flex; gap:6px; }
.kgv-theme .kgv-toolbar-view .kgv-view{
  padding:10px 12px; border:1px solid var(--kgv-border) !important; background:var(--kgv-bg) !important; border-radius:999px; cursor:pointer;
}
.kgv-theme .kgv-toolbar-view .kgv-view[aria-pressed="true"]{
  border-color:var(--kgv-accent) !important; color:var(--kgv-accent) !important; font-weight:700;
}

/* ---------------------------------------
   Layout
--------------------------------------- */
.kgv-theme .kgv-events-layout{ display:grid; grid-template-columns:300px 1fr; gap:16px; }
@media (max-width:900px){ .kgv-theme .kgv-events-layout{ grid-template-columns:1fr; } }

/* ---------------------------------------
   Sidebar Suche
--------------------------------------- */
.kgv-theme .kgv-side-search{
  border:1px solid var(--kgv-border); border-radius:16px; padding:12px; margin-bottom:12px; background:var(--kgv-bg);
  display:flex; flex-direction:column; gap:8px;
}
.kgv-theme .kgv-side-search input[type="text"]{ padding:10px 12px; border:1px solid var(--kgv-border); border-radius:12px; width:100%; }
.kgv-theme .kgv-inline{ display:flex; align-items:center; gap:6px; font-size:.95rem; }
.kgv-theme .kgv-search-btn{
  align-self:flex-start; padding:10px 12px; border:1px solid var(--kgv-primary) !important;
  background:var(--kgv-primary) !important; color:#fff !important; border-radius:12px; cursor:pointer;
}

/* ---------------------------------------
   Mini-Kalender
--------------------------------------- */
.kgv-theme .kgv-mini-calendar{ border:1px solid var(--kgv-border); border-radius:16px; padding:12px; background:var(--kgv-bg); }
.kgv-theme .kgv-mini-grid{ display:grid; grid-template-columns:repeat(7,1fr); gap:6px; }
.kgv-theme .kgv-mini-dow{ font-weight:700; text-align:center; }
.kgv-theme .kgv-mini-cell{ text-align:center; padding:8px 0; border-radius:10px; }
.kgv-theme .kgv-mini-cell .num{ font-weight:400; }
.kgv-theme .kgv-mini-cell.has-events .num{ font-weight:700; } /* nur Tage mit Terminen fett */
.kgv-theme .kgv-mini-cell.today .num{ border-bottom:3px solid var(--kgv-primary); border-radius:2px; padding-bottom:2px; display:inline-block; }
.kgv-theme .kgv-mini-cell:hover{ background:#f3f4f6; cursor:pointer; }
.kgv-theme .kgv-mini-cell.empty{ background:transparent; pointer-events:none; }
.kgv-theme .kgv-mini-help{ margin-top:8px; font-size:.9rem; opacity:.7; }

/* ---------------------------------------
   Grid-Karten (Kachel)
--------------------------------------- */
.kgv-theme .kgv-grid{ display:grid; gap:16px; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); }
.kgv-theme .kgv-card{ background:var(--kgv-bg); border:1px solid var(--kgv-border); border-radius:16px; overflow:hidden; box-shadow:0 1px 3px rgba(0,0,0,.04); position:relative; }
.kgv-theme .kgv-card-media img{ width:100%; height:180px; object-fit:cover; display:block; }
.kgv-theme .kgv-card-body{ padding:14px; }
.kgv-theme .kgv-card-title{ margin:0 0 6px; font-size:1.1rem; font-weight:var(--kgv-title-weight); }
.kgv-theme .kgv-card-title a{ text-decoration:none; color:var(--kgv-accent) !important; }
.kgv-theme .kgv-card-excerpt{ margin:6px 0 0; color:#374151; }

/* Meta mit Icons */
.kgv-theme .kgv-meta{ display:flex; flex-wrap:wrap; gap:10px 14px; margin-bottom:8px; color:#374151; }
.kgv-theme .kgv-meta-item{ display:inline-flex; align-items:center; gap:6px; }
.kgv-theme .kgv-meta-item svg{ width:18px; height:18px; fill:#6b7280; display:inline-block; }

/* Durchstreichen/rot für abgesagte Details */
.kgv-theme .kgv-strike{
  color:var(--kgv-danger) !important;
  text-decoration:line-through;
  text-decoration-thickness:2px;
  text-decoration-color:var(--kgv-danger);
}

/* Abgesagt-Badge NUR in Kachel (Overlay) */
.kgv-theme .kgv-grid .kgv-card .kgv-flag-canceled{
  position:absolute; top:0; left:0; right:0;
  background:var(--kgv-danger) !important; color:#fff !important;
  text-align:center; font-weight:700; padding:6px 8px; z-index:3;
}

/* ---------------------------------------
   Listenansicht
--------------------------------------- */
.kgv-theme .kgv-list{ list-style:none; padding:0; margin:0; display:flex; flex-direction:column; gap:12px; }
.kgv-theme .kgv-list-item{ display:flex; gap:12px; padding:12px; border:1px solid var(--kgv-border); border-radius:14px; background:var(--kgv-bg); position:relative; }
.kgv-theme .kgv-date-badge{ width:64px; min-width:64px; height:64px; border-radius:12px; background:#f3f4f6; display:flex; flex-direction:column; align-items:center; justify-content:center; line-height:1; }
.kgv-theme .kgv-date-badge .d{ font-weight:800; font-size:1.2rem; }
.kgv-theme .kgv-date-badge .m{ text-transform:uppercase; letter-spacing:.04em; font-size:.8rem; color:#6b7280; }

.kgv-theme .kgv-list-main{ flex:1; }
.kgv-theme .kgv-list-title{ font-weight:var(--kgv-title-weight); text-decoration:none; color:var(--kgv-accent) !important; display:inline-block; margin-bottom:4px; }
.kgv-theme .kgv-list .kgv-meta{ margin-bottom:8px; }

/* Abgesagt-Badge NUR in Liste (unter dem Titel) */
.kgv-theme .kgv-list .kgv-flag-canceled{
  position:static; display:block;           /* WICHTIG: neue Zeile unter dem Titel */
  background:var(--kgv-danger) !important; color:#fff !important;
  padding:4px 8px; border-radius:8px; font-weight:700; margin:6px 0 6px;
}

/* Buttons / Links */
.kgv-theme .kgv-card-more{ display:inline-block; text-decoration:none; font-weight:600; color:var(--kgv-primary) !important; }

/* Empty State */
.kgv-theme .kgv-empty{ padding:14px; border:1px dashed var(--kgv-border); border-radius:12px; opacity:.9; }

/* ---------------------------------------
   Detailansicht (ersetzt Ergebnisliste)
--------------------------------------- */
.kgv-theme .kgv-detail-view{
  background:#fff; border:1px solid var(--kgv-border); border-radius:16px; overflow:hidden; scroll-margin-top:90px;
}
.kgv-theme .kgv-detail-inner{ position:relative; }
.kgv-theme .kgv-detail-back{ margin:12px; border:1px solid var(--kgv-border) !important; border-radius:999px; padding:8px 12px; background:#fff !important; cursor:pointer; }
.kgv-theme .kgv-detail-media{ width:100%; height:260px; overflow:hidden; }
.kgv-theme .kgv-detail-media img{ width:100%; height:100%; object-fit:cover; display:block; }
.kgv-theme .kgv-detail-title{ margin:12px 16px 8px; font-weight:700; font-size:1.35rem; }
.kgv-theme .kgv-modal-meta{ display:flex; flex-wrap:wrap; gap:10px 14px; color:#374151; margin:0 16px 10px; }
.kgv-theme .kgv-modal-meta .kgv-meta-item{ display:inline-flex; align-items:center; gap:6px; }
.kgv-theme .kgv-detail-cancel{ margin:0 16px 12px; display:inline-block; background:var(--kgv-danger); color:#fff; font-weight:700; padding:6px 10px; border-radius:8px; }
.kgv-theme .kgv-detail-content{ padding:0 16px 16px; }
.kgv-theme .kgv-detail-content p{ margin:0 0 10px; }

/* Mobile Tweaks */
@media (max-width:700px){
  .kgv-theme .kgv-list-title{ display:block; margin-bottom:4px; }
}
