/* Additions specific to this build — loads after style.css. */

/* Leader message: the signature block is authored in the rich-text editor,
   which drops utility classes, so its styling lives here instead. */
.chancellor-copy h4 {
  font-weight: 600;
  font-size: clamp(1rem, 1.2vw, 2rem);
}
.chancellor-copy p > strong:first-child {
  color: var(--brand);
}

/* Faculty profile page — the design's modal card, opened as a page instead
   (.faculty-modal itself is display:none, being a Fancybox target). */
.faculty-profile {
  width: min(52rem, 100%);
  padding: clamp(1.25rem, 2.4vw, 1.75rem);
  border-radius: 4px;
  background: var(--white);
  text-align: left;
}
.faculty-facts {
  display: grid;
  gap: clamp(0.6rem, 1.2vw, 0.9rem);
  margin-bottom: clamp(1rem, 2vw, 1.5rem);
}
.faculty-facts dt {
  font-weight: 600;
  color: var(--brand);
}

/* Testimonials "Load More" — style.css keys this off the single id the static
   build used (#tm-more-toggle); here each tab owns its own toggle, so the same
   rules are repeated against the class every toggle carries. */
.hrc-radio:checked ~ .tm-more {
  display: block;
}
.hrc-radio:checked ~ .tm-more-btn {
  display: none;
}
.hrc-radio:focus-visible ~ .tm-more-btn {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

/* Industrial Visit Trip — style.css caps the CSS-only slider at 8 photos; the
   admin may add up to 12 per visit, so carry the three rule sets further. */
.ivt-slider:has(.ivt-radio:nth-of-type(9):checked) .ivt-cap:nth-child(9),
.ivt-slider:has(.ivt-radio:nth-of-type(10):checked) .ivt-cap:nth-child(10),
.ivt-slider:has(.ivt-radio:nth-of-type(11):checked) .ivt-cap:nth-child(11),
.ivt-slider:has(.ivt-radio:nth-of-type(12):checked) .ivt-cap:nth-child(12) {
  display: flex;
}

.ivt-slider:has(.ivt-radio:nth-of-type(9):checked) .ivt-nav:nth-child(9),
.ivt-slider:has(.ivt-radio:nth-of-type(10):checked) .ivt-nav:nth-child(10),
.ivt-slider:has(.ivt-radio:nth-of-type(11):checked) .ivt-nav:nth-child(11),
.ivt-slider:has(.ivt-radio:nth-of-type(12):checked) .ivt-nav:nth-child(12) {
  display: contents;
}

.ivt-slider:has(.ivt-radio:nth-of-type(9):checked) .ivt-track { transform: translateX(-800%); }
.ivt-slider:has(.ivt-radio:nth-of-type(10):checked) .ivt-track { transform: translateX(-900%); }
.ivt-slider:has(.ivt-radio:nth-of-type(11):checked) .ivt-track { transform: translateX(-1000%); }
.ivt-slider:has(.ivt-radio:nth-of-type(12):checked) .ivt-track { transform: translateX(-1100%); }

/* Community Outreach — style.css bakes the photo count (8) into the CSS-only
   carousel's arithmetic. The photos are CMS content here, so each .co-slider
   declares its own --total inline and these rules read that instead. */
.co-slider {
  --total: 8;
}

.co-track {
  transform: translateX(calc(-1 * min(var(--k), var(--total) - var(--vis)) * (100% + var(--gap)) / var(--vis)));
}

.co-thumb {
  width: calc(100% * var(--vis) / var(--total));
}

.co-slider:has(.co-radio:nth-of-type(9):checked) { --k: 8; }
.co-slider:has(.co-radio:nth-of-type(10):checked) { --k: 9; }
.co-slider:has(.co-radio:nth-of-type(11):checked) { --k: 10; }
.co-slider:has(.co-radio:nth-of-type(12):checked) { --k: 11; }
.co-slider:has(.co-radio:nth-of-type(13):checked) { --k: 12; }
.co-slider:has(.co-radio:nth-of-type(14):checked) { --k: 13; }
.co-slider:has(.co-radio:nth-of-type(15):checked) { --k: 14; }
.co-slider:has(.co-radio:nth-of-type(16):checked) { --k: 15; }

.co-slider:has(.co-radio:nth-of-type(9):checked) .co-navs > span:nth-child(9),
.co-slider:has(.co-radio:nth-of-type(10):checked) .co-navs > span:nth-child(10),
.co-slider:has(.co-radio:nth-of-type(11):checked) .co-navs > span:nth-child(11),
.co-slider:has(.co-radio:nth-of-type(12):checked) .co-navs > span:nth-child(12),
.co-slider:has(.co-radio:nth-of-type(13):checked) .co-navs > span:nth-child(13),
.co-slider:has(.co-radio:nth-of-type(14):checked) .co-navs > span:nth-child(14),
.co-slider:has(.co-radio:nth-of-type(15):checked) .co-navs > span:nth-child(15),
.co-slider:has(.co-radio:nth-of-type(16):checked) .co-navs > span:nth-child(16) {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ------------------------------------------------------------------------
   Site search — the results page, the type filter chips and the header
   overlay's live suggestion list. All project-only; style.css has none of it.
   ------------------------------------------------------------------------ */

mark {
  background: rgba(158, 9, 6, 0.12);
  color: inherit;
  font-weight: 600;
  padding: 0 0.1em;
  border-radius: 2px;
}

/* ----- The search box on the results page ----- */
.search-page-form {
  display: flex;
  gap: 0.5rem;
  max-width: 34rem;
  padding: 0.4rem;
  border-radius: 4px;
  background: var(--white);
}

.search-page-form input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.6rem 0.75rem;
  border: 0;
  outline: 0;
  font-size: clamp(0.95rem, 1.15vw, 1rem);
  color: var(--ink, #00030a);
  background: transparent;
}

.search-page-form button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem clamp(0.9rem, 1.6vw, 1.25rem);
  border-radius: 3px;
  background: var(--brand);
  color: var(--white);
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.2s ease-in-out;
}

.search-page-form button:hover {
  background: var(--brand-dark);
}

@media (max-width: 479px) {
  .search-page-form button span {
    display: none;
  }
}

/* ----- Type filters / suggestion chips ----- */
.search-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid #dcdcdc;
  border-radius: 999px;
  background: var(--white);
  color: var(--ink, #00030a);
  font-size: clamp(0.85rem, 1vw, 0.95rem);
  line-height: 1.3;
  transition: border-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

.search-chip span {
  color: #8a8a8a;
  font-variant-numeric: tabular-nums;
}

.search-chip:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.search-chip.is-active {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--white);
}

.search-chip.is-active span {
  color: rgba(255, 255, 255, 0.7);
}

/* ----- Result list ----- */
.search-results {
  display: grid;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.search-results > li > a {
  display: block;
  padding: clamp(1rem, 2vw, 1.5rem);
  border-radius: 4px;
  background: var(--white);
  border: 1px solid transparent;
  transition: border-color 0.2s ease-in-out, transform 0.2s ease-in-out;
}

.search-results > li > a:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
}

.search-result-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  font-size: 0.8rem;
  line-height: 1.3;
}

.search-result-type {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 2px;
  background: rgba(158, 9, 6, 0.08);
  color: var(--brand);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.search-result-section {
  color: #8a8a8a;
}

.search-result-title {
  display: block;
  margin-top: 0.6rem;
  font-family: var(--font-heading);
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  line-height: 1.4;
  color: var(--ink, #00030a);
}

.search-result-snippet {
  display: block;
  margin-top: 0.45rem;
  font-size: clamp(0.875rem, 1.05vw, 0.95rem);
  line-height: 1.7;
  color: #686868;
}

/* ----- Pagination ----- */
.search-pagination ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.search-pagination a,
.search-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  padding: 0.5rem 0.85rem;
  border: 1px solid #dcdcdc;
  border-radius: 3px;
  background: var(--white);
  font-size: 0.9rem;
  color: var(--ink, #00030a);
  transition: border-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

.search-pagination a:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.search-pagination .is-active {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--white);
}

.search-pagination .is-disabled,
.search-pagination .is-gap {
  color: #b5b5b5;
}

.search-pagination .is-gap {
  border-color: transparent;
  background: transparent;
}

/* ----- Header overlay suggestions ----- */
.search-modal-panel {
  position: relative;
}

.search-suggestions {
  margin-top: 0.5rem;
  max-height: min(60vh, 28rem);
  overflow-y: auto;
  border-radius: 4px;
  background: var(--white);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}

.search-suggestions[hidden] {
  display: none;
}

.search-suggestion {
  display: block;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #ededed;
  text-align: left;
}

.search-suggestion:last-child {
  border-bottom: 0;
}

.search-suggestion:hover,
.search-suggestion.is-active {
  background: #f7f7f7;
}

.search-suggestion-type {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--brand);
}

.search-suggestion-title {
  display: block;
  margin-top: 0.15rem;
  font-family: var(--font-heading);
  font-size: 1rem;
  line-height: 1.4;
  color: var(--ink, #00030a);
}

.search-suggestion-snippet {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.825rem;
  line-height: 1.55;
  color: #777;
  /* Two lines is enough to recognise the hit without crowding the list. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.search-suggestions-all,
.search-suggestions-empty {
  display: block;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  text-align: center;
  color: var(--brand);
  font-weight: 600;
}

.search-suggestions-empty {
  color: #777;
  font-weight: 400;
}

.search-suggestions-all:hover,
.search-suggestions-all.is-active {
  background: #f7f7f7;
}

/* ------------------------------------------------------------------------
   Enquiry form — server-side validation feedback. The form carries no HTML
   validation attributes, so these messages are the only ones a visitor sees.
   ------------------------------------------------------------------------ */
.field-error {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.825rem;
  line-height: 1.4;
  color: var(--brand);
}

.contact-form .field.has-error {
  border-color: var(--brand);
}

.form-note {
  padding: 0.85rem 1rem;
  border-radius: 4px;
  border-left: 3px solid;
  font-size: 0.925rem;
  line-height: 1.5;
}

.form-note-success {
  border-color: #1f7a3d;
  background: rgba(31, 122, 61, 0.08);
  color: #1f7a3d;
}

.form-note-error {
  border-color: var(--brand);
  background: rgba(158, 9, 6, 0.08);
  color: var(--brand);
}
