/* Blog / News listing (archive/index) */

/* Force readable colors even inside inverted/dark wrappers */
.storys-blog .storys-post-card__link,
#wrapper > .invert .storys-blog .storys-post-card__link {
    color: rgba(0,0,0,.88);
}

.storys-blog .storys-post-card__title,
#wrapper > .invert .storys-blog .storys-post-card__title {
    color: rgba(0,0,0,.9);
}

.storys-blog .storys-post-card__excerpt,
#wrapper > .invert .storys-blog .storys-post-card__excerpt {
    color: rgba(0,0,0,.72);
}

.storys-blog__header {
    margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

.storys-blog__title {
    margin-bottom: 0.5rem;
}

.storys-blog__desc {
    max-width: 75ch;
}

.storys-post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: clamp(1rem, 2.5vw, 2rem);
    overflow: visible;
    padding-bottom: 0.5rem; /* room for hover ring at bottom */
}

/* Blog page background so hover “lift” doesn’t reveal odd gray */
body.blog,
body.archive,
body.search,
body.page-template-news,
body.page-template-news-php {
    background-color: #fff !important;
}

body.blog #wrapper,
body.archive #wrapper,
body.search #wrapper,
body.page-template-news #wrapper,
body.page-template-news-php #wrapper {
    background-color: #fff !important;
}

.storys-blog {
    background: transparent;
}

.storys-blog .inner {
    background: transparent;
}

.storys-post-card {
    margin: 0;
    overflow: visible;
    position: relative;
    z-index: 0;
}

.storys-post-card:hover,
.storys-post-card:focus-within {
    z-index: 5;
}

.storys-post-card__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: 16px;
    background: #fff;
    border: 1px solid rgba(0,0,0,.12);
    overflow: hidden;
    /* Don’t inherit section text color (some wrappers set white text) */
    color: rgba(0,0,0,.88);
    text-align: left;
    /* Ensure nothing can paint “outside” the card due to weird inherited positioning */
    position: relative;
    isolation: isolate;
    will-change: transform;
    transition: transform .15s ease, border-color .15s ease, background-color .15s ease;
}

.storys-post-card__link::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(11,94,215,.04);
    opacity: 0;
    transition: opacity .15s ease;
    pointer-events: none;
    border-radius: inherit;
}

.storys-post-card__link:hover,
.storys-post-card__link:focus-within {
    transform: translateY(-4px);
    border-color: rgba(11,94,215,.45);
    background-color: rgba(11,94,215,.01);
    box-shadow: 0 14px 34px rgba(0,0,0,.10);
}

.storys-post-card__link:hover::after,
.storys-post-card__link:focus-within::after {
    opacity: 1;
}

.storys-post-card__media {
    display: block;
    text-decoration: none;
    color: inherit;
}

.storys-post-card__title-link {
    color: inherit;
    text-decoration: none;
}

.storys-post-card__title-link:hover {
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.storys-post-card__link:focus-within {
    outline: 2px solid #0b5ed7;
    outline-offset: 4px;
}

.storys-post-card__media {
    order: 0;
    /* Taller crop so faces survive even with object-position adjustments. */
    aspect-ratio: 4 / 3;
    background: rgba(0,0,0,.04);
}

.storys-post-card__media--empty {
    background: linear-gradient(135deg, rgba(0,0,0,.03), rgba(0,0,0,.06));
}

.storys-post-card__header,
.storys-post-card__excerpt,
.storys-post-card__cta {
    order: 1;
    position: relative;
    z-index: 1;
}

/* Hard reset any inherited transform that could shove titles “behind/outside” */
.storys-post-card__header,
.storys-post-card__title,
.storys-post-card__meta,
.storys-post-card__excerpt,
.storys-post-card__cta {
    transform: none !important;
}

.storys-post-card__media {
    overflow: hidden;
}

/* Ensure card thumbnails stay evenly cropped (custom.css sets img { height:auto } globally). */
.storys-post-card__media .storys-post-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.storys-post-card__header {
    padding: 1rem 1.15rem 0.4rem;
}

.storys-post-card__title {
    font-size: clamp(1.02rem, 0.55vw + 0.9rem, 1.18rem);
    line-height: 1.25;
    margin: 0 0 0.4rem;
    color: rgba(0,0,0,.9);
    font-weight: 800;
    letter-spacing: -0.01em;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.storys-post-card__meta {
    font-size: 0.8rem;
    color: rgba(0,0,0,.58);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
}

.storys-post-card__cats {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 100%;
    line-height: 1.35;
}

.storys-post-card__meta a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.storys-post-card__excerpt {
    padding: 0 1.15rem;
    color: rgba(0,0,0,.70);
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.storys-post-card__excerpt p {
    margin-bottom: 0;
}

.storys-post-card__cta {
    padding: 0.85rem 1.15rem 1.1rem;
    margin-top: auto;
    display: flex;
    justify-content: flex-start;
}

.storys-post-card__cta .button {
    color: #0b5ed7;
    background: transparent;
    border: 2px solid rgba(11,94,215,.35);
    box-shadow: none; /* avoid “double ring” when base .button also applies shadows */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0.55rem 1rem;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    white-space: nowrap;
    box-sizing: border-box;
}

.storys-post-card__cta .button:hover {
    background: rgba(11,94,215,.08);
    border-color: rgba(11,94,215,.55);
    color: #0b5ed7;
}

.storys-post-card__cta .button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(11,94,215,.18);
    border-color: rgba(11,94,215,.85);
}

.storys-post-card__cta .button:active {
    background: rgba(11,94,215,.12);
    border-color: rgba(11,94,215,.85);
}

.storys-post-card__link:hover .storys-post-card__cta .button,
.storys-post-card__link:focus-within .storys-post-card__cta .button {
    color: #fff;
    background: #0b5ed7;
    border-color: #0b5ed7;
    box-shadow: none;
}

.storys-pagination {
    margin-top: clamp(1.5rem, 3vw, 2.5rem);
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* paginate_links() may output a UL, or just anchors/spans */
.storys-pagination ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.storys-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 0.5rem 0.9rem;
    border-radius: 999px;
    text-decoration: none;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.18);
}

.storys-pagination .page-numbers.current {
    background: #0b5ed7;
    color: #fff;
    box-shadow: none;
}
