/* Framingham State University - Transfer Course Equivalencies
 * Matches the FSU Directory theme. Gold #FCB614 and Black anchor the design;
 * gold is used for accents and backgrounds behind black text only
 * (gold text on white fails contrast). */

:root {
  --gold: #fcb614;
  --black: #000;
  --charcoal: #2c2e35;

  --bg: #fff;
  --surface: #f5f5f3;
  --text: #111;
  --muted: #4a4a4a;          /* 8.9:1 on white */
  --border: #d4d4d4;         /* decorative dividers */
  --control-border: #6b6b6b; /* form controls: >= 3:1 */
  --link: #000;
  --focus: #000;
  --btn-bg: #000;
  --btn-text: #fff;

  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #18191d;
    --surface: var(--charcoal);
    --text: #f2f2f2;
    --muted: #c4c5ca;
    --border: #3d4048;
    --control-border: #8b8e96;
    --link: var(--gold);
    --focus: var(--gold);
    --btn-bg: var(--gold);
    --btn-text: #000;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 1rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 1.0625rem; /* 17px */
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Wider than the directory so the five-column table fits. */
.wrap {
  width: 100%;
  max-width: 62rem;
  margin-inline: auto;
  padding-inline: 1rem;
}

main {
  flex: 1;
  padding-block: 1.5rem 3rem;
}

main:focus {
  outline: none;
}

/* ---------- Focus & skip link ---------- */

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100%;
  z-index: 10;
  padding: 0.75rem 1rem;
  background: var(--gold);
  color: #000;
  font-weight: 700;
  text-decoration: underline;
}

.skip-link:focus {
  top: 1rem;
  outline: 3px solid #000;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Header & footer ---------- */

.site-header {
  background: var(--black);
  border-bottom: 6px solid var(--gold);
}

.site-name {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding-block: 0.875rem;
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  line-height: 1.2;
}

/* FSU mark: shown at its original proportions, never stretched or recolored. */
.site-logo {
  flex: none;
  display: block;
  width: 40px;
  height: 40px;
}

.site-name-sub {
  color: var(--gold);
}

.site-name:hover .site-name-text {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.site-header :focus-visible {
  outline-color: var(--gold);
}

.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9375rem;
}

.site-footer p {
  margin-block: 1.25rem;
}

.site-footer a {
  color: var(--text);
}

/* ---------- Type ---------- */

h1,
h2,
h3 {
  line-height: 1.15;
  margin-block: 0 0.5em;
}

h1 {
  font-size: clamp(1.75rem, 1.4rem + 1.6vw, 2.375rem);
  font-weight: 800;
  padding-left: 0.75rem;
  border-left: 6px solid var(--gold);
  overflow-wrap: anywhere;
}

h2 {
  font-size: 1.375rem;
  font-weight: 700;
}

h3 {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 1.25rem 0 0.25rem;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

.lede {
  color: var(--muted);
  margin-top: -0.25rem;
}

.back-link {
  margin: 0 0 1rem;
}

/* ---------- Panels & search ---------- */

.panel {
  margin-top: 2rem;
}

.search {
  max-width: 40rem;
}

.search label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.375rem;
}

.search-row {
  display: flex;
  gap: 0.5rem;
}

.search input[type="search"] {
  flex: 1;
  min-width: 0;
  min-height: 3rem;
  padding: 0.5rem 0.875rem;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 2px solid var(--control-border);
  border-radius: 0.5rem;
}

.search input[type="search"]:focus-visible {
  border-color: var(--focus);
  outline-offset: 1px;
}

.search button {
  min-height: 3rem;
  padding: 0.5rem 1.25rem;
  font: inherit;
  font-weight: 700;
  color: var(--btn-text);
  background: var(--btn-bg);
  border: 2px solid var(--btn-bg);
  border-radius: 0.5rem;
  cursor: pointer;
}

.search button:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: #000;
}

.status {
  min-height: 1.55em;
  margin: 0.5rem 0;
  color: var(--muted);
  font-size: 0.9375rem;
}

/* ---------- Letter jump bar ---------- */

.letter-nav ul {
  list-style: none;
  margin: 0.25rem 0 0.5rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.letter-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0 0.5rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.letter-nav a:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: #000;
}

/* ---------- Result lists ---------- */

.results {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
}

.results li {
  border-bottom: 1px solid var(--border);
}

.results a {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 3rem;
  padding: 0.625rem 0.75rem;
  border-left: 4px solid transparent;
  color: var(--text);
  text-decoration: none;
}

.results a:hover {
  background: var(--surface);
  border-left-color: var(--gold);
}

.results a:hover .name {
  text-decoration: underline;
}

.results .name {
  font-weight: 600;
}

.letter-group h3 {
  padding-left: 0.75rem;
}

/* Two columns of colleges on wide screens. */
@media (min-width: 48rem) {
  .results.columns {
    columns: 2;
    column-gap: 2rem;
    border-top: 0;
  }

  .results.columns li {
    break-inside: avoid;
  }
}

/* ---------- Sort control ---------- */

.sort-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 1rem;
}

.sort-label {
  font-weight: 700;
}

.sort-options {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.sort-options a {
  display: flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 1rem;
  border: 2px solid var(--control-border);
  border-radius: 999px;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.sort-options a:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: #000;
}

.sort-options a[aria-current] {
  background: var(--btn-bg);
  border-color: var(--btn-bg);
  color: var(--btn-text);
}

/* ---------- Equivalency table ---------- */

.equiv {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}

.equiv th,
.equiv td {
  padding: 0.625rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

.equiv thead th {
  background: var(--black);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 4px solid var(--gold);
}

.equiv tbody tr {
  border-bottom: 1px solid var(--border);
}

.equiv tbody tr:hover {
  background: var(--surface);
}

.equiv .course-code {
  font-weight: 700;
  white-space: nowrap;
}

/* On phones, each equivalency becomes a card (the explicit ARIA roles in
 * the markup keep it announced as a table). */
@media (max-width: 47.99rem) {
  .equiv thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .equiv,
  .equiv tbody,
  .equiv tr,
  .equiv td {
    display: block;
  }

  .equiv tbody tr {
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.875rem;
    background: var(--surface);
    border: 0;
    border-left: 4px solid var(--gold);
    border-radius: 0 0.5rem 0.5rem 0;
  }

  .equiv td {
    display: grid;
    grid-template-columns: 8.5rem 1fr;
    gap: 0.75rem;
    padding: 0.25rem 0;
    overflow-wrap: anywhere;
  }

  .equiv td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.875rem;
    font-weight: 700;
  }

  .equiv .course-code {
    white-space: normal;
  }
}

@media (max-width: 24rem) {
  .equiv td {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

/* ---------- Print ---------- */

@media print {
  .skip-link,
  .search,
  .status,
  .back-link,
  .letter-nav,
  .sort-row {
    display: none !important;
  }

  .site-header {
    background: none;
    border-bottom: 2px solid #000;
  }

  .site-name,
  .site-name-sub {
    color: #000;
  }

  .equiv thead th {
    background: none;
    color: #000;
    border-bottom: 2px solid #000;
  }
}
