/*
Theme Name: iotsystems-blog
Theme URI: http://underscores.me/
Author: IoT Systems Team
Description: Custom WordPress theme for IoT Systems Agency.
Version: 1.1.0
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: iotsystems-blog
*/

@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap");

:root {
  --primary-color: #507192;
  --primary-dark: #3e5771;
  --secondary-color: #2c3e50;
  --text-dark: #1a242f;
  --text-light: #3e5771;
  --text-lighter: #507192;
  --text-primary: #2c3e50;
  --bg-light: #e6e6e6;
  --bg-white: #ffffff;
  --border-color: #e6e6e6;
  --shadow: 0 2px 10px rgba(44, 62, 80, 0.1);
  --shadow-lg: 0 10px 40px rgba(44, 62, 80, 0.15);
  --transition: all 0.3s ease;
}

.blog-hero {
  position: relative;
  background-size: cover;
  background-position: center;
  min-height: 500px;
  display: flex;
  align-items: center;
  color: #ffffff;
  margin-bottom: 40px;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.60); 
    z-index: 1;
}

.blog-hero-content {
    position: relative;
    z-index: 2;
    color: #ffffff;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
}

.blog-hero .back-to-blog {
  display: inline-block;
  color: #ffffff;
  margin-bottom: 20px;
  font-weight: bold;
  text-decoration: none;
}

.blog-hero .blog-article-meta {
  margin-bottom: 15px;
  font-size: 1.1rem;
  opacity: 0.9;
}

.blog-hero .blog-article-title {
    font-weight: 800;  
    text-shadow: 0 4px 12px rgba(0,0,0,0.8);
}

.blog-hero:not([style*="background-image"]) {
  background: linear-gradient(
    135deg,
    #0f2027,
    #203a43,
    #2c5364
  );
}

@media (max-width: 768px) {
  .blog-hero {
    min-height: 400px;
  }
  .blog-hero .blog-article-title {
    font-size: 2.2rem;
  }
  .blog-hero .blog-article-meta {
  margin-bottom: 15px;
  font-size: 1.1rem;
  opacity: 0;
}
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Oxygen,
    Ubuntu,
    Cantarell,
    sans-serif;
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  transition: var(--transition);
}

.navbar.scrolled {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

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

.logo a {
  display: flex;
  align-items: center;
}

.logo-img {
  height: 40px;
  width: auto;
  object-fit: contain;
  transition: var(--transition);
}

.logo a:hover .logo-img {
  opacity: 0.8;
  transform: scale(1.05);
}

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

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

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

.nav-link:hover::after,
.nav-link.active::after,
.current-menu-item > a::after {
  width: 100%;
}

.nav-link:hover,
.nav-link.active,
.current-menu-item > a {
  color: var(--primary-color);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  gap: 5px;
  padding: 0.5rem;
}

.nav-toggle span {
  width: 25px;
  height: 3px;
  background: var(--text-dark);
  transition: var(--transition);
}

.nav-toggle.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Blog Header - Matched to styles.css .blog-header */
.blog-header {
  padding: 8rem 0 4rem;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  color: white;
  text-align: center;
}

.blog-header-content h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.blog-header-content p {
  font-size: 1.25rem;
  opacity: 0.95;
}

/* Blog Content Section */
.blog-content {
  padding: 4rem 0;
  background: var(--bg-light);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 2.5rem;
}

.blog-card {
  background: var(--bg-white);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

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

.blog-image {
  position: relative;
  width: 100%;
  height: 250px;
  overflow: hidden;
}

.blog-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

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

.blog-category {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: var(--primary-color);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
  z-index: 1;
}

.blog-card-content {
  padding: 2rem;
}

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

.blog-card-content h2 {
  margin-bottom: 1rem;
  font-size: 1.5rem;
  line-height: 1.4;
}

.blog-card-content h2 a {
  color: var(--text-dark);
}

.blog-card-content h2 a:hover {
  color: var(--primary-color);
}

.blog-excerpt {
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

.blog-read-more {
  display: inline-block;
  color: var(--primary-color);
  font-weight: 600;
}

.blog-read-more:hover {
  padding-left: 0.5rem;
}

/* Single Blog Page */
.blog-article {
  padding: 8rem 0 4rem;
  background: var(--bg-white);
}

.blog-article-content {
  max-width: 900px;
  margin: 0 auto;
}

.back-to-blog {
  display: inline-block;
  margin-bottom: 2rem;
  color: var(--primary-color);
  font-weight: 600;
}

.back-to-blog:hover {
  padding-left: 0.5rem;
}

.blog-article-header {
  margin-bottom: 3rem;
}

.blog-article-meta {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  color: var(--text-light);
  font-size: 0.875rem;
}

.blog-article-title {
  font-size: 3rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 1.5rem;
  line-height: 1.2;
  text-align: left;
}

.blog-article-image {
  width: 100%;
  height: 500px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 3rem;
  box-shadow: var(--shadow-lg);
}

.blog-article-body {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--text-dark);
}

.blog-article-body h2 {
  font-size: 2rem;
  margin-top: 3rem;
  margin-bottom: 1.5rem;
}

.blog-article-body h3 {
  font-size: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.blog-article-body p {
  margin-bottom: 1.5rem;
}

.blog-article-body ul,
.blog-article-body ol {
  margin-bottom: 1.5rem;
  padding-left: 2rem;
}

.blog-article-body li {
  margin-bottom: 0.75rem;
}

/* Footer Section */
.footer {
  background: var(--secondary-color);
  color: white;
  padding: 5rem 0 2rem;
}

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

.footer-logo {
  height: 40px;
  width: auto;
  margin-bottom: 1.5rem;
}

.footer-section h4 {
  margin-bottom: 1.5rem;
  font-size: 1.125rem;
  color: white;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 0.75rem;
}

.footer-section ul li a {
  color: white;
  opacity: 0.8;
}

.footer-section ul li a:hover {
  opacity: 1;
  color: var(--primary-color);
  padding-left: 5px;
}

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

/* Pagination */
.pagination {
  margin-top: 4rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.page-numbers {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-white);
}

.page-numbers.current {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Post Navigation */
.post-navigation {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.nav-links {
  display: flex;
  justify-content: space-between;
}

.nav-previous,
.nav-next {
  flex: 1;
}

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

.nav-subtitle {
  display: block;
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.nav-title {
  font-weight: 600;
  color: var(--primary-color);
}

/* Responsive Styles */
@media (max-width: 992px) {
  .footer-content {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .nav-menu {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-white);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    transform: translateY(-150%);
    transition: var(--transition);
    z-index: -1;
  }

  .nav-menu.active {
    transform: translateY(0);
  }

  .nav-menu li {
    width: 100%;
    text-align: center;
  }

  .nav-toggle {
    display: flex;
  }

  .blog-header h1 {
    font-size: 2.5rem;
  }

  .blog-article-title {
    font-size: 2.25rem;
  }

  .blog-article-image {
    height: 300px;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }
}
/* Blog Hero Section (Single Post) */
.blog-hero {
  position: relative;
  width: 100%;
  height: 60vh;
  min-height: 400px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  padding-top: 80px; /* Account for fixed navbar */
  margin-bottom: 0;
  justify-content: center;
}

.blog-hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(44, 62, 80, 0.3) 0%,
    rgba(44, 62, 80, 0.8) 100%
  );
  z-index: 1;
}

.blog-hero .container {
  position: relative;
  z-index: 2;
  width: 100%;
}

.blog-hero-content {
  color: white;
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.blog-hero .blog-article-meta {
  justify-content: center;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 2rem;
}

.blog-hero .blog-category {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(5px);
  padding: 0.5rem 1.5rem;
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
}

.blog-hero .blog-date {
  color: rgba(255, 255, 255, 0.9);
}

.blog-hero-content .blog-article-title {
  color: white;
  font-size: 3.5rem;
  text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  margin-bottom: 0;
  line-height: 1.2;
}

/* Adjust Single Post Content */
.blog-article {
  padding-top: 4rem;
}

@media (max-width: 768px) {
  .blog-hero {
    height: 50vh;
    min-height: 350px;
  }

  .blog-hero-content .blog-article-title {
    font-size: 2.25rem;
  }
}
