/* ============================================================================
   components/story/story.css — Story çubuğu, izleyici, oluşturucu, galeri
   ============================================================================ */

/* ───────────────────────────── STORY ÇUBUĞU ───────────────────────────── */
.sb {
  display: flex; gap: 14px;
  padding: 12px 14px;
  overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}
.sb::-webkit-scrollbar { display: none; }

.sb-item {
  flex: 0 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  border: 0; background: none; padding: 0;
  cursor: pointer; font-family: inherit;
  width: 68px;
}
.sb-ring {
  display: grid; place-items: center;
  width: 62px; height: 62px;
  border-radius: 50%;
  padding: 2.5px;
  background: var(--line);
  transition: transform .15s ease;
}
.sb-item:hover .sb-ring { transform: scale(1.05); }
.sb-item:focus-visible .sb-ring { outline: 3px solid var(--brand); outline-offset: 2px; }

/* Görülmemiş = renkli halka. Görülmüş = soluk. Tek bakışta ayrım. */
.sb-ring.has-unseen { background: var(--grad, linear-gradient(135deg, #7C4DFF, #FF4D8D)); }
.sb-ring.is-scope { border-radius: 18px; }
.sb-ring.is-scope .sb-av { border-radius: 15px; }

.sb-av {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid var(--card);
  background: var(--bg);
  display: block;
}
.sb-ring--new {
  background: var(--bg);
  border: 2px dashed var(--line);
}
.sb-plus { font-size: 24px; color: var(--brand); font-weight: 300; line-height: 1; }

.sb-name {
  font-size: 11.5px; color: var(--muted);
  max-width: 68px; text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sb-skel .sb-ring { background: var(--line); animation: sbPulse 1.4s infinite; }
.sb-skel .sb-name { width: 44px; height: 9px; border-radius: 4px; background: var(--line); }
@keyframes sbPulse { 0%,100% { opacity: .5 } 50% { opacity: .9 } }

/* ───────────────────────────── İZLEYİCİ ───────────────────────────── */
body.sv-open { overflow: hidden; }

.sv-layer {
  position: fixed; inset: 0; z-index: 90;
  background: #000;
  display: grid; place-items: center;
  animation: svIn .18s ease;
}
@keyframes svIn { from { opacity: 0 } to { opacity: 1 } }

.sv-shell {
  position: relative;
  width: 100%; height: 100%;
  max-width: 480px; max-height: 100dvh;
  display: flex; flex-direction: column;
  background: #000;
  overflow: hidden;
}

/* ilerleme çubukları */
.sv-bars {
  position: absolute; top: 0; left: 0; right: 0; z-index: 4;
  display: flex; gap: 3px;
  padding: 10px 10px 0;
}
.sv-bar {
  flex: 1 1 0;
  height: 2.5px; border-radius: 2px;
  background: rgba(255,255,255,.3);
  overflow: hidden;
}
.sv-bar__fill { display: block; height: 100%; width: 0; background: #fff; }
.sv-bar.is-done .sv-bar__fill { width: 100%; }

.sv-head {
  position: absolute; top: 18px; left: 0; right: 0; z-index: 4;
  display: flex; align-items: center; gap: 9px;
  padding: 8px 12px;
  color: #fff;
  background: linear-gradient(to bottom, rgba(0,0,0,.55), transparent);
}
.sv-av { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: #333; }
.sv-who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.sv-title { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sv-time { font-size: 11.5px; opacity: .75; }
.sv-ic {
  border: 0; background: rgba(0,0,0,.35); color: #fff;
  width: 32px; height: 32px; border-radius: 50%;
  font-size: 15px; cursor: pointer; font-family: inherit;
  display: grid; place-items: center;
}
.sv-ic:focus-visible { outline: 2px solid #fff; }

.sv-stage {
  flex: 1 1 auto;
  display: grid; place-items: center;
  position: relative;
  overflow: hidden;
}
.sv-media {
  max-width: 100%; max-height: 100%;
  width: auto; height: auto;
  object-fit: contain;
  display: block;
}
.sv-empty { color: #999; font-size: 14px; }
.sv-spin {
  width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.25); border-top-color: #fff;
  animation: svSpin .8s linear infinite;
}
@keyframes svSpin { to { transform: rotate(360deg) } }

/* dokunma bölgeleri — görünmez ama klavyeyle erişilebilir */
.sv-tap {
  position: absolute; top: 60px; bottom: 96px;
  width: 33%; border: 0; background: transparent;
  cursor: pointer; z-index: 2;
}
.sv-tap--prev { left: 0; }
.sv-tap--next { right: 0; width: 67%; }
.sv-tap:focus-visible { outline: 2px dashed rgba(255,255,255,.6); }

.sv-foot {
  position: relative; z-index: 3;
  padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, rgba(0,0,0,.72), transparent);
  color: #fff;
}
.sv-caption { margin: 0 0 8px; font-size: 14px; line-height: 1.45; }
.sv-place { font-size: 12px; opacity: .85; }
.sv-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.sv-quick { display: flex; gap: 4px; }
.sv-emoji {
  border: 0; background: rgba(255,255,255,.14);
  width: 34px; height: 34px; border-radius: 50%;
  font-size: 17px; cursor: pointer; font-family: inherit;
  transition: transform .12s ease, background .12s ease;
}
.sv-emoji:hover { transform: scale(1.15); }
.sv-emoji.is-on { background: rgba(255,255,255,.42); transform: scale(1.12); }
.sv-emoji:focus-visible { outline: 2px solid #fff; }

.sv-reply { flex: 1; display: flex; gap: 6px; }
.sv-reply__in {
  flex: 1; min-width: 0;
  border: 1px solid rgba(255,255,255,.35);
  background: rgba(255,255,255,.1);
  color: #fff; border-radius: 999px;
  padding: 8px 14px; font: inherit; font-size: 13.5px;
}
.sv-reply__in::placeholder { color: rgba(255,255,255,.6); }
.sv-reply__go {
  border: 0; background: #fff; color: #000;
  width: 34px; height: 34px; border-radius: 50%;
  cursor: pointer; font-size: 16px; font-family: inherit;
}
.sv-stats {
  margin-top: 8px; border: 0; background: none; color: #fff;
  font: inherit; font-size: 13px; cursor: pointer; opacity: .9;
}

.sv-sr {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

.sv-layer.is-paused .sv-bar__fill { animation-play-state: paused; }

.sv-viewers {
  position: absolute; inset: 0; z-index: 6;
  background: rgba(0,0,0,.6);
  display: grid; place-items: end center;
}
.sv-viewers__in {
  width: 100%; max-height: 62%;
  background: var(--card); color: var(--text);
  border-radius: 18px 18px 0 0;
  padding: 16px; overflow-y: auto;
}
.sv-viewers__in h3 { margin: 0 0 10px; font-size: 15px; }
.sv-viewers__in ul { list-style: none; margin: 0 0 12px; padding: 0; }
.sv-viewers__in li { display: flex; align-items: center; gap: 9px; padding: 7px 0; font-size: 14px; }
.sv-viewers__in img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: var(--bg); }
.sv-viewers__in em { margin-left: auto; font-style: normal; color: var(--muted); font-size: 12.5px; }

/* ───────────────────────────── OLUŞTURUCU ─────────────────────────────
   Instagram düzeni: medya EKRANI KAPLAR, kontroller onun üstüne biner.
   Önceki hâli form alanlarını alt alta dizen bir alt-sayfaydı; medya
   küçücük kalıyordu ve panel şeffaf görünüyordu (--card tanımsızdı). */
.sc-layer {
  position: fixed; inset: 0; z-index: 92;
  background: #000;
  display: grid; place-items: center;
  animation: svIn .16s ease;
}
.sc-shell {
  position: relative;
  width: 100%; height: 100%;
  max-width: 480px; max-height: 100dvh;
  background: #000;
  overflow: hidden;
  display: flex; flex-direction: column;
}

/* tuval */
.sc-canvas {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 35%, #1b1b22 0%, #000 78%);
}
.sc-media {
  max-width: 100%; max-height: 100%;
  width: auto; height: auto;
  object-fit: contain; display: block;
}

.sc-empty {
  display: grid; place-items: center; gap: 8px;
  width: 78%; padding: 40px 22px;
  border: 2px dashed rgba(255,255,255,.28);
  border-radius: 18px;
  color: #fff; cursor: pointer; text-align: center;
}
.sc-empty:hover { border-color: rgba(255,255,255,.6); background: rgba(255,255,255,.04); }
/* Emoji yerine SVG: boyut svg ile belirlenir, tasarım dili korunur. */
.sc-empty__ic {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--purple-soft); color: var(--purple-deep);
  display: grid; place-items: center;
}
.sc-empty__ic svg { width: 26px; height: 26px; }
.sc-empty strong { font-size: 15px; font-weight: 700; }
.sc-empty em { font-style: normal; font-size: 12.5px; opacity: .65; }

/* üst şerit */
.sc-top {
  position: relative; z-index: 3;
  display: flex; align-items: center; gap: 10px;
  padding: calc(12px + env(safe-area-inset-top, 0px)) 12px 12px;
  background: linear-gradient(to bottom, rgba(0,0,0,.62), transparent);
}
.sc-top__mid { flex: 1; display: flex; justify-content: center; }
.sc-round {
  border: 0; background: rgba(255,255,255,.16); color: #fff;
  width: 36px; height: 36px; border-radius: 50%;
  font-size: 15px; cursor: pointer; font-family: inherit;
  display: grid; place-items: center; flex: 0 0 auto;
}
.sc-round:hover { background: rgba(255,255,255,.28); }
.sc-round:focus-visible { outline: 2px solid #fff; }
.sc-round--alt { font-size: 11px; font-weight: 800; letter-spacing: .04em; }

.sc-chip {
  border: 0; background: rgba(255,255,255,.16); color: #fff;
  border-radius: 999px; padding: 7px 14px;
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.sc-chip:hover { background: rgba(255,255,255,.28); }

/* seçilen medya şeridi */
/* Şerit alt bölümün hemen üstünde durur. `margin-top:auto` BURADA
   OLMAMALI: şerit yalnızca medya seçilince var; boşken alt bölümü aşağı
   itecek hiçbir şey kalmıyor ve kontroller ekranın tepesine yapışıyordu. */
.sc-strip {
  position: relative; z-index: 3;
  display: flex; gap: 7px;
  padding: 0 12px 10px;
  overflow-x: auto; scrollbar-width: none;
}
.sc-strip::-webkit-scrollbar { display: none; }
.sc-cell {
  position: relative; flex: 0 0 auto;
  width: 52px; height: 68px; border-radius: 9px; overflow: hidden;
  border: 2px solid transparent; cursor: pointer; background: #111;
  display: block;
}
.sc-cell.is-on { border-color: #fff; }
.sc-cell:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.sc-cell img, .sc-cell video { width: 100%; height: 100%; object-fit: cover; display: block; }
.sc-cell__v {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: #fff; font-size: 14px; text-shadow: 0 1px 4px rgba(0,0,0,.7);
  pointer-events: none;
}
.sc-cell__x {
  position: absolute; top: 2px; right: 2px;
  background: rgba(0,0,0,.66); color: #fff;
  width: 17px; height: 17px; border-radius: 50%;
  font-size: 9px; display: grid; place-items: center; cursor: pointer;
}

/* alt bölüm */
.sc-bottom {
  position: relative; z-index: 3;
  margin-top: auto;                 /* boş/dolu her durumda en altta */
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, rgba(0,0,0,.82), rgba(0,0,0,.35) 60%, transparent);
  display: grid; gap: 10px;
}
.sc-cap textarea {
  width: 100%;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.1);
  color: #fff; border-radius: 14px;
  padding: 10px 14px; font: inherit; font-size: 14px;
  resize: none; min-height: 42px; max-height: 110px;
}
.sc-cap textarea::placeholder { color: rgba(255,255,255,.55); }
.sc-cap textarea:focus { outline: none; border-color: rgba(255,255,255,.5); }

.sc-send { display: flex; align-items: center; gap: 9px; }
.sc-aud {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 7px;
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.1); color: #fff;
  border-radius: 999px; padding: 9px 14px;
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
  white-space: nowrap; overflow: hidden;
}
.sc-aud:hover { background: rgba(255,255,255,.18); }
.sc-aud__ic { display: inline-grid; place-items: center; }
.sc-aud__caret { margin-left: auto; opacity: .7; }

.sc-go {
  flex: 0 0 auto;
  border: 0; background: #fff; color: #000;
  border-radius: 999px; padding: 10px 20px;
  font: inherit; font-size: 14px; font-weight: 800; cursor: pointer;
  display: flex; align-items: center; gap: 6px;
}
.sc-go:disabled { opacity: .4; cursor: default; }
.sc-go:not(:disabled):hover { transform: translateY(-1px); }

/* açılır sayfalar */
.sc-sheet {
  position: absolute; left: 12px; right: 12px;
  bottom: calc(100% + 8px);
  background: #1c1c22; color: #fff;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 15px; padding: 6px;
  box-shadow: 0 12px 34px rgba(0,0,0,.55);
  z-index: 5;
}
.sc-sheet__row {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border: 0; background: none; color: #fff;
  padding: 11px 13px; border-radius: 11px;
  font: inherit; font-size: 14px; cursor: pointer; text-align: left;
}
.sc-sheet__row:hover { background: rgba(255,255,255,.1); }
.sc-sheet__row.is-on { background: rgba(255,255,255,.14); font-weight: 700; }
.sc-sheet__row em { margin-left: auto; font-style: normal; }

.sc-sheet--alt {
  position: fixed; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, 88vw); bottom: auto;
  display: grid; gap: 10px; padding: 16px;
}
.sc-altlab { font-size: 13px; font-weight: 700; }
.sc-altlab em { font-style: normal; font-weight: 400; opacity: .7; }
.sc-sheet--alt input {
  border: 1px solid rgba(255,255,255,.22);
  background: rgba(255,255,255,.08); color: #fff;
  border-radius: 11px; padding: 10px 13px; font: inherit; font-size: 14px;
}
.sc-sheet--alt .sc-chip { justify-self: end; }

/* yükleme göstergesi */
.sc-busy {
  position: absolute; inset: 0; z-index: 4;
  display: grid; place-items: center; gap: 12px; align-content: center;
  background: rgba(0,0,0,.55); color: #fff;
  font-size: 15px; font-weight: 700;
}
.sc-busy__ring {
  width: 40px; height: 40px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,.22); border-top-color: #fff;
  animation: svSpin .8s linear infinite;
}

/* ───────────────────────── GALERİ / CAROUSEL ───────────────────────── */
.gal { position: relative; }
.gal-track {
  display: flex; gap: 0;
  overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.gal-track::-webkit-scrollbar { display: none; }
.gal-slide {
  flex: 0 0 100%; scroll-snap-align: center;
  display: grid; place-items: center;
  background: var(--bg);
}
.gal-slide img, .gal-slide video { width: 100%; height: auto; display: block; }
.gal-dots {
  position: absolute; left: 0; right: 0; bottom: 8px;
  display: flex; justify-content: center; gap: 5px;
  pointer-events: none;
}
.gal-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255,255,255,.55);
  box-shadow: 0 0 3px rgba(0,0,0,.4);
}
.gal-dot.is-on { background: #fff; width: 7px; height: 7px; }
.gal-count {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,.55); color: #fff;
  font-size: 11.5px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
}

/* ───────────────────── HAREKET AZALTMA (erişilebilirlik) ───────────────────── */
@media (prefers-reduced-motion: reduce) {
  .sv-layer, .sc-layer { animation: none; }
  .sb-item:hover .sb-ring, .sv-emoji:hover { transform: none; }
  .sb-skel .sb-ring { animation: none; }
  .sc-prog span { transition: none; }
}

/* ───────────────────────── GENİŞ EKRAN ───────────────────────── */
@media (min-width: 900px) {
  .sv-shell { max-height: 92dvh; border-radius: 14px; }
  .sc-layer { place-items: center; }
  .sc-shell { border-radius: 16px; }
}
