/* ==========================================================================
   Virasat blog listing (home.php, inc/virasat-blog.php)
   Figma "Hamari Virasat" > "Blog · Desktop redesign" (node 324:367)
   https://www.figma.com/design/xWpHAcjUfuhMtFMoaGrffr/Hamari-Virasat?node-id=324-367

   Plain CSS, no build step. Loaded only on the posts page, after virasat-tokens.css and
   virasat-home.css (the header and footer come from there). Lengths are the
   1440px Figma sizes; the layout is fluid, with a 1200px content column.
   Breakpoints: mobile < 768px, tablet 768-1023px, desktop >= 1024px.

   Tokens: the Figma frame itself only uses the variables color/cta-yellow and space/12; every other
   colour in it is a literal. Where a literal is the same as, or within a shade of, a system token
   this file uses the token (ink, body, yellow, radii, Button/S). The remaining --vb-* colours
   (page, surface, bar, line, accent, hero, pill-on, cream) are blog-specific values from the frame
   and stay local. Note this page is not inside .vh-home, so the radius, space and type tokens keep
   their plain pixel values here (the --vh-u scaling only applies inside .vh-home).
   ========================================================================== */

.vb-blog {
    --vb-page: #f8f4ea;
    --vb-surface: #fffdf7;
    --vb-bar: #fffbf2;
    --vb-line: #e5d9c5;
    --vb-ink: var(--vh-ink);            /* text/heading (Figma frame: #20221b) */
    --vb-text: var(--vh-body);          /* text/body (Figma frame: #605545) */
    --vb-accent: #774817;
    --vb-hero: #151b16;
    --vb-pill-on: #27372c;
    --vb-cream: #fff7e7;
    --vb-gold: var(--vh-yellow);        /* color/cta-yellow (Figma frame: #ffd260) */
    --vb-gutter: 24px;
    --vb-max: 1200px;

    background: var(--vb-page);
    color: var(--vb-ink);
    font-family: var(--vh-sans);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.vb-blog *,
.vb-blog *::before,
.vb-blog *::after {
    box-sizing: border-box;
}

.vb-blog img {
    max-width: 100%;
}

.vb-blog ul,
.vb-blog ol {
    margin: 0;
    padding: 0;
    list-style: none;
}

.vb-blog li {
    margin: 0;
}

.vb-blog h1,
.vb-blog h2,
.vb-blog h3,
.vb-blog p {
    margin: 0;
}

.vb-blog a {
    text-decoration: none;
}

.vb-blog :focus-visible {
    outline: 2px solid var(--vb-accent);
    outline-offset: 2px;
}

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

/* -- 02 · Blog introduction --------------------------------------------- */
.vb-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: var(--vb-hero);
}

.vb-hero__art {
    position: absolute;
    z-index: -2;
    top: 0;
    right: 0;
    width: 64%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 50%;
}

/* Artwork gradient: solid at the left edge, clear from ~58% of the artwork. */
.vb-hero::after {
    content: "";
    position: absolute;
    z-index: -1;
    top: 0;
    right: 0;
    width: 64%;
    height: 100%;
    background: linear-gradient(90deg,
        rgb(21, 27, 22) 0%,
        rgba(21, 27, 22, .98) 9.2%,
        rgba(21, 27, 22, .647) 22.2%,
        rgba(21, 27, 22, .094) 40.5%,
        rgba(21, 27, 22, 0) 57.9%,
        rgba(21, 27, 22, 0) 100%);
}

.vb-hero__inner {
    position: relative;
    max-width: calc(var(--vb-max) + 2 * var(--vb-gutter));
    margin: 0 auto;
    padding: 24px var(--vb-gutter) 48px;
}

.vb-breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: #e1ceaa;
    font-size: 14px;
    line-height: 19px;
}

.vb-breadcrumb li + li::before {
    content: "/";
    margin-right: 8px;
}

.vb-breadcrumb a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: #e1ceaa;
}

.vb-breadcrumb a:hover {
    color: var(--vb-cream);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.vb-blog .vb-hero__title {
    max-width: 620px;
    margin-top: 24px;
    color: var(--vb-cream);
    font-family: var(--vh-display);
    font-size: 40px;
    font-weight: 800;
    line-height: 1.3;
}

.vb-blog .vb-hero__title--long {
    font-size: 32px;
}

.vb-hero__lead {
    max-width: 520px;
    margin-top: 12px;
    color: #f1e0c2;
    font-size: 17px;
    line-height: 1.6;
}

.vb-search {
    position: relative;
    display: flex;
    align-items: stretch;
    max-width: 485px;
    height: 56px;
    margin-top: 32px;
    overflow: hidden;
    border-radius: var(--vh-radius-sm);
    background: var(--vb-surface);
}

.vb-search:focus-within {
    outline: 2px solid var(--vb-gold);
    outline-offset: 2px;
}

.vb-search__icon {
    position: absolute;
    top: 0;
    left: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 100%;
    pointer-events: none;
}

.vb-blog .vb-search__input {
    flex: 1;
    min-width: 0;
    height: 100%;
    margin: 0;
    padding: 0 12px 0 49px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: var(--vb-ink);
    font: 400 15px/23px var(--vh-sans);
}

.vb-blog .vb-search__input::placeholder {
    color: var(--vb-text);
    opacity: 1;
}

.vb-blog .vb-search__input:focus {
    outline: 0;
    box-shadow: none;
}

.vb-blog .vb-search__submit {
    flex: none;
    width: 84px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: var(--vb-gold);
    color: var(--vb-ink);
    font: 700 15px/21px var(--vh-sans);
    cursor: pointer;
}

.vb-blog .vb-search__submit:hover {
    background: #ffc43d;
}

/* -- 03 · Topics and language ------------------------------------------- */
.vb-topics {
    border-bottom: 1px solid var(--vb-line);
    background: var(--vb-bar);
}

.vb-topics__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    max-width: calc(var(--vb-max) + 2 * var(--vb-gutter));
    margin: 0 auto;
    padding: 16px var(--vb-gutter);
}

.vb-topics__list {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 11px;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.vb-topics__list::-webkit-scrollbar {
    display: none;
}

.vb-topics__list > li {
    flex: none;
}

.vb-blog .vb-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 44px;
    padding: 0 16px;
    border: 1px solid var(--vb-line);
    border-radius: var(--vh-radius-pill);
    background: var(--vb-surface);
    color: var(--vb-ink);
    font: 700 15px/21px var(--vh-sans);
    white-space: nowrap;
    cursor: pointer;
}

.vb-blog .vb-pill:hover {
    border-color: var(--vb-pill-on);
}

.vb-blog .vb-pill.is-current {
    border-color: var(--vb-pill-on);
    background: var(--vb-pill-on);
    color: var(--vb-cream);
}

/* "All topics" menu: a <details> element, so it works without JavaScript. */
.vb-more {
    position: relative;
}

.vb-more__details > summary {
    list-style: none;
}

.vb-more__details > summary::-webkit-details-marker {
    display: none;
}

.vb-pill--more::after {
    content: "";
    width: 20px;
    height: 20px;
    margin-right: -6px;
    background: url("../../img/virasat/blog-icon-chevron.svg") center no-repeat;
}

.vb-more__menu {
    position: absolute;
    z-index: 5;
    top: calc(100% + 8px);
    left: 0;
    min-width: 200px;
    max-height: 320px;
    padding: 8px;
    overflow-y: auto;
    border: 1px solid var(--vb-line);
    border-radius: var(--vh-radius-md);
    background: var(--vb-surface);
    box-shadow: 0 12px 28px rgba(33, 25, 15, .14);
}

.vb-more__menu a {
    display: block;
    padding: 10px 12px;
    border-radius: var(--vh-radius-sm);
    color: var(--vb-ink);
    font: 600 14px/19px var(--vh-sans);
}

.vb-more__menu a:hover {
    background: var(--vb-page);
    color: var(--vb-accent);
}

.vb-lang {
    display: flex;
    flex: none;
    align-items: center;
    padding-left: 24px;
    border-left: 1px solid var(--vb-line);
    color: var(--vb-text);
    font: 700 14px/19px var(--vh-sans);
}

.vb-lang li + li::before {
    content: "/";
    margin: 0 12px;
    font-weight: 400;
}

.vb-lang a {
    display: inline-flex;
    align-items: center;
    min-width: 44px;
    min-height: 44px;
    justify-content: center;
    color: var(--vb-text);
}

.vb-lang .is-current a {
    color: var(--vb-accent);
    font-size: 15px;
}

.vb-lang a:hover {
    color: var(--vb-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* -- Sections ------------------------------------------------------------ */
.vb-section {
    max-width: calc(var(--vb-max) + 2 * var(--vb-gutter));
    margin: 0 auto;
    padding: 40px var(--vb-gutter) 0;
}

.vb-latest {
    padding-bottom: 64px;
}

.vb-blog .vb-section__title {
    display: flex;
    align-items: center;
    gap: 18px;
    color: var(--vb-ink);
    font-family: var(--vh-display);
    font-size: 28px;
    font-weight: 800;
    line-height: 1.45;
}

.vb-section__motif {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.vb-featured .vb-section__title {
    margin-bottom: 24px;
}

.vb-section__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.vb-sort {
    display: flex;
    flex: none;
    align-items: center;
}

.vb-blog .vb-sort__select {
    height: 42px;
    margin: 0;
    padding: 0 38px 0 14px;
    border: 1px solid var(--vb-line);
    border-radius: var(--vh-radius-sm);
    background: var(--vb-bar) url("../../img/virasat/blog-icon-chevron.svg") right 10px center no-repeat;
    box-shadow: none;
    color: var(--vb-ink);
    font: 700 14px/19px var(--vh-sans);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.vb-blog .vb-sort__select:hover {
    border-color: var(--vb-accent);
}

.vb-blog .vb-sort__apply {
    height: 42px;
    margin: 0 0 0 8px;
    padding: 0 16px;
    border: 1px solid var(--vb-line);
    border-radius: var(--vh-radius-sm);
    background: var(--vb-bar);
    color: var(--vb-ink);
    font: 700 14px/19px var(--vh-sans);
}

/* -- Article card ---------------------------------------------------------- */
.vb-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--vb-line);
    border-radius: var(--vh-radius-md);
    background: var(--vb-surface);
    transition: box-shadow .2s ease, border-color .2s ease;
}

.vb-card:hover,
.vb-card:focus-within {
    border-color: var(--vh-gold-400);
    box-shadow: 0 8px 22px rgba(33, 25, 15, .1);
}

.vb-card__media {
    flex: none;
    background: #efe6d3;
}

.vb-card__img,
.vb-card__placeholder {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.vb-card__placeholder {
    background: #efe6d3 url("../../img/virasat/logo.png") center / 56px 56px no-repeat;
    opacity: .6;
}

.vb-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 17px 20px 20px;
}

.vb-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 9px;
    color: var(--vb-text);
    font-size: 13px;
    line-height: 18px;
}

.virasat-views {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.virasat-views__icon {
    flex: none;
}

.vb-card__category {
    color: var(--vb-accent);
    font-weight: 700;
}

.vb-card__dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #a27f52;
}

.vb-blog .vb-card__title {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    color: var(--vb-ink);
    font-family: var(--vh-display);
    font-size: 21px;
    font-weight: 800;
    line-height: 1.4;
}

.vb-blog .vb-card__title a {
    color: inherit;
}

.vb-blog .vb-card__title a:hover {
    color: var(--vb-accent);
}

/* The title link covers the whole card, so the entire card is one click target. */
.vb-card__title a::after {
    content: "";
    position: absolute;
    inset: 0;
}

.vb-card__excerpt {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    color: var(--vb-text);
    font-size: 14px;
    line-height: 21px;
}

.vb-card__more {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-top: auto;
    padding-top: 10px;
    color: var(--vb-accent);
    font: 700 14px/19px var(--vh-sans);
}

.vb-card__more::after {
    content: "";
    flex: none;
    width: 20px;
    height: 20px;
    background: url("../../img/virasat/blog-icon-arrow.svg") center no-repeat;
}

.vb-card:hover .vb-card__more {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Featured variant: image beside the text on desktop. */
.vb-card--feature .vb-card__img,
.vb-card--feature .vb-card__placeholder {
    aspect-ratio: 16 / 10;
}

.vb-card--feature .vb-card__body {
    gap: 12px;
    padding: 24px 22px 28px;
}

.vb-blog .vb-card--feature .vb-card__title {
    -webkit-line-clamp: 4;
    line-clamp: 4;
    font-size: 26px;
    line-height: 1.32;
}

.vb-card--feature .vb-card__excerpt {
    -webkit-line-clamp: 4;
    line-clamp: 4;
    font-size: 16px;
    line-height: 27px;
}

/* Button/S, solid: the Figma "Button" component (CTA yellow pill, 44px, trailing arrow). */
.vb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--vh-space-12);
    min-height: 44px;
    padding: 0 20px;
    border-radius: var(--vh-radius-pill);
    background: var(--vh-yellow);
    color: #21190f;
    font: var(--vh-font-button-s);
    white-space: nowrap;
    transition: background-color .15s ease, box-shadow .15s ease;
}

.vb-btn::after {
    content: "";
    flex: none;
    width: 20px;
    height: 20px;
    background: currentColor;
    -webkit-mask: url("../../img/virasat/ico-arrow-right.svg") center / contain no-repeat;
    mask: url("../../img/virasat/ico-arrow-right.svg") center / contain no-repeat;
}

.vb-card:hover .vb-btn {
    background: #ffc43d;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .22);
}

.vb-card__button {
    margin-top: 12px;
}

/* -- Grid ---------------------------------------------------------------------- */
.vb-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
}

.vb-empty {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 32px 0 16px;
    color: var(--vb-text);
}

.vb-blog .vb-empty__link {
    color: var(--vb-accent);
    font: 700 15px/21px var(--vh-sans);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* -- Pagination ------------------------------------------------------------------ */
.vb-pagination {
    margin-top: 40px;
}

.vb-pagination__list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

.vb-blog .vb-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-width: 44px;
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--vb-line);
    border-radius: var(--vh-radius-sm);
    background: var(--vb-surface);
    color: var(--vb-ink);
    font: 700 14px/19px var(--vh-sans);
}

.vb-blog .vb-pagination a.page-numbers:hover {
    border-color: var(--vb-pill-on);
}

.vb-blog .vb-pagination .page-numbers.current {
    border-color: var(--vb-pill-on);
    background: var(--vb-pill-on);
    color: var(--vb-cream);
}

.vb-blog .vb-pagination .page-numbers.dots {
    min-width: 0;
}

.vb-blog .vb-pagination .page-numbers.next::after,
.vb-blog .vb-pagination .page-numbers.prev::before {
    content: "";
    flex: none;
    width: 20px;
    height: 20px;
    background: url("../../img/virasat/blog-icon-arrow.svg") center no-repeat;
}

.vb-blog .vb-pagination .page-numbers.prev::before {
    transform: scaleX(-1);
}

/* -- Tablet ------------------------------------------------------------------------ */
@media (min-width: 768px) {
    .vb-hero__inner {
        padding-top: 32px;
        padding-bottom: 64px;
    }

    .vb-blog .vb-hero__title {
        font-size: 52px;
    }

    .vb-blog .vb-hero__title--long {
        font-size: 40px;
    }

    .vb-hero__lead {
        font-size: 18px;
        line-height: 29px;
    }

    .vb-section {
        padding-top: 50px;
    }

    .vb-blog .vb-section__title {
        font-size: 34px;
    }

    .vb-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* -- Desktop ------------------------------------------------------------------------ */
@media (min-width: 1024px) {
    .vb-hero {
        min-height: 402px;
    }

    .vb-hero__inner {
        padding-top: 40px;
        padding-bottom: 76px;
    }

    .vb-blog .vb-hero__title {
        font-size: 68px;
        line-height: 98px;
    }

    .vb-blog .vb-hero__title--long {
        font-size: 48px;
        line-height: 1.4;
    }

    .vb-blog .vb-section__title {
        font-size: 37px;
    }

    .vb-latest .vb-section__title {
        font-size: 38px;
    }

    .vb-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 26px 24px;
    }

    .vb-blog .vb-card__title {
        font-size: 23px;
        line-height: 31px;
    }

    .vb-card--feature {
        flex-direction: row;
        align-items: stretch;
        min-height: 365px;
    }

    .vb-card--feature .vb-card__media {
        flex: 0 0 58.667%;
    }

    .vb-card--feature .vb-card__img,
    .vb-card--feature .vb-card__placeholder {
        height: 100%;
        aspect-ratio: auto;
    }

    .vb-card--feature .vb-card__body {
        justify-content: center;
        padding: 40px 38px;
    }

    .vb-blog .vb-card--feature .vb-card__title {
        font-size: 32px;
        line-height: 42px;
    }
}

/* -- Mobile ------------------------------------------------------------------------- */
@media (max-width: 767px) {
    .vb-hero__art,
    .vb-hero::after {
        width: 100%;
        opacity: .5;
    }

    .vb-hero::after {
        opacity: 1;
        background: linear-gradient(180deg, rgba(21, 27, 22, .9) 0%, rgba(21, 27, 22, .65) 100%);
    }

    .vb-lang {
        display: none;
    }

    .vb-section__head {
        align-items: flex-start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .vb-card {
        transition: none;
    }
}
