/* ============================================================
   মাদ্রাসা সাইট — ডিজাইন সিস্টেম (Light + Dark)
   ============================================================ */
:root {
  --primary: #0d5c2e;
  --primary-dark: #094520;
  --primary-light: #1a8049;
  --accent: #f5a623;
  --bg: #f4f6f5;
  --card-bg: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 2px 6px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.08);
  --radius: 8px;
}
[data-theme="dark"] {
  --primary: #1a8049;
  --primary-dark: #0d5c2e;
  --primary-light: #2ca766;
  --bg: #0f1614;
  --card-bg: #1a2421;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --border: #2a3531;
  --shadow: 0 2px 6px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.4);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Hind Siliguri', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-light); }
ul { list-style: none; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.text-center { text-align: center; }
.muted { color: var(--muted); }
.hide-sm { display: inline; }

/* ============== TOP BAR ============== */
.topbar {
  background: var(--primary-dark);
  color: #fff;
  font-size: 14px;
  padding: 6px 0;
}
.topbar-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.topbar-left span { margin-right: 16px; }
.topbar-right a { color: #fff; margin-left: 12px; }
.topbar-right a:hover { color: var(--accent); }

/* ============== HEADER ============== */
.site-header {
  background: #fff;
  padding: 16px 0;
  border-bottom: 3px solid var(--primary);
}
.header-inner { display: flex; align-items: center; gap: 18px; }
.logo { width: 80px; height: 80px; object-fit: contain; }
.header-text h1 {
  color: var(--primary);
  font-size: clamp(18px, 2.4vw, 28px);
  font-weight: 700;
  line-height: 1.3;
}
.header-text p { color: var(--muted); font-size: 14px; margin-top: 4px; }

/* ============== NAV ============== */
.main-nav {
  background: var(--primary);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow);
}
.main-nav .container { position: relative; }
.nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 16px;
  padding: 12px 0;
  cursor: pointer;
}
.nav-list { display: flex; flex-wrap: wrap; }
.nav-list > li { position: relative; }
.nav-list a {
  display: block;
  color: #fff;
  padding: 14px 16px;
  font-weight: 500;
  font-size: 15px;
  transition: background 0.2s;
}
.nav-list a:hover, .nav-list a.active {
  background: var(--primary-light);
  color: #fff;
}
.dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  min-width: 200px;
  box-shadow: var(--shadow-md);
  display: none;
  z-index: 60;
}
.dropdown a { color: var(--text); padding: 10px 14px; }
.dropdown a:hover { background: var(--bg); color: var(--primary); }
.has-dropdown:hover .dropdown { display: block; }

/* ============== HERO ============== */
.hero { background: #000; }
.carousel {
  position: relative;
  width: 100%;
  height: clamp(280px, 50vw, 520px);
  overflow: hidden;
}
.slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.8s;
  display: flex;
  align-items: flex-end;
}
.slide.active { opacity: 1; }
.slide-overlay {
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: #fff;
  padding: 40px 24px 32px;
  width: 100%;
  text-align: center;
}
.slide-overlay h2 { font-size: clamp(20px, 3vw, 32px); margin-bottom: 8px; }
.slide-overlay p { font-size: clamp(14px, 1.6vw, 18px); opacity: 0.95; }
.car-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.85);
  border: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  color: var(--primary);
  font-weight: bold;
}
.car-btn.prev { left: 16px; }
.car-btn.next { right: 16px; }
.car-btn:hover { background: #fff; }

/* ============== MARQUEE ============== */
.marquee-wrap {
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.marquee-inner { display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.marquee-label {
  background: var(--accent);
  color: #fff;
  padding: 6px 14px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  flex-shrink: 0;
}
.marquee { flex: 1; overflow: hidden; }
.marquee-track {
  display: inline-flex;
  gap: 48px;
  white-space: nowrap;
  animation: scroll 30s linear infinite;
  color: var(--primary-dark);
  font-weight: 500;
}
.marquee-track span::before { content: '● '; color: var(--accent); }
@keyframes scroll {
  from { transform: translateX(100%); }
  to { transform: translateX(-100%); }
}

/* ============== MAIN GRID ============== */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  padding-top: 24px;
  padding-bottom: 24px;
}
.main-col, .sidebar { display: flex; flex-direction: column; gap: 24px; }

/* ============== CARD ============== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-head {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card-head h3 { font-size: 17px; font-weight: 600; }
.more-link { color: #fff; font-size: 13px; opacity: 0.9; }
.more-link:hover { color: var(--accent); }
.card-body { padding: 18px; }
.card-body p + p { margin-top: 10px; }
.loading { color: var(--muted); text-align: center; padding: 20px; font-style: italic; }

/* ============== NOTICE LIST ============== */
.notice-list li {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--border);
  align-items: flex-start;
}
.notice-list li:last-child { border-bottom: 0; }
.notice-date {
  background: var(--primary);
  color: #fff;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 12px;
  text-align: center;
  min-width: 56px;
  flex-shrink: 0;
  line-height: 1.2;
}
.notice-date strong { display: block; font-size: 16px; }
.notice-title { font-weight: 500; color: var(--text); }
.notice-title:hover { color: var(--primary); }

/* ============== TEACHER GRID ============== */
.teacher-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}
.teacher-card {
  text-align: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 10px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.teacher-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.teacher-img {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 10px;
  border: 3px solid var(--primary);
}
.teacher-name { font-weight: 600; color: var(--primary-dark); font-size: 15px; }
.teacher-role { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ============== BLOG GRID ============== */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.blog-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}
.blog-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.blog-thumb { aspect-ratio: 16/10; object-fit: cover; background: var(--bg); }
.blog-info { padding: 12px; }
.blog-title { font-weight: 600; color: var(--text); font-size: 14px; line-height: 1.4; }
.blog-meta { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* Blog search + pagination */
.blog-search { display: flex; gap: 8px; margin-bottom: 14px; }
.blog-search input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.blog-search input:focus { border-color: var(--primary); }
.btn-ghost {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 14px;
  cursor: pointer;
  font-size: 16px;
  color: var(--muted);
}
.btn-ghost:hover { background: var(--border); }
.blog-footer { margin-top: 16px; text-align: center; }
.btn-primary {
  background: var(--primary);
  color: #fff;
  border: 0;
  padding: 10px 24px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-primary:hover { background: var(--primary-light); }
.btn-primary:disabled { opacity: 0.6; cursor: wait; }
.blog-status { margin-top: 8px; font-size: 13px; color: var(--muted); }

/* ============== GALLERY ============== */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.gallery-item {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 6px;
  background: var(--bg);
}
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.gallery-item:hover img { transform: scale(1.08); }

/* ============== SIDEBAR ============== */
.founder-img {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 12px;
  border: 4px solid var(--primary);
}
.link-list li { border-bottom: 1px dashed var(--border); }
.link-list li:last-child { border-bottom: 0; }
.link-list a { display: block; padding: 10px 4px; color: var(--text); font-size: 14px; }
.link-list a:hover { color: var(--primary); padding-left: 10px; transition: padding 0.2s; }

.stats-card .card-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.stat {
  background: var(--bg);
  border-radius: 6px;
  padding: 14px 8px;
  text-align: center;
}
.stat-num {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
}
.stat span:last-child { font-size: 13px; color: var(--muted); }

/* ============== FOOTER ============== */
.site-footer { background: var(--primary-dark); color: #d4e6da; margin-top: 32px; }
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  padding: 32px 16px;
}
.site-footer h4 { color: #fff; margin-bottom: 12px; font-size: 16px; }
.site-footer a { color: #d4e6da; }
.site-footer a:hover { color: var(--accent); }
.site-footer ul li { padding: 4px 0; }
.copyright {
  background: rgba(0,0,0,0.25);
  padding: 12px 0;
  text-align: center;
  font-size: 14px;
}

/* ============== NAV — desktop list visible, drawer toggle hidden ============== */
.nav-container { display: flex; align-items: center; }
.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  padding: 12px 4px;
  cursor: pointer;
}
.hamburger { display: inline-flex; flex-direction: column; gap: 4px; width: 22px; }
.hamburger span { display: block; height: 2px; background: #fff; border-radius: 2px; transition: transform 0.3s, opacity 0.3s; }
.nav-toggle[aria-expanded="true"] .hamburger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .hamburger span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .hamburger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ============== SIDE DRAWER (App-like) ============== */
.drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 84%;
  max-width: 320px;
  height: 100vh;
  background: var(--card-bg);
  z-index: 200;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 24px rgba(0,0,0,0.2);
  overflow-y: auto;
}
.drawer.open { transform: translateX(0); }
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 199;
  opacity: 0;
  transition: opacity 0.3s;
}
.drawer-backdrop.show { opacity: 1; }
.drawer-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
}
.drawer-head img { width: 48px; height: 48px; border-radius: 50%; background: #fff; padding: 2px; object-fit: contain; }
.drawer-head strong { display: block; font-size: 15px; }
.drawer-head small { opacity: 0.85; font-size: 12px; }
.drawer-close {
  margin-left: auto;
  background: rgba(255,255,255,0.2);
  border: 0;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
}
.drawer-nav { padding: 8px 0; flex: 1; }
.drawer-nav a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 20px;
  color: var(--text);
  font-size: 15px;
  border-left: 3px solid transparent;
  transition: background 0.15s, border-color 0.15s;
}
.drawer-nav a span { font-size: 20px; width: 24px; text-align: center; }
.drawer-nav a:hover, .drawer-nav a.active {
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  border-left-color: var(--primary);
  color: var(--primary);
}
.drawer-nav hr { border: 0; border-top: 1px solid var(--border); margin: 8px 16px; }
.drawer-foot { padding: 14px 20px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.drawer-foot p { margin: 2px 0; }

/* ============== ICON BUTTON (theme toggle) ============== */
.icon-btn {
  background: rgba(255,255,255,0.15);
  border: 0;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  margin-left: 12px;
  transition: background 0.2s;
}
.icon-btn:hover { background: rgba(255,255,255,0.3); }

/* ============== BACK TO TOP ============== */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: var(--primary);
  color: #fff;
  font-size: 22px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  z-index: 90;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.25s, transform 0.25s, background 0.2s;
}
.back-to-top.show { opacity: 1; transform: translateY(0); }
.back-to-top:hover { background: var(--primary-light); }

/* ============== LIGHTBOX ============== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.lightbox[hidden] { display: none !important; }
.lightbox img { max-width: 95vw; max-height: 80vh; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,0.5); }
.lightbox-caption { color: #fff; margin-top: 14px; font-size: 14px; text-align: center; max-width: 90vw; }
.lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: rgba(255,255,255,0.15);
  border: 0;
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
}
.lightbox-close:hover { background: rgba(255,255,255,0.3); }

/* ============== RESPONSIVE ============== */
@media (max-width: 960px) {
  .main-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .nav-list--desktop { display: none; }
}
@media (max-width: 720px) {
  .hide-sm { display: none; }
  .header-inner { flex-direction: column; text-align: center; gap: 10px; }
  .car-btn { width: 36px; height: 36px; font-size: 20px; }
  .back-to-top { bottom: 16px; right: 16px; width: 40px; height: 40px; }
}

/* ============== PRINT ============== */
@media print {
  .topbar, .main-nav, .drawer, .drawer-backdrop, .back-to-top, .car-btn, .marquee-wrap, .blog-search, .blog-footer, .site-footer .footer-grid > div:nth-child(n+2) { display: none !important; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
}

/* ============================================================
   নতুন ফিচার styles (v2)
   ============================================================ */

/* Hero CTA */
.hero-cta { margin-top: 1.2rem; display: flex; gap: .75rem; flex-wrap: wrap; }
.btn-ghost-light {
  display: inline-block; padding: .65rem 1.4rem; border: 2px solid #fff;
  color: #fff; border-radius: 6px; font-weight: 600; transition: .2s;
}
.btn-ghost-light:hover { background: #fff; color: var(--primary); }

/* Carousel dots */
.car-dots { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 3; }
.car-dots button {
  width: 10px; height: 10px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.5); cursor: pointer; padding: 0; transition: .2s;
}
.car-dots button.active { background: #fff; width: 28px; border-radius: 5px; }

/* Header search */
.header-search { position: relative; margin-left: auto; max-width: 280px; width: 100%; }
.header-search input {
  width: 100%; padding: .55rem .9rem; border: 1px solid var(--border);
  border-radius: 20px; background: var(--card-bg); color: var(--text); font-size: .9rem;
}
.global-search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: var(--shadow-md); max-height: 320px; overflow-y: auto; z-index: 100;
}
.global-search-results a {
  display: block; padding: .65rem .9rem; border-bottom: 1px solid var(--border);
  color: var(--text); font-size: .9rem;
}
.global-search-results a:hover { background: var(--bg); }
.global-search-results a small { display: block; color: var(--muted); font-size: .75rem; }
.global-search-results .empty { padding: 1rem; text-align: center; color: var(--muted); }

/* Principal message */
.principal-msg { display: flex; gap: 1rem; align-items: flex-start; }
.principal-msg img { width: 80px; height: 80px; border-radius: 50%; flex-shrink: 0; border: 3px solid var(--primary); }

/* Event list */
.event-list li {
  display: flex; gap: 1rem; align-items: center; padding: .85rem 0;
  border-bottom: 1px dashed var(--border);
}
.event-list li:last-child { border-bottom: 0; }
.event-date {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff; border-radius: 8px; min-width: 60px; text-align: center;
  padding: .4rem; line-height: 1.1;
}
.event-date strong { display: block; font-size: 1.3rem; }
.event-date small { font-size: .7rem; opacity: .9; }
.event-info strong { display: block; color: var(--text); }
.event-info small { color: var(--muted); }

/* Video grid */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.video-card {
  position: relative; cursor: pointer; border-radius: 8px; overflow: hidden;
  background: #000; aspect-ratio: 16/9; border: 0; padding: 0;
}
.video-card img { width: 100%; height: 100%; object-fit: cover; opacity: .85; transition: .2s; }
.video-card:hover img { opacity: 1; transform: scale(1.05); }
.video-play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 3rem; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.6);
  pointer-events: none;
}
.video-title {
  position: absolute; bottom: 0; left: 0; right: 0; padding: .5rem .75rem;
  background: linear-gradient(transparent, rgba(0,0,0,.8)); color: #fff;
  font-size: .85rem; text-align: left;
}
.video-modal-inner {
  width: 90vw; max-width: 900px; aspect-ratio: 16/9;
}
.video-modal-inner iframe { width: 100%; height: 100%; border: 0; border-radius: 8px; }

/* Download list */
.download-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .75rem; }
.download-item {
  display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  color: var(--text); transition: .2s;
}
.download-item:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow); }
.download-icon { font-size: 1.8rem; }
.download-info { flex: 1; min-width: 0; }
.download-info strong { display: block; font-size: .9rem; }
.download-info small { color: var(--muted); font-size: .75rem; }

/* Admission grid */
.admission-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.admission-card {
  padding: 1.2rem; background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff; border-radius: 10px; text-align: center;
}
.admission-card h4 { margin-bottom: .4rem; font-size: 1.1rem; }
.admission-card p { font-size: .85rem; opacity: .95; margin-bottom: .8rem; }
.admission-card .btn-primary { background: #fff; color: var(--primary); }

/* Result form */
.result-form .form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.result-form label { display: block; font-size: .85rem; color: var(--muted); }
.result-form input, .result-form select {
  width: 100%; padding: .55rem .75rem; border: 1px solid var(--border);
  border-radius: 6px; background: var(--card-bg); color: var(--text); margin-top: .25rem;
}
.result-output { margin-top: 1rem; padding: 1rem; border-radius: 8px; }
.result-output.success { background: #d1fae5; color: #065f46; }
.result-output.error { background: #fee2e2; color: #991b1b; }
[data-theme="dark"] .result-output.success { background: #064e3b; color: #6ee7b7; }
[data-theme="dark"] .result-output.error { background: #7f1d1d; color: #fca5a5; }

/* FAQ */
.faq-list details {
  border: 1px solid var(--border); border-radius: 8px; padding: .85rem 1rem;
  margin-bottom: .5rem; background: var(--bg);
}
.faq-list summary { cursor: pointer; font-weight: 600; color: var(--text); }
.faq-list details[open] summary { color: var(--primary); margin-bottom: .5rem; }
.faq-list p { color: var(--muted); font-size: .9rem; }

/* Contact */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.contact-form { display: flex; flex-direction: column; gap: .65rem; }
.contact-form input, .contact-form textarea {
  padding: .65rem .85rem; border: 1px solid var(--border); border-radius: 6px;
  background: var(--card-bg); color: var(--text); font-family: inherit; font-size: .9rem;
}
.contact-form textarea { resize: vertical; }
.map-wrap { margin-top: 1rem; border-radius: 8px; overflow: hidden; height: 200px; }
.map-wrap iframe { width: 100%; height: 100%; border: 0; }

/* Prayer list */
.prayer-list li {
  display: flex; justify-content: space-between; padding: .5rem 0;
  border-bottom: 1px dashed var(--border); font-size: .95rem;
}
.prayer-list li:last-child { border-bottom: 0; }
.prayer-list li span:last-child { color: var(--primary); font-weight: 600; }

/* Newsletter */
.newsletter-form { display: flex; flex-direction: column; gap: .5rem; margin-top: .5rem; }
.newsletter-form input {
  padding: .55rem .75rem; border: 1px solid var(--border); border-radius: 6px;
  background: var(--card-bg); color: var(--text);
}

/* WhatsApp floating button */
.whatsapp-btn {
  position: fixed; bottom: 90px; right: 20px; z-index: 99;
  width: 52px; height: 52px; border-radius: 50%;
  background: #25d366; color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; box-shadow: 0 4px 14px rgba(37,211,102,.4); transition: .2s;
}
.whatsapp-btn:hover { transform: scale(1.1); color: #fff; }

/* Toast */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--card-bg); padding: .8rem 1.5rem;
  border-radius: 30px; box-shadow: var(--shadow-md); z-index: 9999;
  animation: toastIn .3s ease-out;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 20px); } }

/* Responsive */
@media (max-width: 768px) {
  .header-search { max-width: 100%; margin-top: .5rem; }
  .header-inner { flex-wrap: wrap; }
  .contact-grid { grid-template-columns: 1fr; }
  .principal-msg { flex-direction: column; text-align: center; }
  .principal-msg img { margin: 0 auto; }
}

/* ============================================================
   v3 — মোবাইল অ্যাপ-সদৃশ উন্নতি (ডিজাইন token অপরিবর্তিত)
   ============================================================ */

/* Safe area for notched phones */
@supports (padding: env(safe-area-inset-bottom)) {
  body { padding-bottom: env(safe-area-inset-bottom); }
}

/* Faster touch */
a, button, .gallery-item, .video-card, .download-item, .blog-card, .teacher-card {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Smooth-scroll snap on horizontal lists কখনও দরকার হলে */
html { scroll-padding-top: 70px; scroll-padding-bottom: 80px; }

/* ============== BOTTOM NAV (App-like) ============== */
.bottom-nav {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  z-index: 150;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  justify-content: space-around;
  align-items: stretch;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
}
.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 4px;
  color: var(--muted);
  font-size: 11px;
  border-radius: 10px;
  transition: color 0.15s, background 0.15s;
  min-width: 0;
}
.bottom-nav a span { font-size: 20px; line-height: 1; }
.bottom-nav a small { font-size: 11px; font-weight: 500; }
.bottom-nav a.active,
.bottom-nav a:active { color: var(--primary); }
.bottom-nav a.active { background: color-mix(in srgb, var(--primary) 10%, transparent); }

/* Pull-to-refresh ইন্ডিকেটর */
.pull-refresh {
  position: fixed;
  top: 0; left: 50%;
  transform: translate(-50%, -60px);
  background: var(--primary);
  color: #fff;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  opacity: 0;
  z-index: 250;
  pointer-events: none;
  transition: transform 0.2s, opacity 0.2s;
}

/* Skeleton-জাতীয় ফিল লোডিং */
.loading {
  position: relative;
  overflow: hidden;
}
.loading::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--primary) 8%, transparent), transparent);
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* News card thumbnail wrapper — fixed aspect */
.blog-thumb-wrap {
  width: 100%;
  aspect-ratio: 16/10;
  background: var(--bg);
  overflow: hidden;
}
.blog-thumb-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.blog-card:hover .blog-thumb-wrap img { transform: scale(1.05); }

/* ============== মোবাইল breakpoint ============== */
@media (max-width: 860px) {
  .bottom-nav { display: flex; }
  /* নিচের bottom nav-এর জন্য জায়গা */
  body { padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px)); }
  .back-to-top { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
  .whatsapp-btn { bottom: calc(140px + env(safe-area-inset-bottom, 0px)); }

  /* হিরো-তে অ্যাপ-সদৃশ ছোট প্যাড */
  .carousel { height: clamp(220px, 45vw, 360px); }
  .slide-overlay { padding: 24px 16px 24px; }
  .slide-overlay h2 { font-size: 18px; }
  .slide-overlay p { font-size: 13px; }

  /* কার্ড — অ্যাপ-সদৃশ rounded বড় */
  .card { border-radius: 14px; margin: 0 2px; }
  .card-head { padding: 12px 16px; border-radius: 14px 14px 0 0; }
  .card-head h3 { font-size: 16px; }
  .card-body { padding: 14px; }

  /* News grid মোবাইলে 2 কলাম */
  .blog-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .blog-info { padding: 10px; }
  .blog-title { font-size: 13px; }
  .blog-meta { font-size: 11px; }

  /* Gallery মোবাইলে 3 কলাম, gap কমানো */
  .gallery-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }

  /* Teacher grid 2 কলাম */
  .teacher-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .teacher-img { width: 76px; height: 76px; }

  /* Video grid 1 কলাম মোবাইলে */
  .video-grid { grid-template-columns: 1fr; gap: 10px; }

  /* Download grid 1 কলাম */
  .download-list { grid-template-columns: 1fr; }

  /* Main grid spacing কমানো */
  .main-grid { gap: 14px; padding-top: 14px; padding-bottom: 14px; }
  .main-col, .sidebar { gap: 14px; }

  /* Topbar ছোট */
  .topbar { font-size: 12px; }
  .topbar-left span:first-child { margin-right: 8px; }

  /* Header — স্পেস কমানো */
  .site-header { padding: 10px 0; }
  .header-text h1 { font-size: 16px; }
  .header-text p { font-size: 12px; }
  .logo { width: 56px; height: 56px; }
}

@media (max-width: 480px) {
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
  .nav-toggle-text { display: none; }
  .marquee-label { font-size: 12px; padding: 4px 10px; }
}

/* Drawer নিচে bottom-nav এর উপরে শেষ হবে */
@media (max-width: 860px) {
  .drawer { padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px)); }
}

/* অ্যাপ-সদৃশ active feedback */
.bottom-nav a:active span { transform: scale(0.9); }
.btn-primary:active { transform: scale(0.97); }
.card:active { transform: scale(0.998); }

/* Print: bottom-nav লুকাও */
@media print {
  .bottom-nav, .pull-refresh { display: none !important; }
}
