/* ================================================================
   Campus Kongsvinger Events — Frontend CSS
   Font: Manrope | Brand: #8B1A3A burgundy, #F5EDD6 cream, #1C0A0E dark
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;500;600;700;800&display=swap');

/* ── Variables ────────────────────────────────────────────── */
:root {
  --ce-burg:      #8B1A3A;
  --ce-burg-d:    #5C0E24;
  --ce-burg-lt:   rgba(139,26,58,0.08);
  --ce-cream:     #F5EDD6;
  --ce-cream-d:   #EDE0C4;
  --ce-dark:      #1C0A0E;
  --ce-text:      #2E1218;
  --ce-muted:     #7A6068;
  --ce-border:    rgba(139,26,58,0.13);
  --ce-border-lt: rgba(139,26,58,0.07);
  --ce-white:     #ffffff;
  --ce-radius:    8px;
  --ce-font:      'Manrope', system-ui, sans-serif;
  --ce-ease:      cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Base reset for plugin scope ─────────────────────────── */
.ce-wrap *,
.ce-single * { box-sizing: border-box; }

/* ================================================================
   PROGRAM PAGE — shortcode output
   ================================================================ */

.ce-wrap {
  font-family: var(--ce-font);
  color: var(--ce-text);
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ── Page header ─────────────────────────────────────────── */
.ce-header {
  padding: 48px 0 36px;
  border-bottom: 1px solid var(--ce-border);
  margin-bottom: 36px;
}
.ce-title {
  font-family: var(--ce-font);
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  font-weight: 800;
  color: var(--ce-dark);
  margin: 0 0 10px;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.ce-description {
  font-size: 1rem;
  font-weight: 400;
  color: var(--ce-muted);
  line-height: 1.7;
  max-width: 560px;
  margin: 0;
}

/* ── Day navigation ──────────────────────────────────────── */
.ce-day-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.ce-day-nav-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ce-muted);
  white-space: nowrap;
}
.ce-day-nav-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.ce-day-nav-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px;
  border-radius: 100px;
  font-family: var(--ce-font);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ce-burg);
  background: transparent;
  border: 1.5px solid var(--ce-burg);
  text-decoration: none;
  transition: background 0.18s var(--ce-ease), color 0.18s var(--ce-ease);
}
.ce-day-nav-item::before { content: '→'; font-size: 0.75em; }
.ce-day-nav-item:hover,
.ce-day-nav-item.active {
  background: var(--ce-burg);
  color: #fff;
}

/* ── Filter bar ──────────────────────────────────────────── */
.ce-filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
  padding: 14px 18px;
  background: var(--ce-cream);
  border-radius: var(--ce-radius);
  border: 1px solid var(--ce-cream-d);
  flex-wrap: wrap;
}
.ce-filter-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ce-muted);
  white-space: nowrap;
}
.ce-filter-buttons { display: flex; gap: 6px; flex-wrap: wrap; }
.ce-filter-btn {
  padding: 5px 14px;
  border-radius: 100px;
  border: 1.5px solid var(--ce-border);
  background: var(--ce-white);
  font-family: var(--ce-font);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ce-text);
  cursor: pointer;
  transition: all 0.16s var(--ce-ease);
  line-height: 1.5;
}
.ce-filter-btn:hover { border-color: var(--ce-burg); color: var(--ce-burg); }
.ce-filter-btn.active {
  background: var(--ce-burg);
  border-color: var(--ce-burg);
  color: #fff;
}

/* ── Day section ─────────────────────────────────────────── */
.ce-day-section {
  margin-bottom: 52px;
  scroll-margin-top: 90px;
}
.ce-day-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}
.ce-day-title {
  font-family: var(--ce-font);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ce-dark);
  margin: 0;
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.ce-day-line {
  flex: 1;
  height: 1px;
  background: var(--ce-border);
}

/* ── Event grid ──────────────────────────────────────────── */
.ce-events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
}

/* ── Event card — matches moc5 card style ────────────────── */
.ce-event-card {
  background: var(--ce-white);
  border-radius: var(--ce-radius);
  border: 1px solid var(--ce-border-lt);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s var(--ce-ease), transform 0.2s var(--ce-ease);
  /* Card from moc5: clean white, subtle border, no heavy shadow */
  box-shadow: 0 1px 4px rgba(28,10,14,0.06);
}
.ce-event-card:hover {
  box-shadow: 0 4px 20px rgba(28,10,14,0.10);
  transform: translateY(-2px);
}
.ce-event-card.ce-event-featured {
  border-color: var(--ce-burg);
  border-width: 1.5px;
}

/* Card image */
.ce-card-image-link { display: block; overflow: hidden; }
.ce-card-image {
  width: 100%;
  padding-top: 57%;
  background-size: cover;
  background-position: center;
  transition: transform 0.32s var(--ce-ease);
}
.ce-event-card:hover .ce-card-image { transform: scale(1.03); }

.ce-featured-badge {
  position: absolute;
  top: 10px; right: 10px;
  background: var(--ce-burg);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 3px 9px;
  border-radius: 100px;
}
/* Need relative on parent for badge positioning */
.ce-card-image-link { position: relative; }

/* Card body */
.ce-card-body {
  padding: 16px 18px 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.ce-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}
.ce-card-category {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  /* color set inline per event */
}
.ce-card-time {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ce-burg);
}
.ce-card-location {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.73rem;
  font-weight: 500;
  color: var(--ce-muted);
}
.ce-card-title {
  font-family: var(--ce-font);
  font-size: 1rem;
  font-weight: 700;
  margin: 4px 0 2px;
  line-height: 1.35;
  color: var(--ce-dark);
  letter-spacing: -0.01em;
}
.ce-card-title a { color: inherit; text-decoration: none; transition: color 0.15s; }
.ce-card-title a:hover { color: var(--ce-burg); }
.ce-card-excerpt {
  font-size: 0.82rem;
  font-weight: 400;
  color: var(--ce-muted);
  line-height: 1.6;
  margin: 0;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ce-card-footer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--ce-border-lt);
}
.ce-card-cta,
.ce-card-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ce-burg);
  text-decoration: none;
  transition: gap 0.15s;
}
.ce-card-cta:hover,
.ce-card-link:hover { gap: 8px; }

/* ── Empty state ─────────────────────────────────────────── */
.ce-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--ce-muted);
  font-size: 0.95rem;
  font-weight: 500;
}

/* ── Loading ─────────────────────────────────────────────── */
.ce-loading {
  text-align: center;
  padding: 48px;
  color: var(--ce-muted);
  font-size: 0.88rem;
  font-weight: 500;
}
.ce-loading::after {
  content: '';
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid var(--ce-cream-d);
  border-top-color: var(--ce-burg);
  border-radius: 50%;
  animation: ce-spin 0.65s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}
@keyframes ce-spin { to { transform: rotate(360deg); } }

/* ================================================================
   SINGLE EVENT PAGE — injected via the_content filter
   ================================================================ */

.ce-single {
  font-family: var(--ce-font);
  color: var(--ce-text);
  max-width: 760px;
  margin: 0 auto;
  padding: 12px 0 72px;
}

/* Back nav */
.ce-s-nav {
  margin-bottom: 28px;
}
.ce-s-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ce-burg);
  text-decoration: none;
  transition: opacity 0.15s;
}
.ce-s-back:hover { opacity: 0.72; }
.ce-s-back svg { flex-shrink: 0; }

/* Single header */
.ce-s-header {
  text-align: center;
  margin-bottom: 32px;
}
.ce-s-meta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.ce-s-datetime { /* color set inline */ }
.ce-s-meta-sep { color: var(--ce-muted); font-weight: 400; }
.ce-s-category { /* color set inline */ }

.ce-s-title {
  font-family: var(--ce-font);
  font-size: clamp(1.8rem, 4.5vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: var(--ce-dark);
  margin: 0 0 14px;
}
.ce-s-ingress {
  font-size: 1.08rem;
  font-weight: 400;
  line-height: 1.65;
  color: var(--ce-muted);
  margin: 0 auto;
  max-width: 540px;
}

/* Image — matches moc4: full-width, rounded, no caption on top */
.ce-s-image {
  margin-bottom: 40px;
  border-radius: 12px;
  overflow: hidden;
  line-height: 0;
}
.ce-s-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Body content */
.ce-s-body-wrap {
  max-width: 640px;
  margin: 0 auto;
}
.ce-s-location {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--ce-muted);
  margin-bottom: 24px;
}
.ce-s-content {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--ce-text);
  font-weight: 400;
  margin-bottom: 36px;
}
.ce-s-content p { margin: 0 0 1.2em; }
.ce-s-content h2,
.ce-s-content h3 {
  font-weight: 700;
  color: var(--ce-dark);
  letter-spacing: -0.01em;
  margin-top: 1.5em;
}

/* CTA button */
.ce-s-cta-wrap { margin-bottom: 52px; }
.ce-s-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  background: var(--ce-burg);
  color: #fff;
  border-radius: 100px;
  font-family: var(--ce-font);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.18s var(--ce-ease), gap 0.18s;
}
.ce-s-btn:hover { background: var(--ce-burg-d); color: #fff; gap: 11px; }

/* Prev/Next — matches moc3 bottom nav style */
.ce-s-pagination {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--ce-border);
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}
.ce-s-page-link {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-decoration: none;
  padding: 14px 16px;
  border-radius: var(--ce-radius);
  border: 1px solid var(--ce-border-lt);
  background: var(--ce-white);
  transition: border-color 0.16s, box-shadow 0.16s;
}
.ce-s-page-link:hover {
  border-color: var(--ce-burg);
  box-shadow: 0 2px 12px rgba(139,26,58,0.08);
}
.ce-s-next { text-align: right; }
.ce-s-page-meta {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ce-burg);
  display: block;
}
.ce-s-page-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ce-dark);
  line-height: 1.35;
  display: block;
}
.ce-s-page-arrow {
  font-size: 0.9rem;
  color: var(--ce-muted);
  margin-top: 2px;
  display: block;
}

/* ── Theme title suppression — hide the theme's H1 OUTSIDE our wrapper only ── */
/* These selectors target the theme's title block that renders above the_content */
.campus-single-event-page .entry-title,
.campus-single-event-page h1.post-title,
.campus-single-event-page .post-title,
.campus-single-event-page .page-title,
.campus-single-event-page .wp-block-post-title { display: none !important; }

/* Ensure our own title inside ce-single is always visible */
.campus-single-event-page .ce-single .ce-s-title { display: block !important; }

.campus-single-event-page .entry-content,
.campus-single-event-page .post-content {
  max-width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 680px) {
  .ce-events-grid { grid-template-columns: 1fr; }
  .ce-s-pagination { grid-template-columns: 1fr; }
  .ce-day-nav { flex-direction: column; align-items: flex-start; }
  .ce-filter-bar { flex-direction: column; align-items: flex-start; }
  .ce-single { padding: 12px 0 48px; }
}
