/* Single Post (News article) */

body.single {
    background: #f6f7fb;
}

body.single #wrapper {
    background: transparent;
}

.storys-post {
    padding: clamp(1.5rem, 3.5vw, 3.5rem) 0;
}

.storys-post__main {
    width: min(100% - 2rem, 1200px);
    margin-inline: auto;
}

.storys-post__card {
    --post-pad-x: clamp(1rem, 2.5vw, 2.75rem);
    --post-pad-top: clamp(1.25rem, 2.5vw, 2.5rem);

    background: #fff;
    border-radius: 24px;
    border: 1px solid rgba(16, 24, 40, 0.06);
    box-shadow: none;
    overflow: hidden;
}

.storys-post__header {
    padding: var(--post-pad-top) var(--post-pad-x) 0;
    margin-bottom: 0;
}

.storys-post__hero {
    display: grid;
    gap: clamp(1rem, 2.2vw, 2rem);
    align-items: start;
}

.storys-post__hero--no-media {
    display: block;
}

@media (min-width: 900px) {
    .storys-post__hero {
        grid-template-columns: minmax(0, 1.25fr) minmax(240px, 360px);
    }
}

.storys-post__hero-text {
    max-width: none;
}

@media (min-width: 900px) {
    .storys-post__hero-text {
        max-width: 72ch;
    }

    .storys-post__hero--no-media .storys-post__hero-text,
    .storys-post__hero--no-media .storys-post__title,
    .storys-post__hero--no-media .storys-post__summary {
        max-width: none;
    }

    .storys-post__featured {
        align-self: start;
    }
}

.storys-post__eyebrow {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
    color: rgba(0,0,0,.62);
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.75rem;
}

.storys-post__back {
    text-decoration: none;
    font-weight: 800;
    color: rgba(0,0,0,.78);
}

.storys-post__back:hover {
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.storys-post__title {
    font-size: clamp(2rem, 3.2vw, 3rem);
    line-height: 1.1;
    letter-spacing: -0.025em;
    margin-bottom: 0.9rem;
    max-width: none;
}

@media (min-width: 900px) {
    .storys-post__title {
        max-width: 30ch;
    }
}

.storys-post__tags-wrap {
    position: relative;
    margin-bottom: 1.25rem;
}

.storys-post__tags-row {
    position: relative;
    z-index: 1;

    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.storys-post__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0;
}

/* Collapse tag list only when JS is available */
/* Collapsing behavior is handled by JS (hides extra tag links after 2 rows). */
html.js .storys-post__tags-wrap:not(.is-expanded) .storys-post__tags {
    overflow: visible;
}

html.js .storys-post__tags-wrap:not(.is-expanded)::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1.25rem;
    background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,1));
    pointer-events: none;
    z-index: 0;
}

.storys-post__tags-wrap a.storys-post__tags-toggle {
    display: inline;
    padding: 0;
    margin: 0;
    background: none;
    border: 0;
    text-decoration: none;
    color: #0b5ed7;
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.2;
    cursor: pointer;
}

.storys-post__tags-toggle:hover {
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.storys-post__tags-toggle:focus-visible {
    outline: 2px solid rgba(11,94,215,.45);
    outline-offset: 4px;
}

.storys-post__tags-toggle-icon {
    font-weight: 700;
    line-height: 1;
}

.storys-post__tags a {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    background: rgba(11,94,215,.07);
    color: rgba(11,94,215,.95);
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.storys-post__tags a:hover {
    background: rgba(11,94,215,.12);
}

.storys-post__featured {
    margin: 0;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 14px 28px rgba(16, 24, 40, 0.10);
}

.storys-post__featured img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    object-position: center;
    max-height: 420px;
}

@media (max-width: 899px) {
    .storys-post__featured img {
        aspect-ratio: 16 / 9;
        max-height: min(360px, 42vh);
    }
}

.storys-post__summary {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    background: rgba(11,94,215,.04);
    color: rgba(0,0,0,.78);
    border: 1px solid rgba(11,94,215,.10);
}

.storys-post__summary p:last-child {
    margin-bottom: 0;
}

.storys-post__content {
    padding: clamp(1.25rem, 2.5vw, 2rem) var(--post-pad-x) var(--post-pad-top);
    width: 100%;
    max-width: none;
    margin: 0;

    font-size: clamp(1.0625rem, 0.2vw + 1rem, 1.1625rem);
    line-height: 1.8;
    color: rgba(0,0,0,.78);
}

@media (min-width: 900px) {
    .storys-post__content {
        font-size: 1.125rem;
        line-height: 1.78;
    }
}

.storys-post__content > * {
    margin-block: 0 1.1em;
}

.storys-post__content p {
    margin-block: 0 1.25em;
}

.storys-post__content ul,
.storys-post__content ol {
    margin-block: 0 1.25em;
    padding-left: 1.25em;
}

.storys-post__content li {
    margin-block: 0.35em;
}

.storys-post__content figcaption {
    margin-top: 0.5rem;
    font-size: 0.95rem;
    color: rgba(0,0,0,.62);
}

.storys-post__content h2,
.storys-post__content h3,
.storys-post__content h4 {
    color: rgba(0,0,0,.92);
    line-height: 1.25;
    margin-top: 2em;
}

.storys-post__content h2 { font-size: 1.7rem; margin-top: 1.8em; }
.storys-post__content h3 { font-size: 1.35rem; margin-top: 1.6em; }
.storys-post__content h4 { font-size: 1.15rem; margin-top: 1.4em; }

.storys-post__content a {
    color: #0b5ed7;
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.storys-post__content a:hover {
    color: #084298;
}

.storys-post__content img {
    max-width: 100%;
    height: auto;
    border-radius: 16px;
}

.storys-post__content figure {
    margin: 1.5rem 0;
}

/* Optional editorial layouts: wrap text around media when aligned */
.storys-post__content .alignleft,
.storys-post__content img.alignleft,
.storys-post__content figure.alignleft,
.storys-post__content .wp-caption.alignleft {
    float: left;
    max-width: min(42%, 320px);
    margin: 0.35rem 1.25rem 0.9rem 0;
}

.storys-post__content .alignright,
.storys-post__content img.alignright,
.storys-post__content figure.alignright,
.storys-post__content .wp-caption.alignright {
    float: right;
    max-width: min(42%, 320px);
    margin: 0.35rem 0 0.9rem 1.25rem;
}

.storys-post__content figure.alignleft,
.storys-post__content figure.alignright {
    width: auto;
}

.storys-post__content figure.alignleft img,
.storys-post__content figure.alignright img {
    width: 100%;
}

.storys-post__content p::after {
    content: "";
    display: table;
    clear: both;
}

@media (max-width: 720px) {
    .storys-post__content .alignleft,
    .storys-post__content img.alignleft,
    .storys-post__content figure.alignleft,
    .storys-post__content .wp-caption.alignleft,
    .storys-post__content .alignright,
    .storys-post__content img.alignright,
    .storys-post__content figure.alignright,
    .storys-post__content .wp-caption.alignright {
        float: none;
        max-width: 100%;
        margin: 1.25rem auto;
    }
}

/* Keep media from overpowering the copy */
.storys-post__content figure,
.storys-post__content img,
.storys-post__content .wp-block-image,
.storys-post__content .wp-block-video,
.storys-post__content video,
.storys-post__content iframe {
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}

.storys-post__content blockquote {
    border-left: 4px solid rgba(11,94,215,.28);
    padding: 0.25rem 1rem;
    margin-left: 0;
    color: rgba(0,0,0,.72);
    background: rgba(11,94,215,.04);
    border-radius: 12px;
}

.storys-post__content blockquote > *:last-child {
    margin-bottom: 0;
}

.storys-post__content hr {
    border: 0;
    height: 1px;
    background: rgba(0,0,0,.12);
    margin: 2rem 0;
}

/* Make embeds/videos sane */
.storys-post__content iframe,
.storys-post__content video {
    width: 100%;
    border: 0;
    border-radius: 16px;
    display: block;
    margin: 1.5rem auto;
    box-shadow: 0 10px 20px rgba(16, 24, 40, 0.10);
}

.storys-post__content iframe {
    aspect-ratio: 16 / 9;
    height: auto;
}

.storys-post__footer {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 var(--post-pad-x) var(--post-pad-top);
}

.storys-post__nav {
    padding-top: 1.25rem;
    border-top: 1px solid rgba(0,0,0,.10);
}

.storys-post__nav-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.9rem;
}

.storys-post__nav-heading {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: rgba(0,0,0,.65);
    margin: 0;
}

.storys-post__nav-all {
    color: rgba(11,94,215,.95);
    text-decoration: none;
    font-weight: 700;
}

.storys-post__nav-all:hover {
    text-decoration: underline;
    text-underline-offset: 0.15em;
}

.storys-post-nav__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.9rem;
}

.storys-post-nav__slot {
    min-width: 0;
}

.storys-post-nav__slot--empty {
    visibility: hidden;
    pointer-events: none;
}

.storys-post__nav .storys-post__nav-link {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.9rem;
    padding: 1rem;
    border-radius: 16px;
    border: 1px solid rgba(16, 24, 40, 0.10);
    text-decoration: none;
    color: rgba(0,0,0,.85);
    background: #fff;
    min-height: 104px;
    align-content: start;
    align-items: start;
    transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease;
}

.storys-post__nav-media {
    align-self: start;
    margin-top: 0.15rem;

    width: 80px;
    height: 80px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(16, 24, 40, 0.10);
    background: rgba(16, 24, 40, 0.02);
}

@media (min-width: 900px) {
    .storys-post__nav-media {
        width: 96px;
        height: 96px;
    }
}

.storys-post__nav-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    image-rendering: auto;
    filter: none;
    backdrop-filter: none;
}

.storys-post__nav-body {
    display: grid;
    grid-template-rows: auto auto auto;
    gap: 0.25rem;
    align-content: start;
    min-width: 0;
}

.storys-post__nav-link--all {
    grid-template-columns: 1fr;
}

.storys-post__nav-link--next {
    text-align: left;
}

.storys-post__nav-link--prev {
    text-align: left;
}

.storys-post__nav-link--all {
    border-color: rgba(11,94,215,.14);
}

.storys-post__nav-link::before,
.storys-post__nav-link::after {
    content: none;
}

.storys-post__nav-label {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: rgba(0,0,0,.62);
}

.storys-post__nav-title {
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1.25;
    min-height: calc(2em * 1.25);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.storys-post__nav-meta {
    font-size: 0.92rem;
    color: rgba(0,0,0,.62);
}

.storys-post__nav-link:hover {
    border-color: rgba(11,94,215,.22);
    background: rgba(11,94,215,.03);
    transform: translateY(-1px);
}

@media (prefers-reduced-motion: reduce) {
    .storys-post__nav-link:hover {
        transform: none;
    }
}

@media (max-width: 520px) {
    .storys-post__title {
        font-size: clamp(1.6rem, 7vw, 2.1rem);
    }
}
