:root {
  --paper: #f7f1e8;
  --paper-deep: #efe6d8;
  --ink: #1c1612;
  --ink-soft: #5e534a;
  --muted: #8a7d72;
  --rose: #7a2d3a;
  --rose-deep: #5a1f2a;
  --gold: #b0894f;
  --gold-soft: #d4bc8a;
  --line: #e4d7c6;
  --white: #fffdf8;
  --shadow: 0 18px 50px rgba(28, 22, 18, 0.08);
  --radius: 14px;
  --max: 1180px;
  --thumb-ratio: 2 / 1;
  --serif: Arial, Helvetica, sans-serif;
  --sans: Arial, Helvetica, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top, rgba(176, 137, 79, 0.08), transparent 34%),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.65;
}

.article a {
  color: var(--rose);
  text-underline-offset: 3px;
}

.article a.btn {
  color: #fff;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -40px;
  background: var(--ink);
  color: var(--white);
  padding: 0.5rem 0.8rem;
  z-index: 100;
}

.skip-link:focus {
  top: 1rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.wrap {
  width: min(var(--max), calc(100% - 2rem));
  margin-inline: auto;
}

.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  z-index: 80;
  background: linear-gradient(90deg, var(--rose), var(--gold));
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 241, 232, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 76px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--rose);
  color: var(--white);
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 600;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-text strong {
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.brand-text span {
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
}

.nav a {
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.nav a:hover,
.nav a.is-active {
  color: var(--rose);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.icon-btn,
.menu-btn {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 999px;
  cursor: pointer;
}

.menu-btn {
  display: none;
}

.search-panel {
  display: none;
  border-top: 1px solid var(--line);
  background: var(--white);
  padding: 1rem 0 1.2rem;
}

.search-panel.is-open {
  display: block;
}

.search-panel form {
  display: flex;
  gap: 0.6rem;
}

.search-panel input {
  flex: 1;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 999px;
  padding: 0.85rem 1.1rem;
}

.search-panel button {
  border: 0;
  background: var(--rose);
  color: #fff;
  border-radius: 999px;
  padding: 0 1.2rem;
  cursor: pointer;
}

.toast {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 40;
  max-width: min(22rem, calc(100% - 2rem));
  background: #241c19;
  color: #fff;
  padding: 0.85rem 1.05rem;
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(28, 22, 18, 0.22);
  display: none;
}

.toast.show {
  display: block;
}

.hero {
  padding: 2.4rem 0 1.4rem;
}

.hero-card {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2rem;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 1.4rem;
  box-shadow: var(--shadow);
}

.hero-slider {
  position: relative;
}

.hero-slides {
  display: grid;
}

.hero-slides .hero-card {
  grid-area: 1 / 1;
  width: 100%;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.55s ease, visibility 0.55s ease;
}

.hero-slides .hero-card.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.hero-dots {
  display: flex;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 0.9rem;
}

.hero-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #d4c4b0;
  cursor: pointer;
}

.hero-dot.is-active {
  background: var(--rose);
  transform: scale(1.15);
}

@media (prefers-reduced-motion: reduce) {
  .hero-slides .hero-card {
    transition: none;
  }
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--rose);
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero h1,
.page-title,
.article-title {
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.12;
}

.hero h1 {
  margin: 0.7rem 0 0.9rem;
  font-size: clamp(2.1rem, 5vw, 3.6rem);
}

.lede {
  color: var(--ink-soft);
  font-size: 1.05rem;
  max-width: 42rem;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.2rem;
  color: var(--muted);
  font-size: 0.88rem;
  margin: 1.1rem 0 1.4rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--rose);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1.3rem;
  cursor: pointer;
}

.btn:hover {
  background: var(--rose-deep);
}

.cover {
  aspect-ratio: var(--thumb-ratio);
  width: 100%;
  min-height: 0;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(28, 22, 18, 0.05), rgba(28, 22, 18, 0.35)),
    radial-gradient(circle at 20% 20%, #d7b07a, transparent 32%),
    radial-gradient(circle at 80% 10%, #8b3a48, transparent 28%),
    linear-gradient(135deg, #3d2a28, #1c1612 58%, #7a2d3a);
  color: #f7f1e8;
  padding: 1.4rem;
  display: flex;
  align-items: flex-end;
  font-family: var(--serif);
  font-size: 1.4rem;
  position: relative;
  overflow: hidden;
}

.cover.has-photo {
  padding: 0;
  background: #1c1612;
}

.cover.has-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover.has-photo span {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  padding: 1.4rem;
  background: linear-gradient(180deg, transparent 20%, rgba(28, 22, 18, 0.72));
}

.section {
  padding: 0.4rem 0 2.6rem;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.section-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 600;
}

.section-head p,
.muted {
  color: var(--muted);
}

.topic-block {
  padding: 0.2rem 0 2.4rem;
}

.topic-block + .topic-block {
  border-top: 1px solid var(--line);
  padding-top: 2.2rem;
}

.story-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}

.story-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.story-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.thumb {
  aspect-ratio: var(--thumb-ratio);
  height: auto;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}

.thumb.has-photo {
  background-image: none;
  background-color: #1c1612;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb-1 {
  background-image:
    linear-gradient(180deg, transparent, rgba(28, 22, 18, 0.35)),
    linear-gradient(135deg, #8b3a48, #d7b07a 48%, #3d2a28);
}

.thumb-2 {
  background-image:
    linear-gradient(180deg, transparent, rgba(28, 22, 18, 0.35)),
    linear-gradient(135deg, #2f3d4a, #8fa6b3 50%, #c9b496);
}

.thumb-3 {
  background-image:
    linear-gradient(180deg, transparent, rgba(28, 22, 18, 0.35)),
    linear-gradient(135deg, #4a3a2f, #c4a574 46%, #7a2d3a);
}

.thumb-4 {
  background-image:
    linear-gradient(180deg, transparent, rgba(28, 22, 18, 0.35)),
    linear-gradient(135deg, #24352e, #88a07a 50%, #efe6d8);
}

.thumb-5 {
  background-image:
    linear-gradient(180deg, transparent, rgba(28, 22, 18, 0.35)),
    linear-gradient(135deg, #5a1f2a, #b0894f 48%, #1c1612);
}

.thumb-6 {
  background-image:
    linear-gradient(180deg, transparent, rgba(28, 22, 18, 0.35)),
    linear-gradient(135deg, #3a3348, #d4bc8a 52%, #7a2d3a);
}

.story-card .body {
  padding: 1rem 1.05rem 1.15rem;
}

.story-card h3 {
  margin: 0.35rem 0 0.5rem;
  font-family: var(--serif);
  font-size: 1.35rem;
  line-height: 1.2;
  font-weight: 600;
}

.story-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.94rem;
}

.card-meta {
  margin-top: 0.7rem !important;
  color: var(--muted) !important;
  font-size: 0.8rem !important;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1.8rem;
  padding: 1.6rem 0 3rem;
}

.article {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: clamp(1.2rem, 3vw, 2.4rem);
}

.crumbs {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 0.8rem;
}

.crumbs a {
  color: inherit;
}

.article-title {
  margin: 0.2rem 0 0.8rem;
  font-size: clamp(2rem, 4.4vw, 3.1rem);
}

.article p.article-summary {
  color: var(--ink-soft);
  font-size: 1.2rem;
  line-height: 1.55;
  max-width: 42rem;
  margin: 0 0 1rem;
}

.story-hub-head {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 1.2rem 1.6rem;
  align-items: start;
  margin: 0.2rem 0 0.4rem;
}

.story-hub-titles .kicker {
  margin: 0 0 0.45rem;
}

.story-hub-titles .article-title {
  margin: 0 0 0.7rem;
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
}

.story-hub-titles .article-summary {
  margin-bottom: 0.8rem;
}

.story-hub-titles .meta {
  margin: 0 0 1rem;
}

.story-avatar {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  border: 0;
  border-radius: 16px;
  object-fit: cover;
  background: var(--paper-deep);
}

.story-avatar--fallback {
  display: grid;
  place-items: center;
  color: var(--rose);
  font-family: var(--serif);
  font-size: 2.8rem;
  font-weight: 600;
}

.story-hub-section {
  margin-top: 1rem;
}

.chapter-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.chapter-list li + li {
  border-top: 1px solid var(--line);
}

.chapter-list a {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0.1rem;
  color: inherit;
  text-decoration: none;
}

.chapter-list a:hover .chapter-name {
  color: var(--rose);
}

.chapter-num {
  flex: 0 0 2.4rem;
  color: var(--rose);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
}

.chapter-name {
  font-size: 1.12rem;
}

.chapter-page .crumbs {
  text-align: center;
}

.chapter-heading {
  text-align: center;
  margin: 0.6rem 0 1.3rem;
}

.chapter-story-name {
  margin: 0 0 0.35rem;
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 600;
}

.chapter-heading .article-title {
  margin: 0;
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  font-weight: 500;
  color: var(--ink-soft);
}

.chapter-switcher {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 1rem;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
}

.article-body + .chapter-switcher {
  margin: 2rem 0 0;
}

.chapter-switcher-btn {
  display: inline-flex;
  justify-content: center;
  padding: 0.7rem 0.9rem;
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.92rem;
}

.chapter-switcher-btn:hover:not(.is-disabled) {
  background: var(--white);
}

.chapter-switcher-btn.is-disabled {
  color: var(--muted);
  pointer-events: none;
}

.chapter-switcher-menu {
  position: relative;
}

.chapter-switcher-menu summary {
  list-style: none;
  cursor: pointer;
  padding: 0.7rem 1.15rem;
  border-radius: 999px;
  font-weight: 600;
}

.chapter-switcher-menu summary::-webkit-details-marker {
  display: none;
}

.chapter-switcher-menu summary:hover,
.chapter-switcher-menu[open] summary {
  background: var(--white);
}

.chapter-switcher-menu ol {
  position: absolute;
  left: 50%;
  top: calc(100% + 0.45rem);
  z-index: 8;
  width: min(280px, 70vw);
  max-height: 260px;
  overflow: auto;
  margin: 0;
  padding: 0.4rem 0;
  list-style: none;
  transform: translateX(-50%);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.chapter-switcher-menu a {
  display: block;
  padding: 0.55rem 0.9rem;
  color: inherit;
  text-decoration: none;
}

.chapter-switcher-menu a:hover,
.chapter-switcher-menu a.is-current {
  background: var(--paper);
  color: var(--rose);
}

.chapter-share {
  justify-content: center;
  margin: 0 0 1.4rem;
}

.dropcap::first-letter {
  float: left;
  font-family: var(--serif);
  font-size: 4.4rem;
  line-height: 0.8;
  padding: 0.12em 0.12em 0 0;
  color: var(--rose);
}

.article p {
  font-size: 1.12rem;
  margin: 0 0 1.15rem;
}

.article-body img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 14px;
  margin: 1.35rem 0 1.6rem;
}

.article-body img.article-thumb {
  margin-top: 0.2rem;
}

.article-body figure {
  margin: 1.35rem 0 1.7rem;
}

.article-body figcaption {
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.pullquote {
  margin: 1.8rem 0;
  padding: 0.4rem 0 0.4rem 1.2rem;
  border-left: 3px solid var(--gold);
  font-family: var(--serif);
  font-size: 1.55rem;
  line-height: 1.35;
  color: var(--rose-deep);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.1rem;
}

.panel h3 {
  margin: 0 0 0.9rem;
  font-family: var(--serif);
  font-size: 1.35rem;
}

.mini-list {
  display: grid;
  gap: 0.85rem;
}

.mini-list a {
  display: grid;
  gap: 0.15rem;
}

.mini-list strong {
  font-size: 0.98rem;
  line-height: 1.3;
}

.share {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.share a,
.share button {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
  font-size: 0.85rem;
}

.page-form input,
.page-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.8rem 0.9rem;
  background: var(--paper);
  margin-bottom: 0.7rem;
}

#article-mount {
  padding: 1.6rem 0 3rem;
}

.related-block {
  margin-top: 2.2rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--line);
}

.page-hero {
  padding: 2rem 0 0.6rem;
}

.page-hero h1 {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  margin: 0.3rem 0 0.6rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2.2rem 0 2.4rem;
  color: var(--ink-soft);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 1.4rem;
}

.site-footer h4 {
  margin: 0 0 0.6rem;
  font-family: var(--serif);
  font-size: 1.3rem;
  color: var(--ink);
}

.site-footer a {
  display: block;
  margin-bottom: 0.35rem;
}

.copyright {
  margin-top: 1.6rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
  color: var(--muted);
}

.empty-note {
  grid-column: 1 / -1;
  padding: 1.4rem;
  background: var(--white);
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--ink-soft);
}

@media (max-width: 960px) {
  .hero-card,
  .layout,
  .footer-grid,
  .story-grid:not(.story-grid--row) {
    grid-template-columns: 1fr;
  }

  .story-grid--row {
    grid-template-columns: repeat(3, 1fr);
  }

  .nav {
    display: none;
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
  }

  .nav.is-open {
    display: flex;
  }

  .menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .cover {
    aspect-ratio: var(--thumb-ratio);
    min-height: 0;
  }
}

@media (max-width: 700px) {
  .story-grid--row {
    grid-template-columns: 1fr;
  }

  .story-hub-head {
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 0.9rem;
  }

  .story-avatar--fallback {
    font-size: 1.8rem;
  }

  .chapter-switcher-btn {
    padding: 0.65rem 0.55rem;
    font-size: 0.82rem;
  }
}
