/* ==========================================================================
   GLIMPSES OF THE DEPARTMENT — page styles
   Uses the palette tokens defined in styles.css (:root)
   ========================================================================== */

/* ---------- Hero stats ---------- */
.gx-stats {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 2rem;
}

.gx-stat {
  background: var(--paper-glass);
  border: 1px solid var(--walnut-border);
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.gx-stat::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -30px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(213, 133, 31, 0.22), transparent 70%);
}

.gx-stat:nth-child(even)::after {
  background: radial-gradient(circle, rgba(135, 169, 107, 0.28), transparent 70%);
}

.gx-stat-num {
  display: block;
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--walnut);
}

.gx-stat-num span {
  color: var(--amber);
}

.gx-stat-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--sage-ink);
  margin-top: 4px;
}

/* ---------- Partners strip ---------- */
.gx-partners {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px 22px;
  padding: 18px 22px;
  margin-bottom: 1.5rem;
  background: var(--paper-glass);
  border: 1px solid var(--walnut-border);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}

.gx-partners-label {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber-ink);
  margin-right: 6px;
}

.gx-partner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  border-radius: var(--radius-full);
  background: var(--paper);
  border: 1px solid var(--walnut-border);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--walnut);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.gx-partner:hover {
  border-color: var(--amber-border);
  box-shadow: 0 6px 16px -8px rgba(213, 133, 31, 0.5);
}

.gx-partner img {
  height: 34px;
  width: auto;
  max-width: 96px;
  object-fit: contain;
}

.gx-partner img.gx-round {
  width: 34px;
  border-radius: 50%;
  object-fit: cover;
}

.gx-partner img.gx-oval {
  width: 50px;
  border-radius: 50%;
  object-fit: cover;
}

/* ---------- Event index (jump links) ---------- */
.gx-index {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 2.25rem;
}

.gx-index a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 7px;
  border-radius: var(--radius-full);
  background: var(--paper);
  border: 1px solid var(--walnut-border);
  color: var(--walnut-ink);
  font-size: 0.84rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.gx-index a b {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--sage-tint);
  color: var(--sage-ink);
  font-size: 0.72rem;
  font-weight: 800;
}

.gx-index a:hover,
.gx-index a.is-current {
  background: var(--amber-tint);
  border-color: var(--amber-border);
  color: var(--walnut-deep);
}

.gx-index a.is-current b,
.gx-index a:hover b {
  background: var(--amber);
  color: var(--walnut-deep);
}

/* ---------- Timeline ---------- */
.gx-timeline {
  position: relative;
}

.gx-timeline::before {
  content: "";
  position: absolute;
  left: 27px;
  top: 30px;
  bottom: 30px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--amber), var(--sage) 50%, var(--walnut));
  opacity: 0.45;
}

.gx-event {
  position: relative;
  padding-left: 84px;
  margin-bottom: 2.5rem;
  scroll-margin-top: 190px;
}

.gx-marker {
  position: absolute;
  left: 0;
  top: 26px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--paper);
  border: 2px solid var(--amber);
  color: var(--walnut);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.05rem;
  box-shadow: 0 0 0 6px rgba(213, 133, 31, 0.12), var(--shadow-sm);
  z-index: 1;
}

.gx-event:nth-child(even) .gx-marker {
  border-color: var(--sage);
  box-shadow: 0 0 0 6px rgba(135, 169, 107, 0.16), var(--shadow-sm);
}

/* ---------- Event card ---------- */
.gx-card {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  background: var(--paper-glass);
  border: 1px solid var(--walnut-border);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: box-shadow var(--transition-smooth), border-color var(--transition-smooth);
}

.gx-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--sage-border);
}

.gx-event:nth-child(even) .gx-card:not(.gx-card--wide) .gx-media {
  order: 2;
}

.gx-card--wide {
  grid-template-columns: 1fr;
}

.gx-media {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: linear-gradient(160deg, rgba(243, 236, 221, 0.9), rgba(255, 253, 248, 0.6));
}

.gx-card--wide .gx-media {
  padding-bottom: 0;
}

/* Clickable photo (opens lightbox) */
.gx-photo {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--cream-deep);
  border-radius: 14px;
  overflow: hidden;
  cursor: zoom-in;
  box-shadow: 0 0 0 1px var(--walnut-border);
}

.gx-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.gx-photo--feature {
  aspect-ratio: 3 / 2;
}

.gx-card--wide .gx-photo--feature {
  aspect-ratio: auto;
}

.gx-card--wide .gx-photo--feature img {
  height: auto;
}

.gx-photo:hover img {
  transform: scale(1.035);
}

.gx-photo::after {
  content: "View photo";
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: rgba(255, 253, 248, 0.92);
  color: var(--walnut);
  font-size: 0.74rem;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.gx-photo:hover::after,
.gx-photo:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.gx-photo:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
}

.gx-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
}

.gx-thumbs .gx-photo {
  aspect-ratio: 4 / 3;
}

.gx-thumbs .gx-photo::after {
  content: "View";
  right: 8px;
  bottom: 8px;
  padding: 4px 9px;
}

/* Logo panel (Centre of Excellence) */
.gx-logo-panel {
  aspect-ratio: 3 / 2;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background:
    radial-gradient(circle at 30% 20%, rgba(213, 133, 31, 0.35), transparent 55%),
    radial-gradient(circle at 75% 85%, rgba(135, 169, 107, 0.4), transparent 55%),
    linear-gradient(145deg, #5A3E2B, #3B2A1E);
  box-shadow: 0 0 0 1px var(--walnut-border);
  padding: 20px;
  text-align: center;
}

.gx-logo-panel img {
  width: 42%;
  max-width: 190px;
  border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(251, 247, 239, 0.12), 0 18px 40px -10px rgba(0, 0, 0, 0.5);
}

.gx-logo-panel span {
  color: var(--cream);
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}

/* Placeholder when photos are not yet available */
.gx-placeholder {
  aspect-ratio: 3 / 2;
  border-radius: 14px;
  border: 2px dashed var(--sage-border);
  background:
    radial-gradient(circle at 25% 25%, rgba(135, 169, 107, 0.2), transparent 60%),
    radial-gradient(circle at 80% 80%, rgba(213, 133, 31, 0.16), transparent 60%),
    var(--paper);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--sage-ink);
  font-weight: 600;
  font-size: 0.9rem;
  text-align: center;
  padding: 20px;
}

.gx-placeholder svg {
  width: 56px;
  height: 56px;
  stroke: var(--sage);
}

/* Card body */
.gx-body {
  padding: 26px 30px 28px;
  display: flex;
  flex-direction: column;
}

.gx-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 0.85rem;
}

.gx-num {
  display: none;
  font-family: var(--font-heading);
  font-weight: 800;
  color: var(--amber-ink);
}

.gx-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  background: var(--amber-tint);
  border: 1px solid var(--amber-border);
  color: var(--amber-ink);
}

.gx-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.gx-badge--sage {
  background: var(--sage-tint);
  border-color: var(--sage-border);
  color: var(--sage-ink);
}

.gx-badge--walnut {
  background: var(--walnut-tint);
  border-color: var(--walnut-border);
  color: var(--walnut);
}

.gx-logo-chip {
  height: 30px;
  width: auto;
  max-width: 110px;
  object-fit: contain;
  margin-left: auto;
}

.gx-logo-chip.gx-round {
  width: 30px;
  border-radius: 50%;
  object-fit: cover;
}

.gx-logo-chip.gx-oval {
  width: 44px;
  border-radius: 50%;
  object-fit: cover;
}

.gx-body h3 {
  font-size: 1.42rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--walnut);
  margin-bottom: 0.75rem;
}

.gx-body p {
  color: var(--text-dim);
  font-size: 0.96rem;
  line-height: 1.7;
  margin-bottom: 0.75rem;
}

.gx-highlights {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 0.6rem;
}

.gx-highlights li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border-radius: 10px;
  background: var(--paper);
  border: 1px solid var(--walnut-border);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--walnut-ink);
}

.gx-highlights li::before {
  content: "";
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border-radius: 50%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FFFDF8' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 9px no-repeat,
    var(--amber);
}

.gx-card--wide .gx-body {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 0 32px;
}

.gx-card--wide .gx-body .gx-meta,
.gx-card--wide .gx-body h3 {
  grid-column: 1 / -1;
}

.gx-card--wide .gx-body .gx-text {
  grid-column: 1;
}

.gx-card--wide .gx-highlights {
  grid-column: 2;
  align-content: flex-start;
  margin-top: 0;
  padding-top: 0.2rem;
}

/* ---------- Scroll reveal ---------- */
.gx-js [data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.gx-js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- Lightbox ---------- */
.gx-lightbox {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: min(1200px, 94vw);
  max-height: 94vh;
  margin: auto;
  overflow: visible;
}

.gx-lightbox::backdrop {
  background: rgba(46, 31, 21, 0.84);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.gx-lightbox figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.gx-lightbox img {
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.7);
  background: var(--cream-deep);
}

.gx-lightbox figcaption {
  color: var(--cream);
  font-size: 0.92rem;
  text-align: center;
  max-width: 760px;
  line-height: 1.5;
}

.gx-lightbox figcaption small {
  display: block;
  color: var(--amber-soft);
  font-weight: 700;
  margin-top: 2px;
}

.gx-lb-btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(251, 247, 239, 0.3);
  background: rgba(255, 253, 248, 0.94);
  color: var(--walnut);
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.gx-lb-btn:hover {
  background: var(--amber);
  color: var(--walnut-deep);
}

.gx-lb-btn svg {
  width: 20px;
  height: 20px;
}

.gx-lb-close { top: -14px; right: -14px; }
.gx-lb-prev  { left: -22px; top: 40%; }
.gx-lb-next  { right: -22px; top: 40%; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .gx-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .gx-card {
    grid-template-columns: 1fr;
  }
  .gx-event:nth-child(even) .gx-card:not(.gx-card--wide) .gx-media {
    order: 0;
  }
  .gx-media {
    padding-bottom: 0;
  }
  .gx-card--wide .gx-body {
    display: flex;
  }
  .gx-card--wide .gx-highlights {
    margin-top: auto;
    padding-top: 0.6rem;
  }
}

@media (max-width: 768px) {
  .gx-timeline::before,
  .gx-marker {
    display: none;
  }
  .gx-event {
    padding-left: 0;
    margin-bottom: 1.6rem;
    scroll-margin-top: 90px;
  }
  .gx-num {
    display: inline;
  }
  .gx-body {
    padding: 18px 18px 20px;
  }
  .gx-body h3 {
    font-size: 1.18rem;
  }
  .gx-body p {
    font-size: 0.9rem;
    line-height: 1.6;
  }
  .gx-stat-num {
    font-size: 1.6rem;
  }
  .gx-partners {
    justify-content: flex-start;
    padding: 14px;
  }
  .gx-partners-label {
    width: 100%;
  }
  .gx-index {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: none;
  }
  .gx-index::-webkit-scrollbar {
    display: none;
  }
  .gx-index a {
    flex-shrink: 0;
  }
  .gx-lb-prev { left: 6px; top: auto; bottom: -58px; }
  .gx-lb-next { right: 6px; top: auto; bottom: -58px; }
  .gx-lb-close { top: -54px; right: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .gx-js [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .gx-photo img {
    transition: none;
  }
}
