/* =============================================
   Memorial Website Styles
   A warm, elegant design honoring a life well-lived
   ============================================= */

/* CSS Variables */
:root {
    --color-cream: #FAF8F5;
    --color-cream-dark: #F0EDE8;
    --color-warm-white: #FFFEFB;
    --color-text: #2C2C2C;
    --color-text-light: #5A5A5A;
    --color-text-muted: #8A8A8A;
    --color-accent: #4A5568;
    --color-accent-warm: #6B5B4F;
    --color-border: #E2DFD9;
    --color-overlay: rgba(44, 44, 44, 0.4);

    --font-serif: 'Cormorant Garamond', Georgia, serif;
    --font-sans: 'Lato', -apple-system, sans-serif;

    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --spacing-xl: 6rem;

    --max-width: 1100px;
    --transition: 0.3s ease;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    font-weight: 300;
    line-height: 1.7;
    color: var(--color-text);
    background-color: var(--color-cream);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Container */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* Typography */
h1, h2, h3 {
    font-family: var(--font-serif);
    font-weight: 500;
    line-height: 1.3;
}

.section-title {
    font-size: 2rem;
    font-weight: 400;
    text-align: center;
    margin-bottom: var(--spacing-lg);
    color: var(--color-text);
    letter-spacing: 0.02em;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 1px;
    background: var(--color-accent-warm);
    margin: var(--spacing-sm) auto 0;
}

/* =============================================
   Hero Section
   ============================================= */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3d3d3d 0%, #2c2c2c 100%);
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: url('images/eddie.jpg') center/cover no-repeat;
    opacity: 0.2;
    filter: grayscale(30%);
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: var(--spacing-lg);
}

.hero-image-container {
    width: 280px;
    height: 280px;
    margin: 0 auto var(--spacing-md);
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(20%);
    transition: filter var(--transition);
}

.hero-image:hover {
    filter: grayscale(0%);
}

.hero-name {
    font-size: 3.5rem;
    font-weight: 400;
    color: var(--color-warm-white);
    margin-bottom: var(--spacing-xs);
    letter-spacing: 0.04em;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.hero-dates {
    font-family: var(--font-sans);
    font-size: 1.1rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.hero-divider {
    width: 100px;
    height: 1px;
    background: rgba(255, 255, 255, 0.4);
    margin: var(--spacing-md) auto 0;
}

/* =============================================
   Obituary Section
   ============================================= */
.obituary {
    padding: var(--spacing-xl) 0;
    background: var(--color-warm-white);
}

.obituary-content {
    max-width: 750px;
    margin: 0 auto;
}

.obituary-content p {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    line-height: 1.9;
    margin-bottom: var(--spacing-md);
    color: var(--color-text-light);
    text-align: justify;
    text-justify: inter-word;
}

.obituary-content p:first-of-type::first-letter {
    font-size: 4rem;
    float: left;
    line-height: 1;
    padding-right: 0.5rem;
    color: var(--color-accent-warm);
    font-weight: 600;
}

.obituary-closing {
    font-style: italic;
    text-align: center !important;
    color: var(--color-accent-warm) !important;
    margin-top: var(--spacing-lg);
    font-size: 1.3rem !important;
}

/* =============================================
   Memories Section
   ============================================= */
.memories {
    padding: var(--spacing-xl) 0;
    background: var(--color-cream);
}

.memory-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    align-items: center;
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-xl);
    border-bottom: 1px solid var(--color-border);
}

.memory-card:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.memory-card-reverse {
    direction: rtl;
}

.memory-card-reverse > * {
    direction: ltr;
}

.memory-image {
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.memory-image::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 4px;
    pointer-events: none;
    z-index: 1;
}

.memory-image img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.memory-card:hover .memory-image img {
    transform: scale(1.03);
}

.memory-text {
    padding: var(--spacing-md);
}

.memory-author {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--color-accent-warm);
    margin-bottom: var(--spacing-sm);
}

.memory-text p {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--color-text-light);
    margin-bottom: var(--spacing-sm);
}

.memory-text p:last-child {
    margin-bottom: 0;
}

/* =============================================
   Gallery Carousel
   ============================================= */
.gallery {
    padding: var(--spacing-xl) 0;
    background: var(--color-warm-white);
    overflow: hidden;
}

.carousel-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    mask-image: linear-gradient(
        to right,
        transparent,
        black 10%,
        black 90%,
        transparent
    );
    -webkit-mask-image: linear-gradient(
        to right,
        transparent,
        black 10%,
        black 90%,
        transparent
    );
}

.carousel-track {
    display: flex;
    gap: var(--spacing-md);
    animation: scroll 40s linear infinite;
}

.carousel-track:hover {
    animation-play-state: paused;
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.carousel-slide {
    flex-shrink: 0;
    width: 300px;
    height: 220px;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(20%);
    transition: filter var(--transition);
}

.carousel-slide:hover img {
    filter: grayscale(0%);
}

/* =============================================
   Footer
   ============================================= */
.footer {
    padding: var(--spacing-lg) 0;
    background: linear-gradient(135deg, #3d3d3d 0%, #2c2c2c 100%);
    text-align: center;
}

.footer-text {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-style: italic;
    color: rgba(255, 255, 255, 0.9);
}

.footer-divider {
    width: 40px;
    height: 1px;
    background: rgba(255, 255, 255, 0.3);
    margin: var(--spacing-sm) auto;
}

.footer-dates {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.2em;
}

/* =============================================
   Responsive Design
   ============================================= */
@media (max-width: 900px) {
    .memory-card {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .memory-card-reverse {
        direction: ltr;
    }

    .memory-image {
        max-width: 500px;
        margin: 0 auto;
    }

    .memory-text {
        padding: 0;
        text-align: center;
    }
}

@media (max-width: 768px) {
    :root {
        --spacing-lg: 3rem;
        --spacing-xl: 4rem;
    }

    .hero-name {
        font-size: 2.5rem;
    }

    .hero-dates {
        font-size: 0.95rem;
    }

    .hero-image-container {
        width: 220px;
        height: 220px;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .obituary-content p {
        font-size: 1.1rem;
        text-align: left;
    }

    .obituary-content p:first-of-type::first-letter {
        font-size: 3rem;
    }

    .carousel-slide {
        width: 250px;
        height: 180px;
    }
}

@media (max-width: 480px) {
    .hero-name {
        font-size: 2rem;
    }

    .hero-image-container {
        width: 180px;
        height: 180px;
    }

    .memory-author {
        font-size: 1.3rem;
    }

    .memory-text p {
        font-size: 1rem;
    }

    .carousel-slide {
        width: 200px;
        height: 150px;
    }
}

/* =============================================
   Lightbox Modal
   ============================================= */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.lightbox.active .lightbox-image {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.8);
    font-size: 3rem;
    cursor: pointer;
    transition: color var(--transition), transform var(--transition);
    z-index: 1001;
    line-height: 1;
}

.lightbox-close:hover {
    color: white;
    transform: scale(1.1);
}

.lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
}

.lightbox-arrow:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-color: rgba(255, 255, 255, 0.4);
}

.lightbox-prev {
    left: 30px;
}

.lightbox-next {
    right: 30px;
}

@media (max-width: 768px) {
    .lightbox-arrow {
        width: 50px;
        height: 50px;
        font-size: 2rem;
    }

    .lightbox-prev {
        left: 15px;
    }

    .lightbox-next {
        right: 15px;
    }

    .lightbox-close {
        top: 15px;
        right: 20px;
        font-size: 2.5rem;
    }
}

/* =============================================
   Placeholder Image Styles (for demo)
   ============================================= */
.hero-image,
.memory-image img,
.carousel-slide img {
    background: linear-gradient(135deg, #d0ccc5 0%, #b8b4ac 100%);
}
