@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;700&display=swap');

:root {
    --color-primary-accent: #759D97;
    --color-secondary-highlight: #d8ae5e;
    --color-highlight: #fdda87;
    --color-secondary-bg: #E0F1F1;
    --color-subtle-bg: #CFE6E7;
    --color-primary-text: #354B4A;
    --color-dark-bg: #27494c;
}

body {
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--color-subtle-bg);
    color: var(--color-primary-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--color-dark-bg);
    padding: 15px 20px;
    color: white;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 24px;
    font-weight: 700;
}

.navbar ul {
    list-style: none;
    display: flex;
    gap: 20px;
    padding: 0;
    margin-left: 40px;
}

.navbar ul li {
    display: inline;
}

.navbar ul li a {
    color: white;
    text-decoration: none;
    font-weight: 700;
    transition: color 0.3s;
}

.navbar ul li a:hover {
    color: var(--color-highlight);
}

/* Portfolio Section */
.portfolio_section {
    padding: 50px 20px;
    flex: 1;
}

.portfolio_section h1 {
    font-size: 60px;
    font-weight: 700;
    color: var(--color-dark-bg);
    margin: 0;
    text-align: center;
}

.subtext {
    font-size: 18px;
    margin-bottom: 40px;
    text-align: center;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Project Card Styles */
.project-card {
    background: var(--color-dark-bg);
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.project-card.expanded {
    grid-column: 1 / -1;
    min-height: 400px;
}

/* Add hover transformation to the individual card */
.project-card:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.15);
}

.card-preview {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

/* Only show preview content's paragraph on hover for the specific card */
.project-card .preview-content p {
    opacity: 0;
    height: 0;
    margin: 0.5rem 0 0;
    transition: opacity 0.3s ease, height 0.3s ease;
    overflow: hidden;
}

.project-card.hovered .preview-content p {
    opacity: 1;
    height: auto;
    margin: 0.5rem 0 0;
}

/* Only add padding to the hovered card */
.project-card.hovered .card-preview {
    padding-bottom: 2rem;
}

.ngo-logo {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.preview-content {
    flex: 1;
}

.preview-content h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--color-highlight);
    text-align: center;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
}

.preview-content p {
    font-size: 1rem;
    color: var(--color-secondary-highlight);
    text-align: center;
    font-family: 'Montserrat', sans-serif;
}

.card-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 1.5rem;
}

.expanded .card-details {
    max-height: 1000px;
    padding-bottom: 1.5rem;
}

.details-content {
    display: grid;
    gap: 0.5rem; /* Reduced from 1rem for tighter spacing */
}

.details-content p, 
.details-content li {
    color: white;
    font-family: 'Montserrat', sans-serif;
    line-height: 1.4; /* Reduced from 1.6 for tighter spacing */
    margin: 0.5rem 0; /* Reduced margins for tighter spacing */
}

.team-members {
    margin-bottom: 0.7rem; /* Reduced from 1rem */
}

.team-members p {
    margin: 0.3rem 0; /* Tighter spacing between team member lines */
}

.details-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 0.8rem; /* Reduced from 1rem for tighter spacing */
    margin-top: 1rem; /* Reduced from 1.5rem */
    padding: 0;
}

.details-gallery img {
    width: 100%;
    height: 160px; /* Reduced from 180px */
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.details-gallery img:hover {
    transform: scale(1.05);
}

.close-button {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    display: none;
    color: white;
    z-index: 10;
}

.expanded .close-button {
    display: block;
}

footer {
    background-color: var(--color-dark-bg);
    display: flex;
    justify-content: center;
    color: #efefef;
    font-size: 15px;
    padding-top: 7px;
    margin-top: auto;
    width: 100%;
    height: 80px;
}

footer p {
    margin-top: 31px;
}

.socials {
    list-style-type: none;
    padding: 0;
    margin-left: 25px;
}

.socials li {
    display: inline-block;
    margin-right: 10px;
    margin-top: 10px;
}

.socials img {
    width: 30px;
    height: 30px;
}

/* Image Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 80%;
    max-height: 80%;
}

#imageCaption {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: white;
    padding: 10px 0;
    height: 150px;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.modal-close:hover,
.modal-close:focus {
    color: var(--color-highlight);
    text-decoration: none;
    cursor: pointer;
}

/* Media Queries */
@media (max-width: 768px) {
    .portfolio_section h1 {
        font-size: 40px;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .details-gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .details-gallery img {
        height: 140px;
    }
    
    .navbar ul {
        margin-left: 20px;
        gap: 10px;
    }

    .modal-content {
        max-width: 95%;
    }
}

@media (max-width: 480px) {
    .navbar {
        flex-direction: column;
        text-align: center;
    }
    
    .navbar ul {
        margin: 10px 0 0 0;
        justify-content: center;
    }
    
    .card-preview {
        flex-direction: column;
        text-align: center;
    }
    
    .details-gallery {
        grid-template-columns: 1fr;
    }
}