/* =============================================================================
   COLLEGE PAGES STYLES
   ============================================================================= */

/* Page-level red diagonal background — matches body.app and the rest of
 * the site. Uses the same fixed-position SVG so the diagonal stays put as
 * the user scrolls. The dark school header sits on top of the upper band. */
body.school-page {
  background: #fff url("/assets/background_browse-bb186f18.svg") no-repeat top right fixed;
  background-size: 100% 100%;
  min-height: 100vh;
}

/* =============================================================================
   SCHOOL PAGE HEADER
   ============================================================================= */

.school-page .school-header {
  background-size: cover;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 250px;
  width: 100vw;
  z-index: -1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;       /* anchor children at top of header content */
  padding-top: 76px;             /* clear the 64px site nav with breathing room */
  background: var(--header-color, #1a202c);
}

/* Photo mode header */
.school-page .school-header.photo-mode {
  background: transparent;
}

.school-page .school-header.photo-mode .header-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.school-page .school-header.photo-mode::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(0,0,0,0.7) 0%,
    rgba(0,0,0,0.3) 50%,
    rgba(0,0,0,0.5) 100%
  );
  z-index: 1;
}

/* Logo mode header */
.school-page .school-header .header-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
}

.school-page .school-header .school-logo {
  max-height: 160px;
  max-width: 300px;
  object-fit: contain;
  opacity: 1;
}

/* School name + location + division/conference. Flowed in normal
 * order inside the header — no longer absolutely positioned. */
.school-page .school-overview {
  position: relative;       /* take it out of the old absolute layer */
  z-index: 2;
  margin: 0 0 0 4em;
  color: white;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  align-self: flex-start;
}

.school-page .school-overview h1 { color: white; margin: 0 0 0.25rem; }
.school-page .school-overview p,
.school-page .school-overview small { color: rgba(255,255,255,0.85); margin: 0; }

/* Right-side stat callout group: score cards + projected openings.
 * Engages the right edge — no right margin, no right border-radius.
 * Sizes to its content (score-card intrinsic height, ~110-130px). */
.school-page .school-summary {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: row;
  align-items: stretch;          /* score-cards + projected-openings column same height */
  gap: 1.25rem;
  margin: 0;
  background: white;
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
  padding: 0 40px 0 0;
}

/* The merged score-card row sits flush left in the summary and inherits
 * the wrapper's left border-radius via overflow: hidden. */
.school-page .school-summary__cards {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0;
  border-top-left-radius: 8px;
  border-bottom-left-radius: 8px;
  overflow: hidden;
}

/* Right column: PROJECTED OPENINGS label sits directly above the count
 * blocks with a small gap; vertically centered in the white card with
 * 5px top/bottom padding for breathing room. */
.school-page .school-summary > .stack {
  align-self: center;
  gap: 0.375rem;
  padding: 5px 0;
}

/* PROJECTED OPENINGS heading — match the count-block label exactly:
 * default text color, 0.05em tracking, uppercase. */
.school-page .school-summary > .stack > h2 {
  color: var(--text-default);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: center;
}

/* =============================================================================
   SCHOOL CONTENT LAYOUT
   ============================================================================= */

.school-page .school-bottom {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: auto;
  gap: 2rem;
  margin-top: 250px;
}

.school-page .school-left {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* =============================================================================
   SCHOOL INFO / OVERVIEW
   ============================================================================= */

.school-page .school-info {
  margin-left: calc(4em - 20px);
}

.school-page .school-info p {
  line-height: 1.7;
  color: var(--gray-600);
}

/* =============================================================================
   SCORECARDS
   ============================================================================= */

.school-page .scorecards {
  list-style-type: none;
  margin: 0;
  padding: 0;
  margin-left: calc(4em - 20px);
  margin-top: 2em;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto;
  gap: 2em;
}

.school-page .scorecards > li {
  height: 150px;
}

.school-page .scorecard {
  position: relative;
  padding: 1.25rem;
  min-height: 180px;
}

.school-page .scorecard.gated .gated-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(255,255,255,0.9);
  border-radius: 12px;
  z-index: 5;
}

.school-page .scorecard .gated-overlay p {
  margin: 0;
  color: var(--gray-500);
  font-size: 0.875rem;
  text-align: center;
}

.school-page .scorecard .gated-overlay .gated-label {
  font-weight: 600;
  margin-top: 0.5rem;
}

.school-page .scorecard .scorecard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.school-page .scorecard .scorecard-header h2 {
  margin: 0;
}

.school-page .scorecard .info-btn {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: 1px solid var(--gray-400);
  background: white;
  font-size: 0.75rem;
  cursor: pointer;
  color: var(--gray-500);
}

.school-page .scorecard .info-btn:hover {
  background: var(--gray-50);
}

.school-page .scorecard .grade-badge {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  width: 3rem;
  height: 3rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  font-style: italic;
  color: white;
}

.school-page .scorecard .grade-badge.grade-a { background: var(--green); }
.school-page .scorecard .grade-badge.grade-b { background: #3182ce; }
.school-page .scorecard .grade-badge.grade-c { background: var(--yellow); color: var(--gray-800); }
.school-page .scorecard .grade-badge.grade-d { background: #ed8936; }
.school-page .scorecard .grade-badge.grade-f { background: var(--color-primary); }
.school-page .scorecard .grade-badge.grade-unknown,
.school-page .scorecard .grade-badge.gated { background: var(--gray-400); }

/* Bar chart styles */
.school-page .bar-chart {
  display: flex;
  height: 100px;
  gap: 0.5rem;
}

.school-page .bar-chart .chart-y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 0.625rem;
  color: var(--gray-500);
  padding-right: 0.5rem;
}

.school-page .bar-chart .chart-bars {
  display: flex;
  flex: 1;
  align-items: flex-end;
  gap: 0.5rem;
}

.school-page .bar-chart .bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.school-page .bar-chart .bar-group .bar {
  width: 100%;
  background: var(--gray-400);
  border-radius: 4px 4px 0 0;
  min-height: 4px;
}

.school-page .bar-chart .bar-group.current .bar {
  background: var(--color-primary);
}

.school-page .bar-chart .bar-group .year-label {
  font-size: 0.625rem;
  color: var(--gray-500);
  margin-top: 0.25rem;
}

.school-page .chart-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100px;
  color: var(--gray-500);
  font-style: italic;
}

/* =============================================================================
   SCHOOL STATS SIDEBAR
   ============================================================================= */

.school-page .stats-list {
  margin: 0;
}

.school-page .stats-list .stat-row {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--gray-200);
}

.school-page .stats-list .stat-row:last-child {
  border-bottom: none;
}

.school-page .stats-list dt {
  color: var(--gray-500);
  font-size: 0.875rem;
}

.school-page .stats-list dd {
  margin: 0;
  font-weight: 600;
  color: var(--gray-700);
}

.school-page .map-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  background: var(--gray-50);
  border-radius: 8px;
  color: var(--gray-500);
  font-style: italic;
}

/* =============================================================================
   COLLEGES INDEX
   ============================================================================= */

/* Card link wrapper — kills underline, inherits color, lifts on hover.
 * Layout/padding/background are owned by the Surface component inside. */
.schools-index .college-card {
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.schools-index .college-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.schools-index .college-card-logo {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  overflow: hidden;          /* clip broken-image alt text */
}

.schools-index .college-card-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Allow long college names in the title to wrap inside the info
 * column instead of forcing the cluster to wrap to a new row. */
.schools-index .college-card-info {
  min-width: 0;
  flex: 1 1 auto;
}

.schools-index .college-card-logo .logo-placeholder {
  width: 100%;
  height: 100%;
  background: var(--gray-50);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--gray-500);
}

.schools-index .pagination-nav {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
}

/* =============================================================================
   RESPONSIVE
   ============================================================================= */

@media (max-width: 1024px) {
  .school-page .school-bottom {
    grid-template-columns: 1fr;
  }

  .school-page .scorecards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .school-page .school-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    min-height: auto;
    padding-bottom: 1rem;
  }

  .school-page .school-match {
    width: 100%;
    border-radius: 12px;
    flex-wrap: wrap;
  }

  .school-page .school-overview h1 {
    font-size: 1.75rem;
  }

  .school-page .school-bottom {
    margin-top: 1rem;
  }

  .school-page .school-info,
  .school-page .scorecards {
    margin-left: 0;
  }
}
