:root {
  --bg: #0b0f14;
  --panel: #121923;
  --text: #e7edf3;
  --muted: #b5c6d6;
  --accent: #6aa5ff;
  --danger: #ff6b6b;
  --border: #2a3a52;
}

@media (max-width: 480px) {
  .brand { font-size: 16px; }
  .nav-links { gap: 10px; }
  .nav-links a { padding: 6px 8px; }
  h1 { font-size: 22px; }
  h2 { font-size: 17px; }
  .site-footer { padding: 14px; }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: linear-gradient(180deg, #0b0f14 0%, #0f1520 100%);
  color: var(--text);
}

/* Ensure elements with the HTML `hidden` attribute never display */
[hidden] {
  display: none !important;
}

.container {
  max-width: 800px;
  margin: 40px auto;
  padding: 0 16px;
}

h1 {
  margin: 0 0 16px;
  font-size: 28px;
  text-align: center;
}

h2 {
  margin: 0 0 12px;
  font-size: 20px;
  color: var(--accent);
}

.section {
  margin-bottom: 40px;
}

/* Tabs (text labels with active underline) */
.tabs {
  display: flex;
  gap: 24px;
  align-items: flex-end;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
  margin-bottom: 16px;
}

.tab-button {
  position: relative;
  padding: 10px 0;
  background: transparent;
  border: none;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
}

.tab-button:hover {
  color: var(--text);
}

.tab-button.is-active {
  color: var(--text);
}

.tab-button::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -7px; /* sits over the tabs bottom border */
  height: 3px;
  background: transparent;
  border-radius: 3px;
}

.tab-button.is-active::after {
  background: #8b5cf6; /* purple underline to match screenshot vibe */
}

.tab-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.tab-button.loaded::before {
  content: '';
  position: absolute;
  right: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.9;
}

#search-form, #stories-form {
  display: flex;
  gap: 10px;
}

#search-form input, #stories-form input {
  flex: 1;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0f1622;
  color: var(--text);
  outline: none;
  font-size: 14px;
}

#search-form input:focus, #stories-form input:focus {
  border-color: var(--accent);
}

#search-form button, #stories-form button {
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid #3e5e92;
  background: linear-gradient(180deg, #6aa5ff 0%, #4f83e7 100%);
  color: #07121f; /* dark text on light accent for strong contrast */
  font-weight: 700;
  cursor: pointer;
}


/* Global links */
a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* Simple classic header */
.site-header {
  border-bottom: 1px solid var(--border);
  background: #0f1622;
}

.site-header .header-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
}

.brand {
  color: var(--text);
  font-weight: 800;
  letter-spacing: 0.4px;
}

.nav-links {
  display: flex;
  gap: 16px;
}

.nav-links a {
  color: var(--muted);
  font-weight: 600;
  padding: 8px 10px; /* touch target */
  border-radius: 8px;
}

.nav-links a:hover {
  color: var(--text);
  text-decoration: none;
}

/* Simple classic footer */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding: 16px;
  background: #0f1622;
}

.footer-nav {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.footer-nav a {
  color: var(--muted);
  font-weight: 600;
}

.footer-nav a:hover {
  color: var(--text);
  text-decoration: none;
}

/* Home SEO Section light design */
.hero {
  margin: 28px 0 10px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, #0f1622 0%, #0f1725 100%);
}

.hero h2 { margin: 0 0 10px; color: var(--accent); }
.hero p { margin: 0; line-height: 1.6; color: var(--muted); }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.feature-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #0f1622;
  padding: 14px;
}

.feature-card h3 { margin: 0 0 8px; font-size: 16px; }
.feature-card p { margin: 0; color: var(--muted); line-height: 1.6; }

.faq .q { font-weight: 700; margin-top: 10px; }
.faq .a { color: var(--muted); margin: 4px 0 0; line-height: 1.6; }

@media (max-width: 640px) {
  .site-header .header-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .nav-links {
    flex-wrap: wrap;
    gap: 12px;
  }
}
.status {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #111827;
  color: var(--muted);
  border: 1px dashed var(--border);
}

.results {
  margin-top: 18px;
  display: grid;
  gap: 14px;
}

/* Readability for lists and long text */
.section p { line-height: 1.6; }
.section ul, .section ol {
  margin: 10px 0 0;
  padding-left: 20px;
  line-height: 1.6;
}
.section li { margin: 6px 0; }

.profile {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #0f1622;
}

.profile img {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.meta {
  display: grid;
  gap: 6px;
}

.counts {
  display: flex;
  gap: 12px;
  color: var(--muted);
}

.error { color: var(--danger); }

/* Skeleton Loading */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  position: relative;
  overflow: hidden;
  background: #0f1520;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.10), transparent);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

.skeleton-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 2px solid #2a3747;
}

.skeleton-line {
  height: 14px;
  border-radius: 8px;
}

.skeleton-line.sm { width: 30%; }
.skeleton-line.md { width: 60%; }
.skeleton-line.lg { width: 90%; }

/* Stories Styles */
.stories-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 14px;
  background: #0f1622;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.stories-profile-pic {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
}

.stories-header h3 {
  margin: 0;
  font-size: 18px;
  color: var(--text);
}

.stories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.story-card {
  background: #0f1622;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}

.story-media {
  width: 100%;
  height: 350px;
  object-fit: contain;
  display: block;
  background: #0c141f; /* slightly lighter than pure black for visibility */
}

.story-info {
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.story-type {
  color: var(--accent);
  font-weight: 600;
}

.story-time {
  color: var(--muted);
  font-size: 12px;
}

.skeleton-story {
  height: 400px;
  border-radius: 12px;
  background: #0f1622;
  border: 1px solid var(--border);
}

/* Highlights Styles */
.highlights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.highlight-card {
  background: #0f1622;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s;
}

.highlight-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.highlight-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.highlight-cover {
  width: 100%;
  height: 140px;
  object-fit: cover;
  display: block;
  background: #0c141f;
}

.highlight-title {
  padding: 10px 12px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Carousel */
.carousel {
  position: relative;
}

.carousel-track {
  position: relative;
}

.carousel-item[hidden] { display: none !important; }

.carousel-indicators {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 8px 0 4px;
}

.carousel-indicators button {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: #3a4e6a;
  cursor: pointer;
}

.carousel-indicators button[aria-current="true"] {
  background: var(--accent);
}

.carousel-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(20, 35, 55, 0.75);
  color: #eaf2f9;
  border: 1px solid var(--border);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  backdrop-filter: saturate(1.2) blur(2px);
}

.carousel-prev { left: 8px; }
.carousel-next { right: 8px; }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 9999;
}

.lightbox[hidden] { display: none !important; }

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  width: min(900px, 90vw);
  background: #0f1622;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 44px; /* space for prev/next */
}

.lightbox-media img, .lightbox-media video {
  max-width: 100%;
  max-height: 80vh;
  display: block;
  margin: 0 auto;
  background: #000;
}

.lightbox-close {
  position: absolute;
  top: 6px;
  right: 8px;
  background: #0f1622;
  color: var(--text);
  border: 1px solid var(--border);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
}

.lightbox-prev, .lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 44px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #0f1622;
  color: var(--text);
  cursor: pointer;
}

.lightbox-prev { left: 8px; }
.lightbox-next { right: 8px; }

.highlight-stories-container {
  margin-top: 24px;
}

.highlight-stories-section {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.back-button {
  padding: 10px 16px;
  margin-bottom: 16px;
  border-radius: 8px;
  border: 1px solid #223044;
  background: #0e141d;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.back-button:hover {
  background: #121923;
  border-color: var(--accent);
}

.story-resolution {
  color: var(--muted);
  font-size: 11px;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    max-width: 100%;
  }
  h1 { font-size: 24px; }
  h2 { font-size: 18px; }
  
  .stories-grid {
    grid-template-columns: 1fr;
  }
  
  .highlights-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
  
  .section {
    padding: 16px;
  }
  .footer-nav { gap: 12px; }
  .nav-links a { padding: 8px; }
  
  /* Profile + Skeleton adjustments for mobile */
  .profile {
    grid-template-columns: 64px 1fr;
    gap: 12px;
    padding: 12px;
  }

  .profile img {
    width: 64px;
    height: 64px;
  }

  .skeleton-avatar {
    width: 64px;
    height: 64px;
  }

  .counts {
    flex-wrap: wrap;
    gap: 8px 12px;
    font-size: 13px;
  }

  .skeleton-line {
    height: 12px;
    max-width: 100%;
  }

  .skeleton-line.sm { width: 45%; }
  .skeleton-line.md { width: 70%; }
  .skeleton-line.lg { width: 100%; }

  /* Stories sizing on small screens */
  .stories-header {
    padding: 12px;
    gap: 10px;
  }

  .stories-profile-pic {
    width: 44px;
    height: 44px;
  }

  .story-media {
    height: min(60vw, 320px);
    object-fit: contain;
  }
}


