/**
 * Campus Labs Events Widget Styles
 * 
 * Typography:
 * - Titles: Oswald
 * - Date & Content: Merriweather
 */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;500;600;700&family=Merriweather:wght@300;400;700&display=swap');

/* Widget Container */
.cl-events-widget {
  width: 100%;
  margin: 0 auto;
  padding: 20px 0;
}

/* Loading State */
.cl-events-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.cl-events-spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #ba0c2f;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.cl-events-loading p {
  color: #666;
  font-size: 1rem;
  margin: 0;
  font-family: 'Merriweather', serif;
}

/* Error State */
.cl-events-error {
  padding: 40px 20px;
  text-align: center;
  color: #ba0c2f;
  background-color: #fff5f5;
  border: 2px solid #ba0c2f;
  border-radius: 8px;
}

.cl-events-error p {
  margin: 0;
  font-size: 1rem;
  font-family: 'Merriweather', serif;
}

/* Empty State */
.cl-events-empty {
  padding: 60px 20px;
  text-align: center;
  color: #666;
}

.cl-events-empty p {
  margin: 0;
  font-size: 1.1rem;
  font-family: 'Merriweather', serif;
}

/* Events Grid - 3 columns on desktop, 1 column on mobile */
.cl-events-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  padding: 20px 0;
}

@media (max-width: 768px) {
  .cl-events-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* Homepage Style Grid - 4 columns, no gaps, no padding */
.cl-events-grid-homepage {
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  display: grid !important;
}

.cl-events-grid-homepage .cl-event-card-homepage {
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
}

.cl-events-widget-homepage {
  padding: 0 !important;
  margin: 0 !important;
}

@media (max-width: 1024px) {
  .cl-events-grid-homepage {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 768px) {
  .cl-events-grid-homepage {
    grid-template-columns: 1fr !important;
  }
}

/* Event Card */
.cl-event-card {
  background: #ffffff;
  border-radius: 0;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.cl-event-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* Homepage Style Card - Image background with overlay */
.cl-event-card-homepage {
  position: relative;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #ffffff;
  transition: opacity 0.3s ease;
  cursor: pointer;
  overflow: hidden;
  vertical-align: top;
  margin: 0;
  padding: 0;
  border: none;
}

.cl-event-card-homepage:hover {
  opacity: 0.95;
  transform: none !important;
}

.cl-event-card-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.6));
  z-index: 1;
}

.cl-event-card-homepage-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 20px;
  width: 100%;
  overflow: hidden;
  box-sizing: border-box;
  margin: 0;
}

.cl-event-card-homepage-title {
  font-family: 'Oswald', sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: #ffffff !important;
  margin: 0 0 12px 0;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  transition: transform 0.3s ease;
  transform-origin: center;
  display: block;
  will-change: transform;
}

.cl-event-card-homepage:hover .cl-event-card-homepage-title {
  transform: scale(1.05);
}

.cl-event-card-homepage-date {
  font-family: 'Merriweather', serif;
  font-size: 1rem;
  color: #ffffff !important;
  line-height: 1.5;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  transition: transform 0.3s ease;
  transform-origin: center;
  display: block;
  will-change: transform;
  margin: 0;
}

.cl-event-card-homepage:hover .cl-event-card-homepage-date {
  transform: scale(1.05);
}

@media (max-width: 768px) {
  .cl-event-card-homepage {
    min-height: 250px;
  }
  
  .cl-event-card-homepage-title {
    font-size: 1.3rem;
  }
  
  .cl-event-card-homepage-date {
    font-size: 0.9rem;
  }
}

/* Event Card Image - Uniform size with object-fit */
.cl-event-card-image {
  width: 100%;
  height: 250px;
  overflow: hidden;
  background-color: #f5f5f5;
  position: relative;
}

.cl-event-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.3s ease;
}

.cl-event-card:hover .cl-event-card-image img {
  transform: scale(1.05);
}

/* Event Card Content */
.cl-event-card-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

/* Title - Oswald font */
.cl-event-card-title {
  font-family: 'Oswald', sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: #000;
  margin: 0 0 12px 0;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Date - Merriweather font */
.cl-event-card-date {
  font-family: 'Merriweather', serif;
  font-size: 0.95rem;
  color: #666;
  margin-bottom: 12px;
  line-height: 1.5;
}

.cl-event-date {
  font-weight: 400;
  display: block;
}

.cl-event-time {
  font-weight: 300;
  color: #666;
}

/* Hide duplicate time, description, and location in default card style */
.cl-event-card .cl-event-time {
  display: none !important;
}

.cl-event-card .cl-event-card-description {
  display: none !important;
}

.cl-event-card .cl-event-card-location {
  display: none !important;
}

/* Location - Merriweather font */
.cl-event-card-location {
  font-family: 'Merriweather', serif;
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 12px;
  line-height: 1.5;
}

/* Description - Merriweather font */
.cl-event-card-description {
  font-family: 'Merriweather', serif;
  font-size: 0.95rem;
  color: #666;
  line-height: 1.6;
  margin: 0 0 20px 0;
  flex-grow: 1;
}

/* Event Card Button - Use very specific selectors to override WordPress/Elementor styles */
.cl-events-widget .cl-event-card-button,
.cl-events-grid .cl-event-card-button,
.cl-event-card .cl-event-card-button,
a.cl-event-card-button {
  display: inline-block !important;
  font-family: 'Oswald', sans-serif !important;
  font-size: 1.1rem !important;
  font-weight: 500 !important;
  text-align: center !important;
  text-decoration: none !important;
  text-transform: uppercase !important;
  letter-spacing: 1px !important;
  color: #ffffff !important;
  background-color: #ba0c2f !important;
  padding: 12px 24px !important;
  border-radius: 0 !important;
  transition: all 0.3s ease !important;
  margin-top: auto !important;
  border: 2px solid #ba0c2f !important;
}

.cl-events-widget .cl-event-card-button:hover,
.cl-events-grid .cl-event-card-button:hover,
.cl-event-card .cl-event-card-button:hover,
a.cl-event-card-button:hover {
  background-color: #ffffff !important;
  color: #ba0c2f !important;
  border-color: #ba0c2f !important;
  text-decoration: none !important;
}

.cl-event-card-button:focus {
  outline: 2px solid #ba0c2f;
  outline-offset: 2px;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
  .cl-events-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .cl-events-grid {
    grid-template-columns: 1fr;
  }
  
  .cl-event-card-content {
    padding: 20px;
  }

  .cl-event-card-title {
    font-size: 1.3rem;
  }

  .cl-event-card-button {
    font-size: 1rem;
    padding: 10px 20px;
  }
}

@media (max-width: 480px) {
  .cl-event-card-image {
    height: 200px;
  }
}
