/* ═══════════════════════════════════════════
   Angela Lathey Memorial — "April Morning"
   A spring garden palette, wildflower energy
   ═══════════════════════════════════════════ */

:root {
    /* Spring garden palette — bolder, more alive */
    --cream: #FFF9F0;
    --cream-warm: #FFF3E0;
    --pink: #D4729A;
    --pink-light: #F9E0ED;
    --pink-soft: #E896B8;
    --lilac: #A67BB5;
    --lilac-light: #EDE0F2;
    --lilac-deep: #8B5FA0;
    --yellow: #E6C040;
    --yellow-light: #FFF5D6;
    --yellow-warm: #F0D060;
    --green: #5EA354;
    --green-light: #C8E6C0;
    --green-soft: #7EBB74;
    --blue: #5BA8CC;
    --blue-light: #D6F0FB;
    --white: #FFFFFF;

    /* Text — strong, warm, readable */
    --text: #2E2422;
    --text-mid: #4A3F3A;
    --text-light: #6E6058;

    /* Typography */
    --font-script: 'Caveat', cursive;
    --font-body: 'Quicksand', sans-serif;
}

/* ═══════ RESET & BASE ═══════ */

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

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

body {
    font-family: var(--font-body);
    color: var(--text);
    background: var(--cream);
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

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

/* ═══════ LAYOUT ═══════ */

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

.section {
    padding: 5rem 0;
    position: relative;
    z-index: 1;
}

.section-title {
    font-family: var(--font-script);
    font-size: 3.2rem;
    font-weight: 700;
    text-align: center;
    color: var(--text);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.section-subtitle {
    text-align: center;
    color: var(--text-mid);
    font-size: 1.1rem;
    font-weight: 400;
    margin-bottom: 2.5rem;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

/* ═══════ REVEAL ANIMATION ═══════ */
/* Start visible, animate is enhancement only */

.reveal {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.animate-ready {
    opacity: 0;
    transform: translateY(24px);
}

.reveal.animate-ready.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ═══════ FLOATING FLOWERS ═══════ */

.floating-flowers {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.flower-accent {
    position: absolute;
    opacity: 0.3;
}

.flower-1 {
    width: 80px;
    top: 15%;
    left: 3%;
    animation: float-gentle 8s ease-in-out infinite;
}

.flower-2 {
    width: 50px;
    top: 35%;
    right: 4%;
    animation: float-gentle 10s ease-in-out infinite 2s;
}

.flower-3 {
    width: 65px;
    top: 60%;
    left: 5%;
    animation: float-gentle 9s ease-in-out infinite 4s;
}

.flower-4 {
    width: 45px;
    top: 75%;
    right: 6%;
    animation: float-gentle 11s ease-in-out infinite 1s;
}

.flower-5 {
    width: 40px;
    top: 45%;
    left: 8%;
    animation: float-gentle 7s ease-in-out infinite 3s;
}

@keyframes float-gentle {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-12px) rotate(3deg); }
}

/* ═══════ HERO ═══════ */

.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(212,114,154,0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 30%, rgba(166,123,181,0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(230,192,64,0.10) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 70%, rgba(91,168,204,0.08) 0%, transparent 50%),
        linear-gradient(180deg, #FFF9F0 0%, #FFF3E0 100%);
    z-index: 1;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 2rem;
}

.hero-prelude {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 1.25rem;
}

.hero-name {
    font-family: var(--font-script);
    font-size: clamp(3.5rem, 10vw, 7.5rem);
    font-weight: 700;
    line-height: 1.1;
    color: var(--lilac-deep);
    margin-bottom: 1rem;
}

.hero-dates {
    font-family: var(--font-body);
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text-mid);
    letter-spacing: 0.05em;
    margin-bottom: 1.5rem;
}

.hero-epitaph {
    font-family: var(--font-body);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--pink);
    letter-spacing: 0.12em;
}

.meadow-strip {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
    z-index: 1;
}

.meadow-strip svg {
    width: 100%;
    height: 100%;
}

/* ═══════ OBITUARY ═══════ */

.obituary {
    background: linear-gradient(180deg, var(--cream) 0%, var(--cream-warm) 50%, var(--cream) 100%);
}

.obituary-content {
    max-width: 680px;
    margin: 0 auto;
    text-align: center;
}

.obituary-content p {
    font-size: 1.15rem;
    line-height: 1.9;
    margin-bottom: 1.25rem;
    color: var(--text-mid);
}

.obituary-lead {
    font-size: 1.35rem !important;
    font-weight: 600;
    color: var(--text) !important;
}

.obituary-note {
    margin-top: 2rem;
    padding: 1rem 1.5rem;
    background: var(--yellow-light);
    border-radius: 12px;
    font-size: 0.95rem !important;
    color: var(--text-light) !important;
    border: 2px dashed var(--yellow);
}

/* ═══════ WILDFLOWER DIVIDERS ═══════ */

.wildflower-divider {
    text-align: center;
    padding: 1rem 2rem;
}

.wildflower-divider svg {
    max-width: 400px;
    width: 100%;
    height: auto;
}

/* ═══════ GALLERY ═══════ */

.gallery {
    background: linear-gradient(180deg, var(--cream) 0%, #FDF5FF 50%, var(--cream) 100%);
}

.gallery-grid {
    columns: 3;
    column-gap: 1.5rem;
    margin-bottom: 2rem;
}

.gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: var(--white);
    box-shadow: 0 4px 20px rgba(46, 36, 34, 0.1), 0 1px 4px rgba(46, 36, 34, 0.06);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(166, 123, 181, 0.12);
    break-inside: avoid;
    margin-bottom: 1.5rem;
    display: inline-block;
    width: 100%;
}

.gallery-item:nth-child(3n+1) { transform: rotate(-1.5deg); }
.gallery-item:nth-child(3n+2) { transform: rotate(1deg); }
.gallery-item:nth-child(3n+3) { transform: rotate(-0.5deg); }

.gallery-item:hover {
    transform: rotate(0deg) scale(1.03) !important;
    box-shadow: 0 12px 36px rgba(166,123,181,0.2);
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
}

.gallery-item-info {
    padding: 0.75rem 1rem;
}

.gallery-item-caption {
    font-size: 0.9rem;
    color: var(--text-mid);
    font-style: italic;
}

.gallery-item-by {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

.gallery-empty, .memory-empty {
    text-align: center;
    padding: 3rem 1rem;
    margin-bottom: 2rem;
}

.empty-state {
    color: var(--text-light);
    font-size: 1.05rem;
    font-weight: 500;
}

.empty-state svg {
    margin: 0 auto 1rem;
    opacity: 0.7;
}

/* ═══════ FUNERAL DETAILS ═══════ */

.funeral {
    background: linear-gradient(180deg, var(--cream) 0%, #FFF5F8 50%, var(--cream) 100%);
}

.funeral-card {
    max-width: 600px;
    margin: 2rem auto 0;
    background: var(--white);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 6px 28px rgba(46, 36, 34, 0.08), 0 1px 4px rgba(46, 36, 34, 0.04);
    border: 1px solid rgba(212, 114, 154, 0.15);
}

.funeral-detail {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    padding: 1.25rem 0;
}

.funeral-detail:not(:last-child) {
    border-bottom: 1px solid var(--green-light);
}

.funeral-icon {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    background: var(--cream-warm);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.funeral-detail h3 {
    font-family: var(--font-script);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.2rem;
}

.funeral-info {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-mid);
}

.funeral-sub {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 0.15rem;
}

/* ═══════ MEMORIES ═══════ */

.memories {
    background: linear-gradient(180deg, var(--cream) 0%, #F0FAFF 50%, var(--cream) 100%);
}

.memory-wall {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
    margin-bottom: 3rem;
}

.memory-card {
    background: var(--white);
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: 0 4px 18px rgba(46, 36, 34, 0.08), 0 1px 3px rgba(46, 36, 34, 0.04);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.memory-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

/* Rotating accent colors on cards */
.memory-card:nth-child(5n+1)::before { background: var(--pink-soft); }
.memory-card:nth-child(5n+2)::before { background: var(--lilac); }
.memory-card:nth-child(5n+3)::before { background: var(--yellow); }
.memory-card:nth-child(5n+4)::before { background: var(--blue); }
.memory-card:nth-child(5n+5)::before { background: var(--green); }

.memory-card:nth-child(4n+1) { transform: rotate(-0.8deg); }
.memory-card:nth-child(4n+2) { transform: rotate(0.5deg); }
.memory-card:nth-child(4n+3) { transform: rotate(-0.3deg); }
.memory-card:nth-child(4n+4) { transform: rotate(0.7deg); }

.memory-card:hover {
    transform: rotate(0deg) translateY(-4px) !important;
    box-shadow: 0 10px 32px rgba(46, 36, 34, 0.12);
}

.memory-text {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-mid);
    margin-bottom: 1rem;
    font-style: italic;
}

.memory-text::before { content: '\201C'; }
.memory-text::after { content: '\201D'; }

.memory-author {
    font-family: var(--font-script);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
}

.memory-relationship {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 0.1rem;
}

.memory-date {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.25rem;
}

/* ═══════ FORMS ═══════ */

.memory-form-wrapper {
    max-width: 600px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 20px;
    padding: 2.5rem 2.5rem 2rem;
    box-shadow: 0 6px 28px rgba(46, 36, 34, 0.08);
    border: 1px solid rgba(166, 123, 181, 0.15);
}

.form-title {
    font-family: var(--font-script);
    font-size: 2.2rem;
    font-weight: 700;
    text-align: center;
    color: var(--text);
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--green-light);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.6rem;
}

.optional {
    font-weight: 400;
    color: var(--text-light);
    font-size: 0.85rem;
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 0.9rem 1.1rem;
    border: 2px solid var(--green-light);
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text);
    background: var(--cream);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    outline: none;
}

.memory-form .form-group textarea {
    min-height: 140px;
}

.memory-form .btn-submit {
    margin-top: 0.75rem;
}

.form-group input[type="text"]::placeholder,
.form-group textarea::placeholder {
    color: #B0A8A2;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
    border-color: var(--lilac);
    box-shadow: 0 0 0 4px rgba(166,123,181,0.15);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.file-input-wrapper {
    position: relative;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.file-input-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem;
    border: 2px dashed var(--green-soft);
    border-radius: 12px;
    color: var(--text-light);
    font-size: 1rem;
    font-weight: 500;
    transition: border-color 0.3s ease, background 0.3s ease;
    background: var(--cream);
}

.file-input-wrapper:hover .file-input-display {
    border-color: var(--lilac);
    background: var(--lilac-light);
}

.photo-preview {
    display: none;
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 10px;
    margin-top: 0.75rem;
}

.photo-preview.active {
    display: block;
}

/* Buttons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 700;
    padding: 1rem 2.25rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--pink) 0%, var(--lilac) 100%);
    color: var(--white);
    margin: 1.5rem auto;
    display: flex;
    box-shadow: 0 4px 16px rgba(212, 114, 154, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(212, 114, 154, 0.4);
}

.btn-submit {
    background: linear-gradient(135deg, var(--green) 0%, var(--blue) 100%);
    color: var(--white);
    width: 100%;
    margin-top: 0.5rem;
    box-shadow: 0 4px 16px rgba(94, 163, 84, 0.25);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(94, 163, 84, 0.35);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Upload form (hidden by default) */

.upload-form {
    display: none;
    max-width: 500px;
    margin: 1.5rem auto 0;
    background: var(--white);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 6px 28px rgba(46, 36, 34, 0.08);
    border: 1px solid rgba(166, 123, 181, 0.15);
}

.upload-form.active {
    display: block;
    animation: slideDown 0.4s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ═══════ LIGHTBOX ═══════ */

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(255, 249, 240, 0.96);
    backdrop-filter: blur(10px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 2rem;
    cursor: pointer;
}

.lightbox.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.lightbox img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 12px 48px rgba(46, 36, 34, 0.18);
}

.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 48px;
    height: 48px;
    background: var(--white);
    border: 2px solid var(--green-light);
    border-radius: 50%;
    font-size: 1.6rem;
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.lightbox-close:hover {
    background: var(--pink-light);
}

.lightbox-caption {
    margin-top: 1rem;
    font-style: italic;
    color: var(--text-mid);
    font-size: 1.05rem;
    text-align: center;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ═══════ TOAST ═══════ */

.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--white);
    color: var(--text);
    padding: 1rem 2rem;
    border-radius: 50px;
    box-shadow: 0 8px 30px rgba(46, 36, 34, 0.15);
    font-size: 1rem;
    font-weight: 600;
    z-index: 2000;
    transition: transform 0.4s ease;
    border: 2px solid var(--green-light);
}

.toast.visible {
    transform: translateX(-50%) translateY(0);
}

/* ═══════ FOOTER ═══════ */

.footer {
    position: relative;
    text-align: center;
    padding: 3.5rem 2rem 3rem;
    background: var(--cream-warm);
    overflow: hidden;
}

.footer-flowers {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
}

.footer-flowers svg {
    width: 100%;
    height: 100%;
}

.footer-content {
    position: relative;
    z-index: 1;
}

.footer-name {
    font-family: var(--font-script);
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text);
}

.footer-years {
    font-size: 1rem;
    color: var(--text-mid);
    margin-top: 0.25rem;
    letter-spacing: 0.1em;
    font-weight: 500;
}

.footer-message {
    font-style: italic;
    color: var(--pink);
    margin-top: 1rem;
    font-size: 1.15rem;
    font-weight: 600;
}

/* ═══════ RESPONSIVE ═══════ */

@media (max-width: 768px) {
    .section {
        padding: 3.5rem 0;
    }

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

    .container {
        padding: 0 1.25rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .gallery-grid {
        columns: 2;
        column-gap: 1rem;
    }

    .memory-wall {
        grid-template-columns: 1fr;
    }

    .funeral-card {
        padding: 1.5rem;
    }

    .memory-form-wrapper {
        padding: 1.5rem;
    }

    .upload-form {
        padding: 1.5rem;
    }

    .floating-flowers {
        display: none;
    }

    .hero-name {
        font-size: clamp(3rem, 12vw, 5rem);
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 2.2rem;
    }

    .gallery-grid {
        columns: 2;
        column-gap: 0.75rem;
    }

    .gallery-item:nth-child(n) {
        transform: none;
    }

    .memory-card:nth-child(n) {
        transform: none;
    }
}

/* ═══════ PRINT STYLES ═══════ */

@media print {
    .floating-flowers,
    .upload-form,
    .btn,
    .memory-form-wrapper,
    .toast,
    .lightbox {
        display: none !important;
    }

    .section {
        break-inside: avoid;
    }
}
