/* ==========================================================================
   TyeePress Stories — WA / IG / FB Style Story Bar & Modal Viewer
   ========================================================================== */
:root {
  --tyee-story-bar-bg: #ffffff;
  --tyee-story-ring-1: #f7d117;
  --tyee-story-ring-2: #e1306c;
  --tyee-story-ring-3: #1877f2;
  --tyee-story-viewed: #c8c8c4;
}

.tyee-stories-section {
  background-color: var(--tyee-story-bar-bg);
  border-bottom: 1px solid var(--tyee-border);
  padding: 14px 0;
}

.tyee-stories-bar-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tyee-stories-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--tyee-meta);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tyee-stories-label i {
  color: var(--tyee-story-ring-2);
}

.tyee-stories-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 4px 2px;
  flex: 1;
}

.tyee-stories-track::-webkit-scrollbar {
  display: none;
}

.tyee-story-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 78px;
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: center;
  font-family: var(--tyee-font-sans);
}

.tyee-story-ring {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  padding: 3px;
  background: linear-gradient(135deg, var(--tyee-story-ring-1), var(--tyee-story-ring-2), var(--tyee-story-ring-3));
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease;
  position: relative;
}

.tyee-story-item:hover .tyee-story-ring {
  transform: scale(1.06);
}

.tyee-story-item.is-viewed .tyee-story-ring {
  background: var(--tyee-story-viewed);
}

.tyee-story-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid var(--tyee-story-bar-bg);
  background-color: var(--tyee-surface);
}

.tyee-story-name {
  margin-top: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--tyee-heading);
  line-height: 1.2;
  max-width: 76px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tyee-stories-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--tyee-border);
  background: var(--tyee-bg);
  color: var(--tyee-heading);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Fullscreen Modal Viewer */
.tyee-story-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(12, 12, 14, 0.94);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.tyee-story-modal.is-open {
  display: flex;
}

.tyee-story-viewer {
  position: relative;
  width: 100%;
  max-width: 420px;
  height: min(86vh, 740px);
  border-radius: 14px;
  overflow: hidden;
  background: #141416;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  user-select: none;
}

.tyee-story-progress {
  position: absolute;
  top: 10px;
  left: 12px;
  right: 12px;
  display: flex;
  gap: 5px;
  z-index: 10;
}

.tyee-story-progress__seg {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  overflow: hidden;
}

.tyee-story-progress__fill {
  height: 100%;
  width: 0%;
  background: #ffffff;
  transition: width 0.05s linear;
}

.tyee-story-header {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 14px 10px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.65), transparent);
  color: #ffffff;
}

.tyee-story-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tyee-story-user img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ffffff;
}

.tyee-story-user__name {
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.2;
}

.tyee-story-user__time {
  font-size: 0.75rem;
  opacity: 0.8;
}

.tyee-story-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tyee-story-ctrl-btn {
  background: rgba(255, 255, 255, 0.16);
  border: none;
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.tyee-story-media {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 64px 24px 130px;
  text-align: center;
}

.tyee-story-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tyee-story-media__text-only {
  position: relative;
  z-index: 2;
  color: #ffffff;
  font-family: var(--tyee-font-serif);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.35;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.tyee-story-tap-prev,
.tyee-story-tap-next {
  position: absolute;
  top: 70px;
  bottom: 110px;
  z-index: 5;
  cursor: pointer;
}

.tyee-story-tap-prev {
  left: 0;
  width: 32%;
}

.tyee-story-tap-next {
  right: 0;
  width: 68%;
}

.tyee-story-footer {
  position: relative;
  z-index: 10;
  padding: 20px 16px 16px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
  color: #ffffff;
}

.tyee-story-caption {
  font-size: 0.94rem;
  line-height: 1.4;
  margin: 0 0 12px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

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

.tyee-story-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 20px;
  background: var(--tyee-yellow);
  color: var(--tyee-btn-text) !important;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none !important;
}

.tyee-story-reactions {
  display: flex;
  gap: 6px;
}

.tyee-story-react-btn {
  background: rgba(255, 255, 255, 0.16);
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.tyee-story-react-btn:hover {
  transform: scale(1.2);
  background: rgba(255, 255, 255, 0.28);
}

.tyee-story-floating-emoji {
  position: absolute;
  bottom: 70px;
  right: 28px;
  font-size: 2rem;
  z-index: 20;
  pointer-events: none;
  animation: tyeeFloatUp 1s ease-out forwards;
}

@keyframes tyeeFloatUp {
  0% { opacity: 1; transform: translateY(0) scale(0.8); }
  100% { opacity: 0; transform: translateY(-160px) scale(1.5); }
}

.tyee-story-arrow-desktop {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  z-index: 20;
}

.tyee-story-arrow-desktop--prev { left: 24px; }
.tyee-story-arrow-desktop--next { right: 24px; }

@media (max-width: 768px) {
  .tyee-story-arrow-desktop,
  .tyee-stories-nav-btn {
    display: none;
  }
  .tyee-story-viewer {
    height: 92vh;
    border-radius: 10px;
  }
}
