/* ================================
   Annai Theresa Hospital — Main Stylesheet
   Optimized Responsive Design (Hero, Navbar, Departments, Doctors)
   ================================ */

/* Root Variables */
:root {
    --ath-blue: #2c5aa0;
    --ath-gold: #c4a266;
    --ath-bg-light: #eee7e2;
    --ath-bg-alt: #dfd3c5;
    --ath-text: #193C43;
    --ath-border: #b2a99e;
}

/* ================================
   Global Reset
   ================================ */
* {
    margin: 0;
    padding: 0;
    /* box-sizing: border-box; */
    
}

html {
    /* scroll-behavior: smooth; */
    
}

body {
    
    font-family: 'Inter', system-ui, sans-serif;
    /* align-items: center;
    font-size: 1.5rem;
    color: var(--ath-text);
    line-height: 1.6; */
}

/* ================================
   Hero Section
   ================================ */
.departmentHero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 80px 100px;
    position: relative;
    overflow: hidden;
}

.departmentHero::before,
.departmentHero::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: radial-gradient(circle, #c4a26633, transparent 70%);
    z-index: 0;
}

.departmentHero::before {
    width: 400px;
    height: 400px;
    top: -100px;
    left: -100px;
}

.departmentHero::after {
    width: 300px;
    height: 300px;
    bottom: -80px;
    right: -80px;
}

.departmentHero .content {
    position: relative;
    z-index: 1;
    max-width: 600px;
}

.departmentHero h1 {
    font-family: 'Playfair Display', serif;
    font-size: 48px;
    color: var(--ath-blue);
    line-height: 1.2;
    margin-bottom: 20px;
}

.departmentHero h1 span {
    color: var(--ath-gold);
}

.departmentHero p {
    font-size: 18px;
    color: #4a4a4a;
    margin-bottom: 30px;
}

.departmentHero img {
    width: 500px;
    max-width: 100%;
    height: auto;
    border-radius: 15px;
    z-index: 1;
}

/* Hero Responsiveness */
@media (max-width: 992px) {
    .departmentHero {
        flex-direction: column;
        text-align: center;
        padding: 60px 40px;
    }

    .departmentHero h1 {
        font-size: 38px;
    }

    .departmentHero img {
        margin-top: 30px;
        width: 400px;
    }
}

@media (max-width: 576px) {
    .departmentHero h1 {
        font-size: 30px;
    }

    .departmentHero p {
        font-size: 16px;
    }
}

/* ================================
   Department Section
   ================================ */
.Department-section {
    margin-top: 50px;
    /* margin-bottom: 120px !important; */
    padding: 0 150px;
    padding-bottom: 60px;
    justify-content: center;
}

.Department-header {
    max-width: 650px;
    margin: 0 auto 50px auto;
    padding-right: 80px;
    padding-left: 80px;
}

.Department-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 40px;
    color: var(--ath-blue);
    text-align: center;
    padding-top: 50px;
}

.Department-header h2 span {
    color: var(--ath-gold);
}

.Department-header p {
    font-size: 1.1rem;
    color: #5a6c7d;
    line-height: 1.6;
    font-weight: 300;
    text-align: center;
}

.Department-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.row {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.row:nth-child(2) {
    margin-left: 65px;
}

.row:nth-child(3) {
    margin-left: 70px;
}

.card {
    max-width: 275px;
    min-height: 250px;
    background: linear-gradient(120deg, #eee7e2 0%, #e1d7cf 50%, #d6c8bb 100%);
    border: 2px solid var(--ath-border);
    border-radius: 15px;
    padding: 25px;
    box-sizing: border-box;
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
    transition: 0.3s ease-in-out;
    cursor: pointer;
    flex-shrink: 0;
}

/* Alternate Card Colors */
.Department-grid>.row:nth-child(1)>.card:nth-child(3),
.Department-grid>.row:nth-child(2)>.card:nth-child(2),
.Department-grid>.row:nth-child(3)>.card:nth-child(2),
.Department-grid>.row:nth-child(3)>.card:nth-child(4) {
    background: linear-gradient(120deg, #d6c8bb 0%, #e1d7cf 50%, #eee7e2 100%);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
}

/* Icon Wrapper */
.icon-wrapper {
    background-color: var(--ath-gold);
    border-radius: 12px;
    padding: 5px;
    margin-bottom: 20px;
    box-shadow: 2px 2px 10px #928A81;
    border: 2px solid black;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
}

.card img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.card h3 {
    color: var(--ath-blue);
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    margin-bottom: 12px;
}

.card p {
    font-size: 1rem;
    color: #5a6c7d;
    text-align: left;
    line-height: 1.6;
}

.arrow {
    position: absolute;
    bottom: 12px;
    right: 16px;
    font-size: 1.4rem;
    color: #004aad;
    transition: transform 0.3s;
}

.card:hover .arrow {
    transform: translateX(4px);
}

/* ================================
   Responsive Adjustments
   ================================ */
@media (max-width: 1230px) {
    .row {
        justify-content: center;
        margin-left: 0 !important;
    }

    .card {
        max-width: 260px;
    }
}

@media (max-width: 992px) {
    .Department-header h2 {
        font-size: 34px;
    }

    .Department-grid {
        align-items: center;
    }

    .row {
        justify-content: center;
        margin-left: 0;
        gap: 15px;
    }

    .card {
        width: 260px;
        min-height: 240px;
    }
}

@media (max-width: 768px) {
    .Department-section {
        padding: 40px 20px;
    }

    .Department-header h2 {
        font-size: 28px;
    }

    .Department-header p {
        font-size: 1rem;
    }

    .row {
        justify-content: center;
        margin-left: 0;
    }

    .card {
        width: 100%;
        max-width: 330px;
    }
}

@media (max-width: 576px) {
    .Department-section {
        padding: 30px 15px;
    }

    .Department-header h2 {
        font-size: 26px;
    }

    .card {
        width: 100%;
        max-width: 100%;
        min-height: auto;
    }

    .icon-wrapper {
        width: 45px;
        height: 45px;
    }

    .card h3 {
        font-size: 16px;
    }

    .card p {
        font-size: 13.5px;
    }
}

/* ================================
   Doctors Section
   ================================ */
.Doctors-section {
    padding: 60px 20px;
    text-align: center;
    justify-content: center;
}

.Doctors-header {
    max-width: 650px;
    margin: 0 auto 50px auto;
    padding-right: 30px;
    padding-left: 30px;
}

.Doctors-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 40px;
    color: var(--ath-blue);
    text-align: center;
    padding-top: 50px;
}

.Doctors-header h2 span {
    color: var(--ath-gold);
}

.Doctors-header p {
    font-size: 1.1rem;
    color: #5a6c7d;
    line-height: 1.6;
    font-weight: 300;
    text-align: center;
}


.Doctors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 10px;
    justify-items: center;
}

/* Flip Card */
.flip-card {
    background-color: transparent;
    width: 230px;
    height: 300px;
    perspective: 1000px;
    font-family: 'Poppins', sans-serif;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.8s ease;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

/* Front & Back */
.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 8px 14px rgba(0, 0, 0, 0.2);
}

/* Front */
.flip-card-front {
    background: linear-gradient(120deg, #eee7e2 60%, #e1d7cf 88%, #d6c8bb 40%, #2c5aa0 48%);
    color: #2c5aa0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.flip-card-front .doctor-img {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    margin-bottom: 10px;
    border: 3px solid #2c5aa0;
}

/* Back */
.flip-card-back {
    background: linear-gradient(120deg, #2c5aa0 30%, #1b3b6f 88%, #547dc0 40%, #2c5aa0 78%);
    color: #fff;
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px;
}

.Doctors-grid h4 {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.Doctors-grid p {
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Responsive Doctor Cards */
@media (max-width: 576px) {
    .doctors-section {
        padding: 40px 20px;
    }

    .doctor-card {
        width: 100%;
        max-width: 320px;
    }
}

/* ================================
   Department Layout Fixes
   ================================ */

/* Fix for 1383px to 1220px display width (excludes 1384-1520px which has custom scaling) */
@media (max-width: 1383px) and (min-width: 1220px) {
    .Department-header {
        width: 100%;
    }

    .Department-section .Department-grid {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3rem;
    }

    .Department-section .Department-grid .row {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 2rem;
        width: 100%;
        margin: 0 auto;
    }

    .Department-section .Department-grid .card {
        flex: 1 1 340px;
        max-width: 360px;
        margin: 0 !important;
    }
}

/* Move Department-grid to the left for 1500px and above */
@media (min-width: 1500px) {
    .Department-section .Department-grid {
        transform: translateX(-60px) !important;
    }
}

/* Scale down Department-header to fit with 2 cards on same line (1521px - 1680px range) */
@media (max-width: 1680px) and (min-width: 1521px) {
    .Department-header {
        max-width: 550px !important;
        width: auto !important;
        padding-left: 50px;
        padding-right: 50px;
        margin-bottom: 30px;
    }
    
    .Department-header h2 {
        font-size: 36px;
    }
    
    .Department-header p {
        font-size: 1rem;
    }
}

/* More aggressive scaling for 1384px - 1520px range */
@media (max-width: 1520px) and (min-width: 1384px) {
    /* Further reduce Department-header size */
    .Department-header {
        max-width: 480px !important;
        width: auto !important;
        padding-left: 40px !important;
        padding-right: 40px !important;
        margin-bottom: 25px !important;
    }
    
    .Department-header h2 {
        font-size: 34px !important;
    }
    
    .Department-header p {
        font-size: 0.95rem !important;
    }
    
    /* Scale down ALL cards in the entire section */
    .Department-grid .card {
        max-width: 250px;
        min-height: 230px;
        padding: 20px;
    }
    
    /* Reduce gap between items in all rows */
    .Department-grid .row {
        gap: 8px;
    }
}

/* Smooth transition to 2-column layout for smaller laptops */
@media (max-width: 1219px) and (min-width: 992px) {
    .Department-section .Department-grid .row {
        justify-content: center;
        gap: 2rem;
    }

    .Department-section .Department-grid .card {
        flex: 1 1 calc(50% - 2rem);
        max-width: 420px;
        margin: 0 auto;
    }
}

/* Align Department Header Center Below 1520px */
@media (max-width: 1520px) {
    .Department-header {
        width: 100%;
        text-align: center;
        margin: 0 auto;
    }

    .Department-header h2,
    .Department-header h3,
    .Department-header p {
        text-align: center;
        margin-left: auto;
        margin-right: auto;
    }
}