/* =====================================================
   College Department Section - Fixed Default + Responsive Layouts
   File: public/assets/frontend/css/home-sections/college-department.css
   ===================================================== */

.college-dept-section {
    --dept-primary: var(--theme-color, #0f3d5e);
    --dept-secondary: var(--theme-color2, #0b7285);
    --dept-dark: #172033;
    --dept-text: #1f2937;
    --dept-muted: #667085;
    --dept-light: #f6f9fc;
    position: relative;
    overflow: hidden;
    padding: 70px 0;
}

.college-dept-section a {
    text-decoration: none !important;
}

.college-dept-section img {
    max-width: 100%;
}

.cd-section-heading {
    position: relative;
    z-index: 2;
    margin-bottom: 34px;
}

.cd-section-heading .site-title {
    font-weight: 800;
    line-height: 1.2;
}

.cd-section-heading p {
    max-width: 680px;
    margin: 8px auto 0;
    color: var(--dept-muted);
    line-height: 1.6;
}

.cd-heading-light p,
.cd-heading-light .site-title {
    color: #ffffff !important;
}

.cd-heading-light p {
    color: rgba(255, 255, 255, 0.82) !important;
}

.cd-kicker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 15px;
    border-radius: 999px;
    background: rgba(15, 61, 94, 0.08);
    color: var(--dept-primary);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.75px;
    margin-bottom: 10px;
}

.cd-heading-light .cd-kicker {
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
}

.cd-divider {
    max-width: 180px;
    height: auto;
}

.cd-grid {
    position: relative;
    z-index: 2;
}

/* =====================================================
   Default layout: preserves old design exactly
   ===================================================== */

.cd-default-classic {
    background: #f7f9fc;
}

.cd-default-classic .cd-default-link {
    display: block;
    height: 100%;
}

.cd-default-classic .cd-default-card {
    height: 100%;
    min-height: 132px;
    border: 0;
    border-radius: 4px;
    background-color: var(--dept-primary) !important;
    transition: all 0.25s ease;
    overflow: hidden;
    position: relative;
}

.cd-default-classic .cd-default-card:hover {
    transform: translateY(-4px);
    background-color: var(--dept-secondary) !important;
}

.cd-default-classic .cd-default-icon {
    height: 80px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cd-default-classic .cd-dept-img {
    max-height: 50px !important;
    max-width: 70px !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain;
    filter: none !important;
}

.cd-default-classic .cd-default-title {
    font-size: 14px;
    line-height: 1.25;
    font-weight: 600;
    color: #ffffff !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* =====================================================
   Common modern cards for layouts 1 to 5
   ===================================================== */

.cd-card {
    width: 100%;
    height: 100%;
    min-height: 145px;
    padding: 20px 16px;
    border-radius: 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 11px;
    text-align: center;
    transition: all 0.28s ease;
    position: relative;
    overflow: hidden;
}

.cd-card:hover {
    transform: translateY(-5px);
}

.cd-icon {
    width: 62px;
    height: 62px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    position: relative;
    z-index: 1;
}

.cd-icon img {
    max-width: 42px;
    max-height: 42px;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: none !important;
}

.cd-title {
    position: relative;
    z-index: 1;
    font-size: 15px;
    line-height: 1.25;
    font-weight: 850;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cd-card small {
    position: relative;
    z-index: 1;
    font-size: 12px;
    font-weight: 800;
}

/* Layout 1 */
.cd-layout-one {
    background: linear-gradient(180deg, #ffffff 0%, #f6f9fc 100%);
}

.cd-card-clean {
    background: #ffffff;
    border: 1px solid rgba(15, 61, 94, 0.11);
    box-shadow: 0 14px 34px rgba(23, 32, 51, 0.07);
    color: var(--dept-text);
}

.cd-card-clean .cd-icon {
    background: rgba(15, 61, 94, 0.08);
}

.cd-card-clean .cd-title {
    color: var(--dept-text);
}

.cd-card-clean:hover {
    border-color: rgba(15, 61, 94, 0.22);
    box-shadow: 0 20px 48px rgba(23, 32, 51, 0.10);
}

/* Layout 2 */
.cd-layout-two {
    background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.12), transparent 35%), linear-gradient(135deg, var(--dept-primary), var(--dept-dark));
}

.cd-card-horizontal {
    min-height: 96px;
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #ffffff;
    padding: 16px;
}

.cd-card-horizontal .cd-icon {
    background: rgba(255, 255, 255, 0.12);
    width: 56px;
    height: 56px;
    border-radius: 16px;
}

.cd-card-horizontal .cd-icon img,
.cd-card-dark .cd-icon img {
    filter: brightness(0) invert(1) !important;
}

.cd-card-horizontal .cd-title {
    color: #ffffff;
    flex: 1;
}

.cd-card-horizontal .cd-arrow {
    color: rgba(255, 255, 255, 0.82);
    font-size: 13px;
}

.cd-card-horizontal:hover {
    background: rgba(255, 255, 255, 0.16);
}

/* Layout 3 */
.cd-layout-three {
    background: var(--dept-light);
}

.cd-card-soft {
    background: #ffffff;
    border: 1px solid rgba(15, 61, 94, 0.10);
    color: var(--dept-text);
    border-radius: 28px;
    box-shadow: 0 12px 30px rgba(23, 32, 51, 0.06);
}

.cd-card-soft .cd-icon {
    background: linear-gradient(135deg, rgba(15, 61, 94, 0.08), rgba(11, 114, 133, 0.10));
}

.cd-card-soft .cd-title {
    color: var(--dept-text);
}

.cd-card-soft:hover {
    background: var(--dept-primary);
}

.cd-card-soft:hover .cd-title {
    color: #ffffff;
}

.cd-card-soft:hover .cd-icon {
    background: rgba(255, 255, 255, 0.14);
}

.cd-card-soft:hover .cd-icon img {
    filter: brightness(0) invert(1) !important;
}

/* Layout 4 */
.cd-layout-four {
    background: #ffffff;
}

.cd-card-border {
    align-items: flex-start;
    text-align: left;
    background: #ffffff;
    color: var(--dept-text);
    border: 1px solid rgba(15, 61, 94, 0.12);
    border-top: 5px solid var(--dept-primary);
    box-shadow: 0 15px 38px rgba(23, 32, 51, 0.07);
}

.cd-card-border .cd-icon {
    background: rgba(15, 61, 94, 0.08);
}

.cd-card-border .cd-title {
    color: var(--dept-text);
    -webkit-line-clamp: 3;
}

.cd-card-border small {
    color: var(--dept-primary);
}

.cd-card-border:hover {
    border-top-color: var(--dept-secondary);
}

/* Layout 5 */
.cd-layout-five {
    background: linear-gradient(135deg, #111827 0%, var(--dept-dark) 100%);
}

.cd-card-dark {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: none;
}

.cd-card-dark::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(11, 114, 133, 0.25), transparent 45%);
    pointer-events: none;
}

.cd-card-dark .cd-icon {
    background: rgba(255, 255, 255, 0.12);
}

.cd-card-dark .cd-title {
    color: #ffffff;
}

.cd-card-dark:hover {
    background: rgba(255, 255, 255, 0.14);
}

/* =====================================================
   Mobile / Tablet responsive fixes
   ===================================================== */

@media (max-width: 991.98px) {
    .college-dept-section {
        padding: 54px 0;
    }

    .cd-section-heading {
        margin-bottom: 26px;
    }

    .cd-section-heading .site-title {
        font-size: 28px;
    }

    .cd-default-classic .cd-default-card {
        min-height: 126px;
    }

    .cd-card {
        min-height: 132px;
        border-radius: 20px;
        padding: 18px 14px;
    }

    .cd-card-horizontal {
        min-height: 88px;
    }
}

@media (max-width: 767.98px) {
    .college-dept-section {
        padding: 46px 0;
    }

    .college-dept-section .container {
        padding-left: 14px;
        padding-right: 14px;
    }

    .cd-section-heading .site-title {
        font-size: 24px;
    }

    .cd-section-heading p {
        font-size: 14px;
    }

    .cd-default-grid,
    .cd-grid {
        --bs-gutter-x: 14px;
        --bs-gutter-y: 14px;
    }

    .cd-default-classic .dept-col,
    .cd-layout-one .dept-col,
    .cd-layout-three .dept-col {
        padding-left: 7px;
        padding-right: 7px;
    }

    .cd-default-classic .cd-default-card {
        min-height: 118px;
        padding: 12px 8px !important;
    }

    .cd-default-classic .cd-default-icon {
        height: 58px;
        margin-bottom: 6px !important;
    }

    .cd-default-classic .cd-dept-img {
        max-height: 42px !important;
        max-width: 58px !important;
    }

    .cd-default-classic .cd-default-title {
        font-size: 12.5px;
        line-height: 1.25;
    }

    .cd-card {
        min-height: 120px;
        padding: 15px 10px;
        border-radius: 18px;
        gap: 8px;
    }

    .cd-icon {
        width: 52px;
        height: 52px;
        border-radius: 15px;
    }

    .cd-icon img {
        max-width: 34px;
        max-height: 34px;
    }

    .cd-title {
        font-size: 13.5px;
        line-height: 1.25;
    }

    .cd-card-horizontal {
        min-height: 82px;
        padding: 13px;
    }

    .cd-card-horizontal .cd-icon {
        width: 48px;
        height: 48px;
        border-radius: 14px;
    }

    .cd-card-border {
        align-items: center;
        text-align: center;
    }
}

@media (max-width: 575.98px) {
    .college-dept-section {
        padding: 40px 0;
    }

    .cd-section-heading {
        margin-bottom: 22px;
    }

    .cd-section-heading .site-title {
        font-size: 22px;
    }

    .cd-kicker {
        font-size: 11px;
        padding: 5px 12px;
    }

    .cd-divider {
        max-width: 130px;
    }

    .cd-default-classic .cd-default-card {
        min-height: 112px;
    }

    .cd-card {
        min-height: 112px;
    }

    .cd-card-horizontal {
        width: 100%;
        min-height: 78px;
    }

    .cd-layout-two .dept-col,
    .cd-layout-four .dept-col,
    .cd-layout-five .dept-col {
        width: 100%;
    }
}

@media (max-width: 380px) {
    .college-dept-section .container {
        padding-left: 10px;
        padding-right: 10px;
    }

    .cd-default-classic .dept-col,
    .cd-layout-one .dept-col,
    .cd-layout-three .dept-col {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .cd-default-classic .cd-default-card,
    .cd-card {
        min-height: 104px;
    }
}
