/* Hassan Ali Mehdi - Professional Portfolio Stylesheet */

/* CSS Custom Properties for consistent theming */
:root {
  --primary-color: #1e3a8a;
  --secondary-color: #3b82f6;
  --accent-color: #f59e0b;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --background-light: #f9fafb;
  --background-white: #ffffff;
  --border-color: #e5e7eb;
  --shadow-light: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-medium: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-large: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --border-radius: 8px;
  --border-radius-large: 16px;
  --transition: all 0.3s ease;
}

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--background-light);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 1rem;
}

h1 {

  font-size: 3rem;
  font-weight: 700;
}

h2 {
  font-size: 2.5rem;
  color: var(--primary-color);
}

h3 {
  font-size: 2rem;
}

h4 {
  font-size: 1.5rem;
}

h5 {
  font-size: 1.25rem;
}

h6 {
  font-size: 1.125rem;
}

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

a {
  color: var(--secondary-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-color);
}

/* Layout Components */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.section {
  padding: 4rem 0;
}

.section-title {
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -0.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
  border-radius: 2px;
}

/* Navigation */
.navbar {
  background: var(--background-white);
  box-shadow: var(--shadow-light);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.logo {
  font-family: 'Poppins', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-link {
  font-weight: 500;
  padding: 0.5rem 0;
  position: relative;
  transition: var(--transition);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-color);
  transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 0.5rem;
}

.hamburger {
  width: 25px;
  height: 3px;
  background: var(--primary-color);
  margin: 3px 0;
  transition: var(--transition);
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  padding: 6rem 0;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="20" cy="20" r="1" fill="white" opacity="0.1"/><circle cx="80" cy="40" r="1" fill="white" opacity="0.1"/><circle cx="40" cy="80" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  opacity: 0.1;
}

.hero-content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3rem;
  min-height: 500px;
  max-width: 1200px;
  margin: 0 auto;
}

.hero-text {
  flex: 1;
  max-width: 550px;
}

.hero-image-container {
  flex: 0 0 320px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.hero-profile-image {
  width: 300px;
  height: 380px;
  object-fit: cover;
  border-radius: var(--border-radius-large);
  box-shadow: var(--shadow-large);
  transition: var(--transition);
}

.hero-profile-image:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.hero h1 {
  margin-bottom: 1rem;
  font-size: 3.5rem;
}

.hero-subtitle {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  opacity: 0.95;
  color: rgba(255, 255, 255, 0.95);
}

.hero-description {
  font-size: 1.125rem;
  margin-bottom: 2rem;
  opacity: 0.9;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* Page Hero Section (for non-homepage) */
.hero-page .hero-content {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
  gap: 0;
  min-height: 400px;
}

.hero-page .hero-text {
  width: 100%;
  max-width: none;
  flex: none;
}

.hero-page .hero-subtitle {
  display: none;
}

.hero-page .hero-actions {
  justify-content: center;
}

.hero-page .hero-image-container {
  display: none;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  border-radius: var(--border-radius);
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  font-size: 1rem;
}

.btn-primary {
  background: var(--accent-color);
  color: white;
}

.btn-primary:hover {
  background: #d97706;
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

.btn-secondary {
  background: transparent;
  color: var(--secondary-color);
  border: 2px solid var(--secondary-color);
}

.btn-secondary:hover {
  background: var(--secondary-color);
  color: white;
}

.btn-outline {
  background: transparent;
  color: white;
  border: 2px solid white;
}

.btn-outline:hover {
  background: white;
  color: var(--primary-color);
}

/* Cards */
.card {
  background: var(--background-white);
  border-radius: var(--border-radius-large);
  padding: 2rem;
  box-shadow: var(--shadow-light);
  transition: var(--transition);
  border: 1px solid var(--border-color);
}

.card:hover {
  box-shadow: var(--shadow-large);
  transform: translateY(-5px);
}

.card-title {
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.card-meta {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.card-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  color: white;
  font-size: 1.5rem;
}

/* Grid Layouts */
.grid {
  display: grid;
  gap: 2rem;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 2rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--secondary-color);
}

.timeline-item {
  position: relative;
  margin-bottom: 3rem;
  padding-left: 2rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -1.5rem;
  top: 0.5rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-color);
  border: 3px solid var(--background-white);
  box-shadow: var(--shadow-light);
}

.timeline-date {
  color: var(--accent-color);
  font-weight: 600;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.timeline-title {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.timeline-company {
  color: var(--secondary-color);
  font-weight: 500;
  margin-bottom: 1rem;
}

/* Skills */
.skill-category {
  margin-bottom: 2rem;
}

.skill-category h4 {
  color: var(--primary-color);
  margin-bottom: 1rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.skill-tag {
  background: var(--background-white);
  color: var(--primary-color);
  padding: 0.5rem 1rem;
  border-radius: 25px;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.skill-tag:hover {
  background: var(--secondary-color);
  color: white;
  transform: translateY(-2px);
}

/* Image Placeholders */
.image-placeholder {
  background: linear-gradient(135deg, var(--border-color), #d1d5db);
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-align: center;
  border: 2px dashed var(--border-color);
  transition: var(--transition);
}

.image-placeholder:hover {
  border-color: var(--secondary-color);
  background: linear-gradient(135deg, #e0e7ff, #f0f9ff);
}

.profile-image {
  width: 200px;
  height: 250px;
  border-radius: var(--border-radius-large);
  margin: 0 auto 2rem;
  object-fit: cover;
  box-shadow: var(--shadow-medium);
  transition: var(--transition);
}

.profile-image:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-large);
}

.hero-image {
  width: 300px;
  height: 300px;
  border-radius: var(--border-radius-large);
  margin: 2rem auto;
}

.project-image {
  width: 100%;
  height: 200px;
  border-radius: var(--border-radius);
  margin-bottom: 1rem;
}

/* Contact Form */
.contact-form {
  background: var(--background-white);
  padding: 2rem;
  border-radius: var(--border-radius-large);
  box-shadow: var(--shadow-medium);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-primary);
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: var(--transition);
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

/* Checkbox Group Styling */
.checkbox-group {
  display: flex;
  gap: 2rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.checkbox-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  border: 2px solid var(--primary-color);
  border-radius: 4px;
  background: var(--background-white);
  cursor: pointer;
  position: relative;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}

.checkbox-item input[type="checkbox"]:checked {
  background: var(--primary-color);
  border-color: var(--primary-color);
}

.checkbox-item input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
  font-weight: bold;
}

.checkbox-item label {
  margin: 0;
  cursor: pointer;
  font-weight: 500;
  color: var(--text-color);
}

.checkbox-item input[type="checkbox"]:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Social Links */
.social-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
}

.social-link {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--secondary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: var(--transition);
}

.social-link:hover {
  background: var(--primary-color);
  transform: translateY(-3px);
  color: white;
}

/* Footer */
.footer {
  background: var(--primary-color);
  color: white;
  text-align: center;
  padding: 2rem 0;
  margin-top: 4rem;
}

.footer p {
  color: rgba(255, 255, 255, 0.8);
}

/* Responsive Design */
@media (max-width: 768px) {
  .nav-menu {
    display: none;
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: var(--background-white);
    flex-direction: column;
    padding: 2rem;
    box-shadow: var(--shadow-large);
    gap: 1rem;
  }

  .nav-menu.active {
    display: flex;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .hero {
    padding: 4rem 0;
  }

  .hero-content {
    flex-direction: column-reverse;
    gap: 2rem;
    text-align: center;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 1rem;
  }

  .hero-image-container {
    flex: none;
  }

  .hero-profile-image {
    width: 250px;
    height: 300px;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .hero-subtitle {
    font-size: 1.125rem;
  }

  h2 {
    font-size: 2rem;
  }

  .container {
    padding: 0 1rem;
  }

  .section {
    padding: 2rem 0;
  }

  .grid {
    gap: 1rem;
  }

  .timeline {
    padding-left: 1rem;
  }

  .timeline-item {
    padding-left: 1rem;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 2rem;
  }

  .btn {
    padding: 0.5rem 1.5rem;
    font-size: 0.875rem;
  }

  .card {
    padding: 1.5rem;
  }

  .profile-image {
    width: 150px;
    height: 150px;
  }

  .hero-image {
    width: 250px;
    height: 250px;
  }
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeInUp 0.6s ease-out;
}

/* Loading Animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 2rem; }

.highlight {
  background: linear-gradient(120deg, transparent 0%, transparent 50%, var(--accent-color) 50%);
  background-size: 240% 100%;
  background-repeat: no-repeat;
  background-position: 100% 0;
  transition: var(--transition);
}

.highlight:hover {
  background-position: 0 0;
  color: white;
}

/* Footer */
.footer {
  background: var(--primary-color);
  color: white;
  padding: 3rem 0 1rem;
  margin-top: 4rem;
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 2rem;
}

.footer-section h3 {
  margin-bottom: 1rem;
  color: var(--accent-color);
  font-size: 1.25rem;
}

.footer-section p {
  line-height: 1.6;
  opacity: 0.9;
}

.footer-nav {
  list-style: none;
  padding: 0;
}

.footer-nav li {
  margin-bottom: 0.5rem;
}

.footer-nav a {
  color: white;
  text-decoration: none;
  transition: var(--transition);
  opacity: 0.8;
}

.footer-nav a:hover {
  color: var(--accent-color);
  opacity: 1;
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border-radius: 50%;
  text-decoration: none;
  transition: var(--transition);
}

.footer-social a:hover {
  background: var(--accent-color);
  transform: translateY(-2px);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 2rem;
  text-align: center;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-bottom p {
  margin: 0;
  opacity: 0.8;
}

.footer-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.footer-admin-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-color);
  color: white;
  padding: 0.6rem 1.4rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
  box-shadow: 0 8px 20px rgba(18, 112, 215, 0.25);
}

.footer-admin-button i {
  font-size: 0.9rem;
}

.footer-admin-button:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
}

.back-to-top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.back-to-top:hover {
  color: white;
}

/* Footer Responsive */
@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .footer-actions {
    flex-direction: column;
    width: 100%;
  }

  .footer-admin-button {
    width: 100%;
    justify-content: center;
  }
  
  .footer-social {
    justify-content: center;
  }
}

/* ============================================
   BLOGS PAGE STYLES
   ============================================ */

/* Blogs Section */
.blogs-section {
  padding: 4rem 0;
  background: var(--light-blue);
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.section-header h2 {
  font-size: 2.25rem;
  color: var(--dark-blue);
  margin-bottom: 0.75rem;
}

.section-header p {
  color: var(--gray);
  font-size: 1.05rem;
  line-height: 1.6;
}

.blogs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2rem;
  margin-bottom: 3rem;
}

.blogs-loading {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 4rem 1rem;
  background: white;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.12);
  color: var(--gray);
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 4px solid rgba(15, 23, 42, 0.1);
  border-top-color: var(--accent-color);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.blog-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.featured-blog {
  grid-column: span 2;
}

.blog-image {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.featured-blog .blog-image {
  height: 250px;
}

.blog-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.blog-card:hover .blog-image img {
  transform: scale(1.05);
}

.blog-category {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: var(--gold);
  color: white;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.blog-content {
  padding: 1.5rem;
}

.blog-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  color: var(--gray);
}

.blog-meta span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.blog-card h3 {
  color: var(--dark-blue);
  font-size: 1.2rem;
  margin-bottom: 0.8rem;
  line-height: 1.4;
}

.featured-blog h3 {
  font-size: 1.5rem;
}

.blog-card p {
  color: var(--gray);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.blog-read-more {
  color: var(--dark-blue);
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.3s ease;
}

.blog-read-more:hover {
  color: var(--gold);
}

.blog-read-more i {
  font-size: 0.8rem;
  transition: transform 0.3s ease;
}

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

/* Blog Categories */
.blog-categories {
  text-align: center;
  margin-top: 3rem;
}

.blog-categories h3 {
  color: var(--dark-blue);
  margin-bottom: 1.5rem;
}

.category-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  justify-content: center;
}

.category-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: white;
  color: var(--dark-blue);
  padding: 0.6rem 1.2rem;
  border-radius: 25px;
  font-weight: 500;
  border: 0;
  transition: all 0.3s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  cursor: pointer;
}

.category-tag:hover {
  background: var(--dark-blue);
  color: white;
  transform: translateY(-2px);
}

.category-tag.is-active {
  background: var(--accent-color);
  color: white;
  box-shadow: 0 10px 25px rgba(18, 112, 215, 0.3);
}

/* Blogs Responsive */
@media (max-width: 1024px) {
  .featured-blog {
    grid-column: span 1;
  }
  
  .blogs-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
}

@media (max-width: 768px) {
  .blogs-section {
    padding: 3rem 0;
  }
  
  .blogs-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .blog-image {
    height: 180px;
  }
  
  .featured-blog .blog-image {
    height: 200px;
  }
  
  .blog-content {
    padding: 1.2rem;
  }
  
  .blog-meta {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .category-tags {
    gap: 0.6rem;
  }
  
  .category-tag {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }
}

/* ============================================
   AUTHENTICATION PAGES
   ============================================ */

.auth-section {
  padding: 4rem 0;
  background: var(--light-blue);
}

.auth-container {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: stretch;
}

.auth-card {
  background: white;
  border-radius: 20px;
  padding: 2.5rem;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.12);
  position: relative;
  overflow: hidden;
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(18, 112, 215, 0.12), rgba(255, 215, 0, 0.08));
  z-index: 0;
  opacity: 0.8;
}

.auth-card > * {
  position: relative;
  z-index: 1;
}

.auth-card-header h2 {
  color: var(--dark-blue);
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.auth-card-header p {
  color: var(--gray);
  margin-bottom: 2rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.auth-form.is-loading {
  opacity: 0.65;
  pointer-events: none;
}

.input-with-icon {
  display: flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.03);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  padding: 0.4rem 0.75rem;
  transition: var(--transition);
}

.input-with-icon:focus-within {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 4px rgba(18, 112, 215, 0.12);
  background: white;
}

.input-with-icon i {
  margin-right: 0.75rem;
  color: var(--accent-color);
}

.input-with-icon input {
  border: none;
  background: transparent;
  flex: 1;
  font-size: 1rem;
  padding: 0.85rem 0.75rem;
}

.input-with-icon input:focus {
  outline: none;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: var(--gray);
}

.remember-me input {
  width: 18px;
  height: 18px;
}

.auth-link {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 500;
}

.auth-link:hover {
  color: var(--dark-blue);
}

.auth-submit {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  justify-content: center;
}

.auth-submit[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-error {
  color: #d64747;
  font-weight: 600;
  min-height: 1.5rem;
}

.auth-hint {
  margin-top: 2rem;
  padding: 1.5rem;
  border-radius: 16px;
  background: rgba(18, 112, 215, 0.08);
  color: var(--dark-blue);
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.auth-hint i {
  margin-top: 0.3rem;
}

.auth-side-info {
  align-self: stretch;
}

.auth-side-card {
  background: rgba(18, 112, 215, 0.1);
  border-radius: 20px;
  padding: 2rem;
  color: var(--dark-blue);
  box-shadow: 0 20px 45px rgba(18, 112, 215, 0.15);
}

.auth-side-card h3 {
  margin-bottom: 1rem;
}

.auth-side-card ul {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: grid;
  gap: 0.75rem;
}

.auth-side-card li {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.auth-side-card i {
  color: var(--accent-color);
}

@media (max-width: 1024px) {
  .auth-container {
    grid-template-columns: 1fr;
  }

  .auth-side-info {
    order: -1;
  }
}

@media (max-width: 640px) {
  .auth-card {
    padding: 2rem;
  }

  .auth-hint {
    flex-direction: column;
  }

  .form-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .auth-submit {
    width: 100%;
  }
}

/* ============================================
   BLOG EDITOR PAGE
   ============================================ */

.editor-section {
  padding: 4rem 0 6rem;
}

.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}

.editor-form {
  background: white;
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: 0 35px 70px rgba(15, 23, 42, 0.15);
  position: relative;
}

.editor-form-header h2 {
  color: var(--dark-blue);
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.editor-form-header p {
  color: var(--gray);
  margin-bottom: 2rem;
}

.editor-two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
}

.select-wrapper {
  position: relative;
}

.select-wrapper::after {
  content: '\f078';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--accent-color);
}

.select-wrapper select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 3rem;
}

.form-textarea--large {
  min-height: 220px;
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
  justify-content: center;
  align-items: stretch;
}

.editor-toolbar .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 160px;
  justify-content: center;
}

.editor-status {
  margin-top: 1rem;
  font-weight: 500;
  min-height: 1.5rem;
  color: var(--accent-color);
}

.editor-status.is-success {
  color: #2f8f46;
}

.editor-status.is-error {
  color: #d64747;
}

.editor-preview {
  position: relative;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(226, 240, 254, 0.95));
  border-radius: 24px;
  padding: 2.2rem;
  color: var(--dark-blue);
  box-shadow: 0 30px 65px rgba(15, 23, 42, 0.18);
  min-height: 100%;
  border: 1px solid rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(6px);
}

.preview-placeholder {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  min-height: 280px;
  color: rgba(15, 23, 42, 0.7);
}

.preview-placeholder i {
  font-size: 3rem;
  color: var(--accent-color);
  opacity: 0.85;
}

.preview-article {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.preview-category {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(18, 112, 215, 0.12);
  border-radius: 999px;
  padding: 0.4rem 1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--accent-color);
}

.preview-title {
  font-size: 2rem;
  line-height: 1.3;
  font-weight: 700;
  color: var(--dark-blue);
}

.preview-meta {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  opacity: 0.7;
  font-weight: 500;
  color: rgba(15, 23, 42, 0.7);
}

.preview-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.preview-cover {
  border-radius: 18px;
  overflow: hidden;
  max-height: 240px;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.25);
}

.preview-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-content {
  display: grid;
  gap: 1rem;
  line-height: 1.7;
  color: rgba(15, 23, 42, 0.85);
}

.preview-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.preview-tag {
  background: rgba(18, 112, 215, 0.12);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--accent-color);
}

@media (max-width: 1024px) {
  .editor-grid {
    grid-template-columns: 1fr;
  }

  .editor-preview {
    min-height: 260px;
  }
}

@media (max-width: 768px) {
  .editor-form {
    padding: 2rem;
  }

  .editor-two-column {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

@media (max-width: 640px) {
  .editor-toolbar {
    flex-direction: column;
  }

  .editor-toolbar .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================
   BLOG DETAIL PAGE
   ============================================ */

.reading-progress {
  position: sticky;
  top: 70px;
  z-index: 900;
  height: 4px;
  background: rgba(30, 58, 138, 0.08);
}

.reading-progress-bar {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
  transition: width 0.15s ease-out;
}


.blog-detail-header {
  position: relative;
  padding: 3.25rem 0 2.75rem;
  background: linear-gradient(135deg, rgba(37, 78, 204, 0.92) 0%, rgba(45, 149, 239, 0.9) 50%, rgba(23, 162, 184, 0.95) 100%);
  color: rgba(255, 255, 255, 0.95);
  overflow: hidden;
}

.blog-detail-header .container {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.blog-detail-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.25) 0%, transparent 55%),
              radial-gradient(circle at bottom left, rgba(255, 255, 255, 0.16) 0%, transparent 60%);
  opacity: 0.75;
  pointer-events: none;
}

.blog-detail-header .back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  transition: var(--transition);
}

.blog-detail-header .back-link:hover {
  color: #ffffff;
}

.blog-detail-meta {
  position: relative;
  margin: 1.75rem auto 0;
  max-width: 100%;
  background: rgba(255, 255, 255, 0.96);
  padding: 2.2rem 2.4rem 2rem;
  border-radius: 24px;
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.18);
  color: var(--text-primary);
  border: 1px solid rgba(15, 23, 42, 0.04);
  backdrop-filter: blur(6px);
}

.blog-detail-meta::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(99, 102, 241, 0.1));
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.blog-detail-meta:hover::after {
  opacity: 1;
}

.blog-detail-meta h1 {
  margin-bottom: 0.75rem;
}

.meta-category {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--secondary-color);
  background: rgba(59, 130, 246, 0.12);
  padding: 0.4rem 1rem;
  border-radius: 999px;
  font-weight: 600;
}

.meta-info {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  flex-wrap: wrap;
}

.meta-info span {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.meta-info span i {
  color: var(--secondary-color);
}

.meta-info .is-hidden {
  display: none;
}


.meta-footer {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.meta-footer .meta-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.share-toolbar {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  background: rgba(59, 130, 246, 0.1);
  padding: 0.6rem 1rem;
  border-radius: 999px;
  color: var(--text-secondary);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.12);
}

.share-label {
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--primary-color);
  font-size: 0.95rem;
}

.share-buttons {
  display: inline-flex;
  gap: 0.4rem;
}

.share-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--background-white);
  color: var(--secondary-color);
  box-shadow: var(--shadow-light);
  transition: var(--transition);
  cursor: pointer;
  font-size: 0.9rem;
}

.share-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
  color: var(--primary-color);
}

.share-btn:disabled {
  pointer-events: none;
  opacity: 0.45;
  box-shadow: none;
  transform: none;
}

.share-btn.is-disabled {
  pointer-events: none;
  opacity: 0.45;
  box-shadow: none;
  transform: none;
}

.share-btn.copy-success {
  background: var(--accent-color);
  color: #ffffff;
}

.blog-detail-body {
  padding: 3.5rem 0 2.5rem;
}

.blog-detail-body .container {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.blog-content-layout {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.blog-cover {
  border-radius: var(--border-radius-large);
  overflow: hidden;
  margin-bottom: 2rem;
  box-shadow: 0 28px 40px rgba(15, 23, 42, 0.22);
  background: var(--background-white);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.blog-cover.is-empty {
  display: none;
}

.blog-cover img {
  width: 100%;
  display: block;
  height: auto;
  max-height: 520px;
  object-fit: cover;
  object-position: center;
}

.blog-article {
  position: relative;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(241, 245, 255, 0.96));
  padding: 2.9rem;
  border-radius: 26px;
  box-shadow: 0 32px 55px rgba(15, 23, 42, 0.12);
  border: 1px solid rgba(37, 99, 235, 0.08);
  max-width: 100%;
  margin: 0 auto;
  backdrop-filter: blur(4px);
}

.blog-article .lead {
  font-size: 1.15rem;
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 1.6rem;
  background: rgba(59, 130, 246, 0.08);
  border-left: 4px solid rgba(59, 130, 246, 0.45);
  padding: 1.25rem 1.5rem;
  border-radius: 18px;
}

/* Headings */
.blog-article h1,
.blog-article h2,
.blog-article h3,
.blog-article h4,
.blog-article h5,
.blog-article h6 {
  color: var(--primary-color);
  font-weight: 700;
  margin: 2.5rem 0 1.2rem 0;
  line-height: 1.4;
  position: relative;
}

.blog-article h1 {
  font-size: 2.2rem;
  border-bottom: 3px solid rgba(59, 130, 246, 0.2);
  padding-bottom: 0.8rem;
  margin-bottom: 2rem;
}

.blog-article h2 {
  font-size: 1.8rem;
  border-bottom: 2px solid rgba(59, 130, 246, 0.15);
  padding-bottom: 0.6rem;
  margin-bottom: 1.6rem;
}

.blog-article h3 {
  font-size: 1.5rem;
  position: relative;
  padding-left: 1rem;
}

.blog-article h3::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
  border-radius: 2px;
}

.blog-article h4 {
  font-size: 1.3rem;
  color: var(--secondary-color);
}

.blog-article h5 {
  font-size: 1.15rem;
  color: var(--secondary-color);
}

.blog-article h6 {
  font-size: 1.05rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Paragraphs */
.blog-article p {
  font-size: 1.05rem;
  color: var(--text-primary);
  line-height: 1.9;
  margin-bottom: 1.6rem;
}

.blog-article p:first-of-type::first-letter {
  float: left;
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1;
  margin: 0.2rem 0.55rem 0.1rem 0;
  color: var(--primary-color);
  background: rgba(37, 99, 235, 0.12);
  padding: 0.45rem 0.6rem 0.35rem;
  border-radius: 16px;
}

/* Lists */
.blog-article ul,
.blog-article ol {
  margin: 1.5rem 0;
  padding-left: 1.8rem;
}

.blog-article ul {
  list-style-type: none;
}

.blog-article ul li::before {
  content: '▸';
  color: var(--primary-color);
  font-weight: bold;
  font-size: 1.1rem;
  position: absolute;
  left: -1.2rem;
}

.blog-article ol {
  counter-reset: list-counter;
}

.blog-article ol li {
  counter-increment: list-counter;
  position: relative;
}

.blog-article ol li::before {
  content: counter(list-counter);
  color: var(--primary-color);
  font-weight: 700;
  background: rgba(59, 130, 246, 0.1);
  border-radius: 50%;
  width: 1.8rem;
  height: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  left: -2.2rem;
  top: 0.1rem;
  font-size: 0.85rem;
}

.blog-article li {
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  position: relative;
  line-height: 1.7;
}

/* Inline elements */
.blog-article strong {
  color: var(--primary-color);
  font-weight: 700;
}

.blog-article em {
  color: var(--secondary-color);
  font-style: italic;
}

.blog-article code {
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary-color);
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
  font-family: 'Fira Code', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace;
  font-size: 0.9em;
  font-weight: 500;
}

.blog-article mark {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.3), rgba(245, 158, 11, 0.2));
  color: var(--text-primary);
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
}

.blog-article del {
  color: var(--text-secondary);
  text-decoration: line-through;
}

/* Links */
.blog-article a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  transition: all 0.3s ease;
  position: relative;
}

.blog-article a:hover {
  color: var(--secondary-color);
  border-bottom-color: var(--secondary-color);
}

.blog-article a .fas {
  font-size: 0.8em;
  margin-left: 0.3rem;
  opacity: 0.7;
}

/* Blockquotes */
.blog-article blockquote {
  border-left: 4px solid var(--secondary-color);
  padding: 1.5rem 2rem;
  margin: 2rem 0;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(59, 130, 246, 0.03));
  color: var(--text-primary);
  font-style: italic;
  font-size: 1.1rem;
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  position: relative;
}

.blog-article blockquote::before {
  content: '"';
  font-size: 3rem;
  color: var(--primary-color);
  opacity: 0.3;
  position: absolute;
  top: -0.5rem;
  left: 1rem;
  font-family: Georgia, serif;
}

.blog-article blockquote p {
  margin-bottom: 0;
}

/* Code blocks */
.blog-article .code-block {
  position: relative;
  margin: 2rem 0;
  border-radius: 12px;
  overflow: hidden;
  background: #1e293b;
  border: 1px solid rgba(59, 130, 246, 0.2);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.15);
}

.blog-article .code-language {
  display: inline-block;
  background: var(--primary-color);
  color: white;
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.blog-article .code-block pre {
  margin: 0;
  padding: 1.5rem;
  background: transparent;
  overflow-x: auto;
  font-family: 'Fira Code', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace;
  font-size: 0.9rem;
  line-height: 1.6;
}

.blog-article .code-block code {
  background: transparent;
  color: #e2e8f0;
  padding: 0;
  border-radius: 0;
  font-family: inherit;
  font-size: inherit;
  font-weight: 400;
}

.blog-article .copy-code-btn {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #e2e8f0;
  padding: 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  opacity: 0.7;
}

.blog-article .copy-code-btn:hover {
  background: rgba(59, 130, 246, 0.3);
  opacity: 1;
  transform: translateY(-1px);
}

.blog-article .copy-code-btn.copied {
  background: rgba(34, 197, 94, 0.3);
  border-color: rgba(34, 197, 94, 0.4);
  color: #22c55e;
}

/* Syntax highlighting for common languages */
.blog-article .language-javascript .token.keyword,
.blog-article .language-js .token.keyword,
.blog-article .language-typescript .token.keyword,
.blog-article .language-ts .token.keyword {
  color: #c792ea;
}

.blog-article .language-javascript .token.string,
.blog-article .language-js .token.string,
.blog-article .language-typescript .token.string,
.blog-article .language-ts .token.string {
  color: #c3e88d;
}

.blog-article .language-javascript .token.function,
.blog-article .language-js .token.function,
.blog-article .language-typescript .token.function,
.blog-article .language-ts .token.function {
  color: #82aaff;
}

.blog-article .language-javascript .token.comment,
.blog-article .language-js .token.comment,
.blog-article .language-typescript .token.comment,
.blog-article .language-ts .token.comment {
  color: #546e7a;
  font-style: italic;
}

.blog-tags {
  margin: 2.75rem auto 0;
  max-width: 880px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(59, 130, 246, 0.03));
  border-radius: 20px;
  padding: 1.75rem 2rem;
  border: 1px solid rgba(37, 99, 235, 0.08);
  box-shadow: 0 20px 35px rgba(15, 23, 42, 0.08);
}

.blog-tags h3 {
  font-size: 1.05rem;
  margin-bottom: 1rem;
  color: rgba(30, 64, 175, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(30, 58, 138, 0.08);
  color: var(--primary-color);
  border-radius: 999px;
  padding: 0.45rem 0.95rem;
  font-size: 0.88rem;
  font-weight: 500;
}

.blog-related {
  background: var(--background-light);
  padding: 3rem 0 4rem;
}

.blog-related h2 {
  margin-bottom: 2rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.75rem;
}

.related-card {
  background: var(--background-white);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-light);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.related-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-medium);
}

.related-cover img,
.related-cover .cover-placeholder {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: var(--background-light);
}

.related-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.related-category {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--secondary-color);
  letter-spacing: 0.08em;
}

.related-body h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.related-body p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  flex: 1;
}

.related-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: var(--secondary-color);
}

.related-link:hover {
  color: var(--primary-color);
}

.blog-content-layout.is-portrait {
  flex-direction: row;
  align-items: flex-start;
  gap: 2rem;
}

.blog-content-layout.is-portrait .blog-cover {
  flex: 0 0 320px;
  max-width: 320px;
  margin-bottom: 0;
  box-shadow: var(--shadow-light);
}

.blog-content-layout.is-portrait .blog-cover img {
  max-height: none;
  height: auto;
  object-fit: contain;
}

.blog-content-layout.is-portrait .blog-article {
  flex: 1;
}

@media (max-width: 992px) {
  .blog-detail-meta {
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 768px) {
  .reading-progress {
    top: 62px;
  }

  .blog-detail-header .container {
    padding: 0 1rem;
  }

  .blog-detail-body .container {
    padding: 0 1rem;
  }

  .blog-detail-meta {
    margin: 1.75rem 0 0;
    padding: 2rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .blog-detail-meta h1 {
    font-size: 2rem;
    line-height: 1.2;
    word-wrap: break-word;
    hyphens: auto;
  }

  .meta-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .meta-footer .meta-actions {
    justify-content: center;
  }

  .share-toolbar {
    justify-content: center;
  }

  .blog-article {
    margin: 0;
    padding: 2.25rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  .blog-article h1 {
    font-size: 1.8rem;
  }

  .blog-article h2 {
    font-size: 1.5rem;
  }

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

  .blog-article h4 {
    font-size: 1.15rem;
  }

  .blog-article p {
    font-size: 1rem;
  }

  .blog-article .code-block {
    margin: 1.5rem -1rem;
  }

  .blog-article .code-block pre {
    padding: 1rem;
    font-size: 0.85rem;
  }

  .blog-article .copy-code-btn {
    top: 0.5rem;
    right: 0.5rem;
    padding: 0.4rem;
    font-size: 0.8rem;
  }

  .blog-article ul,
  .blog-article ol {
    padding-left: 1.5rem;
  }

  .blog-article ol li::before {
    left: -1.8rem;
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.75rem;
  }

  .blog-article blockquote {
    margin: 1.5rem -1rem;
    padding: 1.2rem 1.5rem;
    font-size: 1rem;
  }

  .blog-related {
    padding: 2.5rem 0 3rem;
  }

  .blog-content-layout.is-portrait {
    flex-direction: column;
  }

  .blog-content-layout.is-portrait .blog-cover {
    flex: none;
    max-width: none;
  }
}

@media (max-width: 520px) {
  .blog-detail-header .container {
    padding: 0 0.75rem;
  }

  .blog-detail-body .container {
    padding: 0 0.75rem;
  }

  .blog-detail-meta {
    margin: 1.75rem 0 0;
    padding: 1.75rem;
  }

  .blog-detail-meta h1 {
    font-size: 1.8rem;
    line-height: 1.15;
  }

  .blog-article {
    margin: 0;
    padding: 2rem;
  }

  .share-toolbar {
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .share-btn {
    width: 34px;
    height: 34px;
  }

  .blog-article {
    padding: 1.75rem;
  }

  .blog-article h1 {
    font-size: 1.6rem;
  }

  .blog-article h2 {
    font-size: 1.35rem;
  }

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

  .blog-article .lead {
    padding: 1rem 1.25rem;
    font-size: 1.05rem;
  }

  .blog-article p:first-of-type::first-letter {
    font-size: 2.2rem;
    margin: 0.15rem 0.4rem 0.05rem 0;
    padding: 0.3rem 0.45rem 0.25rem;
  }

  .blog-article .code-block {
    margin: 1.2rem -1.2rem;
  }

  .blog-article .code-block pre {
    font-size: 0.8rem;
    padding: 0.8rem;
  }

  .blog-article blockquote {
    margin: 1.2rem -1.2rem;
    padding: 1rem 1.2rem;
    font-size: 0.95rem;
  }

  .blog-article blockquote::before {
    font-size: 2.5rem;
    top: -0.3rem;
    left: 0.8rem;
  }

  .related-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}
