/* Approved Home2 visual language, shared by public, State and administrative pages. */
:root {
  --brap-navy-900: #071d40;
  --brap-navy-800: #0a2045;
  --brap-navy-700: #16365c;
  --brap-ink: #0c2049;
  --brap-muted: #596981;
  --brap-saffron: #ff941f;
  --brap-bg: #f3f7fc;
  --brap-line: #dce4f0;
  --brap-radius: 12px;
  --brap-page-ink: #0c2049;
  --brap-page-heading-bg: #f0f5fc;
  --brap-page-line: #dce4f0;
}

body.brap-theme {
  line-height: 1.65;
}

body.brap-theme .main-header {
  background: #fff;
  border: 0;
  border-image: none;
  color: #0c2049;
}

body.brap-theme .header-inner {
  padding-block: 0px;
}

body.brap-theme :is(.dept-en, .dept-hindi, .satyamev) {
  color: #0c2049;
}

body.brap-theme .dept-en {
  font-size: clamp(13px, 1.05vw, 17px);
  letter-spacing: .15px;
  line-height: 1.5;
}

body.brap-theme .dept-hindi {
  font-size: 12px;
}

body.brap-theme .ministry-en {
  color: #596981;
  font-size: 11px;
}

body.brap-theme .emblem-block {
  border-color: #dce4f0;
}

body.brap-theme .emblem-img {
  filter: none;
}

body.brap-theme .admin-card {
  background: #f3f7fc;
  border-color: #dce4f0;
  color: #0c2049;
  border-radius: 9px;
}

body.brap-theme .admin-name {
  color: #0c2049;
}

body.brap-theme .admin-date {
  color: #596981;
}

body.brap-theme .notif-bell-btn {
  background: #f3f7fc;
  color: #0c2049;
  border-color: #dce4f0;
}

body.brap-theme :is(.primary-nav, .dashboard-nav) {
  background: #071d40;
}

/* Restore the original dark masthead for authenticated portal pages. */
body.brap-theme.logged-in .main-header {
  background: radial-gradient(1200px 400px at 85% -20%, #2a49b8 0, transparent 60%), linear-gradient(135deg, #0b1230, #233a88);
  color: #fff;
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(90deg, #ff941f, #fff, #138808) 1;
}

body.brap-theme.logged-in .main-header :is(.dept-en, .satyamev, .admin-name) {
  color: #fff;
}

body.brap-theme.logged-in .main-header .dept-hindi {
  color: #c7d4f5;
}

body.brap-theme.logged-in .main-header :is(.ministry-en, .admin-date) {
  color: #c7d4f5;
}

body.brap-theme.logged-in .emblem-block {
  border-color: rgba(255, 255, 255, .22);
}

body.brap-theme.logged-in .emblem-img {
  filter: brightness(0) invert(1);
}

body.brap-theme.logged-in .main-header :is(.admin-card, .notif-bell-btn) {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .22);
  color: #fff;
}

body.brap-theme.logged-in .main-header :is(.admin-card, .notif-bell-btn):hover {
  background: rgba(255, 255, 255, .16);
}

body.brap-theme.logged-in .main-header :is(.admin-card, .notif-bell-btn):focus-visible {
  outline: 2px solid #ffb85c;
  outline-offset: 3px;
}

body.brap-theme.logged-in :is(.primary-nav, .dashboard-nav) {
  background: #131e4a;
}

body.brap-theme main .card {
  border-radius: 12px;
  border-color: #dce4f0;
  box-shadow: 0 4px 18px #0a204508;
}

body.brap-theme main .card-header {
  background: #f3f7fc;
  border-bottom-color: #dce4f0;
}

body.brap-theme main .btn {
  border-radius: 7px;
}

.portal-wordmark {
  text-align: right;
  flex-shrink: 0;
}

.portal-footer {
  --portal-footer-accent: #ff941f;
  --portal-footer-gutter: clamp(20px, 2.4vw, 40px);
  --portal-footer-content-width: 1440px;
  --portal-footer-muted: #b6c6dd;
  background: #071d40;
  color: #d9e3f1;
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  margin-top: 30px;
  font-size: 13px;
  line-height: 1.65;
  border-top: 3px solid var(--portal-footer-accent);
}

.portal-footer-grid {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--portal-footer-content-width);
  margin: auto;
  padding: 28px var(--portal-footer-gutter);
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: clamp(32px, 5vw, 72px);
}

.portal-footer-grid > * { min-width: 0; }

/* Secondary information shares one quiet row instead of a fourth content column. */
.portal-footer-meta {
  box-sizing: border-box;
  max-width: var(--portal-footer-content-width);
  margin-inline: auto;
  padding: 14px var(--portal-footer-gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 32px;
  border-top: 1px solid #ffffff12;
  color: var(--portal-footer-muted);
  font-size: 12px;
}
.portal-footer-stats { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 24px; }
.portal-footer-connect { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; }

.portal-visitor-box {
  display: flex;
  align-items: center;
  gap: 8px;
}

.portal-visitor-icon { width: 18px; height: 18px; flex-shrink: 0; }
.portal-footer .portal-visitor-box strong { font-size: 13px; font-weight: 600; }

.portal-footer .portal-last-updated {
  margin: 0;
  padding-left: 24px;
  border-left: 1px solid #ffffff24;
  font-size: 12px;
  font-weight: 400;
}

.portal-footer-social { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.portal-footer .portal-footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  min-height: 40px;
  padding: 8px;
  border-radius: 6px;
  color: #d9e3f1;
}
.portal-footer-social svg { width: 16px; height: 16px; flex-shrink: 0; }
.portal-footer .portal-footer-social .portal-footer-feedback { width: auto; gap: 8px; padding-inline: 10px; font-weight: 500; }
.portal-footer .portal-footer-social a:hover { background: #ffffff18; color: #ffb454; text-decoration: none; }
.portal-footer .portal-footer-social a:focus-visible { outline: 2px solid #ffb454; outline-offset: 3px; }

@media (max-width: 900px) {
  .portal-footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portal-footer-about { grid-column: 1 / -1; }
}

.portal-footer strong {
  color: white;
  font-size: 14px;
  font-weight: 600;
}

.portal-footer h2 {
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0;
  margin: 0 0 16px;
}

.portal-footer h2::after {
  content: '';
  display: block;
  width: 28px;
  height: 2px;
  margin-top: 10px;
  background: var(--portal-footer-accent);
}

.portal-footer p {
  margin: 8px 0;
  max-width: 440px;
  color: var(--portal-footer-muted);
}

.portal-footer a {
  color: #d9e3f1;
  text-decoration: none;
}

.portal-footer a:hover {
  color: #ffb454;
  text-decoration: underline;
}

.portal-footer-links a {
  display: block;
  padding: 5px 0;
}

/* Arrow bullets belong to the navigation lists, with wrapped text kept aligned. */
.portal-footer-links > a {
  position: relative;
  padding-inline-start: 18px;
}

.portal-footer-links > a::before {
  content: '\2192';
  position: absolute;
  inset-inline-start: 0;
  top: 5px;
  color: var(--portal-footer-accent);
  font-weight: 700;
}

.portal-government-logos {
  background: #051630;
  border-top: 1px solid #ffffff12;
}

.portal-government-logos-inner {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: center;
  gap: 20px;
  width: min(1080px, calc(100% - 2 * var(--portal-footer-gutter)));
  margin-inline: auto;
  padding-block: 10px;
}

.portal-footer .portal-government-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 72px;
  padding: 10px;
  border-radius: 8px;
  transition: background-color 220ms ease, transform 220ms ease;
}

.portal-government-logo {
  display: block;
  width: auto;
  max-width: 100%;
  height: 40px;
  object-fit: contain;
  filter: grayscale(1);
  opacity: .72;
  transition: filter 220ms ease, opacity 220ms ease;
}
/* Preserve lettering and fine detail when dark artwork is muted on navy. */
.portal-government-link--light .portal-government-logo { filter: grayscale(1) invert(1); }
.portal-government-logo--make { height: 44px; }
.portal-government-logo--wide { height: 28px; }
.portal-government-logo--digital { height: 52px; }
.portal-government-logo--data { height: 42px; }
.portal-government-logo--nic { height: 28px; }
.portal-footer .portal-government-link:is(:hover, :focus-visible) { transform: translateY(-3px); }
.portal-government-link:is(:hover, :focus-visible) .portal-government-logo { filter: none; opacity: 1; }
/* Dark original artwork gets a light plate when its full colors are revealed. */
.portal-footer .portal-government-link--light:is(:hover, :focus-visible) { background-color: #fff; }
.portal-footer .portal-government-link:focus-visible { outline: 2px solid var(--portal-footer-accent); outline-offset: 3px; }

@media (max-width: 900px) {
  .portal-government-logos-inner { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
}
@media (max-width: 480px) {
  .portal-government-logos-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (hover: none) {
  .portal-government-logo,
  .portal-government-link--light .portal-government-logo { filter: none; opacity: 1; }
  .portal-footer .portal-government-link--light { background-color: #fff; }
}
@media (prefers-reduced-motion: reduce) {
  .portal-footer .portal-government-link,
  .portal-government-logo { transition: none; }
  .portal-footer .portal-government-link:is(:hover, :focus-visible) { transform: none; }
}

.portal-footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  font-size: 12px;
  line-height: 1.6;
  border-top: 1px solid #ffffff20;
  /* Match the main grid's content edges, including the scrollbar and wide screens. */
  padding: 14px max(var(--portal-footer-gutter), calc((100% - var(--portal-footer-content-width)) / 2 + var(--portal-footer-gutter)));
}

.portal-footer-bottom > span:last-child {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.portal-footer-bottom a {
  margin: 0;
}

.news-page {
  padding-block: 24px 40px;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.news-grid a {
  color: #0a407e;
}

.news-editor {
  max-width: 1100px;
  margin: auto;
}

.news-editor label {
  margin: 16px 0 6px;
  font-weight: 600;
  font-size: 13px;
}

.news-body {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 24px 0;
}

.news-media {
  width: 100%;
  max-width: 960px;
  max-height: 640px;
  object-fit: contain;
  background: #f3f7fc;
  border-radius: 10px;
}

.news-thumbnail {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 16px;
}

.news-history {
  border-bottom: 1px solid #dce4f0;
  padding: 12px 0;
}

.news-history pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 300px;
  margin-top: 12px;
  font-size: 12px;
}

.analytics-detail-trigger {
  display: block;
  margin-top: 12px;
  padding: 6px 0;
  width: 100%;
  border: 0;
  border-top: 1px solid currentColor;
  background: transparent;
  text-align: left;
  color: var(--kpi-ink, #0a2045);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.analytics-detail-trigger i {
  float: right;
}

.analytics-detail-trigger::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
}

.analytics-detail-trigger:hover {
  text-decoration: underline;
}

#analytics-details .modal-dialog {
  max-width: min(1450px, 96vw);
}

#analytics-details .modal-header {
  background: #0a2045;
  color: white;
}

#analytics-details .dt-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

#analytics-details .dt-buttons .btn {
  flex: 0 0 auto;
  width: auto;
  min-width: 130px;
  border-radius: 7px;
}

#analytics-details .buttons-excel {
  background: #087b70;
  border-color: #087b70;
  color: white;
}

#analytics-details .buttons-pdf {
  background: #a63550;
  border-color: #a63550;
  color: white;
}

#analytics-details .dataTables_length {
  display: inline-block;
  margin: 8px 0 14px;
}

#analytics-details .dataTables_filter {
  float: right;
  margin: 8px 0 14px;
}

#analytics-details table {
  font-size: 12px;
}

#analytics-details .modal-body {
  min-height: 240px;
}

body.modal-open #ai-chat-widget {
  visibility: hidden;
}

@media(max-width:900px) {
  .news-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media(max-width:600px) {
  .portal-footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-block: 28px;
  }

  .portal-footer-meta { align-items: flex-start; gap: 16px; }
  .portal-footer-stats { flex-direction: column; align-items: flex-start; gap: 8px; }
  .portal-footer .portal-last-updated { padding-left: 0; border-left: 0; }

  .news-grid {
    grid-template-columns: 1fr;
  }

  #analytics-details .modal-dialog {
    margin: 10px auto;
  }

  #analytics-details .modal-header p {
    font-size: 11px;
  }
}
