/* Base Styles - Optimized for performance */
:root {
  --primary-color: #3a86ff;
  --secondary-color: #8338ec;
  --accent-color: #ff006e;
  --dark-color: #0d1117;
  --darker-color: #090b0f;
  --light-color: #f8f9fa;
  --text-color: #333;
  --light-text: #f8f9fa;
  --gray-color: #495057;
  --light-gray: #e9ecef;
  --container-width: 1200px;
  --header-height: 70px;
  --transition: all 0.2s ease;
  --card-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  --gradient: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px; /* Base font size for readability */
}

body {
  font-family: "Inter", sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--light-color);
  overflow-x: hidden;
  text-rendering: optimizeSpeed;
  min-width: 320px; /* Prevent content from being too narrow */
}

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

ul {
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
  height: auto;
  /* Ensure proper aspect ratio */
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 2rem;
  width: 100%;
}

/* Header Styles - Simplified */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background-color: var(--light-color);
  box-shadow: var(--card-shadow);
  z-index: 1000;
  transition: var(--transition);
}

header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.logo a {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--dark-color);
  position: relative;
}

.logo a::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 30%;
  height: 3px;
  background: var(--gradient);
  border-radius: 5px;
}

nav {
  display: flex;
  align-items: center;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-weight: 500;
  position: relative;
  padding: 0.5rem 0;
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient);
  transition: var(--transition);
}

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

.burger {
  display: none;
  cursor: pointer;
}

.burger div {
  width: 25px;
  height: 3px;
  background-color: var(--dark-color);
  margin: 5px;
  transition: var(--transition);
}

/* Hero Section with Overlay Image */

/* Featured Posts Section - Optimized */

/* Removed legacy .post-card styles for consistency */

/* Article Card Styles - Unified for all pages */

/* Features Section */

/* Newsletter Section - Simplified */
.newsletter {
  background: var(--darker-color);
  color: var(--light-text);
  padding: 4rem 0;
}

.newsletter h2 {
  margin-bottom: 1rem;
  font-size: 2rem;
}

.newsletter p {
  margin-bottom: 2rem;
  opacity: 0.9;
}

/* Footer Styles - Simplified */
footer {
  background: var(--dark-color);
  color: var(--light-text);
  padding: 4rem 0 2rem;
}



.footer-logo {
  flex: 1 1 300px;
  margin-bottom: 2rem;
}

.footer-logo a {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: inline-block;
}

.footer-logo p {
  opacity: 0.8;
}

.footer-links {
  flex: 2 1 600px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2rem;
}

.links-group h3 {
  margin-bottom: 1.5rem;
  font-size: 1.2rem;
  position: relative;
  display: inline-block;
}

.links-group h3::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 30px;
  height: 2px;
  background: var(--primary-color);
}

.links-group ul li {
  margin-bottom: 0.8rem;
}

.links-group ul li a:hover {
  color: var(--primary-color);
}
.social-links {
  display: flex;
  justify-content: center;
  flex-direction: column;
  align-items: center;
}

.social-links li a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

social-links li a i {
  font-size: 1.2rem;
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0.7;
  font-size: 0.9rem;
}

/* Blog page specific styles - Enhanced */

/* Improved category filter styling */

/* Enhanced pagination styling */

/* Projects section */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
}

@media (max-width: 600px) {
  .about-header h1 {
    font-size: 2rem;
    margin-bottom: 1.2rem;
  }
  .about-section h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
  }
}

/* Featured Label */

/* Index Page Specific Styles */

/* Responsive Design Enhancements */
@media screen and (max-width: 1024px) {
  :root {
    --container-width: 960px;
  }
}

@media screen and (max-width: 768px) {
  :root {
    --container-width: 720px;
    --header-height: 60px;
  }

  .burger {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background: var(--light-color);
    flex-direction: column;
    padding: 1rem 0;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
  }

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

  .footer-content {
    flex-direction: column;
    gap: 2rem;
    text-align: center;
  }

  .footer-links {
    flex-direction: column;
    gap: 2rem;
  }
}

@media screen and (max-width: 480px) {
  :root {
    --container-width: 100%;
  }

  .container {
    padding: 0 1rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.4rem;
  }

  h3 {
    font-size: 1.1rem;
  }

  p,
  li,
  a {
    font-size: 0.9rem;
  }

  .logo a {
    font-size: 1.3rem;
  }

  /* Ensure no zooming is required */
  html {
    font-size: 16px; /* Base font size for readability */
  }

  body {
    min-width: 320px; /* Prevent content from being too narrow */
    overflow-x: hidden; /* Hide horizontal scrollbar */
  }

  img {
    max-width: 100%; /* Ensure images don't overflow */
  }
}

@media screen and (max-width: 968px) {

  .footer-content {
    flex-direction: column;
    gap: 2rem;
  }

  .footer-links {
    flex-direction: column;
    gap: 2rem;
  }
}

@media screen and (max-width: 768px) {
  .nav-links {
    position: absolute;
    right: 0;
    top: var(--header-height);
    background: var(--light-color);
    height: calc(100vh - var(--header-height));
    width: 50%;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 3rem;
    transform: translateX(100%);
    transition: var(--transition);
    box-shadow: -5px 0 10px rgba(0, 0, 0, 0.05);
  }

  .nav-links.active {
    transform: translateX(0);
  }

  .burger {
    display: block;
  }

  .newsletter-form {
    flex-direction: column;
  }

  .newsletter-form input {
    border-radius: 5px;
    margin-bottom: 1rem;
  }

  .newsletter-form button {
    border-radius: 5px;
  }
}

@media screen and (max-width: 576px) {
  .container {
    padding: 0 1.5rem;
  }

  .nav-links {
    width: 70%;
  }
}

/* Blog Post Improvements */

/* Meta Row: Better spacing and alignment */

/* Softer/no box-shadow for post-main and featured image */

/* Larger font size for post content and meta on mobile */

/* Slightly larger font for post content on all screens */

/* Margin below meta row for breathing room */

/* Padding for better readability */

/* Remove box-shadow from sidebar on mobile */

/* --- END: CTA (Newsletter Subscribe) Styles --- */

/* --- BEGIN: CTA (Newsletter Subscribe) Styles - Sourced from blog.html --- */

.newsletter-form {
  display: flex;
  max-width: 500px;
  margin: 0 auto;
}

.newsletter-form input {
  flex: 1;
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 5px 0 0 5px;
  font-size: 1rem;
}

.newsletter-form button {
  border-radius: 0 5px 5px 0;
}

@media screen and (max-width: 768px) {
  .newsletter-form {
    flex-direction: column;
  }
  .newsletter-form input {
    border-radius: 5px;
    margin-bottom: 1rem;
  }
  .newsletter-form button {
    border-radius: 5px;
  }
}
