/* Base styles */
:root {
    --primary-color: #000000;
    --secondary-color: #555555;
    --background-color: #f5f5f5;
    --border-color: #d0d0d0;
    --accent-color: #333333;
    --gold-accent: #d4af37;
    --font-family: 'Times New Roman', serif;
}

/* Improved text rendering for better readability */
html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

body {
    font-family: var(--font-family), serif;
    font-size: 18px; /* Increased base font size for better readability */
    line-height: 1.7; /* Improved line height for better readability */
    color: var(--primary-color);
    background-color: var(--background-color);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.container {
    padding: 0 15px;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3 {
    margin-top: 0;
    line-height: 1.2;
    color: var(--accent-color);
}

h1 {
    font-size: 2.8rem; /* Increased from 2.5rem */
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 2rem; /* Increased from 1.8rem */
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1.2rem; /* Increased from 1rem for better spacing */
}

/* Improve link contrast and readability */
a {
    color: #0056b3; /* Darker blue for better contrast */
    text-decoration: underline; /* Always show underline for better accessibility */
    font-weight: 600; /* Make links slightly bolder */
}

a:hover, a:focus {
    color: #003d7a; /* Even darker on hover/focus */
    text-decoration: underline;
}

/* Agenda link styling */
.agenda-link {
    display: inline-block;
    margin-top: 0.5rem;
    font-weight: bold;
    color: #0056b3;
    text-decoration: underline;
}

.agenda-link:hover, .agenda-link:focus {
    color: #003d7a;
    text-decoration: underline;
}

/* Header */
header {
    background-color: black;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-bottom: 2rem;
    border-bottom: 3px solid var(--gold-accent);
}

header h1 {
    color: white;
    margin: 0;
    font-weight: bold;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Language selector */
.language-selector {
    position: fixed;
    top: 10px;
    right: 20px;
    display: flex;
    align-items: center;
    z-index: 100;
}

.language-selector span {
    margin-right: 10px;
    font-weight: bold;
    line-height: 1.5;
    display: inline-block;
    vertical-align: middle;
}

.language-selector button {
    width: 36px;
    height: 24px;
    border: 1px solid #ccc;
    margin-left: 8px;
    cursor: pointer;
    border-radius: 3px;
    position: relative;
    overflow: hidden;
    padding: 0;
    vertical-align: middle;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.language-selector button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.language-selector button.active {
    box-shadow: 0 0 0 2px var(--gold-accent);
    border-color: #fff;
    transform: translateY(0);
}

/* Vietnam flag */
.flag-vi {
    background-color: #da251d;
    position: relative;
}

.flag-vi::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background-color: #ffff00;
    clip-path: polygon(
        50% 0%, 61% 35%, 98% 35%, 68% 57%, 
        79% 91%, 50% 70%, 21% 91%, 32% 57%, 
        2% 35%, 39% 35%
    );
}

/* German flag */
.flag-de {
    background: linear-gradient(to bottom, 
        #000000 33.33%, 
        #dd0000 33.33%, #dd0000 66.66%, 
        #ffce00 66.66%);
}

/* Main content */
main {
    padding-bottom: 2rem;
}

.memorial-content {
    background-color: white;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid var(--border-color);
    position: relative;
}

.memorial-content:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(to right, black 30%, var(--gold-accent) 30%, var(--gold-accent) 70%, black 70%);
}

/* Profile section */
.profile {
    padding: 2.5rem 0;
    border-bottom: 2px solid var(--gold-accent);
    background-color: white;
}

.profile-image {
    margin: 0;
    text-align: center;
}

.profile-image img {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--gold-accent);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    padding: 5px;
    background-color: white;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.profile-image img:hover, .profile-image img:focus {
    transform: scale(1.02);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.profile-image figcaption {
    margin-top: 1rem;
    font-style: normal;
    font-weight: bold;
    color: var(--primary-color);
    text-align: center;
    font-size: 1.4rem; /* Increased from 1.2rem */
}

.profile-image .click-hint {
    margin-top: 0.5rem;
    font-style: italic;
    font-weight: normal;
    color: var(--secondary-color);
    text-align: center;
    font-size: 0.9rem;
    background-color: rgba(212, 175, 55, 0.1); /* Light gold background */
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    display: block;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    transition: background-color 0.3s ease;
}

.profile-image .click-hint:hover {
    background-color: rgba(212, 175, 55, 0.2); /* Slightly darker gold on hover */
}

.profile-info {
    padding: 1.5rem 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.avatar-container {
    text-align: center;
    margin-bottom: 1.5rem;
}

.avatar-image {
    max-width: 150px;
    width: 100%;
    height: auto;
    aspect-ratio: 1/1;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid black;
    outline: 2px solid var(--gold-accent);
    outline-offset: 2px;
    padding: 3px;
    background-color: white;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.profile-info h2 {
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 0.5rem;
    font-size: 2.2rem; /* Increased from 2rem */
    text-align: center;
}

.dates {
    font-size: 1.5rem; /* Increased from 1.3rem */
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: bold;
}

.memorial-text {
    line-height: 1.9; /* Improved line height */
    text-align: center;
    font-size: 1.25rem; /* Increased from 1.1rem */
    margin-bottom: 0.8rem;
    max-width: 100%;
    word-wrap: break-word;
}

/* Biography section */
.biography {
    padding: 2.5rem 0; /* Increased from 2rem */
    border-bottom: 2px solid var(--gold-accent);
    background-color: white;
    margin-bottom: 0.5rem; /* Added margin */
}

.biography h2 {
    text-align: center;
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 1.5rem;
    position: relative;
}

.biography h2:after {
    content: "";
    display: block;
    width: 80px;
    height: 2px;
    background-color: var(--gold-accent);
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
}

.biography h3 {
    color: var(--primary-color);
    font-weight: bold;
    margin: 2rem 0 1.2rem;
    position: relative;
    text-align: center;
    font-size: 1.6rem;
}

.biography h3:after {
    content: "";
    display: block;
    width: 60px;
    height: 2px;
    background-color: var(--gold-accent);
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
}

.biography p {
    text-align: left;
    line-height: 1.9; /* Improved line height */
    max-width: 800px;
    margin: 0 auto 1rem;
    font-size: 1.25rem; /* Increased from 1.1rem */
    padding: 0 1rem;
}

.biography p:first-of-type {
    text-align: center;
}

.biography p:last-of-type {
    text-align: center;
    margin-top: 2rem;
}

.career-history {
    max-width: 800px;
    margin: 1.5rem auto;
    padding: 0 1rem 0 2.5rem;
    list-style-type: none;
    position: relative;
}

.career-history::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 2.5rem;
    width: 2px;
    background-color: var(--gold-accent);
}

.career-history li {
    position: relative;
    padding: 0.8rem 0;
    margin-bottom: 0.8rem;
    line-height: 1.8;
    font-size: 1.2rem;
    padding-left: 1.5rem;
}

.career-history li:before {
    content: "";
    position: absolute;
    left: -8px;
    top: 0.8rem;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background-color: var(--gold-accent);
    border: 2px solid white;
    box-shadow: 0 0 0 1px var(--gold-accent);
    z-index: 1;
}

/* Family section */
.family {
    padding: 2rem 0 1.5rem 0;
    border-bottom: 2px solid var(--gold-accent);
    background-color: white;
    margin-bottom: 0.5rem;
}

.family h2 {
    text-align: center;
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 1.5rem;
    position: relative;
}

.family h2:after {
    content: "";
    display: block;
    width: 80px;
    height: 2px;
    background-color: var(--gold-accent);
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
}

.family p {
    text-align: center;
    line-height: 1.9;
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.25rem;
}

/* Family container styles */
.family-container {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

/* Wife row styles - using flexbox */
.wife-row {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

.wife-container {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    display: flex;
    align-items: baseline;
}

/* Family grid styles - using CSS Grid */
.family-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    width: 100%;
}

.family-item {
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
    border-radius: 4px;
    background-color: rgba(250, 250, 250, 0.5);
    transition: background-color 0.2s ease;
}

.family-item:hover {
    background-color: rgba(245, 245, 245, 0.8);
}

.family-item.empty {
    background-color: transparent;
}

.family-member {
    display: flex;
    align-items: baseline;
}

.family-label {
    font-size: 1.25rem;
    color: var(--primary-color);
    margin-bottom: 0.3rem;
    font-weight: bold;
}

.family-name {
    font-size: 1.25rem;
    padding-left: 0.5rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Responsive styles for family section */
@media (max-width: 768px) {
    .family-container {
        width: 90%;
    }
    
    .family-label {
        font-size: 1.15rem;
    }
    
    .family-name {
        font-size: 1.15rem;
    }
    
    .family-grid {
        gap: 1.2rem;
    }
}

@media (max-width: 576px) {
    .family-container {
        width: 100%;
        padding: 0 10px;
    }
    
    /* Switch to single column for mobile */
    .family-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .family-item {
        margin-bottom: 0.8rem;
        padding: 0.8rem;
        border-bottom: 1px solid var(--border-color);
    }
    
    .family-item.empty {
        display: none; /* Hide empty items on mobile */
    }
    
    .family-label {
        font-size: 1.1rem;
        margin-bottom: 0.4rem;
    }
    
    .family-name {
        font-size: 1.1rem;
        padding-left: 0.8rem;
    }
}

@media (max-width: 480px) and (min-width: 376px) {
    .family-container {
        padding: 0 8px;
    }
    
    .family-grid {
        gap: 0.8rem;
    }
    
    .family-item {
        padding: 0.7rem;
        margin-bottom: 0.7rem;
    }
    
    .family-label {
        font-size: 1.08rem;
    }
    
    .family-name {
        font-size: 1.08rem;
        padding-left: 0.7rem;
    }
}

@media (max-width: 375px) and (min-width: 321px) {
    .family-container {
        padding: 0 5px;
    }
    
    .family-grid {
        gap: 0.7rem;
    }
    
    .family-item {
        padding: 0.6rem;
        margin-bottom: 0.6rem;
    }
    
    .family-label {
        font-size: 1.05rem;
        margin-bottom: 0.3rem;
    }
    
    .family-name {
        font-size: 1.05rem;
        padding-left: 0.6rem;
    }
}

/* Extra extra small devices */
@media (max-width: 320px) {
    .container {
        padding: 0 4px;
    }
    
    .family-container {
        padding: 0 2px;
    }
    
    .family-grid {
        gap: 0.6rem;
    }
    
    .family-item {
        padding: 0.5rem;
        margin-bottom: 0.5rem;
    }
    
    .family-label {
        font-size: 1rem;
        margin-bottom: 0.2rem;
    }
    
    .family-name {
        font-size: 1rem;
        padding-left: 0.5rem;
    }
    
    .memorial-text, .biography p, .memorial-service p, .family p, .contact-info p {
        font-size: 1rem;
        line-height: 1.5;
        padding: 0 2px;
    }
    
    .memorial-info-item {
        min-width: 100%;
        padding: 0.6rem;
        margin: 0.15rem 0;
        width: 100%;
        font-size: 0.95rem;
    }
    
    .memorial-info-container {
        padding: 0 2px;
        gap: 0.5rem;
    }
    
    .qr-code-container img {
        max-width: 150px;
    }
}

/* Memorial service section */
.memorial-service {
    padding: 2.5rem 0; /* Increased from 2rem */
    background-color: white;
    margin-bottom: 0.5rem; /* Added margin */
}

.memorial-service h2 {
    text-align: center;
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 1.5rem;
    position: relative;
}

.memorial-service h2:after {
    content: "";
    display: block;
    width: 80px;
    height: 2px;
    background-color: var(--gold-accent);
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
}

.memorial-service p {
    text-align: center;
    line-height: 1.9; /* Improved line height */
    font-size: 1.25rem; /* Increased from 1.1rem */
}

.memorial-info-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2.5rem; /* Increased from 2rem for better spacing */
    max-width: 1000px;
    margin: 0 auto;
    padding: 0.5rem; /* Added padding */
}

.memorial-info-item {
    flex: 1 1 400px;
    min-width: 280px;
    padding: 1.2rem; /* Increased from 1rem */
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background-color: #fafafa;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.9; /* Improved line height */
    margin: 0.3rem; /* Added margin for better spacing */
    box-sizing: border-box;
    max-width: 100%;
}

.memorial-table {
    border-collapse: collapse;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    font-size: 1.25rem; /* Increased from 1.1rem */
    line-height: 1.2; /* Improved line height from 0.6 */
}

.memorial-table td {
    padding: 0.5rem;
    border: none;
    vertical-align: top;
}

.memorial-table tr {
    margin-bottom: 0.5rem;
}

.memorial-table strong {
    color: var(--primary-color);
    font-weight: bold;
}

/* For mobile screens, stack the table cells */
@media (max-width: 576px) {
    .memorial-table, 
    .memorial-table tbody, 
    .memorial-table tr, 
    .memorial-table td {
        display: block;
        width: 100%;
        text-align: center;
    }
    
    .memorial-table td {
        padding: 0.25rem 0;
    }
    
    .memorial-table tr {
        margin-bottom: 1rem;
    }
    
    .memorial-info-item {
        min-width: 100%;
        padding: 0.8rem;
        margin: 0.2rem 0;
        width: 100%;
    }
    
    .memorial-info-container {
        padding: 0 5px;
    }
}

/* Contact info section */
.contact-info {
    padding: 2.5rem 0;
    border-bottom: 2px solid var(--gold-accent);
    background-color: white;
    margin-bottom: 0.5rem;
}

.contact-info h2 {
    text-align: center;
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 1.5rem;
    position: relative;
}

.contact-info h2:after {
    content: "";
    display: block;
    width: 80px;
    height: 2px;
    background-color: var(--gold-accent);
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
}

.contact-details {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.contact-item {
    font-size: 1.25rem;
    line-height: 1.9;
    margin-bottom: 0.8rem;
}

.contact-item strong {
    color: var(--primary-color);
    font-weight: bold;
}

/* Email obfuscation */
.email-display {
    font-size: 1.6rem; /* Increased from 1.25rem for better visibility for older people */
    line-height: 1.9;
    color: #0056b3;
    text-decoration: underline;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.email-display:hover {
    color: #003d7a;
}

.email-display::before {
    content: "nguyenquyhiep";
}

.email-display::after {
    content: "caopho.de";
}

.email-display .at-sign {
    position: relative;
    margin: 0 1px;
}

.email-display .at-sign::before {
    content: "@";
}

/* Footer */
footer {
    background-color: black;
    color: white;
    padding: 2rem 0;
    text-align: center;
    border-top: 3px solid var(--gold-accent);
}

footer p {
    margin: 0.7rem 0;
    font-size: 1.2rem; /* Increased from 1rem */
    line-height: 1.7; /* Improved line height */
}

footer p:first-child {
    font-style: italic;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 1.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    h1 {
        font-size: 2.4rem; /* Increased from 2rem */
    }
    
    h2 {
        font-size: 1.8rem; /* Increased from 1.5rem */
    }
    
    h3 {
        font-size: 1.5rem;
    }
    
    .profile-info {
        padding-top: 2rem;
    }
    
    .memorial-text {
        font-size: 1.15rem; /* Increased from 1rem */
        line-height: 1.7; /* Improved line height */
    }
    
    .biography p, .memorial-service p, .contact-info p {
        font-size: 1.15rem; /* Increased from 1rem */
        line-height: 1.7; /* Improved line height */
        padding: 0 0.8rem;
    }
    
    .biography h3 {
        margin: 1.8rem 0 1rem;
    }
    
    .biography h3:after {
        width: 50px;
        bottom: -6px;
    }
    
    .career-history {
        padding: 0 0.8rem 0 2rem;
        margin: 1.2rem auto;
        position: relative;
    }
    
    .career-history::before {
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        left: 2rem;
        width: 2px;
        background-color: var(--gold-accent);
    }
    
    .career-history li {
        font-size: 1.1rem;
        padding: 0.6rem 0;
        padding-left: 1.2rem;
        margin-bottom: 0.6rem;
    }
    
    .career-history li:before {
        width: 12px;
        height: 12px;
        left: -7px;
        top: 0.7rem;
        z-index: 1;
    }
    
    .dates {
        font-size: 1.3rem; /* Increased from 1.1rem */
    }
    
    .avatar-image {
        width: 130px;
        height: 130px;
        outline-offset: 1px;
    }
    
    .memorial-info-container {
        gap: 1.5rem;
    }
    
    .memorial-info-item {
        padding: 0.8rem;
    }
    
    .memorial-table {
        font-size: 1.15rem; /* Added to ensure table text remains readable */
        line-height: 1.2;
    }
    
    .contact-item {
        font-size: 1.15rem;
    }
    
    .email-display {
        font-size: 1.47rem; /* Proportionally increased for better visibility */
    }
    
    footer p {
        font-size: 1.1rem; /* Added to ensure footer text remains readable */
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 10px;
    }
    
    header {
        padding: 1.5rem 0;
    }
    
    header h1 {
        font-size: 2rem; /* Increased from 1.8rem */
    }
    
    .profile, .biography, .family, .memorial-service, .contact-info {
        padding: 1rem 0;
    }
    
    .profile-image img {
        max-width: 90%;
        margin: 0 auto;
        display: block;
    }
    
    .profile-info h2 {
        font-size: 1.8rem; /* Increased from 1.6rem */
    }
    
    .avatar-image {
        max-width: 150px;
        border-width: 1px;
        outline-width: 1px;
        outline-offset: 1px;
        padding: 2px;
    }
    
    .avatar-container {
        margin-bottom: 1rem;
    }
    
    .biography h2:after, .memorial-service h2:after, .family h2:after, .contact-info h2:after {
        width: 60px;
    }
    
    .biography h3 {
        font-size: 1.4rem;
        margin: 1.5rem 0 1rem;
    }
    
    .biography h3:after {
        width: 40px;
        bottom: -5px;
    }
    
    .biography p {
        padding: 0 0.5rem;
        margin-bottom: 0.8rem;
    }
    
    .biography p:last-of-type {
        margin-top: 1.5rem;
    }
    
    .career-history {
        padding: 0 0.5rem 0 1.8rem;
        margin: 1rem auto;
        position: relative;
    }
    
    .career-history::before {
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        left: 1.8rem;
        width: 2px;
        background-color: var(--gold-accent);
    }
    
    .career-history li {
        font-size: 1rem;
        padding: 0.5rem 0;
        padding-left: 1rem;
        margin-bottom: 0.5rem;
        line-height: 1.6;
    }
    
    .career-history li:before {
        width: 10px;
        height: 10px;
        left: -6px;
        top: 0.6rem;
        z-index: 1;
    }
    
    .memorial-info-container {
        gap: 1rem;
    }
    
    .memorial-info-item {
        flex: 1 1 100%;
        min-width: 100%;
        padding: 0.7rem;
        margin-bottom: 0.5rem;
    }
    
    .memorial-text {
        font-size: 1.1rem; /* Increased from 1rem */
        line-height: 1.7; /* Improved line height */
        padding: 0 5px;
    }
    
    .biography p, .memorial-service p, .family p, .contact-info p {
        font-size: 1.1rem; /* Added to ensure paragraph text remains readable */
        line-height: 1.7; /* Improved line height */
    }
    
    .memorial-table {
        font-size: 1.1rem; /* Added to ensure table text remains readable */
        line-height: 1.2;
    }
    
    .contact-item {
        font-size: 1.1rem;
    }
    
    .email-display {
        font-size: 1.4rem; /* Proportionally increased for better visibility */
    }
    
    .dates {
        font-size: 1.2rem; /* Added to ensure dates remain readable */
    }
    
    footer p {
        font-size: 1.05rem; /* Increased from 0.9rem */
        line-height: 1.6; /* Improved line height */
    }
}

/* Extra small devices */
@media (max-width: 375px) {
    header h1 {
        font-size: 1.8rem; /* Increased from 1.6rem */
    }
    
    .profile-info h2 {
        font-size: 1.6rem; /* Increased from 1.4rem */
    }
    
    .dates {
        font-size: 1.15rem; /* Increased from 1rem */
    }
    
    .memorial-text, .biography p, .memorial-service p, .family p, .contact-info p {
        font-size: 1.05rem; /* Increased from 0.95rem */
        line-height: 1.6; /* Added line height */
    }
    
    .biography h2 {
        font-size: 1.6rem;
    }
    
    .biography h3 {
        font-size: 1.3rem;
        margin: 1.2rem 0 0.8rem;
    }
    
    .biography h3:after {
        width: 35px;
        bottom: -4px;
    }
    
    .biography p {
        padding: 0 0.3rem;
        margin-bottom: 0.7rem;
    }
    
    .biography p:last-of-type {
        margin-top: 1.2rem;
    }
    
    .career-history {
        padding: 0 0.3rem 0 1.5rem;
        margin: 0.8rem auto;
        position: relative;
    }
    
    .career-history::before {
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        left: 1.5rem;
        width: 2px;
        background-color: var(--gold-accent);
    }
    
    .career-history li {
        font-size: 0.95rem;
        padding: 0.4rem 0;
        padding-left: 0.8rem;
        margin-bottom: 0.4rem;
        line-height: 1.5;
    }
    
    .career-history li:before {
        width: 8px;
        height: 8px;
        left: -5px;
        top: 0.5rem;
        z-index: 1;
    }
    
    .memorial-table {
        font-size: 1.05rem; /* Added to ensure table text remains readable */
        line-height: 1.2;
    }
    
    .memorial-info-item {
        padding: 0.6rem;
        font-size: 1.05rem; /* Added to ensure info item text remains readable */
    }
    
    .contact-item {
        font-size: 1.05rem;
    }
    
    .email-display {
        font-size: 1.35rem; /* Proportionally increased for better visibility */
    }
    
    footer p {
        font-size: 1rem; /* Added to ensure footer text remains readable */
        line-height: 1.5;
    }
    
    .avatar-image {
        max-width: 120px;
    }
}

/* Additional styles for the agenda page */
.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 2rem;
}

/* Style for nested list items */
.career-history ul {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    padding-left: 2rem;
}

.career-history ul li {
    border-left: none;
    padding-left: 0;
    margin-bottom: 0.3rem;
}

.career-history ul li:before {
    display: none;
}

/* Gallery specific styles */
#gallery-section h2 {
    text-align: center;
    color: var(--primary-color);
    font-weight: bold;
    margin-bottom: 1.5rem;
    position: relative;
}

#gallery-section h2:after {
    content: "";
    display: block;
    width: 80px;
    height: 2px;
    background-color: var(--gold-accent);
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
}

.gallery-container {
    padding: 20px 0;
}

.gallery-description {
    text-align: center;
    margin-bottom: 30px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    grid-gap: 20px;
    margin-bottom: 30px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer; /* Add pointer cursor to indicate clickable */
}

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

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

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

/* Screen reader only class */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Slideshow Modal Styles */
.slideshow-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.slideshow-content {
    position: relative;
    width: 90%;
    height: 90%;
    max-width: 1200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slideshow-image-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#slideshow-image {
    max-width: 100%;
    max-height: 95vh;
    object-fit: contain;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    /* Increased size for better visibility for older people */
}

/* Make the image even larger on bigger screens for better visibility for older people */
@media (min-width: 1200px) {
    #slideshow-image {
        max-width: 90%;
        max-height: 95vh;
    }
    
    .slideshow-content {
        max-width: 1400px;
    }
}

/* Close Button */
.close-slideshow {
    position: absolute;
    top: 15px;
    right: 15px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1010;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    transition: background-color 0.3s;
}

.close-slideshow:hover {
    background-color: rgba(255, 0, 0, 0.7);
}

/* Navigation Buttons */
.prev, .next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    padding: 16px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
    z-index: 1010;
}

.prev {
    left: 20px;
}

.next {
    right: 20px;
}

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

/* Play/Pause Button */
.play-pause {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    padding: 16px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
    z-index: 1010;
}

/* Zoom Controls */
.zoom-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 1010;
}

.zoom-in, .zoom-out, .zoom-reset {
    color: white;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.zoom-in:hover, .zoom-out:hover, .zoom-reset:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.zoom-reset {
    font-size: 14px;
}

.play-pause[data-state="pause"]::before {
    content: "⏸";
}

/* Video Modal Styles */
.video-section {
    margin: 2rem 0;
    text-align: center;
    padding: 1.5rem;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
}

.video-section h3 {
    margin-bottom: 0.5rem;
}

/* Video Preview Styles */
.video-preview-container {
    position: relative;
    width: 100%;
    max-width: 640px;
    margin: 1rem auto;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.video-preview-container:hover, 
.video-preview-container:focus {
    transform: scale(1.02);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.video-preview-container:focus {
    outline: 3px solid var(--accent-color);
}

.video-preview {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 16 / 9;
    background-color: #000;
    object-fit: cover;
}

.play-button-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.3);
    transition: background-color 0.3s ease;
}

.video-preview-container:hover .play-button-overlay,
.video-preview-container:focus .play-button-overlay {
    background-color: rgba(0, 0, 0, 0.5);
}

.play-icon {
    font-size: 4rem;
    color: white;
    opacity: 0.8;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.video-preview-container:hover .play-icon,
.video-preview-container:focus .play-icon {
    opacity: 1;
    transform: scale(1.1);
}

.video-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

#funeral-video {
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}


.close-video {
    position: absolute;
    top: 15px;
    right: 15px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1010;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    transition: background-color 0.3s;
}

.close-video:hover {
    background-color: rgba(255, 0, 0, 0.7);
}

/* Gallery responsive adjustments */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .gallery-item img {
        height: 150px;
    }
    
    .slideshow-content {
        width: 95%;
    }
    
    .prev, .next {
        font-size: 24px;
        width: 40px;
        height: 40px;
    }
    
    .prev {
        left: 10px;
    }
    
    .next {
        right: 10px;
    }
    
    .close-slideshow, .close-video {
        font-size: 30px;
        top: 10px;
        right: 10px;
    }
    
    /* Video preview responsive styles */
    .video-preview-container {
        max-width: 100%;
    }
    
    .play-icon {
        font-size: 3rem;
    }
    
}

/* Lazy loading styles */
.lazy-section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.lazy-section.loaded {
    opacity: 1;
    transform: translateY(0);
}

.loading-placeholder {
    text-align: center;
    padding: 2rem 0;
    color: #888;
    background-color: #f9f9f9;
    border-radius: 5px;
    margin: 1rem 0;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* Profile avatar styles */
.profile-info .avatar-container {
    height: 200px;
    width: 180px;
    overflow: hidden;
    margin-bottom: 10px;
}

.profile-info .avatar-container img {
    height: 200px;
    width: 180px;
    border-radius: 75px 75px 0 0;
    border: 1px solid #000000;
    object-fit: cover;
    object-position: top;
}

/* QR code container styles */
.qr-code-container {
    text-align: center;
    margin-top: -30px;
}

.qr-code-container img,
.qr-code-img {
    max-width: 200px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 5px;
}

/* Section content display */
.section-content {
    display: none;
}

/* Mobile-first responsive adjustments */
@media (min-width: 576px) {
    body {
        font-size: 17px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        grid-gap: 15px;
    }
    
    .gallery-item img {
        height: 150px;
    }
    
    .prev, .next {
        font-size: 22px;
        width: 40px;
        height: 40px;
    }
    
    .prev {
        left: 10px;
    }
    
    .next {
        right: 10px;
    }
    
    .close-slideshow {
        font-size: 28px;
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
    }
}

@media (min-width: 768px) {
    body {
        font-size: 18px;
    }
    
    .container {
        max-width: 720px;
        margin: 0 auto;
    }
    
    .profile .row {
        flex-direction: row;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        grid-gap: 20px;
    }
    
    .gallery-item img {
        height: 180px;
    }
    
    .prev, .next {
        font-size: 26px;
        width: 46px;
        height: 46px;
    }
    
    .close-slideshow {
        font-size: 32px;
        width: 46px;
        height: 46px;
    }
}

@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
    
    .gallery-item img {
        height: 200px;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}
