/*
Theme Name: 绒夜
Theme URI: https://woolnight.com
Author: Woolnight
Description: A night-reading theme for Chinese bear and daddy stories.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 8.1
Text Domain: woolnight
*/

:root {
  --night: #120e0b;
  --door: #1a1511;
  --seam: #2c241d;
  --ash: #8a7663;
  --paper: #ead6b6;
  --paper-dim: #c9b394;
  --copper: #b37a4e;
  --copper-deep: #8c5a34;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --measure: 38rem;
  --font-display: "Songti SC", "STSong", "Iowan Old Style", Palatino, "Noto Serif CJK SC", serif;
  --font-body: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", SimSun, serif;
}

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

html {
  background: var(--night) !important;
  color: var(--paper) !important;
  font-size: 18px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.85;
  letter-spacing: 0.02em;
  background:
    radial-gradient(1200px 480px at 0% -10%, rgba(179, 122, 78, 0.08), transparent 55%),
    var(--night) !important;
  color: var(--paper) !important;
}

body.gate {
  background: var(--night);
}

img,
svg {
  max-width: 100%;
  display: block;
}

a {
  color: var(--copper);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

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

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--copper);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: -999px;
  top: 0;
}

.skip:focus {
  left: var(--gutter);
  top: 0.5rem;
  z-index: 20;
  background: var(--door);
  color: var(--paper);
  padding: 0.4rem 0.7rem;
}

.site-header,
.site-footer,
.wrap {
  width: min(100%, calc(var(--measure) + 18vw));
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

@media (min-width: 900px) {
  .site-header,
  .site-footer,
  .wrap {
    width: 100%;
    max-width: none;
    padding-left: 16vw;
    padding-right: max(8vw, calc(100vw - 16vw - var(--measure)));
  }

  .wrap {
    max-width: calc(16vw + var(--measure) + 8vw);
    margin: 0;
  }
}

.site-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.75rem;
  padding-bottom: 1.5rem;
}

.brand {
  color: inherit;
  text-decoration: none;
  line-height: 1.05;
}

.brand:hover {
  color: inherit;
}

.brand-zh {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 500;
  font-optical-sizing: auto;
  letter-spacing: 0.18em;
}

.brand-en {
  display: block;
  margin-top: 0.2rem;
  color: var(--ash);
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0.22em;
}

.brand-mark {
  display: block;
  width: 2.6rem;
  height: 1px;
  margin-top: 0.55rem;
  background: var(--copper);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.15rem 1.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav a {
  color: var(--ash);
  text-decoration: none;
}

.nav a:hover,
.nav .current-menu-item a,
.nav .current-cat a {
  color: var(--paper);
}

.mast {
  padding-bottom: 2.25rem;
}

.mast p {
  margin: 0;
  max-width: 22em;
  color: var(--paper-dim);
  font-size: 1.05rem;
  line-height: 1.7;
}

.story-list {
  display: grid;
  gap: 0;
  padding: 0;
  margin: 0;
  list-style: none;
}

.story-list > li {
  padding: 1.7rem 0 1.85rem;
  border-top: 1px solid var(--seam);
}

.story-list > li:last-child {
  border-bottom: 1px solid var(--seam);
}

.story-title {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.4vw, 1.85rem);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.04em;
}

.story-title a {
  color: var(--paper);
  text-decoration: none;
}

.story-title a:hover {
  color: var(--copper);
}

.meta {
  margin: 0 0 0.85rem;
  color: var(--ash);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
}

.meta a {
  color: inherit;
  text-decoration: none;
}

.meta a:hover {
  color: var(--copper);
}

.excerpt {
  margin: 0;
  color: var(--paper-dim);
}

.excerpt p {
  margin: 0;
}

.read-on {
  display: inline-block;
  margin-top: 0.75rem;
  color: var(--copper);
  text-decoration: none;
  letter-spacing: 0.08em;
}

.read-on:hover {
  color: var(--paper);
}

.article-head {
  padding: 0.4rem 0 1.5rem;
}

.article-head h1 {
  margin: 0 0 0.55rem;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.05em;
}

.prose {
  color: var(--paper);
  font-size: 1.02rem;
}

.prose p {
  margin: 0 0 1.35em;
}

.prose p:last-child {
  margin-bottom: 0;
}

.prose hr {
  width: 3.5rem;
  margin: 2.2rem 0;
  border: 0;
  border-top: 1px solid var(--copper-deep);
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.8rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--seam);
  color: var(--ash);
  font-size: 0.92rem;
}

.pager a {
  color: var(--paper-dim);
  text-decoration: none;
  max-width: 45%;
}

.pager a:hover {
  color: var(--copper);
}

.pager .next {
  margin-left: auto;
  text-align: right;
}

.page-title {
  margin: 0 0 1.4rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.2rem;
  margin-top: 3.5rem;
  padding-top: 1.3rem;
  padding-bottom: 2.4rem;
  color: var(--ash);
  font-size: 0.8rem;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--copper);
}

.empty {
  color: var(--ash);
}

/* Age gate */
.gate-shell {
  min-height: 100vh;
  width: 100%;
  display: grid;
  place-items: center;
  padding: 2rem var(--gutter) 3rem;
}

.gate-panel {
  position: relative;
  width: min(28rem, 100%);
  margin: 0 auto;
}

.gate-glyph {
  position: absolute;
  top: -2.2rem;
  left: -0.35rem;
  z-index: 0;
  color: rgba(179, 122, 78, 0.13);
  font-family: var(--font-display);
  font-size: clamp(7rem, 28vw, 11rem);
  font-weight: 500;
  line-height: 0.8;
  letter-spacing: -0.06em;
  pointer-events: none;
  user-select: none;
}

.gate-copy {
  position: relative;
  z-index: 1;
  padding-top: 3.2rem;
}

.gate-copy .brand-zh {
  font-size: 2.1rem;
}

.gate-copy p {
  margin: 1.3rem 0 0;
  max-width: 18em;
  color: var(--paper-dim);
  font-size: 1.02rem;
  line-height: 1.7;
}

.gate-actions {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-top: 1.8rem;
}

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  padding: 0.55rem 1.1rem;
  border: 1px solid var(--copper);
  background: var(--copper);
  color: var(--night);
  font-family: var(--font-body);
  font-size: 1rem;
  letter-spacing: 0.12em;
  cursor: pointer;
}

.btn:hover {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--night);
}

.btn-ghost {
  background: transparent;
  color: var(--ash);
  border-color: var(--seam);
}

.btn-ghost:hover {
  color: var(--paper);
  border-color: var(--ash);
  background: transparent;
}

.gate-legal {
  display: flex;
  gap: 1rem;
  margin-top: 1.6rem;
  color: var(--ash);
  font-size: 0.8rem;
}

.gate-legal a {
  color: inherit;
  text-decoration: none;
}

.gate-legal a:hover {
  color: var(--copper);
}

@media (min-width: 640px) {
  .gate-actions {
    flex-direction: row;
  }

  .gate-actions .btn,
  .gate-actions .btn-ghost {
    flex: 1;
  }
}

@media (max-width: 639px) {
  html {
    font-size: 17px;
  }

  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.85rem;
  }

  .nav {
    justify-content: flex-start;
  }

  .pager {
    flex-direction: column;
  }

  .pager a,
  .pager .next {
    max-width: 100%;
    text-align: left;
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
