/*
Theme Name: 拾光书影
Theme URI: https://c0d1.site/
Author: 拾光书影
Description: 面向小说书单与影视资料分享的轻量、阅读优先 WordPress 主题。
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 7.4
Text Domain: shiguang-shuying
*/

:root {
  --color-paper: #fbf8f2;
  --color-surface: #ffffff;
  --color-ink: #29251f;
  --color-muted: #71695e;
  --color-line: #e9e1d5;
  --color-accent: #a94d34;
  --color-accent-dark: #7f3320;
  --color-soft: #f3eadf;
  --shadow-soft: 0 12px 30px rgba(68, 48, 31, 0.07);
  --radius: 14px;
  --content-width: 760px;
  --layout-width: 1160px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.8;
  text-rendering: optimizeLegibility;
}

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

a {
  color: var(--color-accent-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.16em;
}

a:hover {
  color: var(--color-accent);
}

:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
}

button,
input,
textarea,
select {
  color: inherit;
  font: inherit;
}

.site-shell {
  width: min(calc(100% - 40px), var(--layout-width));
  margin-inline: auto;
}

.site-main {
  min-height: 58vh;
  padding-block: 42px 72px;
}

.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;
}

.screen-reader-text:focus {
  top: 10px;
  left: 10px;
  z-index: 100000;
  display: block;
  width: auto;
  height: auto;
  padding: 12px 18px;
  clip: auto !important;
  background: var(--color-surface);
  color: var(--color-ink);
  font-weight: 700;
  white-space: normal;
  box-shadow: var(--shadow-soft);
}

.site-header {
  position: relative;
  z-index: 10;
  border-bottom: 1px solid var(--color-line);
  background: rgba(251, 248, 242, 0.97);
}

.header-inner {
  display: flex;
  min-height: 78px;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.site-branding {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 13px;
}

.custom-logo-link {
  display: flex;
  flex: 0 0 auto;
}

.custom-logo {
  width: auto;
  max-height: 50px;
}

.site-branding-text {
  min-width: 0;
}

.site-title {
  margin: 0;
  font-family: Georgia, "Songti SC", "STSong", serif;
  font-size: clamp(1.35rem, 3vw, 1.65rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.25;
}

.site-title a {
  color: var(--color-ink);
  text-decoration: none;
}

.site-description {
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--color-muted);
  font-size: 0.78rem;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.primary-navigation .menu,
.footer-navigation .menu {
  display: flex;
  margin: 0;
  padding: 0;
  align-items: center;
  gap: 6px;
  list-style: none;
}

.primary-navigation a {
  display: block;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--color-ink);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
}

.primary-navigation a:hover,
.primary-navigation .current-menu-item > a,
.primary-navigation .current-category-ancestor > a {
  background: var(--color-soft);
  color: var(--color-accent-dark);
}

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(48px, 9vw, 100px) 0;
  border-bottom: 1px solid var(--color-line);
  background:
    radial-gradient(circle at 80% 15%, rgba(169, 77, 52, 0.12), transparent 28%),
    linear-gradient(145deg, #fffdf8 0%, #f3eadf 100%);
}

.hero-inner {
  max-width: 800px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--color-accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero h1,
.archive-header h1,
.entry-title,
.section-heading h2 {
  font-family: Georgia, "Songti SC", "STSong", serif;
}

.hero h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(2.15rem, 7vw, 4.35rem);
  letter-spacing: -0.025em;
  line-height: 1.14;
}

.hero-description {
  max-width: 630px;
  margin: 20px 0 0;
  color: #554d43;
  font-size: clamp(1rem, 2.5vw, 1.2rem);
}

.hero-actions {
  display: flex;
  margin-top: 28px;
  flex-wrap: wrap;
  gap: 12px;
}

.button,
.search-submit,
.comment-form input[type="submit"] {
  display: inline-flex;
  min-height: 44px;
  padding: 9px 18px;
  border: 1px solid var(--color-accent-dark);
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  background: var(--color-accent-dark);
  color: #fff;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
}

.button:hover,
.search-submit:hover,
.comment-form input[type="submit"]:hover {
  background: var(--color-accent);
  color: #fff;
}

.button-secondary {
  background: transparent;
  color: var(--color-accent-dark);
}

.section-block + .section-block {
  margin-top: 64px;
}

.section-heading {
  display: flex;
  margin-bottom: 22px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-line);
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2rem);
  line-height: 1.3;
}

.section-heading a {
  flex: 0 0 auto;
  font-size: 0.88rem;
  font-weight: 700;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.post-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  background: var(--color-surface);
  box-shadow: 0 4px 14px rgba(68, 48, 31, 0.04);
}

.post-card-image {
  display: block;
  overflow: hidden;
  aspect-ratio: 3 / 2;
  background: var(--color-soft);
}

.post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 220ms ease;
}

.post-card-image:hover img {
  transform: scale(1.025);
}

.post-card-body {
  padding: 21px;
}

.post-card .entry-title {
  margin: 8px 0 10px;
  font-size: 1.25rem;
  line-height: 1.45;
}

.post-card .entry-title a {
  color: var(--color-ink);
  text-decoration: none;
}

.post-card .entry-title a:hover {
  color: var(--color-accent-dark);
}

.post-card .entry-summary {
  color: #554f46;
  font-size: 0.93rem;
}

.post-card .entry-summary p {
  margin: 0;
}

.entry-meta {
  display: flex;
  color: var(--color-muted);
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 0.78rem;
}

.entry-meta a {
  color: inherit;
}

.category-link {
  font-weight: 700;
}

.archive-header {
  max-width: 780px;
  margin-bottom: 36px;
}

.archive-header h1 {
  margin: 0;
  font-size: clamp(2rem, 6vw, 3.5rem);
  line-height: 1.2;
}

.archive-description {
  margin-top: 14px;
  color: var(--color-muted);
}

.archive-description > :last-child {
  margin-bottom: 0;
}

.breadcrumb {
  margin-bottom: 26px;
  color: var(--color-muted);
  font-size: 0.82rem;
}

.breadcrumb ol {
  display: flex;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
}

.breadcrumb li:not(:last-child)::after {
  margin-left: 6px;
  color: #aaa197;
  content: "/";
}

.breadcrumb a {
  color: inherit;
}

.single-layout {
  max-width: var(--content-width);
  margin-inline: auto;
}

.single-post {
  overflow-wrap: anywhere;
}

.single-post .entry-header {
  margin-bottom: 32px;
}

.single-post .entry-title,
.page .entry-title {
  margin: 8px 0 14px;
  font-size: clamp(2rem, 6vw, 3.55rem);
  letter-spacing: -0.02em;
  line-height: 1.22;
}

.entry-featured-image {
  margin: 0 0 34px;
}

.entry-featured-image img {
  display: block;
  width: 100%;
  border-radius: var(--radius);
}

.entry-content {
  font-family: Georgia, "Songti SC", "STSong", serif;
  font-size: 1.04rem;
}

.entry-content > * {
  max-width: 100%;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
  margin: 2em 0 0.75em;
  line-height: 1.4;
}

.entry-content h2 {
  padding-bottom: 0.35em;
  border-bottom: 1px solid var(--color-line);
  font-size: 1.65rem;
}

.entry-content h3 {
  font-size: 1.35rem;
}

.entry-content p,
.entry-content ul,
.entry-content ol,
.entry-content blockquote {
  margin-top: 0;
  margin-bottom: 1.35em;
}

.entry-content blockquote {
  margin-inline: 0;
  padding: 0.8em 1.25em;
  border-left: 4px solid var(--color-accent);
  background: var(--color-soft);
  color: #4f483f;
}

.entry-content table {
  display: block;
  width: 100%;
  margin-bottom: 1.5em;
  overflow-x: auto;
  border-collapse: collapse;
}

.entry-content th,
.entry-content td {
  padding: 10px 12px;
  border: 1px solid var(--color-line);
  text-align: left;
}

.entry-content pre {
  max-width: 100%;
  padding: 16px;
  overflow: auto;
  border-radius: 8px;
  background: #25211d;
  color: #f8f3eb;
  font-size: 0.85rem;
}

.entry-content figcaption,
.wp-caption-text {
  margin-top: 7px;
  color: var(--color-muted);
  font-size: 0.8rem;
  text-align: center;
}

.entry-footer {
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid var(--color-line);
  color: var(--color-muted);
  font-size: 0.86rem;
}

.entry-footer > div + div {
  margin-top: 8px;
}

.page-links {
  margin: 28px 0;
  font-weight: 700;
}

.post-navigation {
  margin: 40px 0;
  padding: 24px 0;
  border-block: 1px solid var(--color-line);
}

.post-navigation .nav-links {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.post-navigation .nav-next {
  text-align: right;
}

.post-navigation a {
  font-weight: 700;
  text-decoration: none;
}

.related-posts {
  margin-top: 48px;
}

.related-posts h2,
.comments-area h2 {
  font-family: Georgia, "Songti SC", "STSong", serif;
  font-size: 1.5rem;
}

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

.related-list li {
  padding: 13px 0;
  border-bottom: 1px solid var(--color-line);
}

.related-list a {
  color: var(--color-ink);
  font-weight: 700;
  text-decoration: none;
}

.pagination {
  margin-top: 42px;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.page-numbers {
  display: inline-flex;
  min-width: 42px;
  min-height: 42px;
  padding: 5px 10px;
  border: 1px solid var(--color-line);
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  background: var(--color-surface);
  text-decoration: none;
}

.page-numbers.current {
  border-color: var(--color-accent-dark);
  background: var(--color-accent-dark);
  color: #fff;
}

.search-form {
  display: flex;
  width: min(100%, 620px);
  gap: 9px;
}

.search-form label {
  flex: 1 1 auto;
}

.search-field,
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  min-height: 46px;
  padding: 9px 13px;
  border: 1px solid #cfc5b8;
  border-radius: 8px;
  background: var(--color-surface);
}

.not-found {
  max-width: 680px;
  padding: 34px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  background: var(--color-surface);
}

.not-found h1,
.not-found h2 {
  font-family: Georgia, "Songti SC", "STSong", serif;
}

.category-shortcuts {
  display: flex;
  margin: 24px 0 0;
  padding: 0;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
}

.category-shortcuts a {
  display: inline-block;
  padding: 7px 13px;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  background: var(--color-soft);
  font-weight: 700;
  text-decoration: none;
}

.comments-area {
  margin-top: 52px;
}

.comment-list {
  padding-left: 1.25em;
}

.comment-list .comment-body {
  margin-bottom: 20px;
  padding: 18px;
  border: 1px solid var(--color-line);
  border-radius: 10px;
  background: var(--color-surface);
}

.site-footer {
  padding: 42px 0;
  border-top: 1px solid var(--color-line);
  background: #27221d;
  color: #d9d0c5;
  font-size: 0.86rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.footer-brand {
  margin: 0 0 3px;
  color: #fff;
  font-family: Georgia, "Songti SC", "STSong", serif;
  font-size: 1.2rem;
  font-weight: 700;
}

.footer-note,
.site-info {
  margin: 4px 0;
}

.footer-navigation a {
  color: #f5eee6;
}

.alignwide {
  width: min(100vw - 40px, 980px);
  max-width: none;
  margin-left: 50%;
  transform: translateX(-50%);
}

.alignfull {
  width: 100vw;
  max-width: none;
  margin-left: 50%;
  transform: translateX(-50%);
}

@media (max-width: 880px) {
  .header-inner,
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-inner {
    padding-block: 17px;
    gap: 15px;
  }

  .primary-navigation {
    width: 100%;
    overflow-x: auto;
  }

  .primary-navigation .menu {
    width: max-content;
    max-width: none;
  }

  .post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .site-shell {
    width: min(calc(100% - 28px), var(--layout-width));
  }

  .site-main {
    padding-block: 30px 54px;
  }

  .site-description {
    display: none;
  }

  .hero-actions,
  .search-form {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-actions .button,
  .search-submit {
    width: 100%;
  }

  .post-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .post-navigation .nav-links {
    grid-template-columns: minmax(0, 1fr);
  }

  .post-navigation .nav-next {
    text-align: left;
  }

  .not-found {
    padding: 24px;
  }
}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
