/* FILE: assets/css/msn-stories.css */

/* ===============================
   STORIES ROW
=============================== */
.msn-stories-row, .msn-stories-row *{ box-sizing:border-box; }

.msn-stories-row{
  background:#fff;
  border:1px solid rgba(0,0,0,.08);
  border-radius:16px;
  box-shadow:0 10px 24px rgba(0,0,0,.06);
  overflow:hidden;
  margin:12px 0;
}

.msn-stories-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:12px 12px 10px;
}

.msn-stories-title{
  font-weight:1000;
  font-size:16px;
  color:#111;
}

.msn-stories-links{ display:flex; gap:10px; }
.msn-stories-link{
  font-weight:900;
  font-size:13px;
  text-decoration:none;
  color:#1877f2;
}

.msn-stories-track{
  display:flex;
  gap:12px;
  padding:0 12px 12px;
  overflow-x:auto;
  -webkit-overflow-scrolling:touch;
  scroll-snap-type:x mandatory;
}
.msn-stories-track::-webkit-scrollbar{ height:0; }

.msn-story-tile{
  flex:0 0 250px;
  background:#fff;
  border:1px solid rgba(0,0,0,.10);
  border-radius:16px;
  padding:12px;
  display:flex;
  gap:12px;
  align-items:center;
  scroll-snap-align:start;
  cursor:pointer;
  position:relative;
  min-height:84px;
  box-shadow:0 8px 18px rgba(0,0,0,.05);
}

.msn-story-photo{
  width:54px; height:54px;
  border-radius:999px;
  overflow:hidden;
  flex:0 0 54px;
  background:#f0f2f5;
  position:relative;
  z-index:2;
}
.msn-story-photo img{
  width:100%; height:100%;
  object-fit:cover;
  display:block;
}

.msn-story-meta{ min-width:0; flex:1 1 auto; }
.msn-story-name{
  display:block;
  font-weight:1000;
  color:#111;
  font-size:14px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.msn-story-sub{
  display:block;
  margin-top:2px;
  font-size:12px;
  font-weight:800;
  opacity:.72;
}

/* ring */
.msn-story-ring{
  position:absolute;
  left:12px;
  top:50%;
  transform:translateY(-50%);
  width:54px;
  height:54px;
  border-radius:999px;
  border:3px solid #cfd4da;
  z-index:1;
}
.msn-story-tile.is-unseen .msn-story-ring{
  border-color:#1877f2;
  box-shadow:0 0 0 2px rgba(24,119,242,.12);
}
.msn-story-tile.is-seen{
  opacity:.92;
}

/* create story */
.msn-story-create .msn-story-ring{ border-color:#cfd4da; }
.msn-story-plus{
  position:absolute;
  right:12px;
  top:50%;
  transform:translateY(-50%);
  width:34px;
  height:34px;
  border-radius:999px;
  background:#1877f2;
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:1000;
  font-size:18px;
}

/* see more */
.msn-story-more{
  flex:0 0 150px;
  text-decoration:none;
  color:#111;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  font-weight:1000;
  background:#f7f8fa;
  border:1px solid rgba(0,0,0,.08);
  border-radius:16px;
}
.msn-story-more-ico{ font-size:22px; opacity:.7; }
.msn-story-more-txt{ font-size:13px; }

/* responsive sizes */
@media (max-width: 720px){
  .msn-story-tile{ flex-basis:220px; }
}
@media (max-width: 420px){
  .msn-story-tile{ flex-basis:200px; }
}

/* ===============================
   VIEWER
=============================== */
html.msn-story-open, body.msn-story-open{ overflow:hidden; }

.msn-story-viewer[hidden]{ display:none !important; }
.msn-story-viewer{
  position:fixed;
  inset:0;
  z-index:999999;
}

.msn-story-overlay{
  position:absolute;
  inset:0;
  background:rgba(0,0,0,.78);
  backdrop-filter: blur(2px);
}

.msn-story-modal{
  position:relative;
  z-index:2;
  width:min(520px, calc(100vw - 12px));
  height:min(92vh, 860px);
  margin:4vh auto;
  border-radius:18px;
  overflow:hidden;
  background:#000;
  box-shadow:0 24px 70px rgba(0,0,0,.35);
  display:flex;
  flex-direction:column;
}

.msn-story-close{
  position:absolute;
  right:10px;
  top:10px;
  width:38px;
  height:38px;
  border-radius:999px;
  border:0;
  background:rgba(255,255,255,.14);
  color:#fff;
  font-size:26px;
  cursor:pointer;
  z-index:5;
}

.msn-story-top{
  padding:10px 10px 8px;
  position:relative;
  z-index:3;
  background:linear-gradient(180deg, rgba(0,0,0,.70), rgba(0,0,0,0));
}

.msn-story-progress{
  display:flex;
  gap:6px;
  margin-bottom:10px;
}
.msn-story-bar{
  flex:1 1 0;
  height:3px;
  border-radius:999px;
  background:rgba(255,255,255,.22);
  overflow:hidden;
  position:relative;
}
.msn-story-bar-fill{
  display:block;
  height:100%;
  width:0%;
  background:#fff;
}
.msn-story-bar.is-done .msn-story-bar-fill{ width:100%; }
.msn-story-bar.is-active .msn-story-bar-fill{
  width:100%;
  animation-name: msnStoryFill;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}
@keyframes msnStoryFill { from { width:0%; } to { width:100%; } }

.msn-story-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.msn-story-head-left{
  display:flex;
  gap:10px;
  align-items:center;
  min-width:0;
}

.msn-story-head-ava{
  width:36px;
  height:36px;
  border-radius:999px;
  object-fit:cover;
  display:block;
  border:2px solid rgba(255,255,255,.18);
}

.msn-story-head-meta{ min-width:0; }
.msn-story-head-name{
  color:#fff;
  font-weight:1000;
  font-size:13px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:260px;
}
.msn-story-head-sub{
  margin-top:1px;
  color:rgba(255,255,255,.75);
  font-size:11px;
  font-weight:800;
}

.msn-story-head-right{ display:flex; gap:8px; }
.msn-story-pill{
  border:0;
  border-radius:999px;
  background:rgba(255,255,255,.14);
  color:#fff;
  font-weight:900;
  font-size:12px;
  padding:8px 10px;
  cursor:pointer;
}

.msn-story-stage{
  flex:1 1 auto;
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#000;
}

.msn-story-media{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.msn-story-text{
  position:absolute;
  left:12px;
  right:12px;
  bottom:14px;
  color:#fff;
  font-weight:900;
  font-size:16px;
  text-shadow:0 2px 10px rgba(0,0,0,.6);
}

.msn-story-tap{
  position:absolute;
  top:0;
  bottom:0;
  width:40%;
  z-index:4;
}
.msn-story-tap-left{ left:0; }
.msn-story-tap-right{ right:0; }

.msn-story-bottom{
  padding:10px 12px 12px;
  background:linear-gradient(0deg, rgba(0,0,0,.75), rgba(0,0,0,0));
}

.msn-story-mine-actions{
  display:flex;
  gap:10px;
  justify-content:flex-end;
}
.msn-story-link{
  border:0;
  background:rgba(255,255,255,.14);
  color:#fff;
  font-weight:900;
  border-radius:999px;
  padding:8px 10px;
  cursor:pointer;
}

/* Drawer (Seen by) */
.msn-story-drawer[hidden]{ display:none !important; }
.msn-story-drawer{
  position:absolute;
  left:0; right:0; bottom:0;
  background:#fff;
  color:#111;
  border-top-left-radius:18px;
  border-top-right-radius:18px;
  overflow:hidden;
  z-index:6;
  max-height:58%;
  display:flex;
  flex-direction:column;
}
.msn-story-drawer-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:12px 12px;
  border-bottom:1px solid rgba(0,0,0,.06);
}
.msn-story-drawer-title{ font-weight:1000; }
.msn-story-drawer-close{
  border:0;
  background:#eef0f3;
  border-radius:999px;
  padding:8px 10px;
  font-weight:900;
  cursor:pointer;
}
.msn-story-drawer-body{
  padding:12px;
  overflow:auto;
}
.msn-story-drawer-loading{ font-weight:900; opacity:.75; }
.msn-story-drawer-empty{ font-weight:900; opacity:.75; }

/* ===============================
   CREATE MODAL
=============================== */
.msn-story-create-modal{
  position:relative;
  z-index:2;
  width:min(620px, calc(100vw - 12px));
  margin:6vh auto;
  border-radius:18px;
  overflow:hidden;
  background:#fff;
  box-shadow:0 24px 70px rgba(0,0,0,.28);
}
.msn-story-create-head{
  padding:14px;
  border-bottom:1px solid rgba(0,0,0,.06);
}
.msn-story-create-title{ font-weight:1000; font-size:16px; }
.msn-story-create-sub{ margin-top:2px; font-weight:800; opacity:.7; font-size:12px; }
.msn-story-create-body{ padding:14px; display:grid; gap:12px; }

.msn-story-upload input{ display:none; }
.msn-story-upload-box{
  display:flex;
  align-items:center;
  justify-content:center;
  flex-direction:column;
  gap:8px;
  border:1px dashed rgba(0,0,0,.18);
  border-radius:16px;
  background:#f7f8fa;
  height:180px;
  cursor:pointer;
}
.msn-story-upload-ico{
  width:46px;height:46px;border-radius:999px;
  background:#1877f2;color:#fff;
  display:flex;align-items:center;justify-content:center;
  font-weight:1000;font-size:24px;
}
.msn-story-upload-txt{ font-weight:1000; }

.msn-story-create-row{
  display:grid;
  grid-template-columns: 180px 1fr;
  gap:10px;
}
.msn-story-field{ display:grid; gap:6px; }
.msn-story-field-label{ font-weight:900; font-size:12px; opacity:.8; }
.msn-story-field select,
.msn-story-field input{
  height:42px;
  border-radius:12px;
  border:1px solid rgba(0,0,0,.12);
  padding:10px 12px;
  outline:none;
  background:#fff;
}

.msn-story-create-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
}

.msn-story-create-preview{
  border:1px solid rgba(0,0,0,.08);
  border-radius:16px;
  overflow:hidden;
  background:#000;
}
.msn-story-create-preview-inner img,
.msn-story-create-preview-inner video{
  width:100%;
  height:320px;
  object-fit:cover;
  display:block;
}

@media (max-width: 720px){
  .msn-story-create-row{ grid-template-columns:1fr; }
}

/* ===============================
   HIGHLIGHTS / ARCHIVE PAGES
=============================== */
.msn-story-page{ max-width:980px; margin:0 auto; padding:10px; }
.msn-story-page-head{
  display:flex; align-items:flex-end; justify-content:space-between;
  gap:12px; flex-wrap:wrap;
  margin-bottom:12px;
}
.msn-story-page-title{ font-size:18px; font-weight:1000; }
.msn-story-page-sub{ margin-top:2px; opacity:.7; font-weight:800; font-size:12px; }
.msn-story-page-actions{ display:flex; gap:10px; flex-wrap:wrap; }

.msn-highlights-grid,
.msn-archive-grid{
  display:grid;
  gap:12px;
  grid-template-columns:repeat(5, minmax(0,1fr));
}
@media (max-width: 980px){
  .msn-highlights-grid,
  .msn-archive-grid{ grid-template-columns:repeat(3, minmax(0,1fr)); }
}
@media (max-width: 720px){
  .msn-highlights-grid,
  .msn-archive-grid{ grid-template-columns:1fr; }
}

.msn-highlight-card,
.msn-archive-card{
  background:#fff;
  border:1px solid rgba(0,0,0,.10);
  border-radius:16px;
  overflow:hidden;
  box-shadow:0 8px 18px rgba(0,0,0,.05);
}

.msn-highlight-card-photo,
.msn-archive-card-photo{
  border:0;
  padding:0;
  width:100%;
  aspect-ratio: 16/11;
  background:#f3f4f6;
  cursor:pointer;
}
.msn-highlight-card-photo img,
.msn-archive-card-photo img{
  width:100%; height:100%;
  object-fit:cover;
  display:block;
}
.msn-highlight-card-fallback,
.msn-archive-fallback{
  width:100%; height:100%;
  display:flex; align-items:center; justify-content:center;
  font-weight:1000;
  opacity:.7;
}

.msn-highlight-card-body,
.msn-archive-card-body{
  padding:12px;
}
.msn-highlight-card-title,
.msn-archive-card-title{
  font-weight:1000;
  font-size:14px;
}
.msn-highlight-card-sub{
  margin-top:4px;
  font-size:12px;
  font-weight:900;
  opacity:.7;
}
.msn-highlight-card-actions,
.msn-archive-card-actions{
  margin-top:10px;
  display:flex;
  gap:10px;
}

/* archive toggle */
.msn-story-archive-toggle{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  border:1px solid rgba(0,0,0,.08);
  border-radius:16px;
  box-shadow:0 10px 24px rgba(0,0,0,.06);
  padding:14px;
  background:#fff;
  margin-bottom:12px;
}
.msn-archive-toggle-title{ font-weight:1000; }
.msn-archive-toggle-sub{ margin-top:2px; opacity:.7; font-weight:800; font-size:12px; }

.msn-archive-switch{
  border:0;
  border-radius:999px;
  padding:10px 12px;
  font-weight:1000;
  cursor:pointer;
  background:#eef0f3;
  color:#111;
  display:flex;
  gap:8px;
  align-items:center;
}
.msn-archive-switch-dot{
  width:18px;
  height:18px;
  border-radius:999px;
  background:#9aa4af;
}
.msn-archive-switch.is-on{
  background:#e7f0ff;
  color:#0b57d0;
}
.msn-archive-switch.is-on .msn-archive-switch-dot{ background:#1877f2; }

/* toast */
.msn-story-toast{
  position:fixed;
  left:50%;
  bottom:18px;
  transform:translateX(-50%);
  background:#111;
  color:#fff;
  padding:10px 14px;
  border-radius:999px;
  font-weight:1000;
  font-size:13px;
  opacity:0;
  pointer-events:none;
  transition:opacity .18s ease, transform .18s ease;
  z-index:1000000;
  max-width:min(92vw, 520px);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.msn-story-toast.is-show{
  opacity:1;
  transform:translateX(-50%) translateY(-2px);
}