/* ═══════════════════════════════════════════════════════════════
   Goldorak Blog – Design System
   Stack: Pico.css v2 + CSS custom properties + Grid
   ═══════════════════════════════════════════════════════════════ */

:root {
  --brand:        #6c63ff;
  --brand-dark:   #4f48cc;
  --accent:       #ff6584;
  --surface:      #ffffff;
  --surface-2:    #f8f9ff;
  --border:       #e2e4f0;
  --text:         #1a1b2e;
  --text-muted:   #6b7280;
  --radius:       12px;
  --shadow:       0 4px 24px rgba(108,99,255,.10);
  --shadow-hover: 0 8px 40px rgba(108,99,255,.18);
  --font:         'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --surface:    #0f1117;
    --surface-2:  #171923;
    --border:     #2d2f45;
    --text:       #e2e4f0;
    --text-muted: #9ca3af;
  }
}

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--surface);
  color: var(--text);
  line-height: 1.7;
  margin: 0;
}

/* ── Site Header ── */
.site-header {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  padding: 0;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.2rem 2rem;
}

.brand {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  letter-spacing: -0.5px;
}

.tagline {
  font-size: 0.85rem;
  opacity: 0.75;
  font-weight: 300;
}

/* ── Hero (index) ── */
.hero {
  padding: 4rem 2rem 3.5rem;
  text-align: center;
}

.hero-brand {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -1px;
  color: rgba(255,255,255,0.9);
}

.hero-title {
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 700;
  color: #fff;
  margin: 0.5rem 0;
  letter-spacing: -1.5px;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.8);
  max-width: 600px;
  margin: 0.75rem auto 0;
  font-weight: 300;
}

.hero-tags {
  margin-top: 1.5rem;
}

/* ── Main Container ── */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ── Section ── */
.articles-section {
  padding: 3rem 0 4rem;
}

.section-title {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  font-size: 1.5rem;
  font-weight: 700;
  border-bottom: 2px solid var(--brand);
  padding-bottom: 0.75rem;
  margin-bottom: 2rem;
  color: var(--text);
}

.section-title small {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-muted);
}

/* ── Tags ── */
.tag-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff !important;
  text-decoration: none;
  margin: 0.15rem 0.1rem;
  letter-spacing: 0.03em;
  transition: opacity 0.15s;
}

.tag-badge:hover { opacity: 0.85; }

.tag-badge--sm {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
}

.tag-count {
  opacity: 0.7;
  font-weight: 400;
  font-size: 0.85em;
}

.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.article-tags {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.card-tags {
  margin-top: 0.3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
}

/* ── Cards Grid ── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.75rem;
}

.card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--brand);
}

.card-header {
  margin-bottom: 0.75rem;
  padding: 0;
  border: none;
  background: none;
}

.card-header time {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0 0 0.75rem;
}

.card h3 a {
  color: var(--text);
  text-decoration: none;
}

.card h3 a:hover { color: var(--brand); }

.card-excerpt {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 1.25rem;
}

.card-footer {
  margin-top: auto;
  padding: 0;
  border: none;
  background: none;
}

.card-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
}

.card-link:hover { color: var(--brand-dark); }

/* ── Pagination ── */
.pagination {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 3rem;
  flex-wrap: wrap;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2rem;
  height: 2.2rem;
  padding: 0 0.6rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.page-link:hover,
.page-link[aria-current="page"] {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

/* ── Article ── */
.article-main {
  padding: 3rem 1.5rem 4rem;
}

.article-main article {
  max-width: 780px;
  margin: 0 auto;
}

.article-header {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.article-meta time {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.reading-tag {
  font-size: 0.78rem;
  background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
  color: #fff;
  padding: 0.2rem 0.75rem;
  border-radius: 999px;
  font-weight: 600;
}

.article-header h1 {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.8px;
  margin: 0;
  color: var(--text);
}

/* ── Article Body ── */
.article-body {
  font-size: 1.05rem;
  line-height: 1.85;
}

.article-body h2 {
  font-size: 1.55rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
  color: var(--brand);
  letter-spacing: -0.4px;
}

.article-body h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
}

.article-body p { margin: 0 0 1.25rem; }

.article-body ul, .article-body ol {
  padding-left: 1.5rem;
  margin: 0 0 1.25rem;
}

.article-body li { margin-bottom: 0.4rem; }

.article-body blockquote {
  border-left: 4px solid var(--brand);
  background: var(--surface-2);
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--text-muted);
}

.article-body code {
  font-family: var(--font-mono);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 0.15em 0.45em;
  border-radius: 4px;
  font-size: 0.88em;
  color: var(--accent);
}

.article-body pre {
  background: #0f1117;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}

.article-body pre code {
  background: none;
  border: none;
  color: #e2e4f0;
  padding: 0;
  font-size: 0.9rem;
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

.article-body th {
  background: var(--brand);
  color: #fff;
  padding: 0.75rem 1rem;
  text-align: left;
}

.article-body td {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
}

.article-body tr:hover td { background: var(--surface-2); }

/* ── Article Footer ── */
.article-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.back-link {
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.back-link:hover { color: var(--brand-dark); }

/* ── Site Footer ── */
.site-footer {
  background: var(--surface-2);
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.site-footer a { color: var(--brand); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ── Ad Units ── */
.ad-unit {
  width: 100%;
  margin: 1.5rem 0;
  text-align: center;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px dashed var(--border);
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-unit ins {
  display: block;
  width: 100%;
}

/* ── Cover Images ── */
.article-cover {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 2rem;
}

.article-cover img {
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: cover;
  display: block;
}

.card-cover {
  margin: -1.5rem -1.5rem 1rem;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  line-height: 0;
}

.card-cover img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.card:hover .card-cover img {
  transform: scale(1.04);
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .hero { padding: 2.5rem 1.25rem; }
  .cards-grid { grid-template-columns: 1fr; }
  .article-main { padding: 2rem 1rem; }
}
