/* =========================================================
   তথ্যভিত্তিক অনুবিভাগ — Bangladesh government portal style
   ========================================================= */

:root {
  --green: #006a4e;
  --green-mid: #0a7d4f;
  --green-dark: #004f3a;
  --green-soft: #eaf4ef;
  --navy: #0b2c5f;
  --navy-dark: #071d40;
  --red: #da2128;
  --page-bg: #e4e9ec;
  --border: #d3dadf;
  --text: #1f2a37;
  --muted: #4b5563;
  --font: "Noto Sans Bengali", "SolaimanLipi", "Kalpurush", system-ui, sans-serif;
}

html { scroll-behavior: smooth; scroll-padding-top: 56px; }

body {
  font-family: var(--font);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.85;
  background:
    repeating-linear-gradient(45deg, rgba(0,106,78,.025) 0 2px, transparent 2px 12px),
    var(--page-bg);
}

img { max-width: 100%; height: auto; }
a { color: var(--green); }
a:hover { color: var(--navy); }
:focus-visible { outline: 3px solid #f5b400; outline-offset: 2px; }

.skip-link { position: absolute; left: -9999px; top: 0; z-index: 2000; background: var(--navy); color: #fff; padding: .5rem 1rem; }
.skip-link:focus { left: 1rem; top: .5rem; color: #fff; }

/* ---------- Boxed page ---------- */
.page-wrap {
  max-width: 1200px;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 0 18px rgba(0,0,0,.12);
}

/* ---------- Top bar ---------- */
.topbar {
  background: var(--navy-dark);
  color: #d9e2f0;
  font-size: .82rem;
  padding: .3rem 0;
}

/* ---------- Header ---------- */
.site-header {
  position: relative;
  min-height: 118px;
  display: flex; align-items: center;
  padding: 1rem 1.25rem;
  background:
    linear-gradient(90deg, #fff 0%, #fff 45%, rgba(255,255,255,.55) 75%, rgba(255,255,255,.15) 100%),
    url("../img/ec-building-banner.jpg") right 35% / 55% auto no-repeat,
    #fff;
  border-bottom: 1px solid var(--border);
}
.site-header::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px;
  background: linear-gradient(90deg, var(--green) 0 82%, var(--red) 82% 100%);
}
.brand { display: flex; align-items: center; gap: 1rem; text-decoration: none; color: inherit; }
.brand:hover { color: inherit; }
.brand-mark {
  flex: 0 0 auto; width: 70px; height: 70px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--green); color: #fff; font-size: 2rem;
  border: 3px solid #fff; box-shadow: 0 0 0 2px var(--green), 0 2px 6px rgba(0,0,0,.15);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.brand-title { font-size: 2rem; font-weight: 700; color: var(--green-dark); letter-spacing: .2px; }
.brand-sub { font-size: 1.2rem; font-weight: 600; color: var(--navy); }
.brand-logo { flex: 0 0 auto; width: auto; height: 84px; object-fit: contain; }
.brand-text { padding-left: 1rem; border-left: 2px solid var(--green-soft); }

/* Language switcher */
.lang-switch {
  position: relative; z-index: 1;
  margin-left: auto; flex: 0 0 auto;
  display: inline-flex;
  border: 1px solid var(--green);
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
}
.lang-btn {
  border: 0; background: #fff; color: var(--green-dark);
  font-family: var(--font); font-size: .92rem; font-weight: 600; line-height: 1.4;
  padding: .3rem .85rem; cursor: pointer;
}
.lang-btn + .lang-btn { border-left: 1px solid var(--green); }
.lang-btn:hover { background: var(--green-soft); }
.lang-btn.active { background: var(--green); color: #fff; }
.lang-btn[lang="en"] { font-family: "Segoe UI", Roboto, Arial, sans-serif; }

/* Avoid a flash of Bengali when the visitor previously chose English */
html.lang-pending .page-wrap { visibility: hidden; }

/* English typography */
html[lang="en"] body { font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, var(--font); line-height: 1.7; }
html[lang="en"] .brand-title { letter-spacing: 0; }

/* ---------- Navigation ---------- */
.main-nav {
  background: linear-gradient(180deg, var(--green-mid) 0%, var(--green) 100%);
  border-bottom: 3px solid var(--navy);
  padding: 0 .75rem;
}
.main-nav .navbar-brand { color: #fff; font-size: 1rem; padding: .65rem 0; }
.main-nav .navbar-toggler {
  color: #fff; border-color: rgba(255,255,255,.6);
  font-size: 1.45rem; padding: .05rem .5rem; margin: .4rem 0;
}
.main-nav .nav-link {
  color: #fff; font-weight: 500; font-size: 1.02rem;
  padding: .7rem 1.25rem;
  display: flex; align-items: center; gap: .4rem;
}
.main-nav .nav-link:hover,
.main-nav .nav-link:focus-visible { background: var(--green-dark); color: #fff; }
.main-nav .nav-link.active { background: var(--navy); color: #fff; }
@media (min-width: 992px) {
  .main-nav .nav-item { border-right: 1px solid rgba(255,255,255,.22); }
  .main-nav .nav-item:first-child .nav-link { padding-left: 1rem; }
}
@media (max-width: 991.98px) {
  .main-nav .navbar-collapse { border-top: 1px solid rgba(255,255,255,.2); padding-bottom: .4rem; }
  .main-nav .nav-link { border-bottom: 1px solid rgba(255,255,255,.1); }
}

/* ---------- Ticker ---------- */
.ticker {
  display: flex; align-items: stretch;
  background: #f4f7f5; border-bottom: 1px solid var(--border);
  font-size: .95rem; overflow: hidden;
}
.ticker-label {
  flex: 0 0 auto; display: flex; align-items: center;
  background: var(--red); color: #fff; font-weight: 600;
  padding: .45rem 1rem;
}
.ticker-track { flex: 1; overflow: hidden; display: flex; align-items: center; }
.ticker-move {
  display: inline-flex; white-space: nowrap;
  padding-left: 100%;
  animation: ticker 38s linear infinite;
}
.ticker-move span { padding-right: 3rem; color: var(--navy); font-weight: 500; }
.ticker-move span::before { content: "\25C6"; color: var(--green); margin-right: .6rem; font-size: .7rem; vertical-align: middle; }
.ticker:hover .ticker-move { animation-play-state: paused; }
@keyframes ticker { to { transform: translateX(-100%); } }

/* ---------- Main area ---------- */
.main-area { padding: 1.5rem; background: #f4f6f7; }

/* Generic content box (portal style) */
.box {
  background: #fff;
  border: 1px solid var(--border);
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(7,29,64,.06);
}
.box:last-child { margin-bottom: 0; }
.box-head {
  background: linear-gradient(180deg, #fafbfb 0%, #eef1f3 100%);
  border-bottom: 3px solid var(--green);
  line-height: 1;
}
.box-head h2 {
  position: relative;
  display: inline-flex; align-items: center; gap: .5rem;
  margin: 0;
  background: var(--green);
  color: #fff;
  font-size: 1.12rem; font-weight: 600; line-height: 1.4;
  padding: .5rem 2rem .45rem 1.1rem;
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 100%, 0 100%);
}
.box-body { padding: 1.4rem; }

.sub-title {
  font-size: 1.18rem; font-weight: 700; color: var(--navy);
  padding: 0 0 .45rem .65rem; margin-bottom: .85rem;
  border-bottom: 1px dashed var(--border);
  border-left: 4px solid var(--green);
  line-height: 1.45;
}
.box-body p { color: var(--text); }

.photo-frame { margin: 0; border: 1px solid var(--border); padding: 5px; background: #fff; }
.photo-frame img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.photo-frame figcaption { font-size: .85rem; color: var(--muted); text-align: center; padding-top: .35rem; }

.check-list { list-style: none; padding: 0; margin: 0 0 1rem; border: 1px solid var(--border); }
.check-list li { position: relative; padding: .5rem .75rem .5rem 2.3rem; border-bottom: 1px solid var(--border); }
.check-list li:nth-child(odd) { background: var(--green-soft); }
.check-list li:last-child { border-bottom: 0; }
.check-list li::before {
  content: "\F26B"; font-family: "bootstrap-icons";
  position: absolute; left: .75rem; top: .5rem; color: var(--green);
}

/* Hero slider */
.hero-box { padding: 5px; }
.hero-box .carousel-item img { display: block; width: 100%; aspect-ratio: 16 / 7; object-fit: cover; object-position: 60% 40%; }
.slide-caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(0deg, rgba(7,29,64,.92) 0%, rgba(7,29,64,.78) 70%, rgba(7,29,64,0) 100%);
  color: #fff; padding: 2.2rem 1.5rem 2rem;
  border-bottom: 4px solid var(--green);
}
.slide-caption h1,
.slide-caption h2 { font-size: 1.7rem; font-weight: 700; margin-bottom: .25rem; line-height: 1.35; }
.slide-caption p { margin: 0; font-size: 1.02rem; color: #e3eaf5; }
.hero-box .carousel-indicators { justify-content: flex-end; margin: 0 1rem .7rem 0; }
.hero-box .carousel-indicators [data-bs-target] { width: 12px; height: 12px; border-radius: 50%; border: 0; }
.hero-box .carousel-control-prev,
.hero-box .carousel-control-next { width: 8%; }

/* Services */
.service-box { height: 100%; border: 1px solid var(--border); background: #fff; }
.service-head {
  display: flex; align-items: center; gap: .75rem;
  background: var(--green-soft); border-bottom: 1px solid var(--border);
  padding: .55rem .75rem;
}
.service-head h3 { font-size: 1.05rem; font-weight: 700; color: var(--green-dark); margin: 0; }
.service-icon {
  flex: 0 0 auto; width: 40px; height: 40px;
  display: grid; place-items: center;
  background: var(--green); color: #fff; font-size: 1.2rem;
}
.service-icon.icon-navy { background: var(--navy); }
.service-box p { padding: .75rem .9rem .9rem; margin: 0; font-size: .97rem; text-align: left; }

/* Events */
.event-row {
  display: grid; grid-template-columns: 300px 1fr; gap: 1.25rem; align-items: start;
  padding-bottom: 1.25rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--border);
}
.event-row:last-child { padding-bottom: 0; margin-bottom: 0; border-bottom: 0; }
.event-row .photo-frame img { aspect-ratio: 4 / 3; }

/* Sub-block inside a box (e.g. voter registration & NID) */
.sub-block { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.photo-card { height: 100%; }
.photo-card img { aspect-ratio: 3 / 2; }
.photo-card figcaption { color: var(--text); font-size: .88rem; line-height: 1.5; padding: .45rem .25rem .15rem; }

/* Compact meeting / training cards */
.mini-card { height: 100%; border: 1px solid var(--border); background: #fff; display: flex; flex-direction: column; }
.mini-card img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-bottom: 3px solid var(--green); }
.mini-body { padding: .8rem 1rem 1rem; }
.mini-body h4 { font-size: 1.03rem; font-weight: 700; color: var(--navy); margin-bottom: .35rem; }
.mini-body p { font-size: .94rem; margin: 0; line-height: 1.7; }

/* ---------- Featured officer profile ---------- */
.profile-box { border-top: 4px solid var(--navy); }
.profile-box .box-body { padding: 0; }
.profile {
  display: grid; grid-template-columns: 250px 1fr;
  align-items: stretch;
}

/* Left panel: photo + emblem on a deep green band */
.profile-side {
  display: flex; flex-direction: column; align-items: center;
  padding: 1.6rem 1.25rem 1.25rem;
  background:
    repeating-linear-gradient(45deg, rgba(255,255,255,.04) 0 2px, transparent 2px 12px),
    linear-gradient(180deg, var(--green) 0%, var(--green-dark) 100%);
  border-right: 4px solid var(--red);
}
.profile-photo {
  margin: 0; width: 200px; max-width: 100%;
  padding: 5px; background: #fff;
  box-shadow: 0 0 0 3px rgba(255,255,255,.35), 0 8px 20px rgba(0,0,0,.28);
}
.profile-photo img {
  display: block; width: 100%; height: auto;
  aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 20%;
}
.profile-org {
  display: flex; flex-direction: column; align-items: center; gap: .4rem;
  margin: 1.1rem 0 0; text-align: center;
  color: #fff !important; font-weight: 600; font-size: .95rem; line-height: 1.4;
}
.profile-org img {
  width: 46px; height: 46px; object-fit: contain;
  background: #fff; border-radius: 50%; padding: 4px;
}

/* Right: name, designation, contact details */
.profile-info { padding: 1.6rem 1.75rem; background: #fff; }
.profile-name {
  position: relative;
  font-size: 1.75rem; font-weight: 700; color: var(--navy);
  line-height: 1.35; margin: 0 0 .9rem; padding-bottom: .6rem;
}
.profile-name::after {
  content: ""; position: absolute; left: 0; bottom: 0;
  width: 90px; height: 4px;
  background: linear-gradient(90deg, var(--green) 0 75%, var(--red) 75% 100%);
}
.profile-desig {
  display: inline-flex; align-items: center; gap: .45rem;
  margin: 0 0 1.25rem;
  background: var(--green-soft); color: var(--green-dark) !important;
  border: 1px solid #cfe3d8; border-left: 4px solid var(--green);
  font-size: 1.05rem; font-weight: 600; line-height: 1.5;
  padding: .35rem .9rem;
}

.contact-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: .7rem;
  margin: 0;
}
.contact-item {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: .7rem .85rem;
  background: #fafcfb; border: 1px solid var(--border);
  border-left: 3px solid var(--green);
  min-width: 0;
}
.contact-item.wide { grid-column: 1 / -1; }
.contact-item > div { min-width: 0; }
.ci-icon {
  flex: 0 0 auto; width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--green); color: #fff; font-size: .95rem;
}
.contact-item dt { font-size: .82rem; font-weight: 600; color: var(--muted); line-height: 1.4; }
.contact-item dd { margin: .1rem 0 0; font-weight: 600; color: var(--navy); line-height: 1.55; overflow-wrap: anywhere; }
.contact-item dd a { color: var(--green-dark); text-decoration: none; }
.contact-item dd a:hover { text-decoration: underline; }

.profile-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.25rem; }
@media (min-width: 992px) and (max-width: 1199.98px) {
  .contact-grid { grid-template-columns: 1fr; }
}
.btn-gov {
  display: inline-flex; align-items: center; gap: .45rem;
  background: var(--green); color: #fff; border: 1px solid var(--green);
  font-weight: 600; font-size: .95rem; line-height: 1.4;
  padding: .45rem 1.1rem; text-decoration: none;
}
.btn-gov:hover { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-gov-outline { background: #fff; color: var(--green-dark); }

.officer-table { font-size: .97rem; border: 1px solid var(--border); background: #fff; }
.officer-table th {
  width: 34%; white-space: nowrap;
  background: var(--green-soft); color: var(--green-dark); font-weight: 600;
}
.officer-table th i { color: var(--green); margin-right: .5rem; font-size: .9em; }
.officer-table th, .officer-table td { padding: .6rem .85rem; border-color: var(--border); vertical-align: top; }
.officer-table tr:last-child th, .officer-table tr:last-child td { border-bottom: 0; }
.officer-table td { overflow-wrap: anywhere; }
.officer-table a { color: var(--green-dark); font-weight: 500; }

/* Gallery */
.gallery-item {
  display: block; width: 100%; padding: 4px; margin: 0;
  background: #fff; border: 1px solid var(--border); cursor: zoom-in;
}
.gallery-item:hover { border-color: var(--green); }
.gallery-item img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.gallery-caption { display: block; font-size: .88rem; font-weight: 500; color: var(--navy); padding: .35rem .2rem .15rem; }

/* Sidebar */
.side-box .box-head { border-bottom-color: var(--navy); }
.side-box .box-head h2 { background: var(--navy); font-size: 1.02rem; }
.side-box .box-body { font-size: .95rem; }
.side-box .box-body p { text-align: left; }

.date-badge {
  display: inline-flex; flex-direction: column; align-items: center;
  width: 96px; margin-bottom: .75rem;
  border: 2px solid var(--green); background: #fff; line-height: 1.1;
}
.date-day { font-size: 2.3rem; font-weight: 700; color: var(--green); padding: .4rem 0 .2rem; }
.date-month { width: 100%; background: var(--green); color: #fff; font-weight: 600; padding: .3rem 0; }

.glance-table { font-size: .93rem; }
.glance-table th { width: 34%; background: var(--green-soft); color: var(--green-dark); font-weight: 600; }
.glance-table th, .glance-table td { padding: .55rem .75rem; border-color: var(--border); vertical-align: top; }
.glance-table tr:last-child th, .glance-table tr:last-child td { border-bottom: 0; }

.side-links { list-style: none; margin: 0; padding: 0; }
.side-links li { border-bottom: 1px solid var(--border); }
.side-links li:last-child { border-bottom: 0; }
.side-links a { display: block; padding: .55rem 1rem; color: var(--text); text-decoration: none; }
.side-links a::before { content: "\F285"; font-family: "bootstrap-icons"; font-size: .75rem; color: var(--green); margin-right: .5rem; }
.side-links a:hover { background: var(--green-soft); color: var(--green-dark); }


/* ---------- Footer ---------- */
.site-footer { color: #d5deec; }
.footer-main { background: var(--navy); padding: 1.75rem 1.5rem; border-top: 4px solid var(--green); }
.footer-brand { display: flex; align-items: center; gap: .85rem; font-size: 1.2rem; font-weight: 700; color: #fff; margin-bottom: .75rem; line-height: 1.4; }
.footer-logo { flex: 0 0 auto; width: 60px; height: 60px; object-fit: contain; background: #fff; border-radius: 50%; padding: 6px; border: 2px solid var(--green); }
.footer-brand .footer-sub { color: #9fdcc0; font-weight: 600; font-size: 1.05rem; }
.footer-main p { font-size: .93rem; margin: 0; }
.footer-links { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .3rem 1.25rem; }
.footer-links a { color: #d5deec; text-decoration: none; font-size: .95rem; }
.footer-links a::before { content: "\203A"; margin-right: .4rem; color: #9fdcc0; }
.footer-links a:hover { color: #fff; text-decoration: underline; }
.footer-bottom {
  background: var(--green-dark); color: #e5f2ec; font-size: .86rem;
  padding: .6rem 1.5rem;
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .25rem 1rem;
}

/* Back to top */
.back-top {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 1030;
  width: 42px; height: 42px; display: grid; place-items: center;
  background: var(--green); color: #fff; text-decoration: none; font-size: 1.2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility .2s ease;
}
.back-top.show { opacity: 1; visibility: visible; }
.back-top:hover { background: var(--navy); color: #fff; }

#galleryModal .modal-content { border-radius: 0; border-top: 4px solid var(--green); }
#galleryModal .modal-title { color: var(--navy); font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  .slide-caption h1, .slide-caption h2 { font-size: 1.45rem; }
  .profile { grid-template-columns: 220px 1fr; }
  .profile-photo { width: 180px; }
  .profile-name { font-size: 1.55rem; }
  .profile-info { padding: 1.4rem 1.25rem; }
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 767.98px) {
  .site-header { min-height: 0; padding: .9rem 1rem; background: #fff; }
  .brand { gap: .75rem; }
  .brand-title { font-size: 1.4rem; }
  .brand-sub { font-size: 1.02rem; }
  .main-area { padding: .75rem; }
  .box-body { padding: 1rem; }
  .box-body p { text-align: left; }
  .hero-box .carousel-item img { aspect-ratio: 4 / 3; }
  .slide-caption { padding: 1.5rem 1rem 1.6rem; }
  .slide-caption h1, .slide-caption h2 { font-size: 1.2rem; }
  .slide-caption p { font-size: .9rem; }
  .hero-box .carousel-indicators { display: none; }
  .event-row { grid-template-columns: 1fr; gap: .9rem; }
  .topbar { font-size: .76rem; }
  .footer-main, .footer-bottom { padding-left: 1rem; padding-right: 1rem; }
  /* Header: language switch sits on its own row, top-right, above the brand */
  .site-header { flex-wrap: wrap; row-gap: .6rem; }
  .lang-switch { order: -1; width: auto; margin-left: auto; }
  .brand { width: 100%; }
  .brand-logo { height: 60px; }
  .brand-text { padding-left: .75rem; }
  .lang-btn { font-size: .85rem; padding: .25rem .7rem; }
  /* Featured profile stacks: large centred photo, then details */
  .profile { grid-template-columns: 1fr; }
  .profile-side { border-right: 0; border-bottom: 4px solid var(--red); padding: 1.4rem 1rem 1.1rem; }
  .profile-photo { width: 180px; }
  .profile-info { padding: 1.25rem 1rem; text-align: center; }
  .profile-name { font-size: 1.45rem; }
  .profile-name::after { left: 50%; transform: translateX(-50%); }
  .contact-item { text-align: left; }
  .profile-actions { justify-content: center; }
  .footer-logo { width: 52px; height: 52px; }
}
@media (max-width: 480px) {
  .officer-table th, .officer-table td { display: block; width: 100%; }
  .officer-table th { white-space: normal; border-bottom: 0; padding-bottom: .15rem; }
  .officer-table td { padding-top: .15rem; }
}
@media (max-width: 380px) {
  .brand-title { font-size: 1.22rem; }
  .brand-sub { font-size: .95rem; }
  .brand-logo { height: 52px; }
  .profile-name { font-size: 1.35rem; }
  .btn-gov { flex: 1 1 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
  .ticker-move { animation: none; padding-left: 1rem; white-space: normal; flex-wrap: wrap; }
}

@media print {
  .topbar, .main-nav, .ticker, .back-top { display: none !important; }
}
