/* ===================================================
   NRLM KSRLPS – GPLF 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);
  --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;
  --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;
}

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: 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: 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; display: block;
}

.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; }

/* FIX: max-width added to prevent logos stretching on some browsers */
.emblem-img,
.sanjivini-logo {
  height: 76px; width: auto; max-width: 84px;
  object-fit: contain; flex-shrink: 0; display: block;
}

.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;
}

@media (max-width: 600px) { .page-hero { padding: 36px 16px 30px; } }

/* ── GPLF Main Layout ───────────────────────────────── */
.gplf-main {
  flex: 1; padding: 24px 20px;
  max-width: 1400px; margin: 0 auto; width: 100%;
}

.content-panel {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px; align-items: start;
}

@media (max-width: 900px) { .content-panel { grid-template-columns: 1fr; } }

/* ── Panchayat Sidebar ──────────────────────────────── */
.panchayat-sidebar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  position: sticky;
  /* FIX: navbar is 48px on mobile, ~48px on desktop; use 72px to clear it */
  top: 72px;
  max-height: calc(100vh - 100px);
  display: flex; flex-direction: column;
  transition: background var(--t), border-color var(--t);
}

@media (max-width: 900px) {
  .panchayat-sidebar { position: static; max-height: 360px; }
}

.sidebar-header {
  display: flex; align-items: center; gap: 9px;
  padding: 14px 16px;
  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;
  flex-shrink: 0;
  transition: background var(--t), border-color var(--t), color var(--t);
}
body.dark-theme .sidebar-header { color: var(--text-1); }

.sidebar-icon { font-size: 16px; }

.sidebar-search {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  transition: border-color var(--t);
}

.sidebar-search input {
  width: 100%; padding: 7px 12px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-2); color: var(--text-2);
  font-family: 'DM Sans', sans-serif; font-size: 13px;
  transition: border-color var(--t), background var(--t);
  /* FIX: remove default outline and add themed focus */
  outline: none;
}

.sidebar-search input:focus { border-color: var(--navy); }
.sidebar-search input::placeholder { color: var(--text-3); }

#panchayatContainer { overflow-y: auto; flex: 1; padding: 8px; }
#panchayatContainer::-webkit-scrollbar { width: 4px; }
#panchayatContainer::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.panchayat-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; margin-bottom: 4px; border-radius: 8px;
  cursor: pointer; font-size: 13px; font-weight: 500;
  color: var(--text-2); border: 1px solid transparent;
  transition: background var(--t), border-color var(--t), color var(--t), transform 0.15s ease;
}

.panchayat-item:hover {
  background: var(--surface-2); border-color: var(--border);
  /* FIX: was translateX(3px) — correct direction is right (+X) for an indent effect */
  transform: translateX(3px);
  color: var(--text-1);
}

.panchayat-item.active {
  background: var(--navy); color: white;
  border-color: var(--navy); font-weight: 600;
}

/* Dark theme: active item uses saffron so it's visible on dark background */
body.dark-theme .panchayat-item.active {
  background: var(--saffron); border-color: var(--saffron);
}

.count-badge {
  background: var(--surface-2); color: var(--text-3);
  padding: 2px 8px; border-radius: 12px;
  font-size: 11px; font-weight: 600; flex-shrink: 0;
  transition: background var(--t), color var(--t);
}

.panchayat-item.active .count-badge { background: rgba(255,255,255,0.2); color: white; }

/* ── Details Panel ──────────────────────────────────── */
.details-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-height: 500px; overflow: hidden;
  transition: background var(--t), border-color var(--t);
}

/* ── Breadcrumb ─────────────────────────────────────── */
.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 20px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  font-size: 13px; flex-wrap: wrap;
  transition: background var(--t), border-color var(--t);
}

.breadcrumb-item {
  cursor: pointer; color: var(--navy-mid); font-weight: 500;
  transition: color var(--t);
}

.breadcrumb-item:hover { color: var(--saffron); text-decoration: underline; }
body.dark-theme .breadcrumb-item { color: var(--text-2); }

/* FIX: breadcrumb-sep was declared in gplf.css but had no color set */
.breadcrumb-sep { color: var(--text-3); user-select: none; }

/* ── View Content ───────────────────────────────────── */
#viewContent { padding: 20px; }

.view-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px; font-weight: 700; color: var(--navy);
  border-left: 4px solid var(--saffron);
  padding-left: 12px; margin-bottom: 20px;
  transition: color var(--t);
}
body.dark-theme .view-title { color: var(--text-1); }

/* ── Cards Grid ─────────────────────────────────────── */
.cards-grid {
  display: grid;
  /* FIX: min 180px instead of 210px so cards fit on narrow screens */
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.info-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 14px; cursor: pointer;
  transition: background var(--t), border-color var(--t), transform 0.2s ease, box-shadow 0.2s ease;
}

.info-card:hover {
  transform: translateY(-4px);
  border-color: var(--saffron);
  box-shadow: 0 10px 24px rgba(11, 43, 107, 0.14);
  background: var(--surface);
}

.village-card { border-left: 4px solid var(--green); }
.shg-card     { border-left: 4px solid var(--saffron); }

.card-title {
  font-size: 14px; font-weight: 600;
  color: var(--text-1); margin-bottom: 8px; line-height: 1.35;
  transition: color var(--t);
}

.card-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.card-badge {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-3);
  padding: 2px 10px; border-radius: 12px;
  font-size: 11px; font-weight: 600;
  /* FIX: word-break so long SHG names inside badges don't overflow */
  word-break: break-word;
  transition: background var(--t), border-color var(--t), color var(--t);
}

.badge-green  { color: var(--green);   border-color: rgba(19, 136, 8, 0.2);   background: rgba(19, 136, 8, 0.06); }
.badge-orange { color: var(--saffron); border-color: rgba(255, 107, 0, 0.2);  background: rgba(255, 107, 0, 0.06); }

/* ── Root / Welcome State ───────────────────────────── */
.root-state { text-align: center; padding: 48px 20px; }

.root-icon { font-size: 56px; margin-bottom: 16px; opacity: 0.75; }

.root-state h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px; font-weight: 700;
  color: var(--navy); margin-bottom: 10px;
  transition: color var(--t);
}
body.dark-theme .root-state h3 { color: var(--text-1); }

.root-state p {
  font-size: 14px; color: var(--text-3);
  max-width: 460px; margin: 0 auto 24px; line-height: 1.6;
}

.root-stats {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 12px;
}

.root-stat {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 40px; padding: 10px 22px;
  font-size: 14px; color: var(--text-2); font-weight: 500;
  transition: background var(--t), border-color var(--t);
}

/* FIX: strong inside root-stat must be block-inline not block */
.root-stat strong {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px; font-weight: 700;
  color: var(--saffron);
  margin-right: 5px;
  display: inline;  /* was implicitly block in some resets */
}

/* ── Panchayat Statistics Dashboard ────────────────── */
.pstat-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden; margin-bottom: 8px;
  transition: background var(--t), border-color var(--t);
}

.pstat-header {
  padding: 11px 16px;
  background: linear-gradient(135deg, var(--navy), var(--navy-mid));
  color: white; font-size: 13px; font-weight: 700; letter-spacing: 0.04em;
}

.pstat-kpi {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 1px; background: var(--border);
  border-bottom: 1px solid var(--border);
}

@media (max-width: 600px) { .pstat-kpi { grid-template-columns: repeat(2, 1fr); } }

.pstat-kpi-card {
  background: var(--surface);
  display: flex; flex-direction: column;
  align-items: center; padding: 12px 8px; gap: 3px;
  transition: background var(--t);
}

.pstat-kpi-icon { font-size: 18px; }

.pstat-kpi-val {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px; font-weight: 700;
  color: var(--navy); line-height: 1;
  transition: color var(--t);
}
/* FIX: was referencing --saffron-light which is not defined in dark vars — use explicit value */
body.dark-theme .pstat-kpi-val { color: #FF9A4A; }

.pstat-kpi-lbl {
  font-size: 10px; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600;
}

.pstat-chart-title {
  padding: 10px 16px 4px;
  font-size: 11px; font-weight: 700;
  color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em;
}

.pstat-chart { padding: 8px 16px 14px; display: flex; flex-direction: column; gap: 7px; }

.stat-bar-row { display: flex; align-items: center; gap: 10px; }

.stat-bar-label {
  font-size: 11px; color: var(--text-2); font-weight: 500;
  min-width: 100px; max-width: 100px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex-shrink: 0;
}

.stat-bar-track {
  flex: 1; height: 10px; background: var(--surface);
  border-radius: 10px; overflow: hidden; border: 1px solid var(--border);
}

.stat-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--saffron), var(--saffron-light));
  border-radius: 10px; transition: width 0.5s ease;
}

.stat-bar-val {
  font-size: 11px; font-weight: 700; color: var(--text-2);
  min-width: 20px; text-align: right; flex-shrink: 0;
}

/* ── 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; }
}

/* ── GPLF Mobile ────────────────────────────────────── */
@media (max-width: 600px) {
  .gplf-main  { padding: 16px 12px; }
  /* FIX: 2-col at small sizes, not 1fr 1fr which forces 50% on tiny screens */
  .cards-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  #viewContent { padding: 14px; }
}

@media (max-width: 400px) {
  .cards-grid { grid-template-columns: 1fr; }
}