/*
Theme Name: LOCPress Silver Edition
Theme URI: https://locpress.com
Author: E. Lopez
Author URI: https://locpress.com
Description: A custom classic WordPress theme for serialized fiction with parent/child chapter navigation.
Version: 1.1
Text Domain: serialized-fiction
*/

:root {
  --sfm-bg: #1A2342;
  --sfm-surface: #223055;
  --sfm-surface-soft: #2a3452;
  --sfm-text: #E4D3B4;
  --sfm-text-soft: #99A4B0;
  --sfm-accent: #C2A368;
  --sfm-accent-2: #818DBB;
  --sfm-border: rgba(228, 211, 180, 0.12);
  --sfm-sidebar-width: 300px;
  --sfm-max-width: 1280px;
  --sfm-content-width: 760px;
  --sfm-radius: 16px;
  --sfm-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  --sfm-font-body: "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --sfm-font-heading: "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--sfm-bg);
  color: var(--sfm-text);
  font-family: var(--sfm-font-body);
  line-height: 1.75;
  font-size: 17px;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--sfm-accent);
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover,
a:focus {
  color: #e0c48d;
}

.site-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(26, 35, 66, 0.92);
  border-bottom: 1px solid var(--sfm-border);
}

.site-header-inner,
.site-main,
.site-footer-inner {
  width: min(calc(100% - 2rem), var(--sfm-max-width));
  margin: 0 auto;
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
}

.branding {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.site-title {
  margin: 0;
  font-family: var(--sfm-font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.site-title a {
  color: var(--sfm-text);
}

.site-description {
  margin: 0;
  color: var(--sfm-text-soft);
  font-size: 0.92rem;
}

.primary-nav ul {
  list-style: none;
  display: flex;
  gap: 1rem;
  margin: 0;
  padding: 0;
}

.primary-nav a {
  color: var(--sfm-text-soft);
  font-weight: 600;
  font-size: 0.95rem;
}

.primary-nav a:hover,
.primary-nav .current-menu-item > a,
.primary-nav .current_page_item > a {
  color: var(--sfm-accent);
}

.site-main {
  flex: 1;
  padding: 2rem 0 3rem;
}

.fiction-layout {
  display: grid;
  grid-template-columns: var(--sfm-sidebar-width) minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
}

.sidebar-panel {
  position: sticky;
  top: 5.5rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border: 1px solid var(--sfm-border);
  border-radius: var(--sfm-radius);
  box-shadow: var(--sfm-shadow);
  padding: 1.25rem;
}

.sidebar-heading {
  margin: 0 0 0.8rem;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sfm-text-soft);
}

.sidebar-book-link {
  display: block;
  margin-bottom: 1rem;
  color: var(--sfm-text);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.35;
}

.chapter-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.chapter-list li {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--sfm-border);
}

.chapter-list li:first-child {
  border-top: 0;
}

.chapter-list a {
  display: block;
  padding: 0.85rem 0;
  color: var(--sfm-text-soft);
  font-size: 0.97rem;
  line-height: 1.4;
}

.chapter-list .current_page_item > a,
.chapter-list .current_page_ancestor > a,
.chapter-list a:hover {
  color: var(--sfm-accent);
}

.content-panel {
  min-width: 0;
}

.entry {
  width: min(100%, var(--sfm-content-width));
  background: transparent;
}

.entry-header {
  margin-bottom: 1.5rem;
}

.entry-kicker {
  margin-bottom: 0.65rem;
  color: var(--sfm-text-soft);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.entry-title {
  margin: 0;
  font-family: var(--sfm-font-heading);
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  color: var(--sfm-text);
}

.entry-meta {
  margin-top: 0.9rem;
  color: var(--sfm-text-soft);
  font-size: 0.96rem;
}

.entry-content {
  color: var(--sfm-text);
  font-size: 1.08rem;
}

.entry-content p {
  margin: 0 0 1.35rem;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
  margin: 2rem 0 1rem;
  font-family: var(--sfm-font-heading);
  line-height: 1.2;
  color: var(--sfm-text);
}

.entry-content blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-left: 3px solid var(--sfm-accent);
  background: rgba(255,255,255,0.03);
  border-radius: 0 12px 12px 0;
}

.entry-content ul,
.entry-content ol {
  padding-left: 1.4rem;
}

.chapter-pagination {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--sfm-border);
}

.chapter-pagination a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.8rem 1rem;
  border: 1px solid var(--sfm-border);
  border-radius: 999px;
  background: rgba(255,255,255,0.02);
  color: var(--sfm-text);
  font-weight: 600;
}

.chapter-pagination a:hover {
  border-color: rgba(194, 163, 104, 0.45);
  color: var(--sfm-accent);
}

.site-footer {
  border-top: 1px solid var(--sfm-border);
  background: rgba(0, 0, 0, 0.12);
}

.site-footer-inner {
  padding: 1.5rem 0 2rem;
  color: var(--sfm-text-soft);
  font-size: 0.95rem;
}

.site-footer a {
  color: var(--sfm-text-soft);
}

.widget {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--sfm-border);
}

.widget-title {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sfm-text-soft);
}

.screen-reader-text {
  position: absolute;
  left: -9999px;
}

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

  .sidebar-panel {
    position: static;
  }

  .entry {
    width: 100%;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 16px;
  }

  .site-header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .primary-nav ul {
    flex-wrap: wrap;
  }

  .chapter-pagination {
    flex-direction: column;
  }
}