/* ================================================================
   ANGAD.LOG — blog.css
   Blog Sidebar, Post Feed, Editor, and Integrations
   ================================================================ */

/* ── BLOG SIDEBAR ── */
.sidebar { 
  width: 280px; 
  flex-shrink: 0; 
  display: flex; 
  flex-direction: column; 
  gap: 1rem; 
  overflow-y: auto; 
  padding-right: 5px; 
  padding-bottom: 2rem; 
}

.sidebar-box { 
  background: var(--bg-card); 
  border: 2px solid var(--border-mid); 
  border-radius: 8px; 
  padding: 1.25rem; 
  position: relative; 
}

.sidebar-label { 
  font-size: 12px; /* Fixed: bumped up from 8.5px */
  color: var(--purple); 
  letter-spacing: 2px; 
  margin-bottom: 1rem; 
  text-transform: uppercase; 
}

.sidebar-nav-item { 
  display: flex; 
  align-items: center; 
  gap: 0.6rem; 
  width: 100%; 
  padding: 0.6rem 0.75rem; 
  background: transparent; 
  border: 1px solid transparent; 
  border-radius: 4px; 
  color: var(--text-dim); 
  font-size: 15px; 
  cursor: pointer; 
  text-align: left; 
  transition: all 0.13s; 
  text-transform: capitalize; 
  margin-bottom: 0.2rem; 
  font-family: 'Qaaxee';
}

.sidebar-nav-item:hover { 
  background: var(--bg-hover); 
  color: var(--text); 
}

.sidebar-nav-item.active { 
  background: var(--purple-faint); 
  border-color: var(--purple-dim); 
  color: var(--purple-bright); 
}

.sdot { 
  display: inline-block; 
  width: 7px; 
  height: 7px; 
  border-radius: 2px; 
  flex-shrink: 0; 
}

/* ── RECENT ENTRIES ── */
.recent-item { 
  display: flex; 
  flex-direction: column; 
  gap: 0.2rem; 
  padding: 0.6rem 0.5rem; 
  border-left: 2px solid transparent; 
  cursor: pointer; 
  transition: all 0.13s; 
  border-radius: 0 4px 4px 0; 
}

.recent-item:hover { 
  border-left-color: var(--purple); 
  background: var(--bg-hover); 
}

.recent-item-row { 
  display: flex; 
  align-items: flex-start; 
  gap: 0.5rem; 
}

.recent-dot { 
  display: inline-block; 
  width: 6px; 
  height: 6px; 
  border-radius: 2px; 
  flex-shrink: 0; 
  margin-top: 5px; 
}

.recent-title { 
  font-size: 15px; 
  color: var(--text); 
  line-height: 1.4; 
}

.recent-date { 
  font-size: 13px; 
  color: var(--text-faint); 
  padding-left: 1.1rem; 
}

/* ── CONNECTIONS & SPOTIFY ── */
.connect-row { 
  display: flex; 
  gap: 0.6rem; 
  justify-content: center; 
}

.connect-btn { 
  display: flex; 
  align-items: center; 
  justify-content: center; 
  width: 40px; 
  height: 40px; 
  border: 1px solid var(--border-mid); 
  border-radius: 4px; 
  color: var(--text-faint); 
  background: var(--bg); 
  cursor: pointer; 
  transition: all 0.13s; 
}

.connect-btn:hover { 
  border-color: var(--purple-dim); 
  color: var(--purple-bright); 
  background: var(--purple-faint); 
}

.connect-btn svg { 
  width: 18px; 
  height: 18px; 
  stroke: currentColor; 
  fill: none; 
  stroke-width: 1.5; 
  stroke-linecap: round; 
  stroke-linejoin: round; 
}

.spotify-content-vertical { 
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  gap: 12px; 
  text-align: center; 
}

.album-art-large { 
  position: relative; 
  width: 100px; 
  height: 100px; 
  border: 1px solid var(--border-mid); 
  border-radius: 4px; 
  overflow: hidden; 
}

#album-art { 
  width: 100%; 
  height: 100%; 
  object-fit: cover; 
  display: block; 
  image-rendering: pixelated; 
}

.music-bars { 
  display: none; 
  position: absolute; 
  bottom: 4px; 
  right: 4px; 
  height: 15px; 
  gap: 2px; 
  background: rgba(0,0,0,0.6); 
  padding: 3px 5px; 
  border-radius: 2px; 
}

.music-bars.active { display: flex; align-items: flex-end; }
.bar { width: 3px; background: var(--purple-bright); animation: bounce 1s infinite ease-in-out; }
.bar:nth-child(1) { height: 60%; animation-delay: 0s; }
.bar:nth-child(2) { height: 100%; animation-delay: 0.2s; }
.bar:nth-child(3) { height: 80%; animation-delay: 0.4s; }

@keyframes bounce { 
  0%, 100% { height: 30%; } 
  50% { height: 100%; } 
}

#song-title { font-size: 15px; color: var(--cream); font-weight: bold; margin-bottom: 2px; }
#song-artist { font-size: 13px; color: var(--text-faint); text-transform: uppercase; }

/* ── GITHUB OVERRIDES ── */
.github-box { padding: 1.25rem 1rem; }
.github-chart-container { width: 100%; overflow-x: auto; overflow-y: hidden; padding-bottom: 8px; }

/* 1. HIDE ALL THE JUNK (Headers, links, and the extra streak stats) */
.github-chart-container .sr-only, 
.github-chart-container header, 
.github-chart-container a, 
.github-chart-container .contrib-column { 
  display: none !important; 
}

/* 2. Fix the layout of the graph itself */
.github-chart-container table { border-collapse: separate; border-spacing: 3px; empty-cells: show; }
.github-chart-container .ContributionCalendar-day { 
  width: 11px !important; 
  height: 11px !important; 
  min-width: 11px !important; 
  padding: 0 !important; 
  border-radius: 3px; 
  border: 1px solid var(--bg-card); 
}

.github-chart-container span, .github-chart-container .ContributionCalendar-label { 
  color: var(--text-faint) !important; 
  font-size: 10px; 
  font-weight: normal; 
}

/* 3. FIX THE LEGEND: Force it into a left-aligned horizontal row */
.github-chart-container .contrib-footer {
  display: block !important;
  margin-top: 12px !important;
  padding: 0 !important;
}

.github-chart-container .contrib-footer div {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 6px !important;
  color: var(--text-faint) !important;
  font-size: 10px !important;
}

.github-chart-container ul.legend {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 4px !important;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

.github-chart-container ul.legend li {
  width: 11px !important; 
  height: 11px !important; 
  border-radius: 3px !important;
  border: 1px solid var(--bg-card) !important;
  display: inline-block !important;
  margin: 0 !important;
}

/* 4. Dynamic Github Theme Colors (Applied to BOTH graph and legend) */
.github-chart-container .ContributionCalendar-day[data-level="0"], 
.github-chart-container ul.legend li:nth-child(1) { background-color: var(--bg-hover) !important; }

.github-chart-container .ContributionCalendar-day[data-level="1"], 
.github-chart-container ul.legend li:nth-child(2) { background-color: var(--purple-faint) !important; border: 1px solid var(--purple-dim) !important; }

.github-chart-container .ContributionCalendar-day[data-level="2"], 
.github-chart-container ul.legend li:nth-child(3) { background-color: var(--purple-dim) !important; }

.github-chart-container .ContributionCalendar-day[data-level="3"], 
.github-chart-container ul.legend li:nth-child(4) { background-color: var(--purple) !important; }

.github-chart-container .ContributionCalendar-day[data-level="4"], 
.github-chart-container ul.legend li:nth-child(5) { background-color: var(--purple-bright) !important; }

/* ── POST FEED & CARDS ── */
#postList { 
  display: flex; 
  flex-direction: column; 
  gap: 1.5rem; 
  width: 100%; 
  margin: 0; 
}

.post-card { 
  background: var(--bg-card); 
  border: 2px solid var(--border-mid); 
  border-radius: 8px; 
  padding: 1.75rem; 
  cursor: pointer; 
  transition: all 0.15s ease; 
  position: relative; 
}

.post-card:hover { 
  border-color: var(--purple-bright); 
  transform: translateY(-1px); 
  box-shadow: 0 4px 15px rgba(0,0,0,0.2); 
}

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

.post-tag { 
  font-size: 10px; /* Bumped from 7px */
  padding: 5px 8px; 
  border-radius: 4px; 
  letter-spacing: 0.5px; 
  text-transform: uppercase; 
}

.sdot[data-t="life"], .post-tag[data-tag="life"] { 
  background: var(--tc-life); 
  color: #1a0000; 
}

.post-date, .post-views { 
  font-size: 12px; 
  color: var(--text-dim); 
  display: flex; 
  align-items: center; 
  gap: 5px; 
}

.post-read-time { 
  font-size: 11px; /* Bumped from 6.5px */
  color: var(--text-faint); 
  margin-left: auto; 
}

.post-title { 
  font-size: 2.4rem; 
  color: var(--cream); 
  line-height: 1.15; 
  margin-bottom: 0.75rem; 
  letter-spacing: 1px; 
}

.post-divider { 
  width: 45px; 
  height: 3px; 
  background: var(--purple); 
  margin-bottom: 1rem; 
  border-radius: 2px; 
}

.post-excerpt { 
  font-size: 15px; 
  color: var(--text-dim); 
  line-height: 1.7; 
  margin-bottom: 1.2rem; 
}

.read-more { 
  font-size: 12px; /* Bumped from 9px */
  color: var(--purple); 
  letter-spacing: 1px; 
  display: inline-block; 
  opacity: 0.7; 
  transition: all 0.13s; 
}

.post-card:hover .read-more { opacity: 1; color: var(--purple-bright); }

/* ── SINGLE POST VIEW ── */
#view-post { 
  position: relative; 
  background-color: rgba(10, 8, 20, 0.95); 
  padding: 2rem; 
  border: 1px solid var(--border-mid); 
  border-radius: 20px; 
  overflow: hidden; 
}

#view-post::before { 
  content: " "; 
  position: absolute; 
  top: 0; left: 0; bottom: 0; right: 0; 
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.02), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.02)); 
  z-index: 10; 
  background-size: 100% 4px, 3px 100%; 
  pointer-events: none; 
  opacity: 0.6; 
}

#postContent { position: relative; z-index: 11; }

.back-btn { 
  font-size: 14px; /* Bumped from 9px */
  color: var(--text-faint); 
  cursor: pointer; 
  letter-spacing: 1px; 
  display: inline-block; 
  margin-bottom: 1.5rem; 
  transition: color 0.13s; 
  background: none; 
  border: none; 
  padding: 0; 
  font-family: 'Qaaxee';
}

.back-btn:hover { color: var(--purple-bright); }

.single-post-title { 
  font-size: 2.6rem; 
  color: var(--cream); 
  line-height: 1.15; 
  margin: 1rem 0 0; 
  letter-spacing: 1px; 
}

.post-divider-single { 
  width: 50px; 
  height: 3px; 
  background: var(--purple); 
  margin: 1rem 0; 
  border-radius: 2px; 
}

.eye-counter { display: flex; align-items: center; gap: 0.5rem; font-size: 14px; color: var(--text-dim); }

.post-body { font-size: 16px; line-height: 1.8; color: var(--text); padding: 0; }
.post-body p { margin-bottom: 1.75rem; }
.post-body h2 { font-size: 2.2rem; color: var(--purple-bright); letter-spacing: 2px; margin: 3.5rem 0 1.25rem; text-transform: uppercase; }
.post-body .callout { background: var(--bg-card); border-left: 3px solid var(--purple); border-radius: 0 4px 4px 0; padding: 1.25rem 1.5rem; margin: 2rem 0; color: var(--text); line-height: 1.7; }
.post-body a { color: var(--purple-bright); text-decoration: underline; }
.post-body code { background: var(--bg-card); border: 1px solid var(--border-mid); padding: 2px 6px; border-radius: 3px; color: var(--cream); font-size: 13px; }

/* ── WRITE/EDITOR VIEW ── */
#view-write { display: none; flex-direction: column; position: fixed; inset: 0; background: var(--bg); z-index: 500; }
.write-header { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.5rem; border-bottom: 2px solid var(--border-mid); background: var(--bg-card); flex-wrap: wrap; }
.write-back { font-size: 14px; color: var(--text-faint); cursor: pointer; transition: color 0.13s; }
.write-back:hover { color: var(--purple-bright); }
.write-mode-label { font-size: 1.8rem; color: var(--purple-bright); text-transform: uppercase; }
.write-tag { font-size: 13px; font-family: 'Qaaxee'; background: var(--bg); border: 1px solid var(--border-mid); border-radius: 4px; color: var(--text); padding: 0.4rem 0.6rem; cursor: pointer; margin-left: auto; outline: none; }
.write-submit { font-size: 14px; font-family: 'Qaaxee'; background: var(--purple-faint); border: 1px solid var(--purple-dim); border-radius: 4px; color: var(--purple-bright); padding: 0.6rem 1rem; cursor: pointer; transition: all 0.13s; }
.write-submit:hover { background: var(--purple); color: #fff; }
.write-title-wrap { padding: 1rem 1.5rem; border-bottom: 1px solid var(--border-mid); }
.write-title-input { width: 100%; background: none; font-family: 'Qaaxee'; border: none; font-size: 2.5rem; color: var(--cream); outline: none; }
.write-pane { flex: 1; display: flex; overflow: hidden; }
.write-editor-wrap { flex: 1; display: flex; flex-direction: column; border-right: 1px solid var(--border-mid); }
.write-textarea { flex: 1; background: none; border: none; font-family: 'Qaaxee'; color: var(--text); font-size: 14px; line-height: 1.8; padding: 1.5rem; outline: none; resize: none; }
.write-editor-footer { display: flex; justify-content: space-between; padding: 0.6rem 1.5rem; font-size: 12px; color: var(--text-faint); border-top: 1px solid var(--border-mid); }
.write-preview-wrap { flex: 1; display: flex; flex-direction: column; background: var(--bg-card); }
.write-preview-label { font-size: 12px; color: var(--text-faint); padding: 0.6rem 1.5rem; border-bottom: 1px solid var(--border-mid); background: var(--bg); }
#writePreviewContent { flex: 1; overflow-y: auto; padding: 1.5rem; }
.preview-empty { color: var(--text-faint); font-size: 1.2rem; }
.preview-toggle-btn { background: transparent; font-family: 'Qaaxee'; border: 1px solid var(--border-mid); color: var(--purple-bright); padding: 4px 12px; font-size: 11px; cursor: pointer; text-transform: uppercase; margin: 0 10px; }

/* ================================================================
   MOBILE BLOG RESPONSIVENESS (Screens under 900px)
   ================================================================ */

@media (max-width: 900px) {
  /* Hide the sidebar by default on mobile */
  .sidebar {
    display: none; 
    width: 100%;
    border-right: none;
    border-bottom: 2px solid var(--border-mid);
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
  }

  /* Show it when the hamburger button is clicked */
  .sidebar.mobile-open {
    display: flex; 
    flex-direction: column;
    gap: 12px;
    animation: fadeInDown 0.3s ease-out forwards;
  }

  .sidebar-box {
    padding: 16px; 
    margin-bottom: 0; 
  }

  .github-chart-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  @keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
  }
}