/* Blog-specific styles that match the main portfolio theme */

/* Import the main theme variables */
:root {
  --bg-primary: #f0f4ff;
  --bg-secondary: #ffffff;
  --accent: #ff6b35;
  --accent-glow: rgba(255, 107, 53, 0.3);
  --text-primary: #1a1a2e;
  --text-secondary: #5a5a6e;
  --card-bg: rgba(255, 255, 255, 0.95);
  --border: rgba(255, 107, 53, 0.2);
  --gradient-1: #ff6b35;
  --gradient-2: #f7931e;
  --gradient-3: #4ecdc4;
  --gradient-4: #6c5ce7;
}

[data-theme="dark"] {
  --bg-primary: #0a0e27;
  --bg-secondary: #1a1f3a;
  --accent: #00d9ff;
  --accent-glow: rgba(0, 217, 255, 0.3);
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --card-bg: rgba(26, 31, 58, 0.8);
  --border: rgba(0, 217, 255, 0.2);
  --gradient-1: #00d9ff;
  --gradient-2: #6366f1;
  --gradient-3: #ec4899;
  --gradient-4: #8b5cf6;
}

/* Blog card styling */
.blog-card, .blog-index-card {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  width: 100%;
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 48px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
  animation: slideUp 0.8s ease-out;
}

.blog-card::before, .blog-index-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 24px;
  padding: 2px;
  background: linear-gradient(135deg, var(--gradient-1), var(--gradient-2), var(--gradient-3), var(--gradient-4));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: rotateGradient 8s linear infinite;
}

/* Blog header styling */
.blog-header {
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.blog-title-section {
  text-align: center;
  margin-bottom: 20px;
}

.blog-post-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 15px;
  background: linear-gradient(135deg, var(--gradient-1), var(--gradient-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.blog-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 15px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.blog-date {
  display: flex;
  align-items: center;
  gap: 5px;
}

.blog-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.blog-tag {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-family: 'JetBrains Mono', monospace;
}

/* Blog content wrapper with sidebar */
.blog-content-wrapper {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 40px;
  margin-top: 20px;
}

@media (max-width: 768px) {
  .blog-content-wrapper {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* Main blog content */
.blog-main-content {
  min-width: 0;
}

/* Blog article styling */
.blog-article {
  line-height: 1.8;
  color: var(--text-primary);
}

.blog-article h1,
.blog-article h2,
.blog-article h3,
.blog-article h4,
.blog-article h5,
.blog-article h6 {
  margin: 1.5em 0 0.8em 0;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
}

.blog-article h1 {
  font-size: 2rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.5rem;
}

.blog-article h2 {
  font-size: 1.7rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.blog-article h3 {
  font-size: 1.4rem;
}

.blog-article p {
  margin-bottom: 1.2em;
  line-height: 1.8;
}

.blog-article a {
  color: var(--accent);
  text-decoration: none;
  transition: all 0.3s ease;
}

.blog-article a:hover {
  text-decoration: underline;
}

.blog-article ul,
.blog-article ol {
  margin: 1.2em 0;
  padding-left: 1.5em;
}

.blog-article li {
  margin-bottom: 0.5em;
}

.blog-article blockquote {
  margin: 1.5em 0;
  padding: 1.5em 1.5em 1.5em 2em;
  border-left: 4px solid var(--accent);
  background: var(--bg-secondary);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--text-secondary);
}

.blog-article code {
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9em;
  border: 1px solid var(--border);
}

.blog-article pre {
  margin: 1.5em 0;
  border-radius: 8px;
  overflow-x: auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  padding: 16px;
}

.blog-article pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

.blog-article img {
  max-width: 100%;
  border-radius: 8px;
  margin: 1.5em 0;
  display: block;
  height: auto;
}

/* Sidebar styling */
.blog-sidebar {
  min-width: 300px;
}

.sidebar-content {
  position: sticky;
  top: 20px;
}

.blog-profile {
  text-align: center;
  margin-bottom: 30px;
  padding: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.blog-profile-img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 15px;
  border: 3px solid var(--accent);
}

.blog-author-name {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 5px;
  color: var(--text-primary);
}

.blog-author-title {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
  font-family: 'JetBrains Mono', monospace;
}

.sidebar-section {
  margin-bottom: 30px;
  padding: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.sidebar-title {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 15px 0;
  color: var(--accent);
  font-weight: 700;
}

.recent-posts-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.recent-post-item {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.recent-post-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.recent-post-link {
  display: block;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
  margin-bottom: 5px;
  transition: all 0.3s ease;
}

.recent-post-link:hover {
  color: var(--accent);
}

.recent-post-date {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
}

.categories-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-link {
  display: inline-block;
  padding: 6px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.8rem;
  transition: all 0.3s ease;
}

.category-link:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.sidebar-text {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0 0 15px 0;
}

.subscribe-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.subscribe-input {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
}

.subscribe-input:focus {
  outline: none;
  border-color: var(--accent);
}

.subscribe-button {
  padding: 10px 12px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.subscribe-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--accent-glow);
}

/* RSS subscription link */
.rss-subscribe-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-primary);
    color: var(--text-primary);
    text-decoration: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    width: fit-content;
}

.rss-subscribe-link:hover {
    background: linear-gradient(135deg, var(--gradient-1), var(--gradient-2));
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.rss-subscribe-link i {
    font-size: 1rem;
}

/* Post navigation */
.post-navigation {
  display: flex;
  justify-content: space-between;
  margin: 40px 0;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.nav-link {
  display: flex;
  align-items: center;
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.3s ease;
  max-width: 45%;
  padding: 12px 20px;
  border-radius: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.nav-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 107, 53, 0.2), transparent);
  transition: left 0.5s ease;
}

.nav-link:hover {
  color: white;
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 25px var(--accent-glow);
  background: linear-gradient(135deg, var(--gradient-1), var(--gradient-2));
}

.nav-link:hover::before {
  left: 100%;
}

.nav-link i {
  margin: 0 8px;
  font-size: 0.9rem;
  transition: transform 0.3s ease;
}

.nav-link:hover i {
  transform: scale(1.2);
}

.prev-link {
  text-align: left;
  flex-direction: row-reverse;
}

.next-link {
  text-align: right;
}

/* Comments section */
.comments-section {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid var(--border);
}

.comments-title {
  font-size: 1.2rem;
  margin-bottom: 20px;
  color: var(--text-primary);
}

/* Blog index page specific styles */
.blog-index-header {
  text-align: center;
  margin-bottom: 40px;
}

.blog-index-title {
  font-size: 2.5rem;
  margin-bottom: 15px;
  background: linear-gradient(135deg, var(--gradient-1), var(--gradient-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.blog-index-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin: 0;
}

.blog-posts-grid {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.blog-post-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 25px;
  transition: all 0.3s ease;
}

.blog-post-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px var(--accent-glow);
}

.blog-post-card-title {
  margin: 0 0 12px 0;
}

.blog-post-card-title a {
  color: var(--text-primary);
  text-decoration: none;
  font-size: 1.4rem;
  font-weight: 700;
  transition: all 0.3s ease;
}

.blog-post-card-title a:hover {
  color: var(--accent);
}

.blog-post-meta {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  flex-wrap: wrap;
}

.read-more-link {
  display: inline-flex;
  align-items: center;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  z-index: 10;
}

.read-more-link:hover {
  color: var(--gradient-1);
}

.read-more-link i {
  margin-left: 5px;
  transition: transform 0.3s ease;
}

.read-more-link:hover i {
  transform: translateX(3px);
}

/* Back to home button */
.back-to-home {
  position: fixed;
  bottom: 20px;
  left: 20px;
  padding: 12px 20px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
}

.back-to-home:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px var(--accent-glow);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .blog-card, .blog-index-card {
    padding: 24px;
  }
  
  .blog-post-title {
    font-size: 2rem;
  }
  
  .blog-content-wrapper {
    grid-template-columns: 1fr;
    grid-template-areas: "main" "sidebar";
  }
  
  .blog-sidebar {
    grid-area: sidebar;
    min-width: unset;
    margin-top: 30px;
  }
  
  .blog-main-content {
    grid-area: main;
  }
  
  .post-navigation {
    flex-direction: column;
    gap: 20px;
  }
  
  .nav-link {
    max-width: 100%;
    justify-content: center;
  }
  
  .prev-link, .next-link {
    text-align: center;
    flex-direction: row;
  }
  
  .back-to-home {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    width: calc(100% - 40px);
    margin: 0;
    z-index: 1000;
    justify-content: center;
  }
}

/* Animation keyframes */
@keyframes rotateGradient {
  0% {
    filter: hue-rotate(0deg);
  }
  100% {
    filter: hue-rotate(360deg);
  }
}

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