/* Native blog archives: use the ElderCareMatters design tokens.
 * The Resources template retains its existing blog styles in inner.css.
 */
.ecm-main--fallback {
    padding-bottom: 80px;
    background: var(--cream);
}

.ecm-main--fallback > .breadcrumb {
    position: static;
    background: transparent;
    border-bottom: none;
    box-shadow: none;
}

.ecm-main--fallback > .breadcrumb a,
.ecm-main--fallback > .breadcrumb a:hover,
.ecm-main--fallback > .breadcrumb .breadcrumb-current {
    color: var(--muted);
    font-weight: 400;
}

.ecm-archive-header {
    padding: 56px 5% 48px;
    background: linear-gradient(180deg, var(--sage-pale) 0%, transparent 100%);
}

.ecm-archive-title {
    text-transform: uppercase;
    font-family: var(--font-heading);
    font-size: clamp(2rem, 3.8vw, 3rem);
    font-weight: 700;
    line-height: 1.2;
    color: var(--charcoal);
    overflow-wrap: anywhere;
}

.ecm-archive-description {
    max-width: 620px;
    margin-top: 16px;
    color: var(--mid);
    font-size: 1rem;
    line-height: 1.7;
}

.resources-filters {
    margin-top: 28px;
}

.resources-search {
    display: flex;
    max-width: 480px;
    margin-bottom: 20px;
}

.resources-search-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-right: none;
    border-radius: 10px 0 0 10px;
    font-size: 0.95rem;
    font-family: var(--font-body, inherit);
    background: #fff;
    color: var(--charcoal);
}

.resources-search-input:focus {
    outline: 2px solid var(--sage);
    outline-offset: -2px;
}

.resources-search-btn {
    padding: 12px 20px;
    border: 1px solid var(--sage);
    border-radius: 0 10px 10px 0;
    background: var(--sage);
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
}

.resources-search-btn:hover {
    filter: brightness(0.94);
}

.resources-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.resources-chip {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--charcoal);
    background: #fff;
    text-decoration: none;
    white-space: nowrap;
}

.resources-chip:hover {
    border-color: var(--sage);
}

.resources-chip.is-active {
    background: var(--sage);
    border-color: var(--sage);
    color: #fff;
}

.ecm-posts-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    width: 90%;
    margin: 32px auto 0;
}

.ecm-search-grid {
    width: 90%;
    margin: 32px auto 0;
}

.ecm-no-results {
    width: min(920px, 90%);
    margin: 48px auto 0;
    padding: 48px;
    border: 1px solid rgba(79, 107, 83, 0.16);
    border-radius: 20px;
    background:
        linear-gradient(135deg, rgba(229, 239, 230, 0.78), rgba(255, 254, 249, 0.94)),
        var(--warm-white);
    box-shadow: 0 18px 46px rgba(44, 44, 44, 0.08);
}

.ecm-no-results__title {
    max-width: 680px;
    margin: 0 0 10px;
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    line-height: 1.14;
    color: var(--charcoal);
}

.ecm-no-results__message {
    max-width: 620px;
    margin: 0 0 24px;
    color: var(--mid);
    font-size: 1.05rem;
    line-height: 1.7;
}

.ecm-site-search {
    max-width: 680px;
}

.ecm-site-search__fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: stretch;
}

.ecm-site-search__input {
    width: 100%;
    min-height: 54px;
    padding: 0 18px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    background: var(--warm-white);
    color: var(--charcoal);
    font-size: 1rem;
    box-shadow: 0 8px 22px rgba(44, 44, 44, 0.04);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ecm-site-search__input:focus {
    border-color: var(--sage);
    box-shadow: 0 0 0 4px rgba(79, 107, 83, 0.12);
    outline: none;
}

.ecm-site-search__button {
    min-height: 54px;
    padding: 0 24px;
    border: 0;
    border-radius: 12px;
    background: var(--sage);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.ecm-site-search__button:hover {
    background: #405f45;
    transform: translateY(-1px);
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.ecm-post-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--warm-white);
    border: 1.5px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.ecm-post-card:hover {
    transform: translateY(-4px);
    border-color: var(--sage-light);
    box-shadow: 0 16px 40px var(--shadow);
}

.ecm-post-card__thumb {
    display: block;
    height: 210px;
    flex-shrink: 0;
    overflow: hidden;
    background: var(--sage-pale);
}

.ecm-post-card__thumb--placeholder {
    background: linear-gradient(135deg, var(--sage-pale), var(--sage-light));
}

.ecm-post-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.ecm-post-card__thumb:hover img {
    transform: scale(1.04);
}

.ecm-post-card__body {
    padding: 24px;
    display: flex;
    flex: 1;
    flex-direction: column;
}

.ecm-post-card__meta {
    margin-bottom: 12px;
    font-family: var(--font-body);
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.ecm-post-card__title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--charcoal);
    margin: 0 0 12px;
    overflow-wrap: anywhere;
}

.ecm-post-card__title a {
    color: inherit;
    text-decoration: none;
}

.ecm-post-card__title a:hover {
    color: var(--sage);
}

.ecm-post-card__excerpt {
    margin-bottom: 24px;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

.ecm-post-card__excerpt,
.ecm-post-card__excerpt p {
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--mid);
    line-height: 1.7;
}

.ecm-post-card__body > .ecm-btn {
    margin-top: auto;
    padding: 16px 0 0;
    border: none;
    border-top: 1px solid var(--border);
    border-radius: 0;
    background: none;
    color: var(--sage);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    align-self: stretch;
}

.ecm-post-card__body > .ecm-btn::after {
    content: " →";
}

.ecm-post-card__body > .ecm-btn:hover {
    color: var(--charcoal);
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* Reset header navigation styles on both pagination wrappers. */
.ecm-pagination,
.ecm-pagination nav {
    display: block;
    position: static;
    height: auto;
    padding: 0;
    border: none;
    background: none;
    backdrop-filter: none;
    animation: none;
    z-index: auto;
}

.ecm-pagination {
    width: 90%;
    margin: 48px auto 0;
}

.ecm-pagination .nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.ecm-pagination .nav-links a::after {
    content: none;
}

.ecm-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 6px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--mid);
    background: var(--warm-white);
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.ecm-pagination .page-numbers.current,
.ecm-pagination a.page-numbers:hover {
    background: var(--sage);
    color: var(--warm-white);
    border-color: var(--sage);
}

.ecm-pagination .page-numbers.dots {
    border: none;
    background: none;
    color: var(--muted);
    min-width: auto;
}

@media (max-width: 991px) {
    .ecm-posts-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .ecm-archive-header {
        padding: 40px 5% 32px;
    }

    .ecm-no-results {
        padding: 32px 24px;
    }

    .ecm-site-search__fields {
        grid-template-columns: 1fr;
    }

    .ecm-post-card__body {
        padding: 20px;
    }
}

@media (max-width: 575px) {
    .ecm-posts-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: reduce) {
    .ecm-post-card,
    .ecm-post-card__thumb img,
    .ecm-pagination .page-numbers {
        transition: none;
    }

    .ecm-post-card:hover,
    .ecm-post-card__thumb:hover img {
        transform: none;
    }
}
