/* Story media — one-at-a-time swipe carousel inspired by familiar social photo browsing. */
.post-media-gallery{margin:clamp(22px,4.6vw,48px) 0;min-width:0}
.post-carousel-frame{position:relative;overflow:hidden;border:1px solid var(--corner-border);border-radius:18px;background:#f4f3f0}
.post-carousel-track{display:flex;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;scrollbar-width:none;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch;touch-action:pan-x pan-y}
.post-carousel-track::-webkit-scrollbar{display:none}
.post-carousel-slide{position:relative;flex:0 0 100%;width:100%;min-width:100%;margin:0;scroll-snap-align:start;scroll-snap-stop:always;background:#fff}
.post-photo{display:block;width:100%;padding:0;border:0;background:#efeeeb;cursor:zoom-in}
.post-photo:focus-visible{outline:3px solid var(--corner-black);outline-offset:-4px}
.post-carousel-slide :is(.post-photo img,video){display:block;width:100%;height:auto;max-height:min(72dvh,720px);aspect-ratio:4/5;object-fit:contain;background:#efeeeb}
.post-carousel-slide video{background:#111}
.post-carousel-slide figcaption{min-height:42px;padding:11px 54px 13px 14px;font-size:clamp(.76rem,1.2vw,.9rem);line-height:1.5;color:var(--corner-subtext);overflow-wrap:anywhere;background:#fff}
.post-carousel-empty-caption{min-height:12px!important;padding:6px!important}
.post-carousel-count{position:absolute;right:12px;top:12px;z-index:3;padding:5px 9px;border-radius:999px;background:#171717c7;color:#fff;font:650 .7rem/1 var(--mono);backdrop-filter:blur(8px)}
.post-carousel-arrow{display:grid;place-items:center;position:absolute;top:50%;z-index:3;width:42px;height:42px;margin-top:-27px;border:1px solid #ffffffb8;border-radius:50%;background:#171717b8;color:#fff;font-size:1.65rem;box-shadow:0 7px 18px #0003;backdrop-filter:blur(7px)}
.post-carousel-prev{left:10px}.post-carousel-next{right:10px}.post-carousel-arrow:disabled{opacity:0;pointer-events:none}
.post-carousel-dots{position:absolute;left:50%;bottom:54px;z-index:3;display:flex;gap:6px;max-width:70%;padding:5px 8px;border-radius:999px;background:#17171752;transform:translateX(-50%);backdrop-filter:blur(6px)}
.post-carousel-dots button{width:7px;height:7px;min-width:7px;padding:0;border:0;border-radius:50%;background:#ffffff82}
.post-carousel-dots button[aria-current="true"]{background:#fff;transform:scale(1.2)}
.post-carousel-dots button:focus-visible,.post-carousel-arrow:focus-visible{outline:3px solid white;outline-offset:2px}
.post-lightbox{position:fixed;inset:0;box-sizing:border-box;width:min(1100px,calc(100vw - 22px));max-width:none;max-height:calc(100dvh - 22px);margin:auto;padding:clamp(12px,2vw,22px);border:1px solid #484848;border-radius:19px;background:#111;color:#f7f7f7;box-shadow:0 24px 90px #0009;overflow:auto}
.post-lightbox::backdrop{background:#000b;backdrop-filter:blur(7px)}
.post-lightbox>figure{margin:32px 0 0;text-align:center}.post-lightbox>figure img{display:block;width:100%;height:auto;max-height:calc(100dvh - 206px);min-height:100px;object-fit:contain;margin:auto}.post-lightbox>figure figcaption{min-height:22px;margin:12px auto 0;max-width:68ch;color:#e7e7e7;font-size:.85rem;line-height:1.5;overflow-wrap:anywhere}
.post-lightbox-close{display:grid;place-items:center;position:absolute;top:12px;right:14px;z-index:2;width:44px;height:44px;border:1px solid #ffffff50;border-radius:50%;background:#181818;color:white;font-size:1.5rem}
.post-lightbox-controls{display:flex;align-items:center;justify-content:center;gap:18px;margin-top:12px}.post-lightbox-controls button{width:44px;height:44px;border:1px solid #ffffff60;border-radius:50%;background:#212121;color:white;font-size:1.25rem}.post-lightbox button:disabled{opacity:.4;cursor:default}.post-lightbox-controls span{font:600 .77rem/1 var(--mono);color:#ededed}.post-lightbox button:focus-visible{outline:3px solid white;outline-offset:2px}
@media(max-width:767px){.post-media-gallery{margin:14px calc(var(--corner-gutter)*-.35)}.post-carousel-frame{border-radius:14px}.post-carousel-slide :is(.post-photo img,video){max-height:68dvh;aspect-ratio:1/1}.post-carousel-arrow{width:38px;height:38px;font-size:1.45rem}.post-carousel-dots{bottom:51px}.post-lightbox{width:calc(100vw - 10px);max-height:calc(100dvh - 10px);padding:12px;border-radius:12px}.post-lightbox>figure img{max-height:calc(100dvh - 196px)}}
@media(pointer:coarse){.post-carousel-arrow{display:none}}
@media(prefers-reduced-motion:reduce){.post-carousel-track{scroll-behavior:auto}.post-carousel-dots button{transition:none!important}.post-lightbox,.post-photo{transition:none!important}}

/* Owner photo composer: compact, readable, and consistent with Studio surfaces. */
.post-media-editor{min-width:0}
.post-media-head{display:flex;align-items:flex-start;justify-content:space-between;flex-wrap:wrap;gap:12px;margin:0 0 17px}
.post-media-head .eyebrow{margin-bottom:6px}
.post-media-head h3{margin:0;font-size:clamp(1.16rem,2.3vw,1.5rem);line-height:1.12;letter-spacing:-.045em}
.post-media-head>small{padding:6px 11px;border-radius:40px;background:var(--corner-soft);color:var(--corner-subtext);font-size:.73rem}
.post-media-editor .media-gallery{grid-template-columns:repeat(auto-fill,minmax(min(100%,220px),1fr));gap:12px;margin:15px 0}
.post-media-editor .media-thumb{min-width:0;background:#fff}
.post-media-editor .media-view-link{display:block;border-radius:10px;overflow:hidden;cursor:zoom-in}
.post-media-editor .media-view-link img{display:block;width:100%;aspect-ratio:4/3;object-fit:contain;background:#f4f3f0}
.post-media-editor .media-card-caption{font-size:.8rem;line-height:1.55;color:var(--corner-ink);overflow-wrap:anywhere}
.post-media-editor .media-quick-edit{display:grid;gap:8px;margin:11px 0 3px}
.post-media-editor .media-quick-edit label{font-size:.73rem}
.post-media-editor .media-quick-edit input{min-width:0;max-width:100%;height:40px;border:1px solid var(--corner-border);border-radius:9px;padding:8px 10px;font-size:.77rem;background:#fff;color:var(--corner-ink)}
.post-media-editor .media-quick-edit button{width:max-content;min-height:39px;padding:9px 13px;border:1px solid var(--corner-border-strong);border-radius:9px;background:var(--corner-black);color:var(--corner-white);font-size:.74rem;font-weight:650}
.post-media-editor .media-quick-edit button:disabled{opacity:.6}
.post-media-editor .upload-field{gap:10px;padding-top:12px;border-top:1px solid var(--corner-border)}
.post-media-editor .upload-preview-list{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,230px),1fr));gap:11px}
.post-media-editor .upload-preview-card{display:grid;gap:10px;min-width:0;padding:11px;border-radius:12px;border:1px solid var(--corner-border);background:#fff}
.post-media-editor .upload-preview-card figure{margin:0;min-width:0}
.post-media-editor .upload-preview-card img,.post-media-editor .upload-preview-card video{display:block;width:100%;height:155px;object-fit:contain;border-radius:8px;background:#f4f3f0}
.post-media-editor .upload-preview-card small{display:block;margin-top:6px;font-size:.7rem;color:var(--corner-subtext);overflow-wrap:anywhere}
.post-media-editor .upload-preview-card>div{display:grid;gap:9px}
.post-media-editor .upload-preview-card label{display:grid;gap:5px;font-size:.72rem}
.post-media-editor .upload-preview-card input{min-width:0;width:100%;min-height:41px;padding:9px 11px;font-size:.78rem;border:1px solid var(--corner-border-strong);border-radius:9px}
.post-media-editor [data-upload-status]:empty{display:none}
.post-media-editor [data-upload-status]{margin:0;font-size:.76rem;color:var(--corner-subtext);line-height:1.5}
.post-media-editor button[disabled]{opacity:.55;cursor:wait}
.preview-card .preview-media[hidden]{display:none}
.preview-card .preview-media{margin:13px 0;min-width:0;border-radius:11px;overflow:hidden;background:#f4f3f0}
.preview-card .preview-media img{display:block;width:100%;max-height:225px;object-fit:contain}
@media(max-width:767px){
  .post-media-editor .media-gallery{grid-template-columns:minmax(0,1fr)}
  .post-media-editor .upload-preview-list{grid-template-columns:minmax(0,1fr)}
  .post-media-editor .upload-preview-card{grid-template-columns:110px minmax(0,1fr);align-items:start}
  .post-media-editor .upload-preview-card img,.post-media-editor .upload-preview-card video{height:113px}
  .post-media-editor .upload-preview-card>div{min-width:0}
}
@media(max-width:359px){.post-media-editor .upload-preview-card{grid-template-columns:minmax(0,1fr)}}


/* Responsive gallery/editor density. Captions, focus and upload controls remain accessible. */
.post-media-gallery{margin:clamp(13px,2.6vw,28px) 0}
.post-gallery-grid{gap:clamp(8px,1.15vw,13px)}
.post-gallery-item{border-radius:12px}
.post-photo img{height:clamp(175px,23vw,290px)}
.post-gallery-item figcaption{padding:9px 12px 11px;font-size:clamp(.74rem,1.1vw,.85rem);line-height:1.45}
.post-media-head{gap:8px;margin-bottom:11px}
.post-media-head h3{font-size:clamp(1rem,1.65vw,1.25rem)}
.post-media-editor .media-gallery{gap:9px;margin:10px 0}
.post-media-editor .media-quick-edit{gap:6px;margin:8px 0 2px}
.post-media-editor .upload-field{gap:8px;padding-top:10px}
.post-media-editor .upload-preview-list{gap:8px}
.post-media-editor .upload-preview-card{gap:7px;padding:9px}
.post-media-editor .upload-preview-card img,.post-media-editor .upload-preview-card video{height:135px}
.post-media-editor .media-card-caption{font-size:.77rem;line-height:1.45}
.post-lightbox{max-height:calc(100dvh - 12px);padding:clamp(10px,1.6vw,16px)}
.post-lightbox>figure{margin:25px 0 0}
.post-lightbox>figure img{max-height:calc(100dvh - 175px)}
@media(max-width:767px){
 .post-media-gallery{margin:13px 0}
 .post-gallery-grid{gap:9px}
 .post-photo img{height:auto;max-height:min(65dvh,480px);object-fit:contain}
 .post-gallery-item figcaption{padding:8px 11px 10px;font-size:.76rem}
 .post-media-editor .upload-preview-card{grid-template-columns:minmax(88px,33%) minmax(0,1fr)}
 .post-media-editor .upload-preview-card img,.post-media-editor .upload-preview-card video{height:100px}
 .post-lightbox{width:calc(100vw - 8px);max-height:calc(100dvh - 8px);padding:10px}
 .post-lightbox>figure img{max-height:calc(100dvh - 168px)}
}
@media(max-width:359px){.post-media-editor .upload-preview-card{grid-template-columns:minmax(0,1fr)}}

/* Studio typography and spacing: loaded only on admin and post-detail pages. */
.admin-top h1{font-size:clamp(1.55rem,2.6vw,2.3rem);line-height:1.12}
.admin-section>header h2,.admin-surface h2{font-size:clamp(1.1rem,1.8vw,1.55rem);line-height:1.2}
.admin-main{padding-block:clamp(16px,2.1vw,26px)}
.admin-top{margin-bottom:clamp(11px,1.8vw,19px)}
.admin-surface{padding:clamp(13px,1.5vw,20px)}
.admin-form{gap:clamp(10px,1.2vw,16px)}
@media(max-width:767px){.admin-top h1{font-size:clamp(1.45rem,5vw,1.85rem)}.admin-main{padding:14px var(--corner-gutter) 23px}.admin-top{margin-bottom:12px}.admin-surface{padding:clamp(12px,3.5vw,16px)}}
/* Studio media removal and ordering. */
.post-media-editor .media-thumb{position:relative}
.media-card-controls{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:7px}
.media-delete-x,.upload-preview-remove{display:grid!important;place-items:center!important;width:36px!important;height:36px!important;min-width:36px!important;min-height:36px!important;padding:0!important;border:1px solid #dfb7b1!important;border-radius:50%!important;background:#fff4f2!important;color:#b42318!important;font:800 1.15rem/1 system-ui!important}
.media-delete-x:hover,.upload-preview-remove:hover{background:#b42318!important;color:#fff!important}
.media-order-controls{display:flex;align-items:center;gap:6px;margin-left:auto}.media-order-controls button{display:grid;place-items:center;width:36px;min-width:36px;height:36px;padding:0;border:1px solid var(--corner-border-strong);border-radius:10px;background:#fff;color:var(--corner-ink)}.media-order-controls span{font:650 .66rem/1 var(--mono);color:var(--corner-subtext)}
.upload-preview-card figure{position:relative}.upload-preview-remove{position:absolute!important;right:7px;top:7px;z-index:3;box-shadow:0 4px 14px #0002}


/* Immersive photo viewer: no visible counter, arrows or close glyph.
   Swipe horizontally to advance; tap anywhere to dismiss. */
.post-lightbox{
 overflow:hidden!important;
 touch-action:pan-y pinch-zoom;
 cursor:zoom-out;
}
.post-lightbox>figure{
 display:flex;flex-direction:column;align-items:center;gap:12px;
 margin:0!important;text-align:center;
}
.post-lightbox>figure img{
 display:block;width:100%;height:auto;
 max-height:calc(100dvh - 115px)!important;
 object-fit:contain;margin:auto;user-select:none;-webkit-user-drag:none;
}
.post-lightbox>figure figcaption{
 min-height:0;margin:0 auto 3px;
 max-width:68ch;line-height:1.45;
}
.post-lightbox .post-lightbox-controls{display:none!important}
/* Screen-reader/keyboard users retain a named close action without a visible X.
   A keyboard-focus-only button is revealed if tabbed to. */
.post-lightbox .post-lightbox-sr-close{
 position:absolute!important;width:1px!important;height:1px!important;
 min-width:0!important;min-height:0!important;
 padding:0!important;margin:0!important;border:0!important;
 white-space:nowrap!important;overflow:hidden!important;
 clip-path:inset(50%)!important;
}
.post-lightbox .post-lightbox-sr-close:focus-visible{
 top:12px!important;right:12px!important;width:auto!important;height:auto!important;
 min-height:44px!important;min-width:44px!important;padding:9px 12px!important;
 clip-path:none!important;overflow:visible!important;
 border:2px solid white!important;z-index:4!important;
}
@media(max-width:767px){
 .post-lightbox{width:calc(100vw - 12px)!important;max-height:calc(100dvh - 12px)!important;padding:10px!important}
 .post-lightbox>figure img{max-height:calc(100dvh - 100px)!important}
}
@media(prefers-reduced-motion:reduce){
 .post-lightbox>figure img{animation:none!important;transition:none!important}
}
