/*
 * UMDPC institutional experience layer
 * This file intentionally sits after the legacy styles so existing content,
 * components and service behaviour remain available.
 */
:root {
  --ink-950: #061d30;
  --ink-900: #0b2e49;
  --ink-700: #234966;
  --surface: #f5f8f8;
  --white: #ffffff;
  --gold: #f4b942;
  --gold-soft: #fff3d5;
  --aqua: #20b5ad;
  --coral: #d85540;
  --line: rgba(11, 46, 73, .12);
  --display: "DM Serif Display", Georgia, serif;
  --sans: "Manrope", "Open Sans", sans-serif;
  --lift: 0 24px 60px rgba(6, 29, 48, .12);
}

html { scroll-padding-top: 110px; }
body { font-family: var(--sans); color: var(--ink-700); background: var(--surface); }
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1; opacity: .6; background-image: radial-gradient(rgba(7, 45, 70, .06) .65px, transparent .65px); background-size: 12px 12px; }
h1, h2, h3, h4, h5, h6 { font-family: var(--sans); }
a { transition: color .2s ease, transform .2s ease, background .2s ease, box-shadow .2s ease; }

/* Header: keeps the original navigation, but makes it feel like a compact service desk. */
#topbar { height: 36px; font-size: 12px; background: var(--ink-950); border-bottom: 1px solid rgba(255,255,255,.08); }
#topbar .container { gap: 18px; }
#topbar .topbar-link { color: rgba(255,255,255,.88); }
#header { top: 36px; padding: 9px 0; background: rgba(255,255,255,.94); box-shadow: 0 8px 34px rgba(6,29,48,.09); backdrop-filter: blur(18px); }
#header.header-scrolled { top: 0; }
#header .container { max-width: 1420px; }
#header .logo { display: flex; align-items: center; gap: 11px; min-width: 210px; }
#header .logo img { width: 48px; height: 48px; padding: 2px; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
#header .logo a { display: flex; flex-direction: column; gap: 1px; font-family: var(--sans); font-size: 20px; font-weight: 800; letter-spacing: .08em; line-height: 1; }
#header .logo a small { max-width: 245px; color: #567082; font-size: 8px; font-weight: 700; letter-spacing: .04em; line-height: 1.3; text-transform: uppercase; }
.navbar a, .navbar a:focus { padding: 10px 0 10px 20px; color: var(--ink-900); font-family: var(--sans); font-size: 10px; font-weight: 800; letter-spacing: .055em; }
.navbar .dropdown ul { border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--lift); }
.navbar .dropdown ul a { padding: 10px 18px; font-size: 12px; }
.renew-btn { margin-left: 13px; padding: 10px 16px; background: var(--coral); box-shadow: none; font-family: var(--sans); font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.renew-btn:hover { background: var(--ink-950); box-shadow: 0 10px 22px rgba(6,29,48,.18); }
.theme-toggle-header { margin-left: 12px; }

/* A quiet but dramatic hero, with the original carousel and news panels untouched. */
#hero { height: min(780px, 88vh); min-height: 620px; margin-top: 112px; overflow: hidden; background: var(--ink-950); }
#hero::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(90deg, rgba(4,20,34,.88) 0%, rgba(4,20,34,.53) 43%, rgba(4,20,34,.08) 75%), linear-gradient(0deg, rgba(4,20,34,.55), transparent 38%); }
#hero::after { z-index: 2; background: radial-gradient(circle at 12% 20%, rgba(32,181,173,.33), transparent 25rem), radial-gradient(circle at 78% 74%, rgba(244,185,66,.16), transparent 21rem); }
#hero .carousel-item { align-items: center; background-position: center; }
#hero .container { position: relative; z-index: 3; width: min(700px, calc(100% - 64px)); margin: 0 auto 60px max(7vw, 28px); padding: 0; background: transparent; border: 0; border-radius: 0; box-shadow: none; backdrop-filter: none; }
#hero .container::before { content: "Uganda Medical & Dental Practitioners Council"; display: block; width: fit-content; margin-bottom: 17px; padding: 7px 11px; color: var(--gold-soft); background: rgba(255,255,255,.11); border: 1px solid rgba(255,255,255,.22); border-radius: 99px; font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
#hero h3 { max-width: 660px; color: #fff; font-family: var(--display); font-size: clamp(42px, 5.2vw, 76px); font-weight: 400; letter-spacing: -.025em; line-height: .98; text-shadow: none; }
#hero h3 span { color: var(--gold); }
#hero p { max-width: 530px; color: rgba(255,255,255,.86); font-size: 16px; line-height: 1.75; }
#hero .btn-get-started { padding: 13px 21px; background: var(--gold); color: var(--ink-950); border-radius: 4px; box-shadow: none; font-family: var(--sans); font-size: 12px; font-weight: 800; letter-spacing: .04em; }
#hero .btn-get-started:hover { color: #fff; background: var(--coral); transform: translateY(-3px); }
#hero .carousel-control-prev, #hero .carousel-control-next { width: 8%; z-index: 5; }
#hero .carousel-control-next-icon, #hero .carousel-control-prev-icon { width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,.1); }
#hero .carousel-indicators { z-index: 5; }
.hero-service-rail { position: absolute; z-index: 6; left: max(7vw, 28px); right: max(7vw, 28px); bottom: 0; display: flex; align-items: center; min-height: 62px; gap: 8px 25px; padding: 12px 0; border-top: 1px solid rgba(255,255,255,.22); color: rgba(255,255,255,.68); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.hero-service-rail span { margin-right: auto; color: var(--gold); }
.hero-service-rail a { color: #fff; white-space: nowrap; }
.hero-service-rail a i { margin-right: 7px; color: var(--aqua); }
.hero-service-rail a:hover { color: var(--gold); }

/* Long-form information rhythm. Existing sections retain their content but gain visual hierarchy. */
main > section { padding: 98px 0; }
main > section:nth-child(even):not(.app-experience-strip) { background-color: rgba(255,255,255,.68); }
.section-title { max-width: 800px; margin: 0 auto 42px; }
.section-title h2 { color: var(--ink-950); font-family: var(--display); font-size: clamp(34px, 4vw, 53px); font-weight: 400; letter-spacing: -.025em; line-height: 1.05; text-transform: none; }
.section-title h2::after { width: 54px; height: 3px; left: 0; bottom: -17px; background: var(--gold); border-radius: 0; }
.section-title p { font-size: 15px; line-height: 1.75; }
.app-experience-strip { padding: 0 0 20px !important; margin-top: -35px; z-index: 8; }
.app-experience-card { border: 1px solid rgba(255,255,255,.25); border-radius: 6px; box-shadow: var(--lift); background: linear-gradient(115deg, var(--ink-950), var(--ink-900) 62%, #17655f); }
.app-experience-card h2 { font-family: var(--display); font-size: 38px; font-weight: 400; }
.app-kicker { color: var(--gold); }
.app-primary-action { border-radius: 4px; background: var(--gold); color: var(--ink-950); }
.app-secondary-action { border-radius: 4px; }
.app-quick-grid { gap: 12px; }
.app-quick-card { border: 1px solid var(--line); border-radius: 5px; box-shadow: 0 8px 24px rgba(6,29,48,.06); }
.app-quick-card:hover { border-color: var(--gold); transform: translateY(-5px); }

/* Common cards and dense data areas. */
.about .content, .heroo .content { padding: 18px 4% !important; }
.about .content h3, .heroo .content h3 { color: var(--ink-950); font-family: var(--display); font-size: 36px; font-weight: 400; }
.about img, .heroo img { border-radius: 4px; box-shadow: var(--lift); }
.icon-box, .member, .speaker, .staff-news-card, .facility-search-box, .facility-table-wrap, .faq .accordion-list li, .downloads .accordion-list li { border: 1px solid var(--line); border-radius: 5px; box-shadow: 0 10px 30px rgba(6,29,48,.06); }
.icon-box:hover, .member:hover, .speaker:hover, .staff-news-card:hover { border-color: rgba(244,185,66,.9); box-shadow: var(--lift); }
.facility-ai-panel { border-radius: 5px; background: linear-gradient(115deg, var(--ink-950), var(--ink-900) 57%, #146f75); }
.facility-ai-stats div { border-radius: 4px; }
.facility-search-box input, .facility-search-box select, .contact .php-email-form input, .contact .php-email-form textarea { border-radius: 3px; }
.table { --bs-table-striped-bg: rgba(32,181,173,.05); }
.table thead th { color: #fff; background: var(--ink-900); }

.contact { background: var(--ink-950); }
.contact .section-title h2, .contact .section-title p { color: #fff; }
.contact .info-box, .contact .php-email-form { border-radius: 5px; box-shadow: none; }
.contact .info-box i { border-radius: 4px; background: var(--aqua); }
#footer .footer-top { background: var(--ink-950); border-top: 1px solid rgba(244,185,66,.35); }
#footer .footer-top .footer-info h3 { font-family: var(--display); font-size: 34px; font-weight: 400; }
#footer .footer-top .social-links a { border-radius: 4px; background: rgba(255,255,255,.1); }
.back-to-top { border-radius: 4px; background: var(--gold); }

@media (max-width: 1199px) {
  #header .logo a small { display: none; }
  .navbar a, .navbar a:focus { padding-left: 12px; font-size: 9px; }
  .hero-service-rail { gap: 14px; }
}
@media (max-width: 991px) {
  #topbar { height: 32px; }
  #header { top: 32px; }
  #hero { margin-top: 92px; min-height: 570px; }
  #header .logo a small { display: flex; }
  .navbar-mobile { background: rgba(4,20,34,.84); }
  .navbar-mobile > ul { border-radius: 5px; }
  .hero-service-rail { display: none; }
  .hero-flyout-stack { z-index: 8; }
}
@media (max-width: 767px) {
  #topbar { height: 30px; font-size: 10px; }
  #topbar .container { justify-content: center !important; gap: 10px; }
  #topbar .container > div:first-child, #topbar .container > div:nth-child(3) { display: none !important; }
  #header { top: 30px; }
  #hero { height: min(650px, calc(100svh - 70px)); min-height: 500px; margin-top: 78px; }
  #hero .container { width: calc(100% - 32px); margin: 0 16px 132px; }
  #hero .container::before { margin-bottom: 12px; font-size: 8px; }
  #hero h3 { font-size: clamp(38px, 12vw, 58px); }
  #hero p { font-size: 14px; line-height: 1.6; }
  main > section { padding: 64px 0; }
  .section-title { margin-bottom: 34px; text-align: left; }
  .section-title h2 { font-size: 35px; }
  .section-title h2::after { left: 0; }
  .app-experience-strip { margin-top: -20px; }
  .app-experience-card h2 { font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; } }

/* -------------------------------------------------------------------------
   Motion & image-integrated type
   The carousel copy is intentionally treated as part of the photograph rather
   than a flat layer placed over it.  All motion remains optional for visitors
   who prefer reduced motion.
   ------------------------------------------------------------------------- */
#hero .carousel-item {
  isolation: isolate;
  overflow: hidden;
}

#hero .carousel-item::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(105deg, rgba(4, 20, 34, .32), transparent 52%);
  mix-blend-mode: multiply;
}

#hero .carousel-item.active {
  animation: hero-photo-drift 11s ease-out both;
}

#hero h3 {
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, .7);
  background: linear-gradient(110deg, rgba(255,255,255,.42) 0%, rgba(255,255,255,.92) 26%, rgba(244,185,66,.95) 49%, rgba(255,255,255,.92) 68%, rgba(255,255,255,.42) 100%);
  background-size: 235% 100%;
  background-position: 100% 50%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 1px rgba(255, 255, 255, .18);
  text-shadow: 0 16px 32px rgba(0, 0, 0, .24);
  mix-blend-mode: screen;
  filter: drop-shadow(0 4px 3px rgba(4, 20, 34, .25));
  opacity: 0;
}

#hero h3::after {
  content: "";
  display: block;
  width: min(130px, 30%);
  height: 3px;
  margin-top: 18px;
  background: var(--gold);
  box-shadow: 0 0 20px rgba(244,185,66,.85);
  opacity: 0;
}

#hero .container::before,
#hero p,
#hero .btn-get-started { opacity: 0; }

/* The caption belongs to a single active image. */
#hero .carousel-item.caption-is-visible .container::before { animation: hero-label-in .7s .12s both; }
#hero .carousel-item.caption-is-visible h3 { animation: hero-title-in .9s cubic-bezier(.2,.75,.2,1) .18s both, caption-light-sweep 3.8s 1.05s ease-in-out infinite, caption-breathe 2.8s 1.05s ease-in-out infinite; }
#hero .carousel-item.caption-is-visible h3::after { animation: hero-line-in .75s .8s both, caption-line-float 2.2s 1.55s ease-in-out infinite; }
#hero .carousel-item.caption-is-visible p { animation: hero-copy-in .8s .5s both; }
#hero .carousel-item.caption-is-visible .btn-get-started { animation: hero-copy-in .75s .68s both, hero-button-glow 2.8s 1.6s ease-in-out infinite; }

#hero .carousel-item.caption-is-leaving .container::before { animation: hero-label-out .25s both; }
#hero .carousel-item.caption-is-leaving h3 { animation: hero-title-out .32s both; }
#hero .carousel-item.caption-is-leaving h3::after { animation: hero-line-out .18s both; }
#hero .carousel-item.caption-is-leaving p,
#hero .carousel-item.caption-is-leaving .btn-get-started { animation: hero-copy-out .22s both; }

/* Give the existing information blocks a tactile, editorial quality. */
.section-title h2 { position: relative; }
.section-title h2::after { transition: width .45s cubic-bezier(.2,.75,.2,1), box-shadow .45s ease; }
section:hover > .container > .section-title h2::after { width: 105px; box-shadow: 18px 0 24px rgba(244,185,66,.36); }

.app-quick-card,
.staff-news-card,
.member,
.speaker,
.icon-box,
.facility-search-box,
.facility-table-wrap,
.contact .info-box,
.contact .php-email-form {
  transform: translateZ(0);
  transition: transform .35s cubic-bezier(.2,.75,.2,1), box-shadow .35s ease, border-color .35s ease;
}

.app-quick-card:hover,
.staff-news-card:hover,
.member:hover,
.speaker:hover,
.icon-box:hover,
.contact .info-box:hover {
  transform: translateY(-8px) scale(1.01);
}

.staff-news-image-wrap,
.member .pic,
.speaker .pic,
.gallery .gallery-item {
  overflow: hidden;
}

.staff-news-image-wrap img,
.member img,
.speaker img,
.gallery .gallery-item img {
  transition: transform .7s cubic-bezier(.2,.75,.2,1), filter .5s ease;
}

.staff-news-card:hover img,
.member:hover img,
.speaker:hover img,
.gallery .gallery-item:hover img {
  transform: scale(1.07) rotate(.5deg);
  filter: saturate(1.1) contrast(1.03);
}

.app-primary-action,
.app-secondary-action,
.renew-btn,
.contact .php-email-form button[type=submit],
.information-actions a {
  position: relative;
  overflow: hidden;
}

.app-primary-action::after,
.app-secondary-action::after,
.renew-btn::after,
.contact .php-email-form button[type=submit]::after,
.information-actions a::after {
  content: "";
  position: absolute;
  top: -60%;
  left: -35%;
  width: 28%;
  height: 220%;
  background: rgba(255,255,255,.32);
  transform: rotate(24deg) translateX(-450%);
  transition: transform .65s ease;
}

.app-primary-action:hover::after,
.app-secondary-action:hover::after,
.renew-btn:hover::after,
.contact .php-email-form button[type=submit]:hover::after,
.information-actions a:hover::after { transform: rotate(24deg) translateX(720%); }

.facility-ai-panel { overflow: hidden; }
.facility-ai-panel::after { animation: ambient-orb 7s ease-in-out infinite alternate; }
.world-news-toggle:hover .world-news-toggle-icon { transform: rotate(180deg) scale(1.08); }
.world-news-toggle-icon { transition: transform .45s cubic-bezier(.2,.75,.2,1); }

@supports (animation-timeline: view()) {
  main > section > .container > .section-title,
  main > section > .container > .row,
  main > section > .container > .staff-news-grid {
    animation: rise-on-scroll both ease-out;
    animation-timeline: view();
    animation-range: entry 8% cover 34%;
  }
}

@keyframes hero-photo-drift {
  from { background-size: 100%; background-position: 50% 50%; }
  to { background-size: 108%; background-position: 52% 47%; }
}
@keyframes hero-title-in {
  from { opacity: 0; transform: translate3d(-38px, 22px, 0) scale(.96); letter-spacing: .05em; }
  to { opacity: 1; transform: translate3d(0, 0, 0) scale(1); letter-spacing: -.025em; }
}
@keyframes hero-label-in { from { opacity: 0; transform: translateY(12px); } to { opacity: .8; transform: translateY(0); } }
@keyframes hero-line-in { from { opacity: 0; transform: scaleX(0); transform-origin: left; } to { opacity: 1; transform: scaleX(1); transform-origin: left; } }
@keyframes hero-copy-in { from { opacity: 0; transform: translateY(17px); } to { opacity: 1; transform: translateY(0); } }
@keyframes hero-label-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes hero-title-out { to { opacity: 0; transform: translate3d(30px, -12px, 0) scale(1.03); filter: blur(3px); } }
@keyframes hero-line-out { to { opacity: 0; transform: scaleX(0); transform-origin: right; } }
@keyframes hero-copy-out { to { opacity: 0; transform: translateY(-10px); } }
@keyframes caption-light-sweep { 0%, 18% { background-position: 100% 50%; } 52%, 70% { background-position: 0% 50%; } 100% { background-position: -100% 50%; } }
@keyframes caption-breathe { 0%, 100% { filter: drop-shadow(0 4px 3px rgba(4,20,34,.25)); } 50% { filter: drop-shadow(0 8px 10px rgba(244,185,66,.3)); } }
@keyframes caption-line-float { 0%, 100% { transform: translateX(0) scaleX(1); } 50% { transform: translateX(16px) scaleX(.78); } }
@keyframes hero-button-glow { 0%,100% { box-shadow: 0 0 0 rgba(244,185,66,0); } 50% { box-shadow: 0 0 0 9px rgba(244,185,66,.12); } }
@keyframes ambient-orb { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(-32px,20px,0) scale(1.18); } }
@keyframes rise-on-scroll { from { opacity: 0; transform: translateY(34px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 767px) {
  #hero h3 { -webkit-text-stroke: .65px rgba(255,255,255,.2); mix-blend-mode: normal; }
  #hero h3::after { margin-top: 12px; }
  .app-quick-card:hover, .staff-news-card:hover, .member:hover, .speaker:hover, .icon-box:hover, .contact .info-box:hover { transform: translateY(-4px); }
}

@media (prefers-reduced-motion: reduce) {
  #hero .carousel-item.active,
  #hero .container::before,
  #hero h3,
  #hero p,
  #hero .btn-get-started,
  .facility-ai-panel::after { animation: none !important; }
  .staff-news-image-wrap img, .member img, .speaker img, .gallery .gallery-item img { transition: none; }
  #hero .carousel-item .container::before,
  #hero .carousel-item h3,
  #hero .carousel-item h3::after,
  #hero .carousel-item p,
  #hero .carousel-item .btn-get-started { opacity: 1; }
}
