.ff-memories-gallery {
    --ff-memories-green: #093e04;
    max-width: 1080px;
    margin: 3rem auto 1rem;
    color: var(--ff-memories-green);
    font-family: Georgia, "Times New Roman", serif;
    text-align: center;
}

.ff-memories-gallery [hidden] { display: none !important; }
.ff-memories-gallery h2 { margin: 0 0 1.25rem; color: inherit; }
.ff-memories-empty, .ff-memories-status { margin: 1rem 0; }
.ff-memories-status { min-height: 1.5em; font-size: .95rem; }
.ff-memories-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; text-align: left; }
.ff-memories-card { min-width: 0; overflow: hidden; border: 1px solid #e2e8e0; border-radius: 8px; background: #fff; align-self: start; }
.ff-memories-photo { display: block; color: var(--ff-memories-green); }
.ff-memories-media { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; margin: 0; background: #f3f5f0; }
video.ff-memories-media { object-fit: contain; background: #101810; }
.ff-memories-photo-fallback { display: flex; aspect-ratio: 4 / 3; justify-content: center; align-items: center; background: #f3f5f0; text-decoration: underline; }
.ff-memories-card-links { display: flex; gap: 1rem; flex-wrap: wrap; padding: .7rem 1rem; font-size: .85rem; }
.ff-memories-gallery a.ff-memories-original { color: var(--ff-memories-green); text-decoration: underline; text-underline-offset: 3px; }
.ff-memories-gallery .ff-memories-more, .ff-memories-gallery .ff-memories-close {
    appearance: none;
    border: 1px solid var(--ff-memories-green);
    border-radius: 4px;
    padding: .8rem 1.4rem;
    background: var(--ff-memories-green);
    color: #fff;
    font: inherit;
    line-height: 1.3;
    cursor: pointer;
}
.ff-memories-gallery .ff-memories-more { margin-top: 1.5rem; }
.ff-memories-gallery .ff-memories-more:disabled { opacity: .65; cursor: wait; }
.ff-memories-gallery :is(a, button, video):focus-visible { outline: 3px solid #5e8658; outline-offset: 4px; }
.ff-memories-dialog { box-sizing: border-box; max-width: min(94vw, 1100px); max-height: 92vh; padding: 1rem; border: 0; border-radius: 8px; color: var(--ff-memories-green); background: #fff; overflow: auto; }
.ff-memories-dialog:not([open]) { display: none; }
.ff-memories-dialog::backdrop { background: rgb(0 0 0 / 78%); }
.ff-memories-dialog .ff-memories-close { display: block; margin: 0 0 .75rem auto; padding: .5rem 1rem; }
.ff-memories-full-image { display: block; max-width: 100%; max-height: 70vh; width: auto; height: auto; margin: 0 auto; object-fit: contain; }
.ff-memories-dialog-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 1.5rem; margin-top: .8rem; }
.ff-memories-media-error { padding: .5rem 1rem; font-size: .95rem; }
@media (max-width: 800px) {
    .ff-memories-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
}
@media (max-width: 480px) {
    .ff-memories-grid { grid-template-columns: minmax(0, 1fr); }
    .ff-memories-gallery { margin-top: 2rem; }
}
