/* ============================================================================
   Evotic — Stories (vibes 24h, /stories) · Phase 9 v2
   Feed cards verticales (full-screen swipeable reporté Phase 10+)
   ============================================================================ */

.stories-body {
  padding: 0;
  background: var(--bg);
  min-height: 100dvh;
  background-image:
    radial-gradient(circle at 100% 0%, rgba(255, 102, 0, 0.05), transparent 40%);
  background-attachment: fixed;
}

/* Header (shared) — re-declared */
.app-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding-top: var(--safe-top);
  box-shadow: var(--shadow-header);
}
.app-header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 0 var(--sp-4);
}
.app-header-title {
  flex: 1;
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  min-width: 0;
}
.app-header-name {
  font-size: 18px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-header-sub {
  font-size: 11px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hdr-back {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  font-size: 16px;
  flex-shrink: 0;
  transition: background var(--t-fast), transform var(--t-fast);
}
.hdr-back:hover { background: var(--skeleton); }
.hdr-back:active { transform: scale(0.92); }

.hdr-action-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--primary-bg);
  color: var(--primary);
  border: none;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0; margin: 0;
  transition: background var(--t-fast), transform var(--t-fast), box-shadow var(--t-base), color var(--t-fast);
}
.hdr-action-btn:hover {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-primary-sm);
}
.hdr-action-btn:active { transform: scale(0.92); }

/* Section / err / empty utilities */
.err { color: var(--red); font-size: 13px; font-weight: 600; text-align: center; margin: 0; min-height: 18px; }
.empty-state {
  text-align: center;
  padding: var(--sp-7) var(--sp-4);
  color: var(--text-muted);
  font-weight: 600;
  background: var(--card-bg);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-card);
}
.empty-state p { margin: 6px 0; font-size: 14px; }
.empty-state .hint { font-size: 12px; color: var(--text-faint); }
.empty-icon {
  font-size: 36px;
  color: var(--text-faint);
  display: block;
  margin: 0 auto var(--sp-3);
  opacity: 0.7;
}

/* ============================================================================
   Stories feed
   ============================================================================ */
.stories-shell {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.vibes-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.vibe-card {
  background: var(--card-bg);
  border-radius: var(--r-2xl);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  border: 1px solid transparent;
  transition: border-color var(--t-fast), box-shadow var(--t-base);
  animation: vibeIn 0.32s ease-out;
}
.vibe-card:hover {
  border-color: var(--primary-bg);
  box-shadow: var(--shadow-card-hover);
}
@keyframes vibeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.vibe-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: var(--sp-3) var(--sp-4);
}
.vibe-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary-grad);
  color: #fff;
  font-weight: 900;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  flex-shrink: 0;
  box-shadow: var(--shadow-primary-sm), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  letter-spacing: 0.02em;
}
.vibe-meta {
  flex: 1;
  min-width: 0;
}
.vibe-pseudo {
  font-size: 14px;
  font-weight: 900;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.01em;
}
.vibe-time {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-top: 2px;
}

.vibe-media-wrap {
  position: relative;
  width: 100%;
  background: #000;
  max-height: 560px;
  overflow: hidden;
}
.vibe-media-wrap img,
.vibe-media-wrap video,
.vibe-media {
  width: 100%;
  height: auto;
  max-height: 560px;
  display: block;
  object-fit: cover;
}

.vibe-caption {
  padding: var(--sp-3) var(--sp-4) var(--sp-4);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  font-weight: 600;
  word-wrap: break-word;
}
.vibe-caption:empty { display: none; }

/* ============================================================================
   Drawer + sheet-form (mirror of directory.css / map.css for parity)
   ============================================================================ */
.drawer {
  position: fixed;
  inset: 0;
  z-index: var(--z-drawer);
  visibility: hidden;
  opacity: 0;
  transition: opacity var(--t-base), visibility var(--t-base);
}
.drawer.open { visibility: visible; opacity: 1; }
.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(var(--blur-sm));
  -webkit-backdrop-filter: blur(var(--blur-sm));
}
.drawer-card {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  max-width: var(--max-w);
  margin: 0 auto;
  background: var(--card-bg);
  border-radius: var(--r-3xl) var(--r-3xl) 0 0;
  padding: var(--sp-3) var(--sp-5) max(var(--sp-5), calc(var(--safe-bottom) + var(--sp-5)));
  max-height: 82vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform var(--t-slow);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.18);
}
.drawer.open .drawer-card { transform: translateY(0); }
.drawer-handle {
  width: 44px; height: 5px;
  border-radius: var(--r-pill);
  background: var(--skeleton-strong);
  margin: 0 auto var(--sp-3);
}
.drawer-title {
  font-size: 18px;
  font-weight: 900;
  color: var(--text);
  margin: 0;
  letter-spacing: 0.01em;
}
.drawer-head-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin: 0 0 var(--sp-4);
}
.drawer-head-row .drawer-title { flex: 1; }
.drawer-x {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--skeleton);
  color: var(--text-soft);
  border: none;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.drawer-x:hover { background: var(--skeleton-strong); }
.drawer-x:active { background: var(--red-bg); color: var(--red); transform: scale(0.92); }

.sheet-form { display: flex; flex-direction: column; gap: var(--sp-3); }
.sheet-field { display: flex; flex-direction: column; gap: 6px; margin: 0; }
.sheet-field .auth-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sheet-field .auth-label i { color: var(--primary); font-size: 11px; width: 14px; text-align: center; }
.sheet-field textarea,
.sheet-field input[type="text"],
.sheet-field input[type="file"] {
  width: 100%;
  margin: 0;
  padding: 12px 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--card-bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  resize: vertical;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.sheet-field input::placeholder,
.sheet-field textarea::placeholder { color: var(--text-faint); font-weight: 500; }
.sheet-field textarea:focus, .sheet-field input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--primary-bg-soft);
  box-shadow: 0 0 0 3px rgba(255, 102, 0, 0.10);
}
.sheet-form .btn { margin-top: var(--sp-2); width: 100%; }
.sheet-form .hint {
  margin: 0;
  padding: 9px 12px;
  background: var(--primary-bg);
  border-radius: var(--r-md);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.4;
}
.sheet-form .hint i { color: var(--primary); flex-shrink: 0; }

/* ============================================================================
   Phase 11.4.1 — Vibes swipe deck (Tinder-style)
   ============================================================================ */
.vibes-deck-host {
  position: relative;
  width: 100%;
  height: calc(100vh - var(--header-h) - var(--safe-top) - 16px);
  height: calc(100dvh - var(--header-h) - var(--safe-top) - 16px);
  max-height: 720px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: var(--r-2xl);
  background: #000;
  list-style: none;
  padding: 0;
}

.vibes-deck-progress {
  position: absolute;
  top: 10px;
  left: 12px;
  right: 12px;
  z-index: 20;
  display: flex;
  gap: 4px;
  pointer-events: none;
}
.vibe-progress-bar {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}
.vibe-progress-bar.done {
  background: rgba(255, 255, 255, 0.85);
}
.vibe-progress-bar.current {
  background: rgba(255, 255, 255, 0.25);
}
.vibe-progress-bar.current::after {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: #fff;
  width: 0;
  animation: vibeProgress 5s linear forwards;
}
@keyframes vibeProgress {
  from { width: 0; }
  to   { width: 100%; }
}

.vibes-deck-stack {
  position: absolute;
  inset: 0;
  z-index: 5;
}

.vibe-card.vibe-item {
  position: absolute;
  inset: 0;
  border-radius: var(--r-2xl);
  background: #111;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  transition: transform 0.28s ease-out, opacity 0.28s ease-out;
  cursor: grab;
}
.vibe-card.vibe-item.dragging {
  transition: none;
  cursor: grabbing;
}
.vibe-card-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 0%, rgba(255, 102, 0, 0.18), transparent 70%);
  pointer-events: none;
  z-index: 1;
}
.vibe-card-media-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}
.vibe-card .vibe-media {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.vibe-card-head {
  position: absolute;
  top: 22px;
  left: 12px;
  right: 12px;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
}
.vibe-card-head .vibe-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary-grad);
  color: #fff;
  font-weight: 900;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.32);
}
.vibe-card-head .vibe-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
}
.vibe-card-head .vibe-pseudo {
  font-size: 14px;
  font-weight: 900;
  color: #fff;
  letter-spacing: 0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vibe-card-head .vibe-time {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.02em;
}
.vibe-close-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  -webkit-tap-highlight-color: transparent;
}
.vibe-close-btn:hover { background: rgba(0, 0, 0, 0.65); }
.vibe-close-btn:active { transform: scale(0.92); }

.vibe-card-caption {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 16px;
  z-index: 15;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  padding: 12px 16px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.7));
  border-radius: var(--r-md);
  word-break: break-word;
  white-space: pre-wrap;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
  max-height: 35%;
  overflow-y: auto;
}

.vibes-deck-zones {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  pointer-events: none;
}
.vibe-zone-prev,
.vibe-zone-pause,
.vibe-zone-next {
  flex: 1;
  pointer-events: auto;
}
.vibe-zone-prev { flex: 0.3; }
.vibe-zone-next { flex: 0.3; }
.vibe-zone-pause { flex: 0.4; }

.empty-state.card.vibes-empty,
#vibes-empty {
  color: var(--text-muted);
  text-align: center;
}

