/* 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%;
}

.btn {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  background: var(--primary-color);
  color: white;
  border-radius: 5px;
  font-weight: 500;
  transition: var(--transition);
  border: none;
  cursor: pointer;
}

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

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

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

/* 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 */
.hero {
  position: relative;
  overflow: hidden;
  min-height: 340px;
  display: flex;
  align-items: center;
  background: linear-gradient(120deg, #121212 0%, #0a0a14 100%);
  color: var(--light-text);
  padding: 12rem 0;
}

.hero-bg-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("../images/optimized/hero-bg.webp");
  background-size: cover;
  background-position: center;
  opacity: 0.45;
  z-index: 1;
  pointer-events: none;
}

.hero .container,
.hero .hero-content {
  position: relative;
  z-index: 3;
}

.hero::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.7) 0%,
    rgba(10, 10, 20, 0.85) 100%
  );
  z-index: 2;
  pointer-events: none;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.hero p {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  opacity: 0.9;
}

.hero .accent {
  color: var(--accent-color);
}

.hero-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.hero-subtitle {
  max-width: 600px;
}

@media (max-width: 768px) {
  .hero {
    min-height: 280px;
    padding: 3rem 0;
  }

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

  .hero p {
    font-size: 1.1rem;
  }

  .hero-actions {
    flex-direction: column;
    gap: 0.75rem;
    max-width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .hero {
    min-height: 240px;
    padding: 2.5rem 0;
  }

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

  .hero p {
    font-size: 1rem;
  }
}

/* Featured Posts Section - Optimized */

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

/* Article Card Styles - Unified for all pages */
.article-card {
  background: white;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: var(--transition);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.08);
}

.article-image {
  position: relative;
}

.article-image img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 10px 10px 0 0;
}

.article-category {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.9);
  padding: 0.4rem 0.8rem;
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 500;
}

.article-content {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.article-title {
  margin-bottom: 1rem;
  font-size: 1.2rem;
  line-height: 1.4;
}

.article-title a {
  color: var(--dark-color);
  transition: color 0.2s;
}

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

.article-excerpt {
  color: var(--gray-color);
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.article-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--gray-color);
  margin-bottom: 1rem;
}

@media screen and (max-width: 768px) {
  .articles-grid {
    grid-template-columns: 1fr;
  }
  .article-image img {
    height: 180px;
  }
}

/* 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 */

/* Featured Label */

.article-image {
  position: relative;
}

/* Index Page Specific Styles */
.hero-subtitle {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  opacity: 0.9;
}

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

.hero-actions .btn {
  white-space: nowrap;
  min-width: 130px;
  text-align: center;
  padding: 0.8rem 1.2rem;
  font-size: 0.95rem;
}

@media (max-width: 768px) {
  .hero-actions {
    justify-content: flex-start;
    gap: 0.8rem;
  }

  .hero-actions .btn {
    min-width: 120px;
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .hero-actions {
    justify-content: flex-start;
    gap: 0.6rem;
  }

  .hero-actions .btn {
    min-width: 110px;
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
  }
}

.accent {
  color: var(--accent-color);
}

.topics {
  padding: 4rem 0;
  background-color: var(--light-color);
}

.section-title {
  text-align: center;
  margin-bottom: 3rem;
  font-size: 2rem;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 30px;
  transform: translateX(-50%);
  width: 50px;
  height: 3px;
  background: var(--gradient);
  border-radius: 5px;
}

.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
}

.topic-card {
  background: white;
  border-radius: 10px;
  padding: 2rem;
  box-shadow: var(--card-shadow);
  transition: var(--transition);
}

.topic-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.08);
}

.topic-icon {
  width: 60px;
  height: 60px;
  background: var(--light-gray);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  color: var(--primary-color);
  font-size: 1.5rem;
}

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

.topic-card p {
  color: var(--gray-color);
  margin-bottom: 1.5rem;
}

.topic-link {
  color: var(--primary-color);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.topic-link:hover {
  color: var(--secondary-color);
}

.featured {
  padding: 4rem 0;
  background-color: #f8f9fa;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
}

.view-all {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  color: var(--primary-color);
}

.view-all:hover {
  color: var(--secondary-color);
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

@media (max-width: 768px) {
  .articles-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-actions {
    flex-direction: column;
  }
}

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

  .section-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

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

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

  .hero p {
    font-size: 1rem;
  }
}

@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;
  }

  .hero {
    padding: calc(var(--header-height) + 2rem) 0 2rem;
  }

  .hero-content {
    padding: 2.5rem 0;
  }

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

  .hero p {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
  }

  .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;
  }

  .hero h1 {
    font-size: 1.5rem;
    margin-bottom: 1.2rem;
  }

  .hero p {
    font-size: 0.85rem;
    margin-bottom: 1.8rem;
  }

  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }

  .hero .btn {
    display: block;
    width: 70%; /* Reduced width for more space */
    margin: 0.8rem auto; /* Increased margin for breathing room */
    text-align: center;
  }

  .hero-content {
    padding: 4rem 0; /* Increased padding for more vertical space */
  }

  .hero {
    padding: calc(var(--header-height) + 3rem) 0 3rem; /* Increased padding */
  }

  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) {
  .hero h1 {
    font-size: 2.5rem;
  }

  .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;
  }

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

  .hero p {
    font-size: 1rem;
  }

  .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 --- */
.cta {
  background: var(--darker-color);
  color: var(--light-text);
  padding: 4rem 0;
}

.cta-content {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

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

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

.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;
  }
}
