/* ==========================================================================
   academics.css — Academic Programs hub
   University of Bridgeport

   Load order: style.css → home.css (shared v2 layer) → academics.css
   home.css supplies brand tokens, --ub-blue-text, .reveal, .eyebrow-rule,
   .display-*, .btn-ghost, .sticky-cta, .scroll-progress.

   The centrepiece is a faceted program finder. Cards are rendered in the
   HTML (not injected by JS) and filtered by toggling a hidden class, so the
   full program list stays crawlable for the AEO/SEO governance layer.
   ========================================================================== */

/* --------------------------------------------------------------------------
   PAGE HERO
   -------------------------------------------------------------------------- */
.ac-hero {
  position: relative;
  background-color: var(--ub-purple-deep);
  background-image: url('../assets/images/legacy/3d-printing-girl-hero.jpg');
  background-size: cover;
  background-position: center 28%;
  overflow: hidden;
}
.ac-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg,
    rgba(27,16,35,0.95) 0%,
    rgba(42,18,64,0.88) 42%,
    rgba(42,18,64,0.58) 72%,
    rgba(42,18,64,0.38) 100%);
}
/* Signature wedge */
.ac-hero::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0; right: 0;
  width: 44%;
  background: linear-gradient(150deg, rgba(89,45,130,0.55) 0%, rgba(89,45,130,0) 68%);
  clip-path: polygon(20% 0, 100% 0, 100% 100%, 0 100%);
  pointer-events: none;
}
.ac-hero .container { position: relative; z-index: 2; }
.ac-hero-inner {
  padding: 62px 0 70px;
  max-width: 45rem;
  border-left: 3px solid var(--ub-blue);
  padding-left: 32px;
}

.ac-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 0.84rem;
  margin-bottom: 22px;
}
.ac-breadcrumb a { color: rgba(255,255,255,0.66); text-decoration: none; }
.ac-breadcrumb a:hover { color: var(--white); text-decoration: underline; }
.ac-breadcrumb span[aria-current] { color: var(--white); font-weight: 600; }
.ac-breadcrumb i { color: rgba(255,255,255,0.34); font-size: 0.66rem; }

.ac-hero h1 {
  font-size: clamp(2.6rem, 5vw, 4.4rem);
  font-weight: 800;
  line-height: 0.99;
  letter-spacing: -0.033em;
  color: var(--white);
}
.ac-hero .lede {
  font-size: 1.16rem;
  line-height: 1.64;
  color: rgba(255,255,255,0.85);
  margin-top: 22px;
  max-width: 34rem;
}
.ac-hero-stats {
  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: start;
  gap: 38px;
  margin-top: 38px;
}
.ac-hero-stats > div { border-top: 3px solid var(--ub-blue); padding-top: 13px; }
.ac-hero-stats .n {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--white);
}
.ac-hero-stats .l {
  font-size: 0.82rem;
  font-weight: 600;
  color: rgba(255,255,255,0.66);
  margin-top: 7px;
  line-height: 1.35;
}

/* ==========================================================================
   PROGRAM FINDER
   ========================================================================== */
.ac-finder { padding: 78px 0 var(--section-pad); background: var(--white); }
.ac-finder-head { max-width: 46rem; margin-bottom: 34px; }

/* ---------- "I am a…" persona presets ---------- */
.ac-personas { margin-bottom: 30px; }
.ac-personas-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 13px;
}
.ac-persona-row { display: flex; flex-wrap: wrap; gap: 10px; }
.ac-persona {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border: 1.5px solid #CBD4D8;
  padding: 13px 20px;
  font-family: inherit;
  font-size: 0.97rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
}
.ac-persona i { color: var(--ub-blue-text); font-size: 0.95rem; }
.ac-persona:hover {
  border-color: var(--ub-purple);
  color: var(--ub-purple);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.ac-persona[aria-pressed="true"] {
  background: var(--ub-purple);
  border-color: var(--ub-purple);
  color: var(--white);
}
.ac-persona[aria-pressed="true"] i { color: var(--white); }

/* ---------- Search + count bar (sticky) ---------- */
.ac-searchbar {
  position: sticky;
  /* The site header is also sticky (229px, z-index 1000), so a top:0 sticky
     bar pins underneath it and disappears. --ac-header-h is measured at
     runtime by js/academics.js and updated on resize, because the header's
     height changes at breakpoints (the centennial ribbon hides at 768px). */
  top: var(--ac-header-h, 0px);
  z-index: 40;
  background: var(--white);
  border-top: 3px solid var(--ub-purple);
  border-bottom: 1px solid #DDE4E7;
  box-shadow: 0 6px 18px rgba(44,62,80,0.06);
  padding: 16px 0;
  margin-bottom: 28px;
}
.ac-searchbar-inner {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 16px;
  align-items: center;
}
.ac-search { position: relative; }
.ac-search i {
  position: absolute;
  left: 16px; top: 50%;
  transform: translateY(-50%);
  color: var(--ub-purple);
  font-size: 1rem;
  pointer-events: none;
}
.ac-search input {
  width: 100%;
  padding: 15px 44px 15px 46px;
  font-family: inherit;
  font-size: 1.02rem;
  color: var(--text-main);
  background: var(--bg-light);
  border: 1.5px solid #CBD4D8;
  border-radius: 0;
  outline: none;
  transition: var(--transition);
}
.ac-search input:focus {
  border-color: var(--ub-purple);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(89,45,130,0.13);
}
.ac-search input::placeholder { color: #8A979E; }
.ac-search-clear {
  position: absolute;
  right: 10px; top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 1.05rem;
  cursor: pointer;
  padding: 6px 8px;
  display: none;
}
.ac-search-clear.visible { display: block; }
.ac-search-clear:hover { color: var(--ub-purple); }

.ac-count {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
}
.ac-count b { color: var(--ub-purple); font-size: 1.16rem; }

.ac-sort {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0.86rem;
  color: var(--text-light);
  font-weight: 600;
  white-space: nowrap;
}
.ac-sort select {
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
  padding: 10px 34px 10px 12px;
  border: 1.5px solid #CBD4D8;
  border-radius: 0;
  background-color: var(--white);
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath fill='%23592D82' d='M1.4 0 7 5.6 12.6 0 14 1.4 7 8.4 0 1.4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  outline: none;
}
.ac-sort select:focus { border-color: var(--ub-purple); }

/* ---------- Layout: facet rail + results ---------- */
.ac-layout {
  display: grid;
  grid-template-columns: 264px 1fr;
  gap: 44px;
  align-items: start;
}

/* ---------- Facets ---------- */
/* Clears the sticky header AND the sticky search bar above it. */
.ac-facets {
  position: sticky;
  top: calc(var(--ac-header-h, 0px) + var(--ac-searchbar-h, 88px) + 22px);
}
.ac-facet-group { margin-bottom: 26px; padding-bottom: 24px; border-bottom: 1px solid #E4E9EB; }
.ac-facet-group:last-of-type { border-bottom: none; }
.ac-facet-group > h3 {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ub-purple);
  margin-bottom: 14px;
}
.ac-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 0;
  cursor: pointer;
  font-size: 0.96rem;
  color: var(--text-main);
  transition: var(--transition);
  line-height: 1.35;
}
.ac-check:hover { color: var(--ub-purple); }
.ac-check input {
  width: 17px; height: 17px;
  margin: 2px 0 0;
  flex-shrink: 0;
  accent-color: var(--ub-purple);
  cursor: pointer;
}
.ac-check .tally {
  margin-left: auto;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-light);
  padding-left: 8px;
}
/* Facet values that no longer match anything read as unavailable, not broken */
.ac-check.exhausted { opacity: 0.42; }

.ac-reset {
  width: 100%;
  background: none;
  border: 1.5px solid #CBD4D8;
  padding: 12px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
}
.ac-reset:hover { border-color: var(--ub-purple); color: var(--ub-purple); }

/* ---------- Active filter chips ---------- */
.ac-active {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  margin-bottom: 22px;
}
.ac-active:empty { display: none; }
.ac-chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--bg-light);
  border-left: 3px solid var(--ub-blue);
  padding: 8px 12px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-main);
}
.ac-chip button {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 0 0 2px;
}
.ac-chip button:hover { color: var(--ub-purple); }
.ac-clear-all {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ub-blue-text);
  cursor: pointer;
  text-decoration: underline;
  padding: 8px 4px;
}
.ac-clear-all:hover { color: var(--ub-purple); }

/* ---------- Results grid ---------- */
.ac-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.ac-card {
  display: flex;
  flex-direction: column;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  border-bottom: 4px solid transparent;
  transition: transform 0.3s cubic-bezier(0.25,0.8,0.25,1),
              box-shadow 0.3s cubic-bezier(0.25,0.8,0.25,1),
              border-color 0.3s ease;
}
.ac-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
  border-bottom-color: var(--ub-blue);
}
.ac-card.hidden { display: none; }

.ac-card-media {
  position: relative;
  height: 156px;
  overflow: hidden;
}
.ac-card-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.25,0.8,0.25,1);
}
.ac-card:hover .ac-card-media img { transform: scale(1.05); }
/* Wedge corner cut */
.ac-card-media::after {
  content: '';
  position: absolute;
  bottom: 0; right: 0;
  border-style: solid;
  border-width: 0 0 26px 26px;
  border-color: transparent transparent var(--white) transparent;
}
.ac-card-degree {
  position: absolute;
  top: 0; left: 0;
  background: var(--ub-purple);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  padding: 6px 11px;
}
.ac-card-body {
  padding: 18px 20px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.ac-card-name {
  font-size: 1.14rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.018em;
  line-height: 1.26;
}
.ac-card-college {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-top: 7px;
  line-height: 1.4;
}
.ac-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid #EDF1F2;
}
.ac-tag {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ub-blue-text);
  background: rgba(0,167,224,0.09);
  padding: 4px 8px;
}
.ac-tag.campus { color: var(--ub-purple); background: rgba(89,45,130,0.09); }

/* ---------- Empty state ---------- */
.ac-empty {
  display: none;
  border: 2px dashed #CBD4D8;
  padding: 54px 34px;
  text-align: center;
}
.ac-empty.visible { display: block; }
.ac-empty i { font-size: 2.1rem; color: var(--ub-purple); opacity: 0.4; }
.ac-empty h3 {
  font-size: 1.42rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin: 16px 0 10px;
}
.ac-empty p {
  font-size: 1rem;
  color: var(--text-light);
  line-height: 1.6;
  max-width: 30rem;
  margin: 0 auto 22px;
}
.ac-empty-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }

/* Visually hidden, still announced */
.ac-sr {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ==========================================================================
   COLLEGES
   ========================================================================== */
.ac-colleges {
  padding: clamp(3rem, 5vw, 4.5rem) 0 clamp(2rem, 3vw, 2.75rem);
  background: var(--bg-light);
}
.ac-college-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
  margin-top: 48px;
}
.ac-college {
  background: var(--white);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  border-top: 4px solid var(--ub-purple);
  transition: var(--transition);
}
.ac-college:nth-child(even) { border-top-color: var(--ub-blue); }
.ac-college:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); }
.ac-college-media { height: 186px; background-size: cover; background-position: center; }
.ac-college-body { padding: 26px 26px 28px; flex: 1; display: flex; flex-direction: column; }
.ac-college-body h3 {
  font-size: 1.34rem;
  font-weight: 700;
  color: var(--ub-purple);
  letter-spacing: -0.022em;
  line-height: 1.2;
}
.ac-college-body p {
  font-size: 0.96rem;
  color: var(--text-light);
  line-height: 1.58;
  margin: 11px 0 16px;
}
.ac-college-more {
  margin-top: auto;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ub-blue-text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.ac-college:hover .ac-college-more { gap: 13px; }

/* ==========================================================================
   PATHWAYS BAND (graduate / online / transfer)
   ========================================================================== */
.ac-paths {
  padding: var(--section-pad) 0;
  background: var(--ink);
  color: var(--white);
  position: relative;
  overflow: hidden;
}
.ac-paths::before {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 46%; height: 100%;
  background: linear-gradient(160deg, rgba(89,45,130,0.55) 0%, rgba(89,45,130,0) 62%);
  clip-path: polygon(24% 0, 100% 0, 100% 100%, 0 100%);
  pointer-events: none;
}
.ac-paths .container { position: relative; z-index: 2; }
.ac-paths .eyebrow-rule { color: #7FD9F5; }
.ac-paths h2 {
  font-size: clamp(2.1rem, 3.6vw, 3.3rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--white);
}
.ac-path-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(255,255,255,0.13);
  margin-top: 50px;
}
.ac-path {
  background: var(--ink);
  padding: 32px 28px 34px;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  transition: var(--transition);
}
.ac-path:hover { background: rgba(89,45,130,0.34); }
.ac-path i {
  font-size: 1.5rem;
  color: var(--ub-blue);
  margin-bottom: 18px;
}
.ac-path h3 {
  font-size: 1.34rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.022em;
  line-height: 1.2;
  margin-bottom: 11px;
}
.ac-path p {
  font-size: 0.96rem;
  color: rgba(255,255,255,0.7);
  line-height: 1.6;
  margin-bottom: 18px;
}
.ac-path ul { list-style: none; margin-bottom: 20px; }
.ac-path li {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.78);
  padding-left: 22px;
  position: relative;
  margin-bottom: 8px;
  line-height: 1.45;
}
.ac-path li i {
  position: absolute;
  left: 0; top: 3px;
  font-size: 0.82rem;
  margin: 0;
  color: var(--ub-blue);
}
.ac-path .more {
  margin-top: auto;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #7FD9F5;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.ac-path:hover .more { gap: 13px; color: var(--white); }

/* ==========================================================================
   RESOURCES
   ========================================================================== */
.ac-resources { padding: var(--section-pad) 0; background: var(--white); }
.ac-resource-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
  margin-top: 46px;
}
.ac-resource {
  border-left: 3px solid var(--ub-purple);
  background: var(--bg-light);
  padding: 24px 22px 26px;
  text-decoration: none;
  display: block;
  transition: var(--transition);
}
.ac-resource:nth-child(even) { border-left-color: var(--ub-blue); }
.ac-resource:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.ac-resource i { font-size: 1.25rem; color: var(--ub-purple); }
.ac-resource h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.018em;
  margin: 13px 0 8px;
  line-height: 1.25;
}
.ac-resource p { font-size: 0.9rem; color: var(--text-light); line-height: 1.52; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1100px) {
  .ac-hero-inner { padding: 46px 0 54px; padding-left: 22px; }
  .ac-hero::after { display: none; }

  /* Facets collapse into a disclosure above the results */
  .ac-layout { grid-template-columns: 1fr; gap: 26px; }
  .ac-facets { position: static; }
  .ac-facets-panel {
    display: none;
    border: 1px solid #DDE4E7;
    padding: 22px 20px 8px;
    background: var(--bg-light);
  }
  .ac-facets-panel.open { display: block; }
  .ac-facets-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background: var(--white);
    border: 1.5px solid var(--ub-purple);
    padding: 14px 18px;
    font-family: inherit;
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--ub-purple);
    cursor: pointer;
    margin-bottom: 14px;
  }
  .ac-facets-toggle .n {
    background: var(--ub-purple);
    color: var(--white);
    font-size: 0.78rem;
    padding: 3px 9px;
  }
  .ac-facet-group { margin-bottom: 20px; padding-bottom: 18px; }

  .ac-searchbar-inner { grid-template-columns: 1fr auto; row-gap: 12px; }
  .ac-sort { grid-column: 1 / -1; justify-content: flex-end; }

  .ac-grid { grid-template-columns: repeat(2, 1fr); }
  .ac-college-grid { grid-template-columns: repeat(2, 1fr); }
  .ac-path-grid { grid-template-columns: 1fr; }
  .ac-resource-grid { grid-template-columns: repeat(2, 1fr); }
}

/* The facets toggle only exists below 1100px */
@media (min-width: 1101px) {
  .ac-facets-toggle { display: none; }
  .ac-facets-panel { display: block !important; }
}

@media (max-width: 768px) {
  .ac-hero { background-position: center 20%; }
  .ac-hero-stats { grid-template-columns: 1fr; gap: 20px; }

  .ac-persona-row { display: grid; grid-template-columns: 1fr 1fr; }
  .ac-persona { justify-content: center; padding: 12px 10px; font-size: 0.88rem; }

  .ac-searchbar { padding: 12px 0; }
  .ac-searchbar-inner { grid-template-columns: 1fr; }
  .ac-count { text-align: left; }
  .ac-sort { justify-content: space-between; }
  .ac-sort select { flex: 1; margin-left: 10px; }

  .ac-grid { grid-template-columns: 1fr; }
  .ac-college-grid { grid-template-columns: 1fr; }
  .ac-resource-grid { grid-template-columns: 1fr; }
  .ac-empty { padding: 38px 20px; }
}
