/* =========================================================
   DEALERSHIP MANAGER - BLOG AND ADVICE
   ========================================================= */

.dm-blog,
.dm-blog-categories {
    width: 100%;
    box-sizing: border-box;
}

.dm-blog *,
.dm-blog-categories * {
    box-sizing: border-box;
}

/* Search and category filters */

.dm-blog-controls {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 0 30px;
}

.dm-blog-search {
    flex: 1 1 260px;
    min-width: 0;
}

.dm-blog-search input,
.dm-blog-filter select {
    width: 100%;
    min-height: 48px;
    padding: 12px 15px;
    border: 1px solid #d5d5d5;
    border-radius: 4px;
    background: #fff;
    color: #222;
    font: inherit;
}

.dm-blog-filter {
    flex: 0 1 240px;
    min-width: 180px;
}

.dm-blog-search input:focus,
.dm-blog-filter select:focus {
    outline: 2px solid #b7922e;
    outline-offset: 2px;
}

.dm-blog-search-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 24px;
    border: 1px solid #b7922e;
    border-radius: 4px;
    background: #b7922e;
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.dm-blog-search-button:hover,
.dm-blog-search-button:focus {
    background: #927322;
    border-color: #927322;
    color: #fff;
}

.dm-blog-reset {
    color: #555;
    text-decoration: underline;
}

/* Article grid */

.dm-blog-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 30px;
    align-items: stretch;
}

/* Article card */

.dm-blog-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    background: #fff;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.dm-blog-card:hover {
    box-shadow: 0 6px 22px rgb(0 0 0 / 8%);
    transform: translateY(-2px);
}

.dm-blog-card-image-link {
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: #f0f0f0;
}

.dm-blog-card-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.dm-blog-card:hover .dm-blog-card-image {
    transform: scale(1.03);
}

.dm-blog-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 180px;
    padding: 20px;
    background: #ededed;
    color: #777;
    text-align: center;
}

.dm-blog-card-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    padding: 22px;
}

.dm-blog-card-category {
    margin-bottom: 10px;
    color: #927322;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1.5;
    text-transform: uppercase;
}

.dm-blog-card-title {
    margin: 0 0 12px;
    font-size: 21px;
    font-weight: 600;
    line-height: 1.35;
}

.dm-blog-card-title a {
    color: inherit;
    text-decoration: none;
}

.dm-blog-card-title a:hover {
    color: #927322;
}

.dm-blog-card-excerpt {
    margin: 0 0 20px;
    color: #555;
    font-size: 15px;
    line-height: 1.7;
}

.dm-blog-card-link {
    display: inline-block;
    margin-top: auto;
    color: #927322;
    font-weight: 600;
    text-decoration: none;
}

.dm-blog-card-link:hover {
    text-decoration: underline;
}

/* Category landing page heading */

.dm-blog-category-header {
    margin-bottom: 28px;
}

.dm-blog-category-title {
    margin: 0 0 12px;
    font-size: 32px;
    line-height: 1.25;
}

.dm-blog-category-intro {
    max-width: 850px;
    margin: 0;
    color: #555;
    font-size: 16px;
    line-height: 1.7;
}

.dm-blog-category-controls {
    margin-top: 24px;
}

/* Category cards */

.dm-blog-categories {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.dm-blog-category-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 26px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    background: #fff;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.dm-blog-category-card:hover {
    border-color: #b7922e;
    box-shadow: 0 5px 18px rgb(0 0 0 / 6%);
}

.dm-blog-category-card-title {
    margin: 0 0 12px;
    font-size: 22px;
    line-height: 1.35;
}

.dm-blog-category-card-title a {
    color: inherit;
    text-decoration: none;
}

.dm-blog-category-card-title a:hover {
    color: #927322;
}

.dm-blog-category-card-description {
    margin: 0 0 22px;
    color: #555;
    font-size: 15px;
    line-height: 1.7;
}

.dm-blog-category-card-link {
    margin-top: auto;
    color: #927322;
    font-weight: 600;
    text-decoration: none;
}

.dm-blog-category-card-link:hover {
    text-decoration: underline;
}

/* Pagination */

.dm-blog-pagination {
    margin-top: 40px;
}

.dm-blog-pagination .page-numbers {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.dm-blog-pagination .page-numbers li {
    margin: 0;
    padding: 0;
}

.dm-blog-pagination .page-numbers a,
.dm-blog-pagination .page-numbers span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 42px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
}

.dm-blog-pagination .page-numbers a:hover,
.dm-blog-pagination .page-numbers .current {
    border-color: #b7922e;
    background: #b7922e;
    color: #fff;
}

/* Empty results and notices */

.dm-blog-no-results,
.dm-blog-notice {
    padding: 28px;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    background: #f8f8f8;
}

.dm-blog-no-results h3 {
    margin-top: 0;
}

.dm-blog-no-results p,
.dm-blog-notice {
    line-height: 1.7;
}

/* Responsive layout */

@media (max-width: 980px) {
    .dm-blog-grid,
    .dm-blog-categories {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 22px;
    }
}

@media (max-width: 600px) {
    .dm-blog-grid,
    .dm-blog-categories {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
    }

    .dm-blog-controls {
        align-items: stretch;
        flex-direction: column;
    }

    .dm-blog-search,
    .dm-blog-filter {
        flex: 1 1 auto;
        width: 100%;
    }

    .dm-blog-search-button {
        width: 100%;
    }

    .dm-blog-category-title {
        font-size: 26px;
    }

    .dm-blog-card-content,
    .dm-blog-category-card {
        padding: 20px;
    }

    .dm-blog-card-title {
        font-size: 19px;
    }
}


/* =========================================
   HARPER'S AUTO — BLOG HEADINGS
   ========================================= */

.dm-blog-category-title,
.dm-blog-card-title,
.dm-blog-category-card-title {
    display: inline-block !important;
    position: relative;
    margin: 0 0 12px;
    padding-bottom: 12px;
    color: #363536;
    text-transform: uppercase;
    font-size: 24px;
    line-height: 1.3;
}

/* Gold gradient underline */
.dm-blog-category-title::after,
.dm-blog-card-title::after,
.dm-blog-category-card-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(
        to right,
        #B7922E 0%,
        #FDBC21 33%,
        #F9F3AF 50%,
        #FDBC21 67%,
        #B7922E 100%
    );
}

/* Keep linked article headings consistent */
.dm-blog-card-title a,
.dm-blog-category-card-title a {
    color: #363536;
    text-decoration: none;
}

.dm-blog-card-title a:hover,
.dm-blog-category-card-title a:hover {
    color: #B7922E;
}

/* Smaller headings on mobile */
@media (max-width: 600px) {
    .dm-blog-category-title,
    .dm-blog-card-title,
    .dm-blog-category-card-title {
        font-size: 20px;
    }
}


/* =========================================
   HARPER'S AUTO — BLOG BUTTONS
   ========================================= */

/* Search, Read More and Explore Articles */
.dm-blog-search-button,
.dm-blog-card-link,
.dm-blog-category-card-link,
.dm-blog-reset {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    max-width: 100%;
    box-sizing: border-box;
    padding: 10px 24px;
    border: none;
    border-radius: 0;
    background: transparent;
    color: #363536;
    font-family: 'Azo Sans Medium', Helvetica, Arial, Lucida, sans-serif;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.8px;
    text-align: center;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.25s ease;
}

/* Top and bottom gold gradient borders */
.dm-blog-search-button::before,
.dm-blog-search-button::after,
.dm-blog-card-link::before,
.dm-blog-card-link::after,
.dm-blog-category-card-link::before,
.dm-blog-category-card-link::after,
.dm-blog-reset::before,
.dm-blog-reset::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        to right,
        #B7922E 0%,
        #FDBC21 33%,
        #F9F3AF 50%,
        #FDBC21 67%,
        #B7922E 100%
    );
}

.dm-blog-search-button::before,
.dm-blog-card-link::before,
.dm-blog-category-card-link::before,
.dm-blog-reset::before {
    top: 0;
}

.dm-blog-search-button::after,
.dm-blog-card-link::after,
.dm-blog-category-card-link::after,
.dm-blog-reset::after {
    bottom: 0;
}

/* Hover effect */
.dm-blog-search-button:hover,
.dm-blog-card-link:hover,
.dm-blog-category-card-link:hover,
.dm-blog-reset:hover {
    background: transparent;
    color: #000000;
    transform: scale(1.03);
}

/* Keep button text above the decorative borders */
.dm-blog-search-button,
.dm-blog-card-link,
.dm-blog-category-card-link,
.dm-blog-reset {
    z-index: 0;
}

/* Remove default button styling */
.dm-blog-search-button {
    appearance: none;
    -webkit-appearance: none;
}

/* Keep article links tidy */
.dm-blog-card-link span,
.dm-blog-category-card-link span {
    margin-left: 8px;
}

/* Search controls remain aligned */
.dm-blog-controls {
    align-items: center;
}


/* =========================================
   HARPER'S AUTO — BLOG ALIGNMENT
   ========================================= */

/* Centre blog headings and text */
.dm-blog-category-header,
.dm-blog-card-content,
.dm-blog-category-card {
    text-align: center;
}

/* Centre headings and their gold gradient underline */
.dm-blog-category-title,
.dm-blog-card-title,
.dm-blog-category-card-title {
    display: table !important;
    margin: 0 auto 12px;
    text-align: center;
}

/* Centre descriptions and excerpts */
.dm-blog-category-intro,
.dm-blog-card-excerpt,
.dm-blog-category-card-description {
    text-align: center;
}

/* Remove arrows from Read More and Explore Articles */
.dm-blog-card-link span,
.dm-blog-category-card-link span {
    display: none !important;
}

/* Centre buttons and links */
.dm-blog-card-link,
.dm-blog-category-card-link {
    margin: 12px auto 0;
}

/* Centre the search controls */
.dm-blog-controls {
    justify-content: center;
    text-align: center;
}

/* Keep search fields and buttons aligned neatly */
.dm-blog-search,
.dm-blog-filter {
    text-align: left;
}

/* Centre no-results messages */
.dm-blog-no-results {
    text-align: center;
}


/* Remove text underlines from blog buttons and links */
.dm-blog-search-button,
.dm-blog-search-button:hover,
.dm-blog-card-link,
.dm-blog-card-link:hover,
.dm-blog-category-card-link,
.dm-blog-category-card-link:hover,
.dm-blog-reset,
.dm-blog-reset:hover {
    text-decoration: none !important;
    box-shadow: none !important;
}


/* Three-column blog article grid */
.dm-blog-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 30px;
}

/* Two columns on tablets */
@media (max-width: 980px) {
    .dm-blog-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px;
    }
}

/* One column on mobile */
@media (max-width: 600px) {
    .dm-blog-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
    }
}


/* Align the blog search controls */
.dm-blog-controls {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

.dm-blog-search,
.dm-blog-filter {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.dm-blog-search-button,
.dm-blog-reset {
    align-self: flex-end;
    margin-bottom: 0;
    box-sizing: border-box;
}

/* Keep controls aligned on smaller screens */
@media (max-width: 600px) {
    .dm-blog-controls {
        align-items: stretch;
    }

    .dm-blog-search,
    .dm-blog-filter {
        width: 100%;
    }

    .dm-blog-search-button,
    .dm-blog-reset {
        align-self: flex-start;
    }
}


/* News & Advice flip-card grid */
.harpers-blog-category-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    width: 100%;
}

.harpers-blog-category-grid .harpers-large-hover-card {
    height: 300px;
    min-width: 0;
    box-sizing: border-box;
}

.harpers-blog-category-grid .harpers-large-hover-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.harpers-blog-category-grid .harpers-large-hover-card-description {
    overflow-wrap: anywhere;
}

@media (max-width: 980px) {
    .harpers-blog-category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }
}

@media (max-width: 600px) {
    .harpers-blog-category-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }

    .harpers-blog-category-grid .harpers-large-hover-card {
        height: 280px;
    }

    .harpers-blog-category-grid .harpers-large-hover-card-back {
        padding: 20px;
    }
}


/* Centre the final two category cards on desktop */
@media (min-width: 981px) {
    .harpers-blog-category-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .harpers-blog-category-grid .harpers-large-hover-card {
        grid-column: span 2;
    }

    /* Fourth card */
    .harpers-blog-category-grid .harpers-large-hover-card:nth-child(4) {
        grid-column: 2 / span 2;
    }

    /* Fifth card */
    .harpers-blog-category-grid .harpers-large-hover-card:nth-child(5) {
        grid-column: 4 / span 2;
    }
}