/* CSIR-NIES Official Website — Main Styles */
:root {
  --navy: #0c2340;
  --blue: #1a4480;
  --gold: #b8860b;
  --paper: #f4f7fb;
  --ink: #1a1a1a;
  --font: "Segoe UI", system-ui, Arial, sans-serif;
  --font-hi: "Nirmala UI", "Mangal", sans-serif;
  --max: 1200px;
  --header-h: auto;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); }
a:hover { color: var(--navy); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 9999;
  background: var(--navy); color: #fff; padding: 8px 16px;
}
.skip-link:focus { left: 0; }

/* Top bar */
.top-bar {
  background: var(--navy);
  color: #fff;
  font-size: 0.8rem;
  padding: 6px 0;
}
.top-bar .inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.top-bar a { color: #e2e8f0; text-decoration: none; }
.top-bar a:hover { color: #fff; text-decoration: underline; }
.top-bar .gov-hi { font-family: var(--font-hi); }

/* Site header — emblem | dept | logo */
.site-header {
  background: #fff;
  border-bottom: 3px solid var(--gold);
  box-shadow: 0 2px 12px rgba(12,35,64,0.08);
}
.header-brand {
  max-width: var(--max);
  margin: 0 auto;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 88px 1fr 88px;
  align-items: center;
  gap: 12px;
}
.header-brand .logo-slot { display: flex; align-items: center; justify-content: center; }
.header-brand .logo-slot--left { justify-content: flex-start; }
.header-brand .logo-slot--right { justify-content: flex-end; }
.header-brand .logo-emblem { height: 76px; width: auto; max-width: 80px; object-fit: contain; }
.header-brand .logo-org { height: 76px; width: auto; max-width: 84px; object-fit: contain; }
.header-dept { text-align: center; min-width: 0; }
.header-dept .line-main {
  font-size: clamp(0.75rem, 2.2vw, 1rem);
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  line-height: 1.3;
  margin: 0 0 4px;
}
.header-dept .line-sub {
  font-size: clamp(0.7rem, 1.8vw, 0.9rem);
  font-weight: 700;
  color: var(--blue);
  margin: 0;
  line-height: 1.35;
}
.header-meta {
  text-align: center;
  padding: 8px 16px 12px;
  font-size: 0.85rem;
  color: #475569;
  border-top: 1px solid #e2e8f0;
}
.header-meta .tagline { font-family: var(--font-hi), var(--font); color: var(--blue); margin: 4px 0 0; }

/* Nav */
.nav-wrap {
  background: linear-gradient(90deg, var(--navy), var(--blue));
}
.main-nav {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}
.nav-toggle {
  display: none;
  background: transparent;
  border: 2px solid #fff;
  color: #fff;
  padding: 8px 12px;
  font-size: 0.9rem;
  cursor: pointer;
  margin: 8px 0;
  border-radius: 2px;
}
.nav-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  align-items: stretch;
}
.nav-menu > li { list-style: none; margin: 0; padding: 0; }
.nav-menu a {
  display: block;
  padding: 14px 16px;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  border-bottom: 3px solid transparent;
}
.nav-menu a:hover,
.nav-menu a[aria-current="page"] {
  background: rgba(255,255,255,0.12);
  border-bottom-color: var(--gold);
}
.nav-apply {
  background: var(--gold) !important;
  color: var(--navy) !important;
  font-weight: 700 !important;
}
.nav-apply:hover { background: #d4a017 !important; }

/* Govt. homepage — tricolor accent strip */
.gov-tricolor {
  height: 4px;
  background: linear-gradient(90deg, #ff9933 33.33%, #ffffff 33.33%, #ffffff 66.66%, #138808 66.66%);
  border: none;
  margin: 0;
}

/* Hero — institutional (non-recruitment) */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 55%, #2c5282 100%);
  color: #fff;
  padding: 40px 16px 48px;
}
.hero--gov {
  position: relative;
  padding: 36px 16px 40px;
  text-align: center;
}
.hero--gov::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #ff9933, #fff 45%, #fff 55%, #138808);
}
.hero--gov h1 { max-width: 900px; margin-left: auto; margin-right: auto; }
.hero--gov .lead { max-width: 800px; margin-left: auto; margin-right: auto; }
.hero-satya {
  font-family: var(--font-hi), var(--font);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold);
  margin: 16px 0 0;
  letter-spacing: 0.02em;
}

/* Leadership & vichar — CSIR / GoI portal style */
.section--leadership {
  background: linear-gradient(180deg, #fff 0%, var(--paper) 100%);
  border-top: 3px solid var(--gold);
  border-bottom: 3px solid var(--navy);
}
.leadership-intro {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 28px;
  font-size: 0.95rem;
  color: #475569;
}
.leadership-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
}
.leader-card {
  background: #fff;
  border: 1px solid #cbd5e1;
  box-shadow: 0 4px 18px rgba(12, 35, 64, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 2px;
}
.leader-card--featured {
  border-color: var(--gold);
  box-shadow: 0 6px 24px rgba(184, 134, 11, 0.2);
}
.leader-photo-wrap {
  background: #f1f5f9;
  padding: 16px;
  text-align: center;
  border-bottom: 2px solid var(--navy);
}
.leader-photo {
  width: 140px;
  height: 168px;
  object-fit: cover;
  object-position: top center;
  margin: 0 auto;
  border: 3px solid #fff;
  outline: 2px solid var(--gold);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}
.leader-body { padding: 16px 18px 20px; flex: 1; display: flex; flex-direction: column; }
.leader-name {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.3;
}
.leader-role {
  margin: 0 0 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.4;
}
.leader-vichar {
  margin: 0;
  padding: 12px 14px;
  background: #f8fafc;
  border-left: 4px solid var(--gold);
  font-size: 0.9rem;
  line-height: 1.55;
  color: #334155;
  font-style: italic;
  flex: 1;
}
.leader-vichar-hi {
  display: block;
  margin-top: 10px;
  font-family: var(--font-hi), var(--font);
  font-style: normal;
  font-weight: 600;
  color: var(--navy);
  font-size: 0.88rem;
}
.gov-pillars {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 8px;
}
.gov-pillar {
  background: #fff;
  border: 1px solid #cbd5e1;
  padding: 16px;
  text-align: center;
  border-top: 3px solid var(--navy);
}
.gov-pillar strong { display: block; color: var(--navy); margin-bottom: 6px; font-size: 0.95rem; }
.gov-pillar span { font-size: 0.85rem; color: #64748b; }

.hero .inner { max-width: var(--max); margin: 0 auto; }
.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(1.35rem, 4vw, 2rem);
  line-height: 1.25;
}
.hero .lead { font-size: 1.05rem; opacity: 0.95; max-width: 720px; margin-bottom: 20px; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 24px; }
.hero-badge {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.35);
  padding: 6px 12px;
  font-size: 0.85rem;
  border-radius: 2px;
}
.btn {
  display: inline-block;
  padding: 12px 24px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 2px;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
}
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: #d4a017; color: var(--navy); }
.btn-outline-light {
  background: transparent;
  color: #fff;
  border: 2px solid #fff;
  margin-left: 10px;
}
.btn-outline-light:hover { background: rgba(255,255,255,0.15); color: #fff; }

/* Layout sections */
.section { padding: 40px 16px; }
.section--alt { background: #fff; }
.section .inner { max-width: var(--max); margin: 0 auto; }
.section-title {
  margin: 0 0 20px;
  font-size: 1.35rem;
  color: var(--navy);
  border-left: 4px solid var(--gold);
  padding-left: 12px;
}
.section-title span { display: block; font-size: 0.85rem; color: #64748b; font-weight: 400; margin-top: 4px; }

/* Quick links grid — CSIR style */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
.quick-card {
  background: #fff;
  border: 1px solid #cbd5e1;
  padding: 18px 14px;
  text-align: center;
  text-decoration: none;
  color: var(--navy);
  transition: box-shadow 0.2s, border-color 0.2s;
  border-radius: 2px;
}
.quick-card:hover {
  border-color: var(--blue);
  box-shadow: 0 4px 14px rgba(26,68,128,0.15);
  color: var(--blue);
}
.quick-card strong { display: block; font-size: 0.95rem; margin-top: 8px; }

/* News list */
.news-list { list-style: none; padding: 0; margin: 0; }
.news-list li {
  border-bottom: 1px solid #e2e8f0;
  padding: 14px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: flex-start;
}
.news-list .badge-new {
  background: #dc2626;
  color: #fff;
  font-size: 0.7rem;
  padding: 2px 8px;
  font-weight: 700;
  text-transform: uppercase;
}
.news-list a { font-weight: 600; text-decoration: none; flex: 1; min-width: 200px; }

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.card {
  background: #fff;
  border: 1px solid #cbd5e1;
  padding: 20px;
  border-radius: 2px;
}
.card h3 { margin: 0 0 10px; color: var(--navy); font-size: 1.1rem; }

/* Tables */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 16px 0;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
}
table.data-table {
  min-width: 520px;
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: #fff;
}
table.data-table th, table.data-table td {
  border: 1px solid #94a3b8;
  padding: 10px 12px;
  text-align: left;
}
table.data-table th {
  background: var(--navy);
  color: #fff;
  font-weight: 600;
}
table.data-table tr:nth-child(even) { background: #f8fafc; }
table.data-table .center { text-align: center; }

/* Breadcrumb */
.breadcrumb {
  max-width: var(--max);
  margin: 0 auto;
  padding: 12px 16px;
  font-size: 0.85rem;
}
.breadcrumb ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumb li + li::before { content: "›"; margin-right: 6px; color: #94a3b8; }
.breadcrumb a { text-decoration: none; }

/* FAQ */
.faq-item { margin-bottom: 12px; border: 1px solid #cbd5e1; background: #fff; }
.faq-item summary {
  padding: 14px 16px;
  font-weight: 700;
  color: var(--navy);
  cursor: pointer;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item .faq-body { padding: 0 16px 14px; font-size: 0.95rem; }

/* Footer */
.site-footer {
  background: var(--navy);
  color: #e2e8f0;
  padding: 32px 16px 16px;
  font-size: 0.85rem;
}
.footer-grid {
  max-width: var(--max);
  margin: 0 auto 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
}
.site-footer h3 { color: #fff; font-size: 1rem; margin: 0 0 12px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer a { color: #cbd5e1; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-bottom {
  max-width: var(--max);
  margin: 0 auto;
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.2);
  text-align: center;
  color: #94a3b8;
}

/* Page content */
.page-content { padding: 24px 16px 48px; }
.page-content .inner { max-width: var(--max); margin: 0 auto; }
.page-content h1 { color: var(--navy); margin-top: 0; font-size: 1.75rem; }
.page-content h2 { color: var(--blue); font-size: 1.2rem; margin-top: 28px; }
.alert-box {
  background: #eff6ff;
  border-left: 4px solid var(--blue);
  padding: 14px 16px;
  margin: 20px 0;
}
.dates-box {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  padding: 16px;
  margin: 20px 0;
}
.dates-box dt { font-weight: 700; color: var(--navy); }
.dates-box dd { margin: 4px 0 12px 0; }

/* Breadcrumb */
.breadcrumb {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  font-size: 0.85rem;
}
.breadcrumb ol,
.breadcrumb .inner ol {
  max-width: var(--max);
  margin: 0 auto;
  padding: 10px 16px;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.breadcrumb a { color: var(--blue); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb li[aria-current="page"] { color: #64748b; font-weight: 600; }

/* Recruitment nav submenu */
.nav-item-has-sub { position: relative; list-style: none; }
.nav-parent {
  background: transparent;
  border: none;
  color: #fff;
  font: inherit;
  font-weight: 600;
  padding: 14px 16px;
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-caret { font-size: 0.7rem; }
.nav-submenu {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0;
  background: #0f2744;
}
.nav-submenu li { list-style: none; }
.nav-submenu a {
  display: block;
  padding: 12px 20px;
  font-size: 0.88rem;
  font-weight: 500;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  min-height: 44px;
}
.nav-toggle-icon {
  display: inline-block;
  width: 18px;
  height: 2px;
  background: #fff;
  position: relative;
  vertical-align: middle;
  margin-right: 8px;
}
.nav-toggle-icon::before,
.nav-toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: #fff;
}
.nav-toggle-icon::before { top: -6px; }
.nav-toggle-icon::after { top: 6px; }
.top-bar-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: center;
}
.top-bar-links a { white-space: nowrap; }
body.nav-open { overflow: hidden; }

@media (min-width: 769px) {
  .nav-item-has-sub { display: inline-block; }
  .nav-parent { width: auto; }
  .nav-submenu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 50;
    min-width: 240px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.28);
    border-radius: 0 0 4px 4px;
  }
  /* Desktop: submenu only while hovering or keyboard focus — closes when pointer leaves */
  .nav-item-has-sub:hover .nav-submenu,
  .nav-item-has-sub:focus-within .nav-submenu { display: block; }
  .nav-item-has-sub:hover .nav-parent,
  .nav-item-has-sub:focus-within .nav-parent,
  .nav-item-has-sub.nav-recruitment-active > .nav-parent {
    background: rgba(255,255,255,0.12);
    border-bottom-color: var(--gold);
  }
  .nav-item-has-sub.is-open .nav-submenu { display: none; }
}

/* Vacancy status */
.vacancy-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 3px;
  margin-right: 4px;
  vertical-align: middle;
}
.vacancy-badge--open { background: #16a34a; color: #fff; }
.vacancy-badge--closed { background: #b91c1c; color: #fff; }
.vacancy-open-card {
  border: 2px solid #16a34a;
  background: linear-gradient(135deg, #f0fdf4 0%, #fff 100%);
  padding: 20px;
  margin: 20px 0;
  border-radius: 4px;
}
.vacancy-closed-row { background: #fef2f2; }
.vacancy-closed-row td { color: #7f1d1d; }
.status-closed {
  display: inline-block;
  background: #b91c1c;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.status-open {
  display: inline-block;
  background: #16a34a;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 3px;
}
.footer-address {
  margin: 0 0 12px;
  line-height: 1.6;
  font-size: 0.9rem;
}
.footer-address strong { color: #fff; }
.recruitment-hub-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 24px;
}
.recruitment-hub-nav a {
  padding: 10px 14px;
  background: var(--navy);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 4px;
}
.recruitment-hub-nav a:hover { background: var(--blue); color: #fff; }
.recruitment-hub-nav a.is-active { background: var(--gold); color: var(--navy); }

/* Desktop-only UI (accessibility toolbar, e-Gov strip, language, etc.) */
.desktop-only { display: block; }

/* Mobile & tablet */
@media (max-width: 768px) {
  .desktop-only,
  .gov-access-bar,
  .gov-egov-strip,
  .gov-lang-banner,
  .section--egov-services,
  .quick-card--accessibility,
  .top-bar a[href*="accessibility"] {
    display: none !important;
  }
  .header-brand {
    grid-template-columns: 56px 1fr 56px;
    padding: 10px 12px;
    gap: 8px;
  }
  .header-brand .logo-emblem,
  .header-brand .logo-org { height: 52px; max-width: 56px; }
  .header-meta { font-size: 0.78rem; padding: 8px 12px; }
  .top-bar .inner { flex-direction: column; align-items: flex-start; gap: 6px; }
  .top-bar-links { font-size: 0.75rem; }
  .main-nav {
    flex-direction: column;
    align-items: stretch;
    padding: 0 12px 8px;
  }
  .nav-toggle {
    display: flex;
    align-items: center;
    width: 100%;
    justify-content: center;
    min-height: 44px;
    margin: 8px 0 0;
  }
  .nav-menu {
    display: none;
    flex-direction: column;
    width: 100%;
    padding: 0 0 8px;
    max-height: min(70vh, 520px);
    overflow-y: auto;
  }
  .nav-menu.is-open { display: flex; }
  .nav-menu > li { width: 100%; list-style: none; }
  .nav-menu > li > a,
  .nav-item-has-sub .nav-parent {
    width: 100%;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    min-height: 48px;
  }
  .nav-item-has-sub { width: 100%; }
  .nav-item-has-sub.is-open .nav-submenu { display: block; }
  .nav-submenu {
    position: static;
    box-shadow: none;
    background: #081a30;
  }
  .nav-submenu a { padding-left: 28px; }
  .nav-apply { text-align: center; margin-top: 4px; }
  .btn, .btn-gold, .btn-outline-light {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
  }
  .btn-outline-light { margin-left: 0; margin-top: 10px; width: 100%; max-width: 320px; }
  .hero { padding: 28px 16px 36px; }
  .hero--gov h1 { font-size: 1.25rem; }
  .section-title { font-size: 1.15rem; }
  .leader-photo { width: 120px; height: 144px; }
  .leadership-grid { grid-template-columns: 1fr; }
  .quick-grid { grid-template-columns: 1fr; }
  .gov-service-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 20px; }
  .recruitment-hub-nav { flex-direction: column; }
  .recruitment-hub-nav a { width: 100%; text-align: center; min-height: 44px; }
  .page-content h1 { font-size: 1.45rem; }
  .gov-ticker-wrap .inner { flex-direction: column; align-items: stretch; }
  .top-bar-links { gap: 4px 8px; }
}

@media (max-width: 480px) {
  .header-dept .line-main { font-size: 0.68rem; }
  .header-dept .line-sub { font-size: 0.62rem; }
}

@media print {
  .top-bar, .nav-wrap, .skip-link, .btn { display: none !important; }
  .site-header { box-shadow: none; }
}
