body.school-page {
  --school-gap: 12px;
  --school-poster-min: 150px;
  background: var(--pageBg);
  color: var(--fg);
}

body.school-page > .wrap {
  padding-bottom: 0;
}

.school-main {
  box-sizing: border-box;
  width: 100%;
  padding: clamp(24px, 3vw, 44px) var(--school-gap) 48px;
}

.school-intro {
  width: min(900px, 100%);
  margin: 0 auto clamp(32px, 4vw, 56px);
  color: #eee8e1;
  font-family: "InterTight", "Inter Tight", sans-serif;
  font-size: clamp(1.08rem, 1.45vw, 1.32rem);
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
}

.school-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--school-poster-min), 1fr));
  column-gap: var(--school-gap);
  row-gap: clamp(30px, 3vw, 48px);
  width: 100%;
  align-items: start;
}

.school-card {
  appearance: none;
  display: block;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.school-poster-frame {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 15px;
  background: #211f20;
  filter: drop-shadow(0 13px 18px rgba(0, 0, 0, 0.3));
  transition: transform 180ms ease, filter 180ms ease;
}

.school-poster {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.school-card-title {
  display: block;
  margin-top: 13px;
  color: #f0e9df;
  font-family: "FixelExtraBold", sans-serif;
  font-size: clamp(1rem, 1.15vw, 1.18rem);
  font-weight: 800;
  line-height: 1.18;
}

.school-card:hover .school-poster-frame,
.school-card[aria-expanded="true"] .school-poster-frame {
  transform: translateY(-4px);
  filter: drop-shadow(0 17px 23px rgba(0, 0, 0, 0.42));
}

.school-card:focus-visible {
  outline: none;
}

.school-card:focus-visible .school-poster-frame {
  outline: 3px solid var(--brand);
  outline-offset: 4px;
}

.school-card[aria-expanded="true"] .school-card-title {
  color: #fffaf3;
}

.school-status {
  grid-column: 1 / -1;
  margin: 0;
  color: rgba(240, 233, 223, 0.72);
  font-family: "InterTight", "Inter Tight", sans-serif;
  font-size: 1rem;
}

.school-detail {
  grid-column: 1 / -1;
  min-width: 0;
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  margin: calc(-1 * clamp(12px, 1.5vw, 22px)) 0 0;
  transition: grid-template-rows 320ms ease, opacity 240ms ease;
}

.school-detail[hidden] {
  display: none;
}

.school-detail.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
}

.school-detail-reveal {
  width: min(1150px, 100%);
  min-height: 0;
  margin-right: auto;
  margin-left: auto;
  overflow: hidden;
}

.school-detail-panel {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background: var(--panelBg);
  color: var(--panelFg);
}

.school-detail-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(14, 12, 13, 0.72);
  cursor: pointer;
}

.school-detail-close::before,
.school-detail-close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 25px;
  height: 3px;
  border-radius: 999px;
  background: #e33b36;
}

.school-detail-close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.school-detail-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.school-detail-close:hover {
  background: rgba(14, 12, 13, 0.92);
}

.school-detail-close:focus-visible {
  outline: 3px solid #e33b36;
  outline-offset: 3px;
}

.school-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.95fr);
  gap: clamp(20px, 3vw, 42px);
  padding: clamp(20px, 3vw, 42px);
}

.school-detail-copy,
.school-detail-media {
  min-width: 0;
}

.school-detail-title {
  margin: 0 0 10px;
  padding-right: 46px;
  color: #f0e9df;
  font-family: "FixelExtraBold", sans-serif;
  font-size: clamp(1.65rem, 3vw, 2.6rem);
  line-height: 1.05;
}

.school-detail-info {
  margin: 0 0 4px;
  color: #e7ddd5;
  font-family: "InterTight", "Inter Tight", sans-serif;
  font-size: 1.02rem;
  font-weight: 700;
}

.school-detail-genres {
  margin: 0 0 10px;
  color: #c3b877;
  font-family: "InterTight", "Inter Tight", sans-serif;
  font-size: 1.02rem;
  font-weight: 700;
}

.school-detail-credits {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 2px 9px;
  margin: 0 0 10px;
  font-family: "InterTight", "Inter Tight", sans-serif;
  line-height: 1.3;
}

.school-detail-label {
  color: #c3b877;
  font-weight: 800;
}

.school-detail-value {
  color: #f0e9df;
  font-weight: 650;
}

.school-detail-awards {
  margin: 0 0 12px;
  color: var(--sienna);
  font-family: "InterTight", "Inter Tight", sans-serif;
  font-style: italic;
}

.school-detail-synopsis {
  margin: 0;
  color: #e7ddd5;
  font-family: "InterTight", "Inter Tight", sans-serif;
  font-size: 1.03rem;
  font-weight: 550;
  line-height: 1.48;
  white-space: pre-line;
}

.school-detail-link {
  display: inline-block;
  margin-top: 16px;
  color: #c3b877;
  font-family: "InterTight", "Inter Tight", sans-serif;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.school-detail-link:visited {
  color: #c3b877;
}

.school-detail-link:hover,
.school-detail-link:focus-visible {
  color: #e6d990;
}

.school-detail-backdrop {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 11px;
  background: #0a0a0a;
  object-fit: cover;
}

.school-detail-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: 8px;
  max-height: 132px;
  margin-top: 10px;
  overflow: hidden;
}

.school-detail-thumbs:empty {
  display: none;
}

.school-thumb {
  appearance: none;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: #0a0a0a;
  cursor: pointer;
}

.school-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.school-thumb[aria-current="true"],
.school-thumb:focus-visible {
  outline: 2px solid rgba(240, 233, 223, 0.85);
  outline-offset: -2px;
}

.school-detail-trailer {
  margin: 0 clamp(20px, 3vw, 42px) clamp(20px, 3vw, 42px);
}

.school-detail-trailer:empty {
  display: none;
}

.school-trailer-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 11px;
  background: #000;
}

.school-trailer-frame iframe,
.school-trailer-frame video {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}

@media (max-width: 860px) {
  .school-detail-reveal {
    width: 100%;
  }

  .school-detail-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .school-main {
    padding-top: 22px;
  }

  .school-intro {
    margin-bottom: 30px;
  }

  .school-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: var(--school-gap);
    row-gap: 30px;
  }

  .school-poster-frame {
    border-radius: 11px;
  }

  .school-card-title {
    margin-top: 10px;
    font-size: 0.98rem;
  }

  .school-detail-panel {
    border-radius: 14px;
  }

  .school-detail-layout {
    padding: 18px 15px;
  }

  .school-detail-trailer {
    margin: 0 15px 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .school-poster-frame,
  .school-detail {
    transition: none;
  }
}
