/*
Theme Name: Aksara Jawa Kita v2
Theme URI: https://example.com/aksara-jawa-kita
Author: Aksara Jawa Kita
Description: Tema WordPress ringan untuk situs alat konversi dan pembelajaran Aksara Jawa. Konversi Latin ke Aksara Jawa berjalan sepenuhnya di peramban, tanpa API berbayar.
Version: 1.2.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: aksara-jawa-kita
Tags: education, custom-menu, translation-ready, accessibility-ready, one-column
*/

/* =========================================================================
   1. FONTS — all self-hosted, no external requests.
      Licences live beside the files in assets/fonts/.
   ========================================================================= */
@font-face {
  font-family: "AJK Serif";
  src: url("assets/fonts/InstrumentSerif-regular.woff") format("woff");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "AJK Sans";
  src: url("assets/fonts/PlusJakartaSans-400.woff") format("woff");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "AJK Sans";
  src: url("assets/fonts/PlusJakartaSans-600.woff") format("woff");
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "AJK Sans";
  src: url("assets/fonts/PlusJakartaSans-700.woff") format("woff");
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Noto Sans Javanese Local";
  src: url("assets/fonts/NotoSansJavanese-regular.woff") format("woff"),
       url("assets/fonts/NotoSansJavanese-regular.ttf") format("truetype");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Noto Sans Javanese Local";
  src: url("assets/fonts/NotoSansJavanese-bold.woff") format("woff"),
       url("assets/fonts/NotoSansJavanese-bold.ttf") format("truetype");
  font-weight: 700; font-style: normal; font-display: swap;
}

/* =========================================================================
   2. TOKENS
      Palette taken from Javanese batik dyeing: wedel (indigo-black),
      sogan (the brown-gold of Surakarta batik), kelengan (undyed cloth).
   ========================================================================= */
:root {
  --paper:      #EFEBE1;
  --surface:    #FBF9F5;
  --surface-2:  #E7E2D5;
  --ink:        #15181F;
  --muted:      #5F5D56;
  --line:       #D9D3C4;
  --accent:     #9A6A1C;
  --accent-soft:#F0E4CC;

  /* The night band is fixed in both themes: the masthead and cover
     always read as the same dark cloth. */
  --night:       #15181F;
  --night-2:     #1D212B;
  --night-ink:   #F3EFE6;
  --night-muted: #918E85;
  --night-line:  #2E333F;
  --night-accent:#D8A64F;

  --font-display: "AJK Serif", "Iowan Old Style", Georgia, serif;
  --font-body:    "AJK Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-jawa:    "Noto Sans Javanese Local", "Noto Sans Javanese", "Javanese Text", serif;

  --wrap: 1080px;
  --wrap-read: 720px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:      #101318;
    --surface:    #171B22;
    --surface-2:  #1F242D;
    --ink:        #EDE9E0;
    --muted:      #928F87;
    --line:       #272C36;
    --accent:     #D8A64F;
    --accent-soft:#2A2214;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper:      #101318;
  --surface:    #171B22;
  --surface-2:  #1F242D;
  --ink:        #EDE9E0;
  --muted:      #928F87;
  --line:       #272C36;
  --accent:     #D8A64F;
  --accent-soft:#2A2214;
  color-scheme: dark;
}

/* =========================================================================
   3. BASE
   ========================================================================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0 0 .4em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.1rem, 5.4vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 4vw, 2.5rem); }
h3 { font-family: var(--font-body); font-weight: 600; font-size: 1.05rem; letter-spacing: 0; line-height: 1.35; }

p, ul, ol { margin: 0 0 1em; }
a { color: var(--accent); text-underline-offset: 3px; }
img { max-width: 100%; height: auto; }

:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.ajk-wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: 22px; }
.ajk-wrap--read { max-width: var(--wrap-read); }

.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px;
  overflow: hidden; clip: rect(1px,1px,1px,1px); clip-path: inset(50%); white-space: nowrap;
}
.skip-link:focus {
  position: fixed; top: 10px; left: 10px; z-index: 999;
  background: var(--night); color: var(--night-ink);
  padding: 12px 18px; border-radius: 2px; width: auto; height: auto;
  clip: auto; clip-path: none;
}

/* Javanese script.
   Its glyphs sit small against Latin at the same font-size, and it needs far
   more vertical room. Block uses get the generous line-height; a span inside
   running prose gets a size bump instead, so it reads at the weight of the
   text around it without wrecking the line rhythm. */
.ajk-jawa, .ajk-out, .ajk-key, td.ajk-g, .ajk-aks .g, .ajk-ex .jw {
  font-family: var(--font-jawa);
}
.ajk-out, .ajk-key, td.ajk-g, .ajk-aks .g, .ajk-ex .jw,
textarea.ajk-jawa, .ajk-split .word.ajk-jawa {
  line-height: 2.15;
}

/* Inline in prose: tables, paragraphs, list items, examples. */
.ajk-entry-content p .ajk-jawa,
.ajk-entry-content li .ajk-jawa,
.ajk-entry-content td .ajk-jawa,
.ajk-intro .ajk-jawa,
p .ajk-jawa, li .ajk-jawa {
  font-size: 1.45em;
  line-height: 1;
  vertical-align: -0.12em;
  padding-inline: 1px;
}

/* =========================================================================
   4. MASTHEAD — the night band
   ========================================================================= */
.ajk-header { background: var(--night); color: var(--night-ink); }
.ajk-header .ajk-wrap { display: flex; align-items: center; gap: 20px; padding-block: 18px; }

.ajk-brand { display: flex; align-items: center; gap: 12px; color: var(--night-ink); text-decoration: none; }
.ajk-brand .mark {
  width: 42px; height: 42px; flex: none;
  display: grid; place-items: center;
  border: 1.5px solid var(--night-accent); border-radius: 50%;
  color: var(--night-accent);
  font-family: var(--font-jawa); font-size: 19px; line-height: 1; padding-bottom: 3px;
}
.ajk-brand .name {
  font-family: var(--font-display); font-size: 1.3rem; letter-spacing: -.01em; line-height: 1;
}

.ajk-nav { margin-left: auto; }
.ajk-nav ul { list-style: none; display: flex; gap: 26px; margin: 0; padding: 0; }
.ajk-nav a {
  color: var(--night-muted); text-decoration: none; font-size: .95rem;
  padding-block: 4px; border-bottom: 1px solid transparent;
}
.ajk-nav a:hover, .ajk-nav .current-menu-item > a {
  color: var(--night-ink); border-bottom-color: var(--night-accent);
}

.ajk-menu-toggle {
  display: none; margin-left: auto;
  background: none; color: var(--night-ink);
  border: 1px solid var(--night-line); border-radius: 2px;
  padding: 9px 15px; font: inherit; font-size: .9rem; cursor: pointer;
}
@media (max-width: 760px) {
  .ajk-menu-toggle { display: block; }
  .ajk-nav {
    display: none; margin-left: 0; flex-basis: 100%; order: 3;
    border-top: 1px solid var(--night-line); padding-top: 14px;
  }
  .ajk-nav.is-open { display: block; }
  .ajk-nav ul { flex-direction: column; gap: 2px; }
  .ajk-nav a { display: block; padding: 10px 0; font-size: 1.05rem; border-bottom: 0; }
}

/* =========================================================================
   5. COVER — one word, two scripts
      This is the page's single bold moment. Everything below it stays quiet.
   ========================================================================= */
.ajk-cover {
  background: var(--night);
  color: var(--night-ink);
  padding-block: clamp(48px, 9vw, 96px) clamp(96px, 13vw, 150px);
  overflow: hidden;
}

.ajk-split {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  align-items: center;
  gap: clamp(20px, 5vw, 56px);
}
.ajk-split__rule { background: var(--night-line); align-self: stretch; }

.ajk-split__side { min-width: 0; display: grid; gap: 10px; }
.ajk-split__side--latin { text-align: right; }
.ajk-split__side--jawa  { text-align: left; }

.ajk-split .word {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 10vw, 6.2rem);
  line-height: .95;
  letter-spacing: -.03em;
  display: block;
}
.ajk-split .word.ajk-jawa {
  font-family: var(--font-jawa);
  font-size: clamp(2rem, 7.4vw, 4.6rem);
  line-height: 1.5;
  letter-spacing: 0;
  color: var(--night-accent);
}
.ajk-split .tag { font-size: .88rem; color: var(--night-muted); display: block; }

.ajk-cover__say {
  margin-top: clamp(32px, 5vw, 56px);
  max-width: 34ch;
}
.ajk-cover__say h1 {
  font-size: clamp(1.7rem, 3.6vw, 2.5rem);
  color: var(--night-ink);
  margin-bottom: .35em;
}
.ajk-cover__say p { color: var(--night-muted); margin: 0; font-size: 1.02rem; }

@media (max-width: 640px) {
  .ajk-split { grid-template-columns: 1fr; gap: 18px; }
  .ajk-split__rule { height: 1px; align-self: auto; }
  .ajk-split__side--latin, .ajk-split__side--jawa { text-align: center; }
}

/* The single orchestrated moment: the Javanese half arrives once, on load. */
@media (prefers-reduced-motion: no-preference) {
  .ajk-split__side--jawa .word { animation: ajk-arrive .9s cubic-bezier(.22,.8,.3,1) both .25s; }
  .ajk-split__side--jawa .tag  { animation: ajk-arrive .9s cubic-bezier(.22,.8,.3,1) both .4s; }
  @keyframes ajk-arrive {
    from { opacity: 0; transform: translateX(-14px); }
    to   { opacity: 1; transform: none; }
  }
}

/* =========================================================================
   6. CONVERTER — lifted off the cover
   ========================================================================= */
.ajk-toolwrap { margin-top: clamp(-130px, -11vw, -80px); position: relative; z-index: 2; }

.ajk-tool {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 24px 60px -32px rgba(10,12,18,.55);
  overflow: hidden;
}

.ajk-tabs { display: flex; border-bottom: 1px solid var(--line); }
.ajk-tabs button {
  flex: 1; appearance: none; border: 0; background: var(--surface-2);
  color: var(--muted); font: inherit; font-weight: 600; font-size: .95rem;
  padding: 16px 12px; cursor: pointer; border-bottom: 2px solid transparent;
}
.ajk-tabs button[aria-selected="true"] {
  background: var(--surface); color: var(--ink); border-bottom-color: var(--accent);
}

.ajk-panel { padding: clamp(18px, 3vw, 30px); display: grid; gap: 18px; }

.ajk-lbl { display: block; font-size: .85rem; font-weight: 600; color: var(--muted); margin-bottom: 8px; }

.ajk-tool textarea {
  width: 100%; min-height: 108px; resize: vertical; font: inherit;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--line); border-radius: 3px; padding: 14px 16px;
}
.ajk-tool textarea.ajk-jawa { font-size: 1.5rem; line-height: 2.2; }

.ajk-out {
  min-height: 108px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 3px; padding: 16px 18px;
  font-size: clamp(1.6rem, 4.8vw, 2.1rem); line-height: 2.25;
  word-break: break-word; overflow-wrap: anywhere;
}
.ajk-out.is-latin { font-family: var(--font-body); font-size: 1.1rem; line-height: 1.7; }
.ajk-out:empty::before {
  content: attr(data-placeholder);
  color: var(--muted); font-family: var(--font-body); font-size: .98rem; line-height: 1.6;
}

.ajk-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: .86rem; color: var(--muted); }
.ajk-count { font-variant-numeric: tabular-nums; }

.ajk-btnrow { display: flex; flex-wrap: wrap; gap: 10px; }
.ajk-btn {
  appearance: none; font: inherit; font-weight: 600; font-size: .92rem;
  padding: 11px 22px; border-radius: 3px; cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--ink);
}
.ajk-btn--primary { background: var(--night); border-color: var(--night); color: var(--night-ink); }
.ajk-btn:hover { border-color: var(--accent); }
.ajk-btn--primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

.ajk-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ajk-chip {
  appearance: none; font: inherit; font-size: .85rem; cursor: pointer;
  padding: 5px 13px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--muted);
}
.ajk-chip:hover { color: var(--ink); border-color: var(--accent); }

.ajk-notice {
  background: var(--accent-soft); color: var(--ink);
  border-left: 3px solid var(--accent);
  padding: 13px 16px; font-size: .9rem; line-height: 1.55; margin: 0;
}
.ajk-notice ul { margin: 0; padding-left: 18px; }

.ajk-opts { border-top: 1px solid var(--line); padding-top: 16px; }
.ajk-opts > summary { cursor: pointer; font-size: .9rem; font-weight: 600; color: var(--muted); }
.ajk-optgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 16px; }
.ajk-opt { display: flex; gap: 10px; align-items: flex-start; font-size: .89rem; }
.ajk-opt input { margin-top: 4px; flex: none; accent-color: var(--accent); }
.ajk-opt small { display: block; color: var(--muted); font-size: .82rem; line-height: 1.45; }

.ajk-keys { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ajk-key {
  appearance: none; cursor: pointer; min-width: 44px; padding: 8px 5px;
  border: 1px solid var(--line); border-radius: 3px;
  background: transparent; color: var(--ink); font-size: 1.2rem;
}
.ajk-key:hover { border-color: var(--accent); background: var(--accent-soft); }
.ajk-keys-label { font-size: .85rem; font-weight: 600; color: var(--muted); margin-top: 14px; }

/* =========================================================================
   7. SECTIONS
   ========================================================================= */
.ajk-section { padding-block: clamp(52px, 8vw, 88px) 0; }
.ajk-section > .ajk-wrap > h2 { max-width: 20ch; }

/* A kicker, set in the display face — not a tracked-out capital label. */
.ajk-eyebrow {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--accent);
  margin: 0 0 .25em;
}
.ajk-intro { color: var(--muted); max-width: 62ch; font-size: 1.03rem; }

/* Tool cards: a hairline grid, not a tray of identical rounded cards. */
.ajk-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1px; margin-top: 32px;
  background: var(--line); border: 1px solid var(--line);
}
.ajk-card {
  background: var(--paper); padding: 26px 24px 30px;
  display: grid; gap: 7px; align-content: start; min-width: 0;
  text-decoration: none; color: inherit;
  border-top: 2px solid transparent;
}
.ajk-card:hover { background: var(--surface); border-top-color: var(--accent); }
.ajk-card .g { font-family: var(--font-jawa); font-size: 1.7rem; line-height: 1.8; color: var(--accent); }
.ajk-card h3 { margin: 0; }
.ajk-card p { margin: 0; font-size: .91rem; color: var(--muted); }

/* Letter grid */
.ajk-aks-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 1px; margin-top: 32px;
  background: var(--line); border: 1px solid var(--line);
}
.ajk-aks { background: var(--paper); padding: 16px 8px 14px; text-align: center; }
.ajk-aks:hover { background: var(--surface); }
.ajk-aks .g { font-size: 2rem; display: block; color: var(--ink); }
.ajk-aks .l { font-size: .86rem; color: var(--muted); }

/* Tables */
.ajk-tablewrap { overflow-x: auto; margin-top: 26px; border-top: 1.5px solid var(--ink); }
.ajk-tablewrap table { border-collapse: collapse; width: 100%; font-size: .95rem; margin: 0; }
.ajk-tablewrap th, .ajk-tablewrap td {
  text-align: left; padding: 14px 18px 14px 0;
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.ajk-tablewrap th { font-size: .82rem; color: var(--muted); font-weight: 600; }
.ajk-tablewrap tr:last-child td { border-bottom: 0; }
td.ajk-g { font-size: 1.7rem; }
td.ajk-cp { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .85rem; }

/* Steps — genuinely a sequence, so they are numbered. */
.ajk-steps { margin: 30px 0 0; padding: 0; list-style: none; display: grid; gap: 0; counter-reset: ajkstep; }
.ajk-steps li {
  display: flex; gap: 20px; counter-increment: ajkstep; min-width: 0;
  padding-block: 22px; border-top: 1px solid var(--line);
}
.ajk-steps li:last-child { border-bottom: 1px solid var(--line); }
.ajk-steps li::before {
  content: counter(ajkstep); flex: none;
  font-family: var(--font-display); font-size: 2rem; line-height: 1;
  color: var(--accent); width: 42px;
}
.ajk-steps strong { display: block; font-size: 1.02rem; margin-bottom: 2px; }
.ajk-steps span { font-size: .93rem; color: var(--muted); }

/* Worked examples */
.ajk-ex { display: grid; gap: 0; margin-top: 26px; }
.ajk-ex > div {
  padding: 22px 0; border-top: 1px solid var(--line);
  display: grid; gap: 6px; min-width: 0;
}
.ajk-ex > div:last-child { border-bottom: 1px solid var(--line); }
.ajk-ex .pair { display: flex; flex-wrap: wrap; align-items: baseline; gap: 18px; }
.ajk-ex .lat { font-family: var(--font-display); font-size: 1.5rem; }
.ajk-ex .jw { font-size: 1.7rem; color: var(--accent); }
.ajk-ex .why { font-size: .93rem; color: var(--muted); max-width: 70ch; }

/* FAQ */
.ajk-faqlist { margin-top: 26px; border-top: 1px solid var(--line); }
.ajk-faq { border-bottom: 1px solid var(--line); padding-block: 18px; }
.ajk-faq summary { cursor: pointer; font-weight: 600; font-size: 1.02rem; }
.ajk-faq summary::marker { color: var(--accent); }
.ajk-faq p { margin: 10px 0 0; font-size: .95rem; color: var(--muted); max-width: 70ch; }

/* =========================================================================
   8. POSTS AND PAGES
   ========================================================================= */
.ajk-main { padding-block: 44px 0; }
.ajk-entry { max-width: 68ch; }
.ajk-entry-meta { font-size: .88rem; color: var(--muted); margin-bottom: 1.6em; }
.ajk-entry-content > * + * { margin-top: 1.1em; }
.ajk-entry-content h2 { margin-top: 1.7em; }
.ajk-entry-content h3 { margin-top: 1.5em; }
.ajk-entry-content blockquote {
  margin: 1.6em 0; padding: 2px 0 2px 22px;
  border-left: 3px solid var(--accent); color: var(--muted);
  font-family: var(--font-display); font-size: 1.25rem; line-height: 1.4;
}
.ajk-entry-content table { width: 100%; border-collapse: collapse; font-size: .95rem; display: block; overflow-x: auto; }
.ajk-entry-content th, .ajk-entry-content td { padding: 11px 14px 11px 0; border-bottom: 1px solid var(--line); text-align: left; }
.ajk-entry-content pre { overflow-x: auto; background: var(--surface-2); padding: 16px; border-radius: 3px; }

.ajk-list { display: grid; gap: 0; margin-top: 26px; border-top: 1px solid var(--line); }
.ajk-list article { padding-block: 26px; border-bottom: 1px solid var(--line); min-width: 0; }
.ajk-list h2 { font-size: 1.6rem; margin: 0 0 .2em; }
.ajk-list h2 a { color: inherit; text-decoration: none; }
.ajk-list h2 a:hover { color: var(--accent); }
.ajk-list p { margin: 0; font-size: .95rem; color: var(--muted); max-width: 70ch; }

.ajk-breadcrumbs { font-size: .86rem; color: var(--muted); margin-bottom: 20px; }
.ajk-breadcrumbs a { color: var(--muted); text-decoration: none; }
.ajk-breadcrumbs a:hover { color: var(--ink); }
.ajk-breadcrumbs span[aria-hidden] { padding-inline: 8px; color: var(--line); }

.ajk-pagination { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 6px; }
.ajk-pagination .page-numbers {
  display: inline-block; padding: 9px 15px; border: 1px solid var(--line);
  background: transparent; color: var(--ink); text-decoration: none; font-size: .9rem;
}
.ajk-pagination .page-numbers.current { background: var(--night); border-color: var(--night); color: var(--night-ink); }

.ajk-searchform { display: flex; gap: 8px; margin-top: 20px; max-width: 440px; }
.ajk-searchform input[type="search"] {
  flex: 1; min-width: 0; font: inherit; padding: 11px 15px;
  border: 1px solid var(--line); border-radius: 3px;
  background: var(--surface); color: var(--ink);
}

.ajk-related { margin-top: 56px; padding-top: 30px; border-top: 1.5px solid var(--ink); }

/* =========================================================================
   9. FOOTER
   ========================================================================= */
.ajk-footer { margin-top: 84px; background: var(--night); color: var(--night-muted); }
.ajk-footer .ajk-wrap { padding-block: 44px 52px; display: grid; gap: 18px; }
.ajk-footer ul { list-style: none; display: flex; flex-wrap: wrap; gap: 24px; margin: 0; padding: 0; }
.ajk-footer a { color: var(--night-muted); text-decoration: none; font-size: .93rem; }
.ajk-footer a:hover { color: var(--night-ink); }
.ajk-footer small { color: var(--night-muted); font-size: .84rem; line-height: 1.65; display: block; max-width: 72ch; }
.ajk-footer .ajk-footmark {
  font-family: var(--font-jawa); font-size: 1.6rem; line-height: 2;
  color: var(--night-accent);
}

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