/**
 * CMS Events – Frontend Styles
 * Palette: Blau #3b82f6
 * @package CMS_Events
 */

:root {
  /* ── Primärfarben ─────────────────────────── */
  --ev-primary:        #3b82f6;
  --ev-primary-h:      #1d4ed8;
  --ev-accent:         #60a5fa;
  --ev-light:          #eff6ff;
  --ev-border:         #bfdbfe;
  --ev-border-l:       #f1f5f9;
  --ev-card-bg:        #f0f7ff;
  --ev-featured-border:#f59e0b;
  /* ── Archiv-Header ────────────────────────── */
  --ev-hdr-from:       #1d4ed8;
  --ev-hdr-to:         #3b82f6;
  --ev-hdr-title:      #ffffff;
  /* ── Detailseite-Header ───────────────────── */
  --ev-detail-hdr-bg:  #0f172a;
  --ev-detail-hdr-text:#ffffff;
  --ev-detail-accent:  #3b82f6;
  /* ── CTA ─────────────────────────────────── */
  --ev-cta:            #1e40af;
  /* ── Badge-Farben ────────────────────────── */
  --ev-online-badge:   #059669;    /* Textfarbe Online-Badge   */
  --ev-online-badge-bg:#d1fae5;    /* Hintergrund Online-Badge */
  --ev-cancelled-bg:   #fee2e2;    /* Hintergrund Abgesagt     */
  --ev-cancelled-color:#991b1b;    /* Text Abgesagt            */
  /* ── Card-Höhe ─────────────────────────── */
  --ev-card-height:    300px;
  /* ── Neutrale Farben ─────────────────────── */
  --ev-text:           #1e293b;
  --ev-text-m:         #475569;
  --ev-text-l:         #94a3b8;
  --ev-bg:             #ffffff;
  --ev-radius:         12px;
  --ev-shadow:         0 4px 16px rgba(0,0,0,.06);
  --ev-shadow-h:       0 12px 32px rgba(0,0,0,.12);
  --ev-ease:           all .2s cubic-bezier(.4,0,.2,1);
}

/* ── Archive Wrapper ─────────────────────────────────────────── */
.ev-archive {
  max-width: var(--max, 1140px);
  margin: 0 auto;
  border-left:  1px solid var(--post-column-border,var(--rule,#e2e0d8));
  border-right: 1px solid var(--post-column-border,var(--rule,#e2e0d8));
  padding-bottom: 2.5rem;
}

/* ── Gradient-Header ─────────────────────────────────────────── */
.ev-archive-header {
  background: linear-gradient(135deg,var(--ev-hdr-from) 0%,var(--ev-hdr-to) 100%);
  padding: 2.5rem 2rem;
}
.ev-archive-header-inner {
  display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
}
.ev-archive-icon { font-size: 3rem; line-height: 1; flex-shrink: 0; }
.ev-archive-header-inner h1 {
  margin: 0 0 .25rem; font-size: 1.875rem; font-weight: 800;
  color: var(--ev-hdr-title);
}
.ev-archive-subtitle { margin: 0; font-size: .9375rem; opacity: .85; color: var(--ev-hdr-title); }
.ev-archive-count {
  margin-left: auto;
  background: rgba(255,255,255,.2); border-radius: 10px;
  padding: .6rem 1.1rem; backdrop-filter: blur(4px);
  color: var(--ev-hdr-title); text-align: center;
}
.ev-archive-count-num { display: block; font-size: 1.75rem; font-weight: 800; line-height: 1; }
.ev-archive-count-lbl { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; opacity: .8; }

/* ── Filter-Bar ──────────────────────────────────────────────── */
.ev-filter-bar {
  background: #fff; border: 1px solid var(--ev-border-l);
  border-radius: var(--ev-radius); padding: 10px;
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  box-shadow: var(--ev-shadow); margin: 1.5rem 1.5rem 1.75rem;
}
.ev-filter-input { flex-grow: 1; min-width: 150px; position: relative; }
.ev-filter-input input {
  width: 100%; padding: 9px 10px 9px 34px; box-sizing: border-box;
  border: 1px solid var(--ev-border-l); border-radius: 6px;
  font-size: .875rem; background: #f9fafb; color: var(--ev-text);
  transition: border-color .15s, box-shadow .15s;
}
.ev-filter-input input:focus {
  outline: none; border-color: var(--ev-primary);
  box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
.ev-filter-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--ev-text-l); font-size: .9rem; pointer-events: none;
}
.ev-filter-select {
  padding: 9px 10px; border: 1px solid var(--ev-border-l); border-radius: 6px;
  background: #f9fafb; color: var(--ev-text); font-size: .875rem; height: 38px;
}
.ev-filter-select:focus { outline: none; border-color: var(--ev-primary); box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
.ev-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .55rem 1.25rem; font-size: .875rem; font-weight: 600;
  border-radius: 8px; border: none; cursor: pointer;
  text-decoration: none; white-space: nowrap; transition: var(--ev-ease);
}
.ev-btn-primary { background: var(--ev-primary); color: #fff; }
.ev-btn-primary:hover { background: var(--ev-primary-h); }
.ev-btn-ghost { background: #f1f5f9; color: var(--ev-text-m); }
.ev-btn-ghost:hover { background: #e2e8f0; }
.ev-btn-sm { padding: .3rem .75rem; font-size: .8rem; }

/* ── Grid ────────────────────────────────────────────────────── */
.ev-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem; padding: 0 1.5rem;
}
@media (max-width: 1024px) { .ev-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width:  640px) { .ev-grid { grid-template-columns: 1fr; } }

/* ── Empty State ─────────────────────────────────────────────── */
.ev-empty { grid-column: 1/-1; text-align: center; padding: 3rem 1rem; color: var(--ev-text-l); }
.ev-empty-icon { display: block; font-size: 2.5rem; margin-bottom: .75rem; }

/* ── Pagination ──────────────────────────────────────────────── */
.ev-pagination {
  display: flex; justify-content: center; gap: .4rem;
  margin: 1.75rem 0 .5rem; padding: 0 1.5rem; flex-wrap: wrap;
}
.ev-page-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 .5rem;
  border-radius: 8px; border: 1.5px solid var(--ev-border-l);
  background: #fff; color: var(--ev-text-m); text-decoration: none;
  font-size: .82rem; font-weight: 600; transition: var(--ev-ease);
}
.ev-page-btn:hover { border-color: var(--ev-primary); color: var(--ev-primary); }
.ev-page-btn.active { background: var(--ev-primary); border-color: var(--ev-primary); color: #fff; }

/* ═══════════════════════════════════════════════════════════════
   EVENT CARD  (Layout wie co-card, Blautöne)
   ═══════════════════════════════════════════════════════════════ */
.ev-card {
  position: relative;
  background: var(--ev-card-bg, #f0f7ff);
  border: 2px solid var(--ev-border, #bfdbfe);
  border-radius: var(--ev-radius, 12px);
  padding: 1.25rem 1.375rem 0;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  height: var(--ev-card-height, 300px);
  min-height: var(--ev-card-height, 300px);
  max-height: var(--ev-card-height, 300px);
  overflow: hidden;
  transition: all .2s cubic-bezier(.4,0,.2,1);
  box-shadow: var(--ev-shadow);
}
.ev-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--ev-shadow-h);
  border-color: var(--ev-primary);
}
.ev-card--featured {
  border-color: var(--ev-featured-border, #f59e0b);
  background: linear-gradient(135deg, #fffbeb 0%, var(--ev-card-bg, #f0f7ff) 70%);
}
.ev-card--past  { opacity: .75; }
.ev-card--today {
  border-color: #10b981;
  background: linear-gradient(135deg, #ecfdf5 0%, #fff 60%);
}

/* Ribbon – absolut oben rechts (wie co-card-ribbon) */
.ev-card-ribbon {
  position: absolute;
  top: .75rem;
  right: -.1rem;
  padding: .18rem .65rem .18rem .55rem;
  font-size: .65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  border-radius: 4px 0 0 4px;
  color: #fff;
  background: var(--ev-primary);
  box-shadow: -1px 1px 4px rgba(0,0,0,.18);
}
.ev-ribbon-past      { background: #94a3b8; }
.ev-ribbon-today     { background: #10b981; }
.ev-ribbon-featured  { background: linear-gradient(90deg, #fbbf24, #f59e0b); color: #1e293b; }
.ev-ribbon-cancelled { background: #ef4444; }

/* Head: Datum-Avatar + Identity (wie co-card-head) */
.ev-card-head {
  display: flex;
  gap: .875rem;
  align-items: center;
  padding-right: 4.5rem; /* Platz für Ribbon */
}

/* Datum-Block als Avatar (wie co-card-avatar, Blaugradient) */
.ev-date-block {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  border-radius: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--ev-primary-h, #1d4ed8), var(--ev-primary, #3b82f6));
  color: #fff;
  box-shadow: 0 2px 8px rgba(59, 131, 246, 0.404);
}
.ev-date-day  { display: block; font-size: 1.2rem; font-weight: 800; line-height: 1; }
.ev-date-mon  { display: block; font-size: .58rem; text-transform: uppercase; opacity: .85; }
.ev-date-year { display: block; font-size: .58rem; opacity: .7; }

/* Identity (wie co-card-identity) */
.ev-card-identity {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .15rem;
}
.ev-card-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ev-card-title a { color: var(--ev-text, #1e293b); text-decoration: none; }
.ev-card-title a:hover { color: var(--ev-primary); }
.ev-card-category {
  display: inline-block;
  font-size: .75rem;
  font-weight: 600;
  color: var(--ev-primary);
  background: var(--ev-light, #eff6ff);
  padding: .1rem .45rem;
  border-radius: 4px;
  width: fit-content;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Pills-Zeile als Gradient-Band */
.ev-card-pills {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin-left:  -1.375rem;
  margin-right: -1.375rem;
  padding: .55rem 1.375rem;
  background: linear-gradient(90deg, #d4e3fc 0%, #d7e4fa 40%, #d7e4fa 70%, #d4e3fc 100%);
  border-top:    1px solid #bfdbfe;
  border-bottom: 1px solid #bfdbfe;
}
.ev-pill {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .2rem .6rem;
  background: var(--ev-light, #eff6ff);
  border: 1px solid var(--ev-border, #bfdbfe);
  border-radius: 50px;
  font-size: .73rem;
  color: var(--ev-text-m, #475569);
  white-space: nowrap;
}
.ev-pill-online   { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.ev-pill-speakers { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }
.ev-pill-capacity { background: #e0f2fe; color: #0369a1; border-color: #7dd3fc; }
.ev-pill-free     { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.ev-pill-price    { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }

/* Tag-Pills */
.ev-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
}
.ev-tag-pill {
  display: inline-flex;
  align-items: center;
  padding: .15rem .5rem;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 50px;
  font-size: .68rem;
  font-weight: 500;
  color: #0369a1;
  white-space: nowrap;
}

/* Excerpt (wie co-card-excerpt) */
.ev-card-excerpt {
  flex: 1;
  font-size: .82rem;
  color: var(--ev-text-m, #475569);
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Footer (wie co-card-footer) */
.ev-card-footer {
  display: flex;
  gap: .5rem;
  padding: .875rem 0;
  border-top: 1px solid var(--ev-border, #bfdbfe);
  margin-top: auto;
  align-items: center;
}
.ev-card-footer .ev-btn-primary { flex: 1; justify-content: center; }
.ev-card-footer .ev-btn-ghost   { flex-shrink: 0; }

/* ═══════════════════════════════════════════════════════════════
   SINGLE EVENT
   ═══════════════════════════════════════════════════════════════ */
.ev-single {
  max-width: var(--max, 1140px);
  margin: 0 auto;
  border-left:  1px solid var(--post-column-border,var(--rule,#e2e0d8));
  border-right: 1px solid var(--post-column-border,var(--rule,#e2e0d8));
}
.ev-single-header {
  background: var(--ev-detail-hdr-bg, #f0f7ff);
  padding: 2.5rem 2rem 2rem;
  border-bottom: 3px solid var(--ev-primary, #3b82f6);
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.ev-sh-inner { display: flex; align-items: flex-start; gap: 1.5rem; flex-wrap: wrap; }
.ev-sh-date-block {
  flex-shrink: 0;
  background: var(--ev-primary, #3b82f6);
  border-radius: 14px;
  padding: 1rem 1.125rem;
  text-align: center; color: #fff; min-width: 64px;
  box-shadow: 0 4px 14px rgba(59,130,246,.28);
}
.ev-sh-date-day  { display: block; font-size: 2.2rem; font-weight: 800; line-height: 1; }
.ev-sh-date-mon  { display: block; font-size: .78rem; text-transform: uppercase; opacity: .9; margin-top: 2px; }
.ev-sh-date-year { display: block; font-size: .72rem; opacity: .7; }
.ev-sh-text { flex: 1; min-width: 0; color: var(--ev-detail-hdr-text, #1e293b); }
.ev-sh-text h1 { margin: 0 0 .5rem; font-size: 1.875rem; font-weight: 800; line-height: 1.2; color: var(--ev-text, #1e293b); }
.ev-sh-cat  { font-size: .8rem; font-weight: 700; color: var(--ev-primary, #3b82f6); margin-bottom: .375rem; margin-top: 0; }
.ev-sh-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: .875rem; }
.ev-sh-badge {
  display: inline-flex; align-items: center; gap: .25rem; padding: 4px 12px;
  border-radius: 50px; font-size: .75rem; font-weight: 700;
  background: #fff; color: var(--ev-text-m, #475569);
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
/* Badge-Varianten auf dem Einzel-Header */
.ev-sh-badge--online    { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.ev-sh-badge--featured  { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.ev-sh-badge--cancelled { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }
.ev-sh-badge--speakers  { background: #ede9fe; color: #5b21b6; border-color: #ddd6fe; }

/* Two-column body */
.ev-single-body {
  display: grid; grid-template-columns: 1fr 320px;
  gap: 2rem; padding: 2rem;
}
.ev-main-col  { min-width: 0; }
.ev-sidebar-col { position: sticky; top: 1rem; align-self: start; }
.ev-detail-section {
  background: #fff;
  border: 1px solid #e8ecf0;
  border-radius: 14px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
  transition: box-shadow .22s;
}
.ev-detail-section:hover { box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.ev-section-title {
  font-size: 1rem; font-weight: 700;
  color: #1e293b;
  margin: 0 0 1.125rem;
  padding-bottom: .75rem;
  padding-left: .75rem;
  border-left: 3px solid var(--ev-primary, #3b82f6);
  border-bottom: 1.5px solid #f1f5f9;
  display: flex; align-items: center; gap: .4rem;
}
.ev-info-grid {
  display: flex; flex-direction: column; gap: 0;
}
.ev-info-item {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: .5rem 0; border-bottom: 1px solid #f8fafc; gap: 1rem;
}
.ev-info-item:last-child { border-bottom: none; }
.ev-info-label { font-size: .7rem; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: .05em; flex-shrink: 0; }
.ev-info-value { font-size: .875rem; color: var(--ev-text, #1e293b); font-weight: 500; }
.ev-info-value a { color: var(--ev-primary); text-decoration: none; }
.ev-info-value a:hover { text-decoration: underline; }

.ev-sidebar-card {
  background: #fff;
  border: 1px solid #e8ecf0;
  border-radius: 14px;
  padding: 1.25rem 1.375rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}
.ev-sidebar-card:last-child { margin-bottom: 0; }
.ev-sidebar-title {
  font-size: .7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em;
  color: #94a3b8; margin: 0 0 .875rem;
}
.ev-cta-btn {
  display: flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .875rem 1.25rem; font-size: .9rem; font-weight: 700;
  border-radius: 10px; color: #fff;
  background: var(--ev-cta, var(--ev-primary, #3b82f6));
  text-decoration: none; border: none; cursor: pointer; width: 100%;
  box-shadow: 0 4px 14px rgba(59,130,246,.28);
  transition: all .2s; box-sizing: border-box;
  margin-bottom: .625rem;
}
.ev-cta-btn:last-child { margin-bottom: 0; }
.ev-cta-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(59,130,246,.38); }

/* Speaker rows – Card-Style */
.ev-speaker-row {
  display: flex; gap: .875rem; align-items: center;
  padding: .75rem; border-radius: 10px;
  background: #fafbfc; border: 1px solid #f1f5f9;
  margin-bottom: .5rem;
  transition: background .15s, border-color .15s;
}
.ev-speaker-row:last-child { margin-bottom: 0; }
.ev-speaker-row:hover { background: var(--ev-light, #eff6ff); border-color: var(--ev-border, #bfdbfe); }
.ev-speaker-avatar {
  width: 44px; height: 44px; border-radius: 10px; overflow: hidden; flex-shrink: 0;
  background: var(--ev-light); display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: var(--ev-primary); font-size: .95rem;
  border: 1px solid var(--ev-border, #bfdbfe);
}
.ev-speaker-avatar img { width: 100%; height: 100%; object-fit: cover; }
.ev-speaker-info-name { font-size: .9rem; font-weight: 700; color: var(--ev-text); }
.ev-speaker-info-role { font-size: .77rem; color: var(--ev-text-l); margin-top: 2px; }

/* Tags unterhalb (Archiv-Tag-Zeile) */
.ev-card-tags {
  display: flex; flex-wrap: wrap; gap: .3rem;
  padding: 0 14px 8px;
}
.ev-tag-pill {
  display: inline-block;
  padding: .15rem .55rem;
  background: var(--ev-light, #eff6ff);
  border: 1px solid var(--ev-border, #bfdbfe);
  border-radius: 50px;
  font-size: .72rem;
  font-weight: 600;
  color: var(--ev-primary, #1d4ed8);
  white-space: nowrap;
}

/* ── Preis Badge (Sidebar) ────────────────────────────────────── */
.ev-price-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .55rem 1.1rem; border-radius: 10px;
  font-size: 1rem; font-weight: 800;
  background: #f1f5f9; color: #1e293b;
}
.ev-price-free     { background: #d1fae5; color: #065f46; }
.ev-price-paid     { background: #eff6ff; color: #1d4ed8; font-size: 1.2rem; }
.ev-price-donation { background: #fdf4ff; color: #7e22ce; }

/* Featured-Karte: Definition oben bei den Card-Varianten */

/* ── Card Bild (falls Banner-URL gesetzt) ─────────────────────── */
.ev-card-img {
  width: 100%; height: 160px; object-fit: cover;
  border-radius: var(--ev-radius) var(--ev-radius) 0 0;
  display: block; margin: -1.25rem -1.25rem 1rem -1.25rem;
  width: calc(100% + 2.5rem);
}

/* Back Link – vollbreite Breadcrumb-Bar */
.ev-back-link {
  display: flex; align-items: center; gap: .35rem;
  font-size: .8rem; color: var(--ev-text-m); text-decoration: none;
  padding: .7rem 2rem; width: 100%; box-sizing: border-box;
  background: #fafbfc;
  border-bottom: 1px solid #f1f5f9;
  transition: color .15s, background .15s;
}
.ev-back-link:hover { color: var(--ev-primary); background: #f0f7ff; }

/* Responsive */
@media (max-width: 768px) {
  .ev-single-body { grid-template-columns: 1fr; }
  .ev-sh-text h1  { font-size: 1.3rem; }
  .ev-archive-header-inner { flex-direction: column; align-items: flex-start; }
  .ev-archive-count { margin-left: 0; }
  .ev-grid { grid-template-columns: 1fr; padding: 0 .75rem; }
  .ev-filter-bar { margin: .75rem .75rem 1rem; }
  .ev-info-grid { grid-template-columns: 1fr; }
}

/* ── Archive: Responsive Grid ─────────────────────────────────── */
@media (max-width: 1024px) { .ev-grid { grid-template-columns: repeat(2,1fr) !important; } }
@media (max-width: 640px)  { .ev-grid { grid-template-columns: 1fr !important; } }

/* ── Archive: Reset-Link ──────────────────────────────────────── */
.ev-btn--inline { display: inline-flex; margin-top: .5rem; }
