/* ============================================
   style.css - Tema Vintage/Sepia Claro
   Memorial "Memorias QRCode"
   ============================================ */

/* ---------- Variables ---------- */
:root {
    --creme: #FAF6F0;
    --creme-dark: #F0E8DA;
    --sepia: #4A3728;
    --sepia-light: #6B5344;
    --sienna: #A0522D;
    --gold: #C8A96E;
    --gold-light: #D4BC8B;
    --gold-dark: #B8944E;
    --white: #FFFFFF;
    --border-light: #E0D5C5;
    --shadow-color: rgba(74, 55, 40, 0.15);
    --shadow-strong: rgba(74, 55, 40, 0.25);
    --pai-color: #5B7B6F;
    --mae-color: #8B6F7B;
    --ambos-color: #C8A96E;
}

/* ---------- Base ---------- */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Lora', Georgia, serif;
    background-color: var(--creme);
    color: var(--sepia);
    line-height: 1.7;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', Georgia, serif;
    color: var(--sepia);
    font-weight: 700;
}

a {
    color: var(--sienna);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--gold-dark);
}

::selection {
    background-color: var(--gold);
    color: var(--white);
}

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

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--creme-dark);
}
::-webkit-scrollbar-thumb {
    background: var(--gold);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--gold-dark);
}

/* ---------- Navbar ---------- */
.navbar-memorial {
    background-color: rgba(250, 246, 240, 0.95) !important;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-light);
    transition: all 0.3s ease;
    padding: 0.5rem 0;
}

.navbar-memorial.scrolled {
    box-shadow: 0 2px 20px var(--shadow-color);
}

.navbar-memorial .navbar-brand {
    font-family: 'Playfair Display', Georgia, serif;
    color: var(--sepia) !important;
    font-weight: 700;
    font-size: 1.3rem;
}

.navbar-memorial .nav-link {
    color: var(--sepia-light) !important;
    font-size: 0.9rem;
    padding: 0.5rem 1rem !important;
    transition: color 0.3s ease;
    position: relative;
}

.navbar-memorial .nav-link:hover,
.navbar-memorial .nav-link.active {
    color: var(--sienna) !important;
}

.navbar-memorial .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background-color: var(--gold);
    transition: width 0.3s ease;
}

.navbar-memorial .nav-link:hover::after,
.navbar-memorial .nav-link.active::after {
    width: 60%;
}

/* ---------- Hero Section ---------- */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--creme) 0%, var(--creme-dark) 50%, var(--creme) 100%);
    position: relative;
    overflow: hidden;
    padding-top: 80px;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(250, 246, 240, 0.3) 70%);
    pointer-events: none;
}

.hero-photo {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--gold);
    box-shadow: 0 8px 30px var(--shadow-strong), 0 0 0 8px rgba(200, 169, 110, 0.15);
    filter: sepia(20%) saturate(90%);
    transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.hero-photo:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 40px var(--shadow-strong), 0 0 0 12px rgba(200, 169, 110, 0.2);
}

.hero-name {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2.5rem;
    color: var(--sepia);
    margin-top: 1rem;
    margin-bottom: 0.25rem;
}

.hero-dates {
    color: var(--sepia-light);
    font-size: 1rem;
    letter-spacing: 2px;
}

.hero-divider {
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: 1.5rem auto;
}

.hero-message {
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-size: 1.5rem;
    color: var(--sepia-light);
    max-width: 600px;
    margin: 0 auto;
}

.hero-ampersand {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 3rem;
    color: var(--gold);
    line-height: 1;
}

/* ---------- Section Common ---------- */
.section-memorial {
    padding: 80px 0;
}

.section-memorial:nth-child(even) {
    background-color: var(--creme-dark);
}

.section-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 2.2rem;
    text-align: center;
    margin-bottom: 0.5rem;
    color: var(--sepia);
}

.section-subtitle {
    text-align: center;
    color: var(--sepia-light);
    font-style: italic;
    margin-bottom: 2rem;
    font-size: 1.05rem;
}

/* Testemunhos — sem espaço extra entre título e cards */
#testemunhos .section-subtitle {
    margin-bottom: 1rem;
}
#testemunhos #testimonials-list {
    margin-top: 0.5rem;
}

.section-divider {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: 0 auto 1.5rem;
}

/* ---------- Life Stories ---------- */
.life-story-card {
    background: var(--white);
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 4px 20px var(--shadow-color);
    border: 1px solid var(--border-light);
    margin-bottom: 2rem;
    transition: transform 0.3s ease;
}

.life-story-card:hover {
    transform: translateY(-3px);
}

.life-story-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--gold);
    filter: sepia(20%) saturate(90%);
    box-shadow: 0 4px 15px var(--shadow-color);
}

.life-story-name {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.8rem;
    margin-top: 1rem;
}

.life-story-dates {
    color: var(--sepia-light);
    font-size: 0.9rem;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.life-story-text {
    color: var(--sepia-light);
    line-height: 1.9;
    text-align: justify;
}

/* ---------- Gallery ---------- */
.gallery-filters {
    margin-bottom: 2rem;
}

.gallery-filters .btn-filter {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--sepia-light);
    padding: 0.4rem 1.2rem;
    border-radius: 20px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    margin: 0.25rem;
}

.gallery-filters .btn-filter:hover,
.gallery-filters .btn-filter.active {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--white);
}

.memory-card {
    background: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 15px var(--shadow-color);
    border: 1px solid var(--border-light);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    height: 100%;
}

.memory-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px var(--shadow-strong);
}

.memory-card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    filter: sepia(20%) saturate(90%);
    transition: filter 0.3s ease;
}

.memory-card:hover .memory-card-img {
    filter: sepia(5%) saturate(100%);
}

.memory-card-body {
    padding: 1.2rem;
}

.memory-card-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--sepia);
}

.memory-card-date {
    font-size: 0.8rem;
    color: var(--sepia-light);
}

.memory-card-author {
    font-size: 0.8rem;
    color: var(--gold-dark);
    font-style: italic;
}

.memory-card-tags {
    margin-top: 0.5rem;
}

.memory-card-tags .badge {
    background-color: var(--creme-dark);
    color: var(--sepia-light);
    font-weight: 400;
    font-size: 0.7rem;
    margin-right: 0.25rem;
}

.parent-badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.parent-badge.pai {
    background-color: rgba(91, 123, 111, 0.15);
    color: var(--pai-color);
}

.parent-badge.mae {
    background-color: rgba(139, 111, 123, 0.15);
    color: var(--mae-color);
}

.parent-badge.ambos {
    background-color: rgba(200, 169, 110, 0.15);
    color: var(--gold-dark);
}

/* ---------- Lightbox Modal ---------- */
.lightbox-modal .modal-content {
    background-color: rgba(0, 0, 0, 0.95);
    border: none;
}

.lightbox-modal .modal-body {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.lightbox-modal .lightbox-img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

.lightbox-modal .btn-close {
    filter: invert(1);
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(200, 169, 110, 0.8);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.3s ease;
    z-index: 10;
}

.lightbox-nav:hover {
    background: var(--gold);
}

.lightbox-nav.prev { left: 1rem; }
.lightbox-nav.next { right: 1rem; }

/* ---------- Memory Detail Modal ---------- */
.memory-detail-modal .modal-content {
    background-color: var(--creme);
    border: 1px solid var(--border-light);
    border-radius: 12px;
}

.memory-detail-modal .modal-header {
    border-bottom: 1px solid var(--border-light);
    background: var(--white);
    border-radius: 12px 12px 0 0;
}

.memory-detail-modal .modal-title {
    font-family: 'Playfair Display', Georgia, serif;
}

.memory-detail-photos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.memory-detail-photos img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    filter: sepia(20%) saturate(90%);
    transition: filter 0.3s ease;
    border: 2px solid var(--border-light);
}

.memory-detail-photos img:hover {
    filter: sepia(0%);
}

/* ---------- Timeline ---------- */
.timeline-container {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

.timeline-line {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, var(--gold-light), var(--gold), var(--gold-light));
    top: 0;
}

.timeline-entry {
    display: flex;
    align-items: flex-start;
    margin-bottom: 2.5rem;
    position: relative;
}

.timeline-entry:nth-child(odd) {
    flex-direction: row;
}

.timeline-entry:nth-child(even) {
    flex-direction: row-reverse;
}

.timeline-content {
    width: 45%;
    background: var(--white);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 3px 15px var(--shadow-color);
    border: 1px solid var(--border-light);
    transition: transform 0.3s ease;
    position: relative;
}

.timeline-content:hover {
    transform: translateY(-3px);
}

.timeline-entry:nth-child(odd) .timeline-content {
    margin-right: auto;
}

.timeline-entry:nth-child(even) .timeline-content {
    margin-left: auto;
}

.timeline-dot {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background: var(--gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 1rem;
    z-index: 2;
    border: 3px solid var(--white);
    box-shadow: 0 2px 10px var(--shadow-color);
}

.timeline-year-badge {
    display: inline-block;
    background: var(--gold);
    color: var(--white);
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.timeline-content h5 {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.timeline-content p {
    color: var(--sepia-light);
    font-size: 0.9rem;
    margin-bottom: 0;
}

.timeline-decade-nav {
    text-align: center;
    margin-bottom: 2rem;
}

.timeline-decade-nav .btn {
    margin: 0.25rem;
}

/* ---------- Map ---------- */
.map-container {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px var(--shadow-color);
    border: 2px solid var(--border-light);
}

#memorial-map {
    height: 500px;
    width: 100%;
}

.map-sepia {
    filter: sepia(30%) saturate(80%) brightness(105%);
}

.map-legend {
    background: var(--white);
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-light);
}

.map-legend-item {
    display: inline-flex;
    align-items: center;
    margin-right: 1.5rem;
    font-size: 0.85rem;
    color: var(--sepia-light);
}

.map-legend-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.4rem;
    font-size: 0.75rem;
    color: var(--white);
}

/* Leaflet popup custom */
.leaflet-popup-content-wrapper {
    border-radius: 10px !important;
    box-shadow: 0 3px 15px var(--shadow-color) !important;
    font-family: 'Lora', Georgia, serif !important;
}

.leaflet-popup-content {
    margin: 12px 16px !important;
    font-size: 0.9rem !important;
    color: var(--sepia) !important;
}

.popup-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.3rem;
}

.popup-thumb {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 6px;
    margin-top: 0.5rem;
    filter: sepia(20%) saturate(90%);
}

/* ---------- Submission Form ---------- */
.form-memorial {
    background: var(--white);
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 4px 20px var(--shadow-color);
    border: 1px solid var(--border-light);
    max-width: 700px;
    margin: 0 auto;
}

.form-memorial .form-label {
    font-weight: 600;
    color: var(--sepia);
    font-size: 0.9rem;
}

.form-memorial .form-control,
.form-memorial .form-select {
    border: 1px solid var(--border-light);
    background-color: var(--creme);
    color: var(--sepia);
    border-radius: 8px;
    padding: 0.6rem 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-memorial .form-control:focus,
.form-memorial .form-select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(200, 169, 110, 0.2);
}

.form-memorial .form-text {
    color: var(--sepia-light);
    font-size: 0.8rem;
}

.photo-preview-container {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.photo-preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--border-light);
}

.photo-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-preview-item .btn-remove-photo {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    cursor: pointer;
}

/* ---------- Testimonials ---------- */
.testimonial-card {
    background: var(--white);
    border-radius: 10px;
    padding: 1.5rem 2rem;
    box-shadow: 0 3px 15px var(--shadow-color);
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--gold);
    margin-bottom: 1.5rem;
    position: relative;
}

.testimonial-card::before {
    content: '\201C';
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 4rem;
    color: var(--gold-light);
    position: absolute;
    top: -10px;
    left: 15px;
    line-height: 1;
    opacity: 0.5;
}

.testimonial-text {
    font-style: italic;
    color: var(--sepia-light);
    line-height: 1.8;
    margin-bottom: 1rem;
    padding-left: 1rem;
}

.testimonial-author {
    font-weight: 700;
    color: var(--sepia);
}

.testimonial-relation {
    font-size: 0.85rem;
    color: var(--gold-dark);
}

/* ---------- QR Code Section ---------- */
.qr-container {
    text-align: center;
}

.qr-wrapper {
    display: inline-block;
    background: var(--white);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px var(--shadow-color);
    border: 2px solid var(--gold-light);
}

.qr-wrapper canvas,
.qr-wrapper img {
    display: block;
    margin: 0 auto;
}

/* ---------- Footer ---------- */
.footer-memorial {
    background-color: var(--sepia);
    color: var(--creme-dark);
    padding: 2.5rem 0 1.5rem;
}

.footer-memorial h5 {
    color: var(--gold);
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.3rem;
}

.footer-memorial a {
    color: var(--gold-light);
}

.footer-memorial a:hover {
    color: var(--gold);
}

.footer-divider {
    border-color: rgba(200, 169, 110, 0.2);
}

.footer-memorial .text-muted {
    color: rgba(240, 232, 218, 0.5) !important;
}

/* ---------- Buttons (themed) ---------- */
.btn-gold {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--white);
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(200, 169, 110, 0.3);
}

.btn-gold:hover {
    background: linear-gradient(135deg, var(--gold-dark), var(--sienna));
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(200, 169, 110, 0.4);
}

.btn-outline-gold {
    background: transparent;
    color: var(--gold-dark);
    border: 2px solid var(--gold);
    padding: 0.4rem 1.3rem;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-outline-gold:hover {
    background: var(--gold);
    color: var(--white);
}

.btn-sepia {
    background: var(--sepia);
    color: var(--creme);
    border: none;
    border-radius: 25px;
    padding: 0.5rem 1.5rem;
    transition: all 0.3s ease;
}

.btn-sepia:hover {
    background: var(--sepia-light);
    color: var(--white);
}

/* ---------- Scroll to top ---------- */
.btn-scroll-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--gold);
    color: var(--white);
    border: none;
    box-shadow: 0 3px 15px var(--shadow-color);
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    z-index: 1050;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-scroll-top.show {
    display: flex;
}

.btn-scroll-top:hover {
    background: var(--gold-dark);
    transform: translateY(-3px);
}

/* ---------- Toast ---------- */
.toast-memorial {
    background: var(--white);
    border: 1px solid var(--border-light);
    border-left: 4px solid var(--gold);
    border-radius: 8px;
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .hero-name {
        font-size: 2rem;
    }
    .hero-message {
        font-size: 1.2rem;
    }
    .hero-photo {
        width: 150px;
        height: 150px;
    }
    .section-title {
        font-size: 1.8rem;
    }
}

@media (max-width: 767.98px) {
    .hero-name {
        font-size: 1.6rem;
    }
    .hero-message {
        font-size: 1rem;
    }
    .hero-photo {
        width: 120px;
        height: 120px;
    }
    .hero-ampersand {
        font-size: 2rem;
    }

    /* Timeline mobile */
    .timeline-line {
        left: 20px;
    }
    .timeline-entry,
    .timeline-entry:nth-child(even) {
        flex-direction: row;
        padding-left: 50px;
    }
    .timeline-content {
        width: 100%;
    }
    .timeline-dot {
        left: 20px;
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }

    .life-story-card {
        padding: 1.5rem;
    }
    .section-memorial {
        padding: 50px 0;
    }
    .form-memorial {
        padding: 1.5rem;
    }

    #memorial-map {
        height: 350px;
    }
}

@media (max-width: 575.98px) {
    .hero-photo {
        width: 100px;
        height: 100px;
    }
    .hero-name {
        font-size: 1.3rem;
    }
}

/* ---------- Loading state ---------- */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.loading-spinner .spinner-border {
    color: var(--gold);
}

/* ---------- Empty state ---------- */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--sepia-light);
}

.empty-state i {
    font-size: 3rem;
    color: var(--border-light);
    margin-bottom: 1rem;
}

/* ===== HERO PERSON — estados de filtro ===== */
.hero-person-wrap {
    cursor: pointer;
    transition: opacity 0.4s ease, transform 0.4s ease;
    display: inline-block;
    text-align: center;
}

.hero-person-wrap:hover .hero-photo {
    transform: scale(1.07);
    box-shadow: 0 12px 40px var(--shadow-strong), 0 0 0 12px rgba(200,169,110,0.25);
}

.hero-click-hint {
    font-size: 0.75rem;
    color: var(--gold);
    opacity: 0;
    margin-top: 0.25rem;
    transition: opacity 0.3s ease;
    letter-spacing: 1px;
}

.hero-person-wrap:hover .hero-click-hint {
    opacity: 1;
}

.hero-person-dimmed {
    opacity: 0.25;
    transform: scale(0.95);
}

.hero-person-active .hero-photo {
    border-color: var(--gold);
    box-shadow: 0 0 0 6px rgba(200,169,110,0.4), 0 12px 40px var(--shadow-strong);
}
