/* ======================================================
   PAGE CONTENT RESTYLE ONLY - DO NOT TOUCH HEADER
   ====================================================== */

/* Global page reset */
html,
body {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
    background: #ffffff !important;
    font-family: "Montserrat", "Open Sans", Arial, sans-serif !important;
    color: #1f2933 !important;
}

/* Keep header untouched */
#header {
    position: relative !important;
    z-index: 9999 !important;
}

/* ======================================================
   MAIN ARCHIVE WRAPPER
   ====================================================== */

.elementor-location-archive,
.elementor-200,
main,
#content,
.site-main {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 0 !important;
    background: #ffffff !important;
}

/* Main content container */
.elementor-location-archive > .elementor-element,
.elementor-200 > .elementor-element,
.elementor-element-1b7eaf4 {
    width: 100% !important;
    max-width: 1180px !important;
    margin: 0 auto !important;
    padding: 55px 24px 70px !important;
    box-sizing: border-box !important;
}

/* Inner container */
.elementor-location-archive .e-con-inner,
.elementor-200 .e-con-inner {
    max-width: 1180px !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 0 !important;
}

/* Prevent Elementor containers from collapsing */
.elementor-location-archive .e-con,
.elementor-location-archive .e-con-inner,
.elementor-location-archive .elementor-widget-container {
    box-sizing: border-box !important;
}

/* ======================================================
   POST GRID
   ====================================================== */

.elementor-posts-container,
.elementor-posts,
.elementor-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 34px !important;
    width: 100% !important;
    max-width: 1180px !important;
    margin: 0 auto !important;
    padding: 0 !important;
}

/* Post card */
.elementor-post,
.elementor-posts .elementor-post {
    width: 100% !important;
    margin: 0 !important;
    background: #ffffff !important;
    border-radius: 18px !important;
    overflow: hidden !important;
    box-shadow: 0 10px 28px rgba(0,0,0,0.08) !important;
    border: 1px solid rgba(0,0,0,0.06) !important;
    transition: all 0.25s ease !important;
    display: flex !important;
    flex-direction: column !important;
}

.elementor-post:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 16px 36px rgba(0,0,0,0.12) !important;
}

/* Image area */
.elementor-post__thumbnail__link,
.elementor-post__thumbnail {
    width: 100% !important;
    display: block !important;
    margin: 0 !important;
    overflow: hidden !important;
    background: #eef7f4 !important;
}

.elementor-post__thumbnail {
    position: relative !important;
    padding-bottom: 62% !important;
    height: 0 !important;
}

/* Force image to card size */
.elementor-post__thumbnail img,
.elementor-post img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    max-width: none !important;
    margin: 0 !important;
    display: block !important;
}

/* Text content area */
.elementor-post__text {
    padding: 20px 22px 24px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    flex: 1 !important;
}

/* Category/meta */
.elementor-post__meta-data,
.elementor-post__badge,
.elementor-post__read-more {
    font-family: "Montserrat", Arial, sans-serif !important;
}

/* Title */
.elementor-post__title {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 20px !important;
    line-height: 1.35 !important;
    font-weight: 700 !important;
    color: #101828 !important;
}

.elementor-post__title a {
    color: #101828 !important;
    text-decoration: none !important;
}

.elementor-post__title a:hover {
    color: #168d99 !important;
}

/* Excerpt */
.elementor-post__excerpt {
    margin: 0 !important;
    padding: 0 !important;
}

.elementor-post__excerpt p,
.elementor-post p {
    font-size: 14px !important;
    line-height: 1.65 !important;
    color: #667085 !important;
    margin: 0 !important;
}

/* Read more */
.elementor-post__read-more {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: fit-content !important;
    margin-top: 8px !important;
    padding: 9px 16px !important;
    background: #168d99 !important;
    color: #ffffff !important;
    border-radius: 999px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
}

.elementor-post__read-more:hover {
    background: #10aa58 !important;
    color: #ffffff !important;
}

/* ======================================================
   FIX OVERSIZED IMAGES OUTSIDE POST CARDS
   ====================================================== */

.elementor-location-archive img,
.elementor-200 img,
.site-main img,
#content img {
    max-width: 100% !important;
    height: auto !important;
}

/* Prevent random image from becoming huge */
.elementor-location-archive img:not(.attachment-medium):not(.attachment-large):not(.wp-post-image),
.elementor-200 img:not(.attachment-medium):not(.attachment-large):not(.wp-post-image) {
    max-width: 100% !important;
    height: auto !important;
}

/* Specific protection for giant email/newsletter icon issue */
.elementor-location-archive img[src*="email"],
.elementor-location-archive img[src*="mail"],
.elementor-location-archive img[src*="newsletter"],
.elementor-200 img[src*="email"],
.elementor-200 img[src*="mail"],
.elementor-200 img[src*="newsletter"] {
    max-width: 220px !important;
    width: 220px !important;
    height: auto !important;
    display: block !important;
    margin: 30px auto !important;
}

/* ======================================================
   SIDEBAR / WIDGET CLEANUP IF EXISTS
   ====================================================== */

.widget,
.elementor-widget-sidebar,
.elementor-widget-wp-widget-recent-posts,
.elementor-widget-wp-widget-categories {
    background: #ffffff !important;
    border-radius: 16px !important;
    padding: 22px !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06) !important;
    border: 1px solid rgba(0,0,0,0.06) !important;
    margin-bottom: 24px !important;
}

.widget h2,
.widget h3,
.elementor-widget-sidebar h2,
.elementor-widget-sidebar h3 {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #101828 !important;
    margin: 0 0 16px !important;
}

.widget ul,
.elementor-widget-sidebar ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.widget li,
.elementor-widget-sidebar li {
    padding: 8px 0 !important;
    border-bottom: 1px solid #eef2f4 !important;
}

.widget li:last-child,
.elementor-widget-sidebar li:last-child {
    border-bottom: none !important;
}

.widget a,
.elementor-widget-sidebar a {
    color: #168d99 !important;
    text-decoration: none !important;
    font-size: 14px !important;
}

.widget a:hover,
.elementor-widget-sidebar a:hover {
    color: #10aa58 !important;
}

/* ======================================================
   PAGINATION
   ====================================================== */

.elementor-pagination,
.page-numbers {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 8px !important;
    margin: 45px auto 0 !important;
    padding: 0 !important;
}

.elementor-pagination .page-numbers,
.page-numbers a,
.page-numbers span {
    min-width: 38px !important;
    height: 38px !important;
    padding: 0 12px !important;
    border-radius: 999px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #f3f7f7 !important;
    color: #168d99 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
}

.elementor-pagination .page-numbers.current,
.page-numbers .current,
span.page-numbers.current {
    background: #168d99 !important;
    color: #ffffff !important;
}

/* ======================================================
   FOOTER RESTYLE
   ====================================================== */

footer,
#footer,
.site-footer,
.elementor-location-footer {
    width: 100% !important;
    background: #0f8d99 !important;
    color: #ffffff !important;
    padding: 38px 24px !important;
    margin: 0 !important;
    text-align: center !important;
    box-sizing: border-box !important;
}

footer img,
#footer img,
.site-footer img,
.elementor-location-footer img {
    max-width: 150px !important;
    height: auto !important;
    display: block !important;
    margin: 0 auto 18px !important;
}

footer a,
#footer a,
.site-footer a,
.elementor-location-footer a {
    color: #ffffff !important;
    text-decoration: none !important;
}

footer p,
#footer p,
.site-footer p,
.elementor-location-footer p {
    color: rgba(255,255,255,0.85) !important;
    font-size: 14px !important;
    margin: 6px 0 !important;
}

/* ======================================================
   REMOVE RAW / BROKEN DEFAULT STYLING
   ====================================================== */

body > img {
    max-width: 100% !important;
    height: auto !important;
}

body > ul:not(.elementor-nav-menu),
body > li,
body > .menu:not(#header .menu),
body > .menu-menu-container:not(#header .menu-menu-container) {
    display: none !important;
}

/* Remove huge blank spacing from broken Elementor widgets */
.elementor-widget-spacer,
.elementor-spacer,
.elementor-spacer-inner {
    max-height: 40px !important;
}

/* ======================================================
   RESPONSIVE
   ====================================================== */

@media (max-width: 1024px) {
    .elementor-location-archive > .elementor-element,
    .elementor-200 > .elementor-element,
    .elementor-element-1b7eaf4 {
        max-width: 920px !important;
        padding: 42px 22px 60px !important;
    }

    .elementor-posts-container,
    .elementor-posts,
    .elementor-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 26px !important;
    }
}

@media (max-width: 640px) {
    .elementor-location-archive > .elementor-element,
    .elementor-200 > .elementor-element,
    .elementor-element-1b7eaf4 {
        padding: 30px 16px 50px !important;
    }

    .elementor-posts-container,
    .elementor-posts,
    .elementor-grid {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }

    .elementor-post__text {
        padding: 18px !important;
    }

    .elementor-post__title {
        font-size: 18px !important;
    }

    .elementor-post__excerpt p,
    .elementor-post p {
        font-size: 13px !important;
    }

    footer,
    #footer,
    .site-footer,
    .elementor-location-footer {
        padding: 30px 16px !important;
    }
}
