/* Sahisa Blog Grid — all selectors are scoped to .sahisa-blog-grid */
.sahisa-blog-grid,
.sahisa-blog-grid * {
    box-sizing: border-box;
}

.sahisa-blog-grid {
    --sbg-text: #101814;
    --sbg-muted: #6d756f;
    --sbg-line: rgba(17, 35, 26, .09);
    --sbg-surface: rgba(255, 255, 255, .74);
    --sbg-surface-solid: #fff;
    --sbg-accent: #244c3c;
    --sbg-accent-soft: rgba(36, 76, 60, .09);
    --sbg-radius: 24px;
    --sbg-gap: 22px;
    width: 100%;
    color: var(--sbg-text);
    font-family: inherit;
    text-align: right;
}

.sahisa-blog-grid a {
    color: inherit;
    text-decoration: none;
}

.sbg-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 0 26px;
}

.sbg-header__title {
    margin: 0;
    font: inherit;
    font-size: clamp(24px, 2.4vw, 36px);
    font-weight: 800;
    line-height: 1.45;
    letter-spacing: -.02em;
}

.sbg-header__subtitle {
    max-width: 760px;
    margin: 0;
    color: var(--sbg-muted);
    font-size: 15px;
    line-height: 2;
}

.sbg-grid {
    display: grid;
    grid-template-columns: repeat(var(--sbg-columns, 3), minmax(0, 1fr));
    gap: var(--sbg-gap);
    align-items: stretch;
}

.sbg-card {
    position: relative;
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--sbg-line);
    border-radius: var(--sbg-radius);
    background: var(--sbg-surface);
    box-shadow: 0 12px 34px rgba(22, 36, 28, .055);
    transition: transform .32s ease, box-shadow .32s ease, border-color .32s ease;
    isolation: isolate;
}

.sahisa-blog-grid--glass .sbg-card {
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
}

.sbg-card:hover {
    transform: translateY(-5px);
    border-color: rgba(36, 76, 60, .18);
    box-shadow: 0 18px 46px rgba(22, 36, 28, .095);
}

.sbg-card__media {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: #eef1ef;
}

.sbg-card__image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform .65s cubic-bezier(.2,.7,.2,1);
}

.sbg-card:hover .sbg-card__image {
    transform: scale(1.035);
}

.sbg-card__placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: rgba(36, 76, 60, .34);
    background: linear-gradient(145deg, #f4f6f5, #e8eeeb);
}

.sbg-card__placeholder svg {
    width: 52px;
    height: 52px;
    fill: currentColor;
}


.sbg-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 20px 18px;
}

.sbg-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    min-height: 18px;
    margin-bottom: 11px;
    color: var(--sbg-muted);
    font-size: 11.5px;
    line-height: 1.7;
}

.sbg-card__dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: currentColor;
    opacity: .55;
}

.sbg-card__title {
    width: 100%;
    margin: 0;
    font: inherit;
    font-size: clamp(17px, 1.55vw, 20px);
    font-weight: 800;
    line-height: 1.8;
    letter-spacing: -.015em;
}

.sbg-card__title a {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.sbg-card__excerpt {
    display: -webkit-box;
    width: 100%;
    margin: 10px 0 0;
    overflow: hidden;
    color: var(--sbg-muted);
    font-size: 13px;
    line-height: 2;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.sbg-card__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 18px;
    color: var(--sbg-accent) !important;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.4;
}

.sbg-card__arrow {
    display: inline-block;
    font-size: 17px;
    line-height: 1;
    transition: transform .22s ease;
}

.sbg-card__link:hover .sbg-card__arrow {
    transform: translateX(-4px);
}

.sbg-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
}

.sbg-load-more {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 50px;
    padding: 0 24px;
    border: 1px solid rgba(36, 76, 60, .14);
    border-radius: 999px;
    outline: none;
    background: var(--sbg-surface-solid);
    box-shadow: 0 8px 24px rgba(22,36,28,.055);
    color: var(--sbg-accent);
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: transform .22s ease, box-shadow .22s ease, background .22s ease;
}

.sbg-load-more:hover {
    transform: translateY(-2px);
    background: var(--sbg-accent-soft);
    box-shadow: 0 12px 30px rgba(22,36,28,.08);
}

.sbg-load-more:disabled {
    opacity: .56;
    cursor: wait;
    transform: none;
}

.sbg-load-more__icon {
    font-size: 16px;
    line-height: 1;
}

.sbg-status,
.sbg-empty {
    color: var(--sbg-muted);
    font-size: 12px;
    line-height: 1.8;
}

.sbg-empty {
    padding: 28px;
    border: 1px dashed var(--sbg-line);
    border-radius: var(--sbg-radius);
    text-align: center;
}

/* Minimal variation */
.sahisa-blog-grid--minimal .sbg-card {
    border-radius: 18px;
    background: #fff;
    box-shadow: none;
}

.sahisa-blog-grid--minimal .sbg-card:hover {
    box-shadow: 0 12px 32px rgba(22,36,28,.065);
}

/* Editorial variation */
.sahisa-blog-grid--editorial .sbg-card {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.sahisa-blog-grid--editorial .sbg-card:hover {
    transform: none;
    box-shadow: none;
}

.sahisa-blog-grid--editorial .sbg-card__media {
    border-radius: 20px;
}

.sahisa-blog-grid--editorial .sbg-card__body {
    padding: 17px 2px 4px;
}

/* Tablet */
@media (max-width: 1024px) {
    .sbg-grid {
        grid-template-columns: repeat(min(2, var(--sbg-columns, 3)), minmax(0, 1fr));
        gap: 18px;
    }
}

/* Mobile: one-row horizontal swipe carousel instead of stacking cards vertically. */
@media (max-width: 680px) {
    .sahisa-blog-grid {
        --sbg-gap: 13px;
        --sbg-radius: 20px;
        overflow: visible;
    }

    .sbg-header {
        margin-bottom: 18px;
    }

    .sbg-header__title {
        font-size: 23px;
    }

    .sbg-header__subtitle {
        font-size: 13px;
        line-height: 1.9;
    }

    .sbg-grid {
        display: flex;
        grid-template-columns: none;
        gap: var(--sbg-gap);
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 2px 2px 14px;
        scroll-snap-type: x mandatory;
        scroll-padding-inline: 2px;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-inline: contain;
        scrollbar-width: none;
        touch-action: pan-x pan-y;
    }

    .sbg-grid::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    .sbg-card {
        flex: 0 0 clamp(265px, 82vw, 330px);
        width: clamp(265px, 82vw, 330px);
        max-width: calc(100% - 24px);
        scroll-snap-align: start;
        scroll-snap-stop: always;
    }

    .sbg-card:hover {
        transform: none;
    }

    .sbg-card__media {
        aspect-ratio: 4 / 3;
    }

    .sbg-card__body {
        padding: 15px 15px 14px;
    }

    .sbg-card__meta {
        gap: 5px;
        margin-bottom: 8px;
        font-size: 10px;
    }

    .sbg-card__title {
        font-size: 15px;
        line-height: 1.75;
    }

    .sbg-card__excerpt {
        display: none;
    }

    .sbg-card__link {
        gap: 5px;
        padding-top: 13px;
        font-size: 11.5px;
    }

    .sbg-card__arrow {
        font-size: 14px;
    }

    .sbg-footer {
        margin-top: 18px;
    }

    .sbg-load-more {
        width: 100%;
        min-height: 48px;
    }
}

/* Extra-small phones: keep the horizontal slider, just size cards to the screen. */
@media (max-width: 390px) {
    .sbg-card {
        flex-basis: calc(100vw - 58px);
        width: calc(100vw - 58px);
        max-width: calc(100% - 18px);
    }

    .sbg-card__body {
        padding: 14px;
    }

    .sbg-card__title {
        font-size: 14.5px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sbg-card,
    .sbg-card__image,
    .sbg-card__arrow,
    .sbg-load-more {
        transition: none !important;
    }
}

/* =========================================================
   SAHISA BLOG PAGE — [sahisa_blog_page]
   Separate scope: does not alter the existing blog-grid shortcode.
========================================================= */
.sahisa-blog-page,
.sahisa-blog-page * {
    box-sizing: border-box;
}

.sahisa-blog-page {
    --sbp-text: #171b19;
    --sbp-muted: #777d79;
    --sbp-accent: #244c3c;
    --sbp-line: rgba(22, 31, 27, .09);
    --sbp-soft: #f5f7f5;
    --sbp-card: #ffffff;
    --sbp-radius: 24px;
    width: 100%;
    color: var(--sbp-text);
    font-family: inherit;
    text-align: right;
}

.sahisa-blog-page a {
    color: inherit;
    text-decoration: none;
}

.sbp-latest {
    margin-bottom: clamp(44px, 6vw, 76px);
}

.sbp-section-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.sbp-section-head--slider {
    align-items: center;
}

.sbp-section-kicker {
    display: block;
    margin-bottom: 5px;
    color: var(--sbp-accent);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.7;
}

.sbp-section-title {
    margin: 0;
    font: inherit;
    font-size: clamp(24px, 2.5vw, 38px);
    font-weight: 900;
    line-height: 1.4;
    letter-spacing: -.025em;
}

.sbp-section-intro {
    max-width: 680px;
    margin: 9px 0 0;
    color: var(--sbp-muted);
    font-size: 14px;
    line-height: 2;
}

.sbp-post-count {
    flex: 0 0 auto;
    padding: 8px 13px;
    border: 1px solid var(--sbp-line);
    border-radius: 999px;
    background: rgba(255,255,255,.72);
    color: var(--sbp-muted);
    font-size: 11.5px;
    font-weight: 700;
    white-space: nowrap;
}

.sbp-carousel-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    direction: ltr;
}

.sbp-nav {
    appearance: none;
    width: 44px;
    height: 44px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--sbp-line);
    border-radius: 50%;
    outline: none;
    background: #fff;
    color: var(--sbp-text);
    font: inherit;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    transition: transform .2s ease, background .2s ease, border-color .2s ease;
}

.sbp-nav:hover {
    transform: translateY(-2px);
    border-color: rgba(36,76,60,.22);
    background: #f6f9f7;
}

.sbp-nav:focus-visible,
.sbp-carousel__track:focus-visible {
    outline: 2px solid rgba(36,76,60,.45);
    outline-offset: 3px;
}

.sbp-carousel {
    position: relative;
    min-width: 0;
}

.sbp-carousel__track {
    display: flex;
    gap: 18px;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 2px 14px;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    overscroll-behavior-inline: contain;
}

.sbp-carousel__track::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.sbp-featured-card {
    flex: 0 0 calc((100% - 36px) / 3);
    min-width: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

.sbp-featured-card__media {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 11;
    border: 1px solid var(--sbp-line);
    border-radius: 28px;
    background: #edf1ee;
    box-shadow: 0 14px 38px rgba(25, 38, 31, .07);
    isolation: isolate;
}

.sbp-featured-card__image,
.sbp-post-card__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sbp-featured-card__image {
    transition: transform .6s cubic-bezier(.2,.7,.2,1);
}

.sbp-featured-card:hover .sbp-featured-card__image {
    transform: scale(1.035);
}

.sbp-featured-card__shade {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(to top, rgba(12,20,16,.82) 0%, rgba(12,20,16,.42) 42%, rgba(12,20,16,.04) 78%);
}

.sbp-featured-card__content {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 22px;
    color: #fff;
}

.sbp-featured-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
    color: rgba(255,255,255,.80);
    font-size: 10.5px;
    line-height: 1.7;
}

.sbp-meta-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: currentColor;
    opacity: .6;
}

.sbp-featured-card__title {
    display: -webkit-box;
    width: 100%;
    overflow: hidden;
    font-size: clamp(17px, 1.5vw, 22px);
    font-weight: 900;
    line-height: 1.7;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.sbp-featured-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 12px;
    font-size: 11.5px;
    font-weight: 800;
}

.sbp-carousel__progress {
    position: relative;
    width: min(220px, 42%);
    height: 3px;
    margin: 2px auto 0;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(36,76,60,.10);
}

.sbp-carousel__progress > span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--sbp-accent);
    transition: width .32s ease;
}

.sbp-archive-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    align-items: stretch;
}

.sbp-post-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--sbp-line);
    border-radius: var(--sbp-radius);
    background: var(--sbp-card);
    box-shadow: 0 10px 30px rgba(24, 35, 29, .045);
    transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease;
}

.sbp-post-card:hover {
    transform: translateY(-4px);
    border-color: rgba(36,76,60,.17);
    box-shadow: 0 16px 38px rgba(24,35,29,.075);
}

.sbp-post-card__media {
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: #eef1ef;
}

.sbp-post-card__image {
    transition: transform .55s ease;
}

.sbp-post-card:hover .sbp-post-card__image {
    transform: scale(1.035);
}

.sbp-image-placeholder {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, #f1f4f2, #e8eeea);
}

.sbp-post-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    padding: 18px 18px 17px;
}

.sbp-post-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 9px;
    color: var(--sbp-muted);
    font-size: 10.5px;
    line-height: 1.7;
}

.sbp-post-card__title {
    width: 100%;
    margin: 0;
    font: inherit;
    font-size: clamp(16px, 1.35vw, 20px);
    font-weight: 850;
    line-height: 1.8;
}

.sbp-post-card__title a {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.sbp-post-card__link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: auto;
    padding-top: 15px;
    color: var(--sbp-accent) !important;
    font-size: 12px;
    font-weight: 850;
}

.sbp-empty {
    padding: 28px;
    border: 1px dashed var(--sbp-line);
    border-radius: var(--sbp-radius);
    color: var(--sbp-muted);
    text-align: center;
}

@media (max-width: 1024px) {
    .sbp-featured-card {
        flex-basis: calc((100% - 18px) / 2);
    }

    .sbp-archive-grid {
        gap: 18px;
    }
}

@media (max-width: 680px) {
    .sahisa-blog-page {
        --sbp-radius: 18px;
    }

    .sbp-latest {
        margin-bottom: 42px;
    }

    .sbp-section-head {
        align-items: center;
        margin-bottom: 16px;
    }

    .sbp-section-kicker {
        margin-bottom: 3px;
        font-size: 10px;
    }

    .sbp-section-title {
        font-size: 23px;
    }

    .sbp-section-intro {
        font-size: 12px;
    }

    .sbp-carousel-controls {
        gap: 6px;
    }

    .sbp-nav {
        width: 39px;
        height: 39px;
        font-size: 16px;
    }

    .sbp-carousel__track {
        gap: 12px;
        padding-bottom: 11px;
    }

    .sbp-featured-card {
        flex: 0 0 min(82vw, 315px);
    }

    .sbp-featured-card__media {
        aspect-ratio: 4 / 3;
        border-radius: 22px;
    }

    .sbp-featured-card__content {
        padding: 16px;
    }

    .sbp-featured-card__meta {
        margin-bottom: 5px;
        font-size: 9px;
    }

    .sbp-featured-card__title {
        font-size: 16px;
        line-height: 1.65;
    }

    .sbp-featured-card__cta {
        margin-top: 8px;
        font-size: 10.5px;
    }

    .sbp-carousel__progress {
        width: 42%;
    }

    /* Requested mobile archive: exactly two columns. */
    .sbp-archive-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 11px;
    }

    .sbp-post-count {
        padding: 6px 9px;
        font-size: 9.5px;
    }

    .sbp-post-card {
        border-radius: 17px;
    }

    .sbp-post-card__media {
        aspect-ratio: 4 / 3;
    }

    .sbp-post-card__body {
        padding: 11px 10px 11px;
    }

    .sbp-post-card__meta {
        gap: 4px;
        margin-bottom: 6px;
        font-size: 8.5px;
    }

    .sbp-post-card__title {
        font-size: 13.5px;
        line-height: 1.72;
    }

    .sbp-post-card__link {
        gap: 4px;
        padding-top: 10px;
        font-size: 10px;
    }
}

@media (max-width: 390px) {
    .sbp-section-title {
        font-size: 21px;
    }

    .sbp-featured-card {
        flex-basis: calc(100vw - 64px);
    }

    .sbp-archive-grid {
        gap: 9px;
    }

    .sbp-post-card__body {
        padding: 10px 9px;
    }

    .sbp-post-card__meta {
        font-size: 8px;
    }

    .sbp-post-card__title {
        font-size: 12.8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sbp-featured-card__image,
    .sbp-post-card,
    .sbp-post-card__image,
    .sbp-nav,
    .sbp-carousel__progress > span {
        transition: none !important;
    }
}

/* Progressive archive loading for [sahisa_blog_page] */
.sbp-progressive-loader {
    display: flex;
    min-height: 58px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
    color: var(--sbp-muted);
    font-size: 11.5px;
    line-height: 1.8;
    text-align: center;
}

.sbp-progressive-loader__spinner {
    display: none;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    border: 2px solid rgba(36, 76, 60, .15);
    border-top-color: var(--sbp-accent);
    border-radius: 50%;
    animation: sbp-spin .72s linear infinite;
}

.sbp-progressive-loader.is-loading .sbp-progressive-loader__spinner {
    display: inline-block;
}

.sbp-progressive-loader__button {
    appearance: none;
    min-height: 42px;
    padding: 0 17px;
    border: 1px solid rgba(36, 76, 60, .14);
    border-radius: 999px;
    background: #fff;
    color: var(--sbp-accent);
    font: inherit;
    font-size: 11.5px;
    font-weight: 800;
    cursor: pointer;
}

.sbp-progressive-loader__button:disabled {
    opacity: .55;
    cursor: wait;
}

.sbp-progressive-loader.is-auto .sbp-progressive-loader__button {
    display: none;
}

.sbp-progressive-loader.is-auto.has-error .sbp-progressive-loader__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sbp-progressive-loader.is-done {
    min-height: 38px;
    margin-top: 16px;
    opacity: .72;
}

.sbp-load-sentinel {
    display: block;
    width: 100%;
    height: 1px;
    pointer-events: none;
}

@keyframes sbp-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 680px) {
    .sbp-progressive-loader {
        min-height: 52px;
        margin-top: 16px;
        font-size: 10.5px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sbp-progressive-loader__spinner {
        animation: none !important;
    }
}
