/* Memories, modal, comments, notices */

/* MEMORIES SECTION */
.memorial-memories {
    margin-top: 2.5rem;
}

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

.memorial-memory-card {
    background: #fff;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    box-shadow: 0 8px 20px rgba(0,0,0,0.04);
}

.memorial-memory-header h3 {
    margin: 0 0 0.25rem;
}

.memorial-memory-meta {
    margin: 0 0 0.75rem;
    font-size: 0.85rem;
    color: #666;
}

.memorial-memory-text p {
    margin-bottom: 0.75rem;
}

.memorial-memory-photos img {
    max-width: 140px;
    height: auto;
    border-radius: 6px;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

.memorial-share-memory {

}

.memorial-memory-form .acf-fields {
    display: grid;
    grid-template-columns: 1 fr;
    gap: 1rem;
}

/* Hide the memorial_id field in the front-end memory form */
.memorial-memory-form .acf-field[data-name="memorial_id"] {
    display: none !important;
}

/* ---- Memory section layout ---- */

.memorial-memories {
    margin-top: 3rem;
}

.memorial-memories-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1rem;
}

.memorial-memories-header h2 {
    margin: 0;
}

.memorial-memories-count {
    font-size: 0.9rem;
    color: #666;
}

/* Timeline style list */

.memorial-memory-card {
    background: #fff;
    border-radius: 10px;
    padding: 1rem;
    box-shadow: 0 8px 20px rgba(0,0,0,0.04);
    position: relative;
}

/* Header: avatar + meta + like */
.memorial-memory-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.memorial-memory-author {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.memorial-memory-avatar img {
    border-radius: 999px;
}

.memorial-avatar-fallback {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    color: #555;
}

.memorial-memory-author-meta h3 {
    margin: 0.1rem 0 0;
}

.memorial-memory-meta {
    margin: 0;
    font-size: 0.8rem;
    color: #777;
}

.memorial-memory-actions {
    display: flex;
    align-items: center;
}

.memorial-memory-like {
    font-size: 0.9rem;
    text-decoration: none;
    border-radius: 999px;
    padding: 0.25rem 0.75rem;
    border: 1px solid #eeeeee;
    background: #eeeeee;
    color: #cc0000;
    cursor: pointer;
}

/* Memory text & photos */
.memorial-memory-text p {
    margin-bottom: 0.75rem;
}

.memorial-memory-photos {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.memorial-memory-photos img {
    border-radius: 6px;
    max-width: 140px;
    height: auto;
}

/* Report form */
.memorial-memory-footer {
    margin-top: 0.75rem;
}

.memorial-memory-report-toggle {
    font-size: 0.8rem;
    background: transparent;
    border: none;
    color: #b00;
    cursor: pointer;
    padding: 0;
}

.memorial-memory-report-form {
    margin-top: 0.5rem;
}

.memorial-memory-report-form textarea {
    width: 100%;
    resize: vertical;
}

.memorial-memory-report-form button[type="submit"] {
    margin-top: 0.5rem;
}

/* Comments */
.memorial-memory-comments {
    margin-top: 1rem;
    border-top: 1px solid #eee;
    padding-top: 0.75rem;
}

.memorial-memory-comments-list {
    list-style: none;
    padding: 0;
    margin: 0 0 0.75rem;
}

.memorial-memory-comment {
    margin-bottom: 0.5rem;
}

.memorial-memory-comment-date {
    font-size: 0.8rem;
    color: #999;
    margin-left: 0.5rem;
}

/* Notices */
.gp-memorial-notice {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
}

.gp-memorial-notice-success {
    background: #e8f9ef;
    border: 1px solid #b7e3c8;
}

.memorial-memory-delete {
    margin-left: 1rem;
    font-size: 0.8rem;
    color: #b00020;
    text-decoration: underline;
}

.gp-memorial-notice {
    margin: 1rem 0;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.gp-memorial-notice-success {
    background: #e8f9ef;
    border: 1px solid #b7e3c8;
}

/* Fading state */
.gp-memorial-notice.is-fading {
    opacity: 0;
}

/* Modal base: hidden by default */
.memorial-modal {
    position: fixed;
    inset: 0;
    display: none;          /* THIS is the important part */
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* When open */
.memorial-modal.is-open {
    display: flex;
}

.memorial-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
}

.memorial-modal-dialog {
    position: relative;
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 1200px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    z-index: 1;
}

.memorial-modal-close {
    position: absolute;
    right: 0.75rem;
    top: 0.75rem;
    border: none;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

/* Button styling (optional) */
.memorial-share-memory-button {
    padding: 0.6rem 1.2rem;
    border-radius: 999px;
    border: none;
    background: #1a6f8d;
    color: #fff;
    cursor: pointer;
    font-size: 0.95rem;
}
