/*
Theme Name: Natsume Theme
Theme URI: https://enaknyabelanja.com
Author: Natsume
Description: Theme blog editorial responsif - tipografi serif, kartu bersih, mode gelap otomatis, tanpa build step.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
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: natsume
Tags: blog, custom-logo, custom-menu, featured-images, translation-ready, block-styles
*/

/* ---------- tokens ---------- */
:root {
  --paper: #fbf8f3;
  --card: #ffffff;
  --ink: #1b1a17;
  --muted: #6f6a60;
  --line: #e7dfd1;
  --accent: #bf4f21;
  --accent-ink: #8d3814;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(27, 26, 23, .05), 0 12px 32px -18px rgba(27, 26, 23, .35);
  --wrap: 1160px;
  --font-serif: ui-serif, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14130f;
    --card: #1c1a16;
    --ink: #f3ece1;
    --muted: #a89f92;
    --line: #2c2923;
    --accent: #e07a45;
    --accent-ink: #f0a071;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 40px -20px rgba(0, 0, 0, .8);
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .001ms !important; animation-duration: .001ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.nav-open { overflow: hidden; }

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

a {
  color: var(--accent-ink);
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  line-height: 1.15;
  letter-spacing: -.015em;
  margin: 0 0 .55em;
  font-weight: 600;
}

h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.45rem, 2.6vw, 2rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1.15em; }

.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 !important;
  word-wrap: normal !important;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: .75rem 1.1rem;
  border-radius: 0 0 10px 0;
}

.skip-link:focus { left: 0; }

.wrap {
  width: min(100% - 2.5rem, var(--wrap));
  margin-inline: auto;
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 68px;
  flex-wrap: wrap;
}

.brand { margin-right: auto; }

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

.brand-link {
  display: inline-flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--ink);
  line-height: 1.15;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: .02em;
}

.brand-tag {
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: .2rem;
}

.site-nav { display: block; }

.nav-list {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list li { position: relative; }

.nav-list a {
  display: inline-block;
  padding: .35rem 0;
  font-size: .85rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--muted);
  border-bottom: 2px solid transparent;
}

.nav-list a:hover,
.nav-list .current-menu-item > a,
.nav-list .current_page_item > a {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

.nav-list .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 210px;
  margin: 0;
  padding: .5rem;
  list-style: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: none;
}

.nav-list li:hover > .sub-menu,
.nav-list li:focus-within > .sub-menu { display: block; }

.nav-list .sub-menu a {
  display: block;
  padding: .45rem .6rem;
  border-radius: 8px;
  text-transform: none;
  letter-spacing: 0;
  font-size: .9rem;
}

.nav-list .sub-menu a:hover { background: var(--paper); }

.nav-toggle {
  display: none;
  align-items: center;
  gap: .55rem;
  padding: .5rem .7rem;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font: inherit;
  font-size: .8rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
}

.nav-bars {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  width: 18px;
}

.nav-bars span {
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}

.nav-toggle[aria-expanded="true"] .nav-bars span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-bars span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-bars span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.header-search { width: 220px; }

/* ---------- promo band ---------- */
.promo {
  background: linear-gradient(180deg, #f4ece0 0%, var(--paper) 100%);
  border-bottom: 1px solid var(--line);
  padding-block: clamp(2.5rem, 6vw, 5rem);
}

@media (prefers-color-scheme: dark) {
  .promo { background: linear-gradient(180deg, #1d1a15 0%, var(--paper) 100%); }
}

.promo-inner { max-width: 760px; }

.eyebrow {
  font-size: .75rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent-ink);
  margin-bottom: 1rem;
}

.promo-title {
  font-size: clamp(2.1rem, 5.2vw, 3.75rem);
  max-width: 22ch;
  margin-bottom: 1rem;
}

.promo-lede {
  color: var(--muted);
  font-size: 1.075rem;
  max-width: 56ch;
}

.promo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1.6rem;
}

.btn {
  display: inline-block;
  padding: .72rem 1.25rem;
  border-radius: 999px;
  font-size: .88rem;
  letter-spacing: .04em;
  text-decoration: none;
  border: 1px solid transparent;
}

.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--accent-ink); color: var(--paper); }

.btn-ghost { border-color: var(--line); color: var(--ink); background: var(--card); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-ink); }

.promo-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: 2rem;
  padding: 0;
  list-style: none;
}

.promo-chips a {
  display: inline-block;
  padding: .35rem .8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .8rem;
  text-decoration: none;
  color: var(--muted);
  background: var(--card);
}

.promo-chips a:hover { border-color: var(--accent); color: var(--accent-ink); }

/* ---------- layout ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  padding-block: clamp(2rem, 5vw, 3.5rem);
}

.has-sidebar .layout { grid-template-columns: minmax(0, 1fr) 320px; }

.content-col { min-width: 0; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--line);
}

.section-head h2 { margin: 0; font-size: 1.35rem; }

.section-link { font-size: .85rem; text-decoration: none; color: var(--muted); }
.section-link:hover { color: var(--accent-ink); }

/* ---------- cards ---------- */
.post-grid {
  display: grid;
  gap: 1.6rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
}

.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

.card-thumb {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #efe7d9;
}

@media (prefers-color-scheme: dark) {
  .card-thumb { background: #26231c; }
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}

.card:hover .card-thumb img { transform: scale(1.04); }

.card-thumb-fallback {
  display: grid;
  place-items: center;
  height: 100%;
  font-family: var(--font-serif);
  font-size: 3rem;
  color: var(--muted);
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: .55rem;
  flex: 1;
  padding: 1.15rem 1.2rem 1.35rem;
}

.pill {
  display: inline-block;
  width: fit-content;
  padding: .28rem .6rem;
  border-radius: 999px;
  background: rgba(191, 79, 33, .12);
  color: var(--accent-ink);
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
}

.card-title {
  margin: 0;
  font-size: 1.2rem;
  line-height: 1.3;
}

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

.card-excerpt {
  margin: 0;
  color: var(--muted);
  font-size: .93rem;
  flex: 1;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
  color: var(--muted);
  font-size: .78rem;
  letter-spacing: .03em;
}

/* ---------- single / page ---------- */
.entry {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  overflow: hidden;
}

.entry-header { padding: clamp(1.5rem, 4vw, 3rem) clamp(1.2rem, 4vw, 3rem) 0; }

.entry-title { max-width: 28ch; margin-top: .75rem; }

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
  color: var(--muted);
  font-size: .82rem;
  margin-top: .5rem;
}

.entry-thumb { margin: 1.75rem 0 0; aspect-ratio: 16 / 9; overflow: hidden; }
.entry-thumb img { width: 100%; height: 100%; object-fit: cover; }

.entry-content {
  padding: 1.75rem clamp(1.2rem, 4vw, 3rem) clamp(1.5rem, 4vw, 2.5rem);
  max-width: 74ch;
}

.entry-content > * { max-width: 70ch; }

.entry-content h2 { margin-top: 2em; }
.entry-content h3 { margin-top: 1.6em; }

.entry-content ul,
.entry-content ol { padding-left: 1.3em; margin-bottom: 1.15em; }

.entry-content li { margin-bottom: .4em; }

.entry-content blockquote {
  margin: 1.75em 0;
  padding: .25em 0 .25em 1.25em;
  border-left: 3px solid var(--accent);
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--muted);
}

.entry-content code {
  font-size: .9em;
  background: var(--paper);
  padding: .15em .4em;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.entry-content pre {
  overflow-x: auto;
  padding: 1.1rem 1.25rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: .88rem;
  line-height: 1.55;
}

.entry-content pre code { background: none; border: 0; padding: 0; }

.entry-content table { width: 100%; border-collapse: collapse; margin-bottom: 1.5em; font-size: .92rem; }
.entry-content th,
.entry-content td { border-bottom: 1px solid var(--line); padding: .6rem .75rem; text-align: left; }
.entry-content th { font-weight: 600; }

.entry-content figure { margin: 1.75em 0; }
.entry-content figcaption { font-size: .82rem; color: var(--muted); text-align: center; margin-top: .5rem; }

.entry-content .alignwide { max-width: 900px; }
.entry-content .alignfull {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
}

.entry-footer {
  padding: 0 clamp(1.2rem, 4vw, 3rem) clamp(1.5rem, 4vw, 2rem);
}

.tag-list a {
  display: inline-block;
  margin: 0 .35rem .35rem 0;
  padding: .25rem .65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .78rem;
  text-decoration: none;
  color: var(--muted);
}

.tag-list a:hover { border-color: var(--accent); color: var(--accent-ink); }

.page-links { margin: 1.5rem 0; font-size: .9rem; }

.post-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.75rem;
}

.post-nav a {
  display: block;
  padding: 1rem 1.15rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  font-size: .92rem;
  line-height: 1.4;
}

.post-nav a:hover { border-color: var(--accent); color: var(--accent-ink); }

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

/* ---------- archive / search / 404 ---------- */
.archive-head { margin-bottom: 2rem; }

.archive-title { margin-bottom: .35rem; }

.archive-desc { color: var(--muted); max-width: 62ch; }

.empty-state {
  padding: clamp(2rem, 5vw, 3.5rem);
  text-align: center;
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

.empty-state p { color: var(--muted); margin-bottom: 1.4rem; }

.empty-state .search-form { max-width: 420px; margin-inline: auto; }

.error-code {
  font-family: var(--font-serif);
  font-size: clamp(3.5rem, 12vw, 7rem);
  line-height: 1;
  margin-bottom: .5rem;
  color: var(--accent-ink);
}

/* ---------- widgets / sidebar ---------- */
.sidebar { display: flex; flex-direction: column; gap: 1.25rem; }

.widget {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.widget-title {
  font-family: var(--font-sans);
  font-size: .74rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .9rem;
}

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

.widget li { padding: .45rem 0; border-bottom: 1px solid var(--line); font-size: .93rem; }
.widget li:last-child { border-bottom: 0; padding-bottom: 0; }

.widget li a { text-decoration: none; }

.widget li a:hover { color: var(--accent-ink); text-decoration: underline; }

.widget .count { color: var(--muted); font-size: .8rem; }

.mini-post {
  display: flex;
  gap: .8rem;
  padding: .6rem 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
}

.mini-post:last-child { border-bottom: 0; padding-bottom: 0; }

.mini-post-thumb {
  flex: 0 0 64px;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  background: var(--paper);
}

.mini-post-thumb img { width: 100%; height: 100%; object-fit: cover; }

.mini-post-title { font-size: .9rem; line-height: 1.35; }
.mini-post-date { font-size: .75rem; color: var(--muted); margin-top: .2rem; }

.mini-post:hover .mini-post-title { color: var(--accent-ink); }

/* ---------- forms ---------- */
.search-form { display: flex; gap: .5rem; }

.search-field {
  flex: 1;
  min-width: 0;
  padding: .62rem .8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: .9rem;
}

.search-field::placeholder { color: var(--muted); }

.search-field:focus { border-color: var(--accent); outline: none; }

.search-submit {
  padding: .62rem 1rem;
  border: 0;
  border-radius: 10px;
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-size: .88rem;
  cursor: pointer;
}

.search-submit:hover { background: var(--accent-ink); }

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
  width: 100%;
  padding: .7rem .85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: .95rem;
}

.comment-form label { display: block; font-size: .85rem; margin-bottom: .35rem; color: var(--muted); }

.comment-form .submit {
  padding: .7rem 1.4rem;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  cursor: pointer;
}

.comment-form .submit:hover { background: var(--accent-ink); }

/* ---------- comments ---------- */
.comments {
  margin-top: 2rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  padding: clamp(1.25rem, 4vw, 2.25rem);
}

.comments-title { font-size: 1.2rem; margin-bottom: 1.25rem; }

.comment-list { list-style: none; margin: 0 0 1.5rem; padding: 0; }

.comment-list .children { list-style: none; margin: .75rem 0 0 2rem; padding: 0; }

.comment-body {
  display: flex;
  gap: .9rem;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
}

.comment-list > li:first-child > .comment-body,
.comment-list .children .comment-body { border-top: 0; padding-top: .75rem; }

.comment-avatar img { border-radius: 50%; }

.comment-main { min-width: 0; flex: 1; }

.comment-meta {
  display: flex;
  align-items: baseline;
  gap: .6rem;
  font-size: .82rem;
  color: var(--muted);
  margin-bottom: .35rem;
}

.comment-meta strong { color: var(--ink); font-size: .92rem; }

.comment-text { font-size: .95rem; }
.comment-text p:last-child { margin-bottom: .4rem; }

.comment-reply a { font-size: .8rem; text-decoration: none; }

.comment-mod { font-size: .8rem; color: var(--muted); }

.comments-closed { color: var(--muted); font-size: .9rem; }

/* ---------- pagination ---------- */
.pagination,
.comments-pagination { margin-top: 2.25rem; }

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
  justify-content: center;
}

.page-numbers {
  display: inline-block;
  min-width: 2.4rem;
  padding: .45rem .7rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  font-size: .85rem;
  text-align: center;
  text-decoration: none;
}

.page-numbers:hover { border-color: var(--accent); color: var(--accent-ink); }

.page-numbers.current { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.dots { border: 0; background: none; }

/* ---------- footer ---------- */
.site-footer {
  margin-top: clamp(2rem, 5vw, 4rem);
  border-top: 1px solid var(--line);
  background: var(--card);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2rem;
  padding-block: clamp(2rem, 4vw, 3rem);
}

.footer-col { min-width: 0; }

.footer-brand { font-size: 1.25rem; margin-bottom: .35rem; }

.footer-lede { color: var(--muted); font-size: .92rem; max-width: 34ch; }

.footer-list { list-style: none; margin: 0; padding: 0; }
.footer-list li { padding: .3rem 0; font-size: .92rem; }
.footer-list a { text-decoration: none; color: var(--ink); }
.footer-list a:hover { color: var(--accent-ink); }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.1rem;
  border-top: 1px solid var(--line);
  font-size: .85rem;
  color: var(--muted);
}

.footer-bottom p { margin: 0; }

.footer-nav { display: flex; flex-wrap: wrap; gap: 1rem; list-style: none; margin: 0; padding: 0; }
.footer-nav a { text-decoration: none; color: var(--muted); }
.footer-nav a:hover { color: var(--accent-ink); }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .has-sidebar .layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .header-search { display: none; }
  .site-nav { display: none; width: 100%; padding-bottom: 1rem; }
  .site-nav.is-open { display: block; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-list li { border-top: 1px solid var(--line); }
  .nav-list a { display: block; padding: .85rem .25rem; }
  .nav-list .sub-menu {
    position: static;
    display: block;
    border: 0;
    box-shadow: none;
    background: transparent;
    padding: 0 0 .5rem 1rem;
  }
  .post-nav { grid-template-columns: 1fr; }
  .post-nav-next { text-align: left; }
}

@media (max-width: 600px) {
  .brand-tag { display: none; }
  .comment-list .children { margin-left: 1rem; }
  .entry-meta { font-size: .78rem; }
}

/* ---------- print ---------- */
@media print {
  .site-header, .site-footer, .sidebar, .post-nav, .comments, .promo-actions, .pagination { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .entry { border: 0; }
  a { color: #000; text-decoration: underline; }
}