/* ===================================================================
   Ranaviru IT — Design tokens
   Palette: deep blue (authority/Army), sky blue (technology), green
   (growth/certification). Signature motif: a tri-colour "ribbon bar"
   echoing a military service ribbon — used as a recurring divider.
   =================================================================== */
:root {
  --deep-blue: #0b2d52;
  --deep-blue-dark: #071c34;
  --sky-blue: #2ea1db;
  --sky-blue-light: #eaf6fd;
  --green: #1f8a55;
  --green-dark: #156b41;
  --ink: #16263b;
  --muted: #5c6b7a;
  --paper: #fbfcfe;
  --line: #e1e9f0;
  --white: #ffffff;

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

  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px -12px rgba(11, 45, 82, 0.25);
  --shadow-sm: 0 4px 14px -6px rgba(11, 45, 82, 0.18);
  --container: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  font-size: 16px;
}
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  color: var(--deep-blue);
  line-height: 1.25;
  margin: 0 0 0.5em;
  font-weight: 700;
}
h1 { font-size: clamp(2rem, 4vw, 2.85rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
a { color: var(--sky-blue); text-decoration: none; }
a:hover { color: var(--deep-blue); }
img { max-width: 100%; display: block; }
ul { padding-left: 1.2em; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Signature: tri-colour ribbon bar ---------- */
.ribbon-bar {
  height: 5px;
  width: 100%;
  background: linear-gradient(90deg, var(--deep-blue) 0 33.3%, var(--sky-blue) 33.3% 66.6%, var(--green) 66.6% 100%);
}
.ribbon-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--deep-blue);
}
.ribbon-chip::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 8px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--deep-blue) 0 33.3%, var(--sky-blue) 33.3% 66.6%, var(--green) 66.6% 100%);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0.7em 1.5em;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, color .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-green { background: var(--green); color: var(--white); }
.btn-green:hover { background: var(--green-dark); color: var(--white); box-shadow: var(--shadow-sm); }
.btn-sky { background: var(--sky-blue); color: var(--white); }
.btn-sky:hover { background: #2387b9; color: var(--white); }
.btn-outline { background: transparent; border-color: rgba(255,255,255,.55); color: var(--white); }
.btn-outline:hover { background: rgba(255,255,255,.12); color: var(--white); }
.btn-outline-blue { background: transparent; border-color: var(--deep-blue); color: var(--deep-blue); }
.btn-outline-blue:hover { background: var(--deep-blue); color: var(--white); }
.btn-sm { padding: 0.45em 1.1em; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn-danger { background: #c0392b; color: var(--white); }
.btn-ghost { background: var(--sky-blue-light); color: var(--deep-blue); }

/* ---------- Navbar ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--white); box-shadow: 0 2px 12px -6px rgba(11,45,82,.15); }
.navbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; max-width: var(--container); margin: 0 auto; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--deep-blue); }
.brand img { height: 46px; width: 46px; }
.brand-text { line-height: 1.15; }
.brand-text strong { font-family: var(--font-display); font-size: 1.05rem; display: block; color: var(--deep-blue); }
.brand-text span { font-size: 0.72rem; color: var(--muted); letter-spacing: .03em; }

.nav-toggle { display: none; background: none; border: none; font-size: 1.6rem; color: var(--deep-blue); cursor: pointer; }

.nav-links { display: flex; align-items: center; gap: 26px; list-style: none; margin: 0; padding: 0; font-weight: 600; font-size: .93rem; }
.nav-links > li { position: relative; }
.nav-links > li > a { color: var(--ink); padding: 8px 2px; }
.nav-links > li > a:hover, .nav-links > li.active > a { color: var(--sky-blue); }
.nav-links .dropdown { display: none; position: absolute; top: 100%; left: -16px; background: var(--white); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 8px; min-width: 220px; list-style: none; margin: 0; }
.nav-links li:hover .dropdown { display: block; }
.nav-links .dropdown li a { display: block; padding: 9px 12px; border-radius: 6px; color: var(--ink); font-weight: 500; white-space: nowrap; }
.nav-links .dropdown li a:hover { background: var(--sky-blue-light); color: var(--deep-blue); }
.nav-admin-link { display: inline-flex; align-items: center; gap: 6px; color: var(--deep-blue) !important; }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav-links { position: absolute; top: 100%; left: 0; right: 0; background: var(--white); flex-direction: column; align-items: stretch; padding: 10px 20px 20px; gap: 4px; box-shadow: var(--shadow); display: none; }
  .nav-links.open { display: flex; }
  .nav-links > li > a { display: block; padding: 12px 4px; border-bottom: 1px solid var(--line); }
  .nav-links .dropdown { position: static; box-shadow: none; display: none; padding-left: 12px; }
  .nav-links li.open .dropdown { display: block; }
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--deep-blue) 0%, var(--deep-blue-dark) 100%);
  color: var(--white);
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(800px 400px at 85% 20%, rgba(46,161,219,.25), transparent 60%);
  pointer-events: none;
}
.hero-inner { display: grid; grid-template-columns: 1.25fr 1fr; gap: 50px; align-items: center; padding: 70px 24px 50px; max-width: var(--container); margin: 0 auto; position: relative; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); padding: 6px 14px; border-radius: 999px; font-size: .8rem; font-weight: 600; margin-bottom: 18px; }
.hero h1 { color: var(--white); margin-bottom: 18px; }
.hero p.lead { color: rgba(255,255,255,.85); font-size: 1.08rem; max-width: 540px; margin-bottom: 28px; }
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; }

.badge-stack { display: grid; gap: 14px; }
.cred-badge { display: flex; align-items: center; gap: 14px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); border-radius: var(--radius); padding: 14px 18px; backdrop-filter: blur(2px); }
.cred-badge .icon { width: 42px; height: 42px; border-radius: 10px; background: linear-gradient(135deg, var(--sky-blue), var(--green)); display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 1.2rem; }
.cred-badge strong { display: block; font-family: var(--font-display); font-size: 1.05rem; }
.cred-badge span { font-size: .8rem; color: rgba(255,255,255,.7); }

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; padding-top: 40px; }
}

/* ---------- Notice strip ---------- */
.notice-strip { background: var(--sky-blue-light); border-bottom: 1px solid var(--line); padding: 12px 0; }
.notice-strip .container { display: flex; align-items: center; gap: 12px; }
.notice-strip .tag { background: var(--green); color: var(--white); font-size: .72rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; flex-shrink: 0; letter-spacing: .04em; }
.notice-strip p { margin: 0; font-size: .9rem; color: var(--deep-blue); font-weight: 500; }

/* ---------- Sections ---------- */
section { padding: 64px 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 40px; }
.section-head .eyebrow { color: var(--green); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .78rem; }
.section-head p { color: var(--muted); }
.bg-tint { background: var(--sky-blue-light); }
.bg-deep { background: var(--deep-blue); color: var(--white); }
.bg-deep h2 { color: var(--white); }
.bg-deep .section-head p { color: rgba(255,255,255,.75); }

/* ---------- Grids & cards ---------- */
.grid { display: grid; gap: 26px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; border: 1px solid var(--line); transition: transform .18s ease, box-shadow .18s ease; }
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-top-strip { height: 4px; background: linear-gradient(90deg, var(--deep-blue), var(--sky-blue), var(--green)); }

.course-card .thumb { aspect-ratio: 16/10; overflow: hidden; background: var(--sky-blue-light); }
.course-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.course-card .body { padding: 20px; }
.course-card h3 { margin-bottom: 4px; }
.course-card .sinhala { color: var(--muted); font-size: .85rem; margin-bottom: 10px; display: block; }
.course-card .fees { display: flex; justify-content: space-between; font-size: .82rem; color: var(--muted); border-top: 1px dashed var(--line); margin-top: 14px; padding-top: 12px; }
.course-card .fees strong { color: var(--deep-blue); display: block; font-size: .95rem; }
.nvq-tag { display: inline-block; background: var(--green); color: var(--white); font-size: .7rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; margin-bottom: 8px; letter-spacing: .03em; }

.feature { text-align: center; padding: 28px 20px; }
.feature .icon { width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 16px; background: var(--sky-blue-light); display: flex; align-items: center; justify-content: center; font-size: 1.6rem; color: var(--deep-blue); }
.feature h3 { font-size: 1.05rem; }
.feature p { color: var(--muted); font-size: .92rem; margin: 0; }

.achieve-card { text-align: center; padding: 24px 18px; }
.achieve-card .photo { width: 88px; height: 88px; border-radius: 50%; overflow: hidden; margin: 0 auto 14px; border: 3px solid var(--sky-blue-light); }
.achieve-card .photo img { width: 100%; height: 100%; object-fit: cover; }
.achieve-card .cert { font-size: .75rem; color: var(--green); font-weight: 700; }
.scroll-row { display: flex; gap: 20px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.scroll-row > * { scroll-snap-align: start; flex: 0 0 230px; }

.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.gallery-grid a { aspect-ratio: 1; overflow: hidden; border-radius: var(--radius-sm); }
.gallery-grid img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.gallery-grid a:hover img { transform: scale(1.07); }
@media (max-width: 760px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); } }

.centre-card { padding: 22px; }
.centre-card .main-tag { display: inline-block; background: var(--deep-blue); color: var(--white); font-size: .68rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; margin-bottom: 10px; }
.centre-card h3 { margin-bottom: 6px; }
.centre-card .meta { font-size: .88rem; color: var(--muted); margin-bottom: 4px; display: flex; gap: 8px; }

.article-card .thumb { aspect-ratio: 16/9; overflow: hidden; }
.article-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.article-card .body { padding: 18px 20px; }
.article-card .date { font-size: .78rem; color: var(--green); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }

/* ---------- Forms (public) ---------- */
.form-field { margin-bottom: 18px; }
.form-field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .9rem; color: var(--deep-blue); }
.form-field input, .form-field select, .form-field textarea {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: .95rem; background: var(--white); color: var(--ink);
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { outline: 2px solid var(--sky-blue); border-color: var(--sky-blue); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
@media (max-width: 620px) { .form-grid { grid-template-columns: 1fr; } }

.alert { padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 20px; font-size: .92rem; font-weight: 500; }
.alert-success { background: #e6f6ee; color: var(--green-dark); border: 1px solid #b9e6cd; }
.alert-error { background: #fdecea; color: #a3322a; border: 1px solid #f6c5bf; }
.alert-info { background: var(--sky-blue-light); color: var(--deep-blue); border: 1px solid #cfe9f7; }

/* ---------- Page header (inner pages) ---------- */
.page-header { background: linear-gradient(135deg, var(--deep-blue), var(--deep-blue-dark)); color: var(--white); padding: 48px 0 38px; }
.page-header h1 { color: var(--white); margin-bottom: 6px; }
.breadcrumb { font-size: .85rem; color: rgba(255,255,255,.7); }
.breadcrumb a { color: rgba(255,255,255,.85); }

/* ---------- Footer ---------- */
.site-footer { background: var(--deep-blue-dark); color: rgba(255,255,255,.85); padding: 56px 0 0; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1.6fr; gap: 40px; padding-bottom: 40px; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 { color: var(--white); font-size: .95rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 16px; }
.site-footer a { color: rgba(255,255,255,.75); }
.site-footer a:hover { color: var(--white); }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; font-size: .9rem; }
.centre-mini-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; font-size: .85rem; }
.centre-mini-grid strong { color: var(--white); display: block; margin-bottom: 2px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding: 18px 0; font-size: .82rem; text-align: center; color: rgba(255,255,255,.6); }
.social-row { display: flex; gap: 10px; margin-top: 14px; }
.social-row a { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.1); display: flex; align-items: center; justify-content: center; }
.social-row a:hover { background: var(--sky-blue); }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; background: rgba(7,28,52,.92); display: none; align-items: center; justify-content: center; z-index: 200; padding: 30px; flex-direction: column; }
.lightbox.open { display: flex; }
.lightbox img { max-height: 80vh; max-width: 90vw; border-radius: 8px; box-shadow: var(--shadow); }
.lightbox-caption { color: var(--white); margin-top: 14px; font-size: .9rem; }
.lightbox-close { position: absolute; top: 20px; right: 28px; color: var(--white); font-size: 2rem; background: none; border: none; cursor: pointer; line-height: 1; }

/* ---------- Misc utility ---------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.muted { color: var(--muted); }
.tag-pill { display: inline-block; background: var(--sky-blue-light); color: var(--deep-blue); font-size: .75rem; font-weight: 700; padding: 3px 11px; border-radius: 999px; }
.empty-state { text-align: center; padding: 60px 20px; color: var(--muted); }
.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 10px; top: 10px; background: var(--white); padding: 8px 14px; border-radius: 6px; z-index: 100; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid var(--green); outline-offset: 2px;
}

/* ---------- Homepage image slider ---------- */
.hero { position: relative; overflow: hidden; }

/* Sliding background images */
.slider-bg { position: absolute; inset: 0; z-index: 0; }
.slider-bg-item {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.1s ease;
}
.slider-bg-item.active { opacity: 1; }

/* Dark gradient overlay so text stays readable over any photo */
.hero-overlay {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(
    135deg,
    rgba(7,28,52,.82) 0%,
    rgba(11,45,82,.68) 55%,
    rgba(7,28,52,.58) 100%
  );
  pointer-events: none;
}

/* Keep hero text content above the slider */
.hero .hero-inner { position: relative; z-index: 3; }

/* Prev / Next arrow buttons */
.slider-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  z-index: 4;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: rgba(255,255,255,.15);
  border: 1.5px solid rgba(255,255,255,.35);
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s ease;
}
.slider-arrow:hover { background: rgba(255,255,255,.28); }
.slider-arrow svg { pointer-events: none; }
.slider-prev { left: 18px; }
.slider-next { right: 18px; }
@media (max-width: 600px) {
  .slider-prev { left: 8px; }
  .slider-next { right: 8px; }
  .slider-arrow { width: 36px; height: 36px; }
}

/* Dot indicators */
.slider-dots {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  z-index: 4;
  display: flex; gap: 8px;
}
.slider-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,.38);
  border: 1.5px solid rgba(255,255,255,.55);
  cursor: pointer;
  padding: 0;
  transition: background .2s ease, transform .2s ease;
}
.slider-dot.active {
  background: #fff;
  transform: scale(1.25);
}
