/**
 * Lubab Events - Frontend Styles
 */

.lubab-events-container {
  margin: 20px 0;
}

/* List / Grid — pill toggle (matches card borders + gold accent #dfb059) */
.lubab-events-toolbar {
  display: flex;
  margin-bottom: 16px;
  align-items: center;
}

.lubab-events-pill-track {
  display: inline-flex;
  align-items: stretch;
  background: #f8f9fa;
  border: 1px solid #e1e1e1;
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

.lubab-events-view-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 36px;
  padding: 8px 14px;
  margin: 0;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  background: transparent;
  color: #777;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.lubab-events-view-btn:hover {
  color: #333;
}

.lubab-events-view-btn:focus {
  outline: none;
}

.lubab-events-view-btn:focus-visible {
  outline: 2px solid #dfb059;
  outline-offset: 2px;
}

.lubab-events-view-btn.is-active {
  background: #ffffff;
  color: #333;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(223, 176, 89, 0.45);
}

.lubab-events-view-icon {
  display: block;
  flex-shrink: 0;
  pointer-events: none;
}

/* WordPress screen reader text helper (if theme lacks it) */
.lubab-events-toolbar .screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

/* Feed: layout toggled via .lubab-events-view-list | .lubab-events-view-grid */
.lubab-events-feed.lubab-events-view-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin: 20px 0;
}

.lubab-events-feed.lubab-events-view-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 20px 0;
}

.lubab-events-view-grid .lubab-event-card {
  height: 100%;
}

.lubab-events-view-list .lubab-event-card {
  height: auto;
}

/* Card shell */
.lubab-event-card {
  position: relative;
  background: #ffffff;
  border: 1px solid #e1e1e1;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 18px -6px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.lubab-event-card:hover {
  box-shadow: 0 14px 24px rgba(0, 0, 0, 0.5);
  transform: translateY(-2px);
}

.event-card-inner {
  display: flex;
  width: 100%;
  min-height: 0;
  flex: 1;
}

.lubab-events-view-grid .event-card-inner {
  flex-direction: column;
}

.lubab-events-view-list .event-card-inner {
  flex-direction: row;
  align-items: stretch;
}

.event-card-media {
  background: #f0f1f3;
  position: relative;
  overflow: hidden;
}

.lubab-events-view-grid .event-card-media {
  flex: none;
  width: 100%;
  min-height: 160px;
  max-height: 220px;
}

.lubab-events-view-list .event-card-media {
  flex: 0 0 min(240px, 38%);
  max-width: 280px;
  min-height: 160px;
}

.event-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  margin: 0;
}

.lubab-events-view-grid .event-card-media img {
  border-radius: 8px;
}

.event-card-media-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 160px;
  background: linear-gradient(135deg, #e8eaed 0%, #f5f6f7 100%);
}

.event-card-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.lubab-events-view-grid .event-card-main {
  padding: 20px;
}

.lubab-events-view-list .event-card-main {
  padding: 20px;
  gap: 12px;
}

.event-title {
  margin: 0 0 15px 0;
  font-size: 1.4em;
  line-height: 1.3;
}

.lubab-events-view-grid .event-title {
  min-height: 2.6em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lubab-events-view-list .event-title {
  margin-bottom: 8px;
  font-size: 1.35em;
}

.event-date {
  margin-bottom: 15px;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 4px;
  border-left: 4px solid #dfb059;
}

.event-date strong {
  color: #333;
  font-size: 1.1em;
}

.event-time {
  color: #666;
  font-size: 0.9em;
}

.event-location,
.event-instructor {
  margin: 8px 0;
  padding: 6px 10px;
  background: #f8f9fa;
  border-radius: 4px;
  font-size: 0.75em;
  color: #555;
}

.event-location strong,
.event-instructor strong {
  color: #333;
  margin-right: 5px;
}

.event-description {
  margin-bottom: 20px;
  color: #666;
  line-height: 1.6;
  flex: 1;
}

.lubab-events-view-list .event-description {
  margin-bottom: 0;
}

.event-description p {
  margin: 0 0 10px 0;
}

.lubab-events-view-list .event-description p:last-child {
  margin-bottom: 0;
}

.read-more {
  font-size: 0.75rem !important;
}

/* Grid-only vs list-only sections */
.lubab-events-view-grid .event-meta-compact--list-only {
  display: none !important;
}

.lubab-events-view-list .event-date--grid-only,
.lubab-events-view-list .event-location--grid-only,
.lubab-events-view-list .event-instructor--grid-only {
  display: none !important;
}

.event-meta-compact {
  display: none;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #eee;
  font-size: 0.85em;
  color: #555;
}

.lubab-events-view-list .event-meta-compact--list-only {
  display: flex;
}

.event-meta-compact__item {
  display: inline-block;
  max-width: 100%;
}

.event-details-btn,
.event-register-btn {
  padding: 8px 16px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 0.9em;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  display: inline-block;
}

.event-details-btn {
  background: #0073aa;
  color: #fff;
}

.event-details-btn:hover {
  background: #005a87;
  color: #fff;
}

.event-register-btn {
  background: #28a745;
  color: #fff;
}

.event-register-btn:hover {
  background: #218838;
  color: #fff;
}

/* Individual Event Page Styles - Simplified for iframe-only display */
.lubab-event-page {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100vh;
}

.event-page-container {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100vh;
}

.regfox-container {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100vh;
}

.regfox-container iframe {
  width: 100% !important;
  height: 100vh !important;
  border: none;
  margin: 0;
  padding: 0;
}

/* Event Page Body Reset */
.lubab-event-page body {
  margin: 0;
  padding: 0;
}

/* Registration Closed Message */
.form-message {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100vh;
  text-align: center;
  background: #f8f9fa;
  padding: 40px;
}

.form-message h1 {
  color: #dc3545;
  font-size: 2.5rem;
  margin-bottom: 20px;
  font-weight: bold;
}

.form-message p {
  color: #6c757d;
  font-size: 1.2rem;
  margin: 0;
}

/* Infinite scroll [lubab_events_infinite]: same grid/cards; loading/end use event-date accents */
.lubab-events-infinite-sentinel {
  min-height: 1px;
  pointer-events: none;
}

.lubab-events-infinite--busy .lubab-events-feed {
  opacity: 0.92;
}

.lubab-events-infinite-loading,
.lubab-events-infinite-end {
  margin: 15px 0 0;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 4px;
  border-left: 4px solid #dfb059;
  color: #555;
  font-size: 0.9em;
  text-align: center;
}

.lubab-events-infinite-loading:not([hidden]) {
  color: #666;
}

.lubab-events-infinite-end:not([hidden]) {
  margin-top: 15px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .lubab-events-feed.lubab-events-view-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .lubab-events-view-grid .event-card-main,
  .lubab-events-view-list .event-card-main {
    padding: 15px;
  }

  .lubab-events-view-list .event-card-inner {
    flex-direction: column;
  }

  .lubab-events-view-list .event-card-media {
    flex: none;
    max-width: none;
    width: 100%;
    min-height: 180px;
    max-height: 220px;
  }
}
