/*
Theme Name: Yaksha King
Theme URI: https://louishinnant.me
Author: Louis Hinnant
Author URI: https://louishinnant.me
Description: A quiet, editorial blog theme for louishinnant.me — Switzer type throughout (heavy headings over a clean body), a grid-card feed, a faint gradient wash, a Chinese-name watermark, and an automatic dark mode with a manual toggle. Converted from the hand-authored "Yaksha King" static design into a full WordPress CMS theme: write posts in the editor, manage the top navigation and the category filter bar from the admin, and set a featured image per post (with the signature gradient tile as a fallback).
Version: 1.1.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: yaksha-king
Tags: blog, one-column, custom-menu, featured-images, translation-ready, editor-style, full-width-template, threaded-comments
*/

/* louishinnant.me — Yaksha King theme.
   Ported from the hand-authored static design, now set in Switzer (self-hosted):
   grid-card feed, left header, faint gradient wash, dark-mode toggle. */

/* ─── Fonts (Switzer, self-hosted — ITF Free Font License) ──────────── */
@font-face { font-family: 'Switzer'; src: url('fonts/switzer-400.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Switzer'; src: url('fonts/switzer-500.woff2') format('woff2'); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: 'Switzer'; src: url('fonts/switzer-600.woff2') format('woff2'); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: 'Switzer'; src: url('fonts/switzer-700.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Switzer'; src: url('fonts/switzer-800.woff2') format('woff2'); font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: 'Switzer'; src: url('fonts/switzer-900.woff2') format('woff2'); font-weight: 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Switzer'; src: url('fonts/switzer-400-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Switzer'; src: url('fonts/switzer-700-italic.woff2') format('woff2'); font-weight: 700; font-style: italic; font-display: swap; }

/* ─── Theme tokens (Yaksha King) + locked type choices ──────────────── */
:root {
  /* light */
  --bg: #fbf3ea; --surface: #fffaf3; --text: #2a1814; --muted: #998071;
  --border: rgba(42,24,20,0.13); --accentText: #c2491f;
  /* dark */
  --bg-d: #1a1110; --surface-d: #231514; --text-d: #f4e7d8; --muted-d: #a3897e;
  --border-d: rgba(244,231,216,0.13); --acc-d: #ffa256;
  /* gradients */
  --gs: #fdcb16, #ff8a3d, #c5402f, #8a2127, #5a0a0d;
  --wm-grad-light: linear-gradient(96deg, #e0701f, #c5402f, #8a2127);
  --wm-grad-dark:  linear-gradient(96deg, #fdcb16, #ff8a3d, #c5402f, #8a2127, #5a0a0d);
  /* fonts — Switzer for both body and headings (headings just heavier) */
  --sans: 'Switzer', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --cjk: 'Noto Serif SC', serif;
  --display: 'Switzer', system-ui, -apple-system, 'Segoe UI', sans-serif;
  /* watermark = Chinese name (overridable in the Customizer) */
  --cn: '杨英杰';
  --soft: color-mix(in oklab, var(--text) 62%, var(--bg));
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

/* ─── Page shell ────────────────────────────────────────────────────── */
.hp {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  padding: 74px 84px 60px;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
/* faint full-page gradient wash */
.hp::before {
  content: ''; position: absolute; inset: 0; z-index: 0; opacity: .12;
  background: linear-gradient(160deg, var(--gs)); pointer-events: none;
}
.hp > *:not(.hp-watermark):not(.hp-toggle) { position: relative; z-index: 1; }

/* big faded name watermark */
.hp-watermark {
  position: absolute; top: -40px; right: -10px; z-index: 0;
  writing-mode: vertical-rl; font-family: var(--cjk); font-weight: 600;
  font-size: 360px; line-height: .82; letter-spacing: -.04em;
  color: var(--text); opacity: .045; pointer-events: none; user-select: none;
  white-space: nowrap;
}
.hp-watermark::before { content: var(--cn); }

/* dark-mode toggle button */
.hp-toggle {
  position: absolute; top: 28px; right: 32px; z-index: 3;
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--border); background: transparent; color: var(--muted);
  font-size: 17px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: color .2s, border-color .2s;
}
.hp-toggle:hover { color: var(--text); border-color: var(--text); }

/* ─── Masthead (name left, nav right) ───────────────────────────────── */
.hp-mast {
  display: flex; justify-content: space-between; align-items: center;
  gap: 40px; flex-wrap: wrap;
}
.hp-name {
  margin: 0; line-height: 1; white-space: nowrap;
  font-family: var(--display); font-weight: 900; font-size: 54px;
  letter-spacing: -.02em; color: var(--accentText);
}
.hp-name a { color: inherit; text-decoration: none; }
.hp-nav { display: flex; gap: 34px; align-items: center; flex-wrap: wrap; }
/* normalize in case a menu falls back to a <ul> list */
.hp-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 34px; align-items: center; flex-wrap: wrap; }
.hp-nav li { margin: 0; }
.hp-navlink {
  font-size: 15px; font-weight: 500; color: var(--muted); text-decoration: none;
  white-space: nowrap; transition: color .15s;
}
.hp-navlink:hover, .hp-navlink.is-active,
.hp-nav .current-menu-item > a, .hp-nav .current_page_item > a { color: var(--text); }
.hp-navlink.is-active, .hp-nav .current-menu-item > a { font-weight: 600; }

/* gradient divider */
.hp-rule { height: 2px; margin: 40px 0 0; background: var(--wm-grad-light); opacity: .9; }

/* ─── Filters ───────────────────────────────────────────────────────── */
.hp-filters { display: flex; gap: 32px; align-items: center; padding: 30px 0 6px; flex-wrap: wrap; }
.hp-filter {
  position: relative; font-size: 14.5px; font-weight: 500; color: var(--muted);
  text-decoration: none; padding-bottom: 8px; transition: color .15s;
}
.hp-filter:hover, .hp-filter.is-active { color: var(--text); }
.hp-filter.is-active { font-weight: 600; }
.hp-filter.is-active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: var(--wm-grad-light);
}

/* ─── Feed (grid cards) ─────────────────────────────────────────────── */
.hp-feed {
  flex: 1 1 auto; margin-top: 26px; border-top: 1px solid var(--border);
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 44px 36px;
  align-content: start; padding-top: 40px;
}
.hp-card { display: flex; flex-direction: column; min-width: 0; }
.hp-img {
  display: block; position: relative; overflow: hidden; height: 200px; margin-bottom: 20px;
  background: linear-gradient(var(--ang, 158deg), var(--gs));
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06); text-decoration: none;
}
.hp-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hp-imghint {
  position: absolute; left: 12px; bottom: 10px; font-family: var(--mono); font-size: 10.5px;
  letter-spacing: .08em; color: rgba(255,255,255,.85); text-shadow: 0 1px 2px rgba(0,0,0,.4); white-space: nowrap;
}
.hp-meta {
  display: flex; align-items: center; gap: 11px; white-space: nowrap;
  font-family: var(--mono); font-size: 12px; letter-spacing: .04em;
  color: var(--muted); text-transform: uppercase; margin-bottom: 16px;
}
.hp-cat { color: var(--accentText); font-weight: 500; text-decoration: none; }
.hp-cat:hover { text-decoration: underline; }
.hp-dot { opacity: .45; }
.hp-title {
  margin: 0; font-family: var(--display); font-weight: 800; font-size: 21px;
  line-height: 1.22; letter-spacing: -.01em; color: var(--text); text-wrap: balance;
}
.hp-title a { color: inherit; text-decoration: none; }
.hp-title a:hover { color: var(--accentText); }
.hp-excerpt { font-size: 15.5px; line-height: 1.55; color: var(--soft); margin: 12px 0 0; text-wrap: pretty; }

/* infinite-scroll sentinel / pagination */
.hp-infinite { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 46px 0 8px; }
.hp-dots { display: flex; gap: 8px; }
.hp-dots span {
  width: 7px; height: 7px; border-radius: 50%; background: var(--wm-grad-light);
  opacity: .55; animation: hp-pulse 1.3s ease-in-out infinite;
}
.hp-dots span:nth-child(2) { animation-delay: .18s; }
.hp-dots span:nth-child(3) { animation-delay: .36s; }
@keyframes hp-pulse { 0%,100% { opacity: .25; transform: translateY(0); } 50% { opacity: .8; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .hp-dots span { animation: none; } }
.hp-infinite em, .hp-infinite a {
  font-family: var(--mono); font-style: normal; font-size: 12px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); white-space: nowrap; text-decoration: none;
}
.hp-infinite a:hover { color: var(--accentText); }
.hp-infinite.is-done .hp-dots { display: none; }

/* ─── Single post / page / archive additions ────────────────────────── */
.hp-pagehead { margin: 34px 0 0; }
.hp-pagehead .hp-eyebrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
}
.hp-pagehead h1 {
  font-family: var(--display); font-weight: 800; font-size: 33px; line-height: 1.12;
  color: var(--text); margin: 8px 0 0; letter-spacing: -.015em; text-wrap: balance;
}

.hp-article { max-width: 760px; margin: 34px 0 0; }
.hp-article-title {
  font-family: var(--display); font-weight: 900; font-size: 40px; line-height: 1.1;
  letter-spacing: -.02em; margin: 10px 0 0; color: var(--text); text-wrap: balance;
}
.hp-article-featured { margin: 30px 0 6px; }
.hp-article-featured img {
  width: 100%; height: auto; display: block; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}
.hp-article-body { font-size: 17px; line-height: 1.72; color: var(--soft); margin-top: 26px; }
.hp-article-body > *:first-child { margin-top: 0; }
.hp-article-body p { margin: 0 0 1.25em; }
.hp-article-body h2 { font-family: var(--display); font-weight: 800; font-size: 26px; line-height: 1.22; letter-spacing: -.01em; color: var(--text); margin: 1.8em 0 .55em; }
.hp-article-body h3 { font-family: var(--display); font-weight: 700; font-size: 20px; line-height: 1.3; color: var(--text); margin: 1.6em 0 .5em; }
.hp-article-body a { color: var(--accentText); text-decoration: underline; text-underline-offset: 2px; }
.hp-article-body img { max-width: 100%; height: auto; }
.hp-article-body ul, .hp-article-body ol { padding-left: 1.3em; margin: 0 0 1.25em; }
.hp-article-body li { margin: .3em 0; }
.hp-article-body blockquote {
  margin: 1.6em 0; padding-left: 20px; border-left: 2px solid var(--accentText);
  color: var(--text); font-style: italic;
}
.hp-article-body code {
  font-family: var(--mono); font-size: .9em;
  background: color-mix(in oklab, var(--text) 8%, transparent); padding: .1em .35em; border-radius: 3px;
}
.hp-article-body pre {
  font-family: var(--mono); font-size: 13.5px; line-height: 1.6;
  background: color-mix(in oklab, var(--text) 8%, transparent); padding: 16px 18px; overflow: auto;
}
.hp-article-body pre code { background: none; padding: 0; }
.hp-article-body figure { margin: 1.6em 0; }
.hp-article-body figcaption {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: .04em;
  color: var(--muted); margin-top: 8px; text-transform: uppercase;
}
.hp-article-footer { margin-top: 42px; padding-top: 24px; border-top: 1px solid var(--border); }
.hp-tags { font-family: var(--mono); font-size: 12px; letter-spacing: .04em; color: var(--muted); }
.hp-tags a { color: var(--accentText); text-decoration: none; }
.hp-tags a:hover { text-decoration: underline; }

.hp-back {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 30px;
  font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); text-decoration: none;
}
.hp-back:hover { color: var(--accentText); }

.hp-postnav { display: flex; justify-content: space-between; gap: 24px; margin-top: 28px; }
.hp-postnav a { color: var(--muted); text-decoration: none; font-size: 14.5px; }
.hp-postnav a:hover { color: var(--accentText); }

.hp-empty { padding: 30px 0 60px; color: var(--muted); font-size: 16px; max-width: 620px; }

/* search form */
.hp-search { display: flex; gap: 10px; margin-top: 22px; max-width: 440px; }
.hp-search input[type="search"] {
  flex: 1; padding: 11px 14px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-family: var(--sans); font-size: 15px;
}
.hp-search button {
  padding: 11px 18px; border: none; background: var(--accentText); color: #fff;
  font-family: var(--sans); font-weight: 600; font-size: 14px; cursor: pointer;
}

/* comments */
.hp-comments { max-width: 760px; margin: 46px 0 0; }
.hp-comments h2 { font-family: var(--display); font-weight: 800; font-size: 23px; letter-spacing: -.01em; color: var(--text); margin: 0 0 20px; }
.hp-comments ol { list-style: none; margin: 0; padding: 0; }
.hp-comments .children { list-style: none; margin: 0 0 0 26px; padding: 0; }
.hp-comments li.comment { margin: 0 0 22px; }
.hp-comments .comment-author { font-weight: 600; color: var(--text); }
.hp-comments .comment-meta { font-family: var(--mono); font-size: 11.5px; letter-spacing: .04em; color: var(--muted); text-transform: uppercase; margin: 2px 0 8px; }
.hp-comments .comment-meta a { color: inherit; text-decoration: none; }
.hp-comment-respond { margin-top: 30px; }
.hp-comment-respond input[type="text"], .hp-comment-respond input[type="email"],
.hp-comment-respond input[type="url"], .hp-comment-respond textarea {
  width: 100%; max-width: 480px; padding: 10px 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-family: var(--sans); font-size: 15px; margin: 6px 0 14px;
}
.hp-comment-respond textarea { max-width: 640px; min-height: 130px; }
.hp-comment-respond .submit {
  padding: 11px 20px; border: none; background: var(--accentText); color: #fff;
  font-family: var(--sans); font-weight: 600; font-size: 14px; cursor: pointer;
}

/* WordPress core alignment / caption / accessibility classes */
.alignleft { float: left; margin: .4em 1.4em .6em 0; }
.alignright { float: right; margin: .4em 0 .6em 1.4em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.wp-caption { max-width: 100%; }
.wp-caption-text, .gallery-caption { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.sticky, .bypostauthor { display: block; }
.screen-reader-text {
  border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
  height: 1px; width: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; word-wrap: normal !important;
}
.wp-block-image img { height: auto; }

/* ─── Dark mode (toggle adds .is-dark to <html>) ────────────────────── */
html.is-dark .hp { background: var(--bg-d); color: var(--text-d); }
html.is-dark .hp-name { color: var(--acc-d); }
html.is-dark .hp-toggle { color: var(--muted-d); border-color: var(--border-d); }
html.is-dark .hp-toggle:hover { color: var(--text-d); border-color: var(--text-d); }
html.is-dark .hp-navlink { color: var(--muted-d); }
html.is-dark .hp-navlink:hover, html.is-dark .hp-navlink.is-active,
html.is-dark .hp-nav .current-menu-item > a, html.is-dark .hp-nav .current_page_item > a { color: var(--text-d); }
html.is-dark .hp-rule, html.is-dark .hp-dots span { background-image: var(--wm-grad-dark); }
html.is-dark .hp-filter { color: var(--muted-d); }
html.is-dark .hp-filter:hover, html.is-dark .hp-filter.is-active { color: var(--text-d); }
html.is-dark .hp-filter.is-active::after { background-image: var(--wm-grad-dark); }
html.is-dark .hp-feed { border-top-color: var(--border-d); }
html.is-dark .hp-meta { color: var(--muted-d); }
html.is-dark .hp-cat { color: var(--acc-d); }
html.is-dark .hp-title { color: var(--text-d); }
html.is-dark .hp-title a:hover { color: var(--acc-d); }
html.is-dark .hp-excerpt { color: color-mix(in oklab, var(--text-d) 62%, var(--bg-d)); }
html.is-dark .hp-infinite em, html.is-dark .hp-infinite a { color: var(--muted-d); }
html.is-dark .hp-infinite a:hover { color: var(--acc-d); }
html.is-dark .hp-watermark { color: var(--text-d); opacity: .06; }
html.is-dark .hp-pagehead h1 { color: var(--text-d); }
html.is-dark .hp-pagehead .hp-eyebrow { color: var(--muted-d); }
html.is-dark .hp-article-title,
html.is-dark .hp-article-body h2, html.is-dark .hp-article-body h3 { color: var(--text-d); }
html.is-dark .hp-article-body { color: color-mix(in oklab, var(--text-d) 66%, var(--bg-d)); }
html.is-dark .hp-article-body a { color: var(--acc-d); }
html.is-dark .hp-article-body blockquote { color: var(--text-d); border-left-color: var(--acc-d); }
html.is-dark .hp-article-footer, html.is-dark .hp-feed.hp-archive-feed { border-color: var(--border-d); }
html.is-dark .hp-tags a, html.is-dark .hp-back:hover, html.is-dark .hp-postnav a:hover { color: var(--acc-d); }
html.is-dark .hp-back, html.is-dark .hp-postnav a, html.is-dark .hp-empty { color: var(--muted-d); }
html.is-dark .hp-search input[type="search"] { background: var(--surface-d); border-color: var(--border-d); color: var(--text-d); }
html.is-dark .hp-search button, html.is-dark .hp-comment-respond .submit { background: var(--acc-d); color: #231514; }
html.is-dark .hp-comments h2, html.is-dark .hp-comments .comment-author { color: var(--text-d); }
html.is-dark .hp-comments .comment-meta { color: var(--muted-d); }
html.is-dark .hp-comment-respond input, html.is-dark .hp-comment-respond textarea {
  background: var(--surface-d); border-color: var(--border-d); color: var(--text-d);
}

/* ─── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 1000px) {
  .hp { padding: 56px 44px 50px; }
  .hp-feed { grid-template-columns: repeat(2, 1fr); }
  .hp-name { font-size: 48px; }
  .hp-article-title { font-size: 34px; }
}
@media (max-width: 640px) {
  .hp { padding: 40px 22px 40px; }
  .hp-feed { grid-template-columns: 1fr; gap: 36px; }
  .hp-name { font-size: 40px; }
  .hp-toggle { top: 18px; right: 18px; }
  .hp-mast { gap: 18px; }
  .hp-article-title { font-size: 30px; }
}
