/* ═══════════════════════════════════════════
   KCES ENHANCED CSS — Logo, Gallery, News,
   Security UI improvements
═══════════════════════════════════════════ */

/* ── LOGO IMAGE ── */
.logo-img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  flex-shrink: 0;
  transition: transform .2s;
}
.logo-block:hover .logo-img { transform: scale(1.05); }
.logo-text .school-name {
  font-family: 'Playfair Display', serif;
  font-size: 17px; font-weight: 700;
  color: var(--green-dark);
  line-height: 1.2;
}

/* ── PRINCIPAL QUOTE PHOTO ── */
.principal-quote-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  max-width: 900px;
  margin: 0 auto;
  flex-wrap: wrap;
  justify-content: center;
}
.principal-quote-photo {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(255,255,255,.4);
  flex-shrink: 0;
}

/* ── NEWS FILTER TABS ── */
.news-filter-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.nf-tab {
  padding: 8px 20px;
  border-radius: 30px;
  border: 2px solid var(--border);
  background: transparent;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all .2s;
}
.nf-tab:hover { border-color: var(--green); color: var(--green); }
.nf-tab.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

/* ── NEWS CARDS IMPROVED ── */
.news-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: transform .25s, box-shadow .25s;
  display: flex;
  flex-direction: column;
}
.news-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(0,0,0,.12);
}
.news-img-wrap {
  position: relative;
  overflow: hidden;
  height: 200px;
}
.news-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s;
}
.news-card:hover .news-img-wrap img { transform: scale(1.06); }
.news-badge {
  position: absolute;
  top: 12px; left: 12px;
  background: var(--green);
  color: #fff;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.news-badge.event { background: var(--gold); }
.news-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.news-body h4 {
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.4;
}
.news-body p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.65;
  flex: 1;
  margin-bottom: 12px;
}
.news-date {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}
.news-read-more {
  font-size: 13px;
  font-weight: 600;
  color: var(--green);
  transition: color .2s;
}
.news-read-more:hover { color: var(--green-dark); }

/* ── GALLERY PREVIEW GRID ── */
.gallery-preview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: auto auto;
  gap: 12px;
}
.gp-item {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  cursor: pointer;
  aspect-ratio: 1;
}
.gp-item.gp-large {
  grid-column: span 2;
  grid-row: span 2;
  aspect-ratio: auto;
}
.gp-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s;
  display: block;
}
.gp-item:hover img { transform: scale(1.08); }
.gp-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.6) 0%, transparent 60%);
  display: flex;
  align-items: flex-end;
  padding: 14px;
  opacity: 0;
  transition: opacity .3s;
}
.gp-item:hover .gp-overlay { opacity: 1; }
.gp-overlay span {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

/* ── LIGHTBOX ── */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.92);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}
.lightbox.active { display: flex; }
.lightbox img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 60px rgba(0,0,0,.6);
}
.lb-close {
  position: absolute;
  top: 20px; right: 24px;
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  font-size: 24px;
  width: 44px; height: 44px;
  border-radius: 50%;
  cursor: pointer;
  transition: background .2s;
  display: flex; align-items: center; justify-content: center;
}
.lb-close:hover { background: rgba(255,255,255,.3); }
.lb-prev, .lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  font-size: 36px;
  width: 52px; height: 52px;
  border-radius: 50%;
  cursor: pointer;
  transition: background .2s;
  display: flex; align-items: center; justify-content: center;
}
.lb-prev { left: 20px; }
.lb-next { right: 20px; }
.lb-prev:hover, .lb-next:hover { background: rgba(255,255,255,.3); }
.lb-caption {
  color: rgba(255,255,255,.8);
  font-size: 14px;
  margin-top: 14px;
}

/* ── GALLERY PAGE FULL ── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  aspect-ratio: 4/3;
  cursor: pointer;
  background: var(--green-light);
}
.gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s;
}
.gallery-item:hover img { transform: scale(1.07); }
.gallery-item .gp-overlay { opacity: 0; transition: opacity .3s; }
.gallery-item:hover .gp-overlay { opacity: 1; }

/* ── NEWS PAGE IMPROVED ── */
.news-page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .gallery-preview-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .gp-item.gp-large {
    grid-column: span 2;
    aspect-ratio: 16/9;
  }
  .principal-quote-inner { flex-direction: column; text-align: center; }
  .lb-prev { left: 8px; }
  .lb-next { right: 8px; }
}
@media (max-width: 480px) {
  .gallery-preview-grid { grid-template-columns: 1fr 1fr; }
  .gp-item.gp-large { grid-column: span 2; }
}

/* ═══════════════════════════════════════════
   ENHANCED CSS — Part 2
   About Timeline, Portal, 404, Profile Cards,
   Animations, Accessibility
═══════════════════════════════════════════ */

/* ── SKIP LINK (Accessibility) ── */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--green-dark);
  color: #fff;
  padding: 8px 16px;
  z-index: 10000;
  border-radius: 0 0 6px 0;
  transition: top .2s;
  font-size: 14px;
}
.skip-link:focus { top: 0; }

/* ── TIMELINE ── */
.timeline {
  position: relative;
  padding-left: 36px;
  margin-top: 8px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 10px; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--green), var(--gold));
}
.tl-item {
  position: relative;
  margin-bottom: 32px;
}
.tl-item::before {
  content: '';
  position: absolute;
  left: -30px; top: 6px;
  width: 14px; height: 14px;
  background: var(--green);
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--green);
}
.tl-year {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.tl-title {
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--green-dark);
  margin-bottom: 4px;
}
.tl-desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.65;
}

/* ── STAT COUNTERS ── */
.stats-band {
  background: var(--green-dark);
  color: #fff;
  padding: 48px 0;
}
.stats-band-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
  padding: 0 24px;
}
.stat-box .num {
  font-family: 'Playfair Display', serif;
  font-size: 44px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}
.stat-box .label {
  font-size: 13px;
  color: rgba(255,255,255,.7);
  margin-top: 6px;
}
@media (max-width: 640px) {
  .stats-band-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── PORTAL LOGIN PAGE ── */
.portal-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  box-shadow: 0 4px 40px rgba(0,0,0,.08);
  max-width: 460px;
  margin: 0 auto;
}
.portal-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  color: var(--green-dark);
  margin-bottom: 4px;
}
.portal-card .portal-sub {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 28px;
}
.portal-tabs {
  display: flex;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 28px;
}
.portal-tab-btn {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  color: var(--muted);
  transition: all .2s;
}
.portal-tab-btn.active {
  background: var(--green);
  color: #fff;
}
.portal-notice {
  background: var(--green-light);
  border: 1px solid rgba(26,107,60,.15);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 13px;
  color: var(--green-dark);
  margin-top: 20px;
  line-height: 1.6;
}

/* ── 404 PAGE ── */
.page-404 {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex-direction: column;
  padding: 80px 24px;
}
.page-404 .err-code {
  font-family: 'Playfair Display', serif;
  font-size: 120px;
  font-weight: 700;
  color: var(--green-light);
  line-height: 1;
  letter-spacing: -4px;
}
.page-404 h2 {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  color: var(--green-dark);
  margin: -16px 0 16px;
}
.page-404 p {
  color: var(--muted);
  font-size: 15px;
  max-width: 420px;
  margin: 0 auto 28px;
}

/* ── PROFILE CARD IMPROVEMENTS ── */
.profile-wrap {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 48px;
  align-items: start;
}
.profile-photo-box {
  position: relative;
}
.profile-photo-box img {
  width: 100%;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,.15);
}
.profile-photo-box::after {
  content: '';
  position: absolute;
  inset: -6px;
  border: 2px solid var(--green-light);
  border-radius: 20px;
  z-index: -1;
}
.profile-name {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--green-dark);
}
.profile-title {
  font-size: 13px;
  color: var(--green);
  font-weight: 600;
  margin-top: 4px;
}
.profile-msg p {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.9;
  margin-bottom: 16px;
}
.profile-sig {
  font-family: 'Playfair Display', serif !important;
  font-size: 17px !important;
  font-style: italic;
  color: var(--green-dark) !important;
  margin-top: 24px !important;
}
@media (max-width: 768px) {
  .profile-wrap { grid-template-columns: 1fr; }
  .profile-photo-box { max-width: 200px; margin: 0 auto; }
}

/* ── SCROLL REVEAL ANIMATION ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── FLOATING ADMISSION BANNER ── */
.admission-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--green);
  color: #fff;
  padding: 14px 22px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 8px 32px rgba(26,107,60,.35);
  z-index: 900;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background .2s, transform .2s;
  animation: floatPulse 2.5s ease-in-out infinite;
}
.admission-float:hover {
  background: var(--green-dark);
  transform: scale(1.05);
}
.admission-float .af-close {
  margin-left: 8px;
  opacity: .7;
  cursor: pointer;
  background: none;
  border: none;
  color: #fff;
  font-size: 16px;
  padding: 0;
  line-height: 1;
}
@keyframes floatPulse {
  0%, 100% { box-shadow: 0 8px 32px rgba(26,107,60,.35); }
  50% { box-shadow: 0 12px 40px rgba(26,107,60,.55); }
}

/* ── PRINT STYLES ── */
@media print {
  .ticker, .topbar, .hamburger, .mobile-menu, footer,
  .btn-apply, .btn-submit, .admission-float { display: none !important; }
  body { font-size: 12pt; }
  .container { max-width: 100%; }
}
