:root {
  --paper: #f6f4ee;
  --ink: #222620;
  --muted: #696d62;
  --line: #d9d9ce;
  --accent: #78613d;
  --white: #fffef9;
  --serif: Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.65 system-ui, -apple-system,
    BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

a { color: inherit; text-underline-offset: 5px; }

button, input, select, textarea { font: inherit; }
button, a, input, textarea, select { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { opacity: .5; cursor: wait; }
[hidden] { display: none !important; }

.wrap {
  width: min(1180px, calc(100% - 80px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 27px 0;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-size: 29px;
  letter-spacing: .17em;
  font-weight: 750;
  text-decoration: none;
  line-height: 1.15;
}

.brand span {
  display: block;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .25em;
  margin-top: 9px;
}

.brand-logo {
  display: block;
  width: 280px;
  height: 64px;
  object-fit: cover;
  object-position: center;
}

.site-header nav {
  display: flex;
  flex-shrink: 0;
  gap: 32px;
  font-size: 14px;
}

.site-header nav a { text-decoration: none; }
.site-header nav a:hover { text-decoration: underline; }

.eyebrow {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero {
  display: grid;
  grid-template-columns: 1fr 290px;
  align-items: center;
  gap: 70px;
  padding: 80px 0 85px;
  border-bottom: 1px solid var(--line);
}

h1, h2, h3, p { margin-top: 0; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.16;
}

h1 {
  font-size: clamp(42px, 5.2vw, 68px);
  letter-spacing: -.035em;
  margin: 20px 0 24px;
}

h1 em { font-weight: 400; color: var(--accent); }

.hero p {
  max-width: 590px;
  font-size: 17px;
  color: var(--muted);
  margin-bottom: 24px;
}

.read-link {
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}

/* Huruf A lama disembunyikan; monogram brand tampil lewat ::before. */
.monogram {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 300px;
  border: 1px solid var(--line);
  font-size: 0;
  color: #d1c7b3;
  background: linear-gradient(135deg, #efede4, #f8f6f0);
}

.monogram::before {
  content: "";
  display: block;
  width: 220px;
  height: 220px;
  background: url('/brand/aksara-icon.png') center / contain no-repeat;
}

.monogram span {
  position: absolute;
  bottom: 18px;
  font: 8px/1.5 system-ui;
  letter-spacing: .2em;
  color: var(--accent);
}

.listing { padding: 48px 0; }

.section-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 25px;
}

.section-top h2 { font-size: 33px; margin: 8px 0 0; }

.search {
  display: flex;
  gap: 8px;
  max-width: 360px;
}

.search input { width: 230px; }

.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 28px 0 32px;
}

.filters a {
  padding: 7px 16px;
  border: 1px solid var(--line);
  border-radius: 25px;
  font-size: 12px;
  text-decoration: none;
}

.filters .active,
.filters a:hover {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 30px;
}

.post-card {
  border-bottom: 1px solid var(--line);
  padding-bottom: 30px;
  min-width: 0;
}

.cover {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  max-height: none;
  aspect-ratio: auto;
  background: #eae7dc;
}

.post-card .cover {
  aspect-ratio: 16/9;
  object-fit: contain;
}

.card-body { padding-top: 22px; }

.post-card h2 {
  font-size: 32px;
  margin: 12px 0 15px;
  overflow-wrap: anywhere;
}

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

.post-card p {
  color: var(--muted);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.meta {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}

.post-card .read-link {
  display: inline-block;
  margin-top: 22px;
}

.pagination {
  display: flex;
  justify-content: space-between;
  padding-top: 25px;
  color: var(--muted);
  font-size: 13px;
}

.pagination div { display: flex; gap: 25px; }

.empty {
  padding: 70px 20px;
  text-align: center;
  border-block: 1px solid var(--line);
  margin-block: 35px;
}

.empty h1 { font-size: 42px; }
.empty h3 { font-size: 28px; }
.empty p { color: var(--muted); }

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 25px;
  padding: 35px 0;
  margin-top: 40px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

.site-footer strong {
  font-size: 18px;
  letter-spacing: .15em;
  color: var(--ink);
}

.site-footer p { margin: 7px 0 0; }

.site-footer > div:last-child {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.reading { max-width: 800px; margin: 60px auto 80px; }

.back-link {
  display: inline-block;
  font-size: 13px;
  margin-bottom: 45px;
}

.reading h1 {
  font-size: clamp(38px, 5vw, 60px);
  overflow-wrap: anywhere;
}

.reading .dek {
  font-family: var(--serif);
  font-size: 24px;
  color: var(--muted);
}

.reading header { margin-bottom: 35px; }

.prose {
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.9;
  margin-top: 35px;
  overflow-wrap: anywhere;
}

.prose p { white-space: pre-wrap; margin-bottom: 1.4em; }

.author-note {
  border-top: 1px solid var(--line);
  margin-top: 45px;
  padding-top: 30px;
}

.author-note h3 { font-size: 25px; margin: 10px 0; }
.author-note a { font-size: 13px; }
.about { padding-block: 25px; }

.notice {
  padding: 13px 18px;
  border: 1px solid var(--line);
  background: var(--white);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.notice.error {
  border-color: #b97b67;
  color: #842f20;
  background: #fff8f4;
}

.admin-main { padding: 25px 0 60px; }
.login-panel { max-width: 480px; margin: 55px auto; }
.login-panel h1 { font-size: 43px; }
.login-panel button { width: 100%; margin-top: 25px; }

label {
  display: block;
  font-size: 13px;
  font-weight: 650;
  margin: 20px 0 7px;
}

input, textarea, select {
  display: block;
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--white);
  color: var(--ink);
}

textarea { resize: vertical; }

button {
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--white);
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

button:hover:not(:disabled) { border-color: var(--accent); }

button.primary {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
}

button.danger { color: #963c2a; }
.admin-top { margin: 35px 0; }
.admin-top h1 { font-size: 42px; margin: 8px 0; }

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.actions a { font-size: 13px; }

.admin-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 35px;
}

.sidebar {
  border-right: 1px solid var(--line);
  padding-right: 25px;
}

.sidebar h2 { font-size: 23px; }

.sidebar hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 30px 0;
}

.sidebar .actions { margin-top: 20px; }
.sidebar .actions button { font-size: 11px; padding: 8px; }
.sidebar form button { margin-top: 10px; }

.post-item {
  display: block;
  width: 100%;
  text-align: left;
  margin: 10px 0;
  padding: 15px;
  background: transparent;
}

.post-item strong {
  display: block;
  margin-top: 6px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.editor fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
}

.editor legend {
  font-family: var(--serif);
  font-size: 27px;
  margin-bottom: 8px;
}

.help {
  font-size: 12px;
  color: var(--muted);
  margin: 7px 0 15px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.editor-cover {
  margin: 15px 0;
  height: 300px;
  max-height: 300px;
  aspect-ratio: auto;
  object-fit: contain;
}

.editor-status {
  display: flex;
  align-items: center;
  gap: 15px;
  margin: 22px 0;
  font-size: 12px;
  color: var(--muted);
}

.badge {
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--white);
  color: var(--ink);
}

#content {
  line-height: 1.8;
  font-family: var(--serif);
  font-size: 19px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

dialog {
  width: min(900px, 94vw);
  max-height: 90vh;
  border: 1px solid var(--line);
  padding: 25px;
  background: var(--paper);
  color: var(--ink);
}

dialog::backdrop { background: #22262099; }
dialog .reading { margin: 25px auto; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid #9d895b;
  outline-offset: 3px;
}

.share-section {
  margin-top: 45px;
  padding: 28px 0;
  border-block: 1px solid var(--line);
}

.share-section h2 { font-size: 27px; margin: 0 0 10px; }
.share-section > p { font-size: 14px; color: var(--muted); }
.share-actions { display: flex; flex-wrap: wrap; gap: 9px; }

.share-actions a,
.share-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--white);
  font: 600 12px/1.5 system-ui;
  text-decoration: none;
}

.share-actions a:hover,
.share-actions button:hover { border-color: var(--accent); }

.share-status { margin: 12px 0; }
.share-status:empty { display: none; }
.share-manual { font-size: 13px; margin: 15px 0; }

.share-manual summary {
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.share-manual input { font-size: 13px; }
.share-section .help { margin-bottom: 0; }

@media (min-width: 1000px) {
  .post-card:first-child {
    grid-column: 1/-1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 35px;
    align-items: center;
  }

  .post-card:first-child:not(:has(img)) {
    display: block;
    max-width: 800px;
  }

  .post-card:first-child h2 { font-size: 40px; }
  .post-card:first-child .card-body { padding: 15px 0; }
}

@media (max-width: 800px) {
  .wrap { width: calc(100% - 40px); }

  .hero {
    grid-template-columns: 1fr;
    padding: 50px 0;
    gap: 25px;
  }

  .monogram { display: none; }

  .section-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .search { max-width: none; width: 100%; }
  .search input { width: 100%; }
  .admin-grid { grid-template-columns: 1fr; }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 0 0 25px;
  }

  #post-list { max-height: 300px; overflow: auto; }
  .admin-top .actions { width: 100%; }
  .site-header nav { gap: 18px; }
  .reading { margin-top: 35px; }
  .site-footer { flex-direction: column; }
  .site-footer > div:last-child { align-items: flex-start; }
  .prose { font-size: 19px; }
}

@media (max-width: 520px) {
  .wrap { width: calc(100% - 32px); }
  .brand { font-size: 24px; }
  .brand-logo { width: 160px; height: 38px; }
  .site-header nav { font-size: 12px; gap: 14px; }
  .post-grid { grid-template-columns: 1fr; }
  .field-grid { grid-template-columns: 1fr; gap: 0; }
  .hero h1 { font-size: 40px; }
  .reading h1 { font-size: 38px; }
  .reading .dek { font-size: 21px; }
  .actions button { flex-grow: 1; }
  .listing { padding-top: 30px; }
  .login-panel h1 { font-size: 38px; }
}
