.memory-gallery { display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,240px),1fr));gap:20px; }
.memory-card { margin:0 0 20px;padding:18px;border:1px solid var(--line);border-radius:14px;background:var(--paper);overflow-wrap:anywhere; }
.memory-card img { width:100%;height:230px;object-fit:cover;border-radius:8px; }
.memory-card h3 { margin:14px 0 8px; }.memory-card p { line-height:1.7;white-space:pre-wrap; }
.memory-date,.memory-credit { color:var(--muted);font-size:.9rem; }
.memory-study { padding:18px;margin:12px 0;border:1px solid var(--line);border-radius:12px;background:var(--paper); }
.memory-study summary { cursor:pointer;font-weight:700;line-height:1.5; }.memory-study[open] summary { margin-bottom:18px; }
.trip-story { width:min(100% - 32px,1050px);margin:40px auto;overflow-wrap:anywhere; }.trip-story>p { line-height:1.8; }
.trip-story h1 { font-size:clamp(2rem,5vw,3.5rem); }.trip-story h2 { margin-top:36px; }
.memory-editor-grid { display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,300px),1fr));gap:20px; }.memory-editor-grid form { display:grid;gap:12px; }
.memory-editor-grid label,.memory-story-form>label { display:grid;gap:6px;margin:12px 0; }.memory-editor-grid input,.memory-editor-grid textarea,.memory-story-form input,.memory-story-form textarea,.memory-story-form select { width:100%;padding:10px;border:1px solid var(--line);border-radius:8px;background:var(--paper);color:var(--ink);font:inherit;box-sizing:border-box; }
.memory-check { display:flex!important;align-items:start;gap:10px!important;margin:10px 0; }.memory-check input { width:18px!important;flex:none;margin-top:3px; }.memory-editor-list { display:grid;gap:20px;margin:24px 0; }.memory-editor-list img { max-width:240px;max-height:180px;object-fit:contain; }.memory-editor-list form { padding:20px;border:1px solid var(--line);border-radius:12px; }
.memory-actions { display:flex;gap:10px;flex-wrap:wrap;margin:16px 0; }.memory-preview { width:min(1100px,calc(100vw - 28px));max-height:90dvh;overflow:auto;border:1px solid var(--line);border-radius:16px;padding:24px;background:var(--paper);color:var(--ink); }.memory-preview::backdrop { background:rgba(var(--forest-deep-rgb),.65); }.memory-preview header { display:flex;align-items:center;justify-content:space-between;gap:16px; }.memory-status { white-space:pre-wrap; }

.memory-editor-list label { display:grid;gap:6px;margin:12px 0; }.memory-editor-list input,.memory-editor-list textarea { width:100%;padding:10px;border:1px solid var(--line);border-radius:8px;background:var(--paper);color:var(--ink);font:inherit; }.memory-story-form fieldset { border:1px solid var(--line);border-radius:12px;margin:20px 0;padding:18px; }

/* Traveler photos stay in two equal tiles, including a single-photo gallery. */
.journey-page .memory-gallery { grid-template-columns:repeat(2,minmax(0,1fr)); }
.journey-page .memory-gallery .memory-card { min-width:0; }
.journey-page .memory-gallery img { display:block;cursor:zoom-in; }
@media (max-width:600px) { .journey-page .memory-gallery { grid-template-columns:minmax(0,1fr); } }

.memory-video-tile { position:relative;display:block;width:100%;height:230px;border:0;padding:0;border-radius:8px;overflow:hidden;cursor:pointer;background:var(--forest-deep);color:var(--paper);font:inherit; }
.memory-video-tile video { display:block;width:100%;height:100%;object-fit:cover;pointer-events:none; }
.memory-play-label { position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);padding:12px 18px;border-radius:24px;background:var(--forest-deep);color:var(--paper);white-space:nowrap;font-weight:700; }
.memory-video-tile:focus-visible { outline:3px solid var(--gold);outline-offset:4px; }
.memory-photo-tile { display:block;width:100%;padding:0;border:0;border-radius:8px;background:var(--paper);cursor:zoom-in; }
.memory-photo-tile img { display:block; }
.memory-photo-tile:focus-visible { outline:3px solid var(--gold);outline-offset:4px; }
.memory-media-viewer { box-sizing:border-box;width:min(1200px,calc(100% - 24px));max-height:92dvh;overflow:auto;padding:16px 20px;border:1px solid var(--line);border-radius:14px;background:var(--paper);color:var(--ink); }
.memory-media-viewer::backdrop { background:rgba(var(--forest-deep-rgb),.8); }
.memory-media-viewer header { position:sticky;top:-16px;z-index:1;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 0;background:var(--paper); }
.memory-media-viewer h2 { margin:0;font-size:clamp(1.1rem,3vw,1.6rem);overflow-wrap:anywhere; }
.memory-media-viewer button { padding:10px 16px;min-height:44px;border:1px solid var(--line);border-radius:8px;background:var(--paper);color:var(--ink);font:inherit;cursor:pointer; }
.memory-media-viewer button:focus-visible { outline:3px solid var(--gold);outline-offset:3px; }
.memory-media-viewer button:disabled { opacity:.5;cursor:default; }
.memory-media-viewer header button { flex-shrink:0; }
.memory-media-stage { display:flex;align-items:center;justify-content:center;min-height:120px; }
.memory-media-stage img,.memory-media-stage video { display:block;width:auto;height:auto;max-width:100%;max-height:65dvh;object-fit:contain; }
.memory-media-stage video { width:100%;background:var(--forest-deep); }
.memory-media-viewer nav { display:flex;align-items:center;justify-content:space-between;gap:12px;margin:16px 0; }
.memory-media-position { text-align:center;color:var(--muted);white-space:nowrap; }
.memory-media-caption { line-height:1.7;white-space:pre-wrap;overflow-wrap:anywhere; }
.memory-media-status { line-height:1.5; }
.memory-media-status:empty { display:none; }
@media (max-width:480px) { .memory-media-viewer { padding:12px; }.memory-media-viewer header { top:-12px;gap:10px; }.memory-media-viewer nav { gap:8px; }.memory-media-viewer button { padding:10px; }.memory-media-stage img,.memory-media-stage video { max-height:55dvh; } }
.memory-editor-list video { display:block;max-width:100%;width:320px;max-height:220px; }
