/*
Theme Name: FICTBASE Demo
Theme URI: https://fictbase.com
Author: FICTBASE
Author URI: https://fictbase.com
Description: Official demo theme for the FICTBASE WordPress plugin.
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: fictbase-demo
Tags: fiction, stories, blog, minimal
*/

/* ── Reset & Base ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --violet:       #7c3aed;
  --violet-dark:  #6d28d9;
  --violet-light: #ede9fe;
  --violet-soft:  #f5f3ff;
  --zinc-900:     #18181b;
  --zinc-800:     #27272a;
  --zinc-700:     #3f3f46;
  --zinc-500:     #71717a;
  --zinc-400:     #a1a1aa;
  --zinc-200:     #e4e4e7;
  --zinc-100:     #f4f4f5;
  --zinc-50:      #fafafa;
  --white:        #ffffff;
  --radius:       0.75rem;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:    0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:    0 8px 32px rgba(0,0,0,.12);
  --nav-height:   64px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--zinc-800);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

.container {
  max-width: 1152px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Site Nav ────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--zinc-200);
  height: var(--nav-height);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  gap: 2rem;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--zinc-900);
  letter-spacing: -.03em;
  text-decoration: none;
  flex-shrink: 0;
}

.site-logo .logo-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--violet);
  border-radius: 8px;
  color: #fff;
  font-size: .85rem;
}

.primary-nav ul {
  display: flex;
  align-items: center;
  gap: .25rem;
}

.primary-nav a {
  display: block;
  padding: .4rem .75rem;
  font-size: .875rem;
  font-weight: 500;
  color: var(--zinc-700);
  border-radius: .5rem;
  transition: background .15s, color .15s;
}

.primary-nav a:hover,
.primary-nav .current-menu-item > a,
.primary-nav .current-page-ancestor > a {
  background: var(--zinc-100);
  color: var(--zinc-900);
}

.nav-cta {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .375rem;
  font-size: .875rem;
  font-weight: 600;
  border-radius: .625rem;
  padding: .5rem 1.125rem;
  border: none;
  cursor: pointer;
  transition: background .15s, box-shadow .15s, transform .1s;
  text-decoration: none;
  line-height: 1.4;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--violet);
  color: #fff;
  box-shadow: 0 2px 8px rgba(124,58,237,.3);
}

.btn-primary:hover {
  background: var(--violet-dark);
  box-shadow: 0 4px 12px rgba(124,58,237,.4);
}

.btn-ghost {
  background: transparent;
  color: var(--zinc-700);
  border: 1px solid var(--zinc-200);
}

.btn-ghost:hover {
  background: var(--zinc-50);
  border-color: var(--zinc-300, #d4d4d8);
}

/* Hamburger */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: .5rem;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: .5rem;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--zinc-700);
  border-radius: 2px;
  transition: all .25s;
}

/* ── Hero ────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--violet-soft) 0%, #fff 60%);
  padding: 6rem 0 5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -120px; right: -120px;
  width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(124,58,237,.12) 0%, transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: var(--violet-light);
  color: var(--violet);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .3rem .8rem;
  border-radius: 999px;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1.1;
  color: var(--zinc-900);
  max-width: 700px;
  margin: 0 auto 1.25rem;
}

.hero p {
  font-size: 1.125rem;
  color: var(--zinc-500);
  max-width: 480px;
  margin: 0 auto 2.25rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: .75rem;
}

.hero-actions .btn {
  padding: .7rem 1.5rem;
  font-size: 1rem;
}

/* ── Section base ────────────────────────────────────────────── */
section { padding: 5rem 0; }
section.alt { background: var(--zinc-50); }

.section-label {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--violet);
  margin-bottom: .75rem;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -.03em;
  color: var(--zinc-900);
  margin-bottom: .5rem;
}

.section-sub {
  font-size: 1rem;
  color: var(--zinc-500);
  margin-bottom: 3rem;
}

/* ── Stories Grid ────────────────────────────────────────────── */
.stories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.story-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid var(--zinc-200);
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  transition: border-color .2s, box-shadow .2s, transform .2s;
  text-decoration: none;
  color: inherit;
}

.story-card:hover {
  border-color: var(--violet);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.story-cover {
  aspect-ratio: 2/3;
  max-height: 220px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--violet-light), #ddd6fe);
  position: relative;
}

.story-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}

.story-card:hover .story-cover img { transform: scale(1.04); }

.story-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  color: var(--violet);
  opacity: .4;
}

.story-body {
  padding: 1rem 1.1rem 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.story-genre {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--violet);
  margin-bottom: .3rem;
}

.story-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--zinc-900);
  line-height: 1.35;
  margin-bottom: .4rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.story-desc {
  font-size: .8rem;
  color: var(--zinc-500);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
  margin-bottom: .75rem;
}

.story-meta {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .72rem;
  color: var(--zinc-400);
  flex-wrap: wrap;
}

.story-status {
  padding: .15rem .5rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.status-ongoing   { background: #dcfce7; color: #16a34a; }
.status-completed { background: #dbeafe; color: #1d4ed8; }
.status-hiatus    { background: #fef9c3; color: #a16207; }

/* ── Features ────────────────────────────────────────────────── */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

.feature-card {
  background: var(--white);
  border: 1px solid var(--zinc-200);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}

.feature-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 1rem;
  background: var(--violet-light);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.feature-title {
  font-size: .9375rem;
  font-weight: 700;
  color: var(--zinc-900);
  margin-bottom: .35rem;
}

.feature-body {
  font-size: .8125rem;
  color: var(--zinc-500);
  line-height: 1.6;
}

/* ── Blog ────────────────────────────────────────────────────── */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.post-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--zinc-200);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
  transition: border-color .2s, box-shadow .2s;
  text-decoration: none;
  color: inherit;
}

.post-card:hover {
  border-color: var(--violet);
  box-shadow: var(--shadow-md);
}

.post-thumb {
  height: 180px;
  background: linear-gradient(135deg, var(--zinc-100), var(--violet-light));
  overflow: hidden;
  position: relative;
}

.post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-body { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; }

.post-category {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--violet);
  margin-bottom: .4rem;
}

.post-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--zinc-900);
  line-height: 1.35;
  margin-bottom: .5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-excerpt {
  font-size: .8125rem;
  color: var(--zinc-500);
  line-height: 1.6;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 1rem;
}

.post-meta {
  font-size: .75rem;
  color: var(--zinc-400);
  display: flex;
  align-items: center;
  gap: .35rem;
}

/* ── Blog Archive ─────────────────────────────────────────────── */
.archive-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 3rem;
  align-items: start;
}

@media (max-width: 768px) { .archive-layout { grid-template-columns: 1fr; } }

.archive-posts { display: flex; flex-direction: column; gap: 2rem; }

.archive-post-card {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.25rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--zinc-100);
  text-decoration: none;
  color: inherit;
}

.archive-post-card:last-child { border-bottom: none; }

.archive-thumb {
  border-radius: .625rem;
  overflow: hidden;
  height: 130px;
  background: var(--zinc-100);
  flex-shrink: 0;
}

.archive-thumb img { width: 100%; height: 100%; object-fit: cover; }

.archive-post-body { display: flex; flex-direction: column; justify-content: center; }

.archive-post-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--zinc-900);
  line-height: 1.3;
  margin-bottom: .4rem;
  transition: color .15s;
}

.archive-post-card:hover .archive-post-title { color: var(--violet); }

.archive-post-excerpt {
  font-size: .875rem;
  color: var(--zinc-500);
  line-height: 1.6;
  margin-bottom: .6rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 600px) {
  .archive-post-card { grid-template-columns: 1fr; }
  .archive-thumb { height: 180px; }
}

/* Sidebar */
.sidebar { display: flex; flex-direction: column; gap: 1.5rem; }

.sidebar-widget {
  border: 1px solid var(--zinc-200);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.widget-title {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--zinc-400);
  margin-bottom: 1rem;
}

/* ── Single Post ─────────────────────────────────────────────── */
.post-single { max-width: 720px; margin: 0 auto; padding: 3rem 1.5rem; }

.post-header { margin-bottom: 2rem; }

.post-header .post-meta { margin-bottom: 1rem; }

.post-header h1 {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -.04em;
  line-height: 1.15;
  color: var(--zinc-900);
  margin-bottom: 1rem;
}

.post-featured-img {
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 2.5rem;
  aspect-ratio: 16/9;
}

.post-featured-img img { width: 100%; height: 100%; object-fit: cover; }

.post-content {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--zinc-700);
}

.post-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--zinc-900);
  margin: 2rem 0 .75rem;
  letter-spacing: -.02em;
}

.post-content h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--zinc-900);
  margin: 1.5rem 0 .5rem;
}

.post-content p { margin-bottom: 1.25rem; }

.post-content ul, .post-content ol {
  margin: 1rem 0 1.25rem 1.5rem;
  list-style: disc;
}

.post-content ol { list-style: decimal; }

.post-content li { margin-bottom: .4rem; }

.post-content a { color: var(--violet); text-decoration: underline; text-underline-offset: 3px; }

.post-content blockquote {
  border-left: 3px solid var(--violet);
  padding: 1rem 1.5rem;
  background: var(--violet-soft);
  border-radius: 0 .5rem .5rem 0;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--zinc-600, #52525b);
}

.post-content code {
  background: var(--zinc-100);
  padding: .15rem .4rem;
  border-radius: .3rem;
  font-size: .875em;
  font-family: 'JetBrains Mono', monospace;
}

.post-content pre {
  background: var(--zinc-900);
  color: #e4e4e7;
  padding: 1.25rem;
  border-radius: .625rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--zinc-100);
}

.post-nav a {
  font-size: .875rem;
  font-weight: 600;
  color: var(--zinc-700);
  transition: color .15s;
}

.post-nav a:hover { color: var(--violet); }

/* ── Page content ────────────────────────────────────────────── */
.page-content { max-width: 720px; margin: 0 auto; padding: 3rem 1.5rem; }

.page-content h1 {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -.04em;
  color: var(--zinc-900);
  margin-bottom: 1.5rem;
}

/* ── Pagination ──────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  margin-top: 3rem;
}

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 .6rem;
  border-radius: .5rem;
  font-size: .875rem;
  font-weight: 500;
  color: var(--zinc-700);
  border: 1px solid var(--zinc-200);
  transition: all .15s;
}

.pagination .page-numbers:hover { border-color: var(--violet); color: var(--violet); }
.pagination .page-numbers.current { background: var(--violet); color: #fff; border-color: var(--violet); }

/* ── 404 ─────────────────────────────────────────────────────── */
.not-found {
  text-align: center;
  padding: 6rem 1.5rem;
}

.not-found .code {
  font-size: 6rem;
  font-weight: 800;
  color: var(--violet-light);
  line-height: 1;
  margin-bottom: 1rem;
}

.not-found h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--zinc-900);
  margin-bottom: .75rem;
}

.not-found p {
  color: var(--zinc-500);
  margin-bottom: 2rem;
}

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer {
  background: var(--zinc-900);
  color: var(--zinc-400);
  padding: 3rem 0 2rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: start;
  margin-bottom: 2rem;
}

.footer-brand .site-logo { color: #fff; }

.footer-tagline {
  font-size: .8125rem;
  color: var(--zinc-500);
  margin-top: .4rem;
  max-width: 260px;
}

.footer-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1.25rem;
  justify-content: flex-end;
}

.footer-nav a {
  font-size: .8125rem;
  color: var(--zinc-400);
  transition: color .15s;
}

.footer-nav a:hover { color: #fff; }

.footer-bottom {
  padding-top: 1.5rem;
  border-top: 1px solid #27272a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
  font-size: .75rem;
  color: var(--zinc-500);
}

.footer-bottom a { color: var(--violet); transition: color .15s; }
.footer-bottom a:hover { color: #a78bfa; }

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .footer-inner { grid-template-columns: 1fr; }
  .footer-nav ul { justify-content: flex-start; }
}

@media (max-width: 768px) {
  .primary-nav { display: none; }
  .primary-nav.is-open { display: block; position: absolute; top: var(--nav-height); left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--zinc-200); padding: 1rem 1.5rem; }
  .primary-nav.is-open ul { flex-direction: column; gap: .25rem; }
  .menu-toggle { display: flex; }
  .nav-cta .btn-ghost { display: none; }
  .hero { padding: 3.5rem 0 3rem; }
  .stories-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .blog-grid { grid-template-columns: 1fr; }
}
