/* ═══════════════════════════════════════════════════════════════
   MPS COMPONENTS — Reusable UI Components
   ═══════════════════════════════════════════════════════════════ */

/* ──────────────────── PROGRAMME ITEMS ──────────────────── */
.programme-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  margin-top: var(--space-8);
}

/* ──────────────────── SECTION HEADER ROW ──────────────────── */
.section-hd-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-8);
  margin-bottom: clamp(var(--space-10), 5vw, var(--space-16));
  flex-wrap: wrap;
}

/* ──────────────────── BADGES ──────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}

.badge-royal {
  background: rgba(15,61,145,0.1);
  color: var(--color-royal);
}

.badge-gold {
  background: rgba(201,162,39,0.12);
  color: var(--color-gold-dark);
}

/* ──────────────────── DIVIDER ──────────────────── */
.divider {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--color-gold), transparent);
  margin: var(--space-5) 0;
  border-radius: var(--radius-full);
}

.divider-center {
  margin-left: auto;
  margin-right: auto;
  background: linear-gradient(90deg, transparent, var(--color-gold), transparent);
  width: 80px;
}

/* ──────────────────── FORM ELEMENTS ──────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.form-label {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-mid);
  letter-spacing: 0.01em;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.875rem 1.25rem;
  background: var(--color-white);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  outline: none;
  transition:
    border-color var(--dur-fast),
    box-shadow var(--dur-fast);
  appearance: none;
  -webkit-appearance: none;
}

.form-input::placeholder,
.form-textarea::placeholder { color: var(--color-text-ghost); }

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--color-royal);
  box-shadow: 0 0 0 3px rgba(15,61,145,0.12);
}

.form-input.is-error,
.form-select.is-error,
.form-textarea.is-error {
  border-color: #EF4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.12);
}

.form-error-msg {
  font-size: var(--text-xs);
  color: #EF4444;
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.form-textarea {
  resize: vertical;
  min-height: 140px;
  line-height: var(--leading-relaxed);
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

/* Checkbox */
.form-checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.form-checkbox {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-white);
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--color-royal);
}

/* ──────────────────── BREADCRUMB ──────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  list-style: none;
  flex-wrap: wrap;
}

.breadcrumb-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-soft);
}

.breadcrumb-item a {
  color: var(--color-royal);
  text-decoration: none;
  transition: color var(--dur-fast);
}

.breadcrumb-item a:hover { color: var(--color-navy); }

.breadcrumb-sep {
  color: var(--color-border-dark);
}

/* ──────────────────── PAGE HERO (Inner pages) ──────────────────── */
.page-hero {
  position: relative;
  padding: clamp(var(--space-20), 10vw, var(--space-32)) 0 clamp(var(--space-16), 8vw, var(--space-24));
  background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-royal-dark) 100%);
  overflow: hidden;
  margin-top: var(--nav-h);
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 80% 50%, rgba(201,162,39,0.1) 0%, transparent 60%);
}

.page-hero-content {
  position: relative;
  z-index: 1;
}

.page-hero-title {
  font-family: var(--font-display);
  font-size: clamp(var(--text-4xl), 5vw, var(--text-6xl));
  font-weight: 600;
  color: var(--color-white);
  letter-spacing: var(--tracking-tight);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-4);
}

.page-hero-sub {
  font-size: var(--text-lg);
  color: rgba(255,255,255,0.65);
  max-width: 55ch;
  line-height: var(--leading-relaxed);
}

/* ──────────────────── ALERT / NOTICE ──────────────────── */
.alert {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}

.alert-success {
  background: rgba(34,197,94,0.08);
  border: 1px solid rgba(34,197,94,0.25);
  color: #166534;
}

.alert-error {
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.25);
  color: #991b1b;
}

.alert-info {
  background: rgba(15,61,145,0.06);
  border: 1px solid rgba(15,61,145,0.2);
  color: var(--color-royal-dark);
}

/* ──────────────────── ACCORDION (FAQ) ──────────────────── */
.accordion-item {
  border-bottom: 1px solid var(--color-border);
}

.accordion-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: var(--space-5) 0;
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-navy);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  gap: var(--space-4);
  transition: color var(--dur-fast);
}

.accordion-trigger:hover { color: var(--color-royal); }

.accordion-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    transform var(--dur-base) var(--ease-smooth),
    background-color var(--dur-fast),
    border-color var(--dur-fast);
}

.accordion-item.is-open .accordion-icon {
  background: var(--color-royal);
  border-color: var(--color-royal);
  transform: rotate(45deg);
}

.accordion-icon svg {
  transition: stroke var(--dur-fast);
}

.accordion-item.is-open .accordion-icon svg {
  stroke: white;
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--dur-slow) var(--ease-smooth);
}

.accordion-item.is-open .accordion-body {
  max-height: 600px;
}

.accordion-content {
  padding-bottom: var(--space-6);
  color: var(--color-text-mid);
  line-height: var(--leading-relaxed);
  font-size: var(--text-base);
}

/* ──────────────────── GALLERY LIGHTBOX ──────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: rgba(0,0,0,0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity var(--dur-base) var(--ease-smooth),
    visibility var(--dur-base);
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox-inner {
  max-width: 90vw;
  max-height: 85vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.lightbox-img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-xl);
  /* The viewer swaps the tile-sized copy for the full original in place, so
     without a fixed floor the dialog jumps as the larger file lands. */
  min-width: min(40vw, 320px);
  background: rgba(255,255,255,0.04);
}

/* Previous / next. Sit outside the picture on a wide screen and overlay its
   edges on a narrow one, so the image is never cropped by its own controls. */
.lightbox-nav {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--dur-fast);
}
.lightbox-nav:hover { background: rgba(255,255,255,0.22); }
.lightbox-nav[hidden] { display: none; }

.lightbox-caption { flex: 1 0 100%; }

@media (max-width: 700px) {
  .lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; }
  .lightbox-prev { left: 4px; }
  .lightbox-next { right: 4px; }
}

.lightbox-close {
  position: absolute;
  top: -48px;
  right: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--dur-fast);
}

.lightbox-close:hover { background: rgba(255,255,255,0.2); }

/* ──────────────────── TOAST NOTIFICATION ──────────────────── */
.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}

.toast {
  padding: var(--space-4) var(--space-5);
  background: var(--color-navy);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-2xl);
  color: var(--color-white);
  font-size: var(--text-sm);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  pointer-events: auto;
  animation: toastIn var(--dur-slow) var(--ease-spring) both;
  max-width: 340px;
}

.toast.toast-success { border-color: rgba(34,197,94,0.3); }
.toast.toast-error   { border-color: rgba(239,68,68,0.3); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(100%); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(100%); }
}

.toast.is-hiding { animation: toastOut var(--dur-base) var(--ease-in-out) forwards; }

/* ──────────────────── CONTENT NOTE (placeholder) ──────────────────── */
.content-note {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: rgba(201,162,39,0.08);
  border: 1px dashed rgba(201,162,39,0.4);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  color: var(--color-gold-dark);
  font-style: italic;
}

/* ──────────────────── STICKY SECTION LABEL ──────────────────── */
.sticky-label {
  position: sticky;
  top: calc(var(--nav-h) + var(--space-4));
  z-index: var(--z-raised);
}

/* ──────────────────── LOADING SKELETON ──────────────────── */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-mist) 25%,
    var(--color-mist-dark) 50%,
    var(--color-mist) 75%
  );
  background-size: 200% auto;
  animation: shimmer 1.5s linear infinite;
  border-radius: var(--radius-md);
}

/* ═══════════════════════════════════════════════════════════════
   PASS H: GLOBAL VISUAL RHYTHM, CARD & ACCESSIBILITY POLISH
   ═══════════════════════════════════════════════════════════════ */

/* Universal card equal-heights & flex column rhythm */
.why-card,
.news-card,
.fac-card,
.dept-card,
.gen-card,
.val-card,
.leader-card,
.event-card,
.perf-card,
.ach-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  box-sizing: border-box;
}

/* Push actions/footers to bottom of cards when present */
.why-card .why-text,
.fac-card .fac-desc,
.dept-card .dept-info,
.news-card .news-excerpt {
  flex-grow: 1;
}

/* Robust text wrap & overflow protection sitewide */
.why-title,
.fac-name,
.dept-name,
.news-title,
.leader-name,
.footer-brand,
.f-address,
.dept-line,
address {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Unified interactive focus rings */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex="0"]:focus-visible,
.filter-btn:focus-visible,
.dropdown-trigger:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Icon centering alignment */
.icon-center,
.slot-icon,
.fac-nav-btn svg,
.tst-btn svg,
.nl-btn svg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

/* Dark surface secondary typography legibility */
.section-dark p,
.section-blue p,
.site-footer p {
  color: rgba(255, 255, 255, 0.76);
}

.section-dark .section-sub,
.section-blue .section-sub {
  color: rgba(255, 255, 255, 0.82);
}

