/* ==========================================================
   UESA – University of Embu Students' Association
   Static site stylesheet
   ========================================================== */
:root {
  --blue: #2A5BA8;
  --blue-dark: #31519b;
  --navy: #31519b;
  --gold: #BFA05A;
  --gold-dark: #9C8140;
  --ink: #1D2433;
  --muted: #5B6475;
  --line: #E3E7EF;
  --bg-alt: #F4F6FA;
  --white: #FFFFFF;
  --radius: 10px;
  --shadow: 0 6px 24px rgba(49,81,155, .08);
  --container: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Rubik", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--white);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--gold-dark); }
h1, h2, h3, h4 { line-height: 1.25; color: var(--navy); margin: 0 0 .6em; font-weight: 600; }
h1 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); }
h2 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 720px; }
.center { text-align: center; }
.lead { font-size: 1.1rem; color: var(--muted); }
.skip { position: absolute; left: -999px; top: 0; background: var(--gold); color: #fff; padding: 8px 14px; z-index: 999; }
.skip:focus { left: 10px; top: 10px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; background: var(--blue); color: #fff; padding: 12px 26px;
  border-radius: 999px; font-weight: 500; border: 2px solid var(--blue);
  transition: background .2s, color .2s, border-color .2s; cursor: pointer; font: inherit;
}
.btn:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--blue); }
.btn-ghost:hover { background: var(--blue); color: #fff; }
.btn-gold { background: var(--gold); border-color: var(--gold); color: var(--navy); }
.btn-gold:hover { background: #fff; border-color: #fff; color: var(--navy); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }

/* ---------- top bar ---------- */
.topbar { background: var(--navy); color: #C9D3E6; font-size: .85rem; }
.topbar .container { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-block: 7px; flex-wrap: wrap; }
.topbar a { color: #fff; }
.topbar a:hover { color: var(--gold); }
.tb-links a { margin-left: 18px; }

/* ---------- header / nav ---------- */
.site-header { background: #fff; position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 12px rgba(49,81,155,.08); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 86px; }
.nav-bar { background: var(--blue-dark); border-bottom: 3px solid var(--gold); }
.brand { display: flex; align-items: center; gap: 12px; color: var(--navy); }
.brand img { width: 62px; height: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 1.3rem; color: var(--blue-dark); }
.brand-text em { font-style: normal; font-size: .82rem; color: var(--gold-dark); margin-top: 4px; }

.menu { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 2px; }
.menu > li { position: relative; display: flex; align-items: center; }
.menu > li > a, .menu > li > .nav-label {
  display: block; padding: 15px 16px; color: #fff; font-weight: 500; font-size: .98rem; cursor: pointer; white-space: nowrap;
}
.menu > li:hover, .menu > li.active { background: rgba(255,255,255,.1); }
.menu > li.active { box-shadow: inset 0 -3px 0 var(--gold); }
.menu > li > a:hover { color: var(--gold); }
.sub-toggle { background: none; border: 0; color: #C9D3E6; cursor: pointer; padding: 4px 12px 4px 0; font-size: .8rem; margin-left: -10px; }
.sub {
  list-style: none; margin: 0; padding: 8px 0; position: absolute; top: 100%; left: 0; min-width: 230px;
  background: #fff; border-top: 3px solid var(--gold); border-radius: 0 0 8px 8px; box-shadow: var(--shadow);
  opacity: 0; visibility: hidden; transform: translateY(8px); transition: .18s;
}
.has-sub:hover > .sub, .has-sub:focus-within > .sub { opacity: 1; visibility: visible; transform: none; }
.sub a { display: block; padding: 8px 18px; color: var(--ink); font-size: .92rem; }
.sub a:hover { background: var(--bg-alt); color: var(--blue); }
.sub .ext { color: var(--muted); font-size: .8em; }
.nav-toggle { display: none; background: none; border: 0; width: 44px; height: 44px; cursor: pointer; padding: 10px; }
.nav-toggle span { display: block; height: 2px; background: var(--navy); margin: 5px 0; transition: .2s; }

/* ---------- hero slider ---------- */
.hero-slider { position: relative; background: var(--navy); overflow: hidden; }
.slides { position: relative; aspect-ratio: 780 / 412; max-height: 620px; width: 100%; }
.slide { position: absolute; inset: 0; opacity: 0; transition: opacity .8s ease; }
.slide.is-active { opacity: 1; z-index: 1; }
.slide img { width: 100%; height: 100%; object-fit: cover; }
.slide-cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 60px 8% 46px; color: #fff;
  background: linear-gradient(to top, rgba(10,25,50,.85), rgba(10,25,50,0));
}
.slide-cap h2 { color: #fff; margin: 0 0 6px; font-size: clamp(1.2rem, 3vw, 2.2rem); }
.slide-cap p { margin: 0; max-width: 760px; font-size: clamp(.9rem, 1.6vw, 1.1rem); color: #E6ECF7; }
.sl-prev, .sl-next {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 46px; height: 46px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,.2); color: #fff; font-size: 1.8rem; cursor: pointer; line-height: 1;
}
.sl-prev:hover, .sl-next:hover { background: var(--gold); }
.sl-prev { left: 18px; } .sl-next { right: 18px; }
.sl-dots { position: absolute; bottom: 16px; left: 0; right: 0; z-index: 3; display: flex; justify-content: center; gap: 8px; }
.sl-dots button { width: 10px; height: 10px; border-radius: 50%; border: 0; background: rgba(255,255,255,.5); cursor: pointer; padding: 0; }
.sl-dots button.is-active { background: var(--gold); width: 26px; border-radius: 6px; }

/* ---------- sections ---------- */
.section { padding: 70px 0; }
.section.alt { background: var(--bg-alt); }
.sec-head { text-align: center; margin-bottom: 36px; }
.eyebrow { display: inline-block; color: var(--gold-dark); font-weight: 600; text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; margin-bottom: 8px; }
.welcome-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 50px; align-items: center; }
.motto-card { background: var(--bg-alt); border-radius: var(--radius); padding: 30px; border-left: 5px solid var(--gold); display: grid; grid-template-columns: 110px 1fr; gap: 22px; align-items: start; }
.motto-card h3 { margin: 0 0 4px; color: var(--blue); font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; }
.motto-card p { color: var(--muted); font-size: .95rem; }

.cta { background: linear-gradient(120deg, var(--blue-dark), var(--blue)); color: #fff; padding: 56px 0; text-align: center; }
.cta h2 { color: #fff; }
.cta p { color: #DCE5F5; }

/* ---------- cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; margin: 10px 0 30px; }
.card {
  display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; color: var(--ink); transition: transform .2s, box-shadow .2s, border-color .2s;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--gold); color: var(--ink); }
.card-img { aspect-ratio: 4/3; overflow: hidden; background: var(--bg-alt); }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .card-img img { transform: scale(1.05); }
.card-body { padding: 18px 20px; border-top: 3px solid var(--gold); flex: 1; }
.card-body h3 { margin: 0 0 4px; font-size: 1.05rem; color: var(--blue-dark); }
.card-body p { margin: 0; color: var(--muted); font-size: .92rem; }

/* ---------- officials ---------- */
.officials-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 24px; margin: 10px 0 34px; }
.official { flex: 0 1 220px; background: #fff; border-radius: var(--radius); text-align: center; padding: 26px 18px 22px; box-shadow: var(--shadow); border-bottom: 4px solid var(--blue); }
.official .photo { width: 140px; height: 140px; margin: 0 auto 16px; border-radius: 50%; overflow: hidden; border: 4px solid var(--gold); background: var(--bg-alt); }
.official .photo img { width: 100%; height: 100%; object-fit: cover; }
.official .avatar { width: 100%; height: 100%; display: grid; place-items: center; font-size: 2.4rem; color: var(--blue); font-weight: 600; }
.official h3 { font-size: 1.05rem; margin: 0 0 4px; }
.official p { margin: 0; color: var(--gold-dark); font-weight: 500; font-size: .9rem; }

/* ---------- inner pages ---------- */
.page-hero { background: linear-gradient(120deg, var(--navy), var(--blue)); color: #fff; padding: 46px 0 40px; }
.page-hero h1 { color: #fff; margin: 6px 0 0; }
.crumbs { font-size: .85rem; color: #B9C6E0; }
.crumbs a { color: #fff; }
.crumbs a:hover { color: var(--gold); }
.crumbs span { margin: 0 6px; opacity: .6; }
.crumbs strong { font-weight: 400; color: var(--gold); }
main:not(.full) { padding: 50px 0 70px; }
.with-side { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 44px; }
.content { min-width: 0; }
.content h2 { margin-top: 1.4em; }
.content h3 { color: var(--blue-dark); margin-top: 1.2em; }
.content ul, .content ol { padding-left: 1.3em; }
.content li { margin-bottom: .35em; }
.content img { border-radius: 8px; margin: 10px 0 18px; }
.content p > img:first-child { float: none; }
.table-wrap { overflow-x: auto; margin: 0 0 20px; }
.table-wrap table { border-collapse: collapse; width: 100%; }
.table-wrap td, .table-wrap th { border: 1px solid var(--line); padding: 10px; vertical-align: top; }

.sidebar { display: flex; flex-direction: column; gap: 22px; }
.side-box { background: var(--bg-alt); border-radius: var(--radius); padding: 22px; }
.side-box h3 { font-size: 1rem; text-transform: uppercase; letter-spacing: .06em; border-bottom: 2px solid var(--gold); padding-bottom: 8px; margin-bottom: 10px; }
.side-box ul { list-style: none; margin: 0; padding: 0; }
.side-box li a { display: block; padding: 7px 0; color: var(--ink); border-bottom: 1px dashed var(--line); }
.side-box li:last-child a { border-bottom: 0; }
.side-box li a:hover, .side-box li.on a { color: var(--blue); padding-left: 6px; }
.side-box li.on a { font-weight: 600; }
.gov-box { background: linear-gradient(140deg, var(--blue-dark), var(--blue)); color: #fff; }
.gov-box h3 { color: #fff; }
.gov-box p { color: #DCE5F5; font-size: .95rem; }
.gov-box .btn { background: var(--gold); border-color: var(--gold); color: var(--navy); padding: 9px 20px; }

.pager { display: flex; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding-top: 18px; flex-wrap: wrap; }

/* downloads */
.doc-list { list-style: none; padding: 0 !important; display: grid; gap: 10px; }
.doc-list a { display: flex; align-items: center; gap: 14px; padding: 14px 16px; background: var(--bg-alt); border-radius: 8px; color: var(--ink); border-left: 4px solid var(--blue); }
.doc-list a:hover { border-left-color: var(--gold); color: var(--blue); }
.doc-ic { background: #C0392B; color: #fff; font-size: .7rem; font-weight: 700; padding: 4px 7px; border-radius: 4px; }

/* contact */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px; margin: 20px 0 30px; }
.contact-card { background: var(--bg-alt); padding: 22px; border-radius: var(--radius); border-top: 4px solid var(--gold); }
.contact-card h3 { margin: 8px 0 4px; font-size: 1.05rem; }
.contact-card p { margin: 0; color: var(--muted); }
.c-ic { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 1.1rem; }
.contact-form { display: grid; gap: 14px; max-width: 720px; }
.contact-form label { display: grid; gap: 6px; font-weight: 500; font-size: .95rem; }
.contact-form input, .contact-form select, .contact-form textarea {
  font: inherit; padding: 11px 14px; border: 1px solid #CBD2DE; border-radius: 8px; background: #fff; width: 100%;
}
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus { outline: 2px solid var(--blue); border-color: transparent; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.note { font-size: .85rem; color: var(--muted); margin: 0; }

/* gallery */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin: 16px 0 26px; }
.g-item { display: block; aspect-ratio: 1; overflow: hidden; border-radius: 8px; background: var(--bg-alt); }
.g-item img { width: 100%; height: 100%; object-fit: cover; margin: 0 !important; border-radius: 0 !important; transition: transform .35s; }
.g-item:hover img { transform: scale(1.07); }
.lightbox { position: fixed; inset: 0; background: rgba(8,16,32,.94); z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 50px 60px; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 6px; }
.lightbox button { position: absolute; background: none; border: 0; color: #fff; font-size: 2.6rem; cursor: pointer; line-height: 1; padding: 10px; }
.lightbox button:hover { color: var(--gold); }
.lb-close { top: 10px; right: 16px; } .lb-prev { left: 10px; top: 50%; transform: translateY(-50%); } .lb-next { right: 10px; top: 50%; transform: translateY(-50%); }

/* ---------- footer ---------- */
.site-footer { background: var(--navy); color: #B9C6E0; padding-top: 60px; font-size: .95rem; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 36px; padding-bottom: 44px; }
.site-footer h4 { color: #fff; font-size: 1.02rem; margin-bottom: 14px; }
.site-footer h4.mt { margin-top: 22px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: #B9C6E0; }
.site-footer a:hover { color: var(--gold); }
.f-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.f-brand img { width: 56px; background: #fff; border-radius: 8px; padding: 4px; }
.f-brand span { color: #fff; font-size: 1.5rem; font-weight: 700; letter-spacing: .04em; }
.f-motto { color: var(--gold); font-style: italic; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 18px 0; font-size: .85rem; text-align: center; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .nav-toggle { display: block; }
  .nav-bar { border-bottom-width: 3px; }
  .nav-bar .container { padding: 0; }
  .main-nav { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
  .main-nav.open { max-height: 75vh; overflow-y: auto; }
  .menu { flex-direction: column; align-items: stretch; padding: 4px 16px 12px; gap: 0; }
  .menu > li { flex-wrap: wrap; border-bottom: 1px solid rgba(255,255,255,.12); }
  .menu > li.active { box-shadow: none; }
  .menu > li > a, .menu > li > .nav-label { flex: 1; padding: 13px 4px; }
  .sub-toggle { margin: 0; padding: 10px 14px; font-size: 1rem; color: #fff; }
  .has-sub .sub { background: transparent; }
  .has-sub .sub a { color: #DCE5F5; }
  .has-sub .sub a:hover { background: rgba(255,255,255,.08); color: var(--gold); }
  .sub { position: static; width: 100%; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; display: none; padding: 0 0 8px 12px; }
  .has-sub.open > .sub { display: block; }
  .has-sub:hover > .sub { display: none; }
  .has-sub.open:hover > .sub { display: block; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .with-side { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .welcome-grid { grid-template-columns: 1fr; gap: 30px; }
  .section { padding: 50px 0; }
  .brand img { width: 48px; }
  .brand-text strong { font-size: .95rem; }
  .brand-text em { display: none; }
  .header-inner { min-height: 70px; }
  .tb-links { display: none; }
  .slide-cap { padding: 40px 18px 34px; }
  .slide-cap p { display: none; }
  .sl-prev, .sl-next { width: 36px; height: 36px; font-size: 1.4rem; }
  .motto-card { grid-template-columns: 1fr; text-align: center; }
  .motto-card img { width: 110px; margin: 0 auto; }
  .row2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .lightbox { padding: 50px 10px; }
}
.official .bio { list-style: none; margin: 12px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); text-align: left; font-size: .84rem; color: var(--muted); line-height: 1.5; }
.official .bio li { margin-bottom: 6px; }
.official .bio li:first-child { font-weight: 600; color: var(--ink); }
@media (max-width: 520px) {
  .officials-grid { gap: 12px; }
  .official { flex: 0 1 calc(50% - 6px); padding: 16px 10px; }
  .official .photo { width: 96px; height: 96px; border-width: 3px; }
  .official h3 { font-size: .92rem; }
  .official p { font-size: .8rem; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}
/* portraits: keep heads in frame */
.card-img img { object-position: center 25%; }
.portraits .card-img { aspect-ratio: 1 / 1; }
.portraits .card-img img { object-position: center top; }
.official .photo img { object-position: center top; }
