/* Blog: senarai tulisan, halaman post dan komen. Token warna dan font dari styles.css. */
:root {
  --serif: "Newsreader", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --measure: 680px;
}

/* ---------- /blog/ ---------- */
.blog { padding-top: 32px; }
.blog__title { font: 600 clamp(64px, 11.2vw, 164px)/.88 var(--display); letter-spacing: -.055em; margin-left: -.04em; }
.blog__lede { max-width: 620px; margin-top: 32px; font-size: 22px; line-height: 1.4; letter-spacing: -.01em; color: var(--muted); }
.blog__soon { margin-top: 64px; padding-top: 28px; border-top: 1px solid var(--ink); font: 400 28px/1.3 var(--display); letter-spacing: -.02em; color: var(--muted); }

.blog__tools { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin: 72px 0 20px; }
.blog__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.blog__tags button {
  padding: 7px 13px; border: 1px solid var(--line); border-radius: 999px; background: transparent;
  color: var(--ink); font: inherit; font-size: 12px; cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
.blog__tags button:hover { border-color: var(--ink); }
.blog__tags button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.blog__tags button[aria-pressed="true"] .muted { color: inherit; opacity: .6; }
.blog__search {
  display: flex; align-items: center; gap: 8px; flex: 0 1 280px;
  padding: 0 16px; border: 1px solid var(--ink); border-radius: 999px;
}
.blog__search svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.blog__search input { width: 100%; padding: 11px 0; border: 0; background: none; color: var(--ink); font: 15px/1.2 var(--sans); outline: none; }
.blog__search:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.blog__empty { padding: 28px 0; }
.post-row[hidden] { display: none; }

/* ---------- Halaman post ---------- */
.post { padding-top: 40px; }
.post__head { max-width: 980px; }
.post__back { display: inline-block; text-decoration: none; padding: 6px 0; color: var(--muted); transition: color .2s ease, transform .2s ease; }
.post__back:hover { color: var(--ink); transform: translateX(-4px); }
.post__meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 36px; }
.post__title { margin-top: 18px; font: 600 clamp(44px, 6.4vw, 96px)/.95 var(--display); letter-spacing: -.05em; margin-left: -.03em; text-wrap: balance; }
.post__lede { max-width: 760px; margin-top: 28px; font-size: 22px; line-height: 1.4; letter-spacing: -.01em; color: var(--muted); }
.post__tags { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 24px; }
.post__tags a { color: var(--accent); text-decoration: none; }
.post__tags a:hover { text-decoration: underline; }
.post__cover { margin: 56px 0 0; }
.post__cover img { width: 100%; max-height: 640px; object-fit: cover; border-radius: var(--radius-xl); }

/* Isi tulisan */
.prose {
  max-width: var(--measure); margin: 64px auto 0;
  font: 400 20px/1.68 var(--serif); color: #26282A;
  font-optical-sizing: auto; hanging-punctuation: first; overflow-wrap: break-word;
}
.prose > * + * { margin-top: 1.1em; }
.prose h2, .prose h3, .prose h4 { font-family: var(--display); color: var(--ink); letter-spacing: -.03em; text-wrap: balance; }
.prose h2 { font-size: 34px; line-height: 1.12; font-weight: 600; margin-top: 2em; }
.prose h3 { font-size: 25px; line-height: 1.2; font-weight: 600; margin-top: 1.7em; }
.prose h4 { font-size: 20px; line-height: 1.3; font-weight: 600; margin-top: 1.5em; }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: .6em; }
.prose a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose u { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose strong { font-weight: 600; color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: .35em; }
.prose li::marker { color: var(--muted); }
.prose blockquote {
  margin-inline: 0; padding: 4px 0 4px 24px; border-left: 3px solid var(--accent);
  font-style: italic; font-size: 22px; line-height: 1.55; color: var(--ink);
}
.prose hr { border: 0; height: 1px; background: var(--line); margin-block: 2.4em; }
.prose img, .prose video { border-radius: 16px; }
.prose figure { margin-inline: 0; }
.prose figcaption { margin-top: 10px; font: 12px/1.5 var(--mono); color: var(--muted); text-align: center; }
/* Gambar boleh keluar sikit dari lajur teks supaya nampak lega */
.prose > figure, .prose > p > img:only-child, .prose > img { width: min(100vw - 2 * var(--gutter), 920px); max-width: none; margin-left: 50%; transform: translateX(-50%); }
.prose > p:has(> img:only-child) { margin-block: 2em; }
.prose :not(pre) > code {
  padding: .12em .38em; border-radius: 6px; background: rgb(27 28 30 / .07);
  font: .78em/1 var(--mono); color: var(--ink);
}
.prose pre {
  overflow-x: auto; padding: 20px 22px; border-radius: 14px; background: #15181A; color: #C9D1D9;
  font: 14px/1.65 var(--mono); tab-size: 2;
}
.prose pre code { font: inherit; }
.prose table { width: 100%; border-collapse: collapse; font: 15px/1.45 var(--sans); }
.prose th, .prose td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { font-weight: 500; border-bottom-color: var(--ink); }
.prose .table-scroll { overflow-x: auto; }

/* Post sebelum / seterusnya */
.post__pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: var(--measure); margin: 96px auto 0; }
.post__pager:empty { display: none; }
.post__pager a {
  display: grid; gap: 8px; padding: 22px 24px; border: 1px solid var(--line); border-radius: var(--radius-l);
  font: 600 20px/1.2 var(--display); letter-spacing: -.02em; text-decoration: none;
  transition: border-color .2s ease, transform .2s ease;
}
.post__pager a:hover { border-color: var(--ink); transform: translateY(-2px); }
.post__pager-next { grid-column: 2; text-align: right; }

/* ---------- Komen ---------- */
.komen { max-width: var(--measure); margin: 96px auto 0; padding-top: 28px; border-top: 1px solid var(--ink); }
.komen__head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.komen__title { font: 600 34px/1 var(--display); letter-spacing: -.04em; }
.komen__tabs { display: inline-flex; padding: 4px; border-radius: 999px; background: var(--card); }
.komen__tabs button {
  padding: 8px 14px; border: 0; border-radius: 999px; background: transparent; color: var(--muted);
  font: inherit; font-size: 12px; cursor: pointer; transition: background-color .2s ease, color .2s ease;
}
.komen__tabs button[aria-selected="true"] { background: var(--bg); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / .08); }
.komen__panel { margin-top: 28px; }
.komen__note { margin-bottom: 16px; }

.komen__list:not(:empty) { margin-bottom: 32px; }
.komen__item { padding: 18px 0; border-bottom: 1px solid var(--line); }
.komen__item:first-child { padding-top: 0; }
.komen__who { display: flex; align-items: baseline; gap: 10px; }
.komen__who b { font: 600 16px/1.3 var(--sans); }
.komen__text { margin-top: 6px; font-size: 16px; line-height: 1.55; white-space: pre-line; overflow-wrap: anywhere; }

.komen__form { display: grid; gap: 14px; }
.komen__field { display: grid; gap: 6px; }
.komen__field input, .komen__field textarea {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px;
  background: #F2F2EE; color: var(--ink); font: 16px/1.45 var(--sans); resize: vertical;
  transition: border-color .2s ease, background-color .2s ease;
}
.komen__field input:focus, .komen__field textarea:focus { outline: none; border-color: var(--ink); background: #fff; }
.komen__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.komen__actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.komen__actions .btn { border: 0; cursor: pointer; }
.komen__actions .btn:disabled { opacity: .5; cursor: progress; transform: none; }
.komen__status.is-ok { color: var(--accent); }
.komen__status.is-err { color: #A2412F; }

/* ---------- Telefon ---------- */
@media (max-width: 720px) {
  .blog { padding-top: 18px; }
  .blog__title { font-size: clamp(52px, 16.5vw, 80px); }
  .blog__lede { font-size: 18px; margin-top: 20px; }
  .blog__soon { font-size: 22px; margin-top: 40px; }
  .blog__tools { flex-direction: column-reverse; align-items: stretch; margin-top: 40px; gap: 14px; }
  .blog__search { flex-basis: auto; }
  .blog__tags { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); }
  .blog__tags button { flex: none; }

  .post { padding-top: 16px; }
  .post__meta { margin-top: 24px; }
  .post__title { font-size: clamp(36px, 10.5vw, 52px); }
  .post__lede { font-size: 18px; margin-top: 18px; }
  .post__cover { margin-top: 32px; }
  .prose { margin-top: 40px; font-size: 18px; line-height: 1.65; }
  .prose h2 { font-size: 27px; }
  .prose h3 { font-size: 22px; }
  .prose blockquote { font-size: 19px; padding-left: 18px; }
  .prose > figure, .prose > p > img:only-child, .prose > img { width: 100%; margin-left: 0; transform: none; }
  .prose pre { margin-inline: calc(-1 * var(--gutter)); border-radius: 0; font-size: 13px; }
  .post__pager { grid-template-columns: 1fr; margin-top: 64px; }
  .post__pager-next { grid-column: 1; text-align: left; }
  .komen { margin-top: 64px; }
  .komen__title { font-size: 28px; }
}
