/* =========================================================
   EngWeb Theme - Orange & White
   Primary: #ff5722  Navbar: #ff7247  Ink: #d84315
   ========================================================= */

:root {
    --cw-primary: #ff5722;
    --cw-primary-dark: #d84315;
    --cw-primary-hover: #f4511e;
    --cw-navbar: #ff7247;
    --cw-ink: #d84315;
    --cw-indigo: #d84315;
    --cw-text: #212121;
    --cw-light: #faf6f3;
}

* {
    font-family: 'Prompt', sans-serif;
}

body {
    color: var(--cw-text);
    background: #fff;
    font-size: 1rem;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Prompt', sans-serif;
    color: var(--cw-ink);
}

a {
    color: var(--cw-primary);
    text-decoration: none;
}

a:hover {
    color: var(--cw-primary-hover);
}

.btn-primary {
    background-color: var(--cw-primary-dark);
    border-color: var(--cw-primary-dark);
}

.btn-primary:hover {
    background-color: var(--cw-primary-hover);
    border-color: var(--cw-primary-hover);
}

.btn-outline-primary {
    color: var(--cw-primary);
    border-color: var(--cw-primary);
}

.btn-outline-primary:hover {
    background-color: var(--cw-primary);
    border-color: var(--cw-primary);
}

.text-cw-primary { color: var(--cw-primary); }
.text-cw-ink { color: var(--cw-ink); }
.text-cw-indigo { color: var(--cw-indigo); }
.bg-cw-ink { background-color: var(--cw-ink); }
.bg-cw-light { background-color: var(--cw-light); }

/* ---------- Topbar ---------- */
.topbar {
    background: #ffffff;
    color: var(--cw-ink);
    font-size: 0.88rem;
    padding: 0.45rem 0;
    border-bottom: 2px solid var(--cw-primary);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.topbar-item {
    gap: 0.5rem;
    color: #4a4556;
    font-weight: 500;
}

.topbar-icon-badge {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: #fff3e0;
    border: 1px solid #ffe0b2;
    color: var(--cw-primary, #d84315);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.topbar-social-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    background: #f4f6f8;
    border: 1px solid #e0e4e8;
    color: #555;
    transition: all 0.2s ease;
    text-decoration: none;
}

.topbar-social-btn.social-fb:hover { background: #1877f2; color: #fff; border-color: #1877f2; transform: translateY(-2px); }
.topbar-social-btn.social-x:hover { background: #000000; color: #fff; border-color: #000000; transform: translateY(-2px); }
.topbar-social-btn.social-yt:hover { background: #ff0000; color: #fff; border-color: #ff0000; transform: translateY(-2px); }
.topbar-social-btn.social-line:hover { background: #06c755; color: #fff; border-color: #06c755; transform: translateY(-2px); }

/* ---------- Navbar ---------- */
.navbar-engweb {
    background: linear-gradient(90deg, #d84315 0%, #e64a19 100%);
    box-shadow: 0 4px 20px rgba(216, 67, 21, 0.22);
}

.navbar-engweb .navbar-brand {
    flex-shrink: 0;
    white-space: nowrap;
}

.navbar-engweb .nav-link {
    font-weight: 600;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.92);
    padding: 0.5rem 0.75rem;
    white-space: nowrap;
    border-radius: 8px;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 1200px) {
    .navbar-engweb .nav-link {
        font-size: 0.88rem;
        padding: 0.5rem 0.42rem;
    }
}

@media (min-width: 1320px) {
    .navbar-engweb .nav-link {
        font-size: 0.92rem;
        padding: 0.55rem 0.55rem;
    }
}

@media (min-width: 1400px) {
    .navbar-engweb .nav-link {
        font-size: 0.98rem;
        padding: 0.65rem 0.75rem;
    }
}

@media (min-width: 1600px) {
    .navbar-engweb .nav-link {
        font-size: 1rem;
        padding: 0.75rem 0.9rem;
    }
}

/* Clear & High Contrast Hover on Navbar Links */
.navbar-engweb .nav-link:hover,
.navbar-engweb .nav-item:hover > .nav-link {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.24);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
}

.navbar-engweb .active > .nav-link,
.navbar-engweb .active > a,
.navbar-engweb .nav-link.active {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.28) !important;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    font-weight: 700;
}

.navbar-engweb .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.5);
}

.navbar-engweb .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-engweb .dropdown-menu {
    border: none;
    box-shadow: 0 10px 30px rgba(216, 67, 21, 0.18);
    border-radius: 12px;
    padding: 0.5rem;
    overflow: hidden;
    animation: dropdownFade 0.2s ease forwards;
}

@keyframes dropdownFade {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.navbar-engweb .dropdown-item {
    font-weight: 600;
    color: var(--cw-ink);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.navbar-engweb .dropdown-item:hover,
.navbar-engweb .dropdown-item:focus {
    background: var(--cw-light, #fbe9e7);
    color: var(--cw-primary, #d84315);
    transform: translateX(4px);
}

/* ---------- Hero slider ---------- */
#heroSlider .carousel-item {
    overflow: hidden;
}

.hero-slide {
    min-height: 440px;
    display: flex;
    align-items: center;
    background-image: var(--hero-bg);
    background-size: cover;
    background-position: center;
    position: relative;
    transition: background 0.5s ease;
}

.hero-slide.with-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.75) 0%, rgba(15, 23, 42, 0.45) 60%, rgba(15, 23, 42, 0.2) 100%);
    z-index: 1;
}

/* Gradient Presets */
.hero-bg-gradient-orange {
    background: linear-gradient(135deg, #991b1b 0%, #c2410c 50%, #ea580c 100%) !important;
}

.hero-bg-gradient-navy {
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #0369a1 100%) !important;
}

.hero-bg-gradient-tech {
    background: linear-gradient(135deg, #075985 0%, #0284c7 50%, #0891b2 100%) !important;
}

.hero-bg-gradient-emerald {
    background: linear-gradient(135deg, #064e3b 0%, #047857 50%, #059669 100%) !important;
}

.hero-bg-gradient-purple {
    background: linear-gradient(135deg, #3b0764 0%, #6b21a8 50%, #9333ea 100%) !important;
}

.hero-bg-gradient-ruby {
    background: linear-gradient(135deg, #881337 0%, #be123c 50%, #e11d48 100%) !important;
}

.hero-bg-gradient-amber {
    background: linear-gradient(135deg, #78350f 0%, #b45309 50%, #d97706 100%) !important;
}

.hero-bg-gradient-dark {
    background: linear-gradient(135deg, #18181b 0%, #27272a 50%, #3f3f46 100%) !important;
}

.hero-bg-gradient-indigo {
    background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4338ca 100%) !important;
}

.hero-slide-link:hover .hero-slide {
    filter: brightness(1.03);
}

.hero-slide .container { position: relative; z-index: 2; }

/* เนื้อหา fade + เลื่อนขึ้นเมื่อสไลด์เปลี่ยน */
#heroSlider .hero-title,
#heroSlider .hero-cta {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

#heroSlider .carousel-item.active .hero-title,
#heroSlider .carousel-item.active .hero-cta {
    opacity: 1;
    transform: translateY(0);
}

#heroSlider .hero-title {
    color: #fff;
    font-size: 2.3rem;
    font-weight: 700;
    line-height: 1.35;
    max-width: 800px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* ลูกศรนำทางแบบวงกลม */
#heroSlider .carousel-control-prev,
#heroSlider .carousel-control-next {
    background: rgba(0, 0, 0, 0.35);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    top: 50%;
    transform: translateY(-50%);
    margin: 0 16px;
    opacity: 0;
    transition: opacity 0.3s ease, background 0.3s ease;
}

#heroSlider .carousel-control-prev:hover,
#heroSlider .carousel-control-next:hover {
    background: rgba(0, 0, 0, 0.6);
}

#heroSlider:hover .carousel-control-prev,
#heroSlider:hover .carousel-control-next {
    opacity: 1;
}

/* Indicators แบบ pill */
#heroSlider .carousel-indicators [data-bs-target] {
    width: 26px;
    height: 6px;
    border-radius: 3px;
    background-color: rgba(255, 255, 255, 0.5);
    border: 0;
    transition: background-color 0.3s ease, width 0.3s ease;
}

#heroSlider .carousel-indicators .active {
    background-color: #fff;
    width: 40px;
}

/* ---------- Schedule cards ---------- */
.schedule-card {
    border-radius: 12px;
    padding: 1.5rem 1.25rem;
    color: #fff;
    height: 100%;
    box-shadow: 0 6px 18px rgba(216, 67, 21, 0.12);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: linear-gradient(135deg, var(--cw-primary) 0%, var(--cw-primary-hover) 100%);
}

.schedule-card.middle {
    background: linear-gradient(135deg, var(--cw-ink) 0%, #ff5722 100%);
}

.schedule-card.last { background: linear-gradient(135deg, #d84315 0%, #ff7247 100%); }

.schedule-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 28px rgba(216, 67, 21, 0.2);
}

.schedule-card .icon i {
    font-size: 2rem;
    opacity: 0.95;
}

.schedule-card h4 {
    color: #fff;
    font-weight: 700;
    margin: 0.75rem 0;
}

.schedule-card a {
    color: #fff;
    text-decoration: underline;
    font-size: 0.95rem;
}

.schedule-card a:hover { color: #ffe0d4; }

/* ---------- Section titles ---------- */
.section-title {
    position: relative;
    padding-bottom: 0.75rem;
    margin-bottom: 1.5rem;
}

.section-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 70px;
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--cw-primary), var(--cw-primary-hover));
}

.section-title h2, .section-title h3 {
    font-weight: 700;
    color: var(--cw-ink);
    font-size: clamp(1.35rem, 2.4vw, 1.7rem);
    line-height: 1.35;
    margin-bottom: 0;
}

.section-title.center-title { text-align: center; }
.section-title.center-title::after { left: 50%; transform: translateX(-50%); }

/* ---------- News cards ---------- */
.news-card {
    overflow: hidden;
    border: 2px solid #e2e8f0 !important;
    border-radius: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.3s ease;
    margin-bottom: 1.5rem;
    background: #ffffff;
    position: relative;
}

.news-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--cw-primary) 0%, #ea580c 50%, var(--cw-primary-hover) 100%);
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 5;
}

.news-card:hover {
    transform: translateY(-8px) !important;
    border-color: var(--cw-primary) !important;
    box-shadow: 0 16px 36px rgba(216, 67, 21, 0.2), 0 0 0 1px rgba(216, 67, 21, 0.15) !important;
}

.news-card:hover::before {
    transform: scaleX(1);
}

.news-card .news-img-wrapper,
.news-card a.news-img-wrapper {
    position: relative;
    width: 100%;
    height: 235px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    overflow: hidden;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 8px;
    border-bottom: 1px solid #edf2f7;
}

.news-card .news-img-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 55%, rgba(15, 23, 42, 0.22) 100%);
    opacity: 0;
    transition: opacity 0.35s ease;
    pointer-events: none;
}

.news-card:hover .news-img-wrapper::after {
    opacity: 1;
}

.news-card img,
.news-card .news-img-wrapper img {
    max-height: 100% !important;
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: block;
    margin: 0 auto;
}

.news-card:hover img,
.news-card:hover .news-img-wrapper img {
    transform: scale(1.08);
}

.news-card .card-body {
    padding: 1.25rem 1.35rem;
    display: flex;
    flex-direction: column;
}

.news-card .card-meta {
    font-size: 0.83rem;
    color: #64748b;
    font-weight: 500;
}

.news-card .card-meta i {
    color: var(--cw-primary);
    transition: transform 0.25s ease;
}

.news-card:hover .card-meta i {
    transform: scale(1.15);
}

.news-card .card-title {
    font-size: 1.02rem;
    font-weight: 600;
    color: var(--cw-ink);
    min-height: 3.2rem;
    line-height: 1.45;
    margin-bottom: 0.5rem;
    transition: color 0.25s ease;
}

.news-card .card-title a {
    color: var(--cw-ink);
    text-decoration: none;
    transition: color 0.25s ease;
}

.news-card:hover .card-title a {
    color: var(--cw-primary-dark);
}

.news-card .news-read-more {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--cw-primary);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: auto;
    padding-top: 0.65rem;
    border-top: 1px dashed #f1f5f9;
    transition: color 0.25s ease, gap 0.25s ease;
}

.news-card:hover .news-read-more {
    color: var(--cw-primary-dark);
    gap: 0.6rem;
}

/* Sidebar Latest News Widget */
.sidebar-news-card {
    border: 1px solid #e2e8f0 !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04) !important;
    overflow: hidden;
    background: #ffffff;
    padding: 1.25rem;
}

.sidebar-news-card .sidebar-header {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--cw-ink);
    position: relative;
    padding-bottom: 0.75rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #f1f5f9;
}

.sidebar-news-card .sidebar-header::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 45px;
    height: 2px;
    background: var(--cw-primary);
    border-radius: 2px;
}

.sidebar-news-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.65rem 0.75rem;
    border-radius: 12px;
    border: 1px solid transparent;
    text-decoration: none !important;
    margin-bottom: 0.5rem;
    transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
    background: transparent;
}

.sidebar-news-item:hover {
    background: #fff7ed;
    border-color: rgba(216, 67, 21, 0.22);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(216, 67, 21, 0.08);
}

.sidebar-news-thumb {
    width: 76px;
    height: 64px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.sidebar-news-item:hover .sidebar-news-thumb {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(216, 67, 21, 0.25);
}

.sidebar-news-title {
    font-weight: 600;
    color: var(--cw-ink);
    line-height: 1.4;
    font-size: 0.93rem;
    margin-bottom: 0.25rem;
    transition: color 0.2s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sidebar-news-item:hover .sidebar-news-title {
    color: var(--cw-primary-dark) !important;
}

.sidebar-news-date {
    font-size: 0.8rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: color 0.2s ease;
}

.sidebar-news-item:hover .sidebar-news-date {
    color: var(--cw-primary);
}

.badge-date {
    background: rgba(255, 87, 34, 0.12);
    color: var(--cw-primary-dark);
    font-weight: 600;
}

.news-main-image-wrapper {
    background: linear-gradient(135deg, #fbfcfd 0%, #f0f3f6 100%);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* ---------- Teacher cards ---------- */
.teacher-card {
    text-align: center;
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(216, 67, 21, 0.08);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease;
    background: #fff;
}

.teacher-card:hover { transform: translateY(-4px); }

.teacher-card img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 0.75rem;
    border: none;
    padding: 0;
}

.teacher-card h5 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--cw-ink);
    margin-bottom: 0.25rem;
}

.teacher-card p { color: var(--cw-indigo); font-weight: 600; font-size: 0.9rem; }

.head-teacher-card {
    border: 3px solid var(--cw-primary);
    box-shadow: 0 6px 18px rgba(255, 87, 34, 0.2);
}

/* ---------- Album cards ---------- */
.album-card { position: relative; border: none; border-radius: 12px; overflow: hidden; margin-bottom: 1.5rem; }
.album-card img { height: 220px; width: 100%; object-fit: cover; }
.album-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(216, 67, 21, 0.85), transparent 60%);
    color: #fff;
    display: flex;
    align-items: flex-end;
    padding: 1rem;
}
.album-card-overlay h5 { color: #fff; font-weight: 600; }

/* ---------- Photo grid & Lightbox Gallery ---------- */
.photo-item {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

.photo-item img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.photo-item:hover img {
    transform: scale(1.05);
    box-shadow: 0 10px 24px rgba(216, 67, 21, 0.2);
}

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
    z-index: 2050;
    user-select: none;
}

.lightbox.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: lightboxFadeIn 0.25s ease forwards;
}

@keyframes lightboxFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-topbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent);
    z-index: 2060;
    color: #fff;
}

.lightbox-counter {
    font-size: 0.95rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.18);
    padding: 0.35rem 0.95rem;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

.lightbox-caption {
    font-size: 0.95rem;
    color: #ffd9c7;
    max-width: 60%;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lightbox-content-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 4rem 4.5rem;
}

.lightbox-image {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.lightbox-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.25);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
    z-index: 2060;
    backdrop-filter: blur(4px);
}

.lightbox-btn:hover {
    background: var(--cw-primary, #ff5722);
    color: #fff;
    border-color: var(--cw-primary, #ff5722);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-btn.lightbox-prev {
    left: 1.25rem;
}

.lightbox-btn.lightbox-next {
    right: 1.25rem;
}

.lightbox-btn.lightbox-close {
    position: static;
    transform: none;
    width: 42px;
    height: 42px;
    font-size: 1.2rem;
}

.lightbox-btn.lightbox-close:hover {
    background: rgba(255, 59, 48, 0.9);
    border-color: rgba(255, 59, 48, 0.9);
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .lightbox-content-wrapper {
        padding: 3.5rem 1rem 2rem 1rem;
    }
    .lightbox-btn.lightbox-prev { left: 0.5rem; width: 42px; height: 42px; font-size: 1.1rem; }
    .lightbox-btn.lightbox-next { right: 0.5rem; width: 42px; height: 42px; font-size: 1.1rem; }
    .lightbox-caption { display: none; }
}

/* ---------- Content pages ---------- */
.content-page { padding: 3rem 0; }

.content-block {
    background: var(--cw-light);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border-left: 5px solid var(--cw-primary);
}

/* Course curriculum accordion credit badge alignment */
.accordion-button {
    display: flex;
    align-items: center;
}

.accordion-button .badge.ms-auto,
.accordion-button .badge:last-of-type {
    margin-left: auto !important;
    margin-right: 0.75rem !important;
    flex-shrink: 0;
}

.accordion-button::after {
    margin-left: 0 !important;
}

.content-block .content-block {
    border-left: none;
    background: transparent;
    padding: 0;
    margin-bottom: 1.5rem;
    border-radius: 0;
}

.content-block iframe,
.news-detail iframe,
.content-page iframe,
article iframe {
    max-width: 100% !important;
    border-radius: 10px;
}

.page-hero {
    background: linear-gradient(90deg, var(--cw-ink) 0%, var(--cw-primary) 130%);
    color: #fff;
    padding: 2.5rem 0;
}

.page-hero h1 { color: #fff; font-weight: 700; }

/* ---------- Footer ---------- */
.footer {
    background: linear-gradient(180deg, #d84315 0%, #ba340a 100%);
    color: #fff1eb;
    padding-top: 3.5rem;
    margin-top: 3.5rem;
    position: relative;
}

.footer h2, .footer h4 {
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer h2::after, .footer h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 36px;
    height: 3px;
    background: #ffccbc;
    border-radius: 2px;
}

.footer ul { list-style: none; padding: 0; }

.footer ul li { margin-bottom: 0.65rem; }

.footer ul li a {
    color: #ffe3d6;
    display: inline-flex;
    align-items: center;
    transition: transform 0.2s ease, color 0.2s ease, text-shadow 0.2s ease;
    text-decoration: none;
    font-size: 0.95rem;
}

.footer ul li a i {
    color: #ffab91;
    transition: transform 0.2s ease, color 0.2s ease;
}

/* Clear & High Contrast Hover on Footer Links */
.footer ul li a:hover {
    color: #ffffff !important;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
    transform: translateX(6px);
}

.footer ul li a:hover i {
    color: #ffffff;
    transform: translateX(3px);
}

/* Contact Info Items in Footer */
.footer-contact-item {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    margin-bottom: 0.85rem;
    color: #ffe8df;
    font-size: 0.95rem;
    line-height: 1.55;
}

.footer-brand-title span span {
    display: inline-block;
    white-space: nowrap;
    word-break: keep-all;
}

.footer-site-desc {
    color: #ffe3d6;
    font-size: 0.95rem;
    line-height: 1.6;
}

.footer-site-desc span {
    display: inline-block;
    white-space: nowrap;
    word-break: keep-all;
    margin-right: 0.25rem;
}

.footer-contact-address {
    color: #ffe8df;
    font-size: 0.95rem;
    line-height: 1.55;
}

.footer-contact-address span {
    display: inline-block;
    white-space: nowrap;
    word-break: keep-all;
    margin-right: 0.25rem;
}

.footer-contact-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.9rem;
    margin-top: 2px;
}

/* Social Media Icons with Distinct Badges & Brand Hover */
.footer .social {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.footer .social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.32);
    color: #ffffff;
    font-size: 1.15rem;
    transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, color 0.25s ease;
    backdrop-filter: blur(4px);
}

.footer .social a.social-fb:hover {
    background: #1877f2;
    border-color: #1877f2;
    color: #ffffff;
    transform: translateY(-4px);
    box-shadow: 0 6px 14px rgba(24, 119, 242, 0.45);
}

.footer .social a.social-x:hover {
    background: #000000;
    border-color: #ffffff;
    color: #ffffff;
    transform: translateY(-4px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45);
}

.footer .social a.social-yt:hover {
    background: #ff0000;
    border-color: #ff0000;
    color: #ffffff;
    transform: translateY(-4px);
    box-shadow: 0 6px 14px rgba(255, 0, 0, 0.45);
}

.footer .social a.social-line:hover {
    background: #06c755;
    border-color: #06c755;
    color: #ffffff;
    transform: translateY(-4px);
    box-shadow: 0 6px 14px rgba(6, 199, 85, 0.45);
}

.footer-copyright {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.18);
    margin-top: 2rem;
    padding: 1.25rem 0;
    font-size: 0.9rem;
    color: #ffe3d6;
    letter-spacing: 0.2px;
}

/* Visitor Counter in Footer */
.footer-visitor-counter {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-top: 1.5rem;
    margin-top: 2.5rem;
}

.visitor-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    padding: 0.45rem 1.1rem;
    border-radius: 30px;
    backdrop-filter: blur(6px);
    white-space: nowrap;
    transition: all 0.2s ease;
}

.visitor-stat-pill:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.visitor-stat-pill .stat-label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: #ffe8df;
    font-size: 0.88rem;
    font-weight: 500;
}

.visitor-stat-pill .stat-label i {
    font-size: 0.95rem;
    opacity: 0.85;
}

.visitor-stat-num {
    font-weight: 700;
    font-size: 0.95rem;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 10px;
    border-radius: 12px;
    letter-spacing: 0.5px;
}

.visitor-stat-num.highlight {
    background: #ffffff;
    color: var(--cw-primary-dark, #b71c1c);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* =========================================================
   Mobile Responsive Optimizations (All Screens < 1200px)
   ========================================================= */

/* Anti-Wobble & Fluid Media */
html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

.content-block img, .content-page img, .news-show img, .page-content img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: 12px;
}

.content-block table, .content-page table, .news-show table, .page-content table {
    display: block !important;
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

.content-block iframe, .content-page iframe {
    max-width: 100% !important;
    border-radius: 14px;
}

/* Mobile Navbar Dropdown & Collapse (< 1200px) */
@media (max-width: 1199.98px) {
    .navbar-engweb .navbar-collapse {
        background: rgba(216, 67, 21, 0.98);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-radius: 16px;
        padding: 1rem;
        margin-top: 0.75rem;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    }
    .navbar-engweb .nav-link {
        padding: 0.6rem 0.85rem !important;
        border-radius: 8px;
    }
    .navbar-engweb .nav-link:hover,
    .navbar-engweb .nav-link.active {
        background: rgba(255, 255, 255, 0.15);
    }
    .navbar-engweb .dropdown-menu {
        background: #ffffff !important;
        border-radius: 12px !important;
        margin: 0.35rem 0.5rem !important;
    }
}

/* Mobile Screens (< 768px) */
@media (max-width: 767.98px) {
    /* Topbar */
    .topbar {
        font-size: 0.78rem;
        padding: 0.3rem 0;
    }
    .topbar .container {
        justify-content: center !important;
        gap: 0.35rem !important;
    }
    .topbar-item {
        font-size: 0.76rem;
    }
    .topbar-icon-badge {
        width: 22px;
        height: 22px;
        font-size: 0.72rem;
    }

    /* Hero Slider */
    .hero-slide {
        min-height: 240px !important;
        padding: 1.75rem 0 !important;
    }
    #heroSlider .hero-title {
        font-size: clamp(1.2rem, 5.2vw, 1.55rem) !important;
        line-height: 1.35 !important;
        margin-bottom: 0.5rem !important;
    }
    #heroSlider .hero-cta {
        font-size: 0.84rem !important;
        padding: 0.4rem 1.1rem !important;
        margin-top: 0.4rem !important;
        border-radius: 30px !important;
    }
    #heroSlider .carousel-control-prev,
    #heroSlider .carousel-control-next {
        width: 34px !important;
        height: 34px !important;
        margin: 0 4px !important;
        opacity: 0.8 !important;
        background: rgba(0, 0, 0, 0.45) !important;
    }
    #heroSlider .carousel-indicators {
        margin-bottom: 0.5rem;
    }
    #heroSlider .carousel-indicators [data-bs-target] {
        width: 18px;
        height: 4px;
    }
    #heroSlider .carousel-indicators .active {
        width: 28px;
    }

    /* Teacher & Student Cards */
    .teacher-card {
        padding: 0.75rem 0.5rem !important;
        border-radius: 12px !important;
    }
    .teacher-card img {
        aspect-ratio: 4/5 !important;
        object-fit: cover !important;
        object-position: top center !important;
        border-radius: 10px !important;
        margin-bottom: 0.5rem !important;
    }
    .teacher-card h5 {
        font-size: 0.88rem !important;
        line-height: 1.3 !important;
        margin-bottom: 0.2rem !important;
    }
    .teacher-card p {
        font-size: 0.78rem !important;
        line-height: 1.25 !important;
        margin-bottom: 0 !important;
    }
    .head-teacher-card {
        padding: 1rem 0.75rem !important;
    }
    .head-teacher-card h5 {
        font-size: 1rem !important;
    }
    .head-teacher-card p {
        font-size: 0.84rem !important;
    }

    /* Footer on Mobile (< 768px) - 100% Readable & Balanced */
    .footer {
        padding-top: 2.25rem !important;
        margin-top: 2.25rem !important;
    }

    /* 1. Brand Section on Mobile */
    .footer .row > div:first-child {
        text-align: center !important;
        margin-bottom: 1.25rem !important;
    }
    .footer .row > div:first-child h2 {
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
        gap: 0.5rem !important;
        margin-bottom: 0.5rem !important;
    }
    .footer .row > div:first-child h2 img {
        width: 52px !important;
        height: 52px !important;
        margin: 0 auto !important;
        display: block !important;
    }
    .footer .row > div:first-child h2 span {
        display: block !important;
        color: #ffffff !important;
        font-size: 1.12rem !important;
        font-weight: 700 !important;
        line-height: 1.35 !important;
        text-align: center !important;
        word-break: keep-all !important;
        overflow-wrap: break-word !important;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25) !important;
    }
    .footer .row > div:first-child h2::after {
        display: none !important;
    }
    .footer .row > div:first-child p,
    .footer-site-desc {
        color: #ffffff !important;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
        font-size: 0.88rem !important;
        line-height: 1.65 !important;
        text-align: center !important;
        max-width: 330px !important;
        margin: 0.5rem auto 1.15rem !important;
    }
    .footer-site-desc span {
        display: inline-block !important;
        white-space: nowrap !important;
    }
    .footer .social {
        justify-content: center !important;
        margin-bottom: 0.5rem !important;
    }

    /* 2 & 3. Menu and Links in 2 Balanced Columns on Mobile */
    .footer .row > div:nth-child(2),
    .footer .row > div:nth-child(3) {
        width: 50% !important;
        flex: 0 0 50% !important;
        max-width: 50% !important;
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
        text-align: left !important;
        margin-bottom: 1.5rem !important;
    }
    .footer .row > div:nth-child(2) h2,
    .footer .row > div:nth-child(3) h2 {
        color: #ffffff !important;
        font-size: 1.05rem !important;
        font-weight: 700 !important;
        text-align: left !important;
        margin-bottom: 0.85rem !important;
        position: relative !important;
        padding-bottom: 0.4rem !important;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25) !important;
    }
    .footer .row > div:nth-child(2) h2::after,
    .footer .row > div:nth-child(3) h2::after {
        content: '' !important;
        position: absolute !important;
        bottom: 0 !important;
        left: 0 !important;
        transform: none !important;
        background: #ffccbc !important;
        width: 28px !important;
        height: 3px !important;
        border-radius: 2px !important;
    }
    .footer .row > div:nth-child(2) ul,
    .footer .row > div:nth-child(3) ul {
        display: block !important;
        text-align: left !important;
        padding: 0 !important;
        margin: 0 !important;
        list-style: none !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    .footer .row > div:nth-child(2) ul li,
    .footer .row > div:nth-child(3) ul li {
        margin-bottom: 0.55rem !important;
        list-style: none !important;
    }
    .footer .row > div:nth-child(2) ul li a,
    .footer .row > div:nth-child(3) ul li a {
        color: #ffffff !important;
        font-size: 0.86rem !important;
        font-weight: 500 !important;
        line-height: 1.35 !important;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25) !important;
        display: inline-flex !important;
        align-items: flex-start !important;
        text-decoration: none !important;
        word-break: break-word !important;
    }
    .footer .row > div:nth-child(2) ul li a i,
    .footer .row > div:nth-child(3) ul li a i {
        color: #ffeb3b !important;
        font-size: 0.85rem !important;
        margin-right: 0.4rem !important;
        margin-top: 2px !important;
        flex-shrink: 0 !important;
        filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3)) !important;
    }

    /* 4. Contact Us on Mobile */
    .footer .row > div:nth-child(4) {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
        text-align: center !important;
    }
    .footer .row > div:nth-child(4) h2 {
        color: #ffffff !important;
        font-size: 1.15rem !important;
        font-weight: 700 !important;
        text-align: center !important;
        margin-bottom: 1rem !important;
        position: relative !important;
        padding-bottom: 0.45rem !important;
        text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25) !important;
    }
    .footer .row > div:nth-child(4) h2::after {
        content: '' !important;
        position: absolute !important;
        bottom: 0 !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        background: #ffccbc !important;
        width: 36px !important;
        height: 3px !important;
        border-radius: 2px !important;
    }
    .footer-contact-item {
        display: flex !important;
        align-items: flex-start !important;
        text-align: left !important;
        justify-content: flex-start !important;
        max-width: 340px !important;
        margin: 0 auto 0.75rem !important;
        color: #ffffff !important;
        font-size: 0.88rem !important;
        line-height: 1.45 !important;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
    }
    .footer-contact-address {
        color: #ffffff !important;
        font-size: 0.88rem !important;
        line-height: 1.55 !important;
    }
    .footer-contact-address span {
        display: inline-block !important;
        white-space: nowrap !important;
        word-break: keep-all !important;
        margin-right: 0.25rem !important;
    }
    .footer-contact-icon {
        background: rgba(255, 255, 255, 0.25) !important;
        border: 1px solid rgba(255, 255, 255, 0.4) !important;
        color: #ffffff !important;
        flex-shrink: 0 !important;
        margin-right: 0.75rem !important;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2) !important;
    }

    /* Visitor Counter on Mobile */
    .footer-visitor-counter {
        border-top: 1px solid rgba(255, 255, 255, 0.2) !important;
        padding-top: 1.25rem !important;
        margin-top: 1.5rem !important;
    }
    .visitor-stat-pill {
        background: rgba(255, 255, 255, 0.16) !important;
        border: 1px solid rgba(255, 255, 255, 0.3) !important;
        color: #ffffff !important;
        padding: 0.35rem 0.85rem !important;
        font-size: 0.82rem !important;
    }
    .visitor-stat-pill .stat-label {
        color: #ffffff !important;
        font-size: 0.82rem !important;
    }
    .visitor-stat-num {
        color: #ffffff !important;
        background: rgba(0, 0, 0, 0.35) !important;
        font-weight: 700 !important;
    }
    .visitor-stat-num.highlight {
        background: #ffffff !important;
        color: #b71c1c !important;
    }
    .footer-copyright {
        background: rgba(0, 0, 0, 0.22) !important;
        color: #ffffff !important;
        font-size: 0.84rem !important;
        text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2) !important;
    }
}



