@import 'variables.css';

/* Memorial Viewer Custom Elements */
.memorial-hero {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
    align-items: center;
    background-color: var(--bg-card);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.memorial-portrait-container {
    height: 350px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 4px solid white;
    box-shadow: var(--shadow-md);
}

.memorial-portrait {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.memorial-portrait-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e2e8f0;
    color: #64748b;
    font-family: var(--font-serif);
    font-size: 4rem;
}

.memorial-meta h1 {
    font-family: var(--font-serif);
    font-size: 2.8rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.memorial-dates {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.4rem;
    color: var(--accent);
    margin-bottom: 1.5rem;
}

.obituary-block {
    font-size: 1.1rem;
    color: var(--primary-light);
    white-space: pre-line;
}

/* Tabs System */
.tabs-container {
    margin-top: 3rem;
}

.tabs-nav {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 2rem;
    overflow-x: auto;
    gap: 0.5rem;
    width: 100%;
    max-width: 100%;
}

.tab-btn {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    font-size: 1.05rem;
    font-family: var(--font-sans);
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--primary);
}

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 600;
}

.tab-content {
    display: none;
    background-color: var(--bg-card);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    animation: fadeIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Timeline/Life Events */
.timeline {
    position: relative;
    padding-left: 2.5rem;
    margin: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--border-color);
}

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

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -2.5rem;
    top: 0.25rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--accent);
    border: 4px solid var(--bg-card);
    box-shadow: 0 0 0 2px var(--border-color);
}

.timeline-year {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.timeline-title {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.timeline-desc {
    color: var(--text-muted);
}

.relational-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.relational-link:hover {
    text-decoration: underline;
}

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

.gallery-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.gallery-item {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    background-color: #000;
    position: relative;
    aspect-ratio: 1;
}

.gallery-item:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-md);
}

.gallery-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.gallery-caption {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
    line-height: 1.4;
    padding: 0 0.25rem;
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0,0,0,0.6);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    pointer-events: none;
}

/* Guestbook comments & moderation */
.comment-form-container {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 2rem;
    margin-bottom: 2rem;
}

.comment-form-title {
    font-family: var(--font-serif);
    margin-bottom: 1rem;
    color: var(--primary);
}

.submit-message {
    display: none;
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-weight: 500;
}

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

.form-row .form-group {
    margin: 0;
}

.comments-section-title {
    font-family: var(--font-serif);
    margin-bottom: 1.5rem;
    color: var(--primary);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.comment-card {
    background-color: var(--bg-main);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.comment-author {
    font-weight: 600;
    color: var(--primary);
}

.comment-date {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.comment-text {
    color: var(--primary-light);
    white-space: pre-line;
}

/* Mottos */
.motto-quote {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-style: italic;
    text-align: center;
    color: var(--primary);
    max-width: 800px;
    margin: 3rem auto;
    position: relative;
    padding: 0 2rem;
}

.motto-quote::before, .motto-quote::after {
    color: var(--accent);
    font-size: 4rem;
    position: absolute;
    opacity: 0.2;
}

.motto-quote::before {
    content: '“';
    left: -1rem;
    top: -2rem;
}

.motto-quote::after {
    content: '”';
    right: -1rem;
    bottom: -3rem;
}

/* Lightbox Modal */
.lightbox {
    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;
}

.lightbox-container {
    max-width: 90%;
    max-height: 80%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    max-width: 90%;
    max-height: 80%;
    border-radius: var(--radius);
    box-shadow: 0 0 20px rgba(0,0,0,0.8);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
}

/* Additional Memorial Styling for Ethereal Mist Integration */
.memorial-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
}

.header-nav {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 1.25rem;
    text-decoration: none;
    color: var(--primary);
}

.logo span {
    color: var(--accent);
}

.back-btn {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    transition: var(--transition);
}

.back-btn:hover {
    color: var(--primary);
}

.bullet-list {
    list-style: none;
}

.bullet-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 1rem;
    font-size: 1.05rem;
    color: #334155;
}

.bullet-list li::before {
    content: '✦';
    color: var(--accent);
    position: absolute;
    left: 0;
}

.comment-form {
    background: #edf2f7;
    padding: 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 2rem;
}

.submit-btn {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 0.6rem 1.25rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.submit-btn:hover {
    background-color: var(--accent);
}

/* Final Resting Place */
.resting-place-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.gravesite-details-card {
    background-color: var(--bg-main);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.gravesite-title {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.5rem;
}

.navigation-links-container {
    margin-top: 1rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.nav-map-btn {
    text-decoration: none;
    font-weight: 600;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.nav-map-btn-primary {
    background-color: var(--accent);
    color: white !important;
}

.nav-map-btn-primary:hover {
    background-color: var(--accent-hover);
}

.nav-map-btn-secondary {
    background-color: var(--primary);
    color: white !important;
}

.nav-map-btn-secondary:hover {
    background-color: var(--primary-light);
}

.map-embed-container {
    background-color: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    height: 350px;
}

.map-embed-container iframe {
    border: 0;
}

/* Other Links & Documents */
.other-links-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.other-links-intro {
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

.other-section-subtitle {
    font-family: var(--font-serif);
    margin-bottom: 0.5rem;
    color: var(--primary);
    font-size: 1.1rem;
}

.links-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.no-data-msg {
    color: var(--text-muted);
    text-align: center;
}

.other-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.other-link-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--primary);
    font-weight: 500;
    padding: 0.75rem;
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    transition: var(--transition);
}

.other-link-item:hover {
    border-color: var(--accent);
    background-color: white;
}

/* QR Code Section */
.qrcode-section {
    margin-top: 4rem;
    border-top: 1px solid var(--border);
    padding-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
}

.qrcode-img {
    width: 120px;
    height: 120px;
    border: 1px solid var(--border);
    padding: 0.5rem;
    background: white;
    border-radius: 6px;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

.qrcode-description {
    font-size: 0.85rem;
    color: var(--text-muted);
    max-width: 400px;
    font-weight: 500;
}

.qrcode-download-link {
    font-weight: 600;
    font-size: 0.85rem;
}

/* Responsive adjustments */
@media (min-width: 769px) {
    .resting-place-layout {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    /* Layout */
    .memorial-container {
        padding: 1rem;
    }
    
    .header-nav {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem;
        text-align: center;
    }
    
    /* Hero */
    .memorial-hero {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 1.5rem;
        gap: 1.5rem;
    }
    
    .memorial-portrait-container {
        max-width: 250px;
        margin: 0 auto;
        height: 300px;
    }
    
    .memorial-meta h1 {
        font-size: 2rem;
    }
    
    .memorial-dates {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }
    
    .obituary-block {
        font-size: 1rem;
    }
    
    /* Tabs & Content */
    .tabs-nav {
        flex-wrap: wrap;
        justify-content: center;
        overflow-x: visible;
        border-bottom: none;
        gap: 0.75rem;
    }
    
    .tab-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        border: 1px solid var(--border-color);
        border-radius: 20px;
        background-color: var(--bg-main);
        transition: var(--transition);
    }
    
    .tab-btn.active {
        background-color: var(--accent);
        color: white !important;
        border-color: var(--accent);
    }
    
    .tab-content {
        padding: 1.5rem 1rem;
    }
    
    /* Motto */
    .motto-quote {
        font-size: 1.4rem;
        margin: 2rem auto;
    }
    
    /* Form & Grid */
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .comment-form {
        padding: 1rem;
    }
    
    .comment-card {
        padding: 1rem;
    }
    
    .submit-btn {
        width: 100%;
    }
    
    /* Navigation map buttons */
    .navigation-links-container {
        flex-direction: column;
    }
    
    .nav-map-btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Map Container */
    .map-embed-container {
        height: 250px;
    }
}
