/* ==========================================================================
   Anime Finder Tool Styles
   v1.0.0
   Uses --tbr-dg-* design tokens from tbr-site.css
   ========================================================================== */

/* ── Page Shell ─────────────────────────────────────────────────────────── */

.af-page {
  min-height: 100vh;
}

/* ── Hero ────────────────────────────────────────────────────────────────── */

.af-hero {
  max-width: var(--tbr-dg-content-max, 780px);
  margin: 0 auto;
  padding: 48px 24px 32px;
  text-align: center;
}

.af-hero__title {
  font-family: var(--tbr-dg-font-serif);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--tbr-dg-ink);
  line-height: 1.2;
  margin: 0 0 16px;
}

.af-hero__subtitle {
  font-family: var(--tbr-dg-font-sans);
  font-size: 1.15rem;
  color: var(--tbr-dg-ink-light);
  line-height: 1.55;
  margin: 0 0 12px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.af-hero__byline {
  font-family: var(--tbr-dg-font-sans);
  font-size: 0.9rem;
  color: var(--tbr-dg-ink-muted);
  margin: 0;
}

/* ── Filters ─────────────────────────────────────────────────────────────── */

.af-filters {
  max-width: var(--tbr-dg-site-max, 1200px);
  margin: 0 auto;
  padding: 0 24px 24px;
}

.af-filter-group {
  margin-bottom: 20px;
}

.af-filter-group__label {
  font-family: var(--tbr-dg-font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--tbr-dg-ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 10px;
}

.af-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.af-pill {
  font-family: var(--tbr-dg-font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--tbr-dg-ink-light);
  background: var(--tbr-dg-white);
  border: 1.5px solid var(--tbr-dg-border);
  border-radius: 20px;
  padding: 8px 18px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  line-height: 1;
}

.af-pill:hover {
  border-color: var(--tbr-dg-amber);
  color: var(--tbr-dg-ink);
}

.af-pill.active {
  background: var(--tbr-dg-amber);
  border-color: var(--tbr-dg-amber);
  color: var(--tbr-dg-white, #fff);
  font-weight: 600;
}

/* ── Results Bar ─────────────────────────────────────────────────────────── */

.af-results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  padding: 12px 0;
  border-top: 1px solid var(--tbr-dg-border-light);
}

.af-results-bar__count {
  font-family: var(--tbr-dg-font-sans);
  font-size: 0.95rem;
  color: var(--tbr-dg-ink-light);
  font-weight: 500;
}

.af-results-bar__clear,
.af-no-results__clear {
  font-family: var(--tbr-dg-font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--tbr-dg-amber);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.af-results-bar__clear:hover,
.af-no-results__clear:hover {
  color: var(--tbr-dg-amber-hover);
}

/* ── Card Grid ───────────────────────────────────────────────────────────── */

.af-grid {
  max-width: var(--tbr-dg-site-max, 1200px);
  margin: 0 auto;
  padding: 0 24px 40px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* ── Card ────────────────────────────────────────────────────────────────── */

.af-card {
  background: var(--tbr-dg-white);
  border: 1px solid var(--tbr-dg-border);
  border-radius: var(--tbr-dg-r-lg, 14px);
  padding: 24px;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.af-card:hover {
  box-shadow: 0 4px 20px var(--tbr-dg-shadow-lg);
  transform: translateY(-2px);
}

/* Card header: title + age badge */
.af-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.af-card__title {
  font-family: var(--tbr-dg-font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--tbr-dg-ink);
  line-height: 1.3;
  margin: 0;
}

/* ── Age Badges ──────────────────────────────────────────────────────────── */

.af-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--tbr-dg-font-sans);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  padding: 4px 10px;
  border-radius: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

.af-badge--age-6 {
  background: #E8F5E9;
  color: #2E7D32;
}

.af-badge--age-8 {
  background: #E3F2FD;
  color: #1565C0;
}

.af-badge--age-10 {
  background: #FFF3E0;
  color: #E65100;
}

.af-badge--age-12 {
  background: #FCE4EC;
  color: #C62828;
}

.af-badge--age-14 {
  background: #F3E5F5;
  color: #7B1FA2;
}

.af-badge--age-16 {
  background: #ECEFF1;
  color: #37474F;
}

.af-badge--age-skip {
  background: #FFEBEE;
  color: #B71C1C;
}

/* ── Genre Tags ──────────────────────────────────────────────────────────── */

.af-card__genres {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.af-tag {
  font-family: var(--tbr-dg-font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--tbr-dg-ink-muted);
  background: var(--tbr-dg-cream-deep);
  border-radius: 6px;
  padding: 3px 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Card Body ───────────────────────────────────────────────────────────── */

.af-card__desc {
  font-family: var(--tbr-dg-font-sans);
  font-size: 0.92rem;
  color: var(--tbr-dg-ink-light);
  line-height: 1.6;
  margin: 0 0 14px;
  flex-grow: 1;
}

/* ── Warnings ────────────────────────────────────────────────────────────── */

.af-card__warnings {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.af-warning {
  font-family: var(--tbr-dg-font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  color: #C62828;
  background: #FFEBEE;
  border-radius: 6px;
  padding: 3px 8px;
}

/* ── Card Footer ─────────────────────────────────────────────────────────── */

.af-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--tbr-dg-border-light);
  margin-top: auto;
}

.af-card__episodes {
  font-family: var(--tbr-dg-font-sans);
  font-size: 0.8rem;
  color: var(--tbr-dg-ink-muted);
}

.af-card__streaming {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.af-stream {
  font-family: var(--tbr-dg-font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--tbr-dg-ink-muted);
  background: var(--tbr-dg-border-light);
  border-radius: 4px;
  padding: 2px 6px;
}

/* ── Review Link ─────────────────────────────────────────────────────────── */

.af-card__review {
  display: inline-block;
  font-family: var(--tbr-dg-font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--tbr-dg-amber);
  text-decoration: none;
  margin-top: 10px;
}

.af-card__review:hover {
  color: var(--tbr-dg-amber-hover);
  text-decoration: underline;
}

/* ── No Results ──────────────────────────────────────────────────────────── */

.af-no-results {
  max-width: var(--tbr-dg-content-max, 780px);
  margin: 0 auto;
  padding: 60px 24px;
  text-align: center;
}

.af-no-results__text {
  font-family: var(--tbr-dg-font-sans);
  font-size: 1.1rem;
  color: var(--tbr-dg-ink-light);
  margin: 0 0 16px;
}

/* ── Skip-Tier Card Override ─────────────────────────────────────────────── */

.af-card--skip {
  border-color: #FFCDD2;
  background: #FFFBFB;
}

/* ── Card Image ──────────────────────────────────────────────────────────── */

.af-card__image {
  width: 100%;
  height: 260px;
  border-radius: var(--tbr-dg-r-md, 10px);
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  font-family: var(--tbr-dg-font-serif);
  font-size: 1.8rem;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
}

.af-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.af-card__initials {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.af-card__image--age-6  { background: linear-gradient(135deg, #66BB6A, #43A047); }
.af-card__image--age-8  { background: linear-gradient(135deg, #42A5F5, #1E88E5); }
.af-card__image--age-10 { background: linear-gradient(135deg, #FFA726, #FB8C00); }
.af-card__image--age-12 { background: linear-gradient(135deg, #EF5350, #E53935); }
.af-card__image--age-14 { background: linear-gradient(135deg, #AB47BC, #8E24AA); }
.af-card__image--age-16 { background: linear-gradient(135deg, #78909C, #546E7A); }
.af-card__image--age-skip { background: linear-gradient(135deg, #E53935, #B71C1C); }

/* ── SEO Content ─────────────────────────────────────────────────────────── */

.af-content {
  max-width: var(--tbr-dg-content-max, 780px);
  margin: 0 auto;
  padding: 40px 24px;
}

.af-content h2 {
  font-family: var(--tbr-dg-font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--tbr-dg-ink);
  margin: 0 0 16px;
}

.af-content h3 {
  font-family: var(--tbr-dg-font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--tbr-dg-ink);
  margin: 32px 0 12px;
}

.af-content p {
  font-family: var(--tbr-dg-font-sans);
  font-size: 1rem;
  color: var(--tbr-dg-ink-light);
  line-height: 1.7;
  margin: 0 0 16px;
}

/* ── FAQ ──────────────────────────────────────────────────────────────────── */

.af-faq {
  max-width: var(--tbr-dg-content-max, 780px);
  margin: 0 auto;
  padding: 0 24px 40px;
}

.af-faq h2 {
  font-family: var(--tbr-dg-font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--tbr-dg-ink);
  margin: 0 0 24px;
}

.af-faq .schema-faq-section {
  border-bottom: 1px solid var(--tbr-dg-border-light);
  padding: 16px 0;
}

.af-faq .schema-faq-section:last-child {
  border-bottom: none;
}

.af-faq .schema-faq-question {
  font-family: var(--tbr-dg-font-sans);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--tbr-dg-ink);
  display: block;
  margin: 0 0 8px;
}

.af-faq .schema-faq-answer {
  font-family: var(--tbr-dg-font-sans);
  font-size: 0.95rem;
  color: var(--tbr-dg-ink-light);
  line-height: 1.65;
  margin: 0;
}

/* ── What's Next ─────────────────────────────────────────────────────────── */

.af-whats-next {
  max-width: var(--tbr-dg-content-max, 780px);
  margin: 0 auto;
  padding: 0 24px 40px;
}

.af-whats-next h2 {
  font-family: var(--tbr-dg-font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--tbr-dg-ink);
  margin: 0 0 16px;
}

.af-whats-next ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.af-whats-next li {
  font-family: var(--tbr-dg-font-sans);
  font-size: 0.95rem;
  color: var(--tbr-dg-ink-light);
  line-height: 1.5;
  padding: 10px 0;
  border-bottom: 1px solid var(--tbr-dg-border-light);
}

.af-whats-next li:last-child {
  border-bottom: none;
}

.af-whats-next a {
  color: var(--tbr-dg-amber);
  text-decoration: none;
  font-weight: 600;
}

.af-whats-next a:hover {
  color: var(--tbr-dg-amber-hover);
  text-decoration: underline;
}

/* ── Noscript Fallback ───────────────────────────────────────────────────── */

.af-noscript {
  max-width: var(--tbr-dg-site-max, 1200px);
  margin: 0 auto;
  padding: 40px 24px;
}

.af-noscript-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--tbr-dg-font-sans);
  font-size: 0.9rem;
}

.af-noscript-table th,
.af-noscript-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--tbr-dg-border);
}

.af-noscript-table th {
  font-weight: 600;
  color: var(--tbr-dg-ink);
  background: var(--tbr-dg-cream-deep);
}

/* ── Responsive: Tablet ──────────────────────────────────────────────────── */

@media (max-width: 960px) {
  .af-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .af-card__image {
    height: 220px;
  }
}

/* ── Responsive: Mobile ──────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .af-hero {
    padding: 32px 20px 24px;
  }

  .af-hero__title {
    font-size: 1.8rem;
  }

  .af-hero__subtitle {
    font-size: 1rem;
  }

  .af-filters {
    padding: 0 20px 20px;
  }

  .af-pill {
    font-size: 0.82rem;
    padding: 7px 14px;
  }

  .af-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 0 20px 32px;
  }

  .af-card {
    padding: 20px;
  }

  .af-content,
  .af-faq,
  .af-whats-next {
    padding-left: 20px;
    padding-right: 20px;
  }
}

@media (max-width: 480px) {
  .af-hero__title {
    font-size: 1.5rem;
  }

  .af-pill {
    font-size: 0.78rem;
    padding: 6px 12px;
  }

  .af-card__title {
    font-size: 1.05rem;
  }

  .af-card__image {
    height: 200px;
    font-size: 1.4rem;
  }
}