/* ============================================
   KSL YEARBOOK CLUB
   Fonts load via <link> in each page's <head>:
   Fraunces (headings) + Archivo (body)
   ============================================ */


/* --------------------------------------------
   1. TOKENS
   -------------------------------------------- */

:root {
  /* Colour */
  --ink:          #131A28;
  --oxblood:      #1B2A4A;
  --oxblood-deep: #101B33;
  --brass:        #B08A48;
  --bone:         #FFFFFF;
  --bone-dim:     #E4E7ED;
  --grey:         #6B7280;
  --white:        #FFFFFF;

  /* Type families */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body:    "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Type scale */
  --size-xs:   0.8125rem;
  --size-sm:   0.9375rem;
  --size-base: 1.0625rem;
  --size-md:   clamp(1.25rem, 1.1rem + 0.7vw, 1.5rem);
  --size-lg:   clamp(1.75rem, 1.4rem + 1.6vw, 2.5rem);
  --size-xl:   clamp(2.25rem, 1.6rem + 3vw, 4rem);
  --size-2xl:  clamp(3rem, 1.8rem + 5.5vw, 6rem);

  /* Spacing */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2.5rem;
  --space-5: 4rem;
  --space-6: 6rem;
  --space-7: 9rem;

  /* Layout */
  --wrap:       72rem;
  --wrap-text:  38rem;
  --gutter:     clamp(1.25rem, 5vw, 4rem);
  --rule:       1px solid var(--bone-dim);

  /* Corners — change these two to adjust the
     roundness of everything on the site */
  --radius:       10px;
  --radius-small: 6px;
}


/* --------------------------------------------
   2. BASE
   -------------------------------------------- */

body {
  background: var(--bone);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--size-base);
  line-height: 1.65;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  font-variation-settings: "SOFT" 0, "WONK" 0;
  letter-spacing: -0.015em;
}

h1 { font-size: var(--size-xl); }
h2 { font-size: var(--size-lg); }
h3 { font-size: var(--size-md); }

a {
  color: var(--oxblood);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

a:hover { color: var(--oxblood-deep); }

::selection {
  background: var(--oxblood);
  color: var(--bone);
}


/* --------------------------------------------
   3. LAYOUT
   -------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: var(--space-6);
}

.section--tight {
  padding-block: var(--space-5);
}

.section--dark {
  background: var(--ink);
  color: var(--bone);
}

.section--dark a { color: var(--brass); }

.spread {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr);
  gap: var(--space-4);
  align-items: start;
}

.spread__aside h2 {
  position: sticky;
  top: 6rem;
}

.spread__body > * + * {
  margin-top: var(--space-3);
}

@media (max-width: 52em) {
  .spread {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }
  .spread__aside h2 { position: static; }
}

.prose {
  max-width: var(--wrap-text);
}

.prose > * + * {
  margin-top: var(--space-2);
}

.lede {
  font-size: var(--size-md);
  line-height: 1.5;
  color: var(--ink);
}


/* --------------------------------------------
   4. HEADER + NAV
   -------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bone);
  border-bottom: var(--rule);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 4.5rem;
}

.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--ink);
  line-height: 1.2;
}

.brand span {
  display: block;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--size-xs);
  color: var(--grey);
  letter-spacing: 0.04em;
}

.nav__list {
  display: flex;
  gap: var(--space-3);
}

.nav__link {
  display: inline-block;
  padding-block: 0.4rem;
  font-size: var(--size-sm);
  color: var(--ink);
  border-bottom: 2px solid transparent;
}

.nav__link:hover { color: var(--oxblood); }

.nav__link.is-current { border-bottom-color: var(--brass); }

.nav__toggle {
  display: none;
  width: 2.75rem;
  height: 2.75rem;
  align-items: center;
  justify-content: center;
  border: var(--rule);
  border-radius: var(--radius-small);
}

@media (max-width: 48em) {
  .nav__toggle { display: flex; }

  .nav__list {
    position: absolute;
    inset: 100% 0 auto 0;
    flex-direction: column;
    gap: 0;
    background: var(--bone);
    border-bottom: var(--rule);
    padding: var(--space-2) var(--gutter) var(--space-3);
    display: none;
  }

  .nav__list.is-open { display: flex; }

  .nav__link {
    padding-block: 0.75rem;
    border-bottom: var(--rule);
    border-radius: 0;
  }

  .nav__link.is-current {
    color: var(--oxblood);
    border-bottom-color: var(--bone-dim);
  }
}


/* --------------------------------------------
   5. HERO
   -------------------------------------------- */

.hero {
  position: relative;
  min-height: min(82vh, 44rem);
  display: flex;
  align-items: flex-end;
  background: var(--ink);
  overflow: hidden;
}

.hero__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.72;
}

.hero__inner {
  position: relative;
  padding-block: var(--space-5);
  color: var(--bone);
}

.hero__title {
  font-size: var(--size-2xl);
  line-height: 0.98;
  max-width: 14ch;
}

.hero__tagline {
  margin-top: var(--space-2);
  font-size: var(--size-md);
  color: var(--bone-dim);
  max-width: 34ch;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}


/* --------------------------------------------
   6. PAGE BANNER
   -------------------------------------------- */

.banner {
  background: var(--oxblood);
  color: var(--bone);
  padding-block: var(--space-5) var(--space-4);
}

.banner__title { font-size: var(--size-xl); }

.banner__sub {
  margin-top: var(--space-1);
  color: var(--bone-dim);
  max-width: 44ch;
}


/* --------------------------------------------
   7. BUTTONS
   -------------------------------------------- */

.btn {
  display: inline-block;
  padding: 0.8rem 1.6rem;
  font-size: var(--size-sm);
  font-weight: 500;
  border-radius: var(--radius-small);
  border: 1px solid transparent;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.btn--solid {
  background: var(--oxblood);
  color: var(--bone);
}

.btn--solid:hover {
  background: var(--oxblood-deep);
  color: var(--bone);
}

.btn--outline {
  border-color: currentColor;
  color: inherit;
}

.btn--outline:hover {
  background: var(--bone);
  color: var(--ink);
}


/* --------------------------------------------
   8. FOUNDERS
   -------------------------------------------- */

.founders {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: var(--space-4);
}

.founder { position: relative; }

.founder__portrait {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.founder:hover .founder__portrait,
.founder:focus-within .founder__portrait {
  transform: scale(1.04);
  box-shadow: 0 10px 28px rgba(19, 26, 40, 0.18);
}

.founder__name {
  margin-top: var(--space-2);
  font-size: var(--size-md);
}

.founder__role {
  font-size: var(--size-xs);
  color: var(--grey);
  letter-spacing: 0.04em;
}

.founder__bio {
  margin-top: var(--space-1);
  font-size: var(--size-sm);
}


/* --------------------------------------------
   9. CLASS REGISTER
   -------------------------------------------- */

.class-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: var(--space-3);
}

.class-tab {
  padding: 0.5rem 1rem;
  font-size: var(--size-sm);
  font-weight: 500;
  color: var(--grey);
  background: transparent;
  border: 1px solid var(--bone-dim);
  border-radius: var(--radius-small);
  transition: color 0.15s ease, background-color 0.15s ease,
              border-color 0.15s ease;
}

.class-tab:hover {
  color: var(--ink);
  border-color: var(--grey);
}

.class-tab.is-active {
  color: var(--bone);
  background: var(--oxblood);
  border-color: var(--oxblood);
}

.class-tools {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-2);
  border-bottom: var(--rule);
}

.class-count {
  font-size: var(--size-sm);
  color: var(--grey);
  margin-left: auto;
}

.class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: var(--space-3) var(--space-2);
  align-items: start;
}

/* The card is a button, so strip button styling */
.student {
  position: relative;
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.student:hover,
.student:focus-within { z-index: 2; }

.student__photo {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: var(--bone-dim);
  border-radius: var(--radius);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.student:hover .student__photo,
.student:focus-within .student__photo {
  transform: scale(1.06);
  box-shadow: 0 8px 24px rgba(19, 26, 40, 0.18);
}

.student__photo--empty {
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--grey);
  background: var(--bone-dim);
  border-radius: var(--radius);
}

.student__name {
  display: block;
  margin-top: 0.6rem;
  font-family: var(--font-body);
  font-size: var(--size-sm);
  font-weight: 500;
  line-height: 1.3;
}

/* Clipped to two lines so the grid stays even */
.student__quote {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 0.2rem;
  font-size: var(--size-xs);
  line-height: 1.4;
  color: var(--grey);
  font-style: italic;
}


/* --------------------------------------------
   10. GALLERY
   -------------------------------------------- */

.gallery {
  columns: 3;
  column-gap: var(--space-2);
}

@media (max-width: 60em) { .gallery { columns: 2; } }
@media (max-width: 34em) { .gallery { columns: 1; } }

.gallery__item {
  break-inside: avoid;
  margin-bottom: var(--space-2);
  cursor: zoom-in;
}

.gallery__item img {
  width: 100%;
  border-radius: var(--radius);
  background: var(--bone-dim);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.gallery__item:hover img {
  transform: scale(1.02);
  box-shadow: 0 10px 28px rgba(19, 26, 40, 0.18);
}

.gallery__caption {
  margin-top: 0.4rem;
  font-size: var(--size-xs);
  color: var(--grey);
}


/* --------------------------------------------
   11. LIGHTBOX
   -------------------------------------------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--gutter);
  background: rgba(10, 14, 22, 0.95);
}

.lightbox.is-open { display: flex; }

.lightbox img {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: var(--radius);
}

.lightbox__figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 34rem;
}

.lightbox__caption {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: var(--space-2);
  text-align: center;
}

.lightbox__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--size-md);
  color: var(--bone);
}

.lightbox__quote {
  max-width: 34rem;
  font-style: italic;
  color: var(--bone-dim);
  line-height: 1.5;
}

.lightbox__quote:empty { display: none; }

.lightbox__position {
  font-size: var(--size-xs);
  color: var(--grey);
}

.lightbox__close {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  width: 3rem;
  height: 3rem;
  color: var(--bone);
  font-size: 1.75rem;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.15s ease;
}

.lightbox__close:hover { opacity: 1; }

.lightbox__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 3.5rem;
  height: 3.5rem;
  font-size: 2.5rem;
  line-height: 1;
  color: var(--bone);
  opacity: 0.7;
  transition: opacity 0.15s ease;
}

.lightbox__arrow:hover { opacity: 1; }

.lightbox__arrow--prev { left: var(--space-1); }
.lightbox__arrow--next { right: var(--space-1); }

@media (max-width: 34em) {
  .lightbox__arrow {
    top: auto;
    bottom: var(--space-2);
    transform: none;
  }
}


/* --------------------------------------------
   12. FORMS
   -------------------------------------------- */

.contact-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: var(--space-6);
  align-items: start;
}

@media (max-width: 52em) {
  .contact-layout {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }
}

.field {
  display: block;
  margin-bottom: var(--space-2);
}

.field__label {
  display: block;
  font-size: var(--size-sm);
  margin-bottom: 0.35rem;
}

.field__input,
.field__select,
.field__textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  background: var(--white);
  border: 1px solid var(--bone-dim);
  border-radius: var(--radius-small);
  font-size: var(--size-sm);
}

.field__input:focus,
.field__select:focus,
.field__textarea:focus {
  outline: 2px solid var(--oxblood);
  outline-offset: -1px;
  border-color: transparent;
}

.field__textarea { min-height: 9rem; }

.form-note {
  font-size: var(--size-xs);
  color: var(--grey);
  margin-top: var(--space-2);
}

.detail-list { border-top: var(--rule); }

.detail {
  display: grid;
  grid-template-columns: 1.5rem 1fr;
  gap: var(--space-2);
  padding-block: var(--space-2);
  border-bottom: var(--rule);
  align-items: start;
}

.detail svg {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--oxblood);
  margin-top: 0.15rem;
}

.detail__label {
  font-size: var(--size-xs);
  color: var(--grey);
}


/* --------------------------------------------
   13. FOOTER
   -------------------------------------------- */

.site-footer {
  background: var(--ink);
  color: var(--bone-dim);
  padding-block: var(--space-4);
  margin-top: var(--space-6);
  font-size: var(--size-sm);
}

.site-footer a { color: var(--bone); }
.site-footer a:hover { color: var(--brass); }

.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: space-between;
  align-items: flex-end;
}

.site-footer__legal {
  font-size: var(--size-xs);
  color: var(--grey);
}


/* --------------------------------------------
   14. UTILITIES
   -------------------------------------------- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: var(--gutter);
  z-index: 200;
  padding: 0.75rem 1rem;
  background: var(--oxblood);
  color: var(--bone);
}

.skip-link:focus {
  top: 0.5rem;
  color: var(--bone);
}