/* ========================================
   GLOBAL FONTS & RESETS (Scoped to Blog)
======================================== */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@200..800&display=swap');

.mobicip-blog-page,
.mobicip-blog-page *,
.mobicip-blog-page ::after,
.mobicip-blog-page ::before {
    box-sizing: border-box;
    /* ✅ Removed position: relative */
}

/* ========================================
   BLOG WRAPPER
======================================== */

.mobicip-blog-page {
    width: 100%;
    max-width: 1084px;
    margin: -48px auto 80px;
    padding: 40px 20px;
    font-family: 'Manrope', sans-serif;
    text-align: left;
}

.mobicip-blog-page h1 {
    font-size: 42px;
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 10px;
    color: #111827;
}

.mobicip-blog-subtitle {
    font-size: 28px;
    font-weight: 600;
    line-height: 44px;
    color: #454A55;
    margin: 0 0 40px;
}

/* ========================================
   HERO SECTION
======================================== */

.mobicip-blog-hero {
    display: grid;
    grid-template-columns: 3fr 2fr;
    /* ✅ Simplified ratio */
    gap: 40px;
    align-items: center;
    margin-bottom: 70px;
}

.hero-image {
    overflow: hidden;
    width: 747px;
}

.hero-image img,
img.attachment-large.size-large.wp-post-image {
    width: 747px;
    height: 393px;
    object-fit: cover;
    display: block;
}

.hero-content h2 {
    font-size: 36px;
    line-height: 1.25;
    font-weight: 700;
    margin: 0 0 15px;
}

.hero-content h2 a {
    width: 340px;
    color: #111827;
    display: block;
}

.hero-content a {
    color: #111827 !important;
    text-decoration: none;
    cursor: pointer;
}

.mobicip-hero-socials a {
    width: auto;
}

.hero-content a:hover {
    color: #2563eb;
}

.hero-content p.hero-date {
    font-size: 14px;
    color: #9ca3af;
    margin: 0 0 20px 0;
}

/* Hero Social Icons */
.mobicip-hero-socials {
    display: flex;
    gap: 12px;
    align-items: center;
}

.social-icon svg {
    border-radius: 50%;
    transition: opacity 0.2s ease;
}

.social-icon:hover svg {
    opacity: 0.8;
}

/* ========================================
   POPULAR POSTS TITLE
======================================== */

.popular-posts-heading {
    font-size: 40px;
    font-weight: 800;
    margin: 0 0 30px;
    color: #111827;
}

/* ========================================
   POSTS GRID
======================================== */

.mobicip-post-grid {
    display: grid;
    width: 100%;
    list-style-type: none;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px 24px;
    margin-bottom: 70px;
}

.mobicip-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    border-bottom: 1px solid #E5E7EB;
    padding-bottom: 24px;
}

.mobicip-post-grid li:nth-child(-n+3) .mobicip-card {
    padding-bottom: 12px;
}

.mobicip-post-grid li:nth-child(n+4) .mobicip-card {
    padding-top: 4px;
}

.mobicip-card a {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.mobicip-card img,
img.attachment-medium_large.size-medium_large.wp-post-image {
    width: 374px;
    height: 180.06px;
    object-fit: cover;
    display: block;
}

.mobicip-card:hover img {
    transform: scale(1.02);
}

.mobicip-card h3 {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    color: #111827;
    margin: 16px 0 10px;
}

.mobicip-post-excerpt {
    font-size: 14px;
    line-height: 1.6;
    color: #383E48;
    margin: 0 0 8px 0;
    flex-grow: 1;
}

.mobicip-post-date {
    font-size: 13px;
    color: #383E48;
    margin-top: 8px;
}

/* ========================================
   BANNER CARD
======================================== */

.banner-card {
    display: flex;
    align-items: stretch;
}

.banner-card a {
    width: 100%;
}

.banner-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    display: block;
}

/* ========================================
   PAGINATION (Borderless Design)
======================================== */

.mobicip-pagination {
    margin-top: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
}

.mobicip-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #4b5563;
    font-size: 16px;
    font-weight: 500;
    background: transparent;
    border: none;
    transition: color 0.2s ease;
    cursor: pointer;
    padding: 4px 8px;
}

.mobicip-pagination .page-numbers:hover {
    color: #2563eb;
}

.mobicip-pagination .current {
    font-weight: 600;
    color: #2563eb;
}

/* Arrow specific styling */
.mobicip-pagination .prev svg,
.mobicip-pagination .next svg {
    fill: #2563eb;
    /* ✅ Ensures SVG arrows are blue */
}

.mobicip-pagination .page-numbers svg {
    display: block;
}

/* ========================================
   TABLET
======================================== */

@media (max-width: 1024px) {
    .mobicip-blog-page {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 20px 16px !important;
        overflow: hidden;
    }

    .mobicip-blog-hero {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 40px;
        width: 100%;
        overflow: hidden;
    }

    .hero-image {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
        margin: 0;
        padding: 0;
    }

    .hero-image img,
    img.attachment-large.size-large.wp-post-image {
        width: 100%;
        max-width: 100%;
        height: 443.25px;
        object-fit: cover;
        display: block;
        margin: 0;
    }

    .hero-content h2 {
        font-size: 30px;
    }

    .mobicip-post-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
        width: 100%;
    }

    .mobicip-card img {
        width: 100%;
        height: 194.06px;
        object-fit: cover;
        display: block;
    }

    .mobicip-card {
        width: 100%;
        display: flex;
        flex-direction: column;
    }
}

/* ========================================
   MOBILE
======================================== */

@media (max-width: 768px) {
    .mobicip-blog-page {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
    }

    .mobicip-blog-page {
        padding: 20px 16px;
    }

    .mobicip-blog-page h1 {
        font-size: 28px;
        margin: 8px 0 16px;
        line-height: 42px;
    }

    .mobicip-blog-subtitle,
    .blog_index_component .blog_desc {
        font-size: 18px;
        line-height: 36px;
        margin-bottom: 16px;
        word-break: normal;
        overflow-wrap: break-word;
    }

    .hero-content h2 {
        font-size: 24px;
    }

    .hero-content h2 a {
        width: 382px;
        line-height: 44px;
        font-size: 26px;
        color: #111827;
        display: block;
    }

    .popular-posts-heading {
        font-size: 26px;
        margin-top: 0;
        margin-bottom: 16px;
    }

    .mobicip-post-grid {
        grid-template-columns: 1fr;
        gap: 24px;
        justify-items: center;
        width: 100%;
    }

    .mobicip-blog-hero {
        overflow: hidden;
        margin-bottom: 20px;
    }

    .hero-image {
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .hero-image img,
    img.attachment-large.size-large.wp-post-image {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
        object-fit: cover;
        margin: 0;
        display: block;
    }

    .mobicip-card img,
    img.attachment-medium_large.size-medium_large.wp-post-image {
        width: 387px;
        height: 194.06px;
        object-fit: cover;
        display: block;
    }

    .banner-card {
        display: none;
    }

    .mobicip-card h3 {
        font-weight: 700;
        font-size: 22px;
        line-height: 30px;
        margin-bottom: 0px;
    }

    .mobicip-post-excerpt {
        font-weight: 400;
        font-size: 16px;
        line-height: 28px;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        width: 100%;
    }

    .mobicip-post-date {
        margin-top: 16px;
        display: inline-block;
        width: 100%;
        vertical-align: middle;
        font-weight: 500;
        color: #383e48;
        line-height: 24px;
    }
}

/* ========================================
   SMALL MOBILE EXTRA
======================================== */

@media (max-width: 480px) {
    .hero-content h2 {
        font-size: 20px;
    }
}

.blog_index_component .blog_desc {
    font-family: Manrope;
    font-weight: 600;
    font-size: 28px;
    line-height: 44px;
    letter-spacing: 0px;
    color: #454A55;
    margin-bottom: 40px;
    text-align: left;
}

/* ========================================
   iPAD MINI SPECIFIC
======================================== */

@media (min-width: 768px) and (max-width: 820px) {
    .mobicip-blog-page {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 20px 16px !important;
        overflow: hidden;
    }

    .mobicip-blog-hero {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 40px;
        width: 100%;
        overflow: hidden;
    }

    .hero-image {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
        margin: 0;
        padding: 0;
    }

    .hero-image img,
    img.attachment-large.size-large.wp-post-image {
        width: 100%;
        max-width: 100%;
        height: 400px;
        object-fit: cover;
        display: block;
        margin: 0;
    }

    .mobicip-post-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
        width: 100%;
    }

    .mobicip-card img {
        width: 100%;
        height: 194.06px;
        object-fit: cover;
        display: block;
    }

    .mobicip-card {
        width: 100%;
        display: flex;
        flex-direction: column;
    }

    .banner-card {
        display: none;
    }
}


/* ========================================
   PUBLII PORT — AMBIENT RESET RESTORED
   Nothing above this line is modified.

   The exported WordPress <style> block relied on the parent theme's
   img { max-width: 100% } reset, which is not part of the export. Without
   it, .mobicip-card img's fixed 374px and .hero-image img's fixed 747px
   overflow their grid columns (332px at the 1084px container), so cards
   bleed into their neighbours. This restores only that one declaration,
   scoped to the blog page.
======================================== */

.mobicip-blog-page img {
    max-width: 100%;
}

/* The -48px top margin above was compensating for a wrapper WordPress
   rendered between the header and this block. Publii has no such wrapper,
   so it pulled the h1 to 80 - 48 + 40 = 72px, 8px under the 80px fixed
   header. Dropping it leaves the source's own 40px padding as clearance.
   The tablet and mobile rules already set margin: 0 !important, so this
   only affects desktop. */

.mobicip-blog-page {
    margin-top: 0;
}
