/* =========================================================
   PakHerbal Blog Posts
   File: public/css/frontend/home/blog-posts.css
   ========================================================= */

.pakherbal-blog-posts,
.pakherbal-blog-posts *,
.pakherbal-blog-posts *::before,
.pakherbal-blog-posts *::after {
    box-sizing: border-box;
}

.pakherbal-blog-posts {
    --blog-green: var(
        --pakherbal-theme-primary,
        #79c943
    );

    --blog-green-dark: #4e9728;
    --blog-navy: #071827;
    --blog-navy-light: #12334b;
    --blog-text: #25322c;
    --blog-muted: #5e6963;
    --blog-background: #f6f8f2;
    --blog-card-background: #ffffff;
    --blog-border: rgba(36, 65, 46, 0.11);

    width: 100%;
    min-width: 0;
    overflow: hidden;
    background: var(--blog-background);
}

/* =========================================================
   Container and Header
   ========================================================= */

.pakherbal-blog-posts__container {
    width: min(100%, 1320px);
    margin: 0 auto;
    padding: 62px 28px 68px;
}

.pakherbal-blog-posts__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 28px;
}

.pakherbal-blog-posts__heading-group {
    min-width: 0;
}

.pakherbal-blog-posts__title {
    margin: 0;
    color: var(--blog-navy);
    font-size: clamp(31px, 3vw, 43px);
    font-weight: 900;
    line-height: 1.07;
    letter-spacing: -0.035em;
    overflow-wrap: anywhere;
}

.pakherbal-blog-posts__description {
    max-width: 760px;
    margin: 12px 0 0;
    color: var(--blog-muted);
    font-size: 15px;
    line-height: 1.68;
    overflow-wrap: anywhere;
}

.pakherbal-blog-posts__view-all {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 47px;
    padding: 11px 21px;
    color: #ffffff;
    background:
        linear-gradient(
            135deg,
            var(--blog-green),
            var(--blog-green-dark)
        );
    border: 1px solid var(--blog-green-dark);
    border-radius: 0;
    box-shadow:
        0 11px 22px rgba(73, 145, 37, 0.2);
    font-size: 13px;
    font-weight: 850;
    line-height: 1.3;
    text-decoration: none;
    white-space: nowrap;
    transition:
        box-shadow 160ms ease,
        transform 160ms ease;
}

.pakherbal-blog-posts__view-all svg {
    flex: 0 0 auto;
    transition: transform 160ms ease;
}

.pakherbal-blog-posts__view-all:hover {
    color: #ffffff;
    box-shadow:
        0 15px 27px rgba(73, 145, 37, 0.28);
    transform: translateY(-2px);
}

.pakherbal-blog-posts__view-all:hover svg {
    transform: translateX(3px);
}

.pakherbal-blog-posts__view-all:focus-visible {
    outline: 3px solid rgba(121, 201, 67, 0.42);
    outline-offset: 3px;
}

/* =========================================================
   Blog Grid
   ========================================================= */

.pakherbal-blog-posts__grid {
    display: grid;
    grid-template-columns:
        repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 20px;
}

/* =========================================================
   Blog Card
   ========================================================= */

.pakherbal-blog-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    overflow: hidden;
    background: var(--blog-card-background);
    border: 1px solid var(--blog-border);
    border-radius: 0;
    box-shadow:
        0 13px 28px rgba(26, 53, 37, 0.075);
    transition:
        border-color 180ms ease,
        box-shadow 180ms ease,
        transform 180ms ease;
}

.pakherbal-blog-card:hover {
    border-color: rgba(78, 151, 40, 0.3);
    box-shadow:
        0 19px 35px rgba(26, 53, 37, 0.13);
    transform: translateY(-4px);
}

/* =========================================================
   Blog Media
   ========================================================= */

.pakherbal-blog-card__media {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1.55 / 1;
    overflow: hidden;
    background: #e8efe2;
    border-radius: 0;
    text-decoration: none;
}

.pakherbal-blog-card__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 0;
    transition: transform 320ms ease;
}

.pakherbal-blog-card:hover
.pakherbal-blog-card__image {
    transform: scale(1.035);
}

/* =========================================================
   Temporary Placeholder
   ========================================================= */

.pakherbal-blog-card__placeholder {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.pakherbal-blog-card__placeholder--green {
    background:
        radial-gradient(
            circle at 77% 18%,
            rgba(255, 255, 255, 0.52),
            transparent 27%
        ),
        linear-gradient(
            145deg,
            #dcebd3,
            #93bc79
        );
}

.pakherbal-blog-card__placeholder--gold {
    background:
        radial-gradient(
            circle at 77% 18%,
            rgba(255, 255, 255, 0.48),
            transparent 27%
        ),
        linear-gradient(
            145deg,
            #f3e5b5,
            #cfa551
        );
}

.pakherbal-blog-card__placeholder--earth {
    background:
        radial-gradient(
            circle at 77% 18%,
            rgba(255, 255, 255, 0.4),
            transparent 27%
        ),
        linear-gradient(
            145deg,
            #eadcc4,
            #b78e62
        );
}

.pakherbal-blog-card__placeholder-glow {
    position: absolute;
    top: -35%;
    left: -18%;
    width: 80%;
    height: 145%;
    background:
        radial-gradient(
            circle,
            rgba(255, 255, 255, 0.72),
            rgba(255, 255, 255, 0)
        );
}

.pakherbal-blog-card__placeholder-shadow {
    position: absolute;
    right: 50%;
    bottom: 9%;
    width: 55%;
    height: 8%;
    background: rgba(30, 55, 39, 0.18);
    border-radius: 50%;
    filter: blur(10px);
    transform: translateX(50%);
}

/* Herbal products placeholder */

.pakherbal-blog-card__herbal-bowl {
    position: absolute;
    z-index: 3;
    right: 50%;
    bottom: 17%;
    width: 36%;
    height: 26%;
    background:
        linear-gradient(
            180deg,
            #a66e36,
            #644221
        );
    clip-path:
        polygon(
            0 0,
            100% 0,
            82% 100%,
            18% 100%
        );
    transform: translateX(50%);
}

.pakherbal-blog-card__herbal-jar {
    position: absolute;
    z-index: 2;
    right: 18%;
    bottom: 18%;
    width: 21%;
    height: 46%;
    background:
        linear-gradient(
            145deg,
            #ffffff,
            #dfead8
        );
    border: 1px solid rgba(44, 78, 57, 0.12);
    box-shadow:
        0 16px 25px rgba(37, 69, 46, 0.15);
}

.pakherbal-blog-card__herbal-jar::before {
    position: absolute;
    top: -10%;
    left: -4%;
    width: 108%;
    height: 13%;
    content: "";
    background: #173f30;
}

/* Oils placeholder */

.pakherbal-blog-card__oil-bottle {
    position: absolute;
    bottom: 16%;
    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, 0.97),
            rgba(234, 225, 186, 0.94)
        );
    border: 1px solid rgba(85, 66, 27, 0.12);
    box-shadow:
        0 18px 28px rgba(68, 54, 29, 0.17);
}

.pakherbal-blog-card__oil-bottle::before {
    position: absolute;
    top: -12%;
    left: 50%;
    width: 45%;
    height: 15%;
    content: "";
    background: #263a28;
    transform: translateX(-50%);
}

.pakherbal-blog-card__oil-bottle--large {
    right: 38%;
    width: 24%;
    height: 57%;
}

.pakherbal-blog-card__oil-bottle--small {
    right: 18%;
    width: 18%;
    height: 42%;
}

/* Pansar placeholder */

.pakherbal-blog-card__pansar-bowl {
    position: absolute;
    z-index: 3;
    right: 50%;
    bottom: 16%;
    width: 38%;
    height: 25%;
    background:
        linear-gradient(
            180deg,
            #9b6130,
            #603c1f
        );
    clip-path:
        polygon(
            0 0,
            100% 0,
            81% 100%,
            19% 100%
        );
    transform: translateX(50%);
}

.pakherbal-blog-card__pansar-pouch {
    position: absolute;
    bottom: 20%;
    background:
        linear-gradient(
            145deg,
            #f7f0da,
            #d3bc8c
        );
    clip-path:
        polygon(
            9% 0,
            91% 0,
            100% 13%,
            94% 100%,
            6% 100%,
            0 13%
        );
    box-shadow:
        0 16px 25px rgba(70, 52, 32, 0.15);
}

.pakherbal-blog-card__pansar-pouch--one {
    left: 16%;
    width: 21%;
    height: 46%;
}

.pakherbal-blog-card__pansar-pouch--two {
    right: 15%;
    width: 23%;
    height: 53%;
}

/* Shared leaves */

.pakherbal-blog-card__leaf {
    position: absolute;
    z-index: 2;
    background: rgba(62, 132, 61, 0.78);
    border-radius: 100% 0 100% 0;
}

.pakherbal-blog-card__leaf--one {
    top: 20%;
    left: 18%;
    width: 25%;
    height: 13%;
    transform: rotate(-25deg);
}

.pakherbal-blog-card__leaf--two {
    right: 29%;
    bottom: 29%;
    width: 20%;
    height: 11%;
    background: rgba(121, 201, 67, 0.78);
    transform: rotate(30deg);
}

.pakherbal-blog-card__leaf--three {
    top: 21%;
    left: 20%;
    width: 26%;
    height: 13%;
    transform: rotate(-23deg);
}

.pakherbal-blog-card__leaf--four {
    top: 18%;
    right: 31%;
    width: 24%;
    height: 12%;
    transform: rotate(-27deg);
}

/* =========================================================
   Card Content
   ========================================================= */

.pakherbal-blog-card__content {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
    padding: 21px;
}

.pakherbal-blog-card__category {
    margin: 0 0 8px;
    color: var(--blog-green-dark);
    font-size: 11px;
    font-weight: 850;
    line-height: 1.3;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.pakherbal-blog-card__title {
    min-height: 55px;
    margin: 0;
    font-size: 18px;
    font-weight: 850;
    line-height: 1.42;
}

.pakherbal-blog-card__title a {
    display: -webkit-box;
    overflow: hidden;
    color: var(--blog-text);
    text-decoration: none;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.pakherbal-blog-card__title a:hover {
    color: var(--blog-green-dark);
}

.pakherbal-blog-card__excerpt {
    display: -webkit-box;
    min-height: 69px;
    margin: 13px 0 0;
    overflow: hidden;
    color: var(--blog-muted);
    font-size: 13px;
    line-height: 1.72;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.pakherbal-blog-card__link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: fit-content;
    margin-top: auto;
    padding-top: 18px;
    color: var(--blog-navy);
    font-size: 13px;
    font-weight: 850;
    line-height: 1.3;
    text-decoration: none;
}

.pakherbal-blog-card__link svg {
    flex: 0 0 auto;
    color: var(--blog-green-dark);
    transition: transform 160ms ease;
}

.pakherbal-blog-card__link:hover {
    color: var(--blog-green-dark);
}

.pakherbal-blog-card__link:hover svg {
    transform: translateX(3px);
}

/* =========================================================
   Tablet
   ========================================================= */

@media (max-width: 991px) {
    .pakherbal-blog-posts__container {
        padding-right: 20px;
        padding-left: 20px;
    }

    .pakherbal-blog-posts__grid {
        gap: 14px;
    }

    .pakherbal-blog-card__content {
        padding: 17px;
    }

    .pakherbal-blog-card__title {
        font-size: 16px;
    }
}

/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 767px) {
    .pakherbal-blog-posts__container {
        padding: 44px 12px 48px;
    }

    .pakherbal-blog-posts__header {
        align-items: center;
        gap: 16px;
        margin-bottom: 21px;
    }

    .pakherbal-blog-posts__title {
        font-size: clamp(27px, 7.3vw, 36px);
    }

    .pakherbal-blog-posts__description {
        display: none;
    }

    .pakherbal-blog-posts__view-all {
        min-height: 41px;
        padding: 9px 12px;
        font-size: 11px;
    }

    .pakherbal-blog-posts__view-all svg {
        width: 15px;
        height: 15px;
    }

    .pakherbal-blog-posts__grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 13px;
        width: min(100%, 540px);
        margin: 0 auto;
    }

    .pakherbal-blog-card {
        display: grid;
        grid-template-columns:
            minmax(145px, 0.8fr)
            minmax(0, 1.2fr);
    }

    .pakherbal-blog-card__media {
        height: 100%;
        min-height: 220px;
        aspect-ratio: auto;
    }

    .pakherbal-blog-card__content {
        justify-content: center;
        padding: 15px 13px;
    }

    .pakherbal-blog-card__category {
        margin-bottom: 6px;
        font-size: 9px;
    }

    .pakherbal-blog-card__title {
        min-height: auto;
        font-size: 14px;
        line-height: 1.38;
    }

    .pakherbal-blog-card__excerpt {
        min-height: auto;
        margin-top: 9px;
        font-size: 11px;
        line-height: 1.55;
        line-clamp: 4;
        -webkit-line-clamp: 4;
    }

    .pakherbal-blog-card__link {
        padding-top: 12px;
        font-size: 11px;
    }
}

/* =========================================================
   Small Mobile
   ========================================================= */

@media (max-width: 430px) {
    .pakherbal-blog-posts__header {
        align-items: flex-end;
    }

    .pakherbal-blog-posts__title {
        max-width: 215px;
        font-size: 28px;
    }

    .pakherbal-blog-posts__view-all span {
        max-width: 75px;
        white-space: normal;
    }

    .pakherbal-blog-card {
        grid-template-columns: minmax(0, 1fr);
    }

    .pakherbal-blog-card__media {
        min-height: 205px;
        aspect-ratio: 1.55 / 1;
    }

    .pakherbal-blog-card__content {
        padding: 17px 14px;
    }

    .pakherbal-blog-card__title {
        font-size: 16px;
    }

    .pakherbal-blog-card__excerpt {
        font-size: 12px;
        line-clamp: 3;
        -webkit-line-clamp: 3;
    }
}

/* =========================================================
   Very Small Mobile
   ========================================================= */

@media (max-width: 359px) {
    .pakherbal-blog-posts__container {
        padding-right: 8px;
        padding-left: 8px;
    }

    .pakherbal-blog-posts__header {
        gap: 9px;
    }

    .pakherbal-blog-posts__title {
        font-size: 25px;
    }

    .pakherbal-blog-posts__view-all {
        padding-right: 8px;
        padding-left: 8px;
        font-size: 10px;
    }
}

/* =========================================================
   Reduced Motion
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
    .pakherbal-blog-posts__view-all,
    .pakherbal-blog-posts__view-all svg,
    .pakherbal-blog-card,
    .pakherbal-blog-card__image,
    .pakherbal-blog-card__link svg {
        transition: none;
    }

    .pakherbal-blog-posts__view-all:hover,
    .pakherbal-blog-posts__view-all:hover svg,
    .pakherbal-blog-card:hover,
    .pakherbal-blog-card:hover
    .pakherbal-blog-card__image,
    .pakherbal-blog-card__link:hover svg {
        transform: none;
    }
}