:root {
  --size-h1: 3rem; /* 48px  "AI Learning Hub" */
  --size-h2: 2rem; /* 32px  "Find a Learning Topic" */
  --size-h3: 1.5rem; /* 24px  "All Learning Topics" */
  --size-h4: 1.25rem; /* 20px  format card names, topic card titles */

  --illini-blue: #13294b;
  --illini-orange: #ff5f05;
  --orange-text: #c84113;
  --text-body: #3d4b63;
  --text-muted: #4a5a75;
  --border-light: #dde2ea;
  --border-default: #c9d1de;
  --border-input: #949494;
  --surface-muted: #f4f6f9;
  --white: #ffffff;

  --font-title: Georgia, "Times New Roman", serif;
  --font-body: "Source Sans 3", "Source Sans Pro", system-ui, sans-serif;
  --container-width: 80rem;
  --radius-card: 8px;
  --radius-field: 6px;
  --radius-button: 4px;
  --focus-ring: 3px solid var(--illini-orange);
}

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

.main {
  color: var(--illini-blue);
  font-family: var(--font-body);
  line-height: 1.65;
}

.main p {
  font-size: 1.125rem;
  line-height: 1.7;
}

.main h1,
.main h2,
.main h3,
.main h4 {
  font-family: var(--font-body);
}

.main a:not(.button) {
  color: var(--illini-blue);
}

.main a:not(.button):hover {
  color: var(--illini-orange);
}

.main :focus-visible {
  outline: var(--focus-ring);
  outline-offset: 2px;
}

.container {
  max-width: var(--container-width);
  margin-inline: auto;
  padding-inline: 2rem;
}

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

/* ---------- Hero ---------- */
.hero {
  background: var(--illini-blue);
  color: var(--white);
}

.hero-inner {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: clamp(10rem, 20vh, 14rem);
  padding-block: 2rem;
}

.main .hero-title {
  margin: 0;
  font-family: var(--font-title);
  font-weight: 600;
  font-size: var(--size-h1);
  line-height: 1.2;
}

.hero-title::before {
  content: "";
  display: block;
  width: 45px;
  height: 4px;
  margin-bottom: 0.75rem;
  background: var(--illini-orange);
}

/* ---------- Sponsoring units ----------*/
.sponsors {
  padding-top: 5rem;
}

.sponsors-image {
  display: block;
  width: 100%;
  max-width: 26rem;
  height: auto;
  margin-inline: auto;
}

/* ---------- Sections ---------- */
.section {
  padding-block: 4.5rem 1.5rem;
}
.section:first-of-type {
  padding-top: 4.5rem;
}

.section-intro {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.main .section-heading {
  margin: 0;
  font-weight: 700;
  font-size: var(--size-h2);
  line-height: 1.25;
}

.main .section-text {
  margin: 0;
  color: var(--text-body);
}

.results-title:focus {
  outline: none;
}
.results-title:focus-visible {
  outline: var(--focus-ring);
  outline-offset: 4px;
}

/* ---------- Intro and learning formats ---------- */
.intro-section {
  padding-bottom: 2rem;
}

.main .page-intro {
  margin: 0;
  font-size: 1.2rem;
}

.main .page-intro + .page-intro {
  margin-top: 0.5rem;
}

/* AI Professional Development page link: darker orange on hover for contrast */
.main .page-intro a:hover {
  color: var(--orange-text);
}

/* ---------- Format cards ---------- */
.info-card-grid {
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 1.25rem;
}

.info-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 1.5rem 1rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-card);
  text-align: center;
}

/* Illinois brand icon size and color */
.info-card-icon {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 3rem; /* 48px */
  line-height: 1;
  color: var(--illini-orange);
}

.main .info-card-title {
  margin: 0;
  font-weight: 700;
  font-size: var(--size-h4);
  line-height: 1.3;
}

.main .info-card-duration {
  margin: 0;
  line-height: 1.4;
  color: var(--text-body);
}

/* ---------- Catalog controls ---------- */
.catalog {
  padding-bottom: 6rem;
}
.main .catalog .section-heading {
  margin-bottom: 1.75rem;
}

.catalog-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.search-field {
  flex: 1 1 32rem;
}

.search-field-input,
.format-field-select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-field);
  background: var(--white);
  color: var(--illini-blue);
  font-family: inherit;
  font-size: 1.125rem;
}

.search-field-input {
  padding: 0 1rem;
}
.search-field-input::placeholder {
  color: #6b6b6b;
}

.format-field {
  flex: 0 1 15rem;
  min-width: 12.5rem;
}

.format-field-select {
  padding: 0 2.75rem 0 1rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2313294B' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}

.pathway-filter {
  margin-top: 2rem; /* space between the search bar and the pathway buttons */
}

.main .pathway-filter-label {
  margin: 0 0.25rem 0 0;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.3;
}

.pathway-filter-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem;
}

.pathway-pill {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.5rem 1rem;
  border: 1px solid var(--illini-blue);
  border-radius: 0.35rem;
  background: var(--white);
  color: #13294b;
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem; /* 16px */
  line-height: 1.2;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.pathway-pill {
  border-radius: 999px;
  padding-inline: 1rem;
}

.pathway-pill:hover {
  background: #f9fafb;
  outline: 2px solid #13294b;
  outline-offset: 2px;
}

.pathway-pill[aria-pressed="true"] {
  background: #ff5f05;
  border-color: #ff5f05;
  color: var(--white);
}

.pathway-pill[aria-pressed="true"]:hover {
  background: var(--white);
  color: #13294b;
  border-color: #13294b;
}

/* ---------- Results ---------- */
.results-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin: 3rem 0 2rem; /* space above the results heading, and below it to the topic cards */
}

.main .results-title {
  margin: 0;
  font-weight: 700;
  font-size: var(--size-h3);
  line-height: 1.3;
}

.main .results-summary {
  margin: 0;
  color: var(--text-body);
}

.empty-state {
  padding: 4rem 1.5rem 3rem 1.5rem;
  text-align: center;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-card);
}

.main .empty-state-text {
  margin: 0 0 1.25rem;
}

/* ---------- Topic cards ---------- */
.topic-grid {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(18.75rem, 100%), 1fr));
  gap: 2rem;
}

.topic-card {
  position: relative; /* the stretched title link covers this box */
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: 0.7rem;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

/* Hover: a soft shadow and a slight lift */
.topic-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(19, 41, 75, 0.12);
}

/* Clickable card: the title is always underlined so it reads as a link */
.main a.topic-card-link {
  color: #13294b;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

/* Hover anywhere on the card: the title turns orange and the underline gets thicker */
.topic-card:hover .topic-card-link,
.main a.topic-card-link:hover {
  color: var(--orange-text);
  text-decoration-thickness: 2px;
}

/* Keyboard focus: outline the whole card, not just the title */
.main .topic-card-link:focus-visible {
  outline: none;
}

.topic-card:has(.topic-card-link:focus-visible) {
  outline: 3px solid #13294b;
  outline-offset: 3px;
}

.topic-card-image {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
  background: #e8e9eb;
}

.topic-card-content {
  container: topic-card / inline-size;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.875rem;
  padding: 1.5rem 1.25rem; /* 20px sides leave room for all three badges on one row */
}

.main .topic-card-title {
  margin-bottom: 0.5rem;
  font-weight: 700;
  font-size: var(--size-h4);
  line-height: 1.4;
  color: #13294b;
}

.main .topic-card-description {
  margin: 0;
  color: var(--text-body);
}

.topic-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem 0.25rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.375rem;
  border: 1px solid #e8e9eb;
  border-radius: 4px;
  background: #e8e9eb;
  color: #13294b;
  font-weight: 700;
  font-size: 0.835rem;
  line-height: 1.5;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Format and time badges: white with a thin gray border */
.badge-outline {
  border-color: #c8ccd2;
  background: var(--white);
  font-weight: 400;
}

.badge-icon {
  font-size: 1rem; /* 16px */
  line-height: 1;
  color: var(--illini-orange);
}

/* ---------- Load More Topics ---------- */
.load-more {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-top: 3rem;
}

.load-more[hidden] {
  display: none;
}

.load-more-button {
  min-height: 48px;
  padding: 0.75rem 2rem;
  border: 1px solid #13294b;
  border-radius: 0.5rem;
  background: var(--white);
  color: #13294b;
  font-family: inherit;
  font-weight: 700;
  font-size: 1.1875rem;
  line-height: 1.2;
  cursor: pointer;
}

.load-more-button:hover {
  background: #13294b;
  color: var(--white);
}

.main .load-more-count {
  margin: 0;
  color: var(--text-body);
}

/* ---------- Buttons ---------- */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0 1.25rem;
  border: 1px solid transparent;
  border-radius: var(--radius-button);
  font-family: inherit;
  font-weight: 700;
  font-size: 1.0625rem;
  text-decoration: none;
  cursor: pointer;
}

.button-primary {
  background: var(--illini-blue);
  border-color: var(--illini-blue);
  color: var(--white);
}

.button-primary:hover {
  background: var(--illini-orange);
  border-color: var(--illini-orange);
  color: var(--white);
}

.button-full {
  display: flex;
  width: 100%;
}

/* Lets the hidden attribute hide the "Clear All Filters" button */
.button[hidden] {
  display: none;
}

/* ---------- Footer additions ---------- */

/* "Resources" / "Connect": sized to sit with "Illinois Human Resources" */
ilw-footer ilw-content h2.ilw-heading {
  margin: 0;
  font-size: 1.375rem;
  line-height: 1.3;
}

/* Line under each heading: starts at the left edge instead of being centered */
.footer-rule {
  width: 80%;
  height: 2px;
  margin: 0.75rem 0 1rem;
  border: 0;
  background-color: #13294b;
}

.footer-link-list {
  list-style-type: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

/* ---------- Small screens ---------- */
@media (max-width: 40rem) {
  .container {
    padding-inline: 1rem;
  }

  :root {
    --size-h1: 2.25rem; /* 36px */
    --size-h2: 1.75rem; /* 28px */
    --size-h3: 1.375rem; /* 22px */
  }

  .topic-card-content {
    padding: 1.25rem;
  }

  .format-field {
    flex-basis: 100%;
  }
}

/* Set reduced-motion settings: no lift or color animation */
@media (prefers-reduced-motion: reduce) {
  .topic-card,
  .pathway-pill {
    transition: none;
  }

  .topic-card:hover {
    transform: none;
  }
}
