/* Relive: photographic atlas and postcard diary. Shared geometry stays in Leaflet. */
.template-scene{--relive-serif:Georgia,'Songti SC','Noto Serif CJK SC','SimSun',serif;--relive-sans:-apple-system,BlinkMacSystemFont,'Segoe UI','Microsoft YaHei',sans-serif;container-type:inline-size}
.app[data-theme] .template-scene .relive-media{display:block!important;position:relative;height:100%;min-height:0;padding:0!important;overflow:hidden;background:inherit!important;color:inherit!important;font-family:var(--relive-sans)}
.template-scene .relive-media:after,.template-scene .relive-video-hint{display:none}
.template-scene .template-brand{position:absolute;z-index:4;top:22px;left:6%;right:6%;display:flex;justify-content:space-between;align-items:center;font:500 9px/1.2 var(--relive-sans);letter-spacing:.18em}
.template-folio{font-variant-numeric:tabular-nums;letter-spacing:.1em;font-size:9px}
.template-scene .relive-media-slot{position:absolute!important;display:block!important;inset:0 auto auto 0;width:100%;height:var(--photo-end,60%);min-height:0!important;margin:0!important;overflow:hidden;z-index:0}
.template-scene .relive-media-slot>img,.template-scene .relive-media-slot>video{position:absolute;inset:0;width:100%;height:100%;min-width:0;min-height:0;max-width:none;max-height:none;object-fit:cover!important;border-radius:0}
.template-scene .template-map{position:absolute;z-index:2;background:var(--relive-map-water)}
.template-scene .template-copy{position:absolute;z-index:4;box-sizing:border-box}
.app[data-theme] .template-scene .relive-place{position:static!important;inset:auto!important;margin:0!important;padding:0!important;height:auto!important;background:none!important;border:0!important;backdrop-filter:none!important;text-shadow:none!important;color:inherit!important;text-align:left!important}
.app[data-theme] .template-scene .relive-place h1{font:500 clamp(23px,7.5cqw,39px)/1.22 var(--relive-serif);letter-spacing:.015em;margin:0 0 13px!important;color:inherit!important;text-wrap:nowrap;white-space:nowrap;overflow-wrap:normal;display:block;overflow:hidden}
.app[data-theme] .template-scene .relive-place span{display:block;font:400 10px/1.5 var(--relive-sans);letter-spacing:.035em;font-variant-numeric:tabular-nums;color:inherit!important;opacity:.78}
.template-scene .relive-place small{display:none}
.app[data-theme] .template-scene .template-copy>p{position:static;inset:auto;margin:15px 0 0;padding:0;background:none;border:0;color:inherit;font:400 11px/1.7 var(--relive-sans);text-align:left;letter-spacing:.015em;opacity:.85;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.app[data-theme] .template-scene .template-copy>p[hidden]{display:none}
/* A: continuous photograph and map; only the narrow meeting band is translucent. */
.template-scene.gradient{background:var(--relive-map-water)!important;color:var(--relive-ink)!important}
.template-scene.gradient .template-brand{color:#fff;text-shadow:0 1px 6px #0008}
.template-scene.gradient .template-map{left:0;right:0;top:var(--map-top,53%);bottom:0;width:100%;height:auto;mask-image:linear-gradient(to bottom,transparent,#000 var(--blend-end,15%))}
.template-scene.gradient .template-copy{left:6%;width:34%;bottom:6%;color:var(--relive-ink)}
.template-scene.gradient .template-copy:before{content:'';display:block;width:22px;border-top:1px solid currentColor;opacity:.55;margin:0 0 14px}
/* B: large photograph, then a diary column beside a separate map. */
.template-scene.postcard{background:#f5f2e9!important;color:#253c35!important}
.app[data-theme] .template-scene.postcard .relive-media{display:grid!important;grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr);grid-template-rows:16px minmax(0,1.65fr) minmax(0,1fr);grid-template-areas:'brand brand' 'photo photo' 'copy map';gap:24px 20px;padding:6.5% 5.5% 7%!important;box-sizing:border-box}
.template-scene.postcard .template-brand{position:static;grid-area:brand;inset:auto;font-size:8px;letter-spacing:.16em}
.template-scene.postcard .relive-media-slot{position:relative!important;grid-area:photo;inset:auto!important;width:100%;height:100%}
.template-scene.postcard .template-copy{position:relative;grid-area:copy;inset:auto;padding-top:16px;border-top:1px solid #253c3538;min-width:0;overflow:hidden}
.template-scene.postcard .template-map{position:relative;grid-area:map;inset:auto;width:100%;height:100%;min-height:0;mask-image:none;border:1px solid #253c3518;box-sizing:border-box}
.app[data-theme] .template-scene.postcard .relive-place h1{font-size:clamp(21px,6.7cqw,35px);margin-bottom:12px!important;line-height:1.25}
.template-scene .template-vehicle{border:0;background:none}.template-vehicle img{width:30px;height:30px}
.template-scene .relive-destination-label{border:0;border-radius:2px;box-shadow:none;padding:3px 5px;background:rgba(246,247,239,.94);color:#203c38;font:500 10px/1.3 var(--relive-sans);width:max-content;max-width:135px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}
.template-scene .relive-destination-label:before{display:none}
.template-choice{max-width:180px;font:12px var(--relive-sans);background:transparent;color:inherit;border:1px solid #8888;border-radius:8px;padding:4px}
.relive-map-credit{position:absolute;top:30px;right:8px;margin:0;font-size:9px;line-height:1.5;color:var(--muted)}.relive-map-credit a{color:inherit;text-decoration:none}
@container (max-width:340px){.template-scene.postcard .relive-media{gap:19px 14px!important}.template-scene .template-brand{top:17px}.app[data-theme] .template-scene .relive-place h1{font-size:24px}.app[data-theme] .template-scene .relive-place span{font-size:9px}.app[data-theme] .template-scene .template-copy>p{font-size:10px}}
@media (max-height:600px){.app[data-theme] .template-scene.postcard .relive-media{grid-template-rows:12px minmax(0,1.25fr) minmax(0,1fr);gap:16px 18px;padding:5% 5%!important}.template-scene .template-copy:before{display:none}.app[data-theme] .template-scene .relive-place h1{font-size:23px;margin-bottom:5px!important}.app[data-theme] .template-scene .template-copy>p{margin-top:6px;font-size:10px}}

/* Playback and offscreen capture share the same bounded layout. */
/* Compact scenes allocate readable copy its own full-width row. The query follows
   the actual stage, including safe-area and controls, rather than device names. */
.relive-stage,.relive-export-layout{container-type:size;container-name:relive-stage}
@container relive-stage (max-height:440px){
 .app[data-theme] .template-scene.postcard .relive-media{grid-template-columns:minmax(0,1.25fr) minmax(0,1fr);grid-template-rows:12px minmax(55px,1fr) auto;grid-template-areas:'brand brand' 'photo map' 'copy copy';gap:10px 12px!important;padding:12px!important}
 .template-scene.postcard .template-copy{padding-top:8px;overflow:visible}
 .app[data-theme] .template-scene.postcard .relive-place h1{font-size:21px;margin-bottom:4px!important}
 .app[data-theme] .template-scene.postcard .template-copy>p{margin-top:5px;line-height:1.45;-webkit-line-clamp:3}
 .template-scene .template-brand{top:12px}
 .app[data-theme] .relive-journal{padding:16px;gap:12px}
 .relive-route{padding:12px}.relive-route-copy{padding:12px}
 .relive-route-copy h1{font-size:26px}
}


/* Photo text has its own contrast layer; the map's dates/caption keep theme ink. */
.template-scene.gradient .template-brand{top:0;left:0;right:0;padding:16px 6% 32px;align-items:center;letter-spacing:.10em;font-weight:500;text-shadow:none;background:linear-gradient(to bottom,rgba(9,20,24,.28),rgba(9,20,24,.12) 55%,transparent)}
.template-scene.gradient .template-brand :is(.template-brand-name,.template-folio){padding:0;border-radius:0;background:none;color:#fff;font-size:9px;line-height:1.3}
.app[data-theme] .template-scene.gradient .template-photo-title{position:absolute!important;left:0!important;right:0!important;top:auto!important;bottom:calc(100% - var(--photo-end,60%))!important;z-index:3;padding:20px 6% calc(6px + var(--photo-end,60%) - var(--map-top,53%))!important;border-radius:0;background:linear-gradient(to bottom,transparent,rgba(9,20,24,.26) 20px,rgba(9,20,24,.26) calc(100% - var(--photo-end,60%) + var(--map-top,53%)),transparent)!important;color:#fff!important}
.app[data-theme] .template-scene.gradient .template-photo-title h1{color:#fff!important;margin:0!important;line-height:1.22}
.template-scene.gradient .template-copy:before{display:none}
/* Show the complete opening/closing copy instead of a nested scroll box. */
.app[data-theme] .relive-route{container-type:inline-size}
.app[data-theme] .relive-route-copy{max-height:none;overflow:visible;flex-shrink:0}
.app[data-theme] .relive-route-copy h1{font-size:clamp(22px,7cqw,34px)}

/* A quiet rounded opening card across Styles; individual text stays unframed. */
.app[data-theme] .relive-route-copy{border:1px solid var(--line);border-radius:18px;padding:14px 16px;box-shadow:none}
.app[data-theme] .relive-route-copy h1{border:0;padding-bottom:0}

/* Location facts belong to the map, separate from the date and journal. */
.template-scene .template-location-info{position:absolute;z-index:4;right:6%;bottom:6%;max-width:44%;box-sizing:border-box;padding:6px 8px;border-radius:8px;background:var(--relive-info-paper);color:var(--relive-ink);font:400 9px/1.5 var(--relive-sans);font-variant-numeric:tabular-nums;letter-spacing:0;overflow-wrap:anywhere;pointer-events:none}
.template-scene .template-location-info span{display:block;font:inherit;letter-spacing:0}
.template-scene .template-location-info [hidden]{display:none}
.template-scene.postcard .template-location-info{position:relative;grid-area:map;align-self:end;justify-self:end;inset:auto;margin:8px;max-width:calc(100% - 16px)}

/* Keep provider attribution readable and separate from optional location facts. */
.template-scene .template-map .leaflet-control-attribution{font:8px/1.4 var(--relive-sans);max-width:100%;box-sizing:border-box;background:rgba(245,248,243,.9);color:#203c38}
.template-scene .template-map .leaflet-control-attribution a{color:inherit}
.template-scene.postcard[data-map-source="osm"] .template-location-info,.template-scene.postcard[data-map-source="satellite"] .template-location-info{margin-bottom:30px}

/* City labels follow the actual base layer, including offline fallback. */
.relive-detailed-map[data-map-mode="osm"] .trip-map-label,
.template-map[data-map-mode="osm"] .relive-destination-label,
.template-map[data-travelling="false"] .relive-origin-label{display:none}
.relive-city-label{display:none;position:absolute;z-index:650;top:var(--city-label-top,10px);left:10px;max-width:calc(100% - 20px);box-sizing:border-box;padding:5px 8px;border-radius:9px;background:var(--relive-info-paper);color:var(--relive-ink);font:500 11px/1.35 var(--relive-sans);overflow-wrap:anywhere;pointer-events:none}
.template-map[data-map-mode="osm"] .relive-city-label{display:block}

.relive-scene.has-map-credit{padding-bottom:32px!important;box-sizing:border-box}
.relive-scene.has-map-credit>.relive-media,.relive-scene.has-map-credit>.relive-route{height:100%;min-height:0}
.relive-scene.has-map-credit .leaflet-control-attribution{display:none!important}
.relive-credits{position:absolute;bottom:7px;left:14px;right:14px;z-index:700;background:none;color:var(--ink,#253c35);font:400 9px/1.3 -apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;text-align:right;overflow-wrap:anywhere}
.relive-credits a{color:inherit;text-decoration:none}
.template-scene.postcard .relive-credits{color:#253c35}

.relive-scene>.relive-credits{height:auto}

/* Gradient keeps the photograph/map continuous; credits do not reserve a strip. */
.template-scene.gradient.has-map-credit{padding-bottom:0!important}
.template-scene.gradient>.relive-credits{bottom:7px;background:transparent;color:#183b42;text-shadow:0 1px 2px #fff,0 0 3px #fff}
.template-scene.gradient[data-map-source="satellite"]>.relive-credits{color:#fff;text-shadow:0 1px 3px #000,0 0 3px #000}
.template-scene.gradient .template-copy{bottom:max(7%,26px)}

.template-scene.gradient[data-map-source="offline"]>.relive-credits{color:var(--relive-ink);text-shadow:none}

/* A local reading scrim, never a full-width footer or panel. */
.template-scene.gradient .template-copy{--copy-shade:rgba(250,249,242,.95);--copy-edge:rgba(250,249,242,0);left:3.5%;width:43%;padding:10px 20px 10px 10px;border-radius:14px;background:linear-gradient(90deg,var(--copy-shade) 0%,var(--copy-shade) 88%,var(--copy-edge) 100%);color:#183b42!important}
.template-scene.gradient[data-map-source="satellite"] .template-copy{--copy-shade:rgba(8,19,28,.91);--copy-edge:rgba(8,19,28,0);color:#fff!important}
.app[data-theme] .template-scene.gradient .template-copy>p{font-size:12px;line-height:1.65;opacity:1}
.app[data-theme] .template-scene.gradient .template-copy .relive-place span{opacity:1}

/* Gradient avoids duplicate OSM tags; offline and satellite retain anchored names. */
.relive-scene[data-template="gradient"] .relive-city-label{display:none!important}

.template-map[data-map-loading="true"]::after{content:"";position:absolute;z-index:700;right:12px;top:48px;width:12px;height:12px;border:2px solid #899b9b;border-top-color:transparent;border-radius:50%;animation:map-loading-turn 1s linear infinite;pointer-events:none}
@keyframes map-loading-turn{to{transform:rotate(360deg)}}
@media(prefers-reduced-motion:reduce){.template-map[data-map-loading="true"]::after{animation:none}}

/* A soft side wash instead of a floating rectangular caption card. */
.template-scene.gradient .template-copy{left:0;width:49%;padding:12px 7% 12px 6%;border-radius:0;--copy-shade:rgba(250,249,242,.93);--copy-edge:rgba(250,249,242,0);background:linear-gradient(90deg,var(--copy-shade) 0%,var(--copy-shade) 75%,var(--copy-edge) 100%)}
.template-scene.gradient[data-map-source="satellite"] .template-copy{--copy-shade:rgba(8,19,28,.88)}
.app[data-theme] .template-scene.gradient .template-copy>p{margin-top:9px;font-size:11px;line-height:1.65}

/* Keep the map unobstructed: date and caption belong to the photograph. */
.app[data-theme] .template-scene.gradient .template-photo-title .template-copy{position:static!important;left:auto;width:auto;max-width:90%;padding:0;margin-top:8px;border-radius:0;background:none!important;color:#fff!important}
.app[data-theme] .template-scene.gradient .template-photo-title .template-copy>p{margin-top:5px;color:#fff;line-height:1.55;font-size:11px}
.app[data-theme] .template-scene.gradient .template-photo-title .relive-place span{color:#fff!important;font-size:10px;opacity:.9}

/* Keep the photograph luminous; local text shadows replace the heavy photo wash. */
.app[data-theme] .template-scene.gradient :is(.template-photo-title,.template-brand){text-shadow:0 1px 3px rgba(0,0,0,.7)}

/* Small paper-like corners, shared by the photograph and map. */
.app[data-theme] .template-scene.postcard :is(.relive-media-slot,.template-map){border-radius:6px;overflow:hidden;box-sizing:border-box;border:1px solid color-mix(in srgb,var(--relive-ink,#253c35) 24%,transparent);box-shadow:none}

/* Gradient captions remain unboxed, without a separate footer. */
.app[data-theme] .template-scene.gradient .relive-media{height:100%;overflow:hidden}
.app[data-theme] .template-scene.gradient .template-photo-title>span{color:#fff!important;font-size:10px;margin-bottom:6px;opacity:.9}
.app[data-theme] .template-scene.gradient .template-copy{top:auto;bottom:28px;left:6%;width:42%;max-width:none;padding:0;margin:0;border:0;border-radius:0;background:none!important;color:#183b42!important;text-shadow:0 1px 3px #fff,0 0 5px #fff}
.app[data-theme] .template-scene.gradient .template-copy>p{margin:0;color:inherit!important;font-size:11px;line-height:1.6;opacity:1;-webkit-line-clamp:3}
.app[data-theme] .template-scene.gradient[data-map-source="satellite"] .template-copy{color:#fff!important;text-shadow:0 1px 3px #000,0 0 5px #000}
.template-scene.gradient>.relive-credits{bottom:7px}

/* Gradient omits descriptive copy; saved captions remain available in Postcard. */
.app[data-theme] .template-scene.gradient .template-copy{display:none!important}

.app[data-theme] .template-scene.postcard .template-copy>p{overflow-wrap:anywhere}

.relive-export-layout .export-map-credit{position:absolute!important;z-index:900;left:auto!important;right:5px!important;bottom:4px!important;max-width:calc(100% - 10px);margin:0!important;padding:2px 4px!important;font:400 8px/1.25 system-ui,sans-serif!important;letter-spacing:0!important;background:rgba(250,250,246,.85)!important;color:#243c38!important;border:0!important;border-radius:3px;text-shadow:none!important;pointer-events:none}
.relive-export-layout .relive-journal{container-type:inline-size}
.relive-export-layout .relive-journal blockquote{font-size:clamp(22px,6.4cqw,30px)!important}
.relive-export-layout .leaflet-control-attribution{display:none!important}
