/* ============================================
   Custom Styles for Butterfly Theme
   With background image support
   ============================================ */

/* ---------- Global Card Overlay ---------- */
/* Make body background transparent so site bg shows through */
body {
  background: transparent !important;
}

/* ---------- Card Semi-transparent Effect ---------- */
/* Homepage article cards */
#recent-posts .recent-post-item {
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

#recent-posts .recent-post-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  background: rgba(255, 255, 255, 0.95) !important;
}

/* Sidebar cards */
.card-widget {
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 12px !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.card-widget:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.95) !important;
}

/* ---------- Category / Tag / Archive Pages ---------- */
/* Main content area on category, tag, archive pages */
.layout > div:first-child:not(.nc) {
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Category list styling */
.category-lists .category-list a {
  color: var(--font-color);
}

/* Tag cloud styling */
.tag-cloud-list a {
  border-radius: 8px !important;
}

/* Archive styling */
.article-sort {
  margin-left: 0;
  padding-left: 20px;
}

.article-sort-item {
  transition: all 0.3s ease;
}

.article-sort-item:hover {
  transform: translateX(4px);
}

/* ---------- Top Navigation ---------- */
/* Remove blue fallback background from header, let #web_bg handle it */
#page-header {
  background-color: transparent !important;
}

/* When index_img is set, the header uses it as background-image */
#page-header.full_page {
  background-color: transparent !important;
}

#nav {
  background: rgba(255, 255, 255, 0.15) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#nav a,
#nav span.site-page,
#nav .site-name {
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Fixed navigation bar */
.nav-fixed #nav {
  background: rgba(255, 255, 255, 0.7) !important;
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

/* ---------- Homepage Header / Banner ---------- */
#page-header.full_page {
  background-attachment: fixed;
}

#page-header #site-title {
  font-size: 2.2em;
  font-weight: 700;
  letter-spacing: 2px;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

#page-header #site-subtitle {
  font-size: 1.3em;
  font-weight: 400;
  letter-spacing: 1px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  opacity: 0.9;
}

/* ---------- Scroll Down Button ---------- */
#scroll-down .scroll-down-effects {
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ---------- Article List Styling ---------- */
.recent-post-info .article-title {
  font-size: 1.3em;
  font-weight: 600;
  transition: color 0.3s ease;
}

.recent-post-info .article-title:hover {
  color: var(--theme-color, #49B1F5);
}

.recent-post-info .article-meta-wrap {
  opacity: 0.75;
}

.recent-post-info .content {
  opacity: 0.85;
  line-height: 1.7;
}

/* ---------- Tags & Categories ---------- */
.recent-post-info .article-meta-wrap a {
  transition: all 0.3s ease;
}

.recent-post-info .article-meta-wrap a:hover {
  color: var(--theme-color, #49B1F5);
}

/* ---------- Footer ---------- */
#footer {
  background: rgba(0, 0, 0, 0.3) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#footer-wrap {
  color: rgba(255, 255, 255, 0.85);
}

#footer-wrap a {
  color: rgba(255, 255, 255, 0.9);
}

/* ---------- Page Layout (Non-homepage) ---------- */
.layout {
  background: transparent !important;
}

/* ---------- Pagination ---------- */
.pagination a,
.pagination span {
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 8px !important;
  transition: all 0.3s ease;
}

.pagination a:hover {
  background: rgba(255, 255, 255, 0.95) !important;
  transform: translateY(-2px);
}

/* ---------- Article Page ---------- */
#post {
  background: rgba(255, 255, 255, 0.88) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 20px 30px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

/* ---------- Archives / Tags / Categories Pages ---------- */
#archive,
#tags,
#categories {
  background: rgba(255, 255, 255, 0.85) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 20px 30px;
}

/* ============================================
   Dark Mode Overrides
   ============================================ */
[data-theme='dark'] #recent-posts .recent-post-item {
  background: rgba(30, 30, 36, 0.85) !important;
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme='dark'] #recent-posts .recent-post-item:hover {
  background: rgba(40, 40, 48, 0.95) !important;
}

[data-theme='dark'] .card-widget {
  background: rgba(30, 30, 36, 0.85) !important;
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme='dark'] .card-widget:hover {
  background: rgba(40, 40, 48, 0.95) !important;
}

[data-theme='dark'] #post {
  background: rgba(30, 30, 36, 0.88) !important;
}

[data-theme='dark'] #archive,
[data-theme='dark'] #tags,
[data-theme='dark'] #categories {
  background: rgba(30, 30, 36, 0.85) !important;
}

[data-theme='dark'] #nav {
  background: rgba(20, 20, 26, 0.4) !important;
}

[data-theme='dark'] .nav-fixed #nav {
  background: rgba(20, 20, 26, 0.7) !important;
}

[data-theme='dark'] #footer {
  background: rgba(0, 0, 0, 0.5) !important;
}

[data-theme='dark'] .pagination a,
[data-theme='dark'] .pagination span {
  background: rgba(30, 30, 36, 0.85) !important;
}

[data-theme='dark'] .layout > div:first-child:not(.nc) {
  background: rgba(30, 30, 36, 0.85) !important;
  border-color: rgba(255, 255, 255, 0.08);
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media screen and (max-width: 768px) {
  #recent-posts > .recent-post-item {
    border-radius: 8px;
  }

  #post {
    padding: 15px 18px;
    border-radius: 8px;
  }

  #page-header #site-title {
    font-size: 1.6em;
  }

  #page-header #site-subtitle {
    font-size: 1em;
  }
}
