/* ============================================================
   Presenter Gallery — FLIP Card-to-Modal
   ============================================================ */

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.pres-hero {
  position: relative;
  min-height: 38vh;
  display: flex;
  align-items: flex-end;
  color: var(--cream-soft);
  padding: 5rem 1.5rem 3.5rem;
  overflow: hidden;
  isolation: isolate;
}
.pres-hero-inner { max-width: 1180px; margin: 0 auto; width: 100%; }
.pres-hero .logo-mark {
  width: clamp(110px, 18vw, 156px);
  height: clamp(110px, 18vw, 156px);
  margin: 0 auto 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.55));
}
.pres-hero .logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.pres-hero::before {
  content: "";
  position: absolute; inset: 0;
  background: url('../img/community.jpg') center/cover;
  z-index: -2;
  opacity: 0;
  animation: fadeIn 1.5s ease-out forwards;
}
.pres-hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(58, 36, 24, 0.25) 0%, rgba(58, 36, 24, 0.85) 100%);
  z-index: -1;
}
.pres-hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.8rem);
  color: var(--cream-soft);
  margin: 0.4rem 0;
}

.pres-body {
  padding: 3rem 1.5rem 5rem;
  position: relative;
  background-color: var(--cream-soft);
}
.pres-body::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(250,243,228,0.2) 0%, rgba(241,226,196,0.2) 100%), url('../img/festivals-bg.jpg') center/cover no-repeat;
  z-index: -1;
  opacity: 0;
  animation: fadeIn 1.5s ease-out forwards;
}
.pres-section-header {
  max-width: 900px;
  margin: 0 auto 1.5rem;
  text-align: center;
}
.pres-section-header .section-sub {
  margin-bottom: 1rem;
}
/* Presenters heading on the program page — larger, dark, prominent. */
#festPresenters.fest-subheading {
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  color: var(--brown-deep);
  margin: 3rem 0 0.6rem;
}
.pres-hint {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-size: 1.15rem;
  color: var(--gold-deep);
  text-align: center;
  margin: 0 0 1.6rem;
}
.pres-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.6rem;
  max-width: 1180px;
  margin: 0 auto;
}
.pres-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--gold);
  outline: 1px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.pres-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lift);
}

.pres-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.pres-noimg {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: 700;
  color: var(--gold);
  background: linear-gradient(135deg, rgba(212, 162, 76, 0.08) 0%, rgba(212, 162, 76, 0.18) 100%);
  user-select: none;
}

.pres-card h3 {
  font-size: 1.1rem;
  text-align: center;
  padding: 0.85rem 0.6rem 1rem;
  color: var(--brown-deep);
  margin: 0;
}

/* ============================================================
   Program timetable — day -> timeslot -> 3 room columns
   ============================================================ */

.prog-jump {
  max-width: 1180px;
  margin: 0 auto 1.75rem;
  text-align: center;
}
.prog-jump-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  color: var(--brown-deep);
  text-decoration: none;
  padding: 0.6rem 1.4rem;
  border: 1px solid var(--gold);
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-deep) 100%);
  color: var(--cream-soft);
  box-shadow: 0 8px 24px rgba(176, 130, 44, 0.35);
  transition: box-shadow 0.2s, transform 0.2s;
}
.prog-jump-link:hover {
  box-shadow: 0 12px 32px rgba(176, 130, 44, 0.5);
  transform: translateY(-2px);
}
.prog-jump-link span { transition: transform 0.2s; }
.prog-jump-link:hover span { transform: translateY(3px); }

.prog-timetable {
  max-width: 1180px;
  margin: 0 auto 3.5rem;
}
.prog-day { margin-bottom: 2.75rem; }
.prog-day-head {
  font-size: clamp(1.5rem, 3.2vw, 2.1rem);
  color: var(--brown-deep);
  text-align: center;
  margin: 0 0 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 2px solid var(--gold);
}

.prog-table {
  border: 1px solid rgba(212, 162, 76, 0.45);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  background: #fff;
}
.prog-row {
  display: grid;
  grid-template-columns: 88px repeat(var(--prog-rooms, 3), 1fr);
  border-top: 1px solid rgba(212, 162, 76, 0.28);
}
.prog-row:first-child { border-top: none; }
.prog-time {
  grid-column: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  color: var(--brown-deep);
  padding: 0.65rem 0.4rem;
  background: rgba(212, 162, 76, 0.16);
}
.prog-cell {
  grid-column: span var(--span);
  padding: 0.7rem 0.85rem;
  border-left: 1px solid rgba(212, 162, 76, 0.28);
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.15rem;
}
.prog-cell.is-shared {
  background: rgba(212, 162, 76, 0.16);
}
.prog-cell.is-shared .prog-cell-title {
  font-weight: 700;
}
.prog-cell.is-empty {
  background: repeating-linear-gradient(
    135deg,
    rgba(212, 162, 76, 0.04) 0,
    rgba(212, 162, 76, 0.04) 8px,
    transparent 8px,
    transparent 16px
  );
}
.prog-cell-title {
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.25;
  color: var(--brown-deep);
  text-transform: uppercase;
  letter-spacing: 0.01em;
}
.prog-cell-by {
  font-family: 'Cormorant Garamond', serif;
  font-size: 0.95rem;
  font-style: italic;
  color: var(--gold-deep, #b07d2b);
  line-height: 1.2;
}

/* Column header row */
.prog-colhead .prog-col-label {
  padding: 0.6rem 0.5rem;
  text-align: center;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brown-deep);
  background: rgba(212, 162, 76, 0.22);
  border-left: 1px solid rgba(212, 162, 76, 0.28);
}

@media (max-width: 720px) {
  .prog-row { grid-template-columns: 64px 1fr; }
  .prog-colhead { display: none; }
  .prog-cell {
    grid-column: 2 / -1 !important;
    border-left: 1px solid rgba(212, 162, 76, 0.28);
    border-top: 1px solid rgba(212, 162, 76, 0.18);
  }
  .prog-cell:first-of-type { border-top: none; }
  .prog-cell.is-empty { display: none; }
  .prog-time { font-size: 0.82rem; }
}

/* ---- Modal overlay ---- */
.pres-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.pres-modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.pres-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.20);
}
.pres-modal {
  position: absolute;
  z-index: 1;
  background: linear-gradient(180deg, var(--cream-soft) 0%, var(--cream) 100%);
  border: 4px solid var(--gold);
  border-radius: 4px;
  box-shadow: 0 40px 120px rgba(0,0,0,0.55), 0 0 0 1px rgba(212, 162, 76, 0.15);
  overflow: hidden;
  will-change: top, left, width, height, border-radius;
  backface-visibility: hidden;
  /* Extra top padding so the inner scroll area (and its scrollbar) starts
     below the close button rather than running up underneath it. */
  padding: 4.1rem 1.5rem 1.5rem;
  /* Column layout so the inner scroll area fills exactly the modal's content
     box (height minus padding) and can scroll its content all the way down. */
  display: flex;
  flex-direction: column;
}
.pres-modal-inner {
  will-change: opacity;
  /* Fill the modal's content box and scroll when content overflows. min-height:0
     lets a flex child actually shrink below its content size so overflow works. */
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 1.5rem 2.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Gorgeous dark scrollbar */
  scrollbar-width: thin;
  scrollbar-color: var(--gold) var(--cream);
}
.pres-modal-inner::-webkit-scrollbar {
  width: 10px;
}
.pres-modal-inner::-webkit-scrollbar-track {
  background: var(--cream);
  border-radius: 999px;
}
.pres-modal-inner::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold) 50%, var(--gold-deep) 100%);
  border: 2px solid var(--cream);
  border-radius: 999px;
  min-height: 40px;
}
.pres-modal-inner::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--gold) 0%, var(--gold-deep) 100%);
}
.pres-modal-inner::-webkit-scrollbar-corner {
  background: transparent;
}
.pres-modal-close {
  position: absolute;
  top: 1.2rem;
  right: 1.8rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  background: var(--cream-soft);
  color: var(--brown-deep);
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.2s, color 0.2s;
}
.pres-modal-close:hover {
  background: var(--gold);
  color: var(--cream-soft);
  transform: rotate(90deg);
}
.pres-modal-name {
  font-size: 2rem;
  color: var(--brown-deep);
  margin: 0 0 0.75rem;
  text-align: center;
}
.pres-modal-img {
  width: 320px;
  height: 320px;
  object-fit: cover;
  object-position: center top;
  border-radius: 10px;
  border: 2px solid var(--hairline);
  box-shadow: 0 8px 24px rgba(58, 36, 24, 0.15), 0 2px 6px rgba(58, 36, 24, 0.08);
  margin-bottom: 1rem;
}
.pres-workshops-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem 1.5rem;
  width: 100%;
  max-width: 520px;
  margin: 0 auto 1.25rem;
}
.pres-workshop-col {
  text-align: center;
  flex: 0 1 300px;
}
.pres-workshop-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  color: var(--brown-deep);
  margin-bottom: 0.3rem;
  line-height: 1.2;
}
.pres-workshop-desc {
  font-size: 0.88rem;
  color: var(--text-soft);
  line-height: 1.5;
  text-align: center;
}
.pres-modal-bio {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.6;
  text-align: center;
  max-width: 520px;
}
.pres-modal-bio p { margin: 0; }

/* Presenter contact link — gold text hyperlink, not a button */
.pres-modal-contact {
  margin-bottom: 1.25rem;
  text-align: center;
}
.pres-contact-link {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-style: italic;
  color: var(--gold-deep);
  text-decoration: underline;
  text-decoration-color: rgba(212, 162, 76, 0.4);
  text-underline-offset: 3px;
  transition: color 0.2s, text-decoration-color 0.2s;
}
.pres-contact-link:hover {
  color: var(--brown-deep);
  text-decoration-color: var(--gold);
}

/* ---- Responsive ---- */
@media (max-width: 1024px) { .pres-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) {
  .pres-grid { grid-template-columns: repeat(2, 1fr); gap: 1.2rem; }
  .pres-hero { min-height: 28vh; padding: 4rem 1.5rem 2.5rem; }
}
@media (max-width: 480px) {
  .pres-grid { grid-template-columns: 1fr; max-width: 360px; }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  .pres-hero::before,
  .pres-body::before {
    animation: none !important;
    opacity: 1 !important;
  }
}
