@import url('https://fonts.googleapis.com/css2?family=Work+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,300;1,400;1,500;1,600;1,700;1,800&display=swap');

/* =========================================================
   Minimalist / Clean Blog — banyak whitespace, satu kolom,
   tipografi jadi fokus utama.
   ========================================================= */

:root {
  --color-bg: #f9fafb;
  --color-text: #11181c;
  --color-text-secondary: #687076;
  --color-text-muted: #6b6b6b;
  --color-border: #e8e8e8;
  --color-accent: #1a1a1a;
  --color-accent-soft: #f4f4f4;
  --content-width: 880px;
  --public-content-width: 750px;
  --font-sans: 'Work Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-sans);
  font-size: 19px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.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;
}

::selection {
  background: #d9d9d9;
}

/* ---------- Layout: satu kolom di tengah, tanpa sidebar ---------- */

.wrap {
  max-width: var(--public-content-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Bio Header (Homepage) ---------- */

.bio-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 56px;
  gap: 40px;
}

.bio-text {
  flex: 1;
}

.bio-name {
  font-family: var(--font-sans);
  font-size: 44px;
  font-weight: 700;
  margin: 55px 0 10px 0;
  letter-spacing: -0.03em;
}

.bio-description {
  font-family: var(--font-sans);
  font-size: 18px;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin: 0 0 16px 0;
}

.bio-description a {
  color: #0070f3;
  text-decoration: none;
}

.bio-description a:hover {
  text-decoration: underline;
}

.bio-links {
  display: flex;
  gap: 16px;
}

.bio-links a {
  font-family: var(--font-sans);
  font-size: 18px;
  color: var(--color-text);
  font-weight: 600;
  text-decoration: none;
}

.bio-links a:hover {
  text-decoration: underline;
}

.bio-avatar img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin-top: 50px;
}

.site-title {
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--color-text);
}

.site-nav {
  font-family: var(--font-sans);
  font-size: 14px;
}

.site-nav a {
  color: var(--color-text-muted);
  text-decoration: none;
  margin-left: 20px;
}

.site-nav a:hover {
  color: var(--color-text);
}

main {
  padding-bottom: 96px;
  min-height: 60vh;
}

.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 40px 0 64px;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--color-text-muted);
}

/* ---------- Search bar ---------- */

.search-box {
  margin-bottom: 56px;
}

.search-box input {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 15px;
  padding: 10px 0;
  border: none;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  background: transparent;
  outline: none;
  transition: border-color 0.15s ease;
  border-radius: 0;
}

.search-box input:focus {
  border-color: #bdbdbd;
}

.search-box input::placeholder {
  color: #a8a8a8;
}

/* ---------- Daftar post: vertikal, judul -> deskripsi -> meta ---------- */

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

.post-item {
  padding: 24px 0;
}

.post-item:first-child {
  padding-top: 0;
}

.post-item:last-child {
  border-bottom: none;
}

.post-item-title {
  font-family: var(--font-sans);
  margin: 0 0 8px;
  font-size: 23px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.post-item-title a {
  color: var(--color-text);
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-position: 0 100%;
  background-repeat: no-repeat;
  background-size: 0 1px;
  transition: background-size 0.2s ease;
}

.post-item-title a:hover {
  background-size: 100% 1px;
}

.post-item-excerpt {
  font-family: var(--font-sans);
  margin: 0 0 10px;
  color: var(--color-text-muted);
  font-size: 16px;
  line-height: 1.5;
}

.post-item-meta {
  font-family: var(--font-sans);
  font-size: 13px;
  color: #a0a0a0;
}

.post-item-meta .dot {
  margin: 0 8px;
}

.empty-state {
  padding: 64px 0;
  text-align: center;
  color: var(--color-text-muted);
  font-family: var(--font-sans);
  font-size: 15px;
}

/* ---------- Load more ---------- */

.load-more-wrap {
  text-align: center;
  padding-top: 40px;
}

.btn-load-more {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  background: var(--color-accent-soft);
  border: none;
  border-radius: 100px;
  padding: 12px 28px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-load-more:hover {
  background: #eaeaea;
}

.btn-load-more.htmx-request {
  opacity: 0.6;
}

/* ---------- Column Layout for Post Detail ---------- */

.post-layout-container {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.post-content-column {
  padding: 0 45px;
  flex-grow: 1;
  display: flex;
  justify-content: center;
}

.post-content-column article {
  width: 100%;
  max-width: 750px;
  padding: 35px 0;
}

.post-sidebar-column {
  flex: 0 0 300px;
  padding: 0 45px;
  border-left: 1px solid var(--color-border);
  position: sticky;
  top: 0px;
  display: none;
}

@media (min-width: 1280px) {
  .post-sidebar-column {
    display: block;
  }
}

.post-sidebar-sticky {
  padding: 65px 0;
  position: fixed;
  width: 210px;
}

.sidebar-avatar {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.sidebar-name {
  font-family: var(--font-sans);
  font-size: 21px;
  font-weight: 600;
  margin-top: 15px;
  letter-spacing: -0.04em;
}

.sidebar-description {
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.3;
  color: var(--color-text-secondary);
  margin-top: 5px;
}

.sidebar-links {
  margin-top: 15px;
  display: grid;
  gap: 10px;
}

.sidebar-links a {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
}

.sidebar-links a:hover {
  text-decoration: underline;
}

/* ---------- Single post ---------- */

.post-header {
  padding: 8px 0 32px;
}

.post-back-link {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 19px;
  color: var(--color-text-secondary);
  text-decoration: none;
  margin-bottom: 15px;
}

.post-back-link:hover {
  color: var(--color-text);
}

.post-title {
  font-family: var(--font-sans);
  font-size: 35px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.034em;
  margin: 0 0 12px;
}

.post-excerpt {
  font-family: var(--font-sans);
  font-size: 20px;
  line-height: 1.5;
  color: var(--color-text-secondary);
  margin: 0 0 10px 0;
  letter-spacing: -0.015em;
}

.post-meta {
  font-family: var(--font-sans);
  font-size: 15px;
  color: #a0a0a0;
  margin-bottom: 15px;
}

.post-meta .pipe {
  margin: 0 8px;
  color: #d0d0d0;
}

.post-body {
  font-size: 19px;
  line-height: 1.6;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

.post-body h1,
.post-body h2,
.post-body h3 {
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 1.8em 0 0.6em;
  line-height: 1.3;
}

.post-body h1 {
  font-size: 26px;
}

.post-body h2 {
  font-size: 23px;
}

.post-body h3 {
  font-size: 20px;
}

.post-body p {
  font-size: 19px;
  line-height: 1.6;
  letter-spacing: -0.016em;
  margin: 0 0 1.4em;
  color: var(--color-text);
}

.post-body a {
  color: #0070f3;
  text-decoration: none;
}

.post-body a:hover {
  text-decoration: underline;
}

.post-body strong {
  font-weight: 600;
}

.post-body ul,
.post-body ol {
  margin: 0 0 1.4em;
  padding-left: 1.4em;
}

.post-body li {
  font-size: 17px;
  line-height: 1.6;
  letter-spacing: -0.016em;
  color: var(--color-text);
  margin-bottom: 0.5em;
}

.post-body blockquote {
  margin: 1.6em 0;
  padding-left: 20px;
  border-left: 3px solid var(--color-border);
  color: var(--color-text-muted);
}

.table-container {
  overflow-x: auto;
  margin: 1.8em 0;
}

.post-body table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
}

.post-body th,
.post-body td {
  padding: 12px 15px;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
}

.post-body th {
  font-weight: 600;
  background-color: var(--color-accent-soft);
  color: var(--color-text);
}

.post-body tr:hover {
  background-color: #fcfcfc;
}

.post-body code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--color-accent-soft);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

.post-body pre {
  background: #f5f5f5 !important;
  color: var(--color-text);
  padding: 20px 22px;
  border-radius: 8px;
  border: 1px solid var(--color-border);
  overflow-x: auto;
  margin: 1.8em 0;
  font-size: 15px;
  line-height: 1.6;
}

.post-body pre code,
.post-body pre code.hljs {
  font-family: var(--font-mono);
  background: transparent !important;
  padding: 0;
  color: inherit;
}

.post-body + .back-link,
article .back-link {
  display: inline-block;
  margin-top: 56px;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--color-text-muted);
  text-decoration: none;
}

.back-link:hover {
  color: var(--color-text);
}

.post-cover {
  margin-bottom: 32px;
}

.post-cover-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 400px;
  object-fit: cover;
  border-radius: 12px;
}

.post-body img {
  display: block;
  width: calc(100% + 220px);
  margin-left: -110px;
  margin-right: -110px;
  height: auto;
  margin-top: 1.5em;
  margin-bottom: 1.5em;
  border-radius: 8px;
}

.post-img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 2em auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.upload-container {
  border: 1px dashed var(--color-border);
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 24px;
  background: #fcfcfc;
}

.upload-row {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 8px;
}

.upload-row input[type="file"] {
  flex: 1;
  border: none;
  background: none;
  padding: 0;
}

/* ---------- Admin panel ---------- */

.admin-body {
  font-family: var(--font-sans);
  background: #fafafa;
}

.admin-header {
  background: #1a1a1a;
  color: #fff;
  padding: 18px 0;
}

.admin-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--content-width);
}

.admin-header a {
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
}

.admin-header nav a {
  color: #bbb;
  font-weight: 400;
  font-size: 14px;
  margin-left: 18px;
}

.admin-header nav a:hover {
  color: #fff;
}

.admin-wrap {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 40px 24px 96px;
}

.admin-card {
  background: #fff;
  border: 1px solid #eaeaea;
  border-radius: 12px;
  padding: 32px;
}

.login-wrap {
  max-width: 380px;
  margin: 96px auto;
  padding: 0 24px;
}

.login-wrap h1 {
  font-size: 22px;
  margin-bottom: 28px;
  text-align: center;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #444;
}

.field input,
.field textarea {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 15px;
  padding: 10px 12px;
  border: 1px solid #dcdcdc;
  border-radius: 8px;
  outline: none;
  background: #fff;
  color: #1a1a1a;
}

.field textarea {
  font-family: var(--font-mono);
  font-size: 14px;
  resize: vertical;
  min-height: 320px;
  line-height: 1.6;
}

.field input:focus,
.field textarea:focus {
  border-color: #999;
}

.field-hint {
  font-size: 12px;
  color: #888;
  margin-top: 5px;
}

.field-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
}

.field-checkbox input {
  width: auto;
}

.btn {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.btn-primary {
  background: #1a1a1a;
  color: #fff;
}

.btn-primary:hover {
  background: #333;
}

.btn-secondary {
  background: #ececec;
  color: #1a1a1a;
}

.btn-secondary:hover {
  background: #e0e0e0;
}

.btn-danger {
  background: #fff;
  color: #c0392b;
  border: 1px solid #f0d6d3;
}

.btn-danger:hover {
  background: #fdf2f1;
}

.error-msg {
  background: #fdf2f1;
  color: #c0392b;
  border: 1px solid #f0d6d3;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  margin-bottom: 20px;
}

.success-msg {
  background: #f0f9f2;
  color: #2b7a3d;
  border: 1px solid #d3f0d9;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  margin-bottom: 20px;
}

.admin-page-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.admin-page-title h1 {
  font-size: 22px;
  margin: 0;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid #eee;
  font-size: 14px;
}

.admin-table th {
  color: #888;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 100px;
}

.badge-published {
  background: #e6f6e9;
  color: #2b7a3d;
}

.badge-draft {
  background: #f0f0f0;
  color: #777;
}

.row-actions a,
.row-actions button {
  font-size: 13px;
  margin-right: 12px;
  color: #555;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  padding: 0;
}

.row-actions a:hover,
.row-actions button:hover {
  color: #1a1a1a;
  text-decoration: underline;
}

.row-actions .danger {
  color: #c0392b;
}

/* ---------- Responsif mobile ---------- */

@media (max-width: 600px) {
  body {
    font-size: 18px;
    overflow-x: hidden;
  }

  .bio-header {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 0px;
    margin-top: -16px;
    margin-bottom: 24px;
  }

  .bio-avatar img {
    display: none;
  }

  .post-title {
    font-size: 28px;
  }

  .post-content-column {
    padding: 0 16px;
  }

  .post-body img {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .post-layout-container {
    display: block;
  }

  .post-cover-img {
    max-height: 240px;
    border-radius: 8px;
  }

  .post-body pre {
    font-size: 14px;
    padding: 14px;
    overflow-x: auto;
  }

  .post-item-title {
    font-size: 21px;
  }

  .admin-wrap {
    padding: 24px 16px 64px;
  }

  .admin-card {
    padding: 20px;
  }

  .admin-header .wrap {
    flex-wrap: wrap;
    gap: 10px;
  }
}

/* ---------- KaTeX / LaTeX ---------- */

.katex-display {
  margin: 1.8em 0;
  overflow-x: auto;
  overflow-y: hidden;
}

.katex-display > .katex {
  text-align: center;
}

.post-body .katex-display {
  padding: 12px 0;
}
