/* =========================================================
   Tulisan: kartu, daftar, halaman baca
   ========================================================= */
:root {
  --card: #1C1C1B;
  --card-soft: #A9A9A4;
  --mark: #EBD8D6;
  --read: "Source Serif 4", "Iowan Old Style", Georgia, serif;
}

/* ---------- Avatar ---------- */
.avatar { position: relative; display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; overflow: hidden; background: var(--paper); color: var(--ink); flex-shrink: 0; }
.avatar b { font: italic 500 17px/1 var(--serif); }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: grayscale(1); }

/* ---------- Kartu (mengikuti contoh UI) ---------- */
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 28px; }
.tcard { position: relative; background: var(--card); color: var(--paper); border-radius: 6px; overflow: hidden; display: flex; }
.tcard-link { display: flex; flex-direction: column; text-decoration: none; color: inherit; width: 100%; }
.tcard-img { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #2A2A28; }
.tcard-img img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.05); transform: scale(1.01); transition: transform 1.2s var(--ease), opacity .4s; }
.tcard-img::after { content: ""; position: absolute; inset: 40% 0 0; background: linear-gradient(to bottom, transparent, var(--card)); }
.tcard-link:hover .tcard-img img { transform: scale(1.06); }
.tcard-cat { position: absolute; z-index: 1; left: 14px; top: 14px; padding: 5px 10px; border-radius: 999px; background: rgba(28,28,27,.7); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); font-size: 12px; font-weight: 500; }
.tcard-body { position: relative; z-index: 1; margin-top: -28px; padding: 0 24px 26px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.tcard-by { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; color: var(--card-soft); letter-spacing: .02em; }
.tcard-by .avatar { width: 28px; height: 28px; border-radius: 6px; }
.tcard h3 { font: 600 21px/1.3 var(--sans); letter-spacing: -0.01em; }
.tcard-ex { font-size: 15px; line-height: 1.55; color: var(--card-soft); padding-right: 56px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tcard-save { position: absolute; z-index: 2; right: 18px; bottom: 20px; width: 46px; height: 46px; border-radius: 10px; border: 0; cursor: pointer; display: grid; place-items: center; background: #3A3A38; color: var(--paper); transition: background .2s, transform .3s var(--ease); }
.tcard-save svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.tcard-save[aria-pressed="true"] { background: var(--paper); color: var(--ink); }
.tcard-save[aria-pressed="true"] svg { fill: currentColor; }
.tcard-save:hover { transform: translateY(-2px); }
.tcard.is-draft .tcard-img img { opacity: .55; }
.tcard.is-draft h3 { color: #D8D8D3; }

.writing-more { margin-top: 40px; display: flex; justify-content: center; }

/* ---------- Halaman daftar ---------- */
.tlist { max-width: var(--max); margin: 0 auto; padding: 140px var(--gutter) 140px; }
.tlist-head { display: flex; justify-content: space-between; align-items: end; gap: 32px; flex-wrap: wrap; }
.tlist-head h1 { font-size: clamp(52px, 8vw, 112px); line-height: .95; }
.tlist-head p { max-width: 38ch; color: var(--ink-soft); }
.tlist .filters { margin: 48px 0 36px; }

/* ---------- Halaman baca ---------- */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; background: var(--ink); transform-origin: left; transform: scaleX(0); z-index: 60; }
.article { padding: 130px 0 0; }
.art-head { max-width: 760px; margin: 0 auto; padding: 0 var(--gutter); }
.art-cat { font-size: 14px; font-weight: 600; text-decoration: none; color: var(--ink-soft); }
.art-cat:hover { color: var(--ink); }
.art-head h1 { margin-top: 14px; font: 700 clamp(32px, 4.6vw, 52px)/1.12 var(--sans); letter-spacing: -0.025em; text-wrap: balance; }
.art-dek { margin-top: 18px; font: 400 clamp(19px, 2vw, 23px)/1.5 var(--read); color: var(--mute); }
.art-by { display: flex; align-items: center; gap: 14px; margin-top: 30px; padding-bottom: 6px; }
.art-by .avatar { width: 46px; height: 46px; }
.art-by .avatar b { font-size: 24px; }
.art-by div { display: grid; line-height: 1.35; }
.art-by div b { font-weight: 600; font-size: 16px; }
.art-by div span { font-size: 14px; color: var(--mute); }
.listen { margin-left: auto; display: inline-flex; align-items: center; gap: 10px; padding: 12px 20px 12px 16px; border-radius: 999px; border: 0; background: var(--ink); color: var(--paper); font: 600 15px var(--sans); cursor: pointer; transition: transform .3s var(--ease); }
.listen:hover { transform: translateY(-2px); }
.listen svg { width: 18px; height: 18px; fill: currentColor; }
.listen .i-pause, .listen.playing .i-play { display: none; }
.listen.playing .i-pause { display: inline; }

.art-photo { max-width: 1080px; margin: 44px auto 0; padding: 0 var(--gutter); }
.art-photo img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; filter: grayscale(1) contrast(1.05); background: var(--stone); }
.art-photo figcaption { margin-top: 10px; font-size: 12px; color: var(--mute); text-align: right; }
.art-photo figcaption a { color: inherit; }

.art-player { max-width: 1080px; margin: 24px auto 0; padding: 0 var(--gutter); }
.spotify-frame { border-radius: 12px; overflow: hidden; background: #282828; min-height: 152px; }
.spotify-frame iframe, .spotify-frame > * { display: block; width: 100%; border: 0; }
.song-suggest { display: flex; align-items: center; gap: 18px; padding: 18px 22px; border-radius: 12px; background: #282828; color: #fff; text-decoration: none; }
.song-disc { width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0; background: radial-gradient(circle, #282828 0 9%, #555 10% 12%, #111 13% 100%); box-shadow: inset 0 0 0 1px #444; animation: spin 6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.song-suggest small { display: block; font-size: 12px; color: #A7A7A7; }
.song-suggest b { display: block; font-size: 17px; }
.song-suggest em { font-style: normal; font-size: 14px; color: #A7A7A7; }
.song-go { margin-left: auto; font-size: 14px; font-weight: 600; padding: 10px 16px; border-radius: 999px; background: #fff; color: #111; white-space: nowrap; }
.aplayer { display: flex; align-items: center; gap: 18px; padding: 18px 22px; border-radius: 12px; background: #282828; color: #fff; }
.aplayer-btn { width: 52px; height: 52px; border-radius: 50%; border: 0; background: #fff; display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.aplayer-btn svg { width: 22px; height: 22px; fill: #111; }
.aplayer-meta { flex: 1; display: grid; gap: 2px; }
.aplayer-meta span { font-size: 14px; color: #A7A7A7; }
.aplayer-bar { margin-top: 10px; height: 4px; border-radius: 4px; background: #535353; cursor: pointer; overflow: hidden; }
.aplayer-bar i { display: block; height: 100%; width: 0; background: #fff; }

/* Isi tulisan: serif, rata kanan-kiri seperti buku */
.art-body { max-width: 720px; margin: 64px auto 0; padding: 0 var(--gutter); font: 400 clamp(19px, 1.6vw, 21px)/1.85 var(--read); color: #262624; hyphens: auto; -webkit-hyphens: auto; }
.art-body p { margin: 0 0 1.35em; text-align: justify; text-justify: inter-word; }
.art-body > p:first-child::first-letter { float: left; font: 400 4.1em/.82 var(--serif); padding: .08em .1em 0 0; }
.art-body h2 { font: 700 26px/1.25 var(--sans); margin: 2em 0 .8em; letter-spacing: -0.015em; }
.art-body em { font-style: italic; }
.art-body mark { background: var(--mark); color: inherit; padding: .05em .15em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.art-body del { color: var(--mute); text-decoration-thickness: 1.5px; }
.art-body .pull { margin: 2.2em 0; padding: 0; }
.art-body .pull p { font: italic 400 clamp(25px, 2.8vw, 33px)/1.45 var(--read); color: var(--ink); text-align: justify; margin: 0; }
.art-body .pull p::before { content: "“"; }
.art-body .pull p::after { content: "”"; }
.art-body .pause { border: 0; margin: 2.6em 0; text-align: center; height: auto; }
.art-body .pause::before { content: "\2022  \2022  \2022"; letter-spacing: .6em; color: var(--mute); font-size: 14px; }
.art-body .loading, .art-draft { color: var(--mute); text-align: center; }
.art-draft { padding: 40px 0; font-family: var(--read); }
.art-draft p:first-child { font: italic 400 30px/1.3 var(--read); color: var(--ink); text-align: center; }
.art-draft p { text-align: center; }
.art-draft code { font-size: .8em; }

.art-foot { max-width: 720px; margin: 72px auto 0; padding: 32px var(--gutter) 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
.art-sign { display: flex; gap: 14px; align-items: center; max-width: 420px; }
.art-sign .avatar { width: 52px; height: 52px; }
.art-sign p { font-size: 14px; color: var(--ink-soft); line-height: 1.5; }
.art-sign p b { display: block; color: var(--ink); font-size: 16px; }
.art-actions { display: flex; gap: 10px; }
.art-actions .btn { gap: 8px; padding: 10px 16px; font-size: 14px; }
.art-actions svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.art-actions [aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.art-actions [aria-pressed="true"] svg { fill: currentColor; }
.art-more { max-width: var(--max); margin: 110px auto 0; padding: 0 var(--gutter) 140px; }
.art-more h2 { font-size: clamp(36px, 4vw, 56px); margin-bottom: 36px; }
.art-missing { max-width: 640px; margin: 0 auto; padding: 80px var(--gutter) 160px; text-align: center; }
.art-missing h1 { font-size: 48px; }
.art-missing p { margin: 16px 0 32px; color: var(--ink-soft); }

/* nav tetap tampil sederhana di halaman tulisan */
.nav.simple .nav-links { position: static; transform: none; flex-direction: row; padding: 0; background: none; border: 0; z-index: auto; font-size: 14px; display: flex; gap: 22px; }

@media (max-width: 640px) {
  .art-by { flex-wrap: wrap; }
  .listen { margin-left: 0; width: 100%; justify-content: center; }
  .art-body p { text-align: left; }
  .art-body .pull p { text-align: left; }
  .song-go { display: none; }
  .art-actions { width: 100%; }
}
.writing .writing-head { margin-bottom: 56px; }

/* ---------- Foto: perlakuan seni monokrom (kontras + grain film) ---------- */
.tcard-img, .art-photo .grain { position: relative; }
.tcard-img img, .art-photo img { filter: grayscale(1) contrast(1.22) brightness(.92); }
.tcard-img::before, .art-photo .grain::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .32; mix-blend-mode: overlay;
}
.art-photo .grain { display: block; border-radius: 6px; overflow: hidden; }
.art-photo .grain img { border-radius: 0; }
.tcard-cat { z-index: 2; }

.spotify-full { display: inline-block; margin-top: 12px; font-size: 13px; color: var(--mute); text-decoration: underline; text-underline-offset: 3px; }
.spotify-full:hover { color: var(--ink); }
.catnote { min-height: 1.6em; margin: -12px 0 28px; font: italic 400 20px/1.5 var(--read); color: var(--ink-soft); }
