/* ============================================================
   curiouscats_story.css
   Layout shell for /story — nav, skeleton, popup.
   Article content styles live in article-detail-view.css.
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: #0c0c14;
  color: #e4e2df;
  font-family: "SF Pro Display","SF Pro Icons","Helvetica Neue","Helvetica","Arial",sans-serif;
  min-height: 100vh;
}


/* ============================================================
   NAV
   ============================================================ */
.story-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(12,12,20,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 24px;
}

.story-nav-inner {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.story-nav-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: #e4e2df;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.2px;
}

.story-nav-logo img {
  width: 26px;
  height: 26px;
  border-radius: 6px;
}

.story-nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.story-nav-app-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(228,226,223,0.55);
  text-decoration: none;
  transition: color 0.15s;
}
.story-nav-app-icon:hover { color: #e4e2df; }


/* ============================================================
   LOADING SKELETON
   ============================================================ */
.story-loading {
  max-width: 1120px;
  margin: 40px auto;
  padding: 0 24px;
}

.story-skel {
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.04) 25%,
    rgba(255,255,255,0.08) 50%,
    rgba(255,255,255,0.04) 75%
  );
  background-size: 200% 100%;
  animation: story-shimmer 1.4s infinite;
  border-radius: 4px;
}

@keyframes story-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.story-skel-img   { width: 100%; aspect-ratio: 16/9; margin-bottom: 24px; }
.story-skel-tag   { width: 80px; height: 14px; margin-bottom: 16px; border-radius: 3px; }
.story-skel-h1    { width: 72%; height: 44px; margin-bottom: 10px; }
.story-skel-h1b   { width: 48%; height: 44px; margin-bottom: 28px; }
.story-skel-lead  { width: 88%; height: 16px; margin-bottom: 8px; }
.story-skel-lead2 { width: 64%; height: 16px; }


/* ============================================================
   ARTICLE MOUNT
   ============================================================ */
#story-article {
  padding-bottom: 50px;
}


/* ============================================================
   POPUP BACKDROP
   ============================================================ */
.story-popup-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.story-popup-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}


/* ============================================================
   POPUP
   ============================================================ */
.story-popup {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  z-index: 201;
  background: #111119;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 16px;
  padding: 32px 28px 28px;
  width: min(420px, calc(100vw - 32px));
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.story-popup.open {
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  pointer-events: auto;
}

.story-popup-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  margin: 0 auto 16px;
  display: block;
}

.story-popup-title {
  font-size: 17px;
  font-weight: 700;
  color: #f0ede8;
  line-height: 1.3;
  margin-bottom: 8px;
}

.story-popup-sub {
  font-size: 13.5px;
  color: rgba(228,226,223,0.5);
  line-height: 1.55;
  margin-bottom: 24px;
}

.story-popup-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  background: #a092e2;
  color: #0c0c14;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}
.story-popup-cta:hover { background: #b3a7e8; }

.story-popup-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  color: rgba(228,226,223,0.35);
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  transition: color 0.15s;
}
.story-popup-close:hover { color: #e4e2df; }


/* ============================================================
   ERROR STATE
   ============================================================ */
.story-error {
  text-align: center;
  padding: 80px 24px;
  color: rgba(228,226,223,0.4);
  font-size: 15px;
}
.story-error strong {
  display: block;
  font-size: 17px;
  color: rgba(228,226,223,0.7);
  margin-bottom: 8px;
}
.story-error a { color: #a092e2; }


/* ============================================================
   BOTTOM CTA
   ============================================================ */
.story-bottom-cta {
  /* margin-top: 80px; */
  border-top: 1px solid rgba(255,255,255,0.07);
  background: linear-gradient(180deg, transparent 0%, rgba(160,146,226,0.05) 100%);
  padding: 72px 24px 80px;
  text-align: center;
}

.story-bottom-cta-inner {
  max-width: 560px;
  margin: 0 auto;
}

.story-bottom-cta-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: block;
  margin: 0 auto 20px;
}

.story-bottom-cta-headline {
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 800;
  color: #f0ede8;
  line-height: 1.2;
  letter-spacing: -0.4px;
  margin-bottom: 14px;
}

.story-bottom-cta-sub {
  font-size: 15px;
  color: rgba(228,226,223,0.5);
  line-height: 1.6;
  margin-bottom: 32px;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
}

.story-bottom-cta-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.story-bottom-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 13px 28px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.story-bottom-cta-btn--primary {
  background: #a092e2;
  color: #0c0c14;
  border: none;
}
.story-bottom-cta-btn--primary:hover { background: #b3a7e8; }

.story-bottom-cta-btn--ghost {
  background: transparent;
  color: rgba(228,226,223,0.75);
  border: 1px solid rgba(255,255,255,0.15);
}
.story-bottom-cta-btn--ghost:hover {
  color: #e4e2df;
  border-color: rgba(255,255,255,0.3);
}

.story-bottom-cta-countries {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: rgba(228,226,223,0.3);
}


/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 600px) {
  .story-nav     { padding: 0 16px; }
  .story-loading { padding: 0 16px; }
  .story-bottom-cta { padding: 56px 20px 64px; }
  .story-bottom-cta-actions { flex-direction: column; }
  .story-bottom-cta-btn { width: 100%; }
}
