/* ==========================================================================
   HPERD · FMU — Design System
   Health Professions Education & Research Department, Faisalabad Medical University
   ========================================================================== */

:root {
  --color-navy: #1B3A54;
  --color-navy-deep: #0E2238;
  --color-teal: #3D6690;
  --color-teal-light: #6F97BC;
  --color-gold: #9CC4E4;
  --color-gold-soft: #C7DEF0;
  --color-sky: #CFE1F2;
  --color-paper: #FBFAF8;
  --color-mist: #F2F4F6;
  --color-ink: #1A2733;
  --color-ink-soft: #4B5B68;

  --font-display: 'Poppins', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;

  --shadow-soft: 0 4px 20px rgba(15, 45, 82, 0.08);
  --shadow-lift: 0 14px 40px rgba(15, 45, 82, 0.14);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

* { scroll-behavior: smooth; }

html { scroll-padding-top: 100px; }

body {
  font-family: var(--font-body);
  color: var(--color-ink);
  background: var(--color-paper);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .font-display {
  font-family: var(--font-display);
}

/* ---- Focus & accessibility ---- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* ---- Header (floating) ---- */
.header-slot {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 14px 12px 0;
}
@media (min-width: 640px) { .header-slot { padding: 18px 20px 0; } }

.site-header {
  background: rgba(251, 250, 248, 0.85);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border: 1px solid rgba(27, 58, 84, 0.09);
  border-radius: 20px;
  box-shadow: 0 6px 24px rgba(14, 34, 56, 0.10);
  transition: box-shadow 0.3s var(--ease-out), background 0.3s;
}
.site-header.shadow-md {
  box-shadow: 0 16px 40px rgba(14, 34, 56, 0.18);
  background: rgba(251, 250, 248, 0.95);
}

/* Logo mark: blends the logo's white background into the glass header */
.logo-mark {
  mix-blend-mode: multiply;
}
@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-3px); }
}
.logo-float { animation: logoFloat 3.6s var(--ease-out) infinite; }

@keyframes beaconPulse {
  0%   { transform: scale(0.8); opacity: 0.5; }
  75%  { transform: scale(1.7); opacity: 0; }
  100% { transform: scale(1.7); opacity: 0; }
}
.beacon-glow {
  position: absolute;
  inset: -8px;
  border-radius: 9999px;
  background: radial-gradient(circle, rgba(156, 196, 228, 0.6) 0%, rgba(156, 196, 228, 0) 72%);
  animation: beaconPulse 2.8s var(--ease-out) infinite;
  z-index: -1;
}

/* ---- Wave divider (hero → next section) ---- */
@keyframes waveDrift {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
.wave-track {
  animation: waveDrift 18s linear infinite;
  width: 200%;
}
@media (prefers-reduced-motion: reduce) {
  .logo-float, .beacon-glow, .wave-track { animation: none; }
}

.nav-link {
  position: relative;
  color: var(--color-ink-soft);
  font-weight: 500;
  padding-bottom: 4px;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 2px;
  background: var(--color-gold);
  transition: width 0.3s var(--ease-out);
}
.nav-link:hover,
.nav-link.active {
  color: var(--color-navy);
}
.nav-link:hover::after,
.nav-link.active::after { width: 100%; }

/* ---- Buttons ---- */
.btn-primary {
  background: var(--color-gold);
  color: var(--color-navy-deep);
  font-weight: 600;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), background 0.25s;
}
.btn-primary:hover { background: var(--color-gold-soft); box-shadow: var(--shadow-lift); transform: translateY(-2px); }

.btn-outline {
  border: 1.5px solid rgba(255,255,255,0.7);
  color: #fff;
  transition: background 0.25s, transform 0.25s var(--ease-out);
}
.btn-outline:hover { background: rgba(255,255,255,0.12); transform: translateY(-2px); }

.btn-teal {
  background: var(--color-teal);
  color: #fff;
  font-weight: 600;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}
.btn-teal:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }

/* ---- Cards ---- */
.card {
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
  border: 1px solid rgba(15,45,82,0.06);
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }

.eyebrow {
  color: var(--color-teal);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.divider-gold {
  width: 56px;
  height: 3px;
  background: var(--color-gold);
  border-radius: 3px;
}

/* ---- Hero ---- */
.hero-bg {
  background:
    linear-gradient(120deg, rgba(14,34,56,0.93) 0%, rgba(27,58,84,0.84) 45%, rgba(61,102,144,0.58) 100%),
    url('https://images.unsplash.com/photo-1576091160399-112ba8d25d1d?q=80&w=1920&auto=format&fit=crop');
  background-size: cover;
  background-position: center;
}

/* ---- Reveal on scroll (single orchestrated pass) ---- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* ---- Hero entrance (single load-time sequence, not scroll-triggered) ---- */
@keyframes heroUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-anim > * {
  opacity: 0;
  animation: heroUp 0.85s var(--ease-out) forwards;
}
.hero-anim > *:nth-child(1) { animation-delay: 0.05s; }
.hero-anim > *:nth-child(2) { animation-delay: 0.22s; }
.hero-anim > *:nth-child(3) { animation-delay: 0.40s; }
.hero-anim > *:nth-child(4) { animation-delay: 0.58s; }

.shadow-lift { box-shadow: var(--shadow-lift); }

/* ---- Animated counters ---- */
.counter { font-variant-numeric: tabular-nums; }

/* ---- Stats ---- */
.stat-number {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--color-navy);
}

/* ---- Timeline (Events) ---- */
.timeline-line {
  background: linear-gradient(to bottom, var(--color-teal), rgba(15,118,110,0.15));
}
.timeline-dot {
  background: var(--color-gold);
  box-shadow: 0 0 0 4px rgba(212,160,23,0.18);
}

/* ---- Gallery masonry ---- */
.masonry { column-count: 1; column-gap: 1rem; }
@media (min-width: 640px) { .masonry { column-count: 2; } }
@media (min-width: 1024px) { .masonry { column-count: 3; } }
.masonry-item { break-inside: avoid; margin-bottom: 1rem; }

/* ---- Back to top ---- */
#backToTop {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out);
  transform: translateY(10px);
}
#backToTop.show { opacity: 1; pointer-events: auto; transform: translateY(0); }

/* ---- Table (Downloads) ---- */
.downloads-table tr { transition: background 0.2s; }
.downloads-table tr:hover { background: var(--color-mist); }

/* ---- Utility ---- */
.text-navy { color: var(--color-navy); }
.text-teal { color: var(--color-teal); }
.text-gold { color: var(--color-gold); }
.bg-navy { background: var(--color-navy); }
.bg-navy-deep { background: var(--color-navy-deep); }
.bg-teal { background: var(--color-teal); }
.bg-mist { background: var(--color-mist); }

/* Lazy image fade-in */
img.lazy-fade { opacity: 0; transition: opacity 0.5s var(--ease-out); }
img.lazy-fade.loaded { opacity: 1; }

/* =========================================================
   FMU HERO BACKGROUND
   ========================================================= */

.hero-fmu-bg {
  filter: blur(3px);
  transform: scale(1.04);
  opacity: 0.78;
  transition: filter 0.4s ease;
}

/* Extra visual softness at the bottom of the hero */
.hero-fmu-bg::after {
  content: "";
}

/* =========================================================
   FEATURED INFORMATION SECTIONS
   ========================================================= */

.featured-info-section {
  position: relative;
}

.featured-info-card {
  position: relative;
  background: #ffffff;
  border: 1px solid rgba(15, 45, 82, 0.08);
  border-radius: 1.25rem;
  box-shadow: 0 10px 35px rgba(15, 45, 82, 0.07);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease;
}

.featured-info-card:hover {
  transform: translateY(-4px);
  border-color: rgba(15, 118, 110, 0.22);
  box-shadow: 0 18px 45px rgba(15, 45, 82, 0.12);
}

/* Main/featured card */
.featured-info-card-primary {
  border-top: 4px solid #D4A017;
  box-shadow: 0 15px 45px rgba(15, 45, 82, 0.11);
}

/* Section heading accent */
.section-heading-accent {
  position: relative;
  padding-left: 16px;
}

.section-heading-accent::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 4px;
  border-radius: 999px;
  background: #D4A017;
}

/* Announcement date badge */
.announcement-date {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(15, 118, 110, 0.08);
  color: #0F766E;
  font-size: 0.72rem;
  font-weight: 600;
}

/* Event date block */
.event-date-block {
  min-width: 86px;
  text-align: center;
  padding: 12px 10px;
  border-radius: 14px;
  background: #F2F4F6;
  border: 1px solid rgba(15, 45, 82, 0.06);
}

.event-date-block .day {
  font-family: Poppins, Inter, sans-serif;
  font-size: 2rem;
  line-height: 1;
  font-weight: 700;
  color: #0F2D52;
}

.event-date-block .month {
  margin-top: 5px;
  color: #0F766E;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Notice rows */
.notice-highlight {
  position: relative;
  overflow: hidden;
}

.notice-highlight::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #0F766E;
}

.notice-highlight:hover::before {
  background: #D4A017;
}

@media (max-width: 640px) {
  .hero-fmu-bg {
    filter: blur(4px);
    transform: scale(1.06);
  }

  .event-date-block {
    min-width: 76px;
  }
}
