:root {
  --main-bg: #f9fafc;
  --content-bg: #ffffff;
  --accent: #0d6efd;
  --text: #212529;
  --shadow: 0 3px 10px rgba(0,0,0,0.08);
  --radius: 14px;
}

body.dark {
  --main-bg: #0a0f18;
  --content-bg: #111827;
  --text: #e4e6eb;
  --accent: #33a1ff;
  --shadow: 0 0 20px rgba(0, 136, 255, 0.25);
}

body {
  background: var(--main-bg);
  font-family: 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  margin: 0;
  line-height: 1.7;
  transition: background 0.3s, color 0.3s;
}

/* ==============================
   NAVBAR
   ============================== */
.top-menu {
  background: var(--accent);
  padding: 12px 15px;
  text-align: center;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 10;
}
.top-menu a, .top-menu button {
  color: #fff;
  text-decoration: none;
  margin: 0 10px;
  font-weight: 500;
  font-size: 15px;
  background: none;
  border: none;
  cursor: pointer;
}
.top-menu a:hover, .top-menu button:hover { opacity: 0.8; }

/* ==============================
   LAYOUT
   ============================== */
#outer-wrapper {
  max-width: 1200px;
  margin: auto;
  padding: 20px;
}

header.site-header {
  background: var(--content-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  padding: 25px 15px;
  margin-bottom: 30px;
}
header.site-header h1 { color: var(--accent); margin-bottom: 10px; }
header.site-header p { color: #666; font-size: 1rem; }

/* ==============================
   GRID CARD INDEX
   ============================== */
.grid-posts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 25px;
}
.card {
  background: var(--content-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform .2s ease;
}
.card:hover { transform: translateY(-6px); }
.card img {
  width: 100%; height: 200px; object-fit: cover; display: block;
}
.card-body { padding: 14px 16px 18px; }
.card-body h2 { font-size: 1rem; color: var(--accent); margin: 0 0 6px; }
.card-body p { font-size: .9em; color: #555; }

/* ==============================
   POST PAGE
   ============================== */
.container {
  display: grid;
  grid-template-columns: 3fr 1fr;
  gap: 25px;
}
@media(max-width:900px){ .container{ grid-template-columns:1fr; } }

.post-body, .sidebar {
  background: var(--content-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 25px;
}
.post-body h1 {
  color: var(--accent);
  text-align: center;
  margin-bottom: 10px;
}
.meta-info {
  text-align: center;
  color: #888;
  font-size: 14px;
  margin-bottom: 20px;
}

/* ==============================
   IMAGE STYLING FIX (Hero + Section)
   ============================== */
figure.hero {
  text-align: center;
  margin: 1.8em auto;
  max-width: 850px;
}
figure.hero img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.25s ease;
}
figure.hero img:hover { transform: scale(1.02); }
figure.hero figcaption {
  font-size: 0.9em;
  color: #777;
  margin-top: 6px;
  font-style: italic;
}

/* Section images (H2) */
figure.section-img {
  text-align: center;
  margin: 1.8em auto;
  max-width: 680px;
}
figure.section-img img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease;
}
figure.section-img img:hover {
  transform: scale(1.03);
}
figure.section-img figcaption {
  font-size: 0.85em;
  color: #666;
  margin-top: 5px;
  font-style: italic;
}

/* Global figure reset */
figure {
  margin: 25px auto;
  text-align: center;
}
figure img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: var(--shadow);
}
figcaption {
  font-size: 0.9rem;
  color: #666;
  margin-top: 6px;
}

/* ==============================
   RESPONSIVE FIX
   ============================== */
@media (max-width: 900px) {
  figure.hero, figure.section-img { max-width: 95%; }
}
@media (max-width: 600px) {
  figure.hero, figure.section-img {
    margin: 1.2em auto;
    border-radius: 6px;
  }
  figure.hero img, figure.section-img img {
    border-radius: 6px;
  }
}

/* ==============================
   SIDEBAR
   ============================== */
.sidebar h3 {
  color: var(--accent);
  border-bottom: 2px solid #e6e6e6;
  padding-bottom: 6px;
  margin-bottom: 12px;
}
.sidebar a { color: var(--accent); text-decoration:none; display:block; margin-bottom:8px; }
.sidebar a:hover { text-decoration:underline; }

/* ==============================
   FOOTER
   ============================== */
footer {
  text-align: center;
  font-size: .85em;
  color: #777;
  margin-top: 40px;
}

/* ==============================
   SUMMARY BOX
   ============================== */
.summary {
  background: #f8f9fa;
  border-left: 4px solid #28a745;
  padding: 18px 20px;
  border-radius: 8px;
  margin-top: 35px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.summary h3 {
  margin-top: 0;
  color: #111;
}
.summary p {
  margin: 8px 0 0;
  color: #333;
}

/* ==============================
   RELATED BOX
   ============================== */
.related {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 18px 22px;
  margin: 35px 0;
  border: 1px solid #eee;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.related h3 {
  margin-top: 0;
  font-size: 1.2em;
  color: var(--accent);
}
.related ul {
  list-style: none;
  padding-left: 0;
  margin: 0.8em 0 0;
}
.related li {
  margin: 6px 0;
}
.related a {
  color: var(--accent);
  text-decoration: none;
}
.related a:hover {
  text-decoration: underline;
}

/* ==============================
   H2-BLOCKS (MASIH DIPERTAHANKAN)
   ============================== */
.h2-block {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 20px;
  margin: 40px 0;
  background: #f9f9f9;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid #eee;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  transition: background 0.3s;
}
.h2-block:hover { background: #f4f6f3; }
.h2-left {
  flex: 1 1 300px;
  text-align: center;
}
.h2-left img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}
.h2-right {
  flex: 2 1 400px;
}
.h2-right h2 {
  margin-top: 0;
  font-size: 1.5em;
  color: #222;
}
.h2-right p {
  margin-bottom: 0.7em;
  line-height: 1.6;
  color: #333;
}
@media (max-width:768px) {
  .h2-block { flex-direction: column; }
  .h2-left, .h2-right { flex: 1 1 100%; text-align: left; }
  .h2-right h2 { margin-top: 10px; }
}

/* ==============================
   LINKS
   ============================== */
a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ==============================
   HIDE OLD TOC
   ============================== */
.toc { display: none; }
.grid-category {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  margin: 30px auto;
  max-width: 1250px;
  padding: 0 20px;
}
.grid-category a {
  display: block;
  border: 1px solid #e6e6e6;
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: #111;
  background: #fff;
  transition: transform .2s, box-shadow .2s;
}
.grid-category a:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 14px rgba(0,0,0,.08);
}
.grid-category img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: #f7f7f7;
}
.grid-category .card-body {
  padding: 10px 12px 14px;
}
.grid-category h2 {
  font-size: 1rem;
  color: #0073e6;
  margin: 0;
  text-transform: capitalize;
}
/* ==============================
   PAGINATION STYLE
   ============================== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin: 40px 0;
  gap: 6px;
}

.pagination a {
  display: inline-block;
  padding: 8px 12px;
  background: var(--content-bg);
  color: var(--accent);
  border: 1px solid #ddd;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: all 0.2s ease;
}

.pagination a:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: translateY(-1px);
}

.pagination a.active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  border-color: var(--accent);
  pointer-events: none;
}

.pagination a.prev, .pagination a.next {
  font-weight: bold;
  font-size: 1.1rem;
}
