/*
Theme Name: AK School Theme
Theme URI: https://dhakasmm.com
Author: Dhaka SMM
Author URI: https://dhakasmm.com
Description: সম্পূর্ণ বাংলা স্কুল ওয়েবসাইট থিম - এ. কে. উচ্চ বিদ্যালয় ও কলেজ
Version: 1.1.2
Requires at least: 5.8
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ak-school
Tags: school, education, bengali, responsive
*/

/* ===== CSS Variables ===== */
:root {
    --color-primary: #1a5276;
    --color-secondary: #c0392b;
    --color-accent: #27ae60;
    --color-bg: #f5f7fa;
    --color-white: #ffffff;
    --color-text: #2c3e50;
    --color-text-light: #7f8c8d;
    --color-border: #e0e6ed;
    --color-header-bg: #1a5276;
    --color-footer-bg: #1a3a52;
    --font-bengali: 'Noto Sans Bengali', 'Kalpurush', 'SutonnyMJ', Arial, sans-serif;
    --radius: 8px;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --transition: 0.25s ease;
    --header-height: 0px; /* JS দিয়ে set হবে */
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-bengali);
    font-size: 16px;
    line-height: 1.8;
    color: var(--color-text);
    background: var(--color-bg);
    /* বাংলা ফন্ট সর্বোচ্চ স্পষ্ট রেন্ডারিং */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "kern" 1, "liga" 1;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-secondary); }
ul { list-style: none; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-bengali);
    line-height: 1.4;
    color: var(--color-text);
    font-weight: 700;
    letter-spacing: 0;        /* বাংলায় letter-spacing দেওয়া উচিত না */
    word-spacing: 2px;         /* শব্দের মাঝে সামান্য ফাঁক — পড়তে সহজ */
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* বাংলা paragraph — পড়ার আরাম বাড়ানো */
p, li, td, th, label, input, textarea, select, button {
    font-family: var(--font-bengali);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes countUp {
    from { opacity: 0; transform: scale(0.8); }
    to   { opacity: 1; transform: scale(1); }
}
@keyframes pulse-border {
    0%   { box-shadow: 0 0 0 0 rgba(26,82,118,0.4); }
    70%  { box-shadow: 0 0 0 10px rgba(26,82,118,0); }
    100% { box-shadow: 0 0 0 0 rgba(26,82,118,0); }
}
@keyframes shimmer {
    0%   { background-position: -200% center; }
    100% { background-position: 200% center; }
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}
.animate-on-scroll.delay-1 { transition-delay: 0.1s; }
.animate-on-scroll.delay-2 { transition-delay: 0.2s; }
.animate-on-scroll.delay-3 { transition-delay: 0.3s; }
.animate-on-scroll.delay-4 { transition-delay: 0.4s; }

/* ===== Section Styles ===== */
.section-padding { padding: 64px 0; }
.section-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--color-primary);
    margin-bottom: 8px;
    position: relative;
    display: inline-block;
    letter-spacing: 0;
}
.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--color-secondary);
    margin-top: 6px;
    transition: width 0.4s ease;
}
.section-title:hover::after { width: 100%; }
.section-subtitle {
    color: var(--color-text-light);
    margin-bottom: 36px;
    font-size: 0.95rem;
}
.section-header { margin-bottom: 40px; }

/* ===== Top Bar ===== */
.topbar {
    background: var(--color-secondary);
    color: #fff;
    font-size: 0.82rem;
    padding: 6px 0;
    position: relative;
    z-index: 1001;
}
.topbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.topbar a { color: #fff; }
.topbar a:hover { opacity: 0.8; }
.topbar-left, .topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* ===== Header — মূল bug fix ===== */
/*
  সমস্যা ছিল: topbar ও site-header দুটোই আলাদাভাবে fixed/sticky ছিল না।
  scroll করলে topbar scroll হয়ে যেত এবং header reflow হয়ে
  বড় দেখাত এবং menu toggle নিচে নামত।
  
  সমাধান: .site-header-wrap কে position:sticky; top:0 করলাম।
  topbar + header একসাথে sticky থাকবে। header-inner flex নষ্ট
  হওয়ার কারণ ছিল flex-wrap:wrap + position:relative শুধু mobile-এ।
  সেটাও ঠিক করা হলো।
*/
.site-header-wrap {
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: box-shadow 0.3s ease;
}
.site-header-wrap.scrolled {
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.topbar-sticky {
    /* topbar এখন header-wrap এর ভেতরে */
}

.site-header {
    background: var(--color-primary);
    color: #fff;
    padding: 12px 0;
    /* sticky এখন parent .site-header-wrap এ, এখানে নয় */
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    /* flex-wrap: nowrap — এটাই মূল fix, wrap হলে toggle নিচে যায় */
    flex-wrap: nowrap;
    position: relative;
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    min-width: 0; /* overflow prevent */
}
.site-logo img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 50%;
    background: #fff;
    padding: 3px;
    flex-shrink: 0;
    animation: pulse-border 3s infinite;
}
.site-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.3;
    /* long title overflow handle */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
.site-tagline {
    font-size: 0.75rem;
    opacity: 0.85;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== Navigation ===== */
.main-nav { flex-shrink: 0; }
.main-nav ul {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-wrap: nowrap;
}
.main-nav a {
    color: rgba(255,255,255,0.9);
    font-size: 0.88rem;
    padding: 7px 12px;
    border-radius: var(--radius);
    font-weight: 500;
    transition: background var(--transition), color var(--transition), transform 0.2s;
    white-space: nowrap;
    display: block;
}
.main-nav a:hover,
.main-nav .current-menu-item a {
    background: rgba(255,255,255,0.18);
    color: #fff;
    transform: translateY(-1px);
}

/* Mobile Menu Button — সবসময় right-aligned, never wraps down */
.menu-toggle {
    display: none;
    background: rgba(255,255,255,0.18);
    border: 2px solid rgba(255,255,255,0.3);
    color: #fff;
    font-size: 1.3rem;
    padding: 7px 11px;
    border-radius: var(--radius);
    cursor: pointer;
    flex-shrink: 0;
    margin-left: auto;
    transition: background 0.2s, transform 0.2s;
    line-height: 1;
}
.menu-toggle:hover { background: rgba(255,255,255,0.28); }
.menu-toggle.active { transform: rotate(90deg); }

/* ===== Banner / Hero ===== */
.hero-banner {
    position: relative;
    height: 500px;
    overflow: hidden;
    background: #1a3a52;
}
.hero-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1s ease;
    transform: scale(1.04);
    transition: opacity 1s ease, transform 6s ease;
}
.hero-slide.active {
    opacity: 1;
    transform: scale(1);
}
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(26,82,118,0.78) 0%, rgba(192,57,43,0.48) 100%);
}
.hero-content {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    padding: 20px;
}
.hero-text-wrap {
    animation: fadeInUp 0.8s ease 0.2s both;
}
.hero-content h1 {
    font-size: 2.4rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.45);
    margin-bottom: 12px;
}
.hero-content p {
    font-size: 1.05rem;
    opacity: 0.95;
    max-width: 560px;
    margin: 0 auto 24px;
}
.hero-btn {
    display: inline-block;
    background: var(--color-secondary);
    color: #fff;
    padding: 12px 32px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 4px 15px rgba(192,57,43,0.4);
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.hero-btn:hover {
    background: #a93226;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(192,57,43,0.5);
}

.hero-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 2;
}
.hero-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
    cursor: pointer;
    border: none;
    transition: background var(--transition), transform 0.2s;
}
.hero-dot.active {
    background: #fff;
    transform: scale(1.3);
}

/* ===== Stats Bar ===== */
.stats-bar {
    background: var(--color-primary);
    color: #fff;
    padding: 28px 0;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    text-align: center;
}
.stat-item {
    padding: 12px;
    border-right: 1px solid rgba(255,255,255,0.15);
    animation: countUp 0.6s ease both;
}
.stat-item:last-child { border-right: none; }
.stat-item h3 {
    font-size: 2.2rem;
    color: #f9ca24;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.stat-item p { font-size: 0.85rem; opacity: 0.85; margin-top: 6px; }

/* ===== About Section ===== */
.about-section { background: #fff; }
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
}
.about-image {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    position: relative;
}
.about-image::after {
    content: '';
    position: absolute;
    inset: 8px -8px -8px 8px;
    border: 3px solid var(--color-primary);
    border-radius: var(--radius);
    z-index: -1;
    opacity: 0.3;
}
.about-image img { width: 100%; height: 320px; object-fit: cover; transition: transform 0.4s ease; }
.about-image:hover img { transform: scale(1.03); }
.about-text p { color: var(--color-text-light); margin-bottom: 16px; }
.about-info-list { margin-top: 20px; }
.about-info-list li {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.92rem;
}
.about-info-list li strong { color: var(--color-primary); min-width: 130px; }

/* ===== Principal Message ===== */
.principal-section { background: var(--color-bg); }
.principal-card {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 40px;
    align-items: start;
    border-left: 4px solid var(--color-primary);
}
.principal-photo { text-align: center; }
.principal-photo img {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--color-primary);
    margin: 0 auto 12px;
    transition: transform 0.3s;
}
.principal-photo img:hover { transform: scale(1.05); }
.principal-photo .name { font-weight: 700; color: var(--color-primary); }
.principal-photo .role { font-size: 0.85rem; color: var(--color-text-light); }
.principal-message h3 { color: var(--color-primary); margin-bottom: 16px; font-size: 1.2rem; }
.principal-message blockquote {
    border-left: 4px solid var(--color-secondary);
    padding-left: 20px;
    color: var(--color-text-light);
    font-style: italic;
    line-height: 1.8;
}

/* ===== Notice Board ===== */
.notice-section { background: #fff; }
.notice-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 32px;
}
.notice-item {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--color-border);
    align-items: flex-start;
    transition: background 0.2s;
}
.notice-item:hover { background: #f8fafc; padding-left: 8px; border-radius: 4px; }
.notice-date {
    background: var(--color-primary);
    color: #fff;
    text-align: center;
    padding: 8px 12px;
    border-radius: var(--radius);
    min-width: 60px;
    flex-shrink: 0;
}
.notice-date .day { font-size: 1.4rem; font-weight: 700; line-height: 1; }
.notice-date .month { font-size: 0.75rem; opacity: 0.85; }
.notice-info h4 { font-size: 0.95rem; margin-bottom: 4px; }
.notice-info p { font-size: 0.82rem; color: var(--color-text-light); }
.notice-badge {
    display: inline-block;
    background: var(--color-secondary);
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 50px;
    margin-left: 8px;
}

.quick-links-card {
    background: var(--color-bg);
    border-radius: var(--radius);
    padding: 24px;
}
.quick-links-card h3 { color: var(--color-primary); margin-bottom: 16px; font-size: 1rem; }
.quick-link-btn {
    display: block;
    background: var(--color-primary);
    color: #fff;
    padding: 10px 16px;
    border-radius: var(--radius);
    margin-bottom: 10px;
    font-size: 0.88rem;
    text-align: center;
    font-weight: 500;
    transition: background var(--transition), transform 0.2s;
}
.quick-link-btn:hover {
    background: var(--color-secondary);
    color: #fff;
    transform: translateX(4px);
}

/* ===== News Section ===== */
.news-section { background: var(--color-bg); }
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}
.news-card {
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
}
.news-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}
.news-card-img { height: 180px; overflow: hidden; background: var(--color-border); }
.news-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.news-card:hover .news-card-img img { transform: scale(1.06); }
.news-card-body { padding: 20px; }
.news-card-date { font-size: 0.78rem; color: var(--color-text-light); margin-bottom: 8px; }
.news-card-title { font-size: 1rem; margin-bottom: 8px; color: var(--color-text); }
.news-card-excerpt { font-size: 0.85rem; color: var(--color-text-light); line-height: 1.6; }
.news-card-link {
    display: inline-block;
    margin-top: 12px;
    color: var(--color-primary);
    font-size: 0.85rem;
    font-weight: 600;
    transition: gap 0.2s;
}
.news-card-link::after { content: ' →'; }
.news-card:hover .news-card-link { color: var(--color-secondary); }

/* ===== Teachers Section ===== */
.teachers-section { background: #fff; }
.teachers-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}
.teacher-card {
    text-align: center;
    background: var(--color-bg);
    border-radius: var(--radius);
    padding: 24px 16px;
    transition: box-shadow var(--transition), transform var(--transition);
    border: 1px solid transparent;
}
.teacher-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
    border-color: var(--color-border);
}
.teacher-photo {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 14px;
    border: 3px solid var(--color-primary);
    transition: border-color 0.3s, transform 0.3s;
}
.teacher-card:hover .teacher-photo {
    border-color: var(--color-secondary);
    transform: scale(1.05);
}
.teacher-name { font-size: 0.95rem; font-weight: 700; color: var(--color-text); margin-bottom: 4px; }
.teacher-subject { font-size: 0.82rem; color: var(--color-text-light); }
.teacher-designation {
    display: inline-block;
    background: var(--color-primary);
    color: #fff;
    font-size: 0.72rem;
    padding: 3px 10px;
    border-radius: 50px;
    margin-top: 8px;
}

/* ===== Gallery Section ===== */
.gallery-section { background: var(--color-bg); }
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}
.gallery-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 1;
    cursor: pointer;
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.gallery-item:hover img { transform: scale(1.1); }
.gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(26,82,118,0.65);
    opacity: 0;
    transition: opacity var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2rem;
}
.gallery-item:hover .gallery-overlay { opacity: 1; }

/* ===== Contact Section ===== */
.contact-section { background: #fff; }
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
}
.contact-info-item {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    align-items: flex-start;
}
.contact-icon {
    width: 44px;
    height: 44px;
    background: var(--color-primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    transition: transform 0.2s, background 0.2s;
}
.contact-info-item:hover .contact-icon {
    background: var(--color-secondary);
    transform: scale(1.1);
}
.contact-detail h4 { font-size: 0.9rem; color: var(--color-primary); margin-bottom: 4px; }
.contact-detail p { font-size: 0.88rem; color: var(--color-text-light); }

.social-links { display: flex; gap: 12px; margin-top: 24px; }
.social-link {
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    transition: transform 0.2s, box-shadow 0.2s;
}
.social-link:hover { transform: translateY(-3px); box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.social-link.facebook { background: #1877f2; }
.social-link.youtube { background: #ff0000; }

.map-container { border-radius: var(--radius); overflow: hidden; height: 300px; }
.map-container iframe { width: 100%; height: 100%; border: none; }

/* ===== Footer ===== */
.site-footer {
    background: var(--color-footer-bg);
    color: rgba(255,255,255,0.85);
    padding: 48px 0 24px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 32px;
}
.footer-about .footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.footer-about .footer-logo img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    background: #fff;
    border-radius: 50%;
    padding: 3px;
}
.footer-about .footer-logo span { font-size: 1rem; font-weight: 700; color: #fff; }
.footer-about p { font-size: 0.85rem; line-height: 1.7; }

.footer-heading {
    color: #fff;
    font-size: 1rem;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--color-secondary);
    display: inline-block;
}
.footer-links li { margin-bottom: 8px; }
.footer-links a {
    color: rgba(255,255,255,0.75);
    font-size: 0.88rem;
    transition: color 0.2s, padding-left 0.2s;
}
.footer-links a:hover { color: #fff; padding-left: 4px; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.82rem;
}
.footer-bottom a { color: rgba(255,255,255,0.75); }

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
    font-family: var(--font-bengali);
}
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: #154360; color: #fff; transform: translateY(-1px); }
.btn-secondary { background: var(--color-secondary); color: #fff; }
.btn-secondary:hover { background: #a93226; color: #fff; transform: translateY(-1px); }
.btn-outline {
    background: transparent;
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
}
.btn-outline:hover { background: var(--color-primary); color: #fff; }

/* ===== View All Link ===== */
.view-all { text-align: center; margin-top: 32px; }

/* ===== Lightbox ===== */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    animation: fadeInUp 0.2s ease;
}
.lightbox.open { display: flex; }
.lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.lightbox-close {
    position: absolute;
    top: 20px; right: 24px;
    color: #fff;
    font-size: 2.4rem;
    cursor: pointer;
    background: none;
    border: none;
    line-height: 1;
    transition: transform 0.2s;
}
.lightbox-close:hover { transform: scale(1.2) rotate(90deg); }

/* ===== Back to Top ===== */
.back-to-top {
    position: fixed;
    bottom: 28px;
    right: 24px;
    width: 44px;
    height: 44px;
    background: var(--color-primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s, transform 0.3s, background 0.2s;
    z-index: 999;
}
.back-to-top.visible { opacity: 1; transform: translateY(0); }
.back-to-top:hover { background: var(--color-secondary); }

/* ===== Responsive — Tablet ===== */
@media (max-width: 1024px) {
    .teachers-grid { grid-template-columns: repeat(3, 1fr); }
    .gallery-grid { grid-template-columns: repeat(3, 1fr); }
    .news-grid { grid-template-columns: repeat(2, 1fr); }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-item { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.12); }
    .stat-item:nth-child(2n) { border-bottom: none; }
}

/* ===== Responsive — Mobile (≤768px) ===== */
@media (max-width: 768px) {
    /* Header fix — মোবাইলে */
    .site-title { font-size: 0.95rem; -webkit-line-clamp: 2; }
    .site-tagline { display: none; } /* tagline লুকাও, space বাঁচাও */
    .site-logo img { width: 48px; height: 48px; }
    .site-branding { gap: 8px; }

    /* Menu toggle সবসময় দেখাবে, কখনো নিচে নামবে না */
    .menu-toggle { display: flex; align-items: center; justify-content: center; }

    /* Nav মোবাইলে dropdown */
    .main-nav {
        display: none;
        position: absolute;
        top: calc(100% + 1px); /* header এর নিচে */
        left: 0;
        right: 0;
        background: #154a6e; /* থেকে একটু গাঢ় */
        padding: 12px 16px 16px;
        border-top: 2px solid rgba(255,255,255,0.12);
        box-shadow: 0 8px 24px rgba(0,0,0,0.2);
        z-index: 999;
        border-radius: 0 0 var(--radius) var(--radius);
    }
    .main-nav.open { display: block; animation: fadeInUp 0.2s ease; }
    .main-nav ul { flex-direction: column; gap: 2px; }
    .main-nav a {
        padding: 10px 14px;
        font-size: 0.95rem;
        border-radius: 6px;
    }

    /* header-inner: branding বাম, toggle ডান — কখনো wrap নয় */
    .header-inner {
        flex-wrap: nowrap;
        align-items: center;
    }

    /* Content */
    .hero-banner { height: 320px; }
    .hero-content h1 { font-size: 1.5rem; }
    .hero-content p { font-size: 0.9rem; }
    .about-grid { grid-template-columns: 1fr; }
    .principal-card { grid-template-columns: 1fr; text-align: center; padding: 24px; }
    .notice-grid { grid-template-columns: 1fr; }
    .teachers-grid { grid-template-columns: repeat(2, 1fr); }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
    .news-grid { grid-template-columns: 1fr; }
    .contact-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr; }
    .footer-bottom { flex-direction: column; text-align: center; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .section-title { font-size: 1.4rem; }
}

/* ===== Responsive — Small Mobile (≤480px) ===== */
@media (max-width: 480px) {
    .section-padding { padding: 40px 0; }
    .hero-content h1 { font-size: 1.25rem; }
    .hero-btn { padding: 10px 22px; font-size: 0.88rem; }
    .teachers-grid { grid-template-columns: 1fr 1fr; }
    .gallery-grid { grid-template-columns: repeat(2, 1fr); }
    .topbar .container { justify-content: center; }
    .topbar-left { display: none; }
    .about-image img { height: 220px; }
    .stat-item h3 { font-size: 1.7rem; }
    .container { padding: 0 14px; }
}
