/* ==========================================================================
   ADTTC — Gallery & Admin shared styles
   Used by gallery.html and admin.html (loaded after css/styles.css)
   ========================================================================== */

/* ---------- Page banner (both pages) ---------- */
.page-banner {
  background: var(--black);
  color: var(--white);
  padding: 168px 0 64px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.page-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 900px 500px at 85% 0%, var(--red-glow), transparent 60%);
  pointer-events: none;
}
.page-banner .container { position: relative; z-index: 1; }
.page-banner .eyebrow { justify-content: center; }
.page-banner h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.2rem);
  margin-bottom: 14px;
}
.page-banner p {
  color: var(--grey-light);
  max-width: 560px;
  margin: 0 auto;
  font-size: 1.02rem;
}
.page-banner .back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 26px;
  color: var(--grey-light);
  font-weight: 600;
  font-size: 0.92rem;
}
.page-banner .back-link:hover { color: var(--white); }
.page-banner .back-link svg { width: 16px; height: 16px; }

/* ---------- Gallery: state messages ---------- */
.gallery-state {
  max-width: 520px;
  margin: 0 auto;
  text-align: center;
  padding: 60px 24px;
  color: var(--grey);
}
.gallery-state svg { width: 40px; height: 40px; color: var(--grey-light); margin: 0 auto 16px; }
.gallery-state h3 { font-family: var(--font-display); font-size: 1.2rem; color: var(--black); margin-bottom: 10px; }
.gallery-state.is-error h3 { color: var(--red); }

/* ---------- Gallery: albums ---------- */
.gallery-page-main { padding: 72px 0 100px; }
.album-block { margin-bottom: 72px; }
.album-block:last-child { margin-bottom: 0; }
.album-head { max-width: 720px; margin-bottom: 28px; }
.album-head h2 { font-family: var(--font-display); font-size: clamp(1.4rem, 3vw, 1.9rem); margin-bottom: 8px; }
.album-head p { color: var(--grey); font-size: 0.98rem; }

/* ---------- Yearly timeline (shared by the public gallery and the admin dashboard) ---------- */
.year-timeline { position: relative; }
.year-group {
  position: relative;
  padding-left: 92px;
  margin-bottom: 72px;
}
.year-group:last-child { margin-bottom: 0; }
.year-group::before {
  content: '';
  position: absolute;
  left: 33px;
  top: 40px;
  bottom: -72px;
  width: 2px;
  background: #e2e2e6;
}
.year-group:last-child::before { display: none; }
.year-marker {
  position: absolute;
  left: 0;
  top: 2px;
  min-width: 68px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--red);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 0.92rem;
  letter-spacing: 0.01em;
  box-shadow: 0 6px 16px rgba(232,17,45,0.35);
  z-index: 1;
}
.year-heading {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.6vw, 2.3rem);
  margin-bottom: 28px;
  padding-top: 2px;
}
.gallery-page-main .year-heading { color: var(--black); }
@media (max-width: 640px) {
  .year-group { padding-left: 64px; }
  .year-group::before { left: 21px; }
  .year-marker { min-width: 48px; height: 28px; padding: 0 8px; font-size: 0.72rem; }
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 20px;
}
.photo-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--off-white);
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
}
.photo-card:hover { transform: translateY(-4px); box-shadow: 0 16px 30px rgba(0,0,0,0.14); }
.photo-card .photo-img-wrap { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--charcoal); }
.photo-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-card .photo-caption {
  padding: 12px 14px;
  font-size: 0.86rem;
  color: var(--grey);
  line-height: 1.4;
}
.photo-card .photo-caption:empty { display: none; }

.medal-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.35);
  border: 2px solid rgba(255,255,255,0.85);
  z-index: 2;
}
.medal-badge svg { width: 20px; height: 20px; }
.medal-badge.medal-gold   { background: linear-gradient(145deg, #ffe27a, #d8a01c); }
.medal-badge.medal-silver { background: linear-gradient(145deg, #f2f2f2, #b0b0b6); }
.medal-badge.medal-bronze { background: linear-gradient(145deg, #e6a06a, #a4632c); }
.medal-badge svg { color: #3a2c05; }
.medal-badge.medal-silver svg { color: #3a3a3d; }
.medal-badge.medal-bronze svg { color: #3a2107; }

.video-play-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.video-play-badge svg {
  width: 52px;
  height: 52px;
  color: var(--white);
  background: rgba(11,11,13,0.55);
  border-radius: 50%;
  padding: 12px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.35);
}
.admin-photo-card .video-play-badge svg { width: 36px; height: 36px; padding: 9px; }

/* ---------- Lightbox ---------- */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11,11,13,0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 32px;
}
.lightbox-overlay.open { display: flex; }
.lightbox-box { max-width: 900px; max-height: 90vh; width: 100%; display: flex; flex-direction: column; align-items: center; }
.lightbox-media { width: 100%; display: flex; justify-content: center; }
.lightbox-media img { max-width: 100%; max-height: 72vh; border-radius: 10px; object-fit: contain; }
.lightbox-media iframe { width: 100%; aspect-ratio: 16 / 9; max-height: 72vh; border: 0; border-radius: 10px; }
.lightbox-box .lightbox-caption { color: var(--grey-light); text-align: center; margin-top: 16px; font-size: 0.95rem; max-width: 640px; }
.lightbox-close {
  position: absolute;
  top: 24px;
  right: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.25);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.lightbox-close svg { width: 18px; height: 18px; }

/* ==========================================================================
   Admin page
   ========================================================================== */
.admin-main { padding: 56px 0 100px; }

.admin-login {
  max-width: 400px;
  margin: 0 auto;
  background: var(--charcoal);
  color: var(--white);
  border-radius: var(--radius);
  padding: 40px 36px;
}
.admin-login h2 { font-family: var(--font-display); font-size: 1.4rem; margin-bottom: 8px; }
.admin-login p.form-sub { color: var(--grey); font-size: 0.9rem; margin-bottom: 24px; }

.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field label { font-size: 0.85rem; font-weight: 600; color: var(--grey-light); }
.field input,
.field select,
.field textarea {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.95rem;
}
.field input::placeholder, .field textarea::placeholder { color: var(--grey); }
.field textarea { resize: vertical; min-height: 72px; }

/* Light-background variant of fields, used inside album/photo cards on white bg */
.field.field-light input,
.field.field-light select,
.field.field-light textarea {
  background: var(--white);
  border: 1px solid #e2e2e6;
  color: var(--black);
}
.field.field-light label { color: var(--grey); }

.form-error {
  background: rgba(232,17,45,0.12);
  border: 1px solid rgba(232,17,45,0.4);
  color: #ff8a97;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 0.85rem;
  margin-bottom: 16px;
  display: none;
}
.form-error.show { display: block; }
.form-error.on-light { color: var(--red-dark); background: rgba(232,17,45,0.08); }

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 36px;
}
.admin-topbar h1 { font-family: var(--font-display); font-size: 1.7rem; }
.admin-topbar .admin-user { color: var(--grey); font-size: 0.9rem; }

.admin-actions-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 44px; }

.btn-small { padding: 9px 18px; font-size: 0.83rem; }
.btn-outline {
  background: transparent;
  border: 2px solid #dcdce0;
  color: var(--black);
}
.btn-outline:hover { border-color: var(--black); background: var(--off-white); }
.btn-danger {
  background: transparent;
  border: 2px solid rgba(232,17,45,0.4);
  color: var(--red);
}
.btn-danger:hover { background: var(--red); color: var(--white); border-color: var(--red); }

.toggle-row { display: flex; align-items: center; gap: 10px; font-size: 0.88rem; color: var(--grey); }
.toggle-row input { width: 18px; height: 18px; accent-color: var(--red); }

.admin-album-card {
  background: var(--white);
  border: 1px solid #e6e6ea;
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 28px;
}
.admin-album-card.is-hidden { opacity: 0.55; }
.admin-album-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.admin-album-head h3 { font-family: var(--font-display); font-size: 1.2rem; margin-bottom: 6px; }
.admin-album-head p { color: var(--grey); font-size: 0.9rem; max-width: 480px; }
.admin-album-head .status-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: 100px;
  background: rgba(23,201,100,0.12);
  color: #128a45;
  margin-left: 10px;
  vertical-align: middle;
}
.admin-album-head .status-pill.hidden-pill { background: rgba(138,138,146,0.15); color: var(--grey); }

.admin-album-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.admin-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.admin-photo-card {
  border: 1px solid #e6e6ea;
  border-radius: 12px;
  overflow: hidden;
  background: var(--off-white);
}
.admin-photo-card.is-hidden { opacity: 0.5; }
.admin-photo-card .photo-img-wrap { position: relative; aspect-ratio: 4/3; background: var(--charcoal); }
.admin-photo-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.admin-photo-card .admin-photo-body { padding: 12px; display: grid; gap: 8px; }
.admin-photo-card .admin-photo-body select,
.admin-photo-card .admin-photo-body textarea { width: 100%; font-size: 0.82rem; padding: 8px 10px; border-radius: 8px; border: 1px solid #dcdce0; font-family: var(--font-body); }
.admin-photo-card .admin-photo-body textarea { min-height: 50px; resize: vertical; }
.admin-photo-card .admin-photo-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.admin-photo-card .admin-photo-footer .toggle-row { font-size: 0.78rem; }

.upload-drop {
  border: 2px dashed #dcdce0;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  color: var(--grey);
  font-size: 0.88rem;
  margin-top: 18px;
}
.upload-drop input[type=file] { display: block; margin: 12px auto 0; font-size: 0.85rem; }

.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: var(--white);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
.btn-outline .spinner, .btn-danger .spinner { border-color: rgba(0,0,0,0.2); border-top-color: currentColor; }
@keyframes spin { to { transform: rotate(360deg); } }

.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(11,11,13,0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-box h3 { font-family: var(--font-display); font-size: 1.2rem; margin-bottom: 18px; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 22px; }

.setup-banner {
  background: #fff4d6;
  border: 1px solid #f0d38a;
  color: #6b4e02;
  padding: 18px 22px;
  border-radius: 12px;
  font-size: 0.9rem;
  margin-bottom: 32px;
  line-height: 1.55;
}
.setup-banner code { background: rgba(0,0,0,0.06); padding: 2px 6px; border-radius: 4px; font-size: 0.85em; }

.hidden-el { display: none !important; }

/* admin.html and gallery.html have no hamburger/mobile-drawer, so make sure the
   header's ghost button (View Public Gallery / Log Out) stays reachable on mobile
   even though the main site hides .btn-ghost in its header at this breakpoint. */
@media (max-width: 760px) {
  #siteHeaderStatic .header-cta .btn-ghost { display: inline-flex; }
  #siteHeaderStatic .header-cta { gap: 10px; }
}

@media (max-width: 640px) {
  .page-banner { padding: 148px 0 48px; }
  .admin-topbar { flex-direction: column; align-items: flex-start; }
  .admin-login { padding: 32px 24px; }
}
