/* EVENT PAGE SPECIFIC STYLES
- Hero text bits
- Section headings / grids for speakers / teams
*/

/* small helper if your global CSS doesn't already have this */
.is-hidden {
  display: none !important;
}

/* ----- EVENT HERO LAYOUT ----- */

.event-hero {
  background: transparent;
  --hero-img-height: 520px;
}

.event-hero .team-inner {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5.2rem);
  max-width: min(1200px, 95vw);
}

.event-hero .team-stack {
  margin: 0;
  max-width: 100%;
  justify-self: stretch;
  --rect-w: 98%;
  --img-w: 86%;
  min-height: calc(var(--hero-img-height) + 52px);
}

.event-hero .team-image-wrap {
  width: var(--img-w);
}

.event-hero .team-text {
  margin-top: 0;
  max-width: 560px;
}

.team-text a,
.team-intro a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.team-text a:hover,
.team-text a:focus-visible,
.team-intro a:hover,
.team-intro a:focus-visible {
  border-color: rgba(235, 0, 40, 0.35);
  outline: none;
}

.event-switcher {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.5rem;
}

.event-switcher[hidden] {
  display: none !important;
}

.event-switcher__label {
  font-size: 0.75rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

.event-switcher__options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.event-switcher__option {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.event-switcher__option:hover,
.event-switcher__option:focus-visible {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.event-switcher__option.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

@media (max-width: 900px) {
  .event-hero .team-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .event-hero .team-stack {
    --img-w: 92%;
    --rect-w: 96%;
    min-height: calc(var(--hero-img-height) + 32px);
  }
  .event-hero .team-text {
    margin-inline: auto;
  }
}

@media (min-width: 1100px) {
  .event-hero .team-inner {
    max-width: min(1320px, 96vw);
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  }
  .event-hero .team-stack {
    --rect-w: 100%;
    --img-w: 96%;
    min-height: calc(var(--hero-img-height) + 72px);
  }
}

/* ----- HERO EYEBROW + META ----- */

.event-hero .event-eyebrow {
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

/* eventName already styled via .team-title in team.css */

.event-meta {
  margin: 0.35rem 0 0.5rem;
  font-size: 0.9rem;
  color: var(--muted-strong, var(--muted));
}

/* ----- GENERIC EVENT SECTIONS ----- */

.event-section {
  padding-top: 2.5rem;
  padding-bottom: 3rem;
}

.event-section-header {
  margin-bottom: 1.5rem;
}

.event-section-header h2 {
  font-size: clamp(1.6rem, 3vw, 2rem);
  font-weight: 900;
  color: var(--accent);
}

/* Shared Grid and Glassy LinkedIn Icon */
.event-people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  justify-items: center;
}

.event-person-card .linkedin {
  position: absolute;
  right: 12px; top: 12px;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 10px; z-index: 10; pointer-events: auto;
  background: linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.06));
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(6px); box-shadow: 0 8px 20px rgba(2,6,23,0.08);
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.event-person-card .linkedin img {
  width: 18px; height: 18px; object-fit: contain; filter: drop-shadow(0 0 2px rgba(0,0,0,0.2));
}
.event-person-card .linkedin:hover,
.event-person-card .linkedin:focus {
  transform: translateY(-2px);
  background: linear-gradient(180deg, rgba(255,255,255,0.22), rgba(255,255,255,0.10));
  box-shadow: 0 10px 26px rgba(2,6,23,0.12);
}

/* --- LEGACY LAYOUT (Pre-2026) --- */
.event-person-card.legacy {
  position: relative; padding: 1.4rem; border-radius: 20px;
  background: var(--surface, rgba(15, 23, 42, 0.82));
  color: var(--text, #fff);
  box-shadow: 0 22px 50px rgba(15, 23, 42, 0.36);
  display: flex; flex-direction: column; align-items: center; gap: 0.9rem;
  text-align: center; width: 100%; max-width: 360px; margin: 0 auto;
}
.event-person-card.legacy .event-person-avatar {
  width: clamp(108px, 18vw, 184px); height: clamp(108px, 18vw, 184px);
  border-radius: 50%; overflow: hidden; background: rgba(255, 255, 255, 0.08);
  position: relative; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; border: 1px solid rgba(255, 255, 255, 0.12);
}
.event-person-card.legacy .event-person-avatar img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.event-person-card.legacy .event-person-avatar span {
  font-size: clamp(1.4rem, 4vw, 2rem); font-weight: 800; color: var(--accent);
}
.event-person-card.legacy .event-person-name { font-weight: 700; margin-bottom: 0.25rem; font-size: 1.1rem; color: var(--text, #fff); }
.event-person-card.legacy .event-person-role { font-size: 0.84rem; color: var(--accent); font-weight: 700; letter-spacing: 0.04em; }


/* --- NEW 3D CARD LAYOUT (2026+) --- */
.event-person-card.new-era {
  position: relative; width: 100%; max-width: 320px; height: 420px;
  border-radius: 20px; overflow: hidden; cursor: pointer;
  background: var(--surface); box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s ease;
  margin: 0 auto; perspective: 1000px; transform-style: preserve-3d;
}
.event-person-card.new-era:hover {
  transform: translateY(-8px); box-shadow: 0 22px 45px rgba(0, 0, 0, 0.25);
}
.event-person-photo {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  width: 100%; height: 100%; object-fit: cover; z-index: 1; transition: transform 0.5s ease;
}
.event-person-card.new-era:hover .event-person-photo { transform: scale(1.05); }
.event-person-card.new-era .portrait--placeholder {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--accent), rgba(0,0,0,0.8));
  color: #fff; font-size: 4rem; font-weight: 800;
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
}
.event-person-gradient {
  position: absolute; bottom: 0; left: 0; right: 0; height: 75%;
  background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.6) 50%, transparent 100%);
  z-index: 2; pointer-events: none;
}
.event-person-content {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 1.6rem 1.2rem 1rem; z-index: 3; color: #fff;
  display: flex; flex-direction: column; pointer-events: none;
  align-items: flex-start;
  text-align: left;
}
.event-person-name { font-weight: 800; font-size: 1.2rem; margin: 0 0 0.2rem; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,0.45); }
.event-person-role { font-size: 0.78rem; color: var(--accent); margin-bottom: 0.5rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.event-person-bio-short {
  font-size: 0.83rem; color: #e8e8e8; line-height: 1.4; margin-bottom: 0.75rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis;
  -webkit-mask-image: linear-gradient(to bottom, #000 30%, transparent 100%);
}
.event-person-arrow { text-align: center; color: rgba(255,255,255,0.8); animation: float 2s ease-in-out infinite; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(5px); } }

/* --- 3D FLIP MODAL STYLES --- */
.person-modal-overlay {
  position: fixed; inset: 0; z-index: 99999;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.4s ease;
  padding: 1rem;
}

.person-modal-overlay.active {
  opacity: 1; pointer-events: auto;
}

.person-modal {
  background: var(--surface); color: var(--text);
  width: min(100%, 900px); max-width: 900px; max-height: 85vh;
  border-radius: 20px; overflow: hidden;
  display: flex; flex-direction: row; align-items: stretch;
  height: auto;
  box-shadow: 0 30px 60px rgba(0,0,0,0.4);
  /* 3D Flip Entrance */
  transform: perspective(1200px) rotateX(15deg) scale(0.95);
  opacity: 0; transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.person-modal-overlay.active .person-modal {
  transform: perspective(1200px) rotateX(0) scale(1); opacity: 1;
}

.person-modal-img {
  width: 45%; min-height: 55vh; max-height: 85vh;
  background: #000; display: flex; align-items: center; justify-content: center; overflow: hidden;
}

.person-modal-img img,
.person-modal-img .person-modal-img-content {
  width: 100%; height: auto; max-height: 85vh; object-fit: contain; display: block;
  opacity: 1; transition: opacity 0.3s ease;
}

@media (max-width: 768px) {
  .person-modal {
    flex-direction: column;
    max-height: 95vh;
  }
  .person-modal-img {
    width: 100%; height: 35vh;
  }
  .person-modal-body {
    width: 100%; padding: 1.25rem;
  }
}

.person-modal-body {
  padding: 3rem 2.5rem; width: 55%; overflow-y: auto;
  position: relative; display: flex; flex-direction: column; color: var(--text, #111);
  min-height: 100%;
}
.person-modal-body h2 {
  margin: 0 0 0.4rem; font-size: clamp(1.3rem, 2.4vw, 2rem); line-height: 1.2;
  color: var(--text, #111); font-weight: 900;
}
.person-modal-body .person-modal-role {
  margin: 0 0 1rem; color: var(--accent, #eb0028); font-size: 0.82rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em;
}
.person-modal-body .person-modal-bio {
  font-size: 0.95rem; line-height: 1.5; color: var(--text, #222);
  margin-bottom: 1.25rem;
}
.person-modal-body .person-modal-bio p {
  margin-bottom: 0.6rem;
}
.person-modal-body .person-modal-linkedin {
  margin-top: auto; align-self: flex-start;
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.6rem 1rem; border-radius: 10px; border: 1px solid rgba(0,0,0,0.1);
  background: rgba(234, 57, 136, 0.08); color: var(--accent, #eb0028);
  text-decoration: none; font-size: 0.85rem; font-weight: 700;
}

.person-modal-close {
  position: absolute; top: 1.5rem; right: 1.5rem;
  background: var(--bg); color: var(--text);
  border: 1px solid rgba(128,128,128,0.2); border-radius: 50%;
  width: 40px; height: 40px; font-size: 1.6rem; line-height: 1;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease; z-index: 10;
}

.person-modal-close:hover {
  background: rgba(128,128,128,0.1); transform: scale(1.05);
}

.person-modal-title {
  font-size: 2.2rem; font-weight: 900; margin: 0 0 0.2rem; line-height: 1.1;
}

.person-modal-role {
  font-size: 1.1rem; color: var(--accent); margin-bottom: 2rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
}

.person-modal-bio {
  position: relative;
  font-size: 1.01rem; line-height: 1.5; color: var(--muted);
  white-space: pre-line; /* Preserves paragraphs */
  padding-right: 0.2rem;
  overflow-y: auto;
}

.person-modal-bio p {
  margin: 0 0 0.6rem;
}

.person-modal-bio::before,
.person-modal-bio::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 2.8rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.24s ease;
}

.person-modal-bio::before {
  top: 0;
  background: linear-gradient(to bottom, rgba(20, 24, 28, 0.20), rgba(20, 24, 28, 0));
}

.person-modal-bio::after {
  bottom: 0;
  background: linear-gradient(to top, rgba(20, 24, 28, 0.20), rgba(20, 24, 28, 0));
}

html[data-theme="dark"] .person-modal-bio::before {
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0));
}

html[data-theme="dark"] .person-modal-bio::after {
  background: linear-gradient(to top, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0));
}

.person-modal-bio.has-top-fade::before,
.person-modal-bio.has-bottom-fade::after {
  opacity: 0.95;
}

.person-modal-bio.has-top-fade::before,
.person-modal-bio.has-bottom-fade::after {
  opacity: 1;
}

.person-modal-bio.has-bottom-fade::after {
  opacity: 1;
}

.linkedin-modal-link {
  display: inline-flex; align-items: center; gap: 0.5rem; margin-top: 2rem;
  font-weight: 700; color: var(--text); text-decoration: none;
  padding: 0.8rem 1.6rem; border-radius: 12px;
  background: var(--bg); border: 1px solid rgba(128,128,128,0.2);
  width: fit-content; transition: all 0.2s;
}

.linkedin-modal-link:hover {
  background: var(--accent); color: #fff; border-color: var(--accent);
}

@media (max-width: 768px) {
  .person-modal { flex-direction: column; max-height: 90vh; }
  .person-modal-img { width: 100%; height: 35vh; }
  .person-modal-body { width: 100%; padding: 2rem 1.5rem; }
}


/* ----- TEAM SECTIONS ----- */

.event-team-section {
  margin-bottom: 3rem;
}

.event-team-header {
  margin-bottom: 1.5rem;
}

.event-team-header h3 {
  font-size: clamp(1.3rem, 2.5vw, 1.6rem);
  font-weight: 800;
}

/* The actual grid card styling comes from team.css (team-grid, cols, col, portrait-wrap, etc.) */
.portrait--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  color: var(--accent);
  font-weight: 800;
  font-size: clamp(1.4rem, 4vw, 1.8rem);
  text-transform: uppercase;
}

/* ----- REVEAL ANIMATIONS ----- */

.animate-once {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  will-change: opacity, transform;
}

.animate-once.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.portrait-wrap {
  overflow: hidden;
  position: relative;
}

.portrait-wrap.revealed img {
  transform: scale(1);
  filter: blur(0px);
}

.portrait-wrap img {
  transition: transform 0.8s ease, filter 0.8s ease;
  transform: scale(1.1);
  filter: blur(2px);
  will-change: transform, filter;
}

/* ----- 3D FLIP MODAL STYLES ----- */

.event-person-card.new-era {
  perspective: 1000px;
  cursor: pointer;
}

.event-person-card.new-era .card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.8s;
  transform-style: preserve-3d;
}

.event-person-card.new-era.flipped .card-inner {
  transform: rotateY(180deg);
}

.event-person-card.new-era .card-front,
.event-person-card.new-era .card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  border-radius: 12px;
  overflow: hidden;
}

.event-person-card.new-era .card-front {
  background: var(--surface);
}

.event-person-card.new-era .card-back {
  background: var(--surface);
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.5rem;
  color: var(--text);
}

.event-person-card.new-era .card-back .person-name {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.event-person-card.new-era .card-back .person-role {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.event-person-card.new-era .card-back .person-bio {
  font-size: 0.85rem;
  line-height: 1.4;
  flex: 1;
  overflow-y: auto;
}

.event-person-card.new-era .card-back .linkedin-link {
  margin-top: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #0077b5;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.event-person-card.new-era .card-back .linkedin-link svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 640px) {
  .event-section {
    padding-top: 2rem;
    padding-bottom: 2.3rem;
  }
  .event-people-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
  }
  .event-person-card.legacy {
    max-width: min(320px, 100%);
  }
}

@media (max-width: 480px) {
  .event-people-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}