/*
 * Section components for the public site.
 *
 * The vocabulary the long-scroll homepage and the News / Masala / Search
 * pages are built from: section headers with a gold rule, icon tiles,
 * media cards, a statistics band, the alumni band and the tabbed
 * introduction card. Every colour is a palette token from theme.css, so
 * these read correctly for any institution's palette.
 *
 * Motion belongs to motion.css - a component here never animates itself,
 * it just carries `motion-lift` / `data-reveal` where that is wanted.
 */

/* ---- Page banner (inner pages) -------------------------------------- */

.page-hero {
  position: relative;
  background:
    linear-gradient(135deg, var(--color-primary-700) 0%, var(--color-primary-900) 100%);
  color: #fff;
  padding: 3rem 0 2.6rem;
  overflow: hidden;
}

/* A very faint radial highlight so the band is not a flat slab of green. */
.page-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 78% 12%, rgba(255, 255, 255, 0.14), transparent 55%);
  pointer-events: none;
}

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

.page-hero h1 {
  color: #fff;
  font-size: clamp(1.6rem, 1.1rem + 1.8vw, 2.4rem);
  margin-bottom: 0.4rem;
}

.page-hero p {
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 0;
  max-width: 46rem;
}

.page-hero .breadcrumb {
  --bs-breadcrumb-divider-color: rgba(255, 255, 255, 0.5);
  margin-bottom: 0.75rem;
}

.page-hero .breadcrumb a { color: rgba(255, 255, 255, 0.8); text-decoration: none; }
.page-hero .breadcrumb a:hover { color: #fff; text-decoration: underline; }
.page-hero .breadcrumb-item.active { color: rgba(255, 255, 255, 0.7); }

/* ---- Section scaffolding -------------------------------------------- */

.sec { padding: 3.5rem 0; }
.sec-tight { padding: 2.25rem 0; }
.sec-muted { background: var(--color-surface-muted); }

.sec-head {
  text-align: center;
  max-width: 46rem;
  margin: 0 auto 2.25rem;
}

.sec-head-start {
  text-align: start;
  margin-inline: 0;
  max-width: none;
}

.sec-title {
  font-size: clamp(1.4rem, 1.1rem + 1.1vw, 2rem);
  font-weight: 700;
  color: var(--color-primary-800);
  margin-bottom: 0.6rem;
}

.sec-sub {
  color: var(--color-ink-muted);
  margin-bottom: 0;
}

/* The gold ornament under a section heading - a short rule with a dot,
   the reference design's recurring separator. */
.sec-rule {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 0.75rem 0 0;
}

.sec-head-start .sec-rule { justify-content: flex-start; }

.sec-rule::before,
.sec-rule::after {
  content: '';
  height: 2px;
  width: 2.5rem;
  background: linear-gradient(90deg, transparent, var(--color-accent-500));
}

.sec-rule::after { background: linear-gradient(90deg, var(--color-accent-500), transparent); }

.sec-rule i { color: var(--color-accent-500); font-size: 0.7rem; }

/* ---- Icon tile (Quick Links / services grid) ------------------------ */

.tile-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  height: 100%;
  padding: 1.75rem 1rem 3.25rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  text-decoration: none;
  color: inherit;
}

.tile-card .tile-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 4.25rem;
  height: 4.25rem;
  border-radius: 50%;
  background: var(--color-primary-50);
  color: var(--color-primary-700);
  font-size: 1.9rem;
  transition: background-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.tile-card:hover .tile-icon {
  background: var(--color-primary-600);
  color: #fff;
}

.tile-card .tile-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--color-primary-800);
  margin: 0.35rem 0 0;
}

.tile-card .tile-sub {
  font-size: 0.85rem;
  color: var(--color-ink-muted);
  margin: 0;
}

/* The circular arrow pinned to the bottom edge, as in the reference grid.
   inset-inline-start:50% + translate keeps it centred in both directions. */
.tile-card .tile-go {
  position: absolute;
  bottom: 1rem;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid var(--color-primary-300);
  color: var(--color-primary-700);
  font-size: 0.8rem;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

[dir='rtl'] .tile-card .tile-go { transform: translateX(50%); }

.tile-card:hover .tile-go {
  background: var(--color-primary-600);
  border-color: var(--color-primary-600);
  color: #fff;
}

/* ---- Media card (News & Events, gallery) ---------------------------- */

.media-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  text-decoration: none;
  color: inherit;
}

.media-card-figure {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--color-primary-50);
  overflow: hidden;
}

.media-card-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Placeholder for an item with no photograph - a monogram mark rather than
   a broken-image frame. */
.media-card-figure .media-card-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--color-primary-300);
  background: var(--color-primary-50);
}

.media-card-badge {
  position: absolute;
  top: 0.75rem;
  inset-inline-start: 0.75rem;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border-radius: var(--radius-pill);
  padding: 0.15rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  backdrop-filter: blur(2px);
}

.media-card-body {
  padding: 1.1rem 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.media-card-title {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--color-primary-800);
  line-height: 1.45;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.media-card-excerpt {
  font-size: 0.9rem;
  color: var(--color-ink-muted);
  margin-bottom: 0.9rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.media-card-meta {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  font-size: 0.8rem;
  color: var(--color-ink-muted);
}

.media-card-meta i { color: var(--color-primary-500); margin-inline-end: 0.3rem; }

/* ---- Notice list ----------------------------------------------------- */

.notice-row {
  display: flex;
  gap: 0.85rem;
  padding: 0.85rem 0;
  border-bottom: 1px dashed var(--color-border);
}

.notice-row:last-child { border-bottom: 0; }

.notice-row-date {
  flex-shrink: 0;
  width: 3.4rem;
  text-align: center;
  border-radius: var(--radius-sm);
  background: var(--color-primary-50);
  color: var(--color-primary-800);
  padding: 0.35rem 0.2rem;
  line-height: 1.15;
}

.notice-row-date .day { display: block; font-size: 1.15rem; font-weight: 700; }
.notice-row-date .mon { display: block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.04em; }

.notice-row-body { min-width: 0; flex: 1; }

.notice-row-title {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--color-ink);
  text-decoration: none;
  line-height: 1.5;
}

.notice-row-title:hover { color: var(--color-primary-700); }

.notice-flags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.4rem;
}

.notice-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.1rem 0.55rem;
  border-radius: var(--radius-pill);
  text-decoration: none;
  border: 1px solid transparent;
}

.notice-chip-file {
  background: #fdecec;
  color: #b42318;
  border-color: #f6c9c5;
}

.notice-chip-file:hover { background: #b42318; color: #fff; }

.notice-chip-urgent {
  background: var(--color-accent-300);
  color: #5a4508;
}

.notice-chip-more {
  background: var(--color-primary-50);
  color: var(--color-primary-700);
  border-color: var(--color-primary-100);
}

.notice-chip-more:hover { background: var(--color-primary-600); color: #fff; }

/* ---- Statistics band ------------------------------------------------- */

.stat-band {
  position: relative;
  background: linear-gradient(135deg, var(--color-primary-700) 0%, var(--color-primary-900) 100%);
  color: #fff;
  padding: 3rem 0;
  overflow: hidden;
}

/* The faint radiating fan behind the numbers in the reference screenshot,
   drawn with repeating-conic-gradient rather than shipped as an image. */
.stat-band::before {
  content: '';
  position: absolute;
  inset: -40% -10%;
  background: repeating-conic-gradient(
    from 0deg at 50% 100%,
    rgba(255, 255, 255, 0.045) 0deg 4deg,
    transparent 4deg 12deg
  );
  pointer-events: none;
}

.stat-band > * { position: relative; z-index: 1; }

.stat-band .stat-cell {
  text-align: center;
  padding: 1rem 0.5rem;
  border-inline-end: 1px solid rgba(255, 255, 255, 0.16);
}

.stat-band .stat-cell:last-child { border-inline-end: 0; }

.stat-band .stat-value {
  font-family: var(--font-read, var(--font-read-en));
  font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.6rem);
  font-weight: 600;
  font-style: italic;
  line-height: 1.1;
}

.stat-band .stat-label {
  margin-top: 0.5rem;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.5;
}

@media (max-width: 767.98px) {
  .stat-band .stat-cell:nth-child(even) { border-inline-end: 0; }
}

/* ---- Distinguished alumni band --------------------------------------- */

.alumni-strip {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.alumni-avatar {
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  padding: 0;
  border: 2px solid transparent;
  background: var(--color-primary-50);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
  opacity: 0.65;
}

.alumni-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.alumni-avatar .alumni-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-weight: 700;
  color: var(--color-primary-600);
  font-size: 1.15rem;
}

.alumni-avatar:hover { opacity: 1; transform: translateY(-3px); }

.alumni-avatar.is-active {
  opacity: 1;
  transform: scale(1.12);
  border-color: var(--color-accent-500);
  box-shadow: 0 10px 22px -12px rgba(15, 23, 42, 0.5);
}

.alumni-detail { text-align: center; max-width: 44rem; margin: 0 auto; }

.alumni-detail-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-primary-700);
  margin-bottom: 0.2rem;
}

.alumni-detail-meta {
  font-size: 0.85rem;
  color: var(--color-accent-600);
  margin-bottom: 0.75rem;
}

.alumni-detail-bio { color: var(--color-ink-soft); margin-bottom: 0; }

/* Panels swap instantly for keyboard/screen-reader users; the fade is
   decoration layered on top. */
.alumni-panel[hidden] { display: none; }

/* ---- Tabbed introduction card (Mission / Vision / About) ------------- */

.intro-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 1.75rem;
}

.intro-tabs .nav-link {
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  color: var(--color-ink-muted);
  font-weight: 600;
  padding: 0.6rem 1.15rem;
  background: none;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.intro-tabs .nav-link:hover { color: var(--color-primary-700); }

.intro-tabs .nav-link.active {
  color: var(--color-accent-600);
  border-bottom-color: var(--color-accent-500);
  background: none;
}

.intro-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 36px -28px rgba(15, 23, 42, 0.45);
  padding: 1.85rem 2rem;
}

.intro-card-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-primary-700);
  margin-bottom: 0.85rem;
}

.intro-card-title i { color: var(--color-accent-500); }

.intro-card-body { color: var(--color-ink-soft); }
.intro-card-body :last-child { margin-bottom: 0; }

/* ---- Search results -------------------------------------------------- */

.result-group + .result-group { margin-top: 2.25rem; }

.result-group-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  color: var(--color-primary-800);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-primary-100);
  margin-bottom: 0.5rem;
}

.result-group-head i { color: var(--color-primary-600); }

.result-group-count {
  margin-inline-start: auto;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-ink-muted);
}

.result-item {
  display: block;
  padding: 0.9rem 0.6rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--color-border);
  transition: background-color 0.15s ease, padding-inline-start 0.15s ease;
}

.result-item:last-child { border-bottom: 0; }

.result-item:hover {
  background: var(--color-primary-50);
  padding-inline-start: 1rem;
}

.result-item-title { font-weight: 600; color: var(--color-primary-700); margin-bottom: 0.2rem; }
.result-item-excerpt { font-size: 0.88rem; color: var(--color-ink-muted); margin-bottom: 0.2rem; }
.result-item-meta { font-size: 0.78rem; color: var(--color-ink-muted); }

/* ---- Q&A block (Masala) ---------------------------------------------- */

.qa-block {
  border-inline-start: 3px solid var(--color-primary-200);
  padding-inline-start: 1.1rem;
  margin-bottom: 1.5rem;
}

.qa-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent-600);
  margin-bottom: 0.4rem;
}

.qa-block.qa-answer { border-inline-start-color: var(--color-primary-600); }

/* ---- Contact / map --------------------------------------------------- */

.map-frame {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  min-height: 320px;
  background: var(--color-surface-muted);
}

.map-frame iframe { display: block; width: 100%; height: 100%; min-height: 320px; border: 0; }

/* ---- Call to action band --------------------------------------------- */

.cta-band {
  background: linear-gradient(135deg, var(--color-primary-600) 0%, var(--color-primary-800) 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 2.4rem 2rem;
  text-align: center;
  box-shadow: var(--shadow-raised);
}

.cta-band h2 { color: #fff; font-size: clamp(1.3rem, 1.05rem + 0.9vw, 1.85rem); }
.cta-band p { color: rgba(255, 255, 255, 0.88); max-width: 40rem; margin-inline: auto; }

.cta-band .btn-light { color: var(--color-primary-800); font-weight: 600; }
.cta-band .btn-outline-light { border-color: rgba(255, 255, 255, 0.6); }

/* ---- Empty state ------------------------------------------------------ */

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--color-ink-muted);
}

.empty-state i { font-size: 2.75rem; color: var(--color-primary-200); display: block; margin-bottom: 0.75rem; }

/* Bootstrap has no min-width utility, and a flex child defaults to
   min-width:auto - which stops `text-truncate` from ever truncating inside
   a flex row. Used by the notice attachment row and the masala list. */
.min-width-0 { min-width: 0; }

/* ---- Founders grid ---------------------------------------------------- *
 * Shared by the homepage introduction band and the public Founders page.
 * Named -tile rather than -card because about/founder.php already has a
 * .founder-card (and .founder-name) of its own from an earlier design.
 */

.founder-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: var(--color-surface-muted);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem 1.15rem 1.35rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.founder-tile:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-raised);
}

.founder-tile-photo {
  width: 7.5rem;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 0.9rem;
  background: var(--color-primary-50);
  border: 3px solid var(--color-surface);
  box-shadow: var(--shadow-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}

.founder-tile-photo img { width: 100%; height: 100%; object-fit: cover; }
.founder-tile-photo i { font-size: 2.5rem; color: var(--color-primary-300); }

.founder-tile-name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-primary-800);
  margin-bottom: 0.2rem;
}

.founder-tile-role {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-accent-600);
  margin-bottom: 0.6rem;
}

.founder-tile-bio {
  font-size: 0.9rem;
  color: var(--color-ink-soft);
  margin-bottom: 0;
}

@media (max-width: 575.98px) {
  .founder-tile-photo { width: 5.5rem; }
  .founder-tile-bio { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .founder-tile { transition: none; }
  .founder-tile:hover { transform: none; }
}

/* ---- Embedded video ---------------------------------------------------- *
 * Used by the homepage introduction band and the About page, which show
 * the same institution video.
 */

.intro-video {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-raised);
  background: var(--color-primary-900);
}

.intro-video iframe { border: 0; }

