/* Global Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.invoice-guides-section {
    padding: 60px 0;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    min-height: 100vh;
}

/* Hero Section */
.guides-hero {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 50px;
    padding: 0 16px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #ede9fe, #ddd6fe);
    color: #5b34f5;
    padding: 8px 20px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 20px;
}

.guides-hero h1 {
    font-size: clamp(32px, 6vw, 52px);
    line-height: 1.2;
    font-weight: 800;
    margin-bottom: 16px;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.guides-hero h1 span {
    background: linear-gradient(135deg, #5b34f5, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.guides-hero p {
    font-size: clamp(15px, 4vw, 18px);
    color: #64748b;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

/* Featured Guide - Fixed Image Issue */
.featured-guide {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    background: white;
    border-radius: 28px;
    overflow: hidden;
    margin-bottom: 80px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.featured-image {
    position: relative;
    overflow: hidden;
    width: 100%;
    background: #e2e8f0;
}

.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

/* Fix for featured image height */
.featured-image {
    min-height: 0;
}

.featured-image img {
    height: 100%;
    min-height: 320px;
}

.featured-label {
    position: absolute;
    top: 20px;
    left: 20px;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: white;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 700;
    z-index: 1;
}

.featured-content {
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.featured-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fef3c7;
    color: #d97706;
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 20px;
    width: fit-content;
}

.featured-content h2 {
    font-size: clamp(24px, 4vw, 32px);
    line-height: 1.3;
    margin-bottom: 16px;
    color: #0f172a;
    font-weight: 700;
}

.guide-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
    color: #64748b;
    font-size: 13px;
}

.featured-content p {
    color: #475569;
    line-height: 1.7;
    margin-bottom: 28px;
    font-size: 15px;
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 20px;
}

.section-tag {
    display: inline-block;
    color: #5b34f5;
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 10px;
}

.section-header h2 {
    font-size: clamp(24px, 5vw, 32px);
    font-weight: 800;
    color: #0f172a;
}

.view-all-btn {
    color: #5b34f5;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.view-all-btn:hover {
    gap: 10px;
    color: #4c2bc4;
}

/* Blog Grid - Fixed Image Sizing */
.guides-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.guide-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.guide-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e1;
}

/* CRITICAL FIX: Proper image container sizing */
.guide-image {
    position: relative;
    overflow: hidden;
    background: #e2e8f0;
    width: 100%;
    aspect-ratio: 16 / 9;
    flex-shrink: 0;
}

.guide-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.4s ease;
}

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

.card-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: #5b34f5;
    color: white;
    padding: 5px 12px;
    border-radius: 30px;
    font-size: 11px;
    font-weight: 700;
    z-index: 1;
}

.card-badge.purple {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
}

.card-badge.green {
    background: linear-gradient(135deg, #10b981, #059669);
}

.card-badge.orange {
    background: linear-gradient(135deg, #f97316, #ea580c);
}

.card-badge.blue {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.card-badge.dark {
    background: linear-gradient(135deg, #1e293b, #0f172a);
}

.guide-content {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.guide-content h3 {
    font-size: 18px;
    line-height: 1.4;
    margin-bottom: 12px;
    color: #0f172a;
    font-weight: 700;
}

.guide-content p {
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 14px;
    flex: 1;
}

.read-more {
    color: #5b34f5;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s;
    margin-top: auto;
    width: fit-content;
}

.read-more:hover {
    gap: 10px;
    color: #4c2bc4;
}

/* Load More Button */
.load-more {
    text-align: center;
    margin: 40px 0 60px;
}

.load-more-btn {
    background: white;
    border: 2px solid #e2e8f0;
    padding: 14px 36px;
    border-radius: 100px;
    font-weight: 600;
    font-size: 15px;
    color: #5b34f5;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.load-more-btn:hover {
    background: #5b34f5;
    color: white;
    border-color: #5b34f5;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(91, 52, 245, 0.2);
}

.load-more-btn span {
    display: inline-block;
    transition: transform 0.3s;
}

.load-more-btn:hover span {
    transform: translateY(3px);
}

/* Newsletter Section */
.newsletter-section {
    background: linear-gradient(135deg, #5b34f5, #8b5cf6);
    border-radius: 28px;
    padding: 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.newsletter-content {
    flex: 1;
    color: white;
    min-width: 200px;
}

.newsletter-tag {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 15px;
}

.newsletter-content h2 {
    font-size: clamp(22px, 4vw, 28px);
    margin-bottom: 12px;
    font-weight: 700;
}

.newsletter-content p {
    opacity: 0.9;
    line-height: 1.6;
    font-size: 14px;
}

.newsletter-form {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    min-width: 280px;
}

.newsletter-form input {
    padding: 14px 20px;
    border: none;
    border-radius: 100px;
    min-width: 240px;
    flex: 1;
    font-size: 14px;
    outline: none;
    transition: all 0.3s;
}

.newsletter-form input:focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.3);
}

.newsletter-form button {
    background: #1e293b;
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 100px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.newsletter-form button:hover {
    background: #0f172a;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #5b34f5, #7c3aed);
    color: white;
    padding: 12px 28px;
    border-radius: 100px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    width: fit-content;
    font-size: 14px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(91, 52, 245, 0.3);
    gap: 12px;
}

/* Responsive Design - Mobile First */

/* Tablet */
@media (max-width: 968px) {
    .container {
        padding: 0 20px;
    }

    .featured-content {
        padding: 30px;
    }

    .newsletter-section {
        padding: 40px 30px;
    }
}

/* Mobile Landscape */
@media (max-width: 768px) {
    .invoice-guides-section {
        padding: 40px 0;
    }

    .container {
        padding: 0 16px;
    }

    .guides-hero {
        margin: 0 auto 40px;
    }

    /* FIX: Featured guide becomes vertical on mobile */
    .featured-guide {
        grid-template-columns: 1fr;
        gap: 0;
        margin-bottom: 50px;
        border-radius: 20px;
    }

    .featured-image {
        width: 100%;
    }

    .featured-image img {
        min-height: 250px;
        width: 100%;
    }

    .featured-content {
        padding: 24px;
    }

    .featured-tag {
        font-size: 11px;
        margin-bottom: 16px;
    }

    .guide-meta {
        gap: 12px;
        font-size: 12px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 30px;
    }

    /* FIX: Grid becomes single column on mobile */
    .guides-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-bottom: 40px;
    }

    /* FIX: Ensure images don't overflow */
    .guide-image {
        aspect-ratio: 16 / 9;
    }

    .guide-image img {
        width: 100%;
        height: 100%;
    }

    .guide-content {
        padding: 20px;
    }

    .guide-content h3 {
        font-size: 17px;
    }

    .load-more {
        margin: 30px 0 40px;
    }

    .load-more-btn {
        padding: 12px 28px;
        font-size: 14px;
    }
}

/* Mobile Portrait */
@media (max-width: 640px) {
    .container {
        padding: 0 16px;
    }

    .guides-hero h1 {
        font-size: 28px;
    }

    .guides-hero p {
        font-size: 14px;
    }

    .featured-image img {
        min-height: 200px;
    }

    .featured-content {
        padding: 20px;
    }

    .featured-content h2 {
        font-size: 22px;
    }

    .featured-content p {
        font-size: 14px;
        margin-bottom: 20px;
    }

    .guide-meta {
        gap: 10px;
        font-size: 11px;
    }

    .section-header h2 {
        font-size: 22px;
    }

    /* Ensure single column with proper image sizing */
    .guides-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .guide-image {
        aspect-ratio: 16 / 9;
    }

    .guide-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .btn-primary {
        padding: 10px 24px;
        font-size: 13px;
        width: 100%;
        justify-content: center;
    }

    /* FIX: Newsletter becomes vertical */
    .newsletter-section {
        padding: 30px 20px;
        border-radius: 20px;
        flex-direction: column;
        text-align: center;
    }

    .newsletter-content {
        text-align: center;
    }

    .newsletter-form {
        width: 100%;
        flex-direction: column;
    }

    .newsletter-form input,
    .newsletter-form button {
        width: 100%;
        min-width: auto;
    }

    .newsletter-form button {
        padding: 12px 24px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .container {
        padding: 0 14px;
    }

    .invoice-guides-section {
        padding: 30px 0;
    }

    .guides-hero {
        margin: 0 auto 30px;
    }

    .guides-hero h1 {
        font-size: 26px;
    }

    .hero-badge {
        font-size: 11px;
        padding: 5px 14px;
    }

    .featured-content {
        padding: 16px;
    }

    .featured-content h2 {
        font-size: 20px;
    }

    .featured-image img {
        min-height: 180px;
    }

    .guide-content {
        padding: 16px;
    }

    .guide-content h3 {
        font-size: 16px;
    }

    .guide-content p {
        font-size: 13px;
    }

    .card-badge {
        font-size: 10px;
        padding: 4px 10px;
    }

    .read-more {
        font-size: 13px;
    }

    .newsletter-content h2 {
        font-size: 20px;
    }

    .newsletter-content p {
        font-size: 13px;
    }
}

/* Fix for landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .featured-guide {
        grid-template-columns: 1fr;
    }

    .featured-image img {
        min-height: 220px;
    }

    .guides-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {

    .guide-card:hover,
    .featured-guide:hover {
        transform: none;
    }

    .btn-primary:hover,
    .load-more-btn:hover,
    .newsletter-form button:hover {
        transform: none;
    }

    .read-more:active {
        gap: 10px;
    }

    .guide-card:active {
        transform: scale(0.98);
    }
}

/* Loading Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.guide-card {
    animation: fadeInUp 0.5s ease backwards;
}

.guide-card:nth-child(1) {
    animation-delay: 0.05s;
}

.guide-card:nth-child(2) {
    animation-delay: 0.1s;
}

.guide-card:nth-child(3) {
    animation-delay: 0.15s;
}

.guide-card:nth-child(4) {
    animation-delay: 0.2s;
}

.guide-card:nth-child(5) {
    animation-delay: 0.25s;
}

.guide-card:nth-child(6) {
    animation-delay: 0.3s;
}