/**
 * V5 inner pages (ranking + hub). Loads after bu-home-v5.css.
 * Church first (crimson, charcoal, sans), BYU-I blue secondary, V1-style text logo.
 */

/* Page hero (BYU-I deep blue band, Church red rule) */
.v5-pagehero {
  background: var(--ch-charcoal);
  color: #fff;
  padding: 2rem 0 2.5rem;
}

.v5-crumbs {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.6rem;
  margin: 0 0 1.25rem;
  padding: 0;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.8);
}

.v5-crumbs li + li::before {
  content: "/";
  margin-right: 0.6rem;
  opacity: 0.6;
}

.v5-crumbs a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
}

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

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

.v5-pagehero h1 {
  margin: 0 0 0.6rem;
  max-width: var(--v5-measure);
  font-family: var(--ch-font);
  font-weight: 800;
  font-size: clamp(1.9rem, 4vw, 2.85rem);
  line-height: 1.14;
  letter-spacing: -0.02em;
  color: #fff;
}

.v5-pagehero__updated {
  margin: 0 0 1rem;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.v5-pagehero__lede {
  margin: 0 0 0.75rem;
  max-width: var(--v5-measure);
  font-size: 1.05rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.95);
}

.v5-pagehero__lede a {
  color: #fff;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.v5-pagehero__lede a:hover {
  color: var(--by-blue-soft);
}

/* Page layout */
.v5-page {
  padding: 2.25rem 0 3.5rem;
}

.v5-page h2 {
  margin: 0 0 0.6rem;
  font-family: var(--ch-font);
  font-weight: 800;
  font-size: clamp(1.5rem, 2.8vw, 1.95rem);
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ch-ink);
}

.v5-block {
  margin-top: 2.5rem;
}

.v5-block:first-child {
  margin-top: 0;
}

.v5-block__lede {
  margin: 0 0 1.1rem;
  max-width: var(--v5-measure);
  color: var(--ch-muted);
}

/* Table of contents (details, closed on load) */
.v5-toc {
  border: 1px solid var(--ch-line);
  border-radius: var(--ch-radius);
  background: #fff;
  margin-bottom: 2rem;
}

.v5-toc summary {
  min-height: 44px;
  cursor: pointer;
  list-style: none;
  padding: 0.85rem 1.1rem;
  font-weight: 700;
  color: var(--ch-ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.v5-toc summary::-webkit-details-marker {
  display: none;
}

.v5-toc summary::after {
  content: "+";
  font-size: 1.35rem;
  line-height: 1;
  color: var(--ch-red);
}

.v5-toc[open] summary::after {
  content: "\2212";
}

.v5-toc ol {
  margin: 0;
  padding: 0 1.1rem 1rem 2.4rem;
  columns: 2 14rem;
  column-gap: 2rem;
}

.v5-toc li {
  margin: 0.25rem 0;
}

.v5-toc a {
  font-weight: 600;
  text-decoration: none;
}

.v5-toc a:hover {
  text-decoration: underline;
}

/* Collapsible lists inside migrated copy (converted from the old accordion plugin) */
.bu-accordion {
  border: 1px solid var(--ch-line);
  border-radius: var(--ch-radius);
  background: #fff;
  margin: 0.75rem 0 1.5rem;
}

.bu-accordion summary {
  min-height: 44px;
  cursor: pointer;
  list-style: none;
  padding: 0.7rem 1.1rem;
  font-weight: 700;
  color: var(--ch-ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.bu-accordion summary::-webkit-details-marker {
  display: none;
}

.bu-accordion summary::after {
  content: "+";
  font-size: 1.35rem;
  line-height: 1;
  color: var(--ch-red);
}

.bu-accordion[open] summary::after {
  content: "\2212";
}

.bu-accordion > ul {
  margin: 0;
  padding: 0 1.1rem 1rem 2.4rem;
  columns: 2 14rem;
  column-gap: 2rem;
}

/* Key takeaways */
.v5-takeaways {
  background: var(--ch-band);
  border-left: 4px solid var(--ch-red);
  border-radius: 0 var(--ch-radius) var(--ch-radius) 0;
  padding: 1.25rem 1.4rem;
}

.v5-takeaways h2 {
  font-size: 1.3rem;
  margin-bottom: 0.6rem;
}

.v5-takeaways ul {
  margin: 0;
  padding-left: 1.2rem;
}

.v5-takeaways li {
  margin: 0.35rem 0;
}

/* Explore programs unit (QDF host) */
.v5-unit {
  margin: 2rem 0;
}

affiliate-qdf.v5-qdf-host {
  display: block;
  width: 100%;
  --title-padding: 32px 16px 16px 16px;
  --title-background: #2c2c2c;
  --title-font-color: white;
  --title-text-color: white;
  --title-border: 1px solid #2c2c2c;
  --subtitle-text-color: #3a3d40;
  --widget-background-color: #ffffff;
  --widget-border-color: #e6dfe0;
  --widget-border-radius: 0.6rem;
  --card-background-color: #faf9f9;
  --select-font-color: #3a3d40;
  --form-labels-background-color: #ffffff;
  --form-labels-border-color: #e6dfe0;
  --border-color: #e6dfe0;
  --button-background-color: #d50032;
  --button-background-color-hover: #a80027;
  --button-qdf-font-color: #ffffff;
  --cta-card-button-color: #d50032;
  --cta-card-button-text-color: #ffffff;
  --snippet-color: #656565;
}

affiliate-el.v5-el-host {
  display: block;
  width: 100%;
}

.v5-sponsored {
  border: 1px solid var(--ch-line);
  border-radius: var(--ch-radius);
  background: var(--ch-band);
  padding: 1rem 1rem 0.75rem;
  margin: 2rem 0;
}

.v5-sponsored__disclosure {
  margin: 0.75rem 0 0;
  font-size: 0.8125rem;
  color: var(--ch-muted);
}

/* At-a-glance table */
.v5-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--ch-line);
  border-radius: var(--ch-radius);
  background: #fff;
}

.v5-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.975rem;
}

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

.v5-table th,
.v5-table td {
  padding: 0.8rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--ch-line);
}

.v5-table thead th {
  background: var(--ch-band);
  color: var(--ch-ink);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.v5-table tbody tr:last-child th,
.v5-table tbody tr:last-child td {
  border-bottom: 0;
}

.v5-table tbody th {
  font-weight: 700;
}

.v5-table tbody td:first-child {
  font-weight: 800;
  color: var(--ch-red);
  width: 4.5rem;
}

.v5-table tbody tr:hover {
  background: var(--ch-band);
}

/* School cards */
.v5-schools {
  display: grid;
  gap: 1.1rem;
}

.v5-school {
  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.1rem;
  box-shadow: 0 4px 18px rgba(20, 20, 20, 0.05);
}

.v5-school__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.v5-school__id {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  min-width: 0;
}

.v5-school__rank {
  flex: none;
  min-width: 2.75rem;
  height: 2.75rem;
  padding: 0 0.5rem;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--ch-red);
  color: #fff;
  font-weight: 800;
  font-size: 1.05rem;
}

.v5-school h3 {
  margin: 0;
  font-family: var(--ch-font);
  font-size: 1.3rem;
  line-height: 1.25;
}

.v5-school h3 a {
  color: var(--ch-ink);
  text-decoration: none;
}

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

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

/* Highest category grade: subtle callout under the school details */
.v5-school__best {
  margin: 1rem 0 0;
  padding: 0.65rem 0.9rem;
  border-left: 3px solid var(--by-blue);
  border-radius: 0 8px 8px 0;
  background: var(--by-blue-wash);
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--ch-ink, inherit);
}

.v5-grade {
  flex: none;
  text-align: center;
  border: 2px solid var(--by-blue);
  border-radius: 10px;
  padding: 0.4rem 0.8rem 0.5rem;
  min-width: 5.2rem;
}

.v5-grade__label {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ch-muted);
}

.v5-grade__letter {
  display: block;
  font-family: var(--ch-font);
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--by-blue-deep);
}

.v5-grade__place {
  display: block;
  font-size: 0.7rem;
  color: var(--ch-muted);
}

.v5-school__hook {
  margin: 0.9rem 0 0.25rem;
  font-weight: 700;
  color: var(--ch-ink);
}

.v5-school__blurb {
  margin: 0;
  color: var(--ch-text);
}

.v5-facts {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0 0;
  padding: 0.9rem 0 0;
  border-top: 1px solid var(--ch-line);
}

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

.v5-facts span {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ch-muted);
}

.v5-facts strong {
  font-size: 1.15rem;
  color: var(--ch-ink);
}

.v5-school details {
  margin-top: 0.9rem;
  border-top: 1px solid var(--ch-line);
  padding-top: 0.6rem;
}

.v5-school summary {
  display: list-item;
  min-height: 44px;
  padding-block: 0.6rem;
  box-sizing: border-box;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--by-blue);
}

.v5-school summary:hover {
  color: var(--ch-red);
}

.v5-metrics {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
  margin: 0.8rem 0;
}

@media (min-width: 640px) {
  .v5-metrics {
    grid-template-columns: repeat(4, 1fr);
  }
}

.v5-metric {
  background: var(--ch-band);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
}

.v5-metric span {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ch-muted);
}

.v5-metric strong {
  font-family: var(--ch-font);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--by-blue-deep);
}

.v5-school details p,
.v5-school details ul {
  margin: 0.5rem 0;
  font-size: 0.95rem;
}

/* FAQ accordion */
.v5-faq details {
  background: #fff;
  border: 1px solid var(--ch-line);
  border-radius: var(--ch-radius);
  margin-bottom: 0.6rem;
}

.v5-faq summary {
  min-height: 44px;
  cursor: pointer;
  list-style: none;
  padding: 0.95rem 1.15rem;
  font-weight: 700;
  color: var(--ch-ink);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.v5-faq summary::-webkit-details-marker {
  display: none;
}

.v5-faq summary::after {
  content: "+";
  color: var(--ch-red);
  font-size: 1.3rem;
  line-height: 1;
}

.v5-faq details[open] summary::after {
  content: "\2212";
}

.v5-faq details p {
  margin: 0;
  padding: 0 1.15rem 1.1rem;
}

/* Hub: featured + directory */
.v5-hub-search {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  max-width: 40rem;
  margin-top: 1.25rem;
}

.v5-hub-search input {
  flex: 1 1 16rem;
  border: 0;
  border-radius: 6px;
  padding: 0.8rem 1rem;
  font: inherit;
}

.v5-dir__toolbar {
  position: sticky;
  top: 72px;
  z-index: 40;
  background: #fff;
  border-bottom: 1px solid var(--ch-line);
  padding: 0.85rem 0;
}

.v5-dir__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}

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

.v5-chip {
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  min-height: 36px;
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
  border: 1.5px solid var(--ch-line);
  background: #fff;
  color: var(--ch-ink);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

@media (pointer: coarse) {
  .v5-chip,
  .v5-crumbs a {
    min-height: 44px;
  }
}

.v5-chip:hover {
  border-color: var(--ch-red);
  color: var(--ch-red);
}

.v5-chip.is-active {
  background: var(--ch-red);
  border-color: var(--ch-red);
  color: #fff;
}

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

.v5-dir__search {
  width: min(100%, 20rem);
  border: 1.5px solid var(--ch-line);
  border-radius: 6px;
  padding: 0.55rem 0.85rem;
  font: inherit;
  font-size: 0.95rem;
}

.v5-dir__search:focus {
  outline: 2px solid var(--ch-red);
  border-color: var(--ch-red);
}

.v5-dir__empty {
  padding: 1.5rem;
  border: 1px dashed var(--ch-line);
  border-radius: var(--ch-radius);
  color: var(--ch-muted);
}

.v5-dir__section {
  margin-top: 2.25rem;
}

.v5-dir__section-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.v5-dir__section-head h2 {
  margin: 0;
}

.v5-dir__count {
  display: inline-grid;
  place-items: center;
  min-width: 1.9rem;
  height: 1.9rem;
  padding: 0 0.5rem;
  border-radius: 999px;
  background: var(--ch-red);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
}

.v5-dir__grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.8rem;
}

@media (min-width: 640px) {
  .v5-dir__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

.v5-dir__card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  height: 100%;
  padding: 1rem 1.1rem;
  background: #fff;
  border: 1px solid var(--ch-line);
  border-radius: var(--ch-radius);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.v5-dir__card:hover {
  border-color: rgba(213, 0, 50, 0.45);
  box-shadow: 0 8px 22px rgba(18, 18, 18, 0.1);
  transform: translateY(-1px);
  color: inherit;
}

.v5-dir__title {
  display: block;
  font-family: var(--ch-font);
  font-weight: 700;
  font-size: 1.02rem;
  line-height: 1.3;
  color: var(--ch-ink);
}

.v5-dir__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.v5-badge {
  display: inline-block;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--ch-band);
  color: var(--ch-muted);
  border: 1px solid var(--ch-line);
}

.v5-badge--affordable {
  background: var(--by-blue-wash);
  border-color: transparent;
  color: var(--by-blue-deep);
}

.v5-dir__arrow {
  flex: none;
  color: var(--ch-red);
  font-weight: 800;
}

[hidden] {
  display: none !important;
}
