/* ===================================================
   NRLM KSRLPS – Contact Page Stylesheet
   =================================================== */

@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;
}

/* FIX: was missing display:flex — caused icon + text to stack vertically */
.location-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  /* FIX: was `transition: var(--t)` which is invalid — transition needs property name */
  transition: background var(--t), border-color var(--t), color var(--t);
  white-space: nowrap;
  flex-shrink: 0;
  text-decoration: none; /* it's an <a> tag */
}

.location-btn:hover {
  background: var(--saffron);
  border-color: var(--saffron);
  color: white;
}

.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);
  /* FIX: same invalid shorthand — expanded */
  transition: background var(--t), color 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: 600px) {
  .gov-badge    { display: none; }
  .location-btn { display: none; } /* too cramped on very small screens */
}

/* ── 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; }

.emblem-img,
.sanjivini-logo {
  height: 76px;
  width: auto;
  max-width: 84px;
  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); }
}

/* Mobile header */
@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: 64px; }
  .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: 52px; }
  .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: 44px; }
  .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;
  }
}

/* ── Page Hero ──────────────────────────────────────── */
.page-hero {
  background: linear-gradient(135deg, var(--navy) 0%, #1a3a8a 55%, #0d5218 100%);
  padding: 48px 24px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-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'%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");
}

.page-hero-inner { position: relative; z-index: 1; max-width: 680px; 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;
}

.page-hero h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(26px, 5vw, 40px);
  font-weight: 700;
  color: white;
  line-height: 1.15;
  margin-bottom: 12px;
}

.page-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: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  flex: 1;
  width: 100%;
}

/* ── Contact Grid ───────────────────────────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}

@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }

/* ── Info Cards ─────────────────────────────────────── */
.contact-cards { display: flex; flex-direction: column; gap: 20px; }

.info-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  /* FIX: include border-color in transition so hover glow animates smoothly */
  transition: background var(--t), border-color var(--t), box-shadow var(--t);
}

.info-card:hover {
  box-shadow: 0 8px 32px rgba(11, 43, 107, 0.16);
  border-color: rgba(255, 107, 0, 0.3);
}

.info-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 20px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: background var(--t), border-color var(--t), color var(--t);
}

body.dark-theme .info-card-header { color: var(--text-1); }

.card-icon { font-size: 16px; flex-shrink: 0; }

.info-card-body { padding: 20px; }

.info-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.6;
  transition: border-color var(--t);
}

.info-row:last-child  { border-bottom: none; padding-bottom: 0; }
.info-row:first-child { padding-top: 0; }

.info-label {
  font-size: 16px;
  flex-shrink: 0;
  width: 22px;
  text-align: center;
  margin-top: 1px;
}

.toll-free { font-size: 12px; color: var(--green); font-weight: 600; }

/* FIX: break-word is safer than break-all (break-all splits mid-character) */
.contact-link {
  color: var(--navy-mid);
  font-weight: 500;
  transition: color var(--t);
  word-break: break-word;
  overflow-wrap: break-word;
}

.contact-link:hover { color: var(--saffron); }
body.dark-theme .contact-link { color: var(--text-2); }

/* ── Hours Table ────────────────────────────────────── */
.hours-table { width: 100%; border-collapse: collapse; }

.hours-table td {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--text-2);
  transition: border-color var(--t), color var(--t);
  vertical-align: middle;
}

.hours-table tr:last-child td  { border-bottom: none; padding-bottom: 0; }
.hours-table tr:first-child td { padding-top: 0; }

/* FIX: !important on padding-right removed — specificity was unnecessary */
.day {
  font-weight: 600;
  color: var(--navy);
  width: 55%;
  padding-right: 10px;
  transition: color var(--t);
}

body.dark-theme .day { color: var(--text-1); }
.time   { color: var(--text-2); }
.closed { color: #d32f2f; font-weight: 600; }
body.dark-theme .closed { color: #fc8181; }
.closed-row td { opacity: 0.7; }

/* ── Grievance PG Link ──────────────────────────────── */
.pg-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 9px 20px;
  background: var(--navy);
  color: white;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  letter-spacing: 0.03em;
  text-decoration: none; /* FIX: explicit since it's an <a> */
  transition: background var(--t), transform 0.2s ease;
}

.pg-link:hover { background: var(--saffron); transform: translateY(-2px); }

.info-card-body p {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.65;
  margin: 0;
  transition: color var(--t);
}

/* ── Map Card ───────────────────────────────────────── */
.map-col { /* wrapper keeps sticky context clean */ }

.map-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: background var(--t), border-color var(--t);
  position: sticky;
  /* FIX: was top: 80px which overlapped the sticky navbar (~48px tall).
     Using 68px to add comfortable clearance below navbar. */
  top: 68px;
}

.map-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 20px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: background var(--t), border-color var(--t), color var(--t);
}

body.dark-theme .map-header { color: var(--text-1); }

.map-frame {
  width: 100%;
  height: 340px;
  background: var(--surface-2);
}

.map-frame iframe { width: 100%; height: 100%; border: 0; display: block; }

/* FIX: directions-btn is an <a> — needs text-decoration:none + explicit color */
.directions-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 20px;
  background: var(--navy);
  color: white;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-top: 1px solid var(--border);
  text-decoration: none;
  transition: background var(--t), color var(--t);
  cursor: pointer;
}

.directions-btn:hover { background: var(--saffron); color: white; }

/* ── 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;
  }
}

/* ── Contact Responsive ─────────────────────────────── */
@media (max-width: 600px) {
  .page-hero { padding: 36px 16px 30px; }
  .container { padding: 24px 14px; }
  /* FIX: map-card must be static on mobile or it will sticky inside a grid cell (broken) */
  .map-card  { position: static; }
  .map-frame { height: 260px; }
}