/* Universal Section Styling */
.section-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    margin-top: 0;
    color: #333;
    text-align: center;
    line-height: 1.2;
}

.section-subtitle {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 3rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    line-height: 1.4;
}

/* Section container styling for consistency */
.seo-section,
.recommended,
.faq-section,
.categories-section,
.articles-section {
    padding: 5rem 20px;
    text-align: center;
}

/* Alternating section backgrounds for better visual flow */
.bg-filled {
    background: linear-gradient(to right, #ff6600, #ff9900);
    color: white;
}

.seo-section .section-title,
.seo-section .section-subtitle {
    color: white;
}

.seo-section p {
    font-size: 1.05rem;
    line-height: 1.8;
}
.seo-section .features__card p {
    color: #ff6600;
    font-weight: 500;
}

.affiliate-cta {
    text-align: center;
    margin-top: 2rem;
}

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

.bg-white {
    background-color: white;
}

/* Categories section now uses universal .section-title and .section-subtitle classes */

.categories-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.category-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    height: 100%;
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.category-link {
    display: block;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

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

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

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

.category-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 102, 0, 0.8), rgba(255, 153, 0, 0.8));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.category-card:hover .category-overlay {
    opacity: 1;
}

.category-icon {
    font-size: 3rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.category-content {
    padding: 1.5rem;
    text-align: right;
    direction: rtl;
}

.category-content h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 0.75rem;
    color: #333;
    line-height: 1.3;
}

.category-content p {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.5;
    margin: 0 0 1rem;
    height: 3em;
    overflow: hidden;
}

.category-cta {
    display: inline-flex;
    align-items: center;
    color: #ff6600;
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.category-card:hover .category-cta {
    color: #e55a00;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .categories-section {
        padding: 0 15px;
        margin: 2rem auto;
    }

    .categories-section h2 {
        font-size: 2rem;
    }

    .categories-subtitle {
        font-size: 1.1rem;
        margin-bottom: 2rem;
    }

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

    .category-image {
        height: 150px;
    }

    .category-content {
        padding: 1rem;
    }

    .category-content h3 {
        font-size: 1.1rem;
    }

    .category-content p {
        font-size: 0.9rem;
        height: auto;
        min-height: 2.5em;
    }

    .category-icon {
        font-size: 2.5rem;
    }
}

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

    .categories-section h2 {
        font-size: 1.8rem;
    }

    .category-image {
        height: 180px;
    }

    .category-content p {
        height: auto;
    }
}

/* CTA SECTION */
.section-cta {
    text-align: center;
    padding: 5rem 0;
    background: linear-gradient(to right, #ff6600, #ff9900);
}

.section-cta h2 {
    color: white;
    margin-bottom: 1.5rem;
    font-size: 2rem;
    margin-left: auto;
    margin-right: auto;
    max-width: 600px;
}

.section-cta .cta-button {
    background: white;
    color: #ff6600;
}

.section-cta h2 {
    color: white;
    margin-bottom: 2.5rem;
    font-size: 2rem;
    margin-left: auto;
    margin-right: auto;
    max-width: 600px;
}

/* Light CTA for orange backgrounds */
/* All light buttons on orange sections inherit from .cta-button-light */

/* Universal Section Responsive Styles */
@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
    }

    .section-subtitle {
        font-size: 1.1rem;
        margin-bottom: 2rem;
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 1.8rem;
    }

    .section-subtitle {
        font-size: 1rem;
        padding: 0 0.5rem;
    }

    .cta-button,
    .cta-button-light {
        font-size: 18px;
        padding: 14px 20px;
    }

    .seo-section,
    .recommended,
    .faq-section,
    .categories-section,
    .articles-section {
        padding: 3rem 15px;
    }
}

/* Categories Section Responsive */
@media (max-width: 768px) {
    .categories-cta {
        margin-top: 2rem;
        padding: 1.5rem 0;
    }

    .categories-cta p {
        font-size: 1.1rem;
        margin-bottom: 1rem;
        padding: 0 1rem;
    }
}

/* Articles Section Grid - Override main.css styles */
.articles-section {
    /* Override the main.css blog-section grid layout */
    display: block !important;
    grid-template-columns: unset !important;
    padding: 5rem 20px;
    text-align: center;
}

.posts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.posts .blog-post {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    padding: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    text-align: start;
}

/* Add image container for better overlay control */
.posts .blog-post .blog-image-container {
    position: relative;
    overflow: hidden;
}

.posts .blog-post .blog-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(0, 0, 0, 0.4) 0%, rgba(0, 0, 0, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.posts .blog-post:hover .blog-image-overlay {
    opacity: 1;
}

.posts .blog-post h3 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 0.75rem;
    color: #333;
    line-height: 1.3;
}

.posts .blog-post:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.posts .blog-post img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
    margin-bottom: 0;
    border-radius: 0;
    display: block;
}

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

.posts .blog-post h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 1.5rem 1.5rem 0.75rem;
    color: #333;
    line-height: 1.4;
    flex-grow: 1;
}

.posts .blog-post h3 a {
    color: inherit;
    text-decoration: none;
}

.posts .blog-post h3 a:hover {
    color: #ff6600;
}

.posts .blog-post .blog-post-cta {
    padding: 0 1.5rem 1.5rem;
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.posts .blog-post .read-more {
    display: inline-flex;
    align-items: center;
    color: #ff6600;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.2s ease;
    padding: 0.5rem 1rem;
    border: 1px solid #ff6600;
    border-radius: 20px;
    background: rgba(255, 102, 0, 0.05);
}

.posts .blog-post:hover .read-more {
    color: white;
    background: #ff6600;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.3);
}

.posts .blog-post-date {
    font-size: 0.85rem;
    color: #888;
    font-weight: 400;
    white-space: nowrap;
}

/* Articles Grid Responsive */
@media (max-width: 1024px) {
    .posts {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
}

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

    .posts .blog-post img {
        height: 150px;
    }

    .posts .blog-post h3 {
        font-size: 1.1rem;
        margin: 1rem 1rem 0.5rem;
    }

    .posts .blog-post .blog-post-cta {
        padding: 0 1rem 1rem;
    }
}

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

    .posts .blog-post img {
        height: 180px;
    }

    .posts .blog-post .blog-post-cta {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }

    .posts .blog-post .read-more {
        align-self: center;
    }
}
