/* Blog index and post pages. Class names use the bl- prefix to stay clear of the legacy .blog-post rules in style.css. */

:root {
    --bl-navy: #09212b;
    --bl-sky: #33bdff;
    --bl-deep: #009ce3;
    --bl-surface: #f6f9fc;
    --bl-text: #4e4e4e;
    --bl-border: rgba(9, 33, 43, 0.06);
    --bl-shadow: 0 10px 30px rgba(9, 33, 43, 0.08);
    --bl-shadow-hover: 0 18px 40px rgba(9, 33, 43, 0.13);
    --bl-radius: 18px;
}

.bl-section {
    padding-block: clamp(56px, 7vw, 104px);
}

.bl-section--tint {
    background: var(--bl-surface);
}

/* ---------- shared bits ---------- */
.bl-eyebrow {
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--bl-deep);
}

.bl-head {
    max-width: 640px;
    margin: 0 auto clamp(28px, 4vw, 48px);
    text-align: center;
}

.bl-head__title {
    margin: 0;
    color: var(--bl-navy);
    font-size: clamp(28px, 3.4vw, 40px);
}

.bl-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 10px;
    margin: 0 0 12px;
    font-size: 13px;
    color: #6b7780;
}

.bl-meta__dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--bl-sky);
}

.bl-readmore {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    font-size: 14px;
    font-weight: 600;
    color: var(--bl-deep);
    text-decoration: none;
    transition: gap 0.25s ease, color 0.25s ease;
}

.bl-readmore:hover,
.bl-readmore:focus-visible {
    gap: 10px;
    color: var(--bl-navy);
}

.bl-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    padding: 13px 26px;
    border-radius: 999px;
    background: var(--bl-sky);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 10px 22px rgba(51, 189, 255, 0.35);
    transition: transform 0.25s ease, background 0.25s ease;
}

.bl-btn:hover,
.bl-btn:focus-visible {
    background: var(--bl-deep);
    color: #fff;
    transform: translateY(-2px);
}

.bl-section a:focus-visible,
.bl-section button:focus-visible,
.bl-section summary:focus-visible {
    outline: 3px solid rgba(0, 156, 227, 0.45);
    outline-offset: 3px;
    border-radius: 6px;
}

/* ---------- featured post ---------- */
.bl-feature {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    margin-bottom: clamp(32px, 4vw, 56px);
    overflow: hidden;
    border: 1px solid var(--bl-border);
    border-radius: 22px;
    background: #fff;
    box-shadow: var(--bl-shadow);
}

.bl-feature__media {
    display: block;
    position: relative;
    min-height: 400px;
    overflow: hidden;
    background: var(--bl-navy);
}

.bl-feature__img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.bl-feature:hover .bl-feature__img {
    transform: scale(1.03);
}

.bl-feature__body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(24px, 3.5vw, 52px);
}

.bl-feature__title {
    margin: 0 0 16px;
    font-size: clamp(26px, 2.6vw, 38px);
    line-height: 1.2;
}

.bl-feature__title a {
    color: var(--bl-navy);
    text-decoration: none;
}

.bl-feature__title a:hover {
    color: var(--bl-deep);
}

.bl-feature__excerpt {
    margin: 0 0 26px;
    font-size: 16px;
    line-height: 1.7;
    color: var(--bl-text);
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------- grid + cards ---------- */
.bl-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(20px, 2.2vw, 32px);
}

.bl-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--bl-border);
    border-radius: var(--bl-radius);
    background: #fff;
    box-shadow: var(--bl-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.bl-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--bl-shadow-hover);
}

.bl-card__media {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--bl-navy);
}

.bl-card__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.bl-card:hover .bl-card__img {
    transform: scale(1.04);
}

.bl-card__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 100%;
    background: linear-gradient(135deg, #0d3344 0%, var(--bl-navy) 55%, #0a2a38 100%);
    color: rgba(51, 189, 255, 0.55);
    font-size: 56px;
}

.bl-feature__media .bl-card__placeholder {
    position: absolute;
    inset: 0;
    font-size: 84px;
}

.bl-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 22px 24px 26px;
}

.bl-card__title {
    margin: 0 0 10px;
    font-size: 22px;
    line-height: 1.3;
}

.bl-card__title a {
    color: var(--bl-navy);
    text-decoration: none;
}

.bl-card__title a:hover {
    color: var(--bl-deep);
}

.bl-card__excerpt {
    display: -webkit-box;
    margin: 0 0 18px;
    overflow: hidden;
    font-size: 15px;
    line-height: 1.65;
    color: var(--bl-text);
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* ---------- pagination ---------- */
.bl-pagination {
    display: flex;
    justify-content: center;
    margin-top: clamp(36px, 5vw, 64px);
}

.bl-pagination .pagination {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 0;
}

.bl-pagination .page-item .page-link {
    min-width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    border: 1px solid var(--bl-border);
    border-radius: 999px !important;
    background: #fff;
    color: var(--bl-navy);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(9, 33, 43, 0.05);
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.bl-pagination .page-item .page-link:hover {
    background: var(--bl-surface);
    color: var(--bl-deep);
    transform: translateY(-2px);
}

.bl-pagination .page-item.active .page-link {
    border-color: var(--bl-sky);
    background: var(--bl-sky);
    color: #fff;
}

.bl-pagination .page-item.disabled .page-link {
    opacity: 0.45;
    box-shadow: none;
}

.bl-pagination .page-link:focus {
    box-shadow: 0 0 0 3px rgba(0, 156, 227, 0.35);
}

/* ---------- empty state ---------- */
.bl-empty {
    max-width: 480px;
    margin: 0 auto;
    padding: clamp(36px, 5vw, 56px) 28px;
    border: 1px dashed rgba(9, 33, 43, 0.18);
    border-radius: 22px;
    background: var(--bl-surface);
    text-align: center;
}

.bl-empty__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    margin-bottom: 18px;
    border-radius: 50%;
    background: #fff;
    color: var(--bl-sky);
    font-size: 34px;
    box-shadow: var(--bl-shadow);
}

.bl-empty__text {
    margin: 0 0 14px;
    font-size: 17px;
    color: var(--bl-navy);
}

/* ---------- post page ---------- */
.bl-post__head {
    max-width: 1044px;
    margin: 0 auto clamp(28px, 4vw, 48px);
}

.bl-byline {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: clamp(20px, 3vw, 32px);
}

.bl-byline__avatar {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bl-navy);
    color: var(--bl-sky);
    font-family: "DM Serif Display", serif;
    font-size: 22px;
}

.bl-byline__text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bl-byline__name {
    font-weight: 600;
    color: var(--bl-navy);
}

.bl-byline .bl-meta {
    margin: 0;
}

.bl-cover {
    margin: 0;
}

.bl-cover__img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 560px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 20px;
    box-shadow: var(--bl-shadow);
}

.bl-cover__caption {
    margin-top: 12px;
    font-size: 13px;
    text-align: center;
    color: #6b7780;
}

.bl-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "toc" "body" "share";
    gap: 28px;
    max-width: 720px;
    margin: 0 auto;
}

.bl-aside {
    display: contents;
}

.bl-toc {
    grid-area: toc;
}

.bl-share {
    grid-area: share;
}

.bl-prose {
    grid-area: body;
    min-width: 0;
}

@media (min-width: 992px) {
    .bl-layout {
        grid-template-columns: minmax(0, 720px) 260px;
        grid-template-areas: "body aside";
        gap: 64px;
        max-width: 1044px;
        align-items: start;
    }

    .bl-aside {
        display: flex;
        flex-direction: column;
        gap: 24px;
        grid-area: aside;
        position: sticky;
        top: 110px;
        max-height: calc(100vh - 130px);
        overflow-y: auto;
    }
}

.bl-toc {
    padding: 18px 20px;
    border: 1px solid var(--bl-border);
    border-radius: 16px;
    background: var(--bl-surface);
}

.bl-toc__title {
    cursor: pointer;
    list-style: none;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--bl-deep);
}

.bl-toc__title::-webkit-details-marker {
    display: none;
}

.bl-toc__list {
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
}

.bl-toc__item--l3 {
    padding-left: 14px;
}

.bl-toc__link {
    display: block;
    padding: 6px 0 6px 12px;
    border-left: 2px solid rgba(9, 33, 43, 0.1);
    font-size: 14px;
    line-height: 1.4;
    color: var(--bl-text);
    text-decoration: none;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.bl-toc__link:hover,
.bl-toc__link.is-active {
    border-left-color: var(--bl-sky);
    color: var(--bl-navy);
}

.bl-toc__link.is-active {
    font-weight: 600;
}

.bl-share__title {
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--bl-deep);
}

.bl-share__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.bl-share__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--bl-border);
    border-radius: 50%;
    background: #fff;
    color: var(--bl-navy);
    font-size: 20px;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(9, 33, 43, 0.06);
    transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.bl-share__btn:hover,
.bl-share__btn:focus-visible {
    background: var(--bl-navy);
    color: var(--bl-sky);
    transform: translateY(-2px);
}

.bl-share__status {
    flex-basis: 100%;
    min-height: 18px;
    font-size: 13px;
    color: var(--bl-deep);
}

/* ---------- article typography ---------- */
.bl-prose {
    font-size: 18px;
    line-height: 1.8;
    color: #3d4a52;
    overflow-wrap: anywhere;
}

.bl-prose > :first-child {
    margin-top: 0;
}

.bl-prose p,
.bl-prose ul,
.bl-prose ol,
.bl-prose blockquote,
.bl-prose pre,
.bl-prose table,
.bl-prose figure {
    margin: 0 0 1.4em;
}

.bl-prose h2,
.bl-prose h3,
.bl-prose h4 {
    margin: 2em 0 0.6em;
    color: var(--bl-navy);
    line-height: 1.25;
    scroll-margin-top: 110px;
}

.bl-prose h2 {
    font-size: clamp(26px, 3vw, 34px);
}

.bl-prose h3 {
    font-size: clamp(21px, 2.4vw, 26px);
}

.bl-prose h4 {
    font-size: 19px;
}

.bl-prose a {
    color: var(--bl-deep);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.bl-prose a:hover {
    color: var(--bl-navy);
}

.bl-prose strong {
    color: var(--bl-navy);
}

.bl-prose ul,
.bl-prose ol {
    padding-left: 1.4em;
}

.bl-prose li {
    margin-bottom: 0.45em;
}

.bl-prose li::marker {
    color: var(--bl-sky);
}

.bl-prose li > p {
    margin-bottom: 0.4em;
}

.bl-prose blockquote {
    padding: 18px 24px;
    border-left: 4px solid var(--bl-sky);
    border-radius: 0 14px 14px 0;
    background: var(--bl-surface);
    font-family: "DM Serif Display", serif;
    font-size: 1.15em;
    line-height: 1.6;
    color: var(--bl-navy);
}

.bl-prose blockquote p:last-child {
    margin-bottom: 0;
}

.bl-prose img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 1.6em auto;
    border-radius: 16px;
}

.bl-prose hr {
    margin: 2.4em 0;
    border: 0;
    border-top: 1px solid rgba(9, 33, 43, 0.12);
    opacity: 1;
}

.bl-prose table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
    font-size: 16px;
    -webkit-overflow-scrolling: touch;
}

.bl-prose th,
.bl-prose td {
    min-width: 120px;
    padding: 10px 14px;
    border: 1px solid rgba(9, 33, 43, 0.12);
    text-align: left;
    vertical-align: top;
}

.bl-prose th {
    background: var(--bl-surface);
    color: var(--bl-navy);
}

.bl-prose code {
    padding: 2px 6px;
    border-radius: 6px;
    background: #eef3f8;
    font-size: 0.88em;
    color: var(--bl-navy);
}

.bl-prose pre {
    overflow-x: auto;
    padding: 18px 20px;
    border-radius: 14px;
    background: var(--bl-navy);
    color: #e6f4fb;
    font-size: 15px;
    line-height: 1.6;
}

.bl-prose pre code {
    padding: 0;
    background: none;
    color: inherit;
}

/* ---------- responsive ---------- */
@media (max-width: 991.98px) {
    .bl-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bl-feature {
        grid-template-columns: minmax(0, 1fr);
    }

    .bl-feature__media {
        min-height: 0;
        aspect-ratio: 16 / 9;
    }
}

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

    .bl-prose {
        font-size: 17px;
    }

    .bl-cover__img {
        border-radius: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bl-card,
    .bl-card__img,
    .bl-feature__img,
    .bl-btn,
    .bl-readmore,
    .bl-share__btn,
    .bl-pagination .page-link {
        transition: none;
    }

    .bl-card:hover,
    .bl-card:hover .bl-card__img,
    .bl-feature:hover .bl-feature__img {
        transform: none;
    }
}
