/* NSFWAIList — Purple Palette & Category Card Layout */
:root {
  color-scheme: dark;
  --nai-max: 1240px;
  --nai-gutter: 20px;

  /* Dark Charcoal & Purplish Palette */
  --bg: #141418;
  --header-bg: #19191E;
  --cat-card-bg: #28292F;
  --cat-card-head: #202127;
  --cat-card-border: #55565F;
  --cat-card-title: #F4F4F5;
  --cat-card-desc: #C5C5CD;

  --accent: #6D28D9;
  --accent-hover: #5B21B6;
  --lavender: #A78BFA;

  --card: #1F2026;
  --ink: #F4F4F5;
  --muted: #A1A1AA;
  --line: #34353E;
  --soft: #282931;
  --shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  --radius: 10px;

  --nai-h1-size: 30px;
  --nai-h2-size: 22px;
  --nai-h3-size: 18px;
  --nai-h4-size: 16px;
  --nai-h5-size: 15px;
  --nai-h6-size: 14px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; }

.nai-container {
  width: 100%;
  max-width: var(--nai-max);
  margin-inline: auto;
  padding-inline: var(--nai-gutter);
}

/* Header (#19191E) */
.site-header {
  background: var(--header-bg);
  color: #F4F4F5;
  border-bottom: 1px solid #2A2B33;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}
.header-inner {
  min-height: 74px;
  display: flex;
  align-items: center;
  gap: 22px;
}
.brand {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.8px;
  line-height: 1;
}
.brand-main, .footer-brand { color: #F4F4F5; }
.brand-main span, .footer-brand span { color: var(--lavender); }
.brand .custom-logo-link { display: flex; align-items: center; }
.brand img.custom-logo { display: block; width: auto; max-width: 280px; max-height: 54px; object-fit: contain; }

.primary-nav { flex: 1; min-width: 0; }
.primary-nav ul {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.primary-nav a {
  display: inline-flex;
  align-items: center;
  color: #E4E4E7;
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  transition: color 0.15s ease;
}
.primary-nav a:hover { color: var(--lavender); }
.nai-menu-icon {
  display: inline-flex;
  width: 16px;
  height: 16px;
  margin-right: 7px;
  align-items: center;
  justify-content: center;
  color: var(--lavender);
}
.nai-menu-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.header-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; margin-left: auto; }
.theme-toggle, .menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid #3A3B45;
  border-radius: 50%;
  background: #25262E;
  color: #F4F4F5;
  cursor: pointer;
  font-size: 19px;
  line-height: 1;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.theme-toggle:hover, .menu-toggle:hover { border-color: var(--lavender); background: #2F303B; }
.theme-toggle-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.menu-toggle { display: none; border-radius: 7px; }

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* Header Side Search */
.header-search { flex: 0 1 240px; min-width: 170px; }
.header-search .search-form {
  display: flex;
  align-items: center;
  width: 100%;
  height: 36px;
  background: #25262E;
  border: 1px solid #3A3B45;
  border-radius: 999px;
  padding: 0 6px 0 13px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.header-search .search-form:focus-within {
  border-color: var(--lavender);
  box-shadow: 0 0 0 2px rgba(167, 139, 250, 0.2);
}
.header-search .search-field {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #F4F4F5;
  font-size: 13px;
  outline: none;
}
.header-search .search-field::placeholder { color: #A1A1AA; }
.header-search .search-field::-webkit-search-cancel-button { -webkit-appearance: none; }
.header-search .search-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #FFFFFF;
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease;
}
.header-search .search-submit:hover { background: var(--accent-hover); }
.header-search .search-submit svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Search Results Page */
.nai-search-section { margin-bottom: 28px; }
.nai-search-section > h2 { font-size: 19px; margin: 0 0 14px; color: var(--ink); }
.nai-search-category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.nai-search-category-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  background: var(--cat-card-bg);
  border: 1.5px solid var(--cat-card-border);
  border-radius: 10px;
  color: var(--cat-card-title);
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.nai-search-category-card:hover {
  border-color: var(--lavender);
  color: var(--lavender);
  transform: translateY(-2px);
}
.nai-search-category-top { display: flex; align-items: center; gap: 8px; }
.nai-search-category-name { font-weight: 700; font-size: 14px; }
.nai-search-category-description { margin: 0; font-size: 12px; color: var(--cat-card-desc); line-height: 1.4; }

/* Main Area */
.site-main { min-height: 62vh; padding: 24px 0 54px; }
.page-container { min-width: 0; }

/* Hero */
.hero {
  text-align: center;
  padding: 14px 10px 22px;
}
.hero h1 {
  font-size: var(--nai-h1-size);
  line-height: 1.2;
  margin: 0 0 8px;
  font-weight: 800;
  color: var(--ink);
}
.hero p {
  max-width: 720px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 15px;
}

/* Homepage Category Cards (#28292F with #55565F border & #A78BFA accents) */
.home-directory { width: 100%; margin: 10px 0 32px; }
.home-category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
  width: 100%;
}
@media (min-width: 1024px) {
  .home-category-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.home-category-panel {
  min-width: 0;
  background: var(--cat-card-bg);
  color: var(--cat-card-title);
  border: 1.5px solid var(--cat-card-border);
  border-radius: 11px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 12px rgba(24, 24, 27, 0.12);
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.home-category-panel:hover {
  border-color: var(--lavender);
  transform: translateY(-2px);
}

.home-category-header {
  position: relative;
  background: var(--cat-card-head);
  padding: 13px 12px 11px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.home-category-title-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  max-width: 100%;
  color: var(--cat-card-title);
  text-decoration: none;
}
.home-category-title-link:hover { color: var(--lavender); }
.home-category-icon {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  object-fit: contain;
  border-radius: 5px;
}
.home-category-header h2 {
  font-size: 14.5px;
  line-height: 1.25;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-weight: 700;
  margin: 0;
  color: inherit;
}
.home-category-accent-bar {
  display: block;
  width: 44px;
  height: 3px;
  margin: 8px auto 0;
  border-radius: 999px;
  background: var(--lavender);
}

.home-category-description {
  font-size: 12px;
  line-height: 1.4;
  color: var(--cat-card-desc);
  text-align: center;
  padding: 10px 14px 6px;
}

.home-category-sites {
  list-style: none;
  margin: 0;
  padding: 4px 13px 13px;
}
.home-category-sites li {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-width: 0;
  padding: 4px 0;
  font-size: 13px;
  line-height: 1.35;
  white-space: nowrap;
}
.home-rank-num {
  color: #A1A1AA;
  font-size: 12px;
  min-width: 18px;
  text-align: right;
  flex: 0 0 18px;
}
.home-category-sites .home-category-empty {
  color: var(--cat-card-desc);
  white-space: normal;
  justify-content: center;
  padding: 12px 0;
}

.home-site-logo {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  object-fit: contain;
  border-radius: 50%;
  background: #fff;
}
.home-site-logo-fallback {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.home-site-external {
  color: var(--cat-card-title);
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.home-site-external:hover { color: var(--lavender); }

/* Homepage Editorial */
.nai-home-editorial {
  width: 100%;
  max-width: var(--nai-max);
  margin: 30px auto 0;
  padding: 22px 24px;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-size: 15px;
  line-height: 1.7;
}
.nai-home-editorial > *:first-child { margin-top: 0; }
.nai-home-editorial > *:last-child { margin-bottom: 0; }
.nai-home-editorial a:link, .nai-home-editorial a:visited { color: var(--accent); font-weight: 600; }
.nai-home-editorial a:hover { color: var(--accent-hover); text-decoration: underline; }

/* Breadcrumbs & Category Header */
.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12.5px;
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--accent); }

.archive-header, .nai-category-header {
  margin-bottom: 22px;
  padding: 20px 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.archive-header h1, .nai-category-header h1 {
  margin: 0 0 10px;
  color: var(--ink);
}
.term-description {
  max-width: 920px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}
.term-description p:first-child { margin-top: 0; }
.term-description p:last-child { margin-bottom: 0; }
.term-description a { color: var(--accent); font-weight: 600; }
.term-description a:hover { color: var(--accent-hover); text-decoration: underline; }

/* Category-Page Listing Cards (3-column grid, top preview, title, long/full excerpt, purple Visit Site button) */
.nai-category-listing .featured-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}
.nai-category-site-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.nai-category-site-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 6px 18px rgba(109, 40, 217, 0.14);
}
.nai-category-card-image-wrap {
  display: block;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.nai-category-card-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--soft);
  overflow: hidden;
}
.nai-category-card-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.nai-category-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  font-weight: 800;
  color: var(--accent);
}
.nai-category-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  padding: 16px;
  background: var(--soft);
}
.nai-category-card-title {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 800;
  color: var(--ink);
}
.nai-category-card-title a:hover { color: var(--accent); }
.nai-category-card-excerpt {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}
.nai-category-card-actions {
  margin-top: auto;
  display: flex;
  align-items: center;
}
.nai-visit-site-btn, .nai-home-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 7px;
  background: var(--accent);
  color: #FFFFFF !important;
  font-size: 13px;
  font-weight: 700;
  transition: background 0.15s ease;
}
.nai-visit-site-btn:hover, .nai-home-button:hover {
  background: var(--accent-hover);
  color: #FFFFFF !important;
}

/* Blog & Pages */
.article-single {
  background: var(--card);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-wrap: anywhere;
}
.article-single h1 { margin-top: 0; }
.entry-content a:link, .entry-content a:visited { color: var(--accent); font-weight: 600; }
.entry-content a:hover { color: var(--accent-hover); text-decoration: underline; }
.blog-list-grid, .post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.article-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.article-card h2 { font-size: 17px; margin: 0 0 6px; }
.meta { color: var(--muted); font-size: 12px; margin-bottom: 10px; }
.blog-card-thumbnail { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; margin-bottom: 10px; }
.blog-single-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; }
.blog-single-sidebar { display: grid; gap: 16px; }
.blog-sidebar-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.blog-sidebar-box h3 { margin: 0 0 10px; font-size: 17px; }
.blog-sidebar-box p { font-size: 13px; color: var(--muted); }
.blog-directory-button {
  display: block;
  text-align: center;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff !important;
  font-weight: 700;
}
.blog-directory-button:hover { background: var(--accent-hover); }
.blog-related-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.blog-related-list li { padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.blog-related-list li:last-child { border-bottom: 0; padding-bottom: 0; }

.nai-empty-category, .nai-not-found-inner {
  padding: 36px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
}
.nai-not-found-code { font-size: 56px; font-weight: 900; color: var(--accent); line-height: 1; }
.pagination, .nai-pagination { margin: 25px 0; }
.pagination .page-numbers {
  display: inline-block;
  background: var(--card);
  border: 1px solid var(--line);
  padding: 8px 12px;
  margin: 2px;
  border-radius: 6px;
}
.pagination .current { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Footer (#19191E) */
.site-footer {
  background: var(--header-bg);
  color: #D4D4D8;
  border-top: 1px solid #2A2B33;
  padding: 36px 0 20px;
}
.footer-inner { text-align: center; }
.footer-logo { display: flex; justify-content: center; align-items: center; margin: 0 auto 12px; }
.footer-logo img.custom-logo { max-width: 230px; max-height: 54px; object-fit: contain; }
.footer-brand { font-size: 22px; font-weight: 900; }
.footer-description { max-width: 680px; margin: 0 auto; color: #A1A1AA; font-size: 14px; }
.footer-description a { color: var(--lavender); }
.site-footer nav ul {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
  list-style: none;
  padding: 0;
  margin: 14px 0;
}
.site-footer nav a { font-size: 13px; color: #E4E4E7; }
.site-footer nav a:hover { color: var(--lavender); }
.footer-bottom {
  border-top: 1px solid #2E2F38;
  margin-top: 20px;
  padding-top: 15px;
  color: #A1A1AA;
  font-size: 12px;
}

/* Heading Scale */
.site-main :is(.hero h1, .archive-header h1, .nai-category-header h1, .article-single h1) {
  font-size: var(--nai-h1-size) !important;
  line-height: 1.2 !important;
  font-weight: 800 !important;
}
.site-main :is(.entry-content, .term-description) h2 {
  font-size: var(--nai-h2-size) !important;
  line-height: 1.3 !important;
}
.site-main :is(.entry-content, .term-description) h3 {
  font-size: var(--nai-h3-size) !important;
  line-height: 1.35 !important;
}

/* Responsive Breakpoints */
@media (max-width: 900px) {
  :root { --nai-gutter: 16px; }
  .menu-toggle { display: inline-flex; }
  .primary-nav { display: none; width: 100%; flex-basis: 100%; }
  .primary-nav.is-open { display: block; }
  .header-inner { flex-wrap: wrap; padding-block: 10px; }
  .primary-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .primary-nav li { border-top: 1px solid #2E2F38; }
  .primary-nav a { display: flex; width: 100%; padding: 11px 3px; }
  .home-category-grid, .nai-search-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .header-search { flex: 1 1 180px; }
  .nai-category-listing .featured-list, .blog-list-grid, .post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .blog-single-layout { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  :root { --nai-gutter: 12px; --nai-h1-size: 25px; --nai-h2-size: 20px; }
  .site-main { padding: 18px 0 36px; }
  .home-category-grid, .nai-search-category-grid { grid-template-columns: 1fr; gap: 12px; }
  .header-search { min-width: 130px; max-width: 170px; }
  .home-category-sites li { font-size: 14.5px; padding: 4px 0; }
  .home-site-external { font-size: 14.5px; }
  .nai-category-listing .featured-list {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
