/*
 * The main site, campusvoice.me: the home page with the college search, the calculators, scholarships,
 * the college list and the about page. Built from the same tokens as the college sites, so the two read
 * as one family: navy and crimson, serif headings, quiet rules and plenty of room.
 */

/* ---------- Home hero: navy, with the college search in the middle ---------- */

.cv-hero {
  position: relative;
  /* About the photo's own 3:1 shape on a laptop, so little of either side is cropped away. */
  padding: var(--space-8) 0 var(--space-7);
  overflow: hidden;
  isolation: isolate;
  /*
   * Students on campus at dusk, with the dark middle of the picture behind the words. A light navy wash
   * over the whole photo keeps white text above 4.5:1 wherever it falls, including the bright windows
   * at the right edge on wide screens.
   */
  background-color: var(--navy-900);
  background-image:
    radial-gradient(ellipse 46% 70% at 50% 50%, rgba(12, 18, 44, 0.55) 0%, rgba(12, 18, 44, 0) 100%),
    linear-gradient(180deg, rgba(12, 18, 44, 0.15) 0%, rgba(12, 18, 44, 0.1) 50%, rgba(12, 18, 44, 0.45) 100%),
    url("/images/students-1792.jpg");
  background-size: cover;
  background-position: center 40%;
  color: #ffffff;
  text-align: center;
}

@media (max-width: 1100px) {
  .cv-hero {
    background-image:
      linear-gradient(180deg, rgba(12, 18, 44, 0.55) 0%, rgba(12, 18, 44, 0.5) 45%, rgba(12, 18, 44, 0.75) 100%),
      url("/images/students-1100.jpg");
    /* On a phone only a slice of the photo fits: the group of students on the left. */
    background-position: 14% 50%;
  }
}

.cv-hero__title,
.cv-hero__lede {
  text-shadow: 0 2px 24px rgba(8, 12, 32, 0.6);
}

.cv-hero::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(280px, 40%);
  height: 3px;
  background: var(--gold);
  transform: translateX(-50%);
}

.cv-hero__title {
  max-width: 18ch;
  margin: 0 auto var(--space-4);
  color: #ffffff;
  font-size: clamp(2.25rem, 5.6vw, 4.25rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

.cv-hero__lede {
  max-width: 60ch;
  margin: 0 auto var(--space-6);
  color: var(--on-dark);
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
  line-height: 1.6;
}

.cv-hero :focus-visible {
  outline-color: #ffffff;
}

.cv-hero .hero__actions {
  justify-content: center;
  margin-top: var(--space-5);
}

/* ---------- The college search ---------- */

.college-search {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
  text-align: left;
}

.college-search__label {
  display: block;
  margin-bottom: var(--space-2);
  color: #ffffff;
  font-weight: 600;
}

.page-body .college-search__label {
  color: var(--ink);
}

.college-search__box {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-4);
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-raised);
  color: var(--ink-muted);
}

.college-search__box:focus-within {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.college-search__box input {
  flex: 1;
  min-width: 0;
  height: 56px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: var(--text-lg);
  box-shadow: none;
}

.college-search__box input:focus {
  outline: none;
  box-shadow: none;
}

.college-results {
  margin: var(--space-2) 0 0;
  padding: 0;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-menu);
  color: var(--ink);
  overflow: hidden;
}

.college-results[hidden] {
  display: none;
}

.college-result {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--rule);
  color: inherit;
  text-decoration: none;
}

.college-result:first-child {
  border-top: 0;
}

a.college-result:hover,
a.college-result:focus-visible {
  background: var(--navy-wash);
}

.college-result__text {
  flex: 1;
  min-width: 0;
}

.college-result__name {
  display: block;
  font-weight: 600;
}

.college-result__where {
  display: block;
  color: var(--ink-muted);
  font-size: var(--text-sm);
}

.college-result__empty {
  padding: var(--space-4);
  color: var(--ink-muted);
}

/* ---------- Tool cards ---------- */

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.tool-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  height: 100%;
  padding: var(--space-6);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--navy-800);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
  transition: box-shadow var(--fast) var(--ease), transform var(--fast) var(--ease);
}

.tool-card:hover,
.tool-card:focus-visible {
  box-shadow: var(--shadow-raised);
  transform: translateY(-2px);
}

.tool-card__icon {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--navy-wash);
  color: var(--navy-800);
}

.tool-card h3 {
  margin: 0;
  font-size: var(--text-xl);
}

.tool-card p {
  margin: 0;
  color: var(--ink-muted);
}

.tool-card__go {
  margin-top: auto;
  color: var(--link);
  font-weight: 600;
}

/* ---------- Calculators ---------- */

.calc {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: var(--space-6);
  align-items: start;
}

.calc__form {
  padding: var(--space-6);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

.calc__form .field-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.calc__result {
  position: sticky;
  top: 96px;
  padding: var(--space-6);
  background: var(--navy-900);
  border-radius: var(--radius);
  color: #ffffff;
}

.calc__result h2 {
  margin: 0 0 var(--space-4);
  color: var(--on-dark);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.calc__headline {
  margin: 0 0 var(--space-3);
  color: #ffffff;
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2.125rem);
  line-height: 1.2;
}

.calc__detail {
  margin: 0 0 var(--space-4);
  color: var(--on-dark);
}

.calc__figures {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
  margin: var(--space-5) 0 0;
}

.calc__figure {
  padding: var(--space-3);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
}

.calc__figure dt {
  color: var(--on-dark-muted);
  font-size: var(--text-xs);
}

.calc__figure dd {
  margin: 0;
  color: #ffffff;
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-variant-numeric: tabular-nums;
}

.calc__bar {
  position: relative;
  height: 12px;
  margin: var(--space-4) 0 var(--space-2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.calc__bar-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--gold);
  transition: width var(--medium) var(--ease);
}

.calc__bar-fill--good {
  background: #6fcf97;
}

.calc__bar-target {
  position: absolute;
  top: -2px;
  bottom: -2px;
  width: 2px;
  background: #ffffff;
}

.calc__scale {
  display: flex;
  justify-content: space-between;
  color: var(--on-dark-muted);
  font-size: var(--text-xs);
}

.calc__tone--good {
  color: #9be3b8;
}

.calc__tone--bad {
  color: #ffb3b3;
}

.calc-table {
  width: 100%;
  margin-top: var(--space-5);
  border-collapse: collapse;
  color: var(--on-dark);
  font-variant-numeric: tabular-nums;
}

.calc-table caption {
  margin-bottom: var(--space-2);
  color: var(--on-dark-muted);
  font-size: var(--text-sm);
  text-align: left;
}

.calc-table th,
.calc-table td {
  padding: var(--space-2) var(--space-3);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  text-align: left;
}

.calc-table th {
  color: var(--on-dark-muted);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.calc-table tr.is-target td {
  color: #ffffff;
  font-weight: 700;
}

.calc-mode {
  margin-bottom: var(--space-5);
}

/* ---------- Explainers under a tool ---------- */

.explain {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: var(--space-6);
  margin-top: var(--space-8);
}

.explain h2 {
  font-size: var(--text-xl);
}

.explain p,
.explain li {
  color: var(--ink-muted);
}

.formula {
  display: block;
  margin: var(--space-3) 0;
  padding: var(--space-3) var(--space-4);
  background: var(--sunken);
  border-left: 3px solid var(--navy-800);
  border-radius: var(--radius);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: var(--text-sm);
  color: var(--ink);
  overflow-x: auto;
}

/* ---------- Scholarships ---------- */

.scholarship-list {
  display: grid;
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.scholarship {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-3) var(--space-5);
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 3px solid var(--navy-800);
  border-radius: var(--radius);
}

.scholarship--featured {
  border-left-color: var(--gold);
}

.scholarship--hidden {
  opacity: 0.6;
}

.scholarship__title {
  margin: var(--space-2) 0 var(--space-1);
  font-size: var(--text-lg);
}

.scholarship__by {
  margin: 0;
  color: var(--ink-muted);
  font-size: var(--text-sm);
}

.scholarship__facts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin: var(--space-3) 0 0;
  color: var(--ink-muted);
  font-size: var(--text-sm);
}

.scholarship__facts span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.scholarship__side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-3);
  text-align: right;
}

.scholarship__deadline {
  margin: 0;
  font-weight: 600;
}

.scholarship__deadline--soon {
  color: var(--crimson);
}

.scholarship__left {
  display: block;
  color: var(--ink-muted);
  font-size: var(--text-sm);
  font-weight: 400;
}

.scholarship__admin {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--rule);
}

/* ---------- College list ---------- */

.college-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.college-card {
  display: flex;
  gap: var(--space-4);
  align-items: flex-start;
  height: 100%;
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
}

a.college-card:hover,
a.college-card:focus-visible {
  border-color: var(--navy-600);
  box-shadow: var(--shadow-raised);
}

.college-card__mark {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: var(--navy-800);
  color: #ffffff;
  font-family: var(--font-serif);
  font-weight: 700;
}

.college-card--soon .college-card__mark {
  background: var(--sunken);
  color: var(--ink-muted);
}

.college-card__name {
  display: block;
  margin: 0 0 var(--space-1);
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-weight: 600;
}

.college-card__meta {
  display: block;
  margin: 0 0 var(--space-2);
  color: var(--ink-muted);
  font-size: var(--text-sm);
}

.request-form {
  max-width: 640px;
}

/* ---------- About ---------- */

.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.pillar {
  padding: var(--space-5);
  border-top: 3px solid var(--navy-800);
  background: var(--surface);
}

.pillar h3 {
  margin-top: var(--space-3);
}

.pillar p {
  margin: 0;
  color: var(--ink-muted);
}

@media (max-width: 900px) {
  .calc {
    grid-template-columns: minmax(0, 1fr);
  }

  .calc__result {
    position: static;
  }
}

@media (max-width: 600px) {
  .scholarship {
    grid-template-columns: minmax(0, 1fr);
  }

  .scholarship__side {
    align-items: flex-start;
    text-align: left;
  }

  .calc__figures {
    grid-template-columns: minmax(0, 1fr);
  }

  .calc__form .field-row {
    grid-template-columns: minmax(0, 1fr);
  }
}
