/* =========================
   EASY SERVICES & EXPERTS ARCHIVE
   (Including shortcode list embed)
   ========================= */

/* Main container for archives */
/* Selector updated to include the new shortcode class. */
.wrapper.archive_services,
.wrapper.archive_experts,
.wrapper.archive_services.easyservices-list-embed {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    padding: 0 20px;
    margin-top: 20px;
    box-sizing: border-box;
}

/* Each card (service or expert) */
.wrapper.archive_services article.services,
.wrapper.archive_experts article.experts,
.wrapper.archive_services.easyservices-list-embed article.services {
    background-color: #fff;
    padding: 20px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Hover effect */
.wrapper.archive_services article.services:hover,
.wrapper.archive_experts article.experts:hover,
.wrapper.archive_services.easyservices-list-embed article.services:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Thumbnail container */
.service-thumb,
.experts-thumb {
    width: 100%;
    margin-bottom: 15px;
    border-radius: 4px;
}

/* Thumbnail image: full width, height auto, maintain proportions */
.service-thumb img,
.experts-thumb img {
    width: 100%;
    height: auto;
    display: block;
}

/* Title */
.wrapper.archive_services article.services h2,
.wrapper.archive_experts article.experts h2 {
    font-size: 20px;
    margin: 0 0 10px 0;
}

/* Description */
.wrapper.archive_services .description,
.wrapper.archive_experts .description {
    flex: 1;
    margin-bottom: 10px;
}

/* Service info / Expert info */
.wrapper.archive_services .service_info,
.wrapper.archive_experts .service_info {
    font-size: 14px;
    color: #555;
    margin-bottom: 10px;
}

/* Read more link */
.wrapper.archive_services article.services a.learn-more,
.wrapper.archive_experts article.experts a.learn-more {
    color: #0073aa;
    font-weight: 600;
    text-decoration: none;
    align-self: flex-start;
}
.wrapper.archive_services article.services a.learn-more:hover,
.wrapper.archive_experts article.experts a.learn-more:hover {
    text-decoration: underline;
}

/* =========================
   FILTER LAYOUT (FIXED FOR CENTER ALIGNMENT)
   ========================= */
.wrapper.filter_form {
    /* Main container is full width and centered */
    display: flex;
    justify-content: center; /* Center the form horizontally */
    align-items: flex-start;
    margin-bottom: 30px;
    width: 100%;
}

/* Inner container (form wrapper) controls max width */
.wrapper.filter_form > * {
    max-width: 800px; /* Max width restored for compact layout */
    width: 100%;
}

.wrapper.filter_form form {
    /* Form itself is a flex container with centered items */
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: center; /* Center items when they wrap */
    width: 100%;
    max-width: 800px;
}

@media (min-width: 992px) {
    .wrapper.filter_form form {
        flex-wrap: nowrap;
        /* When on one line, use space-between for better distribution, or center */
        justify-content: center; /* Keep it centered even on desktop */
    }
}

.wrapper.filter_form form input,
.wrapper.filter_form form select,
.wrapper.filter_form form button,
.wrapper.filter_form form input[type=submit] {
    flex: 0 0 auto; /* Stop items from stretching and keep their defined size */
    min-width: 140px;
    white-space: nowrap;
}

/* Pagination */
.archive_services .page-numbers,
.archive_experts .page-numbers {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* Responsive layout */

/* Tablet: 2 columns */
@media (max-width: 992px) {
    .wrapper.archive_services,
    .wrapper.archive_experts,
    .wrapper.archive_services.easyservices-list-embed {
        grid-template-columns: repeat(2, 1fr);
        padding: 0 15px;
    }
}

/* Mobile: 1 column */
@media (max-width: 768px) {
    .wrapper.archive_services,
    .wrapper.archive_experts,
    .wrapper.archive_services.easyservices-list-embed {
        grid-template-columns: 1fr;
        padding: 0 10px;
    }
}

/* =========================
   SHORTCODE LIST EMBED FIX
   Ensures the Grid container stretches to full width on pages
   to override conflicting theme styles.
   ========================= */

.wrapper.archive_services.easyservices-list-embed {
    /* Force 100% width to break out of narrow theme containers */
    width: 100%;

    /* Override any conflicting max-width rules from the theme */
    max-width: none !important;

    /* Ensure grid display is prioritized */
    display: grid !important;

    /* Reinforce grid columns */
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    box-sizing: border-box;
}

/* Mobile responsiveness for the shortcode embed specifically */
@media (max-width: 992px) {
    .wrapper.archive_services.easyservices-list-embed {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .wrapper.archive_services.easyservices-list-embed {
        grid-template-columns: 1fr;
    }
}

/* =========================
   SINGLE SERVICE & SINGLE EXPERT
   ========================= */

.wrapper.single_service,
.wrapper.single_expert {
    max-width: 900px;        /* Maximum content width */
    margin: 0 auto;          /* Center horizontally */
    padding: 20px;           /* Outer spacing */
    box-sizing: border-box;
}

.wrapper.single_service .service-thumb,
.wrapper.single_expert .experts-thumb {
    width: 100%;
    margin-bottom: 20px;
    border-radius: 6px;
}

.wrapper.single_service .service-thumb img,
.wrapper.single_expert .experts-thumb img {
    width: 100%;
    height: auto;           /* Maintain proportions */
    display: block;
    border-radius: 6px;
}

.wrapper.single_service h1,
.wrapper.single_expert h1 {
    margin-bottom: 20px;
    font-size: 28px;
    line-height: 1.3;
}

.wrapper.single_service .service-text,
.wrapper.single_expert .description {
    margin-bottom: 20px;
    font-size: 16px;
    line-height: 1.6;
}

.wrapper.single_service .services_info,
.wrapper.single_expert .service_info {
    font-size: 14px;
    color: #555;
    line-height: 1.5;
    margin-bottom: 20px;
}

.wrapper.single_service .services_info p,
.wrapper.single_expert .service_info p {
    margin: 5px 0;
}

.wrapper.single_service .back-to-archive,
.wrapper.single_expert .back-to-archive {
    margin-top: 20px;
}

.wrapper.single_service .back-to-archive a,
.wrapper.single_expert .back-to-archive a {
    color: #0073aa;
    text-decoration: none;
    font-weight: 600;
}

.wrapper.single_service .back-to-archive a:hover,
.wrapper.single_expert .back-to-archive a:hover {
    text-decoration: underline;
}

/* Responsive adjustments for single pages */
@media (max-width: 768px) {
    .wrapper.single_service,
    .wrapper.single_expert {
        padding: 15px;
    }

    .wrapper.single_service h1,
    .wrapper.single_expert h1 {
        font-size: 24px;
    }

    .wrapper.single_service .service-text,
    .wrapper.single_expert .description {
        font-size: 15px;
    }
}