/* web-stories.css — bubble rail, grid cards, and full-screen story viewer */

/* ── Bubble rail (homepage + index page) ──────────────────────────────── */
.web-stories-rail {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 14px 4px 18px;
  scrollbar-width: thin;
}
.web-story-bubble {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 78px;
  text-decoration: none;
  color: var(--color-text);
}
.web-story-bubble__ring {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  padding: 2.5px;
  background: linear-gradient(135deg, #ff7a45, var(--color-primary) 55%, #7a1fd1);
  display: block;
}
.web-story-bubble__ring img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid var(--color-bg);
  display: block;
}
.web-story-bubble__label {
  font-size: 11px;
  text-align: center;
  line-height: 1.25;
  color: var(--color-text-muted);
}

/* ── Grid cards (index page) ──────────────────────────────────────────── */
.web-stories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}
.web-story-card {
  position: relative;
  display: block;
  aspect-ratio: 9 / 16;
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  box-shadow: var(--shadow-card);
  background: #111;
}
.web-story-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.web-story-card__slides-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 999px;
}
.web-story-card__body {
  position: absolute;
  inset: auto 0 0 0;
  padding: 28px 10px 10px;
  background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
  color: #fff;
}
.web-story-card__body .category-badge {
  background: var(--color-primary);
  color: #fff;
  font-size: 10px;
  padding: 1px 7px;
}
.web-story-card__body h3 {
  font-size: 13px;
  margin: 5px 0 4px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.web-story-card__views {
  font-size: 10.5px;
  opacity: 0.85;
}

/* ── Full-screen viewer ────────────────────────────────────────────────── */
body.web-story-open { overflow: hidden; }

.web-story-viewer {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: #000;
  display: flex;
  justify-content: center;
  align-items: center;
}
.web-story-viewer__stage {
  position: relative;
  width: 100%;
  max-width: 420px;
  height: 100%;
  max-height: 100vh;
  background: #000;
  overflow: hidden;
}
.web-story-viewer__progress {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  gap: 4px;
  z-index: 5;
}
.web-story-viewer__progress span {
  flex: 1;
  height: 2.5px;
  background: rgba(255,255,255,0.35);
  border-radius: 2px;
  overflow: hidden;
}
.web-story-viewer__progress span.is-done { background: #fff; }
.web-story-viewer__progress span.is-active {
  position: relative;
  background: rgba(255,255,255,0.35);
}
.web-story-viewer__progress span.is-active::after {
  content: '';
  position: absolute;
  inset: 0;
  background: #fff;
  width: 0%;
  transform-origin: left;
}
.web-story-viewer__progress span.is-active.is-filling::after {
  animation: fpStoryFill linear forwards;
  animation-duration: inherit;
}
@keyframes fpStoryFill { from { width: 0%; } to { width: 100%; } }

.web-story-viewer__header {
  position: absolute;
  top: 22px;
  left: 12px;
  right: 12px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
}
.web-story-viewer__header img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.web-story-viewer__header strong {
  font-size: 13px;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.web-story-viewer__header span { font-size: 11px; opacity: 0.75; }

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

.web-story-viewer__caption {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 4;
  padding: 24px 18px 30px;
  background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
  color: #fff;
}
.web-story-viewer__caption h2 {
  font-size: 19px;
  line-height: 1.35;
  margin: 0 0 6px;
}
.web-story-viewer__caption p {
  font-size: 13.5px;
  opacity: 0.9;
  line-height: 1.5;
  margin: 0 0 12px;
}
.web-story-viewer__cta {
  display: inline-block;
  background: #fff;
  color: #111;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 999px;
  text-decoration: none;
}

.web-story-viewer__tap-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40%;
  z-index: 3;
  cursor: pointer;
}
.web-story-viewer__tap-zone--prev { left: 0; }
.web-story-viewer__tap-zone--next { right: 0; width: 60%; }

.web-story-viewer__close {
  position: absolute;
  top: 18px;
  right: 14px;
  z-index: 20;
  background: rgba(0,0,0,0.4);
  color: #fff;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
}
.web-story-viewer__share {
  position: absolute;
  bottom: 14px;
  right: 14px;
  z-index: 20;
  display: flex;
  gap: 8px;
}
.web-story-viewer__share button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.web-story-viewer__noscript { padding: 20px; color: #fff; background: #000; }
.web-story-viewer__noscript figure { margin: 0 0 20px; }
.web-story-viewer__noscript img { width: 100%; border-radius: 10px; }

@media (max-width: 480px) {
  .web-story-viewer__stage { max-width: 100%; }
}

/* ── Admin: Web Stories manager form ──────────────────────────────────── */
.story-form__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.story-slide-row {
  position: relative;
  border: 1px solid var(--color-border, #e5e5e5);
  border-radius: var(--radius);
  padding: 14px 14px 10px;
  margin: 0 0 14px;
}
.story-slide-row legend {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-primary);
  padding: 0 6px;
}
.story-slide-row label {
  display: block;
  font-size: 12.5px;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}
.story-slide-row input,
.story-slide-row textarea {
  width: 100%;
  margin-top: 4px;
  padding: 7px 9px;
  border: 1px solid var(--color-border, #e5e5e5);
  border-radius: 6px;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 13px;
}
.story-slide-row textarea { min-height: 60px; resize: vertical; }
.story-slide-row .req { color: var(--color-primary); }
.story-slide-row__remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: var(--color-bg-alt);
  color: var(--color-text-muted);
  cursor: pointer;
}
.story-slide-row__remove:hover { background: #e03d3d; color: #fff; }

.story-admin-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.story-admin-list__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--color-border, #e5e5e5);
  border-radius: var(--radius);
}
.story-admin-list__item img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.story-admin-list__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.story-admin-list__body span {
  font-size: 12px;
  color: var(--color-text-muted);
}
.btn-sm { padding: 4px 10px !important; font-size: 12px !important; min-height: 30px !important; }
.btn-danger { border-color: #e03d3d !important; color: #e03d3d !important; }
.btn-danger:hover { background: #e03d3d !important; color: #fff !important; }
.admin-page__hint { font-size: 12.5px; color: var(--color-text-light); margin: 4px 0 16px; }
.admin-page__subhead { margin-top: 28px; font-size: 16px; }
