/**
 * DMG Post Search Styles
 */

.dmg-post-search-container {
    margin: 0 auto;
}

/* Search Form */
.dmg-post-search-form {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 30px;

    font-family: "Outfit", sans-serif;

    @media screen and (max-width: 900px) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    @media screen and (max-width: 600px) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.post-form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;

    @media screen and (max-width: 600px) {
        grid-column: span 2;
    }
}

.post-form-group label {
    font-size: 18px;
    font-weight: 600;
    color: #0f172a;
}

.dmg-post-search-input {
    width: 100%;
    height: 38px;
    padding: 8px 12px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    outline: none;
    transition: border-color 0.3s ease;
}

.dmg-post-search-input:focus {
    border-color: #0073aa;
}

.post-form-btns {
    display: flex;
    gap: 10px;
    align-items: end;
}

.dmg-post-search-button {
    height: 38px;
    padding: 8px 16px;
    font-size: 16px;
    line-height: 1;
    background-color: #004896;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.dmg-post-search-button:hover {
    background-color: #005a87;
}

.dmg-post-clear {
    display: inline-block;
    height: 38px;
    padding: 8px 16px;
    font-size: 16px;
    line-height: 1.3;
    color: #000;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    border: 1px solid #fff;
}
.dmg-post-clear:hover {
    color: #004896;
    background-color: #e6edf5;
    border: 1px solid #004896;
}

/* ----------------------------------- Returned Post Results */

.dmg-post-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;

    @media screen and (max-width: 900px) {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    @media screen and (max-width: 600px) {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
}

.dmg-post-item {
    /* padding: 20px; */
    /* background-color: #f9f9f9; */
    /* border: 1px solid #e5e5e5; */
    /* border-radius: 4px; */
    /* transition: box-shadow 0.3s ease; */

    font-family: "Outfit", sans-serif;
}

.dmg-post-item > a {
    @media screen and (max-width: 600px) {
        display: flex;
        justify-content: space-between;
        border-bottom: #e2e8f0 1px solid;
        gap: 10px;
        padding-bottom: 15px;
    }
}

.dmg-post-imgbox {
    position: relative;
    width: 100%;
    height: 200px;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: end;
    overflow: hidden;
    border-radius: 5px;

    @media screen and (max-width: 600px) {
        display: none;
    }
}

.dmg-post-imgbox:hover img {
    transform: scale(1.05);
}

.dmg-post-img {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
}

.dmg-post-title {
    margin: 0 0 10px;
    font-family: "Outfit", sans-serif;
    font-size: 16px;

    transition: all 0.2s ease;

    @media screen and (max-width: 600px) {
        display: flex;
        flex-direction: column;
        gap: 5px;
        width: 70%;
    }
}
.dmg-post-title:hover {
    color: #004896;
}

.dmg-post-excerpt {
    margin-bottom: 15px;
    color: #666;
    line-height: 1.6;
}

.dmg-post-meta {
    display: flex;
    justify-content: space-around;
    width: 100%;
    padding: 0 10px;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 14px;
    color: #888;
    z-index: 1;
}

.dmg-post-categories {
    font-family: "Outfit", sans-serif;
    margin-right: auto;
    z-index: 1;
    background-color: #ffc823;
    color: #000;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    line-height: 18px;
}

.dmg-post-expiry-banner {
    font-family: "Outfit", sans-serif;
    z-index: 1;
    background-color: #004896;
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    line-height: 18px;

    @media screen and (max-width: 600px) {
        display: none;
    }
}

/* .dmg-post-link:hover {
    background-color: #005a87;
    color: #fff;
} */

.dmg-no-posts-found {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 16px;
}

.dmg-post-categories-mobile {
    display: none;

    @media screen and (max-width: 600px) {
        display: inline-block;
        font-family: "Outfit", sans-serif;
        margin-right: auto;
        z-index: 1;
        background-color: #ffc823;
        color: #000;
        padding: 4px 10px;
        border-radius: 4px;
        font-size: 12px;
        line-height: 18px;
    }
}

.dmg-post-imgbox-mobile {
    display: none;
    width: 40%;
    height: 90px;
    transition: all 0.3s ease;
    border-radius: 0.375rem;
    overflow: hidden;

    @media screen and (max-width: 600px) {
        display: block;
    }
}

.dmg-post-img-mobile {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
}

/* ----------------------------------- Ad box */

.dmg-post-ad-placeholder {
    background-color: #f1f5f9;
    border-radius: 4px;
    text-align: center;
}

.dmg-post-ad-placeholder p {
    font-family: "Outfit", sans-serif;
    color: #666;
    font-size: 12px;
    text-transform: uppercase;
}

.dmg-post-ad-placeholder-codebox {
    width: 100%;
}

/* ----------------------------------- Pagination */

.posts-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e5e5e5;
}

.posts-pagination .page-numbers {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 32px;
    height: 32px;
    font-family: "Outfit", sans-serif;
    font-size: 16px;
    color: #000;
    background-color: #f5f5f5;
    border-radius: 0.375rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.posts-pagination .page-numbers.next,
.posts-pagination .page-numbers.prev {
    width: fit-content;
    padding: 0 8px;
}

.posts-pagination .page-numbers:hover {
    background-color: #ffc823;
    border-color: #ffc823;
}

.posts-pagination .page-numbers.current {
    background-color: #004896;
    border-color: #004896;
    color: #fff;
    cursor: default;
}

.posts-pagination .page-numbers.dots {
    background: transparent;
    border: none;
    cursor: default;
}

.posts-pagination .page-numbers.dots:hover {
    background: transparent;
    color: #333;
}

/* Loading state */
.dmg-post-results.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Header and mobile menu shortcode styles */
.dmg-post-header-search-form {
    display: flex;
    gap: 10px;
}

.dmg-post-header-search-input {
    visibility: hidden;
    width: 0%;
    padding: 8px 8px;
    height: 38px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    outline: none;
    transition: all 0.2s ease;
}

.dmg-post-header-search-input.expanded {
    visibility: visible;
    width: 200px;
}

.expanded-mobile {
    visibility: visible;
    width: 100%;
}

.w-full {
    width: 100%;

    .expanded {
        width: 100%;
    }
}

.dmg-post-header-search-button {
    display: inline-block;
    font-size: 16px;
    background-color: transparent;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-btn-yellow {
    height: 100%;
    background-color: #ffc823;
    color: #000;
}

/* Responsive */
@media (max-width: 600px) {
    .dmg-post-search-form {
        flex-direction: column;
    }

    .dmg-post-search-button {
        width: 100%;
    }

    .dmg-post-meta {
        flex-direction: column;
        gap: 5px;
    }
}
