/* Shared styles for the home page and its resource pages.
   BYU-Idaho blue as the brand color; rounded cards, soft shadows, and
   generous whitespace for everything else. */

:root {
  color-scheme: light dark;

  /* brand */
  --byui-blue: #006eb6;
  --byui-blue-dark: #00518a;
  --byui-blue-deep: #003a63;
  --byui-blue-tint: #e6f1f8;

  /* neutrals */
  --ink: #222;
  --ink-muted: #6a6a6a;
  --surface: #fff;
  --surface-alt: #f7f7f7;
  --border: #e4e4e4;
  --link: var(--byui-blue);
  --footer-bg: #1d1d1f;

  /* shape */
  --radius-sm: 8px;
  --radius: 16px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 6%), 0 4px 12px rgb(0 0 0 / 5%);
  --shadow-md: 0 2px 4px rgb(0 0 0 / 8%), 0 10px 28px rgb(0 0 0 / 12%);

  /* layout */
  --container: 72rem;
  --gutter: clamp(1rem, 4vw, 2rem);

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --byui-blue-tint: #12324a;
    --ink: #f2f2f2;
    --ink-muted: #a9adb2;
    --surface: #1c1e21;
    --surface-alt: #121416;
    --border: #33373c;
    --link: #6bb8ec;
    --footer-bg: #0b0c0d;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 40%);
    --shadow-md: 0 10px 28px rgb(0 0 0 / 50%);
  }
}

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

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  background-color: var(--surface-alt);
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1;
}

h1,
h2,
h3,
p,
ul {
  margin: 0;
}

ul {
  padding: 0;
  list-style: none;
}

a {
  color: var(--link);
}

svg {
  flex: none;
}

:focus-visible {
  outline: 3px solid var(--byui-blue);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--surface);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 0.75rem;
}

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

/* Site header ******************************/
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1.5rem;
  min-height: 4.25rem;
  padding-block: 0.6rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 10px;
  background-color: var(--byui-blue);
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.brand-name {
  display: block;
  font-weight: 700;
  line-height: 1.2;
}

.brand-tag {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--link);
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-inline: -0.5rem;
}

.site-nav a {
  display: block;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-pill);
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.15s;
}

.site-nav a:hover {
  background-color: var(--surface-alt);
}

.site-nav a[aria-current="page"] {
  background-color: var(--byui-blue-tint);
  color: var(--link);
  font-weight: 600;
}

/* Hero ******************************/
.hero {
  padding-block: clamp(2.5rem, 7vw, 4.5rem);
  color: #fff;
  background:
    radial-gradient(60rem 30rem at 85% -20%, rgb(255 255 255 / 18%), transparent 60%),
    linear-gradient(135deg, var(--byui-blue) 0%, var(--byui-blue-dark) 60%, var(--byui-blue-deep) 100%);
}

.eyebrow {
  margin-bottom: 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgb(255 255 255 / 85%);
}

.eyebrow a {
  color: inherit;
}

.hero h1 {
  font-size: clamp(2rem, 6vw, 3.25rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.lede {
  max-width: 40rem;
  margin-top: 0.75rem;
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  color: rgb(255 255 255 / 90%);
}

.search {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 36rem;
  margin-top: 1.75rem;
  padding: 0.35rem 1.1rem;
  border-radius: var(--radius-pill);
  background-color: #fff;
  color: #6a6a6a;
  box-shadow: var(--shadow-md);
}

.search:focus-within {
  outline: 3px solid rgb(255 255 255 / 70%);
  outline-offset: 2px;
}

.search input {
  flex: 1;
  min-width: 0;
  height: 2.9rem;
  border: 0;
  background: transparent;
  color: #222;
  font: inherit;
  outline: none;
}

.search input::placeholder {
  color: #6a6a6a;
}

.search kbd {
  padding: 0.1rem 0.5rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.8rem;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
  font-size: 0.85rem;
}

.hero-meta li {
  padding: 0.3rem 0.8rem;
  border: 1px solid rgb(255 255 255 / 30%);
  border-radius: var(--radius-pill);
  background-color: rgb(255 255 255 / 12%);
}

.hero-meta time {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Resource cards ******************************/
.resources {
  padding-block: clamp(2rem, 5vw, 3.5rem);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: 1.25rem;
  align-items: start;
}

.card {
  padding: 1.25rem 0.75rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background-color: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card h2 {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.6rem;
  padding-inline: 0.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.25;
}

.card-icon {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 12px;
  background-color: var(--byui-blue-tint);
  color: var(--link);
}

.link-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.15s;
}

.link-list a::after {
  content: "→";
  color: var(--ink-muted);
  transition: color 0.15s, transform 0.15s;
}

.link-list a[target="_blank"]::after {
  content: "↗";
}

.link-list a:hover {
  background-color: var(--surface-alt);
}

.link-list a:hover::after {
  color: var(--link);
  transform: translateX(2px);
}

.link-host {
  display: block;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--ink-muted);
}

.no-results {
  padding: 2.5rem 1rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
  color: var(--ink-muted);
}

/* Courses ******************************/
.courses {
  padding-block: clamp(2rem, 5vw, 3.5rem);
  border-top: 1px solid var(--border);
  background-color: var(--surface);
}

.courses h2 {
  font-size: clamp(1.3rem, 3vw, 1.6rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.course-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 1.5rem 2rem;
  margin-top: 1.5rem;
}

.course-groups h3 {
  margin-bottom: 0.6rem;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chips li {
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background-color: var(--surface-alt);
  font-size: 0.88rem;
  font-weight: 600;
}

/* Site footer ******************************/
.site-footer {
  padding-block: 2rem;
  background-color: var(--footer-bg);
  color: #d6d6d6;
  font-size: 0.88rem;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem 2rem;
}

.site-footer strong {
  color: #fff;
}

.site-footer a {
  color: #fff;
  text-underline-offset: 3px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}

.footer-fine {
  margin-top: 0.35rem;
  font-size: 0.8rem;
  color: #a6a6a6;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition: none !important;
  }
}

@media print {
  .site-header {
    position: static;
  }

  .search,
  .hero-meta,
  .site-nav {
    display: none;
  }

  .hero {
    background: none;
    color: #000;
  }
}
