/* Keep Safari typography stable when returning from landscape. Preserve pinch zoom. */
html,body{-webkit-text-size-adjust:100%!important;text-size-adjust:100%!important}
#tbwt-photo-viewer[hidden]{display:none!important}
#tbwt-photo-viewer{position:fixed;inset:0;z-index:100000;box-sizing:border-box;display:grid;grid-template-rows:44px minmax(0,1fr) 52px;width:100vw;height:100vh;height:100dvh;background:#f3f1e8;color:#122c36;padding:env(safe-area-inset-top,0px) max(10px,env(safe-area-inset-right,0px)) env(safe-area-inset-bottom,0px) max(10px,env(safe-area-inset-left,0px));overflow:hidden;overscroll-behavior:none}
.tbwt-viewer-top{display:flex;justify-content:flex-end;align-items:center}.tbwt-viewer-close,#tbwt-photo-viewer button{appearance:none;display:block;padding:0;border:0;border-radius:0;background:transparent;color:#122c36;box-shadow:none;cursor:pointer;font:400 28px/1 Arial,sans-serif;width:44px;height:44px;margin:0}
.tbwt-viewer-stage{display:flex;min-width:0;min-height:0;width:100%;height:100%;align-items:center;justify-content:center;touch-action:pinch-zoom;overflow:hidden}
#tbwt-photo-viewer figure{display:block;max-width:100%;max-height:100%;margin:0;padding:0}
#tbwt-photo-viewer img{display:block;width:100%!important;max-width:none!important;max-height:none!important;object-fit:contain;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;border:0;margin:0;padding:0}
#tbwt-photo-viewer figcaption{display:block;width:100%;font:400 9px/12px Montserrat,Arial,sans-serif;color:#819397;margin:2px 0 0;text-align:left}
.tbwt-viewer-controls{display:flex;align-items:center;justify-content:center;gap:18px;margin:0;padding:0}.tbwt-viewer-controls span{min-width:44px;text-align:center;font:400 12px/1.3 Montserrat,Arial,sans-serif}
.native-photo-track{touch-action:pan-y pinch-zoom!important}.photo-controls a{scroll-behavior:auto}
@media(orientation:landscape) and (max-height:600px){#tbwt-photo-viewer{grid-template-rows:32px minmax(0,1fr) 36px}.tbwt-viewer-close,#tbwt-photo-viewer button{height:32px;width:40px;font-size:25px}}

/* Consistent reading rhythm across December articles and both languages. */
.edit-section .edit-slide+.edit-slide{margin-top:56px!important}
.edit-section .edit-copy{padding:20px 0 0}
.edit-section .edit-card-meta{padding-bottom:14px}
.edit-section .landscape .photo-gallery{margin-top:18px}
@media(max-width:700px){
 .edit-section .edit-slide+.edit-slide{margin-top:40px!important}
 .edit-section .edit-card-layout.portrait{gap:0}
 .edit-section .photo-gallery,.edit-section .portrait .photo-gallery{margin-top:16px;margin-bottom:0!important}
 .edit-section .edit-copy{padding:12px 0 0}
 .edit-section .edit-card-meta{padding-bottom:12px}
 .edit-section .edit-place{margin-bottom:12px}
 .edit-section .edit-slide h3{margin-bottom:18px}
 .edit-section .edit-perspective{margin-top:22px}
}

/* Let the viewport, rather than a remembered pixel size, fit the open photo. */
#tbwt-photo-viewer .tbwt-viewer-stage{min-width:0;min-height:0}
#tbwt-photo-viewer figure{display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto;width:100%;height:100%;min-width:0;min-height:0;max-width:none;max-height:none}
#tbwt-photo-viewer img{width:100%!important;height:100%!important;min-width:0;min-height:0;max-width:100%!important;max-height:100%!important;object-fit:contain}
#tbwt-photo-viewer figcaption{justify-self:center;max-width:100%;margin:2px 0 0;line-height:12px}
@media(orientation:landscape) and (max-height:600px){
 #tbwt-photo-viewer{grid-template-rows:minmax(0,1fr) 36px;padding:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px)}
 #tbwt-photo-viewer .tbwt-viewer-stage{grid-row:1;grid-column:1;box-sizing:border-box;padding:0 44px}
 #tbwt-photo-viewer .tbwt-viewer-top{position:absolute;z-index:2;top:env(safe-area-inset-top,0px);right:env(safe-area-inset-right,0px);width:44px;background:transparent}
 #tbwt-photo-viewer .tbwt-viewer-controls{position:static;grid-row:2;grid-column:1;transform:none;background:transparent;padding:0;gap:18px}
}
