:root {
    --bg-cream: #FDFBF7;
    --bg-sage: #E8EFE8;
    --text-primary: #344E41;
    --text-secondary: #588157;
    --accent: #D4A373;
    --white: #ffffff;
    --shadow: 0 4px 12px rgba(52, 78, 65, 0.1);
    --radius: 8px;
    --serif: 'Playfair Display', Georgia, serif;
    --sans: 'Lora', 'Segoe UI', serif;
}

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

body {
    background-color: var(--bg-cream);
    color: var(--text-primary);
    font-family: var(--sans);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, .logo {
    font-family: var(--serif);
    font-weight: 700;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

ul {
    list-style: none;
}

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

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 5rem 0;
}

.btn {
    display: inline-block;
    background-color: var(--accent);
    color: var(--white);
    padding: 0.8rem 2rem;
    border-radius: var(--radius);
    font-weight: 600;
    transition: transform 0.2s ease, opacity 0.2s ease;
    border: none;
    cursor: pointer;
    font-family: var(--sans);
    outline: none;
}

.btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

/* Header */
header {
    padding: 1.5rem 0;
    position: relative;
    width: 100%;
    z-index: 100;
    background-color: var(--white);
    box-shadow: var(--shadow);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    color: var(--text-primary);
}

nav ul {
    display: flex;
    align-items: center;
    gap: 2rem;
}

nav ul li a, .btn-text {
    text-decoration: none;
    color: var(--text-primary);
    transition: color 0.3s ease;
    font-size: 1rem;
    font-family: var(--sans);
    font-weight: 600;
}

nav ul li a:hover, .btn-text:hover {
    color: var(--accent);
}

.btn-text {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin: 0;
    outline: none;
}

.auth-btns {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.btn-small {
    padding: 0.6rem 1.4rem;
    font-size: 0.9rem;
}

.nav-search {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-search input {
    padding: 0.5rem 1rem;
    padding-left: 2.5rem;
    border-radius: 20px;
    border: 1px solid rgba(52, 78, 65, 0.2);
    font-family: var(--sans);
    width: 200px;
    transition: width 0.3s ease;
}

.nav-search input:focus {
    width: 250px;
    outline: none;
    border-color: var(--accent);
}

.nav-search i {
    position: absolute;
    left: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Auth Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(52, 78, 65, 0.6);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: var(--bg-cream);
    margin: auto;
    padding: 3rem;
    border-radius: var(--radius);
    width: 90%;
    max-width: 450px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
    position: relative;
    border-top: 5px solid var(--accent);
}

.close-modal {
    position: absolute;
    right: 1.5rem;
    top: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
}

.auth-form input {
    width: 100%;
    padding: 0.8rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(52, 78, 65, 0.2);
    border-radius: var(--radius);
    font-family: var(--sans);
}

.auth-form button {
    width: 100%;
    margin-top: 1rem;
}

.modal-toggle-text {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-align: center;
}

.modal-toggle-text span {
    color: var(--accent);
    cursor: pointer;
    font-weight: 600;
}

/* Pricing Section */
.pricing {
    background-color: var(--bg-sage);
}

.pricing-card {
    background-color: var(--white);
    max-width: 400px;
    margin: 0 auto;
    padding: 3rem 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-top: 5px solid var(--accent);
}

.price {
    font-size: 3rem;
    font-family: var(--serif);
    color: var(--text-primary);
    margin: 1rem 0;
}

.price span {
    font-size: 1rem;
    color: var(--text-secondary);
}

.pricing-features {
    margin: 2rem 0;
    text-align: left;
}

.pricing-features li {
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Hero Section */
.hero {
    height: 100vh;
    min-height: 600px;
    background: url('../images/hero.jpeg') center/cover no-repeat;
    position: relative;
    display: flex;
    align-items: center;
    color: var(--white);
    text-align: center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(34, 51, 43, 0.55) 0%, rgba(20, 31, 26, 0.75) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.25);
    font-weight: 500;
}

/* Intro Section */
.intro {
    background-color: var(--white);
}

.intro-text {
    max-width: 700px;
    margin: 0 auto;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* Memorial Page Specifics */
.memorial-page {
    background-color: var(--bg-cream);
}

.static-header {
    position: relative;
    background-color: var(--white);
    box-shadow: var(--shadow);
}

/* Profile Header */
.profile-header {
    padding-top: 4rem;
    padding-bottom: 3rem;
    background: linear-gradient(to bottom, var(--white), var(--bg-cream));
}

.portrait-placeholder {
    width: 200px;
    height: 200px;
    background-color: var(--bg-sage);
    border-radius: 50%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--serif);
    font-size: 3rem;
    color: var(--text-secondary);
    border: 4px solid var(--white);
    box-shadow: var(--shadow);
}

.portrait-img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--white);
    box-shadow: var(--shadow);
    margin: 0 auto;
    display: block;
}

.profile-header h1 {
    font-size: 3rem;
    color: var(--text-primary);
}

.dates {
    font-style: italic;
    color: var(--text-secondary);
    font-size: 1.2rem;
}

/* Biography */
.bio-content {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.15rem;
}

.bio-content p {
    margin-bottom: 1.5rem;
}

/* Timeline */
.timeline-section {
    background-color: var(--bg-sage);
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding-left: 2rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 2px;
    background-color: var(--accent);
}

.timeline-item {
    position: relative;
    margin-bottom: 2.5rem;
}

.timeline-dot {
    position: absolute;
    left: -2.4rem;
    top: 0.5rem;
    width: 12px;
    height: 12px;
    background-color: var(--accent);
    border-radius: 50%;
    border: 3px solid var(--bg-sage);
}

.timeline-content h3 {
    font-size: 1.4rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

/* Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.gallery-placeholder {
    aspect-ratio: 4 / 3;
    background-color: var(--bg-sage);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
    border: 1px solid rgba(0,0,0,0.05);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-placeholder {
    transform: scale(1.02);
}

/* Memories & Stories */
.memories-section {
    background-color: var(--bg-cream);
}

.stories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.story-card {
    background-color: var(--white);
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-top: 4px solid var(--accent);
}

.story-text {
    font-style: italic;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.story-author {
    color: var(--text-secondary);
    font-weight: 600;
}

/* Footer */
footer {
    background-color: var(--bg-sage);
    padding: 3rem 0;
    text-align: center;
    color: var(--text-secondary);
}

/* Utils */
.text-center { text-align: center; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }

/* Hero Buttons Layout */
.hero-btns {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

/* Dashboard Header Layout */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
}

/* Nav Toggle Inputs (hidden by default) */
.nav-toggle {
    display: none;
}
.nav-toggle-label {
    display: none;
}

/* Responsive Breakpoints */
@media (max-width: 992px) {
    .nav-search input {
        width: 150px;
    }
    .nav-search input:focus {
        width: 180px;
    }
}

@media (max-width: 768px) {
    /* Mobile Navigation Drawer */
    header .container {
        position: relative;
    }
    
    .nav-toggle-label {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 2.5rem;
        height: 2.5rem;
        cursor: pointer;
        z-index: 1001;
        position: relative;
    }

    .nav-toggle-label span,
    .nav-toggle-label span::before,
    .nav-toggle-label span::after {
        display: block;
        background: var(--text-primary);
        height: 2px;
        width: 1.75rem;
        position: absolute;
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s ease;
    }

    .nav-toggle-label span::before {
        content: '';
        top: -8px;
    }

    .nav-toggle-label span::after {
        content: '';
        top: 8px;
    }

    /* Transform hamburger into X */
    .nav-toggle:checked ~ .nav-toggle-label span {
        background: transparent;
    }

    .nav-toggle:checked ~ .nav-toggle-label span::before {
        transform: rotate(45deg);
        top: 0;
    }

    .nav-toggle:checked ~ .nav-toggle-label span::after {
        transform: rotate(-45deg);
        top: 0;
    }

    nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        height: 100vh;
        background: rgba(253, 251, 247, 0.98);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        box-shadow: -10px 0 30px rgba(52, 78, 65, 0.1);
        z-index: 1000;
        transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        padding: 5rem 2rem 2rem 2rem;
        display: flex;
        flex-direction: column;
    }

    .nav-toggle:checked ~ nav {
        right: 0;
    }

    nav ul {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
        width: 100%;
        text-align: center;
    }

    nav ul li {
        width: 100%;
        text-align: center;
    }

    nav ul li a, .btn-text {
        font-size: 1.15rem;
        display: block;
        padding: 0.5rem 0;
        width: 100%;
        border-bottom: 1px solid rgba(52, 78, 65, 0.05);
        text-align: center;
    }

    .auth-btns {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
        width: 100%;
        margin-top: 0.5rem;
    }

    .auth-btns .btn {
        width: 100%;
        text-align: center;
        padding: 0.8rem;
    }

    .nav-search {
        width: 100%;
        margin-top: 1rem;
    }

    .nav-search input {
        width: 100% !important;
        padding-top: 0.6rem;
        padding-bottom: 0.6rem;
    }

    /* Layout Elements Mobile Responsiveness */
    .hero {
        min-height: 350px;
        padding: 4rem 0;
        background-position: center 20%;
    }

    .hero h1 {
        font-size: 2.25rem;
        margin-bottom: 1rem;
    }

    .hero p {
        font-size: 1.1rem;
        margin-bottom: 1.5rem;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
        margin-bottom: 2.5rem;
    }
    
    .dashboard-header h1 {
        font-size: 2rem;
    }

    .dashboard-header .btn {
        width: 100%;
        max-width: 320px;
    }

    /* Memorial Page Elements */
    .profile-header h1 {
        font-size: 2.25rem;
    }
    
    .portrait-placeholder, .portrait-img {
        width: 160px;
        height: 160px;
        font-size: 2.5rem;
    }

    .timeline {
        padding-left: 1.5rem;
    }
    .timeline-dot {
        left: -1.9rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding: 0 1.25rem;
    }

    section {
        padding: 3.5rem 0;
    }

    .modal-content {
        margin: auto;
        padding: 2.5rem 1.5rem;
        width: 92%;
    }

    .pricing-card {
        padding: 2.5rem 1.5rem;
    }

    .price {
        font-size: 2.5rem;
    }

    .stories-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .story-card {
        padding: 1.75rem;
    }

    .wizard-steps-indicator {
        gap: 0.25rem;
    }
    
    .step-line {
        max-width: 20px;
    }
}

/* Prevent auto-zooming on input focus in mobile Safari */
@media (max-width: 768px) {
    input, textarea, select {
        font-size: 16px !important;
    }
}

/* Wizard Step Indicators */
.wizard-steps-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 1.5rem 0 2rem 0;
}

.step-dot {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background-color: var(--bg-sage);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.step-dot.active {
    background-color: var(--accent);
    color: var(--white);
    box-shadow: 0 4px 10px rgba(212, 163, 115, 0.3);
}

.step-dot.completed {
    background-color: var(--text-primary);
    color: var(--white);
}

.step-line {
    flex-grow: 1;
    height: 2px;
    background-color: var(--bg-sage);
    max-width: 50px;
    transition: background-color 0.3s ease;
}

.step-line.active {
    background-color: var(--accent);
}

/* Lightbox */
.lightbox {
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(26, 36, 33, 0.95);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.lightbox.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-content-container {
    position: relative;
    max-width: 90%;
    max-height: 85%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transform: scale(0.95);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.lightbox-caption {
    margin-top: 1rem;
    color: var(--bg-cream);
    font-family: var(--serif);
    font-size: 1.1rem;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.lightbox-close {
    position: absolute;
    top: 2rem;
    right: 2rem;
    color: var(--bg-cream);
    font-size: 2.5rem;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
    line-height: 1;
    z-index: 2010;
}

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

.lightbox-prev, .lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: var(--bg-cream);
    font-size: 3rem;
    font-weight: 300;
    cursor: pointer;
    padding: 1rem;
    transition: color 0.2s, transform 0.2s;
    user-select: none;
    z-index: 2010;
}

.lightbox-prev:hover, .lightbox-next:hover {
    color: var(--accent);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
    left: 2rem;
}

.lightbox-next {
    right: 2rem;
}

@media (max-width: 768px) {
    .lightbox-prev, .lightbox-next {
        font-size: 2.2rem;
        padding: 0.5rem;
    }
    .lightbox-prev { left: 0.5rem; }
    .lightbox-next { right: 0.5rem; }
    .lightbox-close { top: 1rem; right: 1rem; }
}

/* Search Dropdown Results Overlay */
.search-results-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 300px;
    background: var(--white);
    border: 1px solid rgba(52, 78, 65, 0.15);
    border-radius: var(--radius);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    margin-top: 0.5rem;
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
    display: none;
}

.search-results-dropdown.active {
    display: block;
}

.search-result-item {
    display: block;
    padding: 0.8rem 1.2rem;
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid rgba(52, 78, 65, 0.05);
    transition: background 0.2s ease;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--bg-cream);
}

.search-result-name {
    font-weight: 600;
    font-family: var(--serif);
    font-size: 0.95rem;
}

.search-result-dates {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.search-no-results {
    padding: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-style: italic;
    text-align: center;
}

