/* ==========================================================================
   CITY INSTITUTE OF HEALTH AND ALLIED SCIENCES — ilalacollege.ac.tz
   Design system derived from the institute seal:
   teal ring · maroon band · forest green · ice blue
   Developed by SAFITECH — safitech.co.tz
   ========================================================================== */

:root {
  /* Palette — sampled from the seal */
  --teal:        #2E9E8E;
  --teal-deep:   #14776A;
  --teal-ink:    #0E3B34;
  --maroon:      #9E1B1E;
  --maroon-deep: #7C1416;
  --forest:      #1E6B45;
  --ice:         #D9EAEC;
  --mist:        #EEF6F4;
  --paper:       #FBFDFC;
  --white:       #FFFFFF;
  --ink:         #1C2B28;
  --ink-soft:    #52655F;
  --line:        #DCE8E4;

  /* Type */
  --font-display: "Bricolage Grotesque", "Segoe UI", sans-serif;
  --font-body: "Figtree", "Segoe UI", sans-serif;

  /* Rhythm */
  --radius: 18px;
  --radius-sm: 10px;
  --section-pad: clamp(4rem, 9vw, 7rem);
  --shadow-soft: 0 10px 40px -12px rgba(14, 59, 52, 0.14);
  --shadow-card: 0 4px 24px -8px rgba(14, 59, 52, 0.10);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: var(--teal-deep); text-decoration: none; }
ul { list-style: none; }

.container {
  width: min(1160px, 92%);
  margin-inline: auto;
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.12;
  color: var(--teal-ink);
  letter-spacing: -0.015em;
}

h1 { font-size: clamp(2.4rem, 5.4vw, 4rem); font-weight: 700; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 600; }

/* Seal-band eyebrow — echoes the maroon/green band of the logo */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 1.1rem;
  border-radius: 4px;
  overflow: hidden;
}
.eyebrow .band-l {
  background: var(--maroon);
  color: var(--white);
  padding: 0.36em 0.85em;
}
.eyebrow .band-r {
  background: var(--mist);
  color: var(--forest);
  padding: 0.36em 0.85em;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 4px 4px 0;
}

.section { padding-block: var(--section-pad); }
.section-head { max-width: 640px; margin-bottom: 3rem; }
.section-head p { color: var(--ink-soft); margin-top: 0.9rem; font-size: 1.05rem; }

/* ==========================================================================
   Header / Navigation
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 253, 252, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.site-header.scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 6px 24px -18px rgba(14, 59, 52, 0.35);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.7rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}
.brand img { height: 54px; width: auto; }
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.98rem;
  line-height: 1.15;
  color: var(--teal-ink);
  letter-spacing: 0.01em;
}
.brand-name span { display: block; font-size: 0.68rem; font-weight: 600; color: var(--maroon); letter-spacing: 0.12em; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.9rem;
}
.nav-links a {
  font-weight: 600;
  font-size: 0.94rem;
  color: var(--ink);
  position: relative;
  padding-block: 0.3rem;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 2px;
  background: var(--teal);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.8rem 1.6rem;
  border-radius: 999px;
  border: 0;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: var(--maroon);
  color: var(--white) !important;
  box-shadow: 0 8px 22px -8px rgba(158, 27, 30, 0.55);
}
.btn-primary:hover { background: var(--maroon-deep); }

.btn-ghost {
  background: transparent;
  color: var(--teal-deep) !important;
  border: 1.5px solid var(--teal);
}
.btn-ghost:hover { background: var(--mist); }

.btn-light {
  background: var(--white);
  color: var(--maroon) !important;
  box-shadow: 0 8px 24px -10px rgba(0,0,0,0.35);
}

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 0.4rem;
}
.nav-toggle span {
  display: block;
  width: 24px; height: 2.5px;
  background: var(--teal-ink);
  border-radius: 2px;
  margin: 5px 0;
  transition: transform 0.3s, opacity 0.3s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  padding-block: clamp(3.5rem, 7vw, 6rem) clamp(3rem, 6vw, 5rem);
  background:
    radial-gradient(900px 480px at 88% -10%, rgba(46, 158, 142, 0.13), transparent 65%),
    radial-gradient(700px 420px at -10% 110%, rgba(217, 234, 236, 0.8), transparent 60%),
    var(--paper);
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(2.5rem, 5vw, 4.5rem);
  align-items: center;
}

.hero-copy h1 em {
  font-style: normal;
  color: var(--teal-deep);
}
.hero-copy > p {
  margin-top: 1.3rem;
  font-size: 1.12rem;
  color: var(--ink-soft);
  max-width: 34rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 2.2rem;
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 2.2rem;
  margin-top: 2.8rem;
  padding-top: 1.8rem;
  border-top: 1px solid var(--line);
}
.fact strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--maroon);
  line-height: 1.1;
}
.fact span { font-size: 0.86rem; color: var(--ink-soft); font-weight: 500; }

.hero-media {
  position: relative;
  padding: 0 18px 18px 0;
}

/* Layered offset frame — a soft teal panel behind the photo */
.hero-media::before {
  content: "";
  position: absolute;
  inset: 22px 0 0 22px;
  background: linear-gradient(140deg, var(--ice), rgba(46, 158, 142, 0.28));
  border-radius: var(--radius);
  z-index: -1;
}

/* Two-tone brand band — echoes the seal's maroon/green bar */
.hero-media::after {
  content: "";
  position: absolute;
  top: -10px;
  left: 34px;
  width: 96px;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--maroon) 50%, var(--forest) 50%);
  box-shadow: 0 6px 16px -6px rgba(158, 27, 30, 0.4);
}
.hero-media .photo {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  aspect-ratio: 4 / 4.6;
}

/* Shimmer placeholder — the frame looks intentional while the photo streams in */
.img-loading {
  background: linear-gradient(100deg, var(--mist) 40%, var(--ice) 50%, var(--mist) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer {
  to { background-position: -200% 0; }
}
.img-loading img { opacity: 0; }
.img-loading.img-done { animation: none; background: var(--mist); }
.img-loading.img-done img { opacity: 1; transition: opacity 0.35s ease; }

@media (prefers-reduced-motion: reduce) {
  .img-loading { animation: none; }
  .img-loading.img-done img { transition: none; }
}
.hero-media .photo img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.hero-media .photo-caption {
  position: absolute;
  left: 1.1rem; bottom: 1.1rem;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-sm);
  padding: 0.7rem 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--teal-ink);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.photo-caption .dot-live {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--forest);
  box-shadow: 0 0 0 4px rgba(30, 107, 69, 0.18);
}

/* ==========================================================================
   Notice bar (loan support)
   ========================================================================== */

.notice {
  background: var(--forest);
  color: var(--white);
}
.notice .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.7rem 1.4rem;
  padding-block: 0.85rem;
  font-size: 0.95rem;
  font-weight: 600;
  text-align: center;
}
.notice a { color: #CFF3DF; text-decoration: underline; text-underline-offset: 3px; }

/* ==========================================================================
   About
   ========================================================================== */

.about-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2.5rem, 5vw, 4.5rem);
  align-items: start;
}
.about-story p + p { margin-top: 1.1rem; }
.about-story p { color: var(--ink-soft); }
.about-story p:first-of-type { color: var(--ink); font-size: 1.08rem; }

.why-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow-card);
}
.why-card h3 { margin-bottom: 1.4rem; }
.why-card li {
  display: flex;
  gap: 0.9rem;
  padding-block: 0.85rem;
}
.why-card li + li { border-top: 1px solid var(--line); }
.why-card .tick {
  flex: none;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--mist);
  color: var(--teal-deep);
  display: grid;
  place-items: center;
  font-size: 0.8rem;
  margin-top: 0.15rem;
}
.why-card li strong { color: var(--teal-ink); display: block; font-size: 0.98rem; }
.why-card li p { font-size: 0.9rem; color: var(--ink-soft); }

/* ==========================================================================
   Principal message
   ========================================================================== */

.principal {
  background:
    radial-gradient(700px 400px at 10% 0%, rgba(46,158,142,0.10), transparent 60%),
    var(--mist);
}
.principal-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: clamp(1.8rem, 4vw, 3.2rem);
  align-items: center;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  padding: clamp(1.8rem, 4vw, 3rem);
}
.principal-portrait {
  width: clamp(150px, 20vw, 210px);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  border: 6px solid var(--mist);
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  align-self: start;
}
.principal-portrait img { width: 100%; height: 100%; object-fit: cover; }

.principal-quote .mark {
  font-family: var(--font-display);
  font-size: 3.4rem;
  line-height: 0.6;
  color: var(--teal);
  display: block;
  margin-bottom: 0.9rem;
}
.principal-quote p { color: var(--ink-soft); }
.principal-quote p + p { margin-top: 0.9rem; }
.principal-sign {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
}
.principal-sign strong { font-family: var(--font-display); color: var(--maroon); font-size: 1.05rem; }
.principal-sign span { font-size: 0.85rem; color: var(--ink-soft); letter-spacing: 0.06em; text-transform: uppercase; }

/* ==========================================================================
   Programs
   ========================================================================== */

.programs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.4rem;
}

.program-card {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.7rem 1.6rem 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.program-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-soft);
  border-color: var(--teal);
}
.program-card::before {
  content: "";
  position: absolute;
  top: 0; left: 1.6rem;
  width: 46px; height: 4px;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(90deg, var(--maroon) 50%, var(--forest) 50%);
}

.program-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--mist);
  color: var(--teal-deep);
  display: grid;
  place-items: center;
  font-size: 1.15rem;
}
.program-card h3 { font-size: 1.16rem; }

.badge-loan {
  position: absolute;
  top: 1.35rem; right: 1.35rem;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--forest);
  background: #E4F3EA;
  border: 1px solid #BFE3CD;
  padding: 0.3em 0.7em;
  border-radius: 999px;
}

.req-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--maroon);
}
.req-note { font-size: 0.92rem; color: var(--ink-soft); margin-top: -0.4rem; }

.subject-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: auto;
}
.subject-pills span {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--teal-deep);
  background: var(--mist);
  border: 1px solid var(--line);
  padding: 0.28em 0.75em;
  border-radius: 999px;
}

/* ==========================================================================
   Gallery preview
   ========================================================================== */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.gallery-grid a {
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  display: block;
}
.gallery-grid img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.gallery-grid a:hover img { transform: scale(1.05); }
.gallery-more { text-align: center; margin-top: 2.2rem; }

/* Full gallery page */
.gallery-page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.1rem;
}
.gallery-page-grid figure {
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 4 / 3;
}
.gallery-page-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.gallery-page-grid figure:hover img { transform: scale(1.05); }

/* ==========================================================================
   CTA
   ========================================================================== */

.cta {
  background:
    radial-gradient(600px 300px at 85% 20%, rgba(255,255,255,0.14), transparent 60%),
    linear-gradient(120deg, var(--teal-deep), var(--teal-ink));
  border-radius: var(--radius);
  color: var(--white);
  text-align: center;
  padding: clamp(2.8rem, 6vw, 4.5rem) clamp(1.5rem, 4vw, 3rem);
  position: relative;
  overflow: hidden;
}
.cta h2 { color: var(--white); }
.cta p { margin: 1rem auto 2rem; max-width: 32rem; color: rgba(255,255,255,0.82); }
.cta .seal-watermark {
  position: absolute;
  right: -60px; bottom: -80px;
  width: 260px;
  opacity: 0.09;
  pointer-events: none;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: var(--teal-ink);
  color: #BFD6D0;
  margin-top: var(--section-pad);
  padding-top: 4rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 3rem;
}
.footer-brand img {
  height: 96px;
  width: auto;
  background: var(--white);
  border-radius: 14px;
  padding: 8px 12px;
}
.footer-brand p { margin-top: 1.1rem; max-width: 26rem; font-size: 0.95rem; }
.site-footer h4 {
  font-family: var(--font-display);
  color: var(--white);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.2rem;
}
.site-footer li { margin-bottom: 0.7rem; font-size: 0.95rem; }
.site-footer a { color: #BFD6D0; transition: color 0.2s; }
.site-footer a:hover { color: var(--white); }

.wa-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(37, 211, 102, 0.14);
  border: 1px solid rgba(37, 211, 102, 0.4);
  color: #7BE8A8 !important;
  border-radius: 999px;
  padding: 0.5rem 1.05rem;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 0.65rem;
}
.wa-btn:hover { background: rgba(37, 211, 102, 0.24); }

.social-row { display: flex; gap: 0.8rem; margin-top: 1.4rem; }
.social-row a {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.22);
  display: grid;
  place-items: center;
  font-size: 1rem;
  transition: background 0.2s, transform 0.2s;
}
.social-row a:hover { background: rgba(255,255,255,0.12); transform: translateY(-2px); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-block: 1.4rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem;
  font-size: 0.85rem;
}
.footer-bottom .credit a {
  color: var(--white);
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* ==========================================================================
   Reveal on scroll
   ========================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.in-view { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .program-card, .gallery-grid img { transition: none; }
}

:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 960px) {
  .hero-grid, .about-grid { grid-template-columns: 1fr; }
  .hero-media { max-width: 520px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .principal-card { grid-template-columns: 1fr; text-align: left; }
}

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 24px 32px -20px rgba(14,59,52,0.25);
    padding: 0.6rem 1.2rem 1.2rem;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding-block: 0.85rem; border-bottom: 1px solid var(--line); }
  .nav-links a::after { display: none; }
  .nav-links .btn { margin-top: 0.9rem; justify-content: center; }
  .brand-name { font-size: 0.85rem; }
  .footer-grid { grid-template-columns: 1fr; }
}
