/**
 * Homepage v5 — Church first, BYU-I secondary, Best Universities identity.
 * Church: crimson #D50032 on white, near-black text, sans headings, photo hero.
 * BYU-I: blue used for secondary actions, labels, and stats only.
 * Standalone (does not depend on v2/v3/v4 theme files).
 */

:root {
  /* Church (primary) */
  --ch-red: #d50032;
  --ch-red-deep: #a80027;
  --ch-ink: #121212;
  --ch-charcoal: #2c2c2c;
  --ch-text: #3a3d40;
  --ch-muted: #656565;
  --ch-line: #e6dfe0;
  --ch-band: #f6f5f5;
  --ch-white: #ffffff;
  /* BYU-I (secondary) */
  --by-blue: #006eb6;
  --by-blue-deep: #00538f;
  --by-blue-hover: #1764aa;
  --by-blue-soft: #a2daff;
  --by-blue-wash: #e8f4fc;
  --ch-max: 1200px;
  /* Reading width for running text only. Boxes and modules span the full container. */
  --v5-measure: 46rem;
  --ch-radius: 10px;
  --ch-font: "Open Sans", "Source Sans 3", system-ui, -apple-system, sans-serif;
}

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

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Keyboard focus: one visible ring everywhere; lighter ring on dark bands */
:focus-visible {
  outline: 3px solid var(--by-blue);
  outline-offset: 2px;
}

.v5-util :focus-visible,
.v5-pagehero :focus-visible,
.v5-footer :focus-visible,
.v5-preview-bar :focus-visible {
  outline-color: var(--by-blue-soft);
}

body.v5-body {
  margin: 0;
  font-family: var(--ch-font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ch-text);
  background: var(--ch-white);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--by-blue);
}

a:hover {
  color: var(--by-blue-hover);
}

img {
  max-width: 100%;
  display: block;
}

.v5-wrap {
  width: min(100% - 2rem, var(--ch-max));
  margin-inline: auto;
}

.v5-skip {
  position: absolute;
  left: -9999px;
}

.v5-skip:focus {
  left: 1rem;
  top: 1rem;
  z-index: 100;
  background: #fff;
  padding: 0.5rem 0.75rem;
}

/* Preview chrome */
.v5-preview-bar {
  background: #111;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.75rem;
  padding: 0.45rem max(1rem, calc((100% - var(--ch-max)) / 2));
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  justify-content: space-between;
}

.v5-preview-bar a {
  color: var(--by-blue-soft);
}

/* Utility bar — Church-style charcoal, small links */
.v5-util {
  background: var(--ch-charcoal);
  color: #fff;
  font-size: 0.8125rem;
}

.v5-util__inner {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1.5rem;
  min-height: 36px;
}

.v5-util a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  font-weight: 600;
}

.v5-util a:hover {
  color: #fff;
  text-decoration: underline;
}

/* Header — white, crimson accent */
.v5-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--ch-white);
  border-bottom: 1px solid var(--ch-line);
  height: 72px;
}

.v5-header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

/* Brand — BU identity in Church's red */
.v5-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ch-ink);
}

.v5-brand__mark {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--ch-red);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: -0.02em;
}

.v5-brand__name {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.v5-brand__name small {
  display: block;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ch-muted);
  margin-top: 0.1rem;
}

.v5-nav {
  display: none;
  align-items: center;
  gap: 1.5rem;
}

.v5-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--ch-ink);
  text-decoration: none;
  padding: 0.35rem 0;
}

.v5-nav a:hover {
  color: var(--ch-red);
}

.v5-nav a[aria-current="page"] {
  box-shadow: inset 0 -3px 0 var(--ch-red);
}

.v5-header__actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.v5-header__actions .v5-btn {
  white-space: nowrap;
}

.v5-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--ch-font);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  border-radius: 6px;
  padding: 0.6rem 1.15rem;
  border: 1.5px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

/* Primary — Church crimson */
.v5-btn--red {
  background: var(--ch-red);
  border-color: var(--ch-red);
  color: #fff;
}

.v5-btn--red:hover {
  background: var(--ch-red-deep);
  border-color: var(--ch-red-deep);
  color: #fff;
}

/* Secondary — BYU-I blue outline */
.v5-btn--blue-outline {
  background: #fff;
  border-color: var(--by-blue);
  color: var(--by-blue);
}

.v5-btn--blue-outline:hover {
  background: var(--by-blue-wash);
  color: var(--by-blue-deep);
}

.v5-btn--white {
  background: #fff;
  border-color: #fff;
  color: var(--ch-red);
}

.v5-btn--white:hover {
  background: #f5f5f5;
  color: var(--ch-red-deep);
}

.v5-btn--ghost-light {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.85);
  color: #fff;
}

.v5-btn--ghost-light:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.v5-btn--lg {
  padding: 0.8rem 1.5rem;
  font-size: 1rem;
}

.v5-menu {
  display: inline-flex;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ch-line);
  border-radius: 6px;
  background: #fff;
  color: var(--ch-ink);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.v5-menu[aria-expanded="true"] {
  border-color: var(--ch-red);
  color: var(--ch-red);
}

@media (min-width: 960px) {
  .v5-nav {
    display: flex;
  }
  .v5-menu {
    display: none;
  }
}

/* Narrow phones: logo + menu button only. Rankings and FAQ live in the menu.
   The utility bar (Methodology, Sources, Contact) is hidden too; the footer carries those links. */
@media (max-width: 639.98px) {
  .v5-header__actions .v5-btn {
    display: none;
  }

  .v5-util {
    display: none;
  }
}

/* Mobile menu: nav drops below the header when the menu button is open */
@media (max-width: 959.98px) {
  .v5-header.is-menu-open .v5-nav {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.25rem max(1rem, calc((100% - var(--ch-max)) / 2)) 0.75rem;
    background: var(--ch-white);
    border-bottom: 1px solid var(--ch-line);
    box-shadow: 0 14px 28px rgba(18, 18, 18, 0.14);
  }

  .v5-header.is-menu-open .v5-nav a {
    min-height: 48px;
    padding: 0.35rem 0.25rem;
    border-bottom: 1px solid var(--ch-line);
  }

  .v5-header.is-menu-open .v5-nav a:last-child {
    border-bottom: 0;
  }

  .v5-header.is-menu-open .v5-nav a[aria-current="page"] {
    box-shadow: inset 4px 0 0 var(--ch-red);
    padding-left: 0.85rem;
  }
}

/* Hero — full-bleed photo, charcoal scrim (Church-style), crimson CTA */
.v5-hero {
  position: relative;
  min-height: clamp(460px, 64vh, 680px);
  display: flex;
  align-items: center;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(18, 18, 18, 0.9) 0%, rgba(18, 18, 18, 0.7) 44%, rgba(18, 18, 18, 0.18) 100%),
    url("../img/bu-home-hero-v21.jpg");
  background-size: cover;
  background-position: center right;
  padding: 4rem 0;
}

.v5-hero__inner {
  max-width: 36rem;
}

.v5-hero__rule {
  width: 3rem;
  height: 4px;
  background: var(--ch-red);
  margin: 0 0 1.1rem;
}

.v5-hero__eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
}

.v5-hero h1 {
  margin: 0 0 1rem;
  font-weight: 800;
  font-size: clamp(2.1rem, 4.6vw, 3.25rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: #fff;
}

.v5-hero__lede {
  margin: 0 0 1.75rem;
  font-size: 1.1rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.94);
  max-width: 32rem;
}

.v5-hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Quick links — Church-style red line icons on white */
.v5-quick {
  background: var(--ch-white);
  border-bottom: 1px solid var(--ch-line);
  padding: 1.75rem 0;
}

.v5-quick__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem 1rem;
}

@media (min-width: 760px) {
  .v5-quick__grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.v5-quick a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  text-align: center;
  text-decoration: none;
  color: var(--ch-ink);
  font-weight: 700;
  font-size: 0.9rem;
}

.v5-quick a:hover {
  color: var(--ch-red);
}

.v5-quick__icon {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  border: 2px solid var(--ch-red);
  color: var(--ch-red);
  display: grid;
  place-items: center;
}

.v5-quick a:hover .v5-quick__icon {
  background: var(--ch-red);
  color: #fff;
}

.v5-quick__icon svg {
  width: 1.65rem;
  height: 1.65rem;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Sections */
.v5-section {
  padding: clamp(2.75rem, 5vw, 4rem) 0;
}

.v5-section--band {
  background: var(--ch-band);
}

.v5-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.v5-section__head h2 {
  margin: 0;
  font-weight: 800;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ch-ink);
}

.v5-section__sub {
  margin: 0.4rem 0 0;
  color: var(--ch-muted);
  font-size: 0.975rem;
  max-width: 38rem;
}

.v5-more {
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  color: var(--ch-red);
  white-space: nowrap;
}

.v5-more:hover {
  text-decoration: underline;
  color: var(--ch-red-deep);
}

/* Cards — white, red top rule, blue category label (secondary) */
.v5-cards {
  display: grid;
  gap: 1.1rem;
}

@media (min-width: 820px) {
  .v5-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.v5-card {
  background: #fff;
  border: 1px solid var(--ch-line);
  border-top: 4px solid var(--ch-red);
  border-radius: var(--ch-radius);
  padding: 1.35rem 1.35rem 1.45rem;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 4px 16px rgba(18, 18, 18, 0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.v5-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(18, 18, 18, 0.1);
  color: inherit;
}

.v5-card__cat {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--by-blue);
}

.v5-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ch-ink);
}

.v5-card__meta {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ch-muted);
}

/* Find band — Church crimson */
.v5-split {
  display: grid;
  border-radius: var(--ch-radius);
  overflow: hidden;
  min-height: 260px;
}

@media (min-width: 820px) {
  .v5-split {
    grid-template-columns: 1.1fr 1fr;
  }
}

.v5-split__copy {
  background: var(--ch-red);
  color: #fff;
  padding: 2.25rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
}

.v5-split__copy h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.05rem);
  font-weight: 800;
  line-height: 1.2;
  color: #fff;
}

.v5-split__copy p {
  margin: 0;
  color: rgba(255, 255, 255, 0.95);
}

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

.v5-split__form input {
  flex: 1 1 14rem;
  border: 0;
  border-radius: 6px;
  padding: 0.75rem 0.9rem;
  font: inherit;
}

.v5-split__media {
  background:
    linear-gradient(0deg, rgba(18, 18, 18, 0.25), rgba(18, 18, 18, 0.25)),
    url("../img/bu-home-hero-v21.jpg") center / cover;
  min-height: 220px;
}

/* Stats — light band, BYU-I blue numbers (secondary) */
.v5-stats {
  background: var(--ch-band);
  border-top: 1px solid var(--ch-line);
  padding: 2.25rem 0;
}

.v5-stats__grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 720px) {
  .v5-stats__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.v5-stats strong {
  display: block;
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--by-blue-deep);
  letter-spacing: -0.01em;
}

.v5-stats p {
  margin: 0.35rem 0 0;
  color: var(--ch-muted);
  font-size: 0.95rem;
}

/* Footer — Church charcoal, red rule, BYU-I blue link hovers */
.v5-footer {
  background: var(--ch-charcoal);
  border-top: 4px solid var(--ch-red);
  color: rgba(255, 255, 255, 0.9);
  padding: 3rem 0 1.75rem;
}

.v5-footer a {
  color: #fff;
  text-decoration: none;
}

.v5-footer a:hover {
  text-decoration: underline;
  color: var(--by-blue-soft);
}

.v5-footer__grid {
  display: grid;
  gap: 1.75rem;
  margin-bottom: 2rem;
}

@media (min-width: 800px) {
  .v5-footer__grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.v5-footer h3 {
  margin: 0 0 0.65rem;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
}

.v5-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.v5-footer li {
  margin: 0 0 0.45rem;
}

.v5-footer li a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
}

/* Touch screens: 44px minimum targets for small text links */
@media (pointer: coarse) {
  .v5-util a,
  .v5-footer li a {
    min-height: 44px;
  }

  .v5-util__inner {
    gap: 0.25rem 1rem;
  }
}

.v5-footer p {
  margin: 0.75rem 0 0;
  max-width: 28rem;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.8);
}

.v5-footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 1rem;
  font-size: 0.8125rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  color: rgba(255, 255, 255, 0.75);
}

.v5-footer .v5-brand {
  color: #fff;
}

.v5-footer .v5-brand__mark {
  background: #fff;
  color: var(--ch-red);
}

.v5-footer .v5-brand__name small {
  color: rgba(255, 255, 255, 0.7);
}

/* Master logo: steps mark + V1-style text masthead (Outfit wordmark) */
.v5-logo {
  /* Extra hit area above and below the wordmark without moving it */
  padding-block: 0.75rem;
  margin-block: -0.75rem;
  display: inline-flex;
  align-items: baseline;
  gap: 0.42em;
  text-decoration: none;
  color: var(--ch-ink);
  font-family: "Outfit", system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(1.45rem, 2.2vw, 1.75rem);
  letter-spacing: -0.02em;
  word-spacing: 0.04em;
  line-height: 1;
  white-space: nowrap;
}

.v5-logo:hover,
.v5-logo:focus-visible {
  color: var(--ch-ink);
  opacity: 0.85;
}

/* Mark is cropped tight to the artwork and sized to the wordmark cap height (Outfit B renders ~0.715em),
   then baseline-aligned so its top and bottom match the letters. */
.v5-mark {
  --mk-1: var(--ch-red);
  --mk-2: var(--ch-charcoal);
  height: 0.715em;
  width: auto;
  aspect-ratio: 26 / 22;
  flex: none;
  display: block;
  transform: translateY(var(--mk-nudge, 0.01em));
}

.v5-mark__body {
  fill: var(--mk-2);
}

.v5-mark__cap {
  fill: var(--mk-1);
}

.v5-footer .v5-logo {
  color: #fff;
  font-size: clamp(1.4rem, 2.1vw, 1.65rem);
}

.v5-footer .v5-mark {
  --mk-2: #fff;
}

.v5-footer .v5-logo:hover,
.v5-footer .v5-logo:focus-visible {
  color: #fff;
}
