/* ============================================================
   SUBHAJAI BENCHADHIKUL — BLOG
   Custom styles to complement Tailwind CSS.
   Covers: nav blur · card hover · article prose · code · print
   ============================================================ */

html {
  scroll-behavior: smooth;
  scroll-padding-top: 3rem; /* fixed nav height */
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ── Frosted-glass nav ───────────────────────────────────── */
.nav-blur {
  backdrop-filter: saturate(180%) blur(20px);
  background-color: rgba(255, 255, 255, 0.72);
}

/* ── Apple-card hover ────────────────────────────────────── */
.apple-card {
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1),
              box-shadow 0.3s ease;
}
.apple-card:hover {
  transform: scale(1.015);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 4px; }

/* ── Tags ────────────────────────────────────────────────── */
.tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 500;
  text-decoration: none;
  color: #86868b;
  background: #f5f5f7;
  border: 1px solid #e5e5e5;
  padding: 0.2rem 0.65rem;
  border-radius: 9999px;
  transition: background 200ms ease, color 200ms ease, border-color 200ms ease;
}
.tag:hover {
  background: #1d1d1f;
  color: #ffffff;
  border-color: #1d1d1f;
}

/* ── Pagination (Hugo internal template) ─────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #e5e5e5;
  list-style: none;
}
.pagination li a,
.pagination li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.5rem;
  font-size: 0.8rem;
  font-family: 'Inter', sans-serif;
  text-decoration: none;
  color: #86868b;
  border-radius: 9999px;
  border: 1px solid transparent;
  transition: all 200ms ease;
}
.pagination li a:hover {
  background: #f5f5f7;
  border-color: #e5e5e5;
  color: #1d1d1f;
}
.pagination li.active a,
.pagination li .current {
  background: #1d1d1f;
  color: #ffffff;
  border-color: #1d1d1f;
}

/* ── Article prose ───────────────────────────────────────── */
.prose {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.78;
  color: #424245;
  -webkit-font-smoothing: antialiased;
}

.prose h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1d1d1f;
  letter-spacing: -0.025em;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  line-height: 1.25;
}

.prose h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: #1d1d1f;
  letter-spacing: -0.015em;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.prose h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #1d1d1f;
  margin-top: 1.5rem;
  margin-bottom: 0.4rem;
}

.prose p {
  margin-bottom: 1.4rem;
  max-width: 68ch;
}

.prose ul,
.prose ol {
  margin: 1rem 0 1.4rem 1.5rem;
}
.prose li {
  margin-bottom: 0.4rem;
}
.prose ul li { list-style-type: disc; }
.prose ol li { list-style-type: decimal; }

.prose strong {
  font-weight: 600;
  color: #1d1d1f;
}

.prose em { font-style: italic; }

.prose a {
  color: #0066cc;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.prose a:hover { color: #0077ed; }

.prose blockquote {
  border-left: 4px solid #0066cc;
  padding: 0.75rem 0 0.75rem 1.25rem;
  margin: 2rem 0;
  font-style: italic;
  color: #86868b;
  font-size: 1.05rem;
}

.prose code {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.875em;
  background: #f5f5f7;
  padding: 0.15em 0.45em;
  border-radius: 4px;
  color: #0066cc;
}

.prose pre {
  background: #1d1d1f;
  color: #e8e4dc;
  padding: 1.5rem;
  border-radius: 0.75rem;
  overflow-x: auto;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.875rem;
  line-height: 1.65;
  margin: 2rem 0;
}
.prose pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
  border-radius: 0;
}

.prose hr {
  border: none;
  border-top: 1px solid #e5e5e5;
  margin: 3rem 0;
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 0.75rem;
  display: block;
  margin: 2rem 0;
}

.prose figcaption {
  text-align: center;
  font-size: 0.8rem;
  color: #86868b;
  margin-top: -1.25rem;
  margin-bottom: 2rem;
  font-style: italic;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.9rem;
}
.prose th {
  background: #f5f5f7;
  font-weight: 600;
  color: #1d1d1f;
  text-align: left;
  padding: 0.6rem 0.9rem;
  border-bottom: 2px solid #e5e5e5;
}
.prose td {
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid #e5e5e5;
  color: #424245;
}

/* ── Print ───────────────────────────────────────────────── */
@media print {
  nav, footer { display: none !important; }
  body { background: white !important; color: black; font-size: 12pt; }
  .apple-card { box-shadow: none !important; border: 1px solid #eee; }
  main { padding-top: 0 !important; }
}
