/* Speakers Page Specific Styles */

.speakers {
  max-width: 1280px;
  margin: auto;
  padding: 3.5rem 2rem 5rem;
  background: transparent;
}

.speakers * {
  box-sizing: border-box;
}

.speakers .header {
  text-align: center;
  margin-bottom: 3rem;
}

.speakers .header h1 {
  color: var(--green-dark, #1F4F3A);
  margin: 0 0 .6rem 0;
}

.speakers .header p {
  max-width: 760px;
  margin: auto;
  color: var(--muted, #6b7280);
}

.speakers .filters {
  display: flex;
  gap: .9rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 2.25rem;
}

.speakers .filters button {
  padding: .65rem 1.5rem;
  border-radius: 999px;
  border: none;
  background: #e3e8e6;
  font-weight: 700;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}

.speakers .filters button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,.12);
}

.speakers .filters button.active {
  background: var(--green-primary, #2E6B4E);
  color: #fff;
}

.speakers .grid {
  display: grid !important;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto 2rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) !important;
  gap: var(--xl);
  align-items: stretch;
  padding: 0;
}

.speakers .photo {
  height: 220px;
}

@media (min-width: 1200px) {
  .speakers .grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

.speakers .card {
  background: var(--white, #ffffff);
  border-radius: var(--radius, 18px);
  box-shadow: 0 20px 50px rgba(0,0,0,.08);
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
  cursor: pointer;
  border: 1px solid var(--border, #E3E7E5);
  display: flex;
  flex-direction: column;
  height: 360px;
  width: 100%;
  min-width: 0;
}

.speakers .card:hover {
  transform: translateY(-6px);
  box-shadow: 0 28px 70px rgba(0,0,0,.12);
}

.speakers .photo {
  height: 220px;
  max-height: 220px;
  background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #374151;
  letter-spacing: .02em;
  overflow: hidden;
  position: relative;
  width: 100%;
  flex-shrink: 0; /* Prevent photo container from shrinking */
}

.speakers .photo img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top; /* Prioritize faces which are usually at top */
  display: block;
  transition: transform 0.3s ease;
}

/* Zoom effect on hover */
.speakers .card:hover .photo img {
  transform: scale(1.05);
}

/* Loading state - shimmer effect */
/* Show shimmer for photos without loaded images */
.speakers .photo::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.3) 50%,
    transparent 100%
  );
  animation: shimmer 2s infinite;
  z-index: 1;
}

/* Stop shimmer animation once image has loaded (class-based for broad compatibility) */
.speakers .photo.image-loaded::before {
  animation: none;
  opacity: 0;
}

.speakers .photo img[src] {
  z-index: 2;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Special adjustment for photos with different composition */
.speakers .photo-adjust-center img {
  object-position: center center;
}

.speakers .card-body {
  padding: 1.6rem 1.2rem;
  text-align: center;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .35rem;
}

.speakers .name {
  font-weight: 800;
  color: var(--green-dark, #1F4F3A);
  margin-bottom: .25rem;
  font-size: 1rem;
  line-height: 1.3;
  word-break: break-word;
}

.speakers .role {
  font-size: .85rem;
  font-weight: 600;
  color: #374151;
  line-height: 1.3;
}

.speakers .org {
  font-size: .75rem;
  color: var(--muted, #6b7280);
  margin-top: .25rem;
  line-height: 1.3;
}

.speakers .modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.speakers .modal.active { display: flex; }

.speakers .modal-box {
  background: #fff;
  border-radius: 18px;
  max-width: 520px;
  width: 90%;
  padding: var(--xl);
  box-shadow: 0 10px 30px rgba(0,0,0,.12);
}

.speakers .modal-box h3 {
  color: var(--green-dark, #1F4F3A);
  margin-top: 0;
  margin-bottom: var(--sm);
}

.speakers .modal-box p {
  color: var(--muted, #6b7280);
  line-height: 1.6;
}

.speakers .close-btn {
  margin-top: 1.5rem;
  padding: .6rem 1.6rem;
  border-radius: 999px;
  border: none;
  background: var(--green-primary, #2E6B4E);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 600px) {
  .speakers .photo {
    height: 180px;
    max-height: 180px;
  }
  .speakers .photo img {
    object-position: center center; /* Center on mobile */
  }
  .speakers .grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
    gap: var(--md);
  }
  .speakers .card {
    height: 310px;
  }
  .speakers .card-body {
    padding: 1rem 0.8rem;
    gap: .2rem;
  }
  .speakers .name {
    font-size: 0.9rem;
  }
  .speakers .role {
    font-size: 0.75rem;
  }
  .speakers .org {
    font-size: 0.65rem;
  }
}

@media (min-width: 601px) and (max-width: 900px) {
  .speakers .photo {
    height: 200px;
    max-height: 200px;
  }
  .speakers .grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
  }
  .speakers .card {
    height: 340px;
  }
  .speakers .card-body {
    padding: 1.2rem 1rem;
    gap: .3rem;
  }
  .speakers .name {
    font-size: 0.95rem;
  }
  .speakers .role {
    font-size: 0.8rem;
  }
  .speakers .org {
    font-size: 0.7rem;
  }
}

@media (min-width: 901px) and (max-width: 1200px) {
  .speakers .photo {
    height: 220px;
    max-height: 220px;
  }
  .speakers .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
  .speakers .card {
    height: 360px;
  }
}
