/* ================================
   Base Style
================================ */
body {
  font-family: 'Inter', sans-serif;
  background-color: #0d1117;
  color: #c9d1d9;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

main {
  width: 100%;
  max-width: 42rem; /* 672px */
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* ================================
   Link Card / Button Link
================================ */
.link-card {
    /* Subtle gradient background */
    background: linear-gradient(145deg, #2a3a50, #1c2738);
    border: 1px solid #374151;
    /* Base shadow for depth */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2), 0 1px 3px rgba(0,0,0,0.1);
    /* Smooth transitions for all properties */
    transition: all 0.3s ease;
    color: #9CA3AF; /* text-gray-400 */
}
.link-card:hover {
  color: #E5E7EB; /* Brighter color */
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3),
                0 4px 6px -2px rgba(37, 99, 235, 0.1);
}
/* Icon styling */
.link-card svg {
    
    transition: transform 0.3s ease, color 0.3s ease;
}
/* Interactive icon animation on hover */
.link-card:hover svg {
    
    /* Rotate and scale up the icon */
    transform: rotate(-10deg) scale(1.1);
}
/* ================================
   Artikel & Project Card
================================ */
.article-card,
.project-card {
  transition: all 0.3s ease;
}

.article-card:hover,
.project-card:hover {
  border-color: #3b82f6;
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(37, 99, 235, 0.3),
              0 4px 6px -2px rgba(37, 99, 235, 0.1);
}

/* ================================
   Scrollbar (Dark Mode)
================================ */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-thumb {
  background-color: #30363d;
  border-radius: 10px;
}

::-webkit-scrollbar-track {
  background-color: #161b22;
}

/* ================================
   Code Block
================================ */
pre {
  background-color: #161b22;
  border: 1px solid #30363d;
  padding: 1rem;
  border-radius: 0.75rem;
  overflow-x: auto;
  color: #58a6ff;
  font-family: monospace;
  line-height: 1.5;
}

code {
  background-color: #1b1f24;
  color: #58a6ff;
  padding: 0.2rem 0.4rem;
  border-radius: 0.3rem;
  font-family: monospace;
  font-size: 0.95em;
}

/* ================================
   Konten Utama (Markdown)
================================ */
article {
  line-height: 1.75;
  color: #c9d1d9;
}

article h2 {
  color: #ffffff;
  font-weight: 700;
  font-size: 1.75rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  border-left: 4px solid #3b82f6;
  padding-left: 0.75rem;
}

article h3 {
  color: #60a5fa;
  font-weight: 600;
  font-size: 1.5rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

article h4 {
  color: #d1d5db;
  font-weight: 600;
  font-size: 1.125rem;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

article h5 {
  color: #9ca3af;
  font-weight: 500;
  font-size: 1rem;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}

article p {
  margin-bottom: 1rem;
}

article a {
  color: #3b82f6;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

article a:hover {
  color: #60a5fa;
}

article ul,
article ol {
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

article ul {
  list-style: disc;
}

article ol {
  list-style: decimal;
}

article li {
  margin-bottom: 0.4rem;
}

article blockquote {
  border-left: 4px solid #3b82f6;
  padding-left: 1rem;
  color: #9ca3af;
  font-style: italic;
  margin: 1.5rem 0;
}

article img {
  max-width: 100%;
  border-radius: 0.75rem;
  border: 1px solid #30363d;
  display: block;
  margin: 1.5rem auto;
}

/* ================================
   Table
================================ */
article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

article th,
article td {
  border: 1px solid #30363d;
  padding: 0.75rem;
  text-align: left;
}

article th {
  background-color: #161b22;
  color: #ffffff;
  font-weight: 600;
}

/* Batasi .title maksimal 2 baris, sisanya ellipsis */
.title {
  display: -webkit-box;        /* enable webkit box */
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;      /* jumlah baris maksimum */
  overflow: hidden;
  text-overflow: ellipsis;
  /* fallback untuk browser non-webkit: tunjukkan satu baris dengan ellipsis */
  white-space: nowrap;
}

.summary {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;   /* jumlah maksimum baris */
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Pada browser yang mendukung line-clamp, hapus white-space agar 2 baris berfungsi */
@supports (-webkit-line-clamp: 2) {
  .title { white-space: normal; }
}

.highlight pre {
  padding-top: .2rem;
  padding-bottom: .2rem;
}

.highlight pre > code {
  background-color: transparent;
}

/* ================================
   Responsive Spacer (Mobile Nav)
================================ */
@media (max-width: 640px) {
  .mobile-nav-spacer {
    height: 4.5rem;
  }

  article table {
    display: block;              /* penting untuk responsif */
    overflow-x: auto;            /* scroll horizontal di layar kecil */
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;         /* cegah teks pecah baris */
  }
}
