/**
 * SEO Landing Page — Hero, Breadcrumb, TOC
 * Hero section, overlay mode, quick stats, breadcrumb, sticky TOC tabs.
 */

/* ========================================
   Breadcrumb — Pill Style
   ======================================== */
.seo-breadcrumb-sticky {
  width: 100%;
  position: sticky;
  top: 56px;
  z-index: 100;
  background: var(--ap-surface-card, rgba(31, 36, 48, 0.85));
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--seo-border);
  padding: 0.625rem 0;
}

.seo-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  flex-wrap: nowrap;
  color: var(--seo-text-muted);
  font-family: var(--font-body);
  min-width: 0;
}

.seo-breadcrumb a {
  color: var(--seo-text-muted);
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border-radius: var(--seo-radius-pill);
  transition: color 0.2s, background 0.2s;
}

.seo-breadcrumb a:hover {
  color: var(--seo-text-primary);
  background: hsla(0 0% 100% / 0.06);
}

.seo-breadcrumb .separator {
  color: var(--seo-text-dim);
}

/* FIX(Bug5): ellipsis on .current child only, not flex parent */
.seo-breadcrumb .current {
  color: var(--seo-text-secondary);
  font-weight: 500;
  background: hsla(0 0% 100% / 0.04);
  padding: 0.25rem 0.625rem;
  border-radius: var(--seo-radius-pill);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* ========================================
   Hero Section — Premium with Art Overlay
   ======================================== */
.seo-hero {
  width: 100%;
  position: relative;
  padding: 4rem 0 3rem;
  overflow: clip;
}

.seo-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, var(--seo-bg-deep) 0%, transparent 20%, transparent 85%, var(--seo-bg-deep) 100%);
  z-index: 1;
}

/* Art background image */
.seo-hero-art {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.18;
}

/* Overlay hero mode (with custom hero image) */
.seo-hero--has-image {
  min-height: 380px;
  display: flex;
  align-items: flex-end;
  padding: 0;
}

.seo-hero--has-image .seo-hero-art {
  opacity: 0.65;
  filter: none;
}

.seo-hero--has-image::before {
  background:
    linear-gradient(
      to top,
      hsla(220 100% 4% / 0.97) 0%,
      hsla(220 100% 4% / 0.75) 25%,
      hsla(220 100% 4% / 0.3) 55%,
      hsla(220 100% 4% / 0.1) 75%,
      transparent 100%
    );
}

.seo-hero--has-image > .container {
  padding-bottom: 2.5rem;
  padding-top: 6rem;
  text-align: center;
}

.seo-hero--has-image .seo-hero-title {
  text-shadow: 0 2px 24px hsla(0 0% 0% / 0.6);
  margin-bottom: 1rem;
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}

/* Inline KPI bar on hero overlay */
.seo-hero-kpi-bar {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 0.75rem;
}

.seo-kpi-item {
  display: inline-flex;
  align-items: baseline;
  gap: 0.375rem;
  font-size: 0.875rem;
  color: var(--seo-text-secondary);
}

.seo-kpi-value {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--seo-text-primary);
  font-variant-numeric: tabular-nums;
}

.seo-kpi-label {
  font-size: 0.75rem;
  color: var(--seo-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.seo-kpi-sep {
  color: hsla(0 0% 100% / 0.25);
  font-size: 1.125rem;
  line-height: 1;
}

.seo-kpi-date {
  font-size: 0.8125rem;
  color: var(--seo-text-muted);
}

/* Editorial zone below overlay hero */
.seo-hero-editorial {
  background: var(--seo-bg-deep);
  padding: 2.5rem 0 1.5rem;
}

.seo-hero-editorial .seo-hero-intro {
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
  font-size: 1.0625rem;
  line-height: 1.85;
  color: var(--seo-text-secondary);
}

.seo-hero-editorial .seo-hero-intro p {
  margin: 0 0 1rem;
  color: var(--seo-text-secondary);
}

.seo-hero-editorial .seo-hero-intro p:last-child {
  margin-bottom: 0;
}

/* Horizontal TOC bar */
.seo-hero-toc-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  max-width: 760px;
  margin: 2rem auto 0;
  padding: 0.875rem 0;
  border-top: 1px solid var(--seo-border);
}

.seo-toc-bar-label {
  font-family: var(--font-heading);
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--seo-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: 0.5rem;
}

.seo-toc-bar-link {
  display: inline-flex;
  align-items: center;
  color: var(--seo-text-muted);
  text-decoration: none;
  font-size: 0.8125rem;
  padding: 0.375rem 0.75rem;
  border-radius: var(--seo-radius-pill);
  border: 1px solid transparent;
  transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.seo-toc-bar-link:hover,
.seo-toc-bar-link.active {
  color: var(--seo-accent);
  background: var(--seo-accent-bg);
  border-color: hsla(165 100% 45% / 0.15);
}

.seo-hero > .container {
  position: relative;
  z-index: 2;
}

/* Atmospheric orbs */
.seo-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 15% 85%, hsla(165 100% 45% / 0.05) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 15%, hsla(220 80% 50% / 0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 1;
}

/* Hero Badges */
.seo-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.seo-badge-theme {
  background: hsla(165 100% 45% / 0.2);
  color: hsl(165 100% 65%);
  border: 1px solid hsla(165 100% 45% / 0.3);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.75rem;
  padding: 0.375rem 0.875rem;
  border-radius: var(--seo-radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.seo-badge-count,
.seo-badge-year {
  background: hsla(0 0% 100% / 0.1);
  border: 1px solid hsla(0 0% 100% / 0.18);
  color: var(--seo-text-primary);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.375rem 0.75rem;
  border-radius: var(--seo-radius-pill);
}

.seo-badge-etf {
  background: hsla(165 80% 45% / 0.15);
  color: var(--seo-accent);
  font-size: 0.625rem;
  font-weight: 700;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  text-transform: uppercase;
  font-family: var(--font-mono);
}

.seo-hero-title {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 4.5vw, 2.75rem);
  font-weight: 700;
  color: var(--seo-text-primary);
  line-height: 1.15;
  margin: 0 0 1.5rem;
  letter-spacing: -0.02em;
}

/* Quick Stats Bar */
.seo-quick-stats {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 1.125rem 1.75rem;
  background: hsla(0 0% 100% / 0.06);
  border: 1px solid hsla(0 0% 100% / 0.12);
  border-radius: var(--seo-radius);
  margin-bottom: 2rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.seo-stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.seo-stat + .seo-stat {
  padding-left: 1.5rem;
  border-left: 1px solid hsla(0 0% 100% / 0.1);
}

.seo-stat-value {
  font-family: var(--font-mono);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--seo-text-primary);
  font-variant-numeric: tabular-nums;
}

.seo-quick-stats .seo-perf-positive {
  text-shadow: 0 0 16px hsla(165 100% 45% / 0.35);
}

/* KPI inside hero grid */
.seo-hero-intro-grid .seo-quick-stats {
  margin-bottom: 0;
}

.seo-stat-label {
  font-size: 0.6875rem;
  color: var(--seo-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-body);
}

.seo-stat-value-sm {
  font-size: 1.125rem !important;
}

.seo-hero-intro-grid {
  display: block;
}

/* Content boxes — Dark readable style */
.seo-hero-intro {
  background: var(--seo-bg-card);
  border: 1px solid var(--seo-border);
  border-radius: var(--seo-radius-lg);
  padding: 1.5rem 1.75rem;
  color: var(--seo-text-secondary);
  font-size: 1rem;
  line-height: 1.8;
}

.seo-hero-intro p {
  margin: 0 0 0.875rem;
  color: var(--seo-text-secondary);
}

.seo-hero-intro strong {
  color: var(--seo-text-primary);
}

/* Links in dark content sections */
.seo-hero-intro a,
.seo-section-content a,
.seo-conclusion-text a {
  color: var(--seo-accent);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px dotted var(--seo-accent-dim);
  transition: color 0.15s, border-color 0.15s;
}

.seo-hero-intro a:hover,
.seo-section-content a:hover,
.seo-conclusion-text a:hover {
  color: var(--seo-accent);
  border-bottom-color: var(--seo-accent);
}

/* Hero TOC sidebar (legacy — hidden, replaced by sticky tabs) */
.seo-hero-toc {
  display: none;
}

/* ========================================
   Sticky Underline-Tab TOC Navigation
   ======================================== */
.seo-toc-tabs-sticky {
  position: sticky;
  top: 96px;
  z-index: 99;
  background: var(--ap-surface-card, rgba(31, 36, 48, 0.85));
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--seo-border);
  padding: 0;
  display: flex;
  align-items: center;
}

.seo-toc-tabs-sticky .container {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.seo-toc-tabs-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--seo-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  flex-shrink: 0;
  padding: 0.75rem 0;
}

.seo-toc-tabs {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.seo-toc-tabs::-webkit-scrollbar { display: none; }

.seo-toc-tab {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: var(--font-body);
  color: var(--seo-text-muted);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  transition: color 200ms, border-color 200ms;
}

.seo-toc-tab:hover {
  color: var(--seo-text-primary);
  text-decoration: none;
}

.seo-toc-tab.active {
  color: var(--seo-accent);
  border-bottom-color: var(--seo-accent);
  font-weight: 600;
}

/* First tab active by default until JS sets scroll-based active */
.seo-toc-tab:first-child {
  color: var(--seo-accent);
  border-bottom-color: var(--seo-accent);
  font-weight: 600;
}

.seo-toc-tabs.js-active .seo-toc-tab:first-child {
  color: var(--seo-text-muted);
  border-bottom-color: transparent;
  font-weight: 500;
}

.seo-toc-tabs.js-active .seo-toc-tab:first-child.active {
  color: var(--seo-accent);
  border-bottom-color: var(--seo-accent);
  font-weight: 600;
}

/* TOC (Desktop Only) — legacy */
.seo-toc {
  display: none;
}

/* ========================================
   Video Section
   ======================================== */
.seo-video-container {
  max-width: 720px;
  margin: 2rem auto;
}

.seo-video-title {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--seo-text-primary);
  margin-bottom: 0.75rem;
  text-align: center;
}

.seo-video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: var(--seo-radius);
  box-shadow: 0 4px 16px hsla(0 0% 0% / 0.3);
}

.seo-video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.seo-video-text {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--seo-text-muted);
  line-height: 1.5;
}

.seo-video-section {
  margin-bottom: 2.5rem;
}

.seo-video-embed {
  border-radius: var(--seo-radius);
  overflow: hidden;
  box-shadow: 0 4px 16px hsla(0 0% 0% / 0.3);
}
