/* ==========================================================================
   1. BASE STYLES & VARIABLES
   ========================================================================== */
:root {
    --primary-color: #0b3d91;
    --primary-dark: #06255c;
    --secondary-color: #0f766e;
    --secondary-dark: #0a524c;
    --accent-blue: #2563eb;
    --bg-light: #f1f5f9;
    --white: #ffffff;
    --text-dark: #1e293b;
    --text-muted: #475569;
    --border-light: #e2e8f0;

    /* Vision & Mission Themes */
    --vision-header-bg: #1e3a8a;
    --vision-gradient: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    --mission-header-bg: #065f46;
    --mission-gradient: linear-gradient(135deg, #059669 0%, #047857 100%);

    font-size: 16px; /* Increased from 14px */
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', 'Segoe UI', Arial, sans-serif;
    margin: 0;
    padding: 24px 16px;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.7;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ==========================================================================
   2. MAIN CONTAINER & HERO BANNER
   ========================================================================== */
.dept-section {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto 2rem auto;
    background-color: var(--white);
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    overflow: hidden;
}

.dept-header {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.dept-header img {
    width: 100%;
    height: 360px;
    object-fit: cover;
}

.dept-header-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(6, 37, 92, 0.85) 0%, rgba(6, 37, 92, 0.25) 60%, transparent 100%);
    display: flex;
    align-items: flex-end;
    padding: 36px 44px;
}

.dept-header-overlay h1 {
    margin: 0;
    color: var(--white);
    font-size: 2.4rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

/* ==========================================================================
   3. INTRO SECTION
   ========================================================================== */
.dept-intro {
    padding: 40px 44px 24px;
}

.intro-text {
    font-size: 1.15rem; /* ~18.5px */
    line-height: 1.85;
    color: var(--text-muted);
    text-align: justify;
}

.paragraph-indent {
    text-indent: 42px;
    margin: 0 0 18px 0;
}

.paragraph-indent:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   4. INLINE PHOTO GALLERY
   ========================================================================== */
.dept-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 920px;
    margin: 16px auto 40px;
    padding: 0 44px;
}

.gallery-item {
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.gallery-item img {
    width: 100%;
    height: 210px;
    object-fit: cover;
    transition: transform 0.35s ease;
}

.gallery-item img:hover {
    transform: scale(1.06);
}

/* ==========================================================================
   5. OBJECTIVES SECTION
   ========================================================================== */
.dept-objectives {
    padding: 20px 44px 36px;
}

.dept-objectives h2 {
    font-size: 1.85rem;
    color: var(--primary-color);
    border-bottom: 3px solid var(--secondary-color);
    display: inline-block;
    padding-bottom: 8px;
    margin: 0 0 24px 0;
}

.dept-objectives ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.dept-objectives li {
    position: relative;
    padding: 16px 20px 16px 52px;
    background-color: #f8fafc;
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--secondary-color);
    border-radius: 10px;
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--text-dark);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dept-objectives li:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(15, 118, 110, 0.08);
}

.dept-objectives li::before {
    content: "\2714";
    position: absolute;
    left: 18px;
    top: 17px;
    color: var(--secondary-color);
    font-weight: 700;
    font-size: 1.2rem;
}

/* ==========================================================================
   6. VISION & MISSION SECTION
   ========================================================================== */
.vm-container {
    display: flex;
    gap: 24px;
    padding: 16px 44px 40px;
}

.vm-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}

.vm-header {
    padding: 18px 24px;
    text-align: center;
    color: var(--white);
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-size: 1.35rem;
}

.vm-content {
    padding: 28px 26px;
    flex: 1;
    color: var(--white);
}

.vision-header { background-color: var(--vision-header-bg); }
.vision-content { background: var(--vision-gradient); }

.mission-header { background-color: var(--mission-header-bg); }
.mission-content { background: var(--mission-gradient); }

.vm-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.vm-content li {
    position: relative;
    padding-left: 34px;
    margin-bottom: 16px;
    line-height: 1.7;
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.96);
}

.vm-content li:last-child {
    margin-bottom: 0;
}

.vm-content li::before {
    content: "\27A4";
    position: absolute;
    left: 0;
    top: 2px;
    font-size: 1.15rem;
    color: #fde047;
}

/* ==========================================================================
   7. FACULTY SECTION
   ========================================================================== */
.dept-faculty {
    padding: 24px 44px 48px;
    background-color: #f8fafc;
    border-top: 1px solid var(--border-light);
}

.faculty-title {
    text-align: center;
    font-size: 1.95rem;
    color: var(--primary-color);
    margin: 12px 0 32px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.faculty-hod {
    max-width: 300px;
    margin: 0 auto 36px;
    background: var(--white);
    padding: 24px 20px;
    border-radius: 14px;
    border-top: 5px solid var(--primary-color);
    box-shadow: 0 8px 22px rgba(11, 61, 145, 0.1);
    text-align: center;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.faculty-hod:hover,
.faculty-hod:focus {
    transform: translateY(-6px);
    box-shadow: 0 14px 28px rgba(11, 61, 145, 0.16);
    outline: none;
}

.faculty-hod img {
    width: 170px;
    height: 210px;
    object-fit: cover;
    border-radius: 10px;
    border: 3px solid var(--primary-color);
    margin: 0 auto 14px;
}

.faculty-hod p {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 6px;
}

.faculty-hod small {
    display: inline-block;
    font-size: 0.98rem;
    font-weight: 600;
    color: var(--secondary-color);
    background-color: #ecfdf5;
    padding: 4px 12px;
    border-radius: 20px;
}

.lectures,
.sup_staff {
    display: flex;
    justify-content: center; /* Horizontally centers every row, even with 5 cards */
    align-items: stretch;    /* Keeps cards in the same row equal height */
    flex-wrap: wrap;
    gap: 24px;
    width: 100%;
    max-width: 100%;
    margin: 0 auto 28px;
}

.sup_staff {
    margin-bottom: 0;
}

.lectures .member-card,
.sup_staff .member-card {
    flex: 0 1 240px;         /* Consistent card width across both sections */
    width: 240px;
}

.sup_staff .member-card {
    flex: 0 1 260px;         /* Fixed matching width for both cards */
    width: 260px;
}

.member-card {
    background: var(--white);
    padding: 22px 18px;
    border-radius: 14px;
    border: 1px solid var(--border-light);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
    text-align: center;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.member-card:hover,
.member-card:focus {
    transform: translateY(-6px);
    border-color: var(--accent-blue);
    box-shadow: 0 12px 24px rgba(37, 99, 235, 0.12);
    outline: none;
}

.member-card img {
    width: 150px;
    height: 190px;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid var(--primary-color);
    margin: 0 auto 12px;
}

.member-card p {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 6px;
}

.member-card small {
    font-size: 0.98rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ==========================================================================
   8. EXTENDED GALLERY TOGGLE & GRID
   ========================================================================== */
.gallery-link {
    display: block;
    width: 100%;
    max-width: 1180px;
    margin: 0 auto 24px;
    text-align: center;
    padding: 18px 24px;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--secondary-dark) 100%);
    color: var(--white);
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(15, 118, 110, 0.22);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gallery-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(15, 118, 110, 0.3);
}

.gallery-link i {
    margin-right: 10px;
}

.dept-gallery-ext {
    display: none;
    width: 100%;
    max-width: 1180px;
    margin: 0 auto 40px;
    padding: 24px;
    background-color: var(--white);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    border-radius: 14px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
}

.gallery-item-ext {
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.gallery-item-ext img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.gallery-item-ext img:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

/* ==========================================================================
   9. MODALS (IMAGE & FACULTY PROFILE)
   ========================================================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    inset: 0;
    padding: 60px 20px;
    overflow: auto;
    background-color: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(4px);
}

.profile-modal-content {
    background-color: var(--white);
    margin: 0 auto;
    padding: 36px;
    width: 92%;
    max-width: 720px;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    color: var(--text-dark);
    position: relative;
    animation: slideDown 0.3s ease;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 18px;
}

.profile-modal-img {
    width: 135px;
    height: 170px;
    object-fit: cover;
    border-radius: 10px;
    border: 3px solid var(--primary-color);
    flex-shrink: 0;
}

.profile-modal-content h3 {
    color: var(--primary-color);
    margin: 0 0 8px;
    font-size: 1.75rem;
}

.profile-modal-content h4 {
    color: var(--secondary-color);
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
}

.profile-modal-content hr {
    border: 0;
    border-top: 1px solid var(--border-light);
    margin: 20px 0;
}

.profile-modal-content p {
    font-size: 1.125rem;
    line-height: 1.7;
    margin: 10px 0;
}

.profile-modal-content a {
    color: var(--accent-blue);
    text-decoration: none;
}

.profile-modal-content a:hover {
    text-decoration: underline;
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 82vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.close-btn {
    font-size: 38px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease, transform 0.2s ease;
}

#image-modal .close-btn {
    position: fixed;
    top: 20px;
    right: 32px;
    color: var(--white);
    z-index: 2010;
}

#profile-modal .close-btn {
    position: absolute;
    top: 16px;
    right: 22px;
    color: #dc2626;
}

.close-btn:hover {
    transform: scale(1.1);
    opacity: 0.8;
}

.prev,
.next {
    cursor: pointer;
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    padding: 16px 20px;
    color: var(--white);
    font-weight: 700;
    font-size: 24px;
    border: none;
    border-radius: 8px;
    background-color: rgba(0, 0, 0, 0.5);
    transition: background-color 0.25s ease;
    z-index: 2010;
}

.prev { left: 20px; }
.next { right: 20px; }

.prev:hover,
.next:hover {
    background-color: rgba(0, 0, 0, 0.85);
}

@keyframes slideDown {
    from { transform: translateY(-40px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ==========================================================================
   10. RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 768px) {
    body {
        padding: 12px 10px;
    }

    .dept-header img {
        height: 240px;
    }

    .dept-header-overlay {
        padding: 20px;
    }

    .dept-header-overlay h1 {
        font-size: 1.7rem;
    }

    .dept-intro,
    .dept-objectives,
    .vm-container,
    .dept-faculty {
        padding: 24px 20px;
    }

    .dept-gallery {
        padding: 0 20px;
        grid-template-columns: 1fr;
    }

    .vm-container {
        flex-direction: column;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .profile-modal-content {
        padding: 24px 20px;
    }
}