/* ===== VARIABEL ===== */
:root {
  --bg-body: #ffffff;
  --text-primary: #1a1a1a;
  --text-secondary: #4d4d4d;
  --text-muted: #5c5c5c;
  --border: #d4d4d4;
  --accent: #0059b3;

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  --navbar-height: 56px;
  --content-max-width: 750px;
  --navbar-max-width: 750px;          /* sejajar dengan konten */

  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

  --text-xs: clamp(0.7rem, 1.2vw, 0.75rem);
  --text-sm: clamp(0.8rem, 1.3vw, 0.8125rem);
  --text-base: clamp(0.9rem, 1.5vw, 0.9375rem);
  --text-md: clamp(1rem, 1.8vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 2.4vw, 1.375rem);
  --text-xl: clamp(1.375rem, 3.2vw, 1.75rem);
  --text-2xl: clamp(1.75rem, 5vw, 2.25rem);
  --text-3xl: clamp(2.25rem, 7vw, 3rem);
}

/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg-body);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-weight: 400;
  line-height: 1.7;
  font-size: var(--text-base);
  padding-top: calc(var(--navbar-height) + 8px);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

a {
  color: var(--text-primary);
  text-decoration: none;
}

/* ===== NAVBAR (lebar sejajar konten, tanpa background berat) ===== */
.navbar {
  position: fixed;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 16px);
  max-width: var(--navbar-max-width);
  height: var(--navbar-height);
  background: #ffffff;
  border: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  border-radius: 14px;
}

.navbar-inner {
  width: 100%;
  max-width: var(--navbar-max-width);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(16px, 4vw, 28px);
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-logo {
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

/* ===== DROPDOWN ===== */
.search-dropdown,
.menu-dropdown {
  position: absolute;
  top: calc(var(--navbar-height) + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 16px);
  max-width: var(--navbar-max-width);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px clamp(20px, 4vw, 28px);
  box-shadow: none;
  display: none;
}

.search-dropdown.active,
.menu-dropdown.active {
  display: block;
}

.menu-dropdown.active {
  display: flex;
  flex-direction: column;
  padding: 12px 0;
}

.menu-dropdown a {
  padding: 10px clamp(20px, 4vw, 28px);
  font-size: var(--text-sm);
  color: var(--text-primary);
  display: block;
  font-weight: 500;
}

.menu-dropdown a:hover {
  background: #f2f2f2;
}

.menu-dropdown .social-links {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 10px clamp(20px, 4vw, 28px);
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

.menu-dropdown .social-links a {
  padding: 6px 0;
  font-weight: 500;
  font-size: var(--text-sm);
}

.search-dropdown input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: var(--text-base);
  outline: none;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: clamp(28px, 5vw, 48px) clamp(20px, 5vw, 40px) clamp(32px, 6vw, 56px);
  width: 100%;
}

/* ===== TAGS CONTAINER ===== */
.tags-container {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 8px;
  margin-bottom: var(--space-lg);
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

.tag-toggle,
.article-info-bottom .tag,
.share-btn,
.rss-button,
.back-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #f2f2f2;
  color: var(--text-primary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 5px 10px;
  font-size: var(--text-xs);
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
  font-family: var(--font-mono);
}

.tag-toggle.active {
  background: #e0e0e0;
  border-color: #aaa;
}

.tag-toggle:hover,
.article-info-bottom .tag:hover,
.share-btn:hover,
.rss-button:hover,
.back-button:hover {
  background: #e6e6e6;
}

/* ===== POST CARD (list) ===== */
.post-card-item {
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: var(--space-sm) 0;
  margin: 0;
}

.post-card-item:last-child {
  border-bottom: none;
}

.article-title {
  font-size: var(--text-md);
  font-weight: 600;
  margin-bottom: 4px;
  line-height: 1.4;
  color: var(--text-primary);
}

.article-title a {
  color: inherit;
}

.post-meta-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.article-date {
  color: var(--text-secondary);
}

.article-tags-new {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.article-tags-new .tag {
  background: none;
  padding: 0;
  border: none;
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.article-tags-new .tag:hover {
  color: var(--text-primary);
}

/* ===== BREADCRUMB & BACK BUTTON ===== */
.back-button {
  float: right;
  margin: 20px 0 32px auto;
}

.breadcrumb {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-xl);
  padding-top: 12px;
  clear: both;
}

.breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
}

.breadcrumb-separator {
  margin: 0 4px;
}

/* ===== HALAMAN ARTIKEL ===== */
.article-header-new {
  margin-bottom: var(--space-xl);
}

.article-title-new {
  font-size: var(--text-3xl);
  font-weight: 700;
  line-height: 1.1;
  color: #111;
  margin-bottom: var(--space-lg);
}

.tag-page-title {
  margin-bottom: var(--space-xl);
  font-size: var(--text-2xl);
  font-weight: 700;
}

.article-info-bottom {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: 20px;
}

/* ===== ISI ARTIKEL ===== */
.article-content {
  margin-top: var(--space-xl);
  font-size: var(--text-base);
  line-height: 1.8;
  color: #1a1a1a;
}

.article-content p {
  margin-bottom: 1.5rem;
}

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

.article-content li {
  margin-bottom: 0.6rem;
}

.article-content h2 {
  font-weight: 700;
  font-size: var(--text-xl);
  color: #111;
  margin: 56px 0 12px;
  line-height: 1.3;
}

.article-content h3 {
  font-weight: 600;
  font-size: var(--text-lg);
  color: #111;
  margin: 48px 0 10px;
}

.article-content h4 {
  font-weight: 600;
  font-size: var(--text-md);
  color: #111;
  margin: 40px 0 8px;
}

.article-content a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin: var(--space-xl) 0;
  display: block;
}

.article-content blockquote {
  margin: var(--space-xl) 0;
  padding: 18px 20px;
  border-left: 4px solid var(--accent);
  background: #f7f7f7;
  color: var(--text-secondary);
  font-style: italic;
  border-radius: 0 8px 8px 0;
}

.article-content blockquote p {
  margin: 0;
}

.article-content pre {
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.article-content code {
  background: #f5f5f5;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  border: 1px solid var(--border);
}

.article-content pre code {
  background: none;
  padding: 0;
  border: none;
}

/* ===== MARK ===== */
mark {
  background: none;
  text-decoration: underline;
  text-decoration-color: #f5c518;
  text-decoration-thickness: 0.55em;
  text-underline-offset: -0.15em;
  text-decoration-skip-ink: none;
  -webkit-text-decoration-skip: none;
}

/* ===== DIVIDER ===== */
.post-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-lg) 0;
}

/* ===== FOOTER / RSS ===== */
.rss-footer-section {
  margin-top: auto;
  padding-top: 16px;
  padding-bottom: 8px;
  text-align: center;
}

.rss-content::before {
  content: "— ◉ —";
  display: block;
  font-size: 0.9rem;
  color: #1a1a1a;
  letter-spacing: 6px;
  margin-bottom: 24px;
}

.rss-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.rss-buttons-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.rss-tagline {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-style: italic;
}

.no-results {
  text-align: center;
  color: var(--text-muted);
  margin: 64px 0;
  font-style: italic;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  :root {
    --navbar-height: 52px;
    --space-xl: 24px;
    --space-2xl: 32px;
  }

  .navbar {
    top: 6px;
    border-radius: 12px;
  }

  .navbar-inner {
    padding: 0 clamp(12px, 3vw, 18px);
  }

  .main-content {
    padding: 24px 18px 36px;
    gap: var(--space-md);
  }

  .search-dropdown,
  .menu-dropdown {
    width: calc(100% - 12px);
    padding: 14px 18px;
    border-radius: 10px;
  }

  .menu-dropdown {
    padding: 10px 0;
  }

  .menu-dropdown a {
    padding: 10px 18px;
  }

  .menu-dropdown .social-links {
    padding: 8px 18px;
  }

  .article-title {
    font-size: var(--text-base);
  }

  .article-title-new {
    font-size: var(--text-2xl);
    margin-bottom: 20px;
  }

  .tags-container {
    gap: 6px;
  }

  .tag-toggle,
  .article-info-bottom .tag,
  .share-btn,
  .rss-button,
  .back-button {
    padding: 4px 8px;
    font-size: 0.7rem;
    border-radius: 8px;
  }

  .back-button {
    margin: 12px 0 24px auto;
  }
}