:root {
  /* Default Theme Variables */
  --cds-font-family: inherit;
  --cds-container-max-width: 100%;
  
  /* Layout Defaults */
  --cds-height: 500px;
  --cds-width: 100%;
  --cds-speed: 20s;
  
  /* Colors */
  --cds-header-bg: #21235d;
  --cds-header-text: #ffffff;
  --cds-title-color: #ffffff;
  
  --cds-card-bg: #ffffff;
  --cds-border-color: #e2e8f0;
  
  --cds-primary-color: #396ddc;
  --cds-date-color: #396ddc;
  
  --cds-text-color: #334155;
  --cds-muted-color: #64748b;
}

/* ============================================
   OUTER SHELL (Shared with Template 1 & 2)
   ============================================ */

/* Main Container */
.cds-events-container.cds-template-3 {
  width: var(--cds-width);
  max-width: 100%;
  margin: 0 auto;
  font-family: var(--cds-font-family);
  box-sizing: border-box;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  border: 1px solid var(--cds-border-color);
}

/* Header */
.cds-template-3 .cds-header {
  background: linear-gradient(135deg, var(--cds-header-bg), var(--cds-header-bg-gradient, var(--cds-header-bg)));
  padding: 0.7rem;
  text-align: center;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

.cds-template-3 .cds-bell-icon {
  width: 20px;
  height: 20px;
  opacity: 0.9;
  flex-shrink: 0;
}

.cds-template-3 .cds-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: var(--cds-title-color);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.cds-template-3 .cds-count-badge {
  background-color: rgba(255, 255, 255, 0.2);
  color: var(--cds-title-color);
  font-size: 0.7rem;
  width: 20px;
  height: 20px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}

/* Carousel Area */
.cds-template-3 .cds-carousel-wrapper {
  position: relative;
  overflow-y: auto;
  scrollbar-width: none;
  height: var(--cds-height);
  padding: 0;
  background-color: #ffffff;
  contain: content;
}

.cds-template-3 .cds-carousel-wrapper::-webkit-scrollbar {
  display: none;
}

.cds-template-3 .cds-carousel-track {
  display: flex;
  flex-direction: column;
}

/* ============================================
   TEMPLATE 3 — Bulletin / News List
   CSS-only restyling of the shared view.php markup.
   
   Transforms:
   • .cds-date-box → hidden as a calendar, repositioned to bottom as inline text
   • ::before on .cds-event-card → bullet point
   • .cds-content → full width, title bold, desc lighter
   ============================================ */

/* Event Card — Clean list row with bullet */
.cds-template-3 .cds-event-card {
  display: flex;
  flex-wrap: wrap;
  position: relative;
  padding: 1rem 1.25rem 1rem 2.25rem; /* Extra left padding for bullet */
  border-bottom: 1px solid var(--cds-border-color);
  background-color: var(--cds-card-bg);
  transition: background-color 0.2s ease;
  align-items: flex-start;
  border-radius: 0;
  box-shadow: none;
  border-left: none;
  border-right: none;
  border-top: none;
}

.cds-template-3 .cds-event-card:hover {
  background-color: #f8fafc;
  transform: none;
  box-shadow: none;
}

/* Bullet Point with subtle pulse glow */
.cds-template-3 .cds-event-card::before {
  content: '';
  position: absolute;
  left: 1rem;
  top: 1.35rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--cds-date-color);
  flex-shrink: 0;
  animation: cds-bullet-pulse 2.5s ease-in-out infinite;
  will-change: box-shadow;
}

@keyframes cds-bullet-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--cds-date-color) 40%, transparent);
  }
  50% {
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--cds-date-color) 0%, transparent);
  }
}

/* Loop Spacer */
.cds-template-3 .cds-set-separator {
  margin-bottom: var(--cds-height);
}

/* --- Hide the calendar-style date box, restyle as inline text at bottom --- */
.cds-template-3 .cds-date-box {
  /* Reset all calendar styles */
  flex: 0 0 100%;
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 5px;
  order: 2; /* Push below .cds-content */

  /* Strip calendar appearance */
  background: none;
  border: none;
  border-right: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  margin-top: 10px;
  justify-content: flex-start;
  text-align: left;
  line-height: 1;
  height: auto;
}

/* Restyle day / month / year — Lightest & Smallest (Level 3) */
.cds-template-3 .cds-date-day {
  font-size: var(--cds-event-date-size, 0.8rem);
  font-weight: 400;
  color: #b0b8c4;
  margin: 0;
  line-height: 1;
}

.cds-template-3 .cds-date-month {
  font-size: var(--cds-event-date-size, 0.8rem);
  font-weight: 400;
  color: #b0b8c4;
  text-transform: uppercase;
  margin: 0;
  line-height: 1;
  /* Reset any template-2-style ordering/coloring */
  order: unset;
  width: auto;
  background: none;
  padding: 0;
  letter-spacing: 0;
}

.cds-template-3 .cds-date-year {
  font-size: var(--cds-event-date-size, 0.8rem);
  font-weight: 400;
  color: #b0b8c4;
  margin: 0;
  line-height: 1;
}

/* --- Content: Full width, bold title, lighter desc --- */
.cds-template-3 .cds-content {
  flex: 1 1 100%;
  order: 1; /* Before date box */
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 0;
  text-align: left;
}

/* Title — Large & Dark (Level 1) */
.cds-template-3 .cds-event-title {
  font-size: var(--cds-event-title-size, 18px);
  font-weight: 700;
  color: #3a3a3a;
  margin: 0;
  line-height: 1.35;
}

/* Description — Mid-tone & Smaller (Level 2) */
.cds-template-3 .cds-event-desc {
  font-size: var(--cds-event-desc-size, 17px);
  font-weight: 400;
  color: #6d6e6f;
  margin: 0;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Link */
.cds-template-3 .cds-event-link {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--cds-date-color);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  margin-top: 2px;
}

.cds-template-3 .cds-event-link:hover {
  text-decoration: underline;
  opacity: 0.9;
}

.cds-template-3 .cds-event-link::after {
  content: "→";
  margin-left: 4px;
  transition: transform 0.2s;
  font-weight: 800;
}

.cds-template-3 .cds-event-link:hover::after {
  transform: translateX(3px);
}

/* No Events Message */
.cds-template-3 .cds-no-events {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  color: var(--cds-muted-color);
  font-size: 1rem;
  font-weight: 500;
  padding: 2rem;
}

/* ============================================
   MOBILE
   ============================================ */
@media (max-width: 480px) {
  .cds-template-3 .cds-event-card {
    padding: 0.85rem 1rem 0.85rem 2rem;
  }

  .cds-template-3 .cds-event-card::before {
    left: 0.75rem;
  }

  .cds-template-3 .cds-event-title {
    font-size: 0.9rem;
  }
}

/* ============================================
   AUTO-ADJUST HEIGHT MODE
   ============================================ */
.cds-events-container.cds-template-3.cds-height-auto {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 200px;
}

.cds-events-container.cds-template-3.cds-height-auto .cds-carousel-wrapper {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  overflow-y: auto;
}
