/* =================== ROOT VARIABLES =================== */
:root {
  --primary: #1a73e8;
  --primary-dark: #1557b0;
  --accent: #fbbc04;
  --bg: #f8f9fa;
  --text: #1a1a2e;
  --text-muted: #6c757d;
  --border: #dee2e6;
  --card-radius: 12px;
}

/* =================== BASE =================== */
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* =================== NAVBAR =================== */
.navbar-brand {
  font-family: 'Merriweather', serif;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
}

.navbar-brand span { color: var(--accent); }

.navbar { border-bottom: 1px solid var(--border); }

.nav-link.active {
  color: var(--primary) !important;
  font-weight: 600;
}

/* =================== HERO (articles index) =================== */
.hero {
  line-height: 0;
  margin: 0;
  padding: 0;
  background: linear-gradient(135deg, #071e2b 0%, #0b2d3e 60%, #0e4d60 100%);
}

.hero-banner {
  max-height: 100px;
  display: block;
}

/* =================== CATEGORY BAR =================== */
.category-bar {
  background: white;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 56px;
  z-index: 100;
  box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}

.cat-scroll {
  display: flex;
  overflow-x: auto;
  gap: 0;
  scrollbar-width: none;
}

.cat-scroll::-webkit-scrollbar { display: none; }

.cat-btn {
  background: none;
  border: none;
  padding: 0.65rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
}

.cat-btn:hover { color: var(--primary); }

.cat-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}

/* =================== POST CARDS =================== */
.post-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

.post-card-link {
  text-decoration: none;
  color: inherit;
}

.post-card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}

.post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.post-card-img {
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  flex-shrink: 0;
  background: linear-gradient(135deg, #e8f0fe, #c7d7fd);
}

.post-card-body {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.post-category-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #e8f0fe;
  color: #1d4ed8;
}

.post-date {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.post-card h3 {
  font-family: 'Merriweather', serif;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.post-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
  margin: 0;
}

.post-card-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.author-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.author-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
 background:linear-gradient(135deg,#1a73e8,#7c3aed);
}

.author-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
}

/* =================== SIDEBAR =================== */
.sidebar-widget {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--card-radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.sidebar-widget-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}

.sidebar-cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f1f3f5;
  text-decoration: none;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.15s;
}

.sidebar-cat-item:hover { color: var(--primary); }

.sidebar-cat-item:last-child { border-bottom: none; }

.sidebar-cat-count {
  font-size: 0.75rem;
  background: #f1f3f5;
  color: var(--text-muted);
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
}

/* =================== PAGINATION =================== */
.page-link { border-radius: 8px !important; margin: 0 2px; }

/* =================== READING PROGRESS BAR (article show) =================== */
#readingProgress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--accent);
  width: 0%;
  z-index: 9999;
  transition: width 0.1s linear;
}

/* =================== POST HERO (article show) =================== */
.post-hero {
  background: linear-gradient(135deg, #071e2b 0%, #0b2d3e 60%, #0e4d60 100%);
  color: white;
  padding: 3rem 0 2.5rem;
}

/* =================== ARTICLE CONTENT (article show) =================== */
.post-content {
  font-family: 'Merriweather', serif;
  font-size: 1.05rem;
  line-height: 1.85;
  color: #2d2d44;
}

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

.post-content h2 {
  font-size: 1.45rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
  color: var(--text);
}

.post-content h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
  color: var(--text);
}

.post-content blockquote {
  border-left: 4px solid var(--accent);
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  background: #fffbeb;
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: #78350f;
}

.post-content ul,
.post-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
}

.post-content li { margin-bottom: 0.5rem; }

/* =================== ARTICLE IMAGE PLACEHOLDER (article show) =================== */
.article-img {
  border-radius: var(--card-radius);
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #e8f0fe, #c7d7fd);
}

/* =================== TAGS (article show) =================== */
.tag {
  font-size: 0.75rem;
  padding: 0.25rem 0.65rem;
  border-radius: 100px;
  background: #f1f3f5;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.tag:hover { background: #cffafe; color: var(--primary); }

/* =================== SHARE STICKY (article show) =================== */
.share-sticky {
  position: sticky;
  top: 80px;
}

/* =================== FOOTER =================== */
footer {
  background: #0d1117;
  color: #c9d1d9;
}

footer a {
  color: #c9d1d9;
  text-decoration: none;
  font-size: 0.875rem;
}

footer a:hover { color: white; }

footer h6 { color: white; font-weight: 700; margin-bottom: 1rem; }

.footer-bottom {
  background: #080c10;
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* =================== COOKIE CONSENT =================== */
.cookie-consent {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  max-width: 860px;
  margin: 0 auto;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 14px 36px rgba(13, 17, 23, 0.16);
  padding: 0.9rem;
  display: none;
  gap: 0.8rem;
  align-items: center;
  justify-content: space-between;
  z-index: 1100;
}

.cookie-consent.is-visible {
  display: flex;
  animation: cookieSlideIn 0.28s ease-out;
}

.cookie-consent__body {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  min-width: 0;
}

.cookie-consent__text {
  font-size: 0.85rem;
  color: #324154;
  line-height: 1.55;
}

.cookie-consent__text a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.cookie-consent__text a:hover {
  text-decoration: underline;
}

.cookie-consent__btn {
  border-radius: 999px;
  padding: 0.4rem 0.95rem;
  flex-shrink: 0;
}

@keyframes cookieSlideIn {
  from {
    transform: translateY(12px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 767px) {
  .cookie-consent {
    flex-direction: column;
    align-items: stretch;
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
  }

  .cookie-consent__btn {
    width: 100%;
  }
}

/* =================== SCROLL TO TOP =================== */
.scroll-top-btn {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #1a73e8, #1557b0);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(13, 17, 23, 0.24);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  z-index: 1050;
}

.scroll-top-btn:hover {
  box-shadow: 0 14px 28px rgba(13, 17, 23, 0.28);
}

.scroll-top-btn.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

body.cookie-consent-visible .scroll-top-btn {
  bottom: 5.9rem;
}

@media (max-width: 767px) {
  .scroll-top-btn {
    right: 0.75rem;
    bottom: 0.75rem;
  }

  body.cookie-consent-visible .scroll-top-btn {
    bottom: 8.6rem;
  }
}
