:root {
    --primary-font: 'Playfair Display', serif;
    --secondary-font: 'Merriweather', serif;
    --text-color: #333333;
    --light-text: #666666;
    --bg-color: #fdfdfd;
    --accent-color: #f4f4f4;
    --border-color: #e0e0e0;
    --btn-hover: #eaeaea;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--secondary-font);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.8;
}

/* Header Section */
.hero-header {
    position: relative;
    width: 100%;
    margin-bottom: 80px;
    /* Space for the overlapping profile image */
}

.header-image-container {
    width: 100%;
    height: 300px;
    overflow: hidden;
    position: relative;
}

.header-bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.profile-image-container {
    position: absolute;
    bottom: -75px;
    /* Half the height of the profile image to overlap */
    left: 50%;
    transform: translateX(-50%);
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 5px solid white;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    background-color: white;
    overflow: hidden;
}

.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Adjust object-position if needed depending on the portrait */
    object-position: top center;
}

/* Main Content */
.main-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.tribute-info {
    margin-bottom: 40px;
}

.name {
    font-family: var(--primary-font);
    font-size: 2.5rem;
    font-weight: 500;
    margin-bottom: 10px;
    color: #2c2c2c;
}

.dates {
    font-size: 1.1rem;
    color: var(--light-text);
    margin-bottom: 5px;
}

.location {
    font-size: 1rem;
    color: #888;
    font-style: italic;
}

/* Obituary Text */
.obituary-text {
    text-align: left;
    font-size: 1.05rem;
    color: #444;
    max-width: 700px;
    margin: 0 auto 60px;
}

.obituary-text p {
    margin-bottom: 20px;
}

.drop-cap {
    float: left;
    font-family: var(--primary-font);
    font-size: 3.5rem;
    line-height: 0.8;
    margin-right: 8px;
    margin-top: 4px;
    color: #222;
}

.telugu-text {
    font-family: 'Tenali Ramakrishna', sans-serif;
    /* Fallback will serve if not loaded, but good to have a dedicated font */
    margin-top: -20px;
    /* Reduce gap between English and Telugu sections */
    border-top: 1px solid #eee;
    padding-top: 40px;
}

/* Photo Gallery */
.photo-gallery {
    margin: 60px auto;
    max-width: 800px;
}

.photo-gallery h2 {
    font-family: var(--primary-font);
    font-size: 2rem;
    margin-bottom: 30px;
    color: #2c2c2c;
    position: relative;
    display: inline-block;
}

.photo-gallery h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 2px;
    background-color: #ddd;
    margin: 10px auto 0;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    padding: 10px;
}

.gallery-item {
    width: 100%;
    height: 250px;
    /* Fixed height for uniformity */
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

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

/* Optional: Subtle zoom effect on hover */
.gallery-item:hover img {
    transform: scale(1.03);
}

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

.lightbox-content {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 900px;
    max-height: 80vh;
    object-fit: contain;
    animation-name: zoom;
    animation-duration: 0.6s;
}

@keyframes zoom {
    from {
        transform: scale(0)
    }

    to {
        transform: scale(1)
    }
}

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

.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}


/* Footer */
.site-footer {
    text-align: center;
    padding: 40px 0;
    border-top: 1px solid var(--border-color);
    color: #999;
    font-size: 0.9rem;
    margin-top: 40px;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .name {
        font-size: 2rem;
    }

    .profile-image-container {
        width: 150px;
        height: 150px;
        bottom: -60px;
    }

    .hero-header {
        margin-bottom: 70px;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        /* 2 columns on mobile */
        gap: 10px;
    }

    .gallery-item {
        height: 180px;
    }

    .lightbox-content {
        width: 100%;
    }
}