/* ===================================================
   NRLM KSRLPS – Gallery Page Stylesheet
   Matches index.css design system exactly
   =================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400&family=DM+Sans:wght@300;400;500;600&family=Noto+Sans+Kannada:wght@400;500;600;700&display=swap');

/* ── Variables ──────────────────────────────────────── */
:root {
  --saffron:       #FF6B00;
  --saffron-light: #FF9A4A;
  --saffron-faint: #FFF3E8;
  --navy:          #0B2B6B;
  --navy-mid:      #153A8E;
  --green:         #138808;
  --gold:          #C8931A;
  --white:         #FFFFFF;
  --off-white:     #F7F8FC;

  --bg:        var(--off-white);
  --surface:   var(--white);
  --surface-2: #EFF2FA;
  --border:    #D4DCF0;
  --text-1:    #0D1B4B;
  --text-2:    #3A4A72;
  --text-3:    #6B7BAD;

  --util-bg:      var(--navy);
  --util-text:    #B8CAF5;
  --nav-bg:       var(--navy);
  --nav-text:     rgba(255,255,255,0.88);
  --nav-hover-bg: rgba(255,255,255,0.08);

  --footer-bg:      #0A1E4A;
  --footer-text:    #A8BDE8;
  --footer-heading: #FFD166;
  --footer-link:    #7BA3D8;
  --footer-link-h:  var(--gold);

  --t:      0.3s ease;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(11,43,107,0.12);
}

body.dark-theme {
  --bg:        #0E1628;
  --surface:   #162040;
  --surface-2: #1C2A52;
  --border:    #2D3F70;
  --text-1:    #D8E4FF;
  --text-2:    #98B0E0;
  --text-3:    #6880B8;
  --util-bg:   #0A1228;
  --util-text: #6880B8;
  --nav-bg:    #101B38;
  --footer-bg: #060D1C;
  --shadow:    0 4px 24px rgba(0,0,0,0.4);
}

/* ── Reset ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', 'Noto Sans Kannada', sans-serif;
  background: var(--bg);
  color: var(--text-1);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background var(--t), color var(--t);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a   { text-decoration: none; color: inherit; }
ul  { list-style: none; padding: 0; margin: 0; }

/* ── Utility Bar ────────────────────────────────────── */
.utility-bar {
  background: var(--util-bg);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background var(--t);
}
.utility-inner {
  max-width: 1400px; margin: 0 auto; padding: 7px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.gov-badge { font-size: 12px; font-weight: 500; color: rgba(255,255,255,0.6); white-space: nowrap; }
.utility-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.theme-toggle {
  display: flex; align-items: center; gap: 5px; padding: 4px 10px;
  border: 1px solid rgba(255,255,255,0.15); border-radius: 20px;
  cursor: pointer; font-size: 12px; font-weight: 500;
  color: rgba(255,255,255,0.75); background: rgba(255,255,255,0.05);
  transition: var(--t); white-space: nowrap; flex-shrink: 0;
}
.theme-toggle:hover { background: rgba(255,255,255,0.12); color: white; }
.theme-icon { font-size: 13px; }
@media (max-width: 480px) { .gov-badge { display: none; } }

/* ── Header ─────────────────────────────────────────── */
header {
  background: var(--surface);
  box-shadow: var(--shadow);
  position: relative;
  transition: background var(--t), box-shadow var(--t);
}
header::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--saffron) 33.33%, white 33.33% 66.66%, var(--green) 66.66%);
}
.header-grid {
  max-width: 1400px; margin: 0 auto; padding: 20px 24px 16px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
}
.official-card { display: flex; align-items: center; gap: 12px; }
.left-card  { justify-content: flex-end; }
.right-card { justify-content: flex-start; }
.official-photo {
  width: 76px; height: 76px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--border); box-shadow: 0 3px 12px rgba(0,0,0,0.15); flex-shrink: 0;
}
.left-card  .official-photo { border-color: var(--saffron); }
.right-card .official-photo { border-color: var(--green); }
.official-info { display: flex; flex-direction: column; gap: 3px; }
.left-card  .official-info { text-align: right; }
.right-card .official-info { text-align: left; }
.official-role {
  font-size: 11px; font-weight: 500; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.06em; line-height: 1.3;
}
.official-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 17px; font-weight: 700; color: var(--navy); line-height: 1.2;
  transition: color var(--t);
}
body.dark-theme .official-name { color: var(--text-1); }
.header-center { display: flex; justify-content: center; }
.logo-row { display: flex; align-items: center; gap: 14px; }

/* KEY FIX: explicit constraints prevent logo from growing large */
.emblem-img, .sanjivini-logo {
  height: 76px; width: auto; max-width: 80px;
  object-fit: contain; flex-shrink: 0;
}

.mission-identity { text-align: center; }
.mission-acronym {
  font-family: 'Cormorant Garamond', serif;
  font-size: 12px; font-weight: 700; letter-spacing: 0.28em;
  color: var(--saffron); text-transform: uppercase; margin-bottom: 1px;
}
.mission-full {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(15px,2.3vw,21px); font-weight: 700;
  color: var(--navy); line-height: 1.2; white-space: nowrap;
  transition: color var(--t);
}
body.dark-theme .mission-full { color: var(--text-1); }
.mission-divider {
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--saffron), var(--green), transparent);
  margin: 5px auto; width: 80%; border-radius: 2px;
}
.mission-sub {
  font-size: clamp(12px,1.5vw,14px); font-weight: 600; color: var(--navy-mid);
  font-family: 'Noto Sans Kannada','DM Sans',sans-serif; transition: color var(--t);
}
body.dark-theme .mission-sub { color: var(--text-2); }
.mission-org { font-size: 11px; color: var(--text-3); margin-top: 2px; line-height: 1.4; }
.mission-loc {
  display: flex; align-items: center; justify-content: center;
  gap: 5px; font-size: 11px; color: var(--text-3); margin-top: 3px; font-weight: 500;
}
.loc-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green); flex-shrink: 0;
  animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot { 0%,100%{opacity:1;transform:scale(1);}50%{opacity:0.5;transform:scale(0.7);} }

@media (max-width: 860px) {
  .header-grid { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; padding: 14px 14px 12px; gap: 12px 8px; }
  .header-center { grid-column: 1/-1; grid-row: 1; }
  .left-card  { grid-column: 1; grid-row: 2; justify-content: flex-start; }
  .right-card { grid-column: 2; grid-row: 2; justify-content: flex-end; }
  .left-card  .official-info { text-align: left; }
  .right-card .official-info { text-align: right; }
  .official-photo { width: 58px; height: 58px; border-width: 2px; }
  .official-name  { font-size: 13.5px; }
  .official-role  { font-size: 10px; }
  .emblem-img, .sanjivini-logo { height: 58px; max-width: 62px; }
  .logo-row { gap: 10px; }
  .mission-full { white-space: normal; font-size: 15px; }
  .mission-sub  { font-size: 12px; }
  .mission-org, .mission-loc { font-size: 10px; }
}
@media (max-width: 480px) {
  .header-grid { padding: 11px 10px 10px; gap: 10px 6px; }
  .official-photo { width: 46px; height: 46px; }
  .official-name  { font-size: 12px; }
  .official-role  { font-size: 9px; }
  .emblem-img, .sanjivini-logo { height: 46px; max-width: 50px; }
  .mission-full { font-size: 13px; }
}
@media (max-width: 360px) {
  .official-photo { width: 40px; height: 40px; }
  .official-name  { font-size: 11px; }
  .emblem-img, .sanjivini-logo { height: 38px; max-width: 42px; }
  .mission-full { font-size: 12px; }
}

/* ── Navigation ─────────────────────────────────────── */
.navbar {
  background: var(--nav-bg); position: sticky; top: 0; z-index: 200;
  box-shadow: 0 2px 10px rgba(0,0,0,0.25); transition: background var(--t);
}
.hamburger-wrap {
  display: none; padding: 0 16px; height: 48px;
  align-items: center; justify-content: space-between;
}
.hamburger-label { color: rgba(255,255,255,0.65); font-size: 12px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; }
.hamburger {
  display: flex; flex-direction: column; justify-content: space-between;
  width: 22px; height: 16px; background: none; border: none; cursor: pointer; padding: 0;
}
.hamburger span {
  display: block; width: 22px; height: 2px; background: rgba(255,255,255,0.85);
  border-radius: 2px; transition: transform 0.27s ease, opacity 0.27s ease; transform-origin: center;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav-menu { display: flex; justify-content: center; flex-wrap: wrap; max-width: 1400px; margin: 0 auto; }
.nav-menu li a {
  display: block; padding: 15px 20px; color: var(--nav-text);
  font-size: 13px; font-weight: 500; letter-spacing: 0.05em; text-transform: uppercase;
  position: relative; transition: color var(--t), background var(--t); white-space: nowrap;
}
.nav-menu li a::after {
  content: ''; position: absolute; bottom: 0; left: 50%; right: 50%;
  height: 3px; background: var(--saffron); border-radius: 2px 2px 0 0;
  transition: left 0.22s ease, right 0.22s ease;
}
.nav-menu li a:hover, .nav-menu li a.active-link { color: white; background: var(--nav-hover-bg); }
.nav-menu li a:hover::after, .nav-menu li a.active-link::after { left: 0; right: 0; }
@media (max-width: 768px) {
  .hamburger-wrap { display: flex; }
  .nav-menu { display: none; flex-direction: column; width: 100%; background: var(--nav-bg); border-top: 1px solid rgba(255,255,255,0.06); max-height: calc(100vh - 50px); overflow-y: auto; }
  .nav-menu.open { display: flex; }
  .nav-menu li { width: 100%; border-bottom: 1px solid rgba(255,255,255,0.05); }
  .nav-menu li:last-child { border-bottom: none; }
  .nav-menu li a { padding: 13px 20px; font-size: 14px; border-left: 3px solid transparent; }
  .nav-menu li a::after { display: none; }
  .nav-menu li a:hover, .nav-menu li a.active-link { background: rgba(255,255,255,0.06); border-left-color: var(--saffron); padding-left: 24px; }
}

/* ── Gallery Hero ───────────────────────────────────── */
.gallery-hero {
  background: linear-gradient(135deg, var(--navy) 0%, #1a3a8a 50%, #0d5218 100%);
  padding: 52px 24px 44px; text-align: center; position: relative; overflow: hidden;
}
.gallery-hero::before {
  content: ''; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.gallery-hero-inner { position: relative; z-index: 1; max-width: 700px; margin: 0 auto; }
.hero-badge {
  display: inline-block; background: var(--saffron); color: white;
  font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 5px 16px; border-radius: 20px; margin-bottom: 16px;
}
.gallery-hero h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(26px,5vw,42px); font-weight: 700;
  color: white; line-height: 1.15; margin-bottom: 12px;
}
.gallery-hero p {
  font-size: clamp(13px,2vw,16px); color: rgba(255,255,255,0.75);
  line-height: 1.6; font-weight: 300;
}

/* ── Main Container ─────────────────────────────────── */
.container { max-width: 1400px; margin: 0 auto; padding: 36px 20px; flex: 1; width: 100%; }

/* ── Filter Bar ─────────────────────────────────────── */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center; margin-bottom: 32px;
}
.filter-btn {
  background: var(--surface); border: 2px solid var(--border);
  color: var(--text-2); padding: 9px 22px;
  font-size: 13px; font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  border-radius: 40px; cursor: pointer;
  transition: all 0.25s ease; letter-spacing: 0.03em;
}
.filter-btn:hover { border-color: var(--navy); color: var(--navy); background: var(--surface-2); }
.filter-btn.active {
  background: var(--navy); border-color: var(--navy); color: white;
  box-shadow: 0 4px 14px rgba(11,43,107,0.25);
}
body.dark-theme .filter-btn.active { background: var(--saffron); border-color: var(--saffron); }

/* ── Section Header ─────────────────────────────────── */
.section-header { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.section-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 21px; font-weight: 700; color: var(--navy); white-space: nowrap;
  transition: color var(--t);
}
body.dark-theme .section-title { color: var(--text-1); }
.photo-count {
  background: var(--saffron); color: white;
  font-size: 11px; font-weight: 700;
  padding: 3px 12px; border-radius: 20px;
  letter-spacing: 0.06em; white-space: nowrap; flex-shrink: 0;
}
.section-line { flex: 1; height: 1px; background: var(--border); transition: background var(--t); }

/* ── Gallery Grid ───────────────────────────────────── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.gallery-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  box-shadow: var(--shadow);
}
.gallery-item:hover { transform: translateY(-6px); box-shadow: 0 16px 36px rgba(11,43,107,0.18); border-color: var(--saffron); }
.gallery-thumb { position: relative; width: 100%; height: 210px; overflow: hidden; background: var(--surface-2); }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s ease; }
.gallery-item:hover .gallery-thumb img { transform: scale(1.06); }
.gallery-thumb-overlay {
  position: absolute; inset: 0; background: rgba(11,43,107,0);
  display: flex; align-items: center; justify-content: center;
  transition: background 0.3s ease;
}
.gallery-item:hover .gallery-thumb-overlay { background: rgba(11,43,107,0.35); }
.gallery-zoom-icon {
  color: white; font-size: 28px; opacity: 0; transform: scale(0.7);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.gallery-item:hover .gallery-zoom-icon { opacity: 1; transform: scale(1); }
.gallery-caption {
  padding: 12px 16px; border-top: 1px solid var(--border); transition: border-color var(--t);
}
.gallery-caption h3 {
  font-size: 14px; font-weight: 600; color: var(--text-1); margin: 0 0 3px;
  transition: color var(--t); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gallery-caption p {
  font-size: 12px; color: var(--text-3); margin: 0; line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gallery-caption .cat-tag {
  display: inline-block; font-size: 10px; font-weight: 700;
  color: var(--saffron); letter-spacing: 0.08em; text-transform: uppercase; margin-top: 5px;
}
.gallery-empty { grid-column: 1/-1; text-align: center; padding: 60px 20px; color: var(--text-3); font-size: 16px; }
.gallery-empty span { font-size: 40px; display: block; margin-bottom: 12px; }

/* ── Lightbox Modal ─────────────────────────────────── */
.modal {
  display: none; position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.93); align-items: center; justify-content: center;
}
.modal.active { display: flex; }
.modal-inner {
  position: relative; display: flex; flex-direction: column; align-items: center;
  max-width: 92vw; animation: modal-in 0.28s ease;
}
@keyframes modal-in { from{opacity:0;transform:scale(0.94);}to{opacity:1;transform:scale(1);} }
.modal-img {
  max-width: 88vw; max-height: 76vh; border-radius: 8px;
  border: 3px solid rgba(255,255,255,0.12);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5); display: block; object-fit: contain;
}
.modal-caption { color: rgba(255,255,255,0.85); text-align: center; margin-top: 14px; font-size: 15px; font-weight: 400; line-height: 1.5; max-width: 600px; }
.modal-counter { color: rgba(255,255,255,0.4); font-size: 12px; margin-top: 6px; letter-spacing: 0.06em; }
.close-modal {
  position: absolute; top: 16px; right: 20px;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
  color: white; font-size: 24px; font-weight: 300;
  width: 40px; height: 40px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s ease; line-height: 1;
}
.close-modal:hover { background: rgba(255,107,0,0.7); }
.modal-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
  color: white; width: 48px; height: 48px; border-radius: 50%;
  font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s ease; backdrop-filter: blur(4px);
}
.modal-nav:hover { background: rgba(255,107,0,0.6); }
.modal-prev { left: 16px; }
.modal-next { right: 16px; }
@media (max-width: 600px) {
  .modal-nav  { width: 38px; height: 38px; font-size: 15px; }
  .modal-prev { left: 8px; }
  .modal-next { right: 8px; }
  .modal-img  { max-width: 96vw; max-height: 70vh; }
}

/* ── Footer ─────────────────────────────────────────── */
.site-footer { background: var(--footer-bg); transition: background var(--t); }
.footer-top  { max-width: 1400px; margin: 0 auto; padding: 44px 20px 36px; }
.footer-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 28px 20px; }
.footer-col h4 { font-size: 11px; font-weight: 700; color: var(--footer-heading); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 12px; padding-bottom: 7px; border-bottom: 1px solid rgba(255,255,255,0.07); }
.footer-col p, .footer-col ul { font-size: 13px; color: var(--footer-text); line-height: 1.7; }
.footer-col ul li { margin-bottom: 6px; }
.footer-col ul li a { color: var(--footer-link); transition: color var(--t); }
.footer-col ul li a:hover { color: var(--footer-link-h); }
.footer-col strong { color: var(--footer-heading); font-weight: 500; }
.footer-col p { margin: 5px 0; word-break: break-word; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.06); padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; max-width: 1400px; margin: 0 auto; font-size: 12px; color: rgba(255,255,255,0.28); }
.footer-bottom-links { display: flex; gap: 4px; flex-shrink: 0; }
.footer-bottom-links a { color: rgba(255,255,255,0.32); transition: color var(--t); }
.footer-bottom-links a:hover { color: var(--footer-link-h); }
@media (max-width: 1100px) { .footer-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 640px) {
  .footer-top  { padding: 30px 16px 26px; }
  .footer-grid { grid-template-columns: 1fr; gap: 22px; }
  .footer-bottom { flex-direction: column; text-align: center; padding: 14px 16px; gap: 6px; }
}

/* ── Gallery Responsive ─────────────────────────────── */
@media (max-width: 900px) { .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: 16px; } }
@media (max-width: 600px) {
  .gallery-grid { grid-template-columns: repeat(2,1fr); gap: 12px; }
  .gallery-thumb { height: 160px; }
  .gallery-hero  { padding: 36px 16px 30px; }
  .container     { padding: 24px 14px; }
  .filter-btn    { padding: 8px 16px; font-size: 12px; }
}
@media (max-width: 400px) {
  .gallery-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .gallery-thumb { height: 130px; }
}