/* =========================================================================
   home.css — styles specific to the event HOMEPAGE
   -------------------------------------------------------------------------
   Load AFTER global.css. Covers the hero, photo strip, overview (organizer
   rich text), documents, sponsors, and leaderboard CTA sections.
   ========================================================================= */

/* ---- hero ---- */
.hero {
  background:
    radial-gradient(120% 130% at 100% 0%, var(--glow), transparent 58%),
    var(--paper);
}
.hero .container { padding-top: clamp(44px, 7vw, 44px); padding-bottom: clamp(44px, 7vw, 44px); }
.hero .eyebrow { margin-bottom: 16px; letter-spacing: .34em; }
.hero-title { font-family: var(--serif); font-weight: 600; font-size: clamp(34px, 6.4vw, 64px); line-height: 1; }
.rule { display: block; width: 56px; height: 2px; background: var(--primary); margin: 22px 0 16px; }
.hero-sub { font-size: clamp(12px, 1.6vw, 14px); color: var(--body); letter-spacing: .03em; }
.hero-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 28px; }
.hero-note { font-size: 12px; color: var(--soft); }

/* ---- past-event photo carousel ---- */
.photo-carousel { position: relative; }
.photo-strip {
  display: flex;
  gap: 3px;
  height: clamp(200px, 26vw, 320px);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.photo-strip::-webkit-scrollbar { display: none; }
.tile {
  position: relative;
  display: block;
  /* stretch to fill: up to 4 across fill the width; fewer stretch wider */
  flex: 1 0 calc((100% - 9px) / 4);
  scroll-snap-align: start;
  overflow: hidden;
  background: var(--tint);
}

/* paging arrows — shown by JS only when photos overflow */
.strip-nav {
  position: absolute; 
  top: 50%; 
  transform: translateY(-50%);
  z-index: 3;
  width: 46px; height: 46px;
  border: none; border-radius: 50%;
  background: rgba(23,39,30,.55); color: #fff;
  font-size: 26px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s ease;
}
.strip-nav:hover { background: rgba(23,39,30,.78); }
.strip-nav[hidden] { display: none; }
.strip-prev { left: 12px; }
.strip-next { right: 12px; }
/* uniform crop — mismatched uploads still form a clean band */
.tile img,
.tile .ph {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}
.tile .ph { background-image: var(--stripe); background-color: var(--tint); }
.tile:nth-child(even) .ph { background-color: var(--tint-2); }
.tile img { transition: transform .5s ease; }
.tile:hover img { transform: scale(1.04); }

/* 1–2 photos: fewer, taller feature tiles instead of skinny slivers */
.photo-strip--few { height: clamp(260px, 34vw, 440px); }

/* 7+ photos: last visible tile shows a "+N more" scrim */
.tile--more::after {
  content: attr(data-more);
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(23,39,30,.58);
  color: #fff;
  font-family: var(--mono);
  font-size: clamp(18px, 2.4vw, 28px);
  font-weight: 600;
  letter-spacing: .02em;
}
@media (max-width: 900px) { .tile { flex-basis: calc((100% - 6px) / 3); } }
@media (max-width: 640px) {
  .photo-strip { height: clamp(200px, 52vw, 300px); }
  .tile { flex-basis: calc((100% - 3px) / 2); }
  .strip-nav { width: 38px; height: 38px; font-size: 22px; }
}

/* ---- gallery lightbox ---- */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(16px, 4vw, 56px);
  background: rgba(10,18,14,.90);
}
.lightbox[hidden] { display: none; }
.lightbox-fig { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 100%; max-height: 100%; }
.lightbox-img {
  max-width: 100%; max-height: 82vh;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  object-fit: contain;
}
.lightbox-cap {
  color: rgba(255,255,255,.82);
  font-size: 13px; letter-spacing: .02em;
  text-align: center;
}
.lightbox-close {
  position: absolute; 
  top: 18px; 
  right: 20px;
  width: 42px; 
  height: 42px;
  border: none; 
  border-radius: 50%;
  background: rgba(255,255,255,.14); color: #fff;
  font-size: 18px; 
  cursor: pointer;
  margin: auto;
}
.lightbox-close:hover { background: rgba(255,255,255,.26); }
.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 52px; height: 52px;
  border: none; border-radius: 50%;
  background: rgba(255,255,255,.12); color: #fff;
  font-size: 30px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-nav:hover { background: rgba(255,255,255,.24); }
.lightbox-prev { left: clamp(12px, 3vw, 40px); }
.lightbox-next { right: clamp(12px, 3vw, 40px); }
.lightbox-count {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,.7);
  font-family: var(--mono); font-size: 12px; letter-spacing: .08em;
}
@media (max-width: 640px) {
  .lightbox-nav { width: 42px; height: 42px; font-size: 24px; }
}


/* ---- feature photos + welcome ---- */
.feature {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.feature-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(300px, 1.2fr);
}
.feature-photos {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.feature-img {
  width: 100%;
  flex: 1 1 auto;
  min-height: 260px;
  max-height: 560px;
  object-fit: cover;
  object-position: 50% 28%;
  display: block;
}
/* a lone photo keeps its taller feature presence */
.feature-photos .feature-img:only-child { min-height: 380px; height: 100%; }
.feature-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(24px, 4vw, 56px);
}
@media (max-width: 760px) {
  .feature-grid { grid-template-columns: 1fr; }
  .feature-img { min-height: 0; max-height: 70vw; }
  .feature-photos .feature-img:only-child { min-height: 0; }
}

/* ---- overview (organizer rich text) ---- */
.overview {
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.overview .container { padding-top: clamp(32px, 5vw, 48px); padding-bottom: clamp(32px, 5vw, 48px); }
.pill {
  display: inline-block;
  font-size: 8.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--primary);
  border: 1px dashed var(--primary);
  border-radius: 20px;
  padding: 4px 10px;
  margin-bottom: 18px;
  opacity: .8;
}
.prose { max-width: 640px; }
.prose h2 { font-family: var(--serif); font-weight: 600; font-size: clamp(24px, 3.4vw, 30px); line-height: 1.1; margin-bottom: 16px; }
.prose p { font-size: clamp(13px, 1.5vw, 14px); line-height: 1.72; color: var(--body); margin-bottom: 15px; }
.prose p:last-child { margin-bottom: 0; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { text-decoration: underline; text-underline-offset: 2px; }
.prose blockquote {
  margin: 22px 0;
  padding: 4px 0 4px 20px;
  border-left: 3px solid var(--primary);
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(18px, 2.3vw, 21px);
  line-height: 1.35;
  color: var(--ink);
}

/* ---- documents ---- */
.documents { background: var(--surface); border-bottom: 1px solid var(--line); }
.documents .container { padding-top: clamp(30px, 4.5vw, 40px); padding-bottom: clamp(30px, 4.5vw, 40px); }
.documents .section-label { margin-bottom: 18px; letter-spacing: .26em; }
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 12px;
}
.doc {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  max-width: 400px;
  background: var(--paper);
}
.doc:hover { opacity: 1; border-color: var(--primary); }
.doc-chip {
  flex: none;
  width: 40px; height: 40px;
  border-radius: 8px;
  background: var(--tint);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.doc-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.doc-name { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.doc-size { font-size: 11px; color: var(--soft); margin-top: 2px; }
.doc-view { flex: none; display: inline-flex; align-items: center; gap: 5px; color: var(--primary); font-size: 11.5px; font-weight: 600; }


/* ---- sponsors ---- */
.sponsors { border-bottom: 1px solid var(--line); }
.sponsors .container { padding-top: clamp(28px, 4vw, 36px); padding-bottom: clamp(28px, 4vw, 36px); }
.sponsors .section-label { margin-bottom: 16px; letter-spacing: .26em; }
.sponsor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr));
  gap: 14px;
}
.sponsor {
  height: 120px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background-color: #ffffff;
  display: flex; align-items: center; justify-content: center;
}
.sponsor::before {
  content: attr(data-label);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: .06em;
  color: rgba(0,0,0,.4);
}

.sponsor a:hover img { transform: scale(1.04); }

/* ---- leaderboard CTA ---- */
.cta-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding-top: clamp(30px, 4.5vw, 40px);
  padding-bottom: clamp(30px, 4.5vw, 40px);
}
.cta-title { font-family: var(--serif); font-weight: 600; font-size: clamp(21px, 2.6vw, 24px); line-height: 1; }
.cta-sub { font-size: 13px; color: var(--soft); margin-top: 6px; }

.docview { position: fixed; inset: 0; z-index: 110; display: flex; flex-direction: column; background: rgba(10,18,14,.90); }
.docview[hidden] { display: none; }
.docview-bar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px clamp(14px,3vw,28px); background: var(--primary); color: #fff; }
.docview-title { display: flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 600; min-width: 0; }
.docview-badge { flex: none; font-size: 10px; font-weight: 700; letter-spacing: .06em; background: rgba(255,255,255,.2); padding: 4px 8px; border-radius: 5px; }
.docview-btn { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 8px; background: rgba(255,255,255,.14); color: #fff; font-size: 12.5px; font-weight: 600; text-decoration: none; }
.docview-btn:hover { background: rgba(255,255,255,.26); }
.docview-close { width: 38px; height: 38px; border: none; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; cursor: pointer; }
.docview-stage { flex: 1; min-height: 0; position: relative; padding: clamp(10px,2.5vw,28px); overflow: auto; }
.docview-frame { width: 100%; height: 100%; border: none; border-radius: 6px; background: #fff; box-shadow: 0 16px 50px rgba(0,0,0,.4); }
.docview-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.7); }
@media (max-width: 640px) { .docview-btn span { display: none; } }
