/* =========================================
   BLOG PAGE SPECIFIC STYLES
   (Complements the main style.css)
========================================= */

/* Blog Hero Section */
.blog-hero {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 4rem 2rem;
    text-align: center;
    color: white;
    position: relative;
    overflow: hidden;
    margin-bottom: 2rem;
}

.blog-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" opacity="0.1"><path d="M0 0 L100 100 M100 0 L0 100" stroke="white" stroke-width="1"/></svg>');
    background-size: 30px 30px;
}

.blog-hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

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

.blog-hero p {
    font-size: 1.2rem;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto;
}

/* Filter Bar - Fixed layout */
.filter-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 2rem;
    max-width: var(--max);
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.search-input-wrapper {
    position: relative;
    flex: 2;
    min-width: 280px;
    max-width: 400px;
}

.filter-wrapper {
    position: relative;
    flex: 1;
    min-width: 180px;
    max-width: 220px;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    z-index: 1;
    font-size: 1rem;
    transition: color 0.3s ease;
    pointer-events: none;
}

.filter-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    z-index: 1;
    font-size: 1rem;
    pointer-events: none;
}

.filter-bar input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    font-size: 1rem;
    border-radius: 50px;
    border: 2px solid var(--border-color);
    background: var(--bg-light);
    color: var(--text-dark);
    outline: none;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    box-sizing: border-box;
}

.filter-bar input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.filter-bar input:focus ~ .search-icon {
    color: var(--primary-color);
}

.filter-bar select {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    font-size: 1rem;
    border-radius: 50px;
    border: 2px solid var(--border-color);
    background: var(--bg-light);
    color: var(--text-dark);
    outline: none;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 16px;
    box-sizing: border-box;
}

.filter-bar select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.filter-bar select:focus ~ .filter-icon {
    color: var(--primary-color);
}

/* Blog Container */
.blog-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    padding: 2rem;
    max-width: var(--max);
    margin: 0 auto;
}

/* Blog Card */
.blog-card {
    background: var(--bg-light);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--border-color);
}

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

.blog-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

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

.blog-content h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-dark);
    line-height: 1.4;
}

.blog-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-light);
}

.blog-meta .date {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.blog-meta .date i {
    color: var(--primary-color);
    font-size: 0.8rem;
}

.blog-meta .category {
    background: var(--bg-gray);
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--primary-color);
}

.blog-content p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-light);
    margin: 0 0 1rem 0;
    flex: 1;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.tags span {
    background: var(--bg-gray);
    color: var(--text-light);
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tags span:hover {
    background: var(--primary-color);
    color: white;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    margin-top: 0.5rem;
    transition: all 0.3s ease;
    align-self: flex-start;
}

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

.read-more:hover {
    color: var(--secondary-color);
    gap: 0.75rem;
}

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

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 3rem 2rem;
    max-width: var(--max);
    margin: 0 auto;
    flex-wrap: wrap;
}

.pagination a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.pagination a:hover {
    background: var(--bg-gray);
    color: var(--primary-color);
}

.pagination a.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination a.prev-next {
    width: auto;
    padding: 0 1rem;
    border-radius: 50px;
    gap: 0.5rem;
}

.pagination a.prev-next i {
    font-size: 0.9rem;
}

.pagination a.disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

/* No Results State */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    background: var(--bg-light);
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
}

.no-results i {
    font-size: 4rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-results h3 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.no-results p {
    color: var(--text-light);
}

/* Loading State */
.loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem;
}

.loading i {
    font-size: 2rem;
    color: var(--primary-color);
    animation: spin 1s linear infinite;
}

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

/* Active navigation link */
.nav-links a.active {
    color: var(--primary-color);
    font-weight: 600;
}

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

/* Dark theme adjustments */
body.dark-theme .blog-card {
    border-color: var(--border-color);
}

body.dark-theme .filter-bar input,
body.dark-theme .filter-bar select {
    background: var(--bg-light);
    border-color: var(--border-color);
    color: var(--text-dark);
}

body.dark-theme .no-results {
    background: var(--bg-light);
}

/* Responsive Design */
@media (max-width: 768px) {
    .blog-hero {
        padding: 3rem 1.5rem;
        margin-top: 0;
    }

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

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

    .filter-bar {
        padding: 1.5rem 1rem;
        gap: 1rem;
        flex-direction: column;
        align-items: stretch;
    }

    .search-input-wrapper,
    .filter-wrapper {
        min-width: 100%;
        max-width: 100%;
    }

    .blog-container {
        grid-template-columns: 1fr;
        padding: 1rem;
        gap: 1.5rem;
    }

    .blog-content {
        padding: 1.25rem;
    }

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

    .pagination {
        padding: 2rem 1rem;
        gap: 0.3rem;
    }
    
    .pagination a {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
    
    .pagination a.prev-next {
        width: auto;
        padding: 0 0.75rem;
    }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .blog-container {
        grid-template-columns: repeat(2, 1fr);
        padding: 1.5rem;
    }
    
    .filter-bar {
        padding: 2rem 1.5rem;
    }
    
    .search-input-wrapper {
        min-width: 240px;
    }
    
    .filter-wrapper {
        min-width: 160px;
    }
}

/* Small Desktop */
@media (min-width: 1025px) and (max-width: 1200px) {
    .blog-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
        padding: 2rem;
    }
}

/* ========== NEWSLETTER SECTION ========== */
.newsletter-wrapper {
  max-width: var(--max);
  margin: 2rem auto 1rem;
  padding: 0 2rem;
  width: 100%;
  box-sizing: border-box;
}

.newsletter-container {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(124, 58, 237, 0.05) 100%);
  border-radius: 16px;
  padding: 2.5rem 2rem;
  border: 1px solid var(--blog-container-border);
  transition: all 0.4s ease;
  box-shadow: var(--shadow-sm);
}

body.dark-theme .newsletter-container {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
  border-color: var(--blog-container-border);
}

.newsletter-content {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.newsletter-icon {
  font-size: 2.5rem;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 1rem;
}

.newsletter-title {
  font-size: 1.8rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  color: var(--blog-heading);
  font-family: 'Georgia', 'Times New Roman', Times, serif;
  transition: color 0.4s ease;
  background: none;
  -webkit-text-fill-color: initial;
}

.newsletter-text {
  font-size: 1rem;
  color: var(--text-light);
  margin-bottom: 2rem;
  line-height: 1.6;
}

.newsletter-form {
  width: 100%;
  box-sizing: border-box;
}

.form-group {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
}

.newsletter-input {
  flex: 1;
  min-width: 250px;
  padding: 1rem 1.2rem;
  border: 2px solid var(--blog-container-border);
  border-radius: 50px;
  font-size: 1rem;
  background: var(--bg-light);
  color: var(--text-dark);
  transition: all 0.3s ease;
  outline: none;
  box-sizing: border-box;
}

.newsletter-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

body.dark-theme .newsletter-input:focus {
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.newsletter-button {
  padding: 1rem 2rem;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  box-sizing: border-box;
}

.newsletter-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.3);
}

.newsletter-button i {
  font-size: 0.9rem;
  transition: transform 0.3s ease;
}

.newsletter-button:hover i {
  transform: translateX(5px);
}

.newsletter-footer {
  font-size: 0.85rem;
  color: var(--text-light);
  margin: 0.5rem 0 0;
  width: 100%;
  box-sizing: border-box;
}

.newsletter-link {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
  margin-left: 0.5rem;
}

.newsletter-link:hover {
  color: var(--secondary-color);
  text-decoration: underline;
}

/* Mobile responsive - FIXED VERSION */
@media (max-width: 768px) {
  .newsletter-wrapper {
    padding: 0 1rem;
    width: 100%;
    box-sizing: border-box;
  }
  
  .newsletter-container {
    padding: 2rem 1.5rem;
    width: 100%;
    box-sizing: border-box;
  }
  
  .newsletter-content {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0;
  }
  
  .newsletter-title {
    font-size: 1.5rem;
  }
  
  .form-group {
    flex-direction: column;
    gap: 0.8rem;
    width: 100%;
    box-sizing: border-box;
  }
  
  .newsletter-input {
    width: 100%;
    min-width: 0; /* Remove min-width constraint */
    max-width: 100%;
    padding: 1rem 1.2rem;
    margin: 0;
    box-sizing: border-box; /* Critical: includes padding in width calculation */
  }
  
  .newsletter-button {
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
  }
  
  .newsletter-footer {
    width: 100%;
    box-sizing: border-box;
    padding: 0 0.5rem;
  }
}

@media (max-width: 480px) {
  .newsletter-wrapper {
    padding: 0 0.8rem;
  }
  
  .newsletter-container {
    padding: 1.5rem 1rem;
  }
  
  .newsletter-title {
    font-size: 1.3rem;
  }
  
  .newsletter-text {
    font-size: 0.95rem;
  }
  
  .newsletter-input {
    padding: 0.9rem 1rem; /* Slightly smaller padding on very small screens */
  }
  
  .newsletter-button {
    padding: 0.9rem 1.5rem;
  }
  
  .newsletter-footer {
    padding: 0 0.3rem;
    font-size: 0.8rem;
  }
}

/* Blog archive theme refresh; retains existing filter, pagination and card hooks. */
.blog-hero{background:radial-gradient(ellipse at top right,#245a64,transparent 65%),#122b3b;color:#f4f8fc;padding:65px 28px;}
.blog-hero::before{display:none;}
.blog-hero h1{font-weight:500;font-size:clamp(2.5rem,5vw,4rem);letter-spacing:-.055em;line-height:1.1;}
.blog-hero p{color:#bbccda;line-height:1.85;font-size:1rem;}
.filter-bar{background:var(--bg-light);border:1px solid var(--bg-gray);border-radius:17px;box-shadow:none;}
.filter-bar input,.filter-bar select{border-radius:10px;border-color:var(--bg-gray);}
.filter-bar input:focus,.filter-bar select:focus{border-color:#237b72;box-shadow:0 0 0 3px #237b7218;}
.blog-card{border-radius:19px;border:1px solid var(--bg-gray);box-shadow:0 9px 28px #183c3210;}
.blog-card img{width:100%;height:auto;max-height:none;aspect-ratio:auto;object-fit:contain;display:block;}
.blog-card:hover img{transform:none;}
.blog-content h3{letter-spacing:-.035em;font-weight:600;line-height:1.4;}
.blog-meta .category,.tags span{background:#e6f1ec;color:#237b72;border-radius:100px;}
.read-more,.blog-meta .date i{color:#237b72;}
.pagination a.active,.pagination a:hover{background:#183e38;border-color:#183e38;color:white;}
body.dark-theme .blog-meta .category,body.dark-theme .tags span{background:#183b3b;color:#79decf;}
body.dark-theme .read-more,body.dark-theme .blog-meta .date i{color:#79decf;}
.newsletter-container{background:#e0eee8;border-color:#cfe2da;box-shadow:none;}
.newsletter-title,.newsletter-icon{color:#183e38;background:none;-webkit-text-fill-color:currentColor;}
.newsletter-text,.newsletter-footer{color:#476b60;}
.newsletter-button{background:#183e38;}.newsletter-button:hover{background:#28665b;}.newsletter-link{color:#235e50;}
body.dark-theme .newsletter-container{background:#183b3b;border-color:#2a5550;}
body.dark-theme .newsletter-title,body.dark-theme .newsletter-icon{color:#d2ede6;}
body.dark-theme .newsletter-text,body.dark-theme .newsletter-footer,body.dark-theme .newsletter-link{color:#a8d3c7;}
