/* =========================================================
   IslamiQna Posts Grid — EXACT match to Elementor design
   Grid: 3 desktop / 2 tablet / 1 mobile
   ========================================================= */

/* -------- Wrapper -------- */
.iqpg-wrapper {
    width: 100%;
    max-width: 1140px;
    margin: 20px auto 0;
    padding: 0;
}
@media (max-width: 1024px) {
    .iqpg-wrapper { padding: 0 20px; }
}

/* -------- Grid: 3 / 2 / 1 -------- */
.iqpg-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
@media (max-width: 1024px) {
    .iqpg-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 767px) {
    .iqpg-grid { grid-template-columns: 1fr; }
}

/* =========================================================
   .post-cards — the card container
   ========================================================= */
.post-cards {
    display: flex;
    flex-direction: column;
    background: #FFFFFF;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 8px 25px rgba(7, 85, 64, 0.08);
    transition: all 0.3s ease;
    height: 100%;
}
.post-cards:hover {
    transform: translateY(-6px);
    box-shadow:
        0 18px 40px rgba(7, 85, 64, 0.16),
        0 5px 15px rgba(7, 85, 64, 0.08);
}

/* =========================================================
   Image — wrapper clips radius + shadow together
   ========================================================= */
.iqpg-card-img-wrap {
    display: block;
    line-height: 0;
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.47);
    overflow: hidden;
}
.iqpg-card-img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 10px;
    transition: transform 0.4s ease;
}
.post-cards:hover .iqpg-card-img {
    transform: scale(1.02);
}

/* =========================================================
   Title — h2, Poppins 18/16 weight 600 #075540
   ========================================================= */
.iqpg-card-title {
    font-family: 'Poppins', sans-serif !important;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
    color: #075540;
    margin: 15px 0 0;
    padding: 0 10px;
    text-align: left;
}
.iqpg-card-title a {
    color: inherit;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
@media (max-width: 1024px) {
    .iqpg-card-title { font-size: 16px; }
}

/* =========================================================
   Bottom row: [icon] [category label] [Start Quiz button]
   ========================================================= */
.iqpg-card-bottom {
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 15px;
    padding: 10px 5px 0;
    margin-top: auto;
}
@media (max-width: 767px) {
    .iqpg-card-bottom { gap: 10px; }
}

/* -------- Icon circle (50×50 / 40×40) -------- */
.iqpg-card-icon {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
    min-width: 50px;
    min-height: 50px;
    max-width: 50px;
    max-height: 50px;
    padding: 0;
    border-radius: 50%;
    background: #F0F8F4;
    color: #043C30;
    flex-shrink: 0;
}
.iqpg-card-icon svg {
    width: 25px;
    height: 25px;
    fill: currentColor;
    overflow: visible;
}
@media (max-width: 767px) {
    .iqpg-card-icon {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        max-width: 40px;
        max-height: 40px;
    }
    .iqpg-card-icon svg {
        width: 20px;
        height: 20px;
    }
}

/* -------- Category label (Montaga, 12px, 400, #515151) -------- */
.iqpg-card-category {
    font-family: 'Montaga', serif !important;
    font-size: 12px;
    font-weight: 400;
    color: #515151;
    line-height: 1.2;
    white-space: nowrap;
    flex-shrink: 0;
}

/* =========================================================
   Start Quiz button — replicates Elementor button widget
   (_flex_size: grow, align: right, size: sm)
   ========================================================= */

/* Widget wrapper: grows to fill the row, button aligned right */
.post-cards .iqpg-card-btn-wrap {
    flex: 1 0 auto;          /* Elementor "grow" = grow 1, shrink 0 */
    text-align: right;       /* Elementor align: right */
    margin: 0;
    padding: 0;
    min-width: 0;
}

/* The button itself = .elementor-button */
.post-cards .iqpg-card-btn,
.post-cards a.iqpg-card-btn,
.post-cards a.iqpg-card-btn:link,
.post-cards a.iqpg-card-btn:visited {
    display: inline-block;
    width: auto;
    height: auto;
    min-height: 0;
    max-width: none;
    margin: 0;
    box-sizing: border-box;

    padding: 18px 15px;               /* text_padding */
    background-color: #075540;
    background-image: none;
    border: 0;
    border-radius: 4px;
    box-shadow: none;
    outline: 0;

    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 500;
    font-style: normal;
    line-height: 0;                   /* Elementor JSON: line_height = 0px */
    letter-spacing: 0;
    word-spacing: 0;
    text-transform: none;
    text-decoration: none;
    text-align: center;
    white-space: nowrap;
    color: #FFFFFF;
    fill: #FFFFFF;

    cursor: pointer;
    transition: all 0.3s;
    -webkit-appearance: none;
    appearance: none;
}

/* .elementor-button-content-wrapper */
.post-cards .iqpg-card-btn .iqpg-card-btn-content {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin: 0;
    padding: 0;
    text-align: center;
}

/* .elementor-button-text */
.post-cards .iqpg-card-btn .iqpg-card-btn-text {
    display: inline-block;
    order: 10;
    margin: 0;
    padding: 0;
    color: inherit;
    font: inherit;
    line-height: inherit;
    letter-spacing: inherit;
    text-align: center;
}

/* Hover / focus (Elementor default: white text, bg from kit) */
.post-cards .iqpg-card-btn:hover,
.post-cards .iqpg-card-btn:focus,
.post-cards a.iqpg-card-btn:hover,
.post-cards a.iqpg-card-btn:focus {
    background-color: #075540;   /* change if your Elementor kit has a hover colour */
    color: #FFFFFF;
    fill: #FFFFFF;
    text-decoration: none;
    outline: 0;
}

/* Mobile — text_padding_mobile 16/10, font 14 */
@media (max-width: 767px) {
    .post-cards .iqpg-card-btn,
    .post-cards a.iqpg-card-btn,
    .post-cards a.iqpg-card-btn:link,
    .post-cards a.iqpg-card-btn:visited {
        padding: 16px 10px;
        font-size: 14px;
    }
}

/* =========================================================
   Load More
   ========================================================= */
.iqpg-loadmore-wrap {
    text-align: center;
    margin-top: 40px;
}
.iqpg-loadmore {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: #075540;
    color: #fff;
    border: 0;
    border-radius: 4px;
    padding: 12px 28px;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 16px;
    cursor: pointer;
    transition: background .25s ease, transform .2s ease;
}
.iqpg-loadmore:hover {
    background: #0a6a50;
    transform: translateY(-1px);
}
.iqpg-loadmore[disabled] { opacity: .7; cursor: not-allowed; }

.iqpg-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    display: none;
    animation: iqpg-spin .7s linear infinite;
}
.iqpg-loadmore.loading .iqpg-spinner { display: inline-block; }

@keyframes iqpg-spin { to { transform: rotate(360deg); } }