.student-life-page {
  overflow-x: clip;
}

.student-life-hero-title {
  margin: 0.2rem 0 0.55rem;
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  line-height: 1.35;
  color: var(--heading);
}

.student-life-section-head {
  margin-bottom: 1rem;
}

.student-life-section-head h3 {
  margin: 0.15rem 0 0;
  font-family: var(--serif);
  font-size: 1.35rem;
  line-height: 1.3;
  color: var(--heading);
}

.student-life-section-lead {
  margin: 0.45rem 0 0;
  max-width: 40rem;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--muted);
}

.student-life-page .life-card {
  border-radius: 0.85rem;
  overflow: hidden;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.student-life-page .life-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--gold-bar) 40%, var(--line));
  box-shadow: 0 12px 26px rgba(8, 18, 44, 0.09);
}

.student-gallery-section {
  padding-top: 2.5rem;
}

.student-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.student-gallery-card {
  margin: 0;
  min-width: 0;
  content-visibility: auto;
  contain-intrinsic-size: 220px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  overflow: hidden;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.student-gallery-card:hover,
.student-gallery-card:focus-within {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--gold-bar) 45%, var(--line));
  box-shadow: 0 12px 26px rgba(8, 18, 44, 0.1);
}

.student-gallery-hit {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.student-gallery-hit:focus-visible {
  outline: 2px solid var(--gold-bar);
  outline-offset: 2px;
}

.student-gallery-media {
  display: block;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: var(--navy-deep);
}

.student-gallery-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s var(--ease);
}

.student-gallery-card:hover .student-gallery-media img,
.student-gallery-card:focus-within .student-gallery-media img {
  transform: scale(1.04);
}

.student-life-cta {
  margin-top: 1.5rem;
}

.student-life-cta-inner {
  align-items: center;
}

.student-life-cta-inner .btn {
  flex: 0 0 auto;
  width: auto;
}

@media (max-width: 1000px) {
  .student-gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 800px) {
  .student-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .student-life-cta-inner {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
  }

  .student-life-cta-inner .btn {
    min-height: 2.3rem;
    padding: 0.35rem 0.9rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .student-gallery {
    grid-template-columns: 1fr;
  }
}

html[data-theme="dark"] .student-life-hero-title,
html[data-theme="dark"] .student-life-section-head h3 {
  color: #ffffff;
}

html[data-theme="dark"] .student-gallery-card {
  background: var(--white);
  border-color: var(--line);
  color: var(--ink);
}
