/* ==========================================================================
   fzh.xyz — site.css
   Diekstrak dari layout referensi (atlantic-magazine.html) mengikuti
   Design System & Aturan Koding: token system, rem/em, breakpoint em,
   reduced-motion, focus-visible.
   ========================================================================== */

/* ---------- Reset dasar ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

img, video, canvas, svg {
  display: block;
  max-width: 100%;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Token: primitives ---------- */
:root {
  --white: #FAFAF8;
  --black: #141414;
  --gray-600: #6B6B6B;
  --gray-300: #D9D6CE;
  --gray-100: #E6E6E2;
  --gray-200: #D3D3CD;
  --red-600: #B7291E;

  --font-serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;
  --font-sans: 'Inter', -apple-system, sans-serif;
}

/* ---------- Token: semantic ---------- */
:root {
  --color-bg: var(--white);
  --color-text: var(--black);
  --color-text-muted: var(--gray-600);
  --color-border: var(--gray-300);
  --color-accent: var(--red-600);

  color-scheme: light;
}

/* ---------- Token: scale (spacing & radius yang berulang) ---------- */
:root {
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-14: 3.5rem;   /* 56px */

  --ease-standard: 0.15s ease;
}

/* Alias nama token lama — dipakai di beberapa inline style (arsip.njk, cari.njk,
   kategori.njk, kategori-detail.njk, tag.njk) supaya gak perlu ubah tiap file */
:root {
  --sub: var(--color-text-muted);
  --ink: var(--color-text);
  --bg: var(--color-bg);
  --line: var(--color-border);
  --red: var(--color-accent);
  --mono: var(--font-mono);
  --serif: var(--font-serif);
  --sans: var(--font-sans);
}

/* ---------- Base ---------- */
html {
  color-scheme: light;
}

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

button { font: inherit; }

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.wrap {
  max-width: 68.75rem; /* 1100px */
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* Skip link (aksesibilitas — wajib ada, tidak ada di reference asli) */
.skip-link {
  position: absolute;
  top: -3rem;
  left: var(--space-4);
  background: var(--color-text);
  color: var(--color-bg);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: var(--space-2) var(--space-4);
  z-index: 100;
  transition: top var(--ease-standard);
}
.skip-link:focus-visible {
  top: var(--space-4);
}

/* ---------- Masthead ---------- */
header.masthead {
  border-top: 3px solid var(--color-text);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-5) 0;
  position: relative;
  z-index: 50;
  background: var(--color-bg);
}
.masthead .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
}
.logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}
.logo span { color: var(--color-accent); }

.masthead-right {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

nav {
  display: none;
  gap: 1.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
nav a { text-decoration: none; color: var(--color-text-muted); }
nav a:hover { color: var(--color-accent); }
@media (min-width: 53.75em) { /* 860px */
  nav { display: flex; }
}

/* Desktop search */
.search-desktop {
  display: none;
  align-items: center;
  gap: var(--space-2);
  border: 1px solid var(--color-border);
  padding: 0.44rem 0.75rem;
  width: 12.5rem;
  transition: border-color var(--ease-standard), width 0.2s ease;
}
.search-desktop:focus-within {
  border-color: var(--color-text);
  width: 15rem;
}
.search-desktop svg { flex-shrink: 0; color: var(--color-text-muted); }
.search-desktop input {
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--color-text);
  width: 100%;
}
.search-desktop input::placeholder { color: var(--color-text-muted); }
@media (min-width: 53.75em) {
  .search-desktop { display: flex; }
}

/* Burger button — mobile only, target sentuh 44x44 (di atas minimum 24px) */
.burger-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text);
  padding: 0;
}
@media (min-width: 53.75em) {
  .burger-btn { display: none; }
}

/* Tombol tutup di dalam mobile menu — posisi absolut, gantiin inline style */
.mobile-menu-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
}

/* Mobile menu panel — state dikontrol lewat data-state, bukan classList manual */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--color-bg);
  z-index: 60;
  padding: 6rem var(--space-6) var(--space-10);
  overflow-y: auto;
}
.mobile-menu[data-state="open"] { display: block; }
.mobile-search {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  border: 1px solid var(--color-text);
  padding: 0.8rem 0.875rem;
  margin-bottom: var(--space-8);
}
.mobile-search svg { flex-shrink: 0; color: var(--color-text-muted); }
.mobile-search input {
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--color-text);
  width: 100%;
}
.mobile-search input::placeholder { color: var(--color-text-muted); }
.mobile-nav {
  display: flex;
  flex-direction: column;
}
.mobile-nav a {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--color-text);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--color-border);
}
.mobile-nav-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin: var(--space-8) 0 var(--space-3);
}
.mobile-nav-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
}
.mobile-nav-tags a {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  text-decoration: none;
  color: var(--color-text);
  border: 1px solid var(--color-border);
  padding: var(--space-2) 0.875rem;
}

/* ---------- Hero ---------- */
.hero {
  padding: var(--space-14) 0 var(--space-8);
  border-bottom: 1px solid var(--color-border);
}
.hero-card {
  display: block;
  text-decoration: none;
}
.hero-img,
.hero-img-wrap {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--gray-100), var(--gray-200));
  background-size: cover;
  background-position: center;
  overflow: hidden;
}
.hero-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-top: var(--space-8);
}
.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.015em;
  margin-top: 0.875rem;
}
.hero p.dek {
  font-family: var(--font-serif);
  font-style: italic;
  margin-top: var(--space-4);
  font-size: 1.15rem;
  color: var(--color-text-muted);
  max-width: 40rem;
  line-height: 1.55;
  font-weight: 400;
}
.byline {
  margin-top: 1.375rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--color-text-muted);
}

/* ---------- Halaman post: header, gambar, body, tags ---------- */
.post-header {
  padding: var(--space-14) 0 var(--space-8);
  border-bottom: 1px solid var(--color-border);
}
.post-header h1 {
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin-top: 0.875rem;
}
.post-header .dek {
  font-family: var(--font-serif);
  font-style: italic;
  margin-top: var(--space-4);
  font-size: 1.15rem;
  color: var(--color-text-muted);
  max-width: 40rem;
  line-height: 1.55;
  font-weight: 400;
}
.post-header .byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-top: 1.375rem;
}

.post-hero-img-wrap {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  margin-top: var(--space-8);
  background: linear-gradient(135deg, var(--gray-100), var(--gray-200));
}
.post-hero-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.share-btn {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--color-text);
  background: transparent;
  border: 1px solid var(--color-border);
  padding: 0.5rem 0.875rem;
  cursor: pointer;
  transition: border-color var(--ease-standard), color var(--ease-standard);
  white-space: nowrap;
}
.share-btn:hover { border-color: var(--color-text); color: var(--color-accent); }

/* Isi artikel (markdown yang di-render) — belum ada tipografi sama sekali sebelumnya */
.post-body {
  padding: var(--space-10) 0;
  max-width: 44rem;
  font-family: var(--font-serif);
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--color-text);
}
.post-body > * + * { margin-top: var(--space-5); }
.post-body h2 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.25;
  margin-top: var(--space-10);
}
.post-body h3 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  line-height: 1.3;
  margin-top: var(--space-8);
}
.post-body p { }
.post-body strong { font-weight: 700; }
.post-body em { font-style: italic; }
.post-body mark {
  background: color-mix(in srgb, var(--color-accent) 18%, transparent);
  color: var(--color-text);
  padding: 0 0.15em;
}
.post-body a {
  color: var(--color-accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}
.post-body a:hover { text-decoration-thickness: 2px; }
.post-body ul,
.post-body ol {
  padding-left: 1.3em;
}
.post-body li + li { margin-top: 0.4em; }
.post-body blockquote {
  border-left: 3px solid var(--color-accent);
  padding-left: var(--space-5);
  font-style: italic;
  color: var(--color-text-muted);
}
.post-body code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--gray-100);
  padding: 0.15em 0.4em;
}
.post-body pre {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.5;
  background: var(--color-text);
  color: var(--color-bg);
  padding: var(--space-4);
  overflow-x: auto;
}
.post-body pre code {
  background: none;
  padding: 0;
  color: inherit;
}
.post-body img {
  width: 100%;
  height: auto;
}
.post-body hr {
  border: none;
  border-top: 1px solid var(--color-border);
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding-bottom: var(--space-10);
}
.tag-pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-decoration: none;
  color: var(--color-text);
  border: 1px solid var(--color-border);
  padding: var(--space-2) 0.875rem;
  transition: border-color var(--ease-standard), color var(--ease-standard);
}
.tag-pill:hover { border-color: var(--color-text); color: var(--color-accent); }

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

/* ---------- Section label ---------- */
.section-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text);
  padding-top: var(--space-14);
  padding-bottom: 1.375rem;
  border-top: 3px solid var(--color-text);
  margin-top: var(--space-2);
}

/* ---------- Grid: Latest ---------- */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem 2rem;
  padding-bottom: var(--space-4);
}
@media (min-width: 40em) { /* 640px */
  .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 60em) { /* 960px */
  .grid { grid-template-columns: repeat(3, 1fr); }
}

.card {
  display: block;
  text-decoration: none;
}
.card-img,
.card-img-wrap {
  width: 100%;
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, var(--gray-100), var(--gray-200));
  overflow: hidden;
}
.card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card h2 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.3;
  margin-top: var(--space-4);
  letter-spacing: -0.005em;
}
.card .cat {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 0.375rem;
  display: block;
}

/* ---------- Related: headline-only list ---------- */
.related {
  border-top: 1px solid var(--color-border);
  padding: 0.25rem 0;
}
.related-list a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-4);
  padding: var(--space-5) 0;
  border-bottom: 1px solid var(--color-border);
  text-decoration: none;
}
.related-list a:last-child { border-bottom: none; }
.related-list .headline {
  font-family: var(--font-serif);
  font-size: 1.08rem;
  font-weight: 500;
  line-height: 1.35;
}
.related-list .num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--color-accent);
  flex-shrink: 0;
  font-weight: 600;
}

/* ---------- Browse by tag ---------- */
.tags {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.875rem;
  padding-bottom: var(--space-14);
}
@media (min-width: 40em) {
  .tags { grid-template-columns: repeat(4, 1fr); }
}
.tag-card {
  display: block;
  text-decoration: none;
  border: 1px solid var(--color-border);
  padding: 1.375rem 1.125rem;
  transition: border-color var(--ease-standard);
}
.tag-card:hover { border-color: var(--color-text); }
.tag-card .tag-name {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
}
.tag-card .tag-count {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--color-text-muted);
  margin-top: var(--space-1);
  display: block;
}

/* ---------- Newsletter ---------- */
.newsletter {
  border-top: 3px solid var(--color-text);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-14) 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}
@media (min-width: 45em) { /* 720px */
  .newsletter {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
  }
}
.newsletter h3 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.newsletter p {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-top: var(--space-2);
  max-width: 26.25rem;
  line-height: 1.5;
}
.newsletter-form {
  display: flex;
  gap: 0;
  max-width: 23.75rem;
  width: 100%;
}
.newsletter-form input {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  padding: 0.8rem 0.875rem;
  border: 1px solid var(--color-text);
  border-right: none;
  background: var(--color-bg);
  color: var(--color-text);
  outline: none;
}
.newsletter-form input::placeholder { color: var(--color-text-muted); }
.newsletter-form button {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.8rem 1.25rem;
  background: var(--color-text);
  color: var(--color-bg);
  border: 1px solid var(--color-text);
  cursor: pointer;
  white-space: nowrap;
}
.newsletter-form button:hover { background: var(--color-accent); border-color: var(--color-accent); }

/* ---------- About / company blurb ---------- */
.about {
  padding: 3.25rem 0;
  border-bottom: 1px solid var(--color-border);
}
.about p {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  line-height: 1.55;
  max-width: 43.75rem;
  color: var(--color-text);
}
.about p.small {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: var(--space-3);
  line-height: 1.5;
}

/* ---------- Footer ---------- */
footer {
  padding: var(--space-14) 0 2.25rem;
}
.footer-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.25rem;
  padding-bottom: 2.5rem;
}
@media (min-width: 45em) {
  .footer-top { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
}
.footer-brand .logo {
  font-size: 1.1rem;
}
.footer-brand p {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-top: var(--space-3);
  max-width: 16.25rem;
  line-height: 1.5;
}
.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}
.footer-col a {
  display: block;
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--color-text);
  padding: var(--space-2) 0;
}
.footer-col a:hover { color: var(--color-accent); }

.footer-bottom {
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}
@media (min-width: 45em) {
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}
.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 1.125rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--color-text-muted);
}
.footer-legal a { text-decoration: none; color: var(--color-text-muted); }
.footer-legal a:hover { color: var(--color-text); }
.footer-copyright {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--color-text-muted);
}
.footer-social {
  display: flex;
  gap: var(--space-4);
}
.footer-social a {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-decoration: none;
  color: var(--color-text-muted);
}
.footer-social a:hover { color: var(--color-accent); }