/* =============================================================
   WaifuWorld — Top-list article template
   From Shopify assets/ww-blog.css (v1.5)

   IMPORTANT — this is a DARK template. It's the only shop-adjacent
   page that uses the dark neon marketing palette rather than the
   light neutral shop palette (#fafaf8 etc.). Don't "fix" that.

   TOKEN NOTE: the original inherits :root custom properties from
   ww-custom.css and only supplies fallbacks. Since those tokens
   may not exist in the WordPress build, the :root block below
   defines them explicitly. If you already load ww-custom.css and
   it defines these, delete the :root block to avoid duplication.
   ============================================================= */

:root {
  --bg-void:        #04040f;
  --bg-deep:        #0d0b22;
  --bg-mid:         #1a1535;
  --text-primary:   #F0F0FF;
  --text-secondary: #8892A4;
  --text-muted:     #4a5568;
  --accent-cyan:    #00E5FF;
  --accent-pink:    #FF2D78;
  --accent-purple:  #9B5DE5;
  --accent-gold:    #FFD166;
  --border-subtle:  rgba(255, 255, 255, 0.06);
  --border-glow:    rgba(0, 229, 255, 0.25);
}

/* Page background. In WordPress, apply the dark background to the
   article body wrapper instead of relying on :has() — kept here
   for reference. */
/* WordPress constrains direct children of the post-content block to the
   theme's content width (its is-layout-constrained CSS), which left this
   whole template boxed in with white margins on both sides instead of
   running edge to edge. Breaks out of that regardless of viewport width. */
.wp-block-post-content .ww-tl-page {
  max-width: none;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  background: var(--bg-deep);
}

.ww-tl {
  --tl-max: 1080px;
  --tl-text: 760px;
  --tl-radius: 18px;
  /* headline gradients */
  --tl-grad-hero: linear-gradient(104deg, #FFFFFF 0%, #CDE9FF 22%, #00E5FF 42%, #9B5DE5 68%, #FF2D78 92%);
  --tl-grad-head: linear-gradient(100deg, #FFFFFF 0%, #D8CCFF 38%, #FF2D78 78%, #9B5DE5 100%);
  --tl-grad-gold: linear-gradient(100deg, #FFFFFF 0%, #FFE9B0 30%, #FFD166 62%, #FF8A3D 100%);
  color: var(--text-primary);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.ww-tl a { color: inherit; }

/* Reset inherited heading color before applying gradients. In Shopify
   this counteracted the light-palette h1-h3 rules; keep it as a
   safety net in case the WP theme colors headings darkly. */
.ww-tl h1,
.ww-tl h2,
.ww-tl h3 {
  color: var(--text-primary);
  -webkit-text-fill-color: currentColor;
  background: none;
}

.ww-tl a:focus-visible,
.ww-tl button:focus-visible,
.ww-tl summary:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Gradient headlines, applied progressively: if background-clip:text
   isn't supported the solid light color above stays. Keep the
   @supports wrapper — without it, unsupported browsers get
   invisible text. */
.ww-tl .ww-tl-h1,
.ww-tl .ww-tl-h2,
.ww-tl .ww-tl-entry-h,
.ww-tl .ww-tl-cta-h { color: var(--text-primary); }

@supports (-webkit-background-clip: text) or (background-clip: text) {
  .ww-tl .ww-tl-h1 {
    background-image: var(--tl-grad-hero);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
    text-shadow: none;
    filter: drop-shadow(0 10px 34px rgba(0,0,0,0.6));
  }
  .ww-tl .ww-tl-h2,
  .ww-tl .ww-tl-entry-h,
  .ww-tl .ww-tl-cta-h {
    background-image: var(--tl-grad-head);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
  }
  /* #1 entry gets the gold variant instead of pink/purple */
  .ww-tl .ww-tl-entry.is-top .ww-tl-entry-h {
    background-image: var(--tl-grad-gold);
  }
  /* the "#N" prefix keeps a solid tone rather than sampling the gradient */
  .ww-tl .ww-tl-entry-hash {
    background: none;
    -webkit-text-fill-color: currentColor; color: var(--text-muted);
  }
  .ww-tl .ww-tl-entry.is-top .ww-tl-entry-hash {
    color: var(--accent-gold); -webkit-text-fill-color: currentColor;
  }
}

/* ---------- hero ---------- */
.ww-tl-hero {
  position: relative;
  min-height: 62vh;
  display: grid;
  align-items: end;
  background: var(--bg-void);
  overflow: hidden;
}
.ww-tl-hero-media { position: absolute; inset: 0; }
.ww-tl-hero-media img {
  width: 100%; height: 100%; object-fit: cover; object-position: center 30%;
  filter: saturate(1.1);
}
/* Scrim: fades the hero image into the page background so the
   headline stays readable over any image */
.ww-tl-hero::after {
  content: '';
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(4,4,15,0.25) 0%, rgba(4,4,15,0.6) 45%, var(--bg-deep) 100%),
    radial-gradient(60% 50% at 80% 20%, rgba(155,93,229,0.28), transparent 70%);
  pointer-events: none;
}
.ww-tl-hero-inner {
  position: relative; z-index: 1;
  width: 100%; max-width: var(--tl-max);
  margin: 0 auto;
  padding: clamp(120px, 22vh, 220px) 24px 44px;
}
.ww-tl-crumbs { font-size: 13px; color: var(--text-secondary); display: flex; gap: 10px; margin-bottom: 18px; }
.ww-tl-crumbs a { text-decoration: none; }
.ww-tl-crumbs a:hover { color: var(--accent-cyan); }
.ww-tl .ww-tl-h1 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: clamp(34px, 5.4vw, 64px);
  line-height: 1.02;
  letter-spacing: -0.03em;
  max-width: 18ch;
  margin: 0 0 18px;
  text-wrap: balance;
}
.ww-tl-dek {
  max-width: 62ch;
  font-size: clamp(16px, 1.6vw, 19px);
  color: rgba(226,232,255,0.86);
  margin: 0 0 22px;
}
.ww-tl-meta {
  display: flex; flex-wrap: wrap; gap: 10px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 600; font-size: 15px; letter-spacing: 0.04em;
  color: var(--accent-cyan);
  margin: 0;
}
.ww-tl-meta span[aria-hidden] { color: var(--text-muted); }

/* ---------- content column ---------- */
.ww-tl-wrap { max-width: var(--tl-max); margin: 0 auto; padding: 40px 24px 96px; }
.ww-tl-intro { max-width: var(--tl-text); margin: 0 auto 48px; color: rgba(226,232,255,0.9); }
.ww-tl-intro p { margin: 0 0 1.2em; }
.ww-tl-intro h2, .ww-tl-intro h3 { font-family: 'Montserrat', sans-serif; font-weight: 800; }
.ww-tl .ww-tl-h2 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin: 0 0 22px;
  width: fit-content;   /* keeps the gradient tight to the text */
}

/* ---------- "at a glance" jump-list ---------- */
.ww-tl-glance {
  max-width: var(--tl-text);
  margin: 0 auto 72px;
  padding: 28px 24px 22px;
  border-radius: var(--tl-radius);
  background: linear-gradient(180deg, rgba(0,229,255,0.07), rgba(155,93,229,0.05));
  border: 1px solid rgba(0,229,255,0.22);
}
.ww-tl-glance-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
.ww-tl-glance-list a {
  display: flex; align-items: center; gap: 12px;
  min-height: 54px;
  padding: 8px 12px; border-radius: 10px; text-decoration: none;
  background: rgba(255,255,255,0.025);
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.ww-tl-glance-list a:hover { background: rgba(255,255,255,0.06); border-color: var(--border-glow); }
.ww-tl-glance-rank {
  flex: 0 0 30px;
  font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 22px; line-height: 1;
  color: var(--accent-pink);
  text-align: right;
  font-variant-numeric: tabular-nums;  /* keeps 1-10 aligned */
}
.ww-tl-glance-text { min-width: 0; display: grid; gap: 1px; }
.ww-tl-glance-name { font-weight: 600; font-size: 15.5px; line-height: 1.25; }
.ww-tl-glance-series {
  font-size: 12.5px; color: var(--text-secondary); line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ww-tl-method { margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--border-subtle); font-size: 14.5px; color: var(--text-secondary); }

/* ---------- entry ---------- */
.ww-tl-entry {
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr;
  gap: 40px;
  align-items: start;
  margin: 0 0 88px;
  scroll-margin-top: 90px;   /* so #rank-N anchors don't hide under a sticky header */
}
/* Media card is STICKY — it stays in view while the body text
   scrolls past it. This is a defining behavior of the layout. */
.ww-tl-entry-media {
  position: sticky;
  top: 90px;
  aspect-ratio: 4 / 5;   /* fallback for the "media pending" placeholder only;
                            real media overrides this inline — see README */
  border-radius: var(--tl-radius);
  overflow: hidden;
  background:
    radial-gradient(120% 120% at 50% 20%, rgba(155,93,229,0.16), transparent 60%),
    var(--bg-mid);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 30px 80px rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;  /* needed for the rank numeral's absolute positioning */
}
.ww-tl-video, .ww-tl-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ww-tl-media-empty {
  width: 100%; height: 100%; display: grid; place-items: center;
  font-family: 'Rajdhani', sans-serif; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-muted);
  background: repeating-linear-gradient(135deg, rgba(255,255,255,0.03) 0 12px, transparent 12px 24px);
}

/* The signature move: oversized rank numeral bleeding off the
   media card's bottom-left corner. Requires overflow visible on
   the parent OR it clips — note the parent has overflow:hidden,
   so the numeral is deliberately clipped at the card edge. */
.ww-tl .ww-tl-rank {
  position: absolute; left: -6px; bottom: -22px; z-index: 2;
  font-family: 'Rajdhani', sans-serif; font-weight: 700;
  font-size: clamp(120px, 14vw, 190px); line-height: 0.8;
  letter-spacing: -0.06em;
  background-image: linear-gradient(180deg, #fff 0%, var(--accent-pink) 55%, var(--accent-purple) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent;
  filter: drop-shadow(0 6px 24px rgba(255,45,120,0.35));
  pointer-events: none; user-select: none;
}
.ww-tl .ww-tl-entry.is-top .ww-tl-rank {
  background-image: linear-gradient(180deg, #fff 0%, var(--accent-gold) 55%, #ff8a3d 100%);
  filter: drop-shadow(0 6px 28px rgba(255,209,102,0.45));
}
.ww-tl-entry.is-top .ww-tl-entry-media { border-color: rgba(255,209,102,0.4); box-shadow: 0 30px 90px rgba(0,0,0,0.5), 0 0 60px rgba(255,209,102,0.15); }

.ww-tl-entry-body { max-width: 62ch; }
.ww-tl-series {
  margin: 0 0 8px;
  font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 15px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent-cyan);
}
.ww-tl .ww-tl-entry-h {
  font-family: 'Montserrat', sans-serif; font-weight: 900;
  font-size: clamp(30px, 3.6vw, 44px); line-height: 1.02; letter-spacing: -0.03em;
  margin: 0 0 14px;
  width: fit-content;
}
.ww-tl .ww-tl-entry-hash { font-weight: 700; margin-right: 2px; }
.ww-tl-why { font-size: 19px; line-height: 1.5; color: rgba(226,232,255,0.92); margin: 0 0 20px; font-weight: 500; }

/* Stat pills — a <dl> rendered as inline chips */
.ww-tl-stats {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 0 0 22px; padding: 0;
}
.ww-tl-stats div {
  display: inline-flex; gap: 6px; align-items: baseline;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(255,255,255,0.045); border: 1px solid var(--border-subtle);
  font-size: 13.5px; line-height: 1.3;
}
.ww-tl-stats dt { color: var(--text-secondary); font-weight: 500; }
.ww-tl-stats dt::after { content: ':'; }
.ww-tl-stats dd { margin: 0; font-weight: 600; }
.ww-tl-p { margin: 0 0 1.15em; color: rgba(226,232,255,0.88); }

/* Per-entry shop link — no product cards, just a link out */
.ww-tl-shop { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border-subtle); }
.ww-tl-shoplink {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 13px 22px; border-radius: 12px;
  text-decoration: none;
  background: rgba(0,229,255,0.07);
  border: 1px solid rgba(0,229,255,0.3);
  font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 16.5px; letter-spacing: 0.02em;
  color: var(--text-primary);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}
.ww-tl-shoplink:hover { background: rgba(0,229,255,0.14); border-color: rgba(0,229,255,0.55); transform: translateY(-1px); color: var(--text-primary); }
.ww-tl-shoplink-icon { color: var(--accent-cyan); font-size: 18px; line-height: 1; }
/* #1 entry's link switches cyan → gold */
.ww-tl-entry.is-top .ww-tl-shoplink { background: rgba(255,209,102,0.09); border-color: rgba(255,209,102,0.35); }
.ww-tl-entry.is-top .ww-tl-shoplink:hover { background: rgba(255,209,102,0.16); border-color: rgba(255,209,102,0.6); }
.ww-tl-entry.is-top .ww-tl-shoplink-icon { color: var(--accent-gold); }

/* ---------- CTA blocks (mid-list + end) ---------- */
.ww-tl-cta {
  display: flex; align-items: center; justify-content: space-between; gap: 28px;
  margin: 0 0 88px; padding: 30px 34px;
  border-radius: var(--tl-radius);
  background:
    radial-gradient(80% 120% at 0% 50%, rgba(255,45,120,0.22), transparent 60%),
    radial-gradient(60% 120% at 100% 50%, rgba(0,229,255,0.16), transparent 60%),
    var(--bg-mid);
  border: 1px solid rgba(255,255,255,0.08);
}
.ww-tl-cta--end { margin-bottom: 72px; }
.ww-tl .ww-tl-cta-h { margin: 0 0 6px; font-family: 'Montserrat', sans-serif; font-weight: 900; font-size: clamp(22px, 2.6vw, 30px); letter-spacing: -0.02em; line-height: 1.1; width: fit-content; }
.ww-tl-cta-p { margin: 0; color: rgba(226,232,255,0.8); font-size: 15.5px; }
.ww-tl-btn {
  flex-shrink: 0;
  display: inline-flex; align-items: center;
  padding: 15px 28px; border-radius: 12px;
  background: linear-gradient(90deg, #FF2D78, #C71585);
  color: #fff; text-decoration: none;
  font-family: 'Montserrat', sans-serif; font-weight: 900; font-size: 15px;
  box-shadow: 0 6px 22px rgba(255,45,120,0.32);
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}
.ww-tl-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(255,45,120,0.45); color: #fff; }

/* ---------- full ranking table ---------- */
.ww-tl-table-wrap { max-width: var(--tl-text); margin: 0 auto 72px; }
.ww-tl-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.ww-tl-table th, .ww-tl-table td { text-align: left; padding: 12px 12px; border-bottom: 1px solid var(--border-subtle); vertical-align: top; }
.ww-tl-table th { font-family: 'Rajdhani', sans-serif; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 13px; color: var(--text-secondary); }
.ww-tl-table td:first-child { font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 20px; color: var(--accent-pink); width: 60px; }
.ww-tl-table td a { font-weight: 600; text-decoration: none; }
.ww-tl-table td a:hover { color: var(--accent-cyan); }
.ww-tl-table td:nth-child(3) { color: var(--text-secondary); }

/* ---------- FAQ (native <details>, no JS) ---------- */
.ww-tl-faq { max-width: var(--tl-text); margin: 0 auto 72px; }
.ww-tl-faq-item { border-top: 1px solid var(--border-subtle); }
.ww-tl-faq-item:last-child { border-bottom: 1px solid var(--border-subtle); }
.ww-tl-faq-item summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 18px 4px; }
.ww-tl-faq-item summary::-webkit-details-marker { display: none; }
.ww-tl .ww-tl-faq-item summary h3 { margin: 0; font-family: 'Inter', sans-serif; font-weight: 600; font-size: 17px; line-height: 1.4; color: var(--text-primary); }
/* "+" rotates 45° into "×" when open */
.ww-tl-faq-item summary::after { content: '+'; font-family: 'Rajdhani', sans-serif; font-weight: 700; font-size: 26px; line-height: 1; color: var(--accent-cyan); transition: transform 0.2s ease; }
.ww-tl-faq-item[open] summary::after { transform: rotate(45deg); }
.ww-tl-faq-item p { margin: 0 0 20px; padding: 0 4px; color: rgba(226,232,255,0.85); }

/* ---------- related posts ---------- */
.ww-tl-more { max-width: var(--tl-max); margin: 0 auto; }
.ww-tl-more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.ww-tl-more-card {
  position: relative; display: block; aspect-ratio: 16 / 10; border-radius: 14px; overflow: hidden;
  background: var(--bg-mid); border: 1px solid var(--border-subtle);
  text-decoration: none;
}
.ww-tl-more-card img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.6); transition: transform 0.4s ease, filter 0.3s ease; }
.ww-tl-more-card:hover img { transform: scale(1.04); filter: brightness(0.75); }
.ww-tl-more-card span {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 16px;
  background: linear-gradient(180deg, transparent, rgba(4,4,15,0.92));
  font-family: 'Montserrat', sans-serif; font-weight: 800; font-size: 15px; line-height: 1.3;
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  /* Media card stops being sticky and stacks above the text */
  .ww-tl-entry { grid-template-columns: 1fr; gap: 26px; margin-bottom: 72px; }
  .ww-tl-entry-media { position: relative; max-width: 460px; }
  .ww-tl .ww-tl-rank { font-size: clamp(110px, 28vw, 150px); bottom: -18px; }
  .ww-tl-cta { flex-direction: column; align-items: flex-start; padding: 26px; }
  .ww-tl-btn { width: 100%; justify-content: center; }
  .ww-tl-more-grid { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .ww-tl-glance-list { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .ww-tl { font-size: 16px; }
  .ww-tl-hero { min-height: 56vh; }
  .ww-tl-hero-inner { padding: 110px 18px 34px; }
  .ww-tl-wrap { padding: 32px 18px 72px; }
  .ww-tl-glance { padding: 22px 14px 18px; }
  .ww-tl-entry-media { max-width: none; }
  .ww-tl-shoplink { width: 100%; justify-content: center; text-align: center; }
  /* "Why" column dropped on narrow screens */
  .ww-tl-table th:nth-child(4), .ww-tl-table td:nth-child(4) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .ww-tl * { transition: none !important; }
}
