﻿/* ============================================================
   SS.ge — Blog
   Drops onto:
     House.Web/Views/Blog/Index.cshtml   (list)
     House.Web/Views/Blog/Details.cshtml (article)

   Uses tokens from the SS.ge design system (tokens.css). Class
   names are fresh + semantic — when porting back to .cshtml,
   update the markup to match.
   ============================================================ */

/* ---------- Webfonts (Helvetica Neue LT GEO) ---------- */
@font-face {
    font-family: "Helvetica Neue LT GEO";
    src: url("../fonts/HelveticaNeueLTGEO-45Light.woff2") format("woff2");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Helvetica Neue LT GEO";
    src: url("../fonts/HelveticaNeueLTGEO-55Roman.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Helvetica Neue LT GEO";
    src: url("../fonts/HelveticaNeueLTGEO-65Medium.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Helvetica Neue LT GEO";
    src: url("../fonts/HelveticaNeueLTGEO-75Bold.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ---------- Tokens (mirrored from design-system) ---------- */
:root {
    --ss-blue: #2C61F2;
    --ss-yellow: #FAD400;
    --ss-green: #30C582;
    --ss-magenta: #D915A2;
    --ss-red: #D80027;
    --primary-50: #EBF0FE;
    --primary-500: #2C61F2;
    --primary-600: #1F4FD9;
    --primary-tint: rgba(44, 97, 242, 0.10);
    --fg-1: #00091C;
    --fg-2: #494F5D;
    --fg-3: #717681;
    --fg-4: #8E929A;
    --fg-inverse: #FFFFFF;
    --bg-canvas: #FFFFFF;
    --bg-subtle: #F8F8F9;
    --bg-muted: #F1F2F3;
    --border-1: #E3E4E6;
    --border-2: #DFE0E7;
    --border-strong: #C6C8CD;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 32px rgba(0, 9, 28, 0.10);
    --shadow-focus: 0 0 0 2px rgba(44, 97, 242, 0.30);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-pill: 999px;
    --s-1: 4px;
    --s-2: 8px;
    --s-3: 12px;
    --s-4: 16px;
    --s-5: 20px;
    --s-6: 24px;
    --s-8: 32px;
    --s-10: 40px;
    --s-12: 48px;
    --s-16: 64px;
    --font-sans: "Helvetica Neue LT GEO", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --w-light: 300;
    --w-regular: 400;
    --w-medium: 500;
    --w-bold: 700;
    /* page geometry */
    --container-max: 1280px;
    --container-gutter: 32px;
    --aside-width: 300px;
    --layout-gap: 32px;
}

/* ============================================================
   Base / reset (scoped — won't fight site-wide resets)
   ============================================================ */
.blog-page,
.blog-article {
    font-family: var(--font-sans);
    color: var(--fg-1);
    background: var(--bg-subtle);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

    .blog-page *,
    .blog-article * {
        box-sizing: border-box;
    }

    .blog-page a,
    .blog-article a {
        color: inherit;
        text-decoration: none;
    }

        .blog-page a:hover,
        .blog-article a:hover {
            color: var(--primary-600);
        }

        .blog-page a.blog-category.is-active:hover,
        .blog-article a.blog-category.is-active:hover {
            color: var(--fg-inverse);
        }

/* ============================================================
   Container
   ============================================================ */
.blog-container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-gutter);
}

/* ============================================================
   Breadcrumbs (details page)
   ============================================================ */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    padding: var(--s-5) 0 var(--s-3);
    font-size: 13px;
    color: var(--fg-3);
}

.breadcrumbs__item {
    color: var(--fg-3);
}

@media (max-width: 639px) {
    .breadcrumbs__item {
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        max-width: 220px;
    }
}

@media (min-width: 640px) and (max-width: 1023px) {
    .breadcrumbs__item {
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        max-width: 500px;
    }
}

    a.breadcrumbs__item:hover {
        color: var(--primary-500);
    }

    .breadcrumbs__item.is-current {
        color: var(--fg-1);
        pointer-events: none;
    }

.breadcrumbs__sep {
    display: inline-flex;
    width: 16px;
    height: 16px;
    color: var(--fg-4);
}

    .breadcrumbs__sep svg {
        width: 100%;
        height: 100%;
    }

/* ============================================================
   List page — header / categories
   ============================================================ */
.blog-list-page {
    padding: var(--s-8) 0 var(--s-16);
}

.blog-list-page__title {
    margin: 0 0 var(--s-6);
    font-size: 34px;
    line-height: 1.15;
    letter-spacing: -0.01em;
    font-weight: var(--w-bold);
    color: var(--fg-1);
}

.blog-categories {
    display: flex;
    gap: var(--s-2);
    margin-bottom: var(--s-6);
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    /* Bleed past the container so scrolled-off pills can sit flush at the edge */
    margin-left: calc(-1 * var(--container-gutter));
    margin-right: calc(-1 * var(--container-gutter));
    padding: 4px var(--container-gutter);
    scroll-padding-left: var(--container-gutter);
}

    .blog-categories::-webkit-scrollbar {
        display: none;
    }

.blog-category {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    height: 38px;
    padding: 0 var(--s-5);
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: var(--w-regular);
    color: var(--fg-2);
    background: var(--bg-muted);
    border: 1px solid transparent;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
    cursor: pointer;
}

    .blog-category:hover {
        background: #EAEBEC;
        color: var(--fg-1);
    }

    .blog-category.is-active {
        background: var(--primary-500);
        color: var(--fg-inverse);
        border-color: var(--primary-500);
        font-weight: var(--w-medium);
    }


/* ============================================================
   List page — layout (main + aside)
   ============================================================ */
.blog-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--aside-width);
    gap: var(--layout-gap);
    align-items: start;
}

.blog-main {
    display: flex;
    flex-direction: column;
    gap: var(--s-4);
}

/* ============================================================
   Article card (list item)
   ============================================================ */
.blog-card {
    display: grid;
    grid-template-columns: 412px minmax(0, 1fr);
    gap: var(--s-6);
    padding: var(--s-4);
    background: var(--bg-canvas);
    border: 1px solid var(--border-1);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: border-color .15s ease;
    position: relative;
    overflow: hidden;
}

    .blog-card:hover {
        border-color: var(--primary-500);
    }

.blog-card__media {
    position: relative;
    width: 100%;
    aspect-ratio: 19 / 10;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-muted) center / cover no-repeat;
}

    .blog-card__media img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

.blog-card__body {
    display: flex;
    flex-direction: column;
    padding: var(--s-2) var(--s-2) var(--s-1) 0;
    min-width: 0;
}

.blog-card__title {
    margin: 0 0 var(--s-3);
    font-size: 18px;
    line-height: 1.4;
    font-weight: var(--w-bold);
    color: var(--fg-1);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-wrap: pretty;
}

.blog-card__excerpt {
    margin: 0 0 auto;
    font-size: 13px;
    line-height: 1.55;
    color: var(--fg-2);
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-wrap: pretty;
}

/* meta strip: clock + views + author */
.blog-meta {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    margin-top: var(--s-5);
    padding-top: 0;
    flex-wrap: wrap;
}

.blog-meta__item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: var(--w-medium);
    color: var(--fg-2);
    line-height: 1;
}

    .blog-meta__item svg {
        width: 16px;
        height: 16px;
        color: var(--fg-3);
        flex-shrink: 0;
    }

    .blog-meta__item:last-child {
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

.blog-meta__divider {
    width: 1px;
    height: 14px;
    background: var(--border-1);
}

/* ============================================================
   Pagination
   ============================================================ */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--s-2);
    margin-top: var(--s-8);
    list-style: none;
    padding: 0;
    /* Scroll horizontally if too many pages to fit on one line */
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scroll-snap-type: x proximity;
}

    .pagination::-webkit-scrollbar {
        height: 6px;
    }

    .pagination::-webkit-scrollbar-thumb {
        background: var(--border-2);
        border-radius: var(--radius-pill);
    }

    .pagination > * {
        scroll-snap-align: center;
        flex-shrink: 0;
    }

.pagination__item,
.pagination__nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 var(--s-3);
    border-radius: var(--radius-md);
    background: var(--bg-canvas);
    border: 1px solid var(--border-2);
    font-size: 14px;
    font-weight: var(--w-medium);
    color: var(--fg-1);
    cursor: pointer;
    text-decoration: none;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}

    .pagination__nav[aria-disabled="true"] {
        opacity: 0.4;
        pointer-events: none;
    }

    .pagination__item:hover,
    .pagination__nav:hover {
        background: var(--bg-muted);
        border-color: var(--border-strong);
    }

    .pagination__item.is-current {
        background: var(--primary-500);
        border-color: var(--primary-500);
        color: var(--fg-inverse);
    }

        .pagination__item.is-current:hover {
            background: var(--primary-600);
            border-color: var(--primary-600);
        }

    .pagination__nav.is-active {
        background: var(--primary-500);
        border-color: var(--primary-500);
        color: var(--fg-inverse);
    }

.pagination__ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    color: var(--fg-3);
    user-select: none;
}

.pagination svg {
    width: 18px;
    height: 18px;
}

/* ============================================================
   Aside (sidebar)
   ============================================================ */
.blog-aside {
    display: flex;
    flex-direction: column;
    gap: var(--s-4);
}

.aside-card:not(.aside-rss) {
    background: var(--bg-canvas);
    border: 1px solid var(--border-1);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

/* SS.ge HOME lockup — sits above the listings card (Figma "logo home 1") */
.aside-brand {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    padding: 0 var(--s-1);
    margin-bottom: var(--s-1);
}

.aside-brand__mark {
    height: 24px;
    width: auto;
    display: block;
}

.aside-brand__tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 18px;
    padding: 0 8px;
    border-radius: var(--radius-pill);
    background: var(--ss-blue);
    color: var(--fg-inverse);
    font-size: 11px;
    font-weight: var(--w-bold);
    letter-spacing: 0.04em;
    line-height: 1;
}

/* Popular-articles block — mini card list with thumb + title + meta */
.aside-popular {
    padding: var(--s-4);
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
}

.aside-popular__head {
    font-size: 13px;
    font-weight: var(--w-bold);
    color: var(--fg-1);
    letter-spacing: 0.02em;
    margin-bottom: var(--s-1);
}

.aside-popular__item {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: var(--s-3);
    align-items: center;
    color: var(--fg-1);
}

.aside-popular__thumb {
    width: 88px;
    height: 60px;
    border-radius: var(--radius-md);
    background: var(--bg-muted) center / cover no-repeat;
    flex-shrink: 0;
}

.aside-popular__body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.aside-popular__title {
    font-size: 13px;
    line-height: 1.35;
    font-weight: var(--w-medium);
    color: var(--fg-1);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.aside-popular__meta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--fg-3);
}

/* Featured-listings list */
.aside-listings {
    padding: var(--s-4);
    display: flex;
    flex-direction: column;
    gap: var(--s-4);
}

.aside-listing {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: var(--s-3);
    align-items: center;
}

.aside-listing__thumb {
    width: 88px;
    height: 90px;
    border-radius: var(--radius-md);
    background: var(--bg-muted) center / cover no-repeat;
    flex-shrink: 0;
}

.aside-listing__body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.aside-listing__price {
    font-size: 16px;
    font-weight: var(--w-bold);
    color: var(--fg-1);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.aside-listing__title {
    font-size: 12px;
    line-height: 1.4;
    color: var(--fg-1);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.aside-listing__meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--fg-3);
    margin-top: 2px;
}

    .aside-listing__meta svg {
        width: 14px;
        height: 14px;
    }

/* RSS block — matches aside-popular layout on desktop, blog-card on mobile */
.aside-card.aside-rss {
    background: var(--bg-canvas);
    border: 1px solid var(--border-1);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    padding: var(--s-4);
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
}

.aside-rss__head {
    font-size: 13px;
    font-weight: var(--w-bold);
    color: var(--fg-1);
    letter-spacing: 0.02em;
}

.aside-rss__strip {
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
}

.aside-rss__item {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: var(--s-3);
    align-items: center;
    color: var(--fg-1);
    text-decoration: none;
}

.aside-rss__thumb {
    width: 88px;
    height: 60px;
    border-radius: var(--radius-md);
    background-color: var(--bg-muted);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    flex-shrink: 0;
}

.aside-rss__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.aside-rss__title {
    font-size: 12px;
    line-height: 1.35;
    font-weight: var(--w-medium);
    color: var(--fg-1);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.aside-rss__price {
    font-size: 13px;
    font-weight: var(--w-bold);
    color: var(--fg-1);
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Ad slot card */

/* ============================================================
   Article page
   ============================================================ */
.blog-article {
    padding: 0 0 var(--s-16);
}

/* Left column: stack hero card on top of article card */
.article-main-col {
    display: flex;
    flex-direction: column;
    gap: var(--s-4);
    min-width: 0;
}

.article-main {
    background: var(--bg-canvas);
    border: 1px solid var(--border-1);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--s-8);
}

/* Hero is a standalone card, same chrome as article-main.
   Aspect-ratio matches the source image (1200×625) to prevent crop. */
.article-hero {
    width: 100%;
    background: var(--bg-canvas);
    border: 1px solid var(--border-1);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    aspect-ratio: 1200 / 625;
}

    .article-hero img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

.article-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--aside-width);
    gap: var(--layout-gap);
    align-items: start;
}

.article-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-4);
    margin-bottom: var(--s-6);
}

.article-toolbar__meta {
    display: inline-flex;
    align-items: center;
    gap: var(--s-3);
    color: var(--fg-2);
    font-size: 12px;
    font-weight: var(--w-medium);
}

    .article-toolbar__meta .blog-meta__divider {
        margin: 0;
    }

.article-toolbar__actions {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
}

.article-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-pill);
    background: var(--bg-muted);
    border: 0;
    color: var(--fg-2);
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

    .article-action:hover {
        background: #EAEBEC;
        color: var(--fg-1);
    }

    .article-action svg {
        width: 18px;
        height: 18px;
    }

.article-title {
    margin: 0 0 var(--s-6);
    font-size: 30px;
    line-height: 1.25;
    font-weight: var(--w-bold);
    letter-spacing: -0.005em;
    color: var(--fg-1);
    text-wrap: balance;
}

.article-body {
    font-size: 15px;
    line-height: 1.7;
    color: var(--fg-2);
}

    .article-body p {
        margin: 0 0 var(--s-4) !important;
        margin-top: 0 !important;
        margin-left: 0 !important;
        line-height: inherit !important;
        text-wrap: pretty;
    }

    .article-body h2,
    .article-body h3,
    .article-body h4 {
        color: var(--fg-1);
        margin: var(--s-8) 0 var(--s-3);
        font-weight: var(--w-bold);
        line-height: 1.3;
    }

    .article-body h2 {
        font-size: 22px;
    }

    .article-body h3 {
        font-size: 18px;
    }

    .article-body h4 {
        font-size: 16px;
    }

    .article-body a {
        color: var(--primary-500);
        text-decoration: underline;
        text-underline-offset: 2px;
    }

        .article-body a:hover {
            color: var(--primary-600);
        }

    .article-body strong, .article-body b {
        color: var(--fg-1);
        font-weight: var(--w-bold);
    }

    .article-body ul,
    .article-body ol {
        margin: 0 0 var(--s-4);
        padding-left: var(--s-5);
        padding-inline-start: var(--s-5) !important;
    }

    .article-body li {
        margin-bottom: var(--s-2);
    }

    .article-body ul li::marker {
        color: var(--primary-500);
    }

    .article-body img {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        border-radius: var(--radius-md);
        margin: var(--s-5) 0;
    }

    .article-body span[style*="display:inline-block"],
    .article-body span[style*="display: inline-block"] {
        width: 100% !important;
        height: auto !important;
    }

    .article-body blockquote {
        margin: var(--s-5) 0;
        padding: var(--s-3) var(--s-5);
        border-left: 3px solid var(--primary-500);
        background: var(--primary-50);
        color: var(--fg-1);
        font-size: 16px;
        border-radius: 0 var(--radius-md) var(--radius-md) 0;
    }

    .article-body table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

/* Author footer */
.article-author {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-4);
    margin-top: var(--s-10);
    padding-top: var(--s-5);
    border-top: 1px solid var(--border-1);
    flex-wrap: wrap;
}

.article-author__person {
    display: flex;
    align-items: center;
    gap: var(--s-3);
}

.article-author__avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-pill);
    background: var(--bg-muted) center / cover no-repeat;
    flex-shrink: 0;
}

.article-author__label {
    font-size: 12px;
    color: var(--fg-3);
    line-height: 1.3;
}

.article-author__name {
    font-size: 14px;
    font-weight: var(--w-bold);
    color: var(--fg-1);
    line-height: 1.3;
    margin-top: 2px;
}

.article-author__date {
    font-size: 12px;
    font-weight: var(--w-medium);
    color: var(--fg-3);
    letter-spacing: 0.02em;
}

/* ============================================================
   Related articles (under article main)
   ============================================================ */
.related {
    margin-top: var(--s-12);
}

/* ============================================================
   Related articles — slider variant
   Add these rules to blog.css (after the existing .related block)
   ============================================================ */

/* ---- Section header: title + arrow buttons on the same row ---- */
.related__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--s-5);
}

/* ---- Arrow buttons ---- */
.related-slider__nav {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    flex-shrink: 0;
}

.related-slider__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-pill);
    background: var(--bg-canvas);
    border: 1px solid var(--border-2);
    color: var(--fg-2);
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
    flex-shrink: 0;
}

    .related-slider__btn:hover:not(:disabled) {
        background: var(--bg-muted);
        border-color: var(--border-strong);
        color: var(--fg-1);
    }

    .related-slider__btn:disabled {
        opacity: 0.35;
        cursor: default;
        pointer-events: none;
    }

    .related-slider__btn svg {
        width: 18px;
        height: 18px;
    }

/* ---- Slider track wrapper: clips overflow ---- */
.related-slider__wrapper {
    overflow: hidden;
}

/* ---- Track: flex row, no wrap, smooth slide ---- */
.related-slider__track {
    display: flex;
    gap: var(--s-5);
    transition: transform .35s cubic-bezier(.4, 0, .2, 1);
    will-change: transform;
}

    /* ---- Each card: fixed portion of visible width ---- */
    .related-slider__track .related-card {
        /* Desktop: 3 visible, 2 gaps of --s-5 (20px each) */
        flex: 0 0 calc((100% - var(--s-5) * 2) / 3);
        min-width: 0;
        text-decoration: none;
    }

/* ---- Card internals (same tokens as existing .related-card) ---- */
.related-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-canvas);
    border: 1px solid var(--border-1);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    cursor: pointer;
}

    .related-card:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
        border-color: var(--border-strong);
    }

.related-card__media {
    width: 100%;
    aspect-ratio: 19 / 10;
    overflow: hidden;
    background: var(--bg-muted);
}

    .related-card__media img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        transition: transform .3s ease;
    }

.related-card:hover .related-card__media img {
    transform: scale(1.03);
}

.related-card__body {
    padding: var(--s-4);
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
    flex: 1;
}

.related-card__title {
    margin: 0;
    font-size: 15px;
    line-height: 1.4;
    font-weight: var(--w-bold);
    color: var(--fg-1);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-wrap: pretty;
}

.related-card__meta {
    display: inline-flex;
    align-items: center;
    gap: var(--s-3);
    font-size: 11px;
    color: var(--fg-3);
    margin-top: auto;
    flex-wrap: wrap;
}

    .related-card__meta .blog-meta__item {
        font-size: 11px;
        color: var(--fg-3);
    }

    .related-card__meta svg {
        width: 14px;
        height: 14px;
    }

/* ============================================================
   Responsive
   ============================================================ */

/* Tablet: 2 cards visible, arrows still shown */
@media (max-width: 1023px) and (min-width: 640px) {
    .related-slider__track .related-card {
        flex: 0 0 calc((100% - var(--s-5)) / 2);
    }
}

/* Mobile: horizontal swipe, arrows hidden, show ~1.2 cards */
@media (max-width: 639px) {
    /* Hide arrow buttons on mobile — swipe only */
    .related-slider__nav {
        display: none;
    }

    /* Let the wrapper scroll natively */
    .related-slider__wrapper {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        scroll-snap-type: x mandatory;
    }

        .related-slider__wrapper::-webkit-scrollbar {
            display: none;
        }

    /* Track: no JS transform on mobile, just flex scroll */
    .related-slider__track {
        transform: none !important;
        transition: none;
        padding-bottom: 4px; /* prevents shadow clip */
    }

        /* Show ~1.2 cards so user knows it scrolls */
        .related-slider__track .related-card {
            flex: 0 0 82vw;
            scroll-snap-align: start;
        }
}

.related__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: var(--s-5);
}

.related__title {
    margin: 0;
    font-size: 22px;
    font-weight: var(--w-bold);
    color: var(--fg-1);
}

.related__more {
    font-size: 13px;
    font-weight: var(--w-medium);
    color: var(--primary-500);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

    .related__more:hover {
        color: var(--primary-600);
    }

    .related__more svg {
        width: 16px;
        height: 16px;
    }

.related__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--s-5);
}

.related-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-canvas);
    border: 1px solid var(--border-1);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

    .related-card:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-md);
        border-color: var(--border-strong);
    }

.related-card__media {
    width: 100%;
    aspect-ratio: 19 / 10;
    background: var(--bg-muted) center / cover no-repeat;
}

.related-card__body {
    padding: var(--s-4);
    display: flex;
    flex-direction: column;
    gap: var(--s-3);
    flex: 1;
}

.related-card__title {
    margin: 0;
    font-size: 15px;
    line-height: 1.4;
    font-weight: var(--w-bold);
    color: var(--fg-1);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-wrap: pretty;
}

.related-card__meta {
    display: inline-flex;
    align-items: center;
    gap: var(--s-3);
    font-size: 11px;
    color: var(--fg-3);
    margin-top: auto;
}

    .related-card__meta .blog-meta__item {
        font-size: 11px;
    }

    .related-card__meta svg {
        width: 14px;
        height: 14px;
    }

/* ---------- Blog-page header overrides ---------- */

/* Base desktop: switch from grid to flex for blog pages */
#header_block .topHeader {
    display: flex !important;
    justify-content: space-between !important;
    grid-template-columns: none !important;
}

#header_block .topHeader,
#header_block .topHdrContainer {
    align-items: center;
}

/* Mid-size desktop: responsive.css @media (min-width:761px) and (max-width:1200px)
   overrides height to 135px + align-items:flex-start — undo both for blog */
@media (min-width: 761px) and (max-width: 1200px) {
    #header_block .topHeader {
        height: auto;
        align-items: center;
    }
}

/* Mobile: responsive.css @media (max-width:768px)
   overrides height to 135px + align-items:flex-start — undo both for blog */
@media (max-width: 768px) {
    #header_block .topHeader {
        height: auto;
        align-items: center;
    }
}

/* ---------- Rubric logo ---------- */
.rubric-logo img {
    margin: 0;
}

/* ============================================================
   Static Banners
   ============================================================ */
.static-banners {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 16px;
    border-radius: 12px;
    overflow: hidden;
}

.static-banners__item {
    display: block;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
}

.static-banners__item img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
}

@media (max-width: 768px) {
    .static-banners {
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        border-radius: 0;
        scrollbar-width: none;
        gap: 12px;
        padding-right: 16px;
        margin-left: calc(-1 * var(--container-gutter, 16px));
        margin-right: calc(-1 * var(--container-gutter, 16px));
        padding-left: var(--container-gutter, 16px);
    }

    .static-banners::-webkit-scrollbar {
        display: none;
    }

    .static-banners__item {
        min-width: 70%;
        flex-shrink: 0;
        scroll-snap-align: start;
    }
}