/*
Theme Name: Jianyue Novel Theme
Theme URI: https://example.com/jianyue-novel-theme
Author: Jianyue
Author URI: https://example.com
Description: A minimal English novel library and reading theme designed for Jianyue Novel Manager.
Version: 1.2.0
Requires at least: 6.2
Requires PHP: 7.4
Text Domain: jianyue-novel-theme
License: GPL-2.0-or-later
*/

:root {
  --jy-background: #f5f1e8;
  --jy-paper: #fffdf8;
  --jy-ink: #26231f;
  --jy-muted: #746e64;
  --jy-line: #ddd5c7;
  --jy-accent: #8b4d32;
  --jy-accent-dark: #6f3825;
  --jy-width: 1160px;
  --jy-radius: 5px;
  --jy-shadow: 0 22px 64px rgba(50, 36, 28, .10);
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--jy-ink);
  background: var(--jy-background);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
}

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

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

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

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

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

.screen-reader-text:focus,
.skip-link:focus {
  z-index: 100000;
  top: 8px;
  left: 8px;
  width: auto;
  height: auto;
  padding: 10px 16px;
  clip: auto;
  color: #fff;
  background: var(--jy-accent);
}

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

.jy-site-header {
  border-bottom: 1px solid rgba(120, 105, 91, .16);
}

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

.jy-brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.custom-logo-link img {
  width: 36px;
  max-height: 36px;
  object-fit: contain;
}

.jy-site-title {
  color: var(--jy-ink);
  font-family: Georgia, 'Songti SC', serif;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: .08em;
  text-decoration: none;
}

.jy-site-nav ul {
  display: flex;
  align-items: center;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.jy-site-nav a {
  color: var(--jy-muted);
  font-size: 14px;
  text-decoration: none;
}

.jy-site-nav a:hover,
.jy-site-nav .current-menu-item > a {
  color: var(--jy-ink);
}

.jy-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(78px, 12vw, 150px) 0 clamp(72px, 10vw, 124px);
  border-bottom: 1px solid var(--jy-line);
}

.jy-hero::after {
  position: absolute;
  top: 12%;
  right: -4vw;
  width: clamp(180px, 28vw, 420px);
  aspect-ratio: 3 / 4;
  border: 1px solid rgba(139, 77, 50, .18);
  border-radius: 50% 50% 6px 6px;
  content: '';
  transform: rotate(8deg);
}

.jy-hero-content {
  position: relative;
  z-index: 1;
  max-width: 780px;
}

.jy-eyebrow {
  margin: 0 0 16px;
  color: var(--jy-accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.jy-hero h1 {
  max-width: 12ch;
  margin: 0;
  font-family: Georgia, 'Songti SC', serif;
  font-size: clamp(48px, 8vw, 102px);
  font-weight: 600;
  letter-spacing: -.035em;
  line-height: 1.08;
}

.jy-hero-description {
  max-width: 52ch;
  margin: 26px 0 0;
  color: var(--jy-muted);
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.9;
}

.jy-banner {
  position: relative;
  overflow: hidden;
  color: #fff;
  background: #312923;
}

.jy-banner__viewport {
  display: grid;
}

.jy-banner__slide {
  position: relative;
  visibility: hidden;
  min-height: clamp(520px, 68vw, 760px);
  grid-area: 1 / 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms cubic-bezier(.23, 1, .32, 1), visibility 300ms linear;
}

.jy-banner__slide.is-active {
  visibility: visible;
  z-index: 1;
  opacity: 1;
  pointer-events: auto;
}

.jy-banner__media,
.jy-banner__scrim {
  position: absolute;
  inset: 0;
}

.jy-banner__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.jy-banner__scrim {
  background: linear-gradient(90deg, rgba(25, 20, 17, .82) 0%, rgba(25, 20, 17, .48) 52%, rgba(25, 20, 17, .18) 100%);
}

.jy-banner__content {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: inherit;
  align-items: flex-start;
  flex-direction: column;
  justify-content: flex-end;
  padding-top: 112px;
  padding-bottom: 116px;
}

.jy-banner__eyebrow {
  margin: 0 0 14px;
  color: #f0c8b2;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.jy-banner h1 {
  max-width: 14ch;
  margin: 0;
  font-family: Georgia, 'Songti SC', serif;
  font-size: clamp(46px, 7vw, 92px);
  font-weight: 600;
  letter-spacing: -.035em;
  line-height: 1.04;
  text-wrap: balance;
}

.jy-banner__description {
  max-width: 56ch;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, .84);
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.75;
  text-wrap: pretty;
}

.jy-banner__button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  gap: 9px;
  margin-top: 28px;
  padding: 0 22px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 999px;
  color: #fff;
  background: rgba(31, 24, 20, .22);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: color 160ms ease-out, background 160ms ease-out, transform 120ms ease-out;
}

.jy-banner__button:hover,
.jy-banner__button:focus-visible {
  color: var(--jy-ink);
  background: #fff;
}

.jy-banner__button:active,
.jy-banner__arrow:active {
  transform: scale(.97);
}

.jy-banner__controls {
  position: absolute;
  z-index: 3;
  right: 0;
  bottom: 32px;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  pointer-events: none;
}

.jy-banner__arrow,
.jy-banner__dots button {
  border: 1px solid rgba(255, 255, 255, .55);
  color: #fff;
  background: rgba(30, 24, 20, .36);
  cursor: pointer;
  pointer-events: auto;
}

.jy-banner__arrow {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border-radius: 50%;
  transition: background 160ms ease-out, transform 120ms ease-out;
}

.jy-banner__arrow:hover,
.jy-banner__arrow:focus-visible {
  background: rgba(255, 255, 255, .2);
}

.jy-banner__dots {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.jy-banner__dots button {
  width: 10px;
  height: 10px;
  padding: 0;
  border-radius: 50%;
  opacity: .58;
  transition: opacity 160ms ease-out, transform 160ms ease-out, background 160ms ease-out;
}

.jy-banner__dots button[aria-current="true"] {
  background: #fff;
  opacity: 1;
  transform: scale(1.2);
}

.jy-banner__arrow:focus-visible,
.jy-banner__dots button:focus-visible,
.jy-banner__button:focus-visible {
  outline: 3px solid rgba(255, 255, 255, .7);
  outline-offset: 3px;
}

.jy-library {
  padding: clamp(64px, 9vw, 112px) 0;
}

.jy-shelf + .jy-shelf {
  padding-top: 12px;
  border-top: 1px solid rgba(120, 105, 91, .12);
}

.jy-shelf .jnm-novel-grid {
  overflow-x: auto;
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: minmax(176px, 214px);
  padding: 2px 2px 18px;
  scroll-padding-inline: 2px;
  scroll-snap-type: x proximity;
  scrollbar-color: var(--jy-line) transparent;
}

.jy-shelf .jnm-novel-card {
  scroll-snap-align: start;
}

.jy-section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 36px;
}

.jy-section-header h2,
.jy-page-title {
  margin: 0;
  font-family: Georgia, 'Songti SC', serif;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.2;
}

.jy-section-header > a {
  color: var(--jy-accent);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.jy-page-header {
  padding: clamp(56px, 8vw, 96px) 0 32px;
}

.jy-page-header p:last-child {
  max-width: 60ch;
  margin: 14px 0 0;
  color: var(--jy-muted);
}

.jy-main {
  min-height: 55vh;
  padding: 64px 0 96px;
}

.jy-post-list {
  display: grid;
  gap: 20px;
}

.jy-post-card {
  padding: 28px;
  border: 1px solid var(--jy-line);
  border-radius: var(--jy-radius);
  background: rgba(255, 253, 248, .55);
}

.jy-post-card h2 {
  margin: 0 0 8px;
}

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

.jy-entry-content {
  max-width: 760px;
  margin-inline: auto;
}

.jy-entry-content > h1 {
  font-family: Georgia, 'Songti SC', serif;
  font-size: clamp(36px, 6vw, 62px);
}

.jy-pagination {
  margin-top: 48px;
}

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

.jy-pagination a,
.jy-pagination span {
  display: grid;
  min-width: 40px;
  min-height: 40px;
  place-items: center;
  border: 1px solid var(--jy-line);
  border-radius: 50%;
  text-decoration: none;
}

.jy-pagination .current {
  color: #fff;
  border-color: var(--jy-accent);
  background: var(--jy-accent);
}

.jy-site-footer {
  padding: 42px 0;
  border-top: 1px solid var(--jy-line);
  color: var(--jy-muted);
  font-size: 13px;
}

.jy-footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.jy-footer-inner p {
  margin: 0;
}

.jy-empty-state {
  padding: 52px 24px;
  border: 1px dashed var(--jy-line);
  border-radius: var(--jy-radius);
  color: var(--jy-muted);
  background: rgba(255, 253, 248, .42);
  text-align: center;
}

.jy-empty-state h2 {
  margin: 0 0 8px;
  color: var(--jy-ink);
}

.jy-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  margin-top: 14px;
  padding: 0 20px;
  border-radius: 999px;
  color: #fff;
  background: var(--jy-accent);
  font-weight: 700;
  text-decoration: none;
}

.jy-button:hover {
  color: #fff;
  background: var(--jy-accent-dark);
}

@media (max-width: 760px) {
  .jy-container {
    width: min(calc(100% - 24px), var(--jy-width));
  }

  .jy-header-inner {
    min-height: 64px;
  }

  .jy-site-nav ul {
    gap: 16px;
  }

  .jy-site-nav li:not(:first-child) {
    display: none;
  }

  .jy-hero::after {
    opacity: .5;
  }

  .jy-banner__slide {
    min-height: 620px;
  }

  .jy-banner__scrim {
    background: rgba(25, 20, 17, .58);
  }

  .jy-banner__content {
    padding-top: 96px;
    padding-bottom: 132px;
  }

  .jy-banner h1 {
    font-size: clamp(42px, 14vw, 62px);
  }

  .jy-banner__controls {
    bottom: 28px;
    justify-content: space-between;
  }

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

  .jy-shelf .jnm-novel-grid {
    grid-auto-columns: minmax(156px, 72vw);
  }

  .jy-footer-inner {
    flex-direction: column;
  }
}

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

  .jy-banner__slide,
  .jy-banner__button,
  .jy-banner__arrow,
  .jy-banner__dots button {
    transition-duration: .01ms;
  }
}
