<style>
/* =========================
   SHLOKA SECTION
========================= */



/* =========================
   TOP
========================= */

.shloka-top {
    text-align: center;

    /* max-width: 780px; */

    margin: auto;
    margin-bottom: 70px;
}

.shloka-heading {
    font-family: 'Cormorant Garamond', serif;

    font-size: 68px;
    line-height: 1;

    color: var(--primary);

    margin-bottom: 24px;
}

.shloka-description {
    font-size: 17px;
    line-height: 1.9;

    color: #5a5a5a;
}


/* =========================
   WRAP
========================= */

.shloka-scroll-wrap {
    display: flex;
    justify-content: center;
}


/* =========================
   SCROLL IMAGE
========================= */

.scroll-image {
    position: relative;

    width: 380px;
    max-width: 100%;
}

.scroll-image img {
    width: 100%;
    transform: rotate(90deg);
    display: block;
}


/* =========================
   CONTENT
========================= */

.shloka-content {
    position: absolute;

    top: 16%;
    left: 14%;
    right: 14%;
    bottom: 16%;

    display: flex;
    align-items: center;
    justify-content: center;

    text-align: center;
}


/* =========================
   ITEM
========================= */

.shloka-item {
    position: absolute;

    opacity: 0;

    transform:
        translateY(20px) scale(0.96);

    transition:
        opacity 1s ease,
        transform 1s ease;

    max-width: 100%;
}


/* ACTIVE */

.shloka-item.active {
    opacity: 1;

    transform:
        translateY(0) scale(1);
}


/* =========================
   LABEL
========================= */

.shloka-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 30px;

    padding: 0 18px;

    border-radius: 100px;

    /* background:
        rgba(139, 74, 74, 0.08); */

    color: var(--primary);

    font-size: 13px;
    font-weight: 700;

    margin-bottom: 12px;
}


/* =========================
   SHLOKA
========================= */

.shloka-item h3 {
    font-family: 'Noto Serif Devanagari', serif;

    font-size: 28px;
    line-height: 1.4;

    font-weight: 900;

    color: #5A3419;

    margin-bottom: 12px;
}


/* =========================
   TRANSLATION
========================= */

.shloka-item p {
    font-family: inherit;
    font-size: 15px;
    font-weight: 500;
    /* line-height: 1.9; */

    color: #5b4633;

    max-width: 500px;

    margin: auto;
}


/* =========================
   RESPONSIVE
========================= */

@media (max-width: 768px) {

    .shloka-section {
        padding: 80px 0;
    }

    .shloka-heading {
        font-size: 42px;
    }

    .shloka-description {
        font-size: 15px;
    }

    .scroll-image {
        width: 100%;
    }

    .shloka-content {
        top: 14%;
        left: 12%;
        right: 12%;
        bottom: 14%;
    }

    .shloka-label {
        min-height: 34px;

        padding: 0 14px;

        font-size: 11px;

        margin-bottom: 16px;
    }

    .shloka-item h3 {
        font-size: 22px;

        line-height: 1.8;

        margin-bottom: 18px;
    }

    .shloka-item p {
        font-size: 13px;

        line-height: 1.8;
    }

}
</style>


<div class="shloka-scroll-wrap">

    <!-- SCROLL IMAGE -->

    <div class="scroll-image">

        <img src="images/24.png" alt="">

        <!-- SHLOKA CONTENT -->

        <div class="shloka-content">

            <!-- ITEM 1 -->

            <div class="shloka-item active">

                <div class="shloka-label">
                    Charaka Samhita
                </div>

                <h3>
                    धर्मार्थकाममोक्षाणाम् आरोग्यं मूलमुत्तमम्।
                </h3>

                <p>
                    Health is the supreme foundation for
                    righteousness, prosperity, pleasure,
                    and liberation.
                </p>

            </div>

            <!-- ITEM 2 -->

            <div class="shloka-item">

                <div class="shloka-label">
                    Ayurvedic Philosophy
                </div>

                <h3>
                    समदोषः समाग्निश्च समधातु मलक्रियः।
                </h3>

                <p>
                    Balanced doshas, digestion, tissues,
                    and bodily functions define true health.
                </p>

            </div>

            <!-- ITEM 3 -->

            <div class="shloka-item">

                <div class="shloka-label">
                    Holistic Wellness
                </div>

                <h3>
                    स्वस्थस्य स्वास्थ्य रक्षणं आतुरस्य विकार प्रशमनम्।
                </h3>

                <p>
                    Ayurveda focuses on preserving health
                    and relieving disease through balance.
                </p>

            </div>

            <!-- ITEM 4 -->

            <div class="shloka-item">

                <div class="shloka-label">
                    Ancient Healing Wisdom
                </div>

                <h3>
                    हिताहितं सुखं दुःखमायुस्तस्य हिताहितम्।
                </h3>

                <p>
                    Ayurveda explains beneficial and harmful
                    aspects of life, happiness, and wellbeing.
                </p>

            </div>

        </div>

    </div>

</div>



<script>
/* =========================
   SHLOKA ANIMATION
========================= */

document.addEventListener("DOMContentLoaded", () => {

    const shlokas =
        document.querySelectorAll(".shloka-item");

    let current = 0;

    function changeShloka() {

        shlokas[current]
            .classList.remove("active");

        current++;

        if (current >= shlokas.length) {
            current = 0;
        }

        shlokas[current]
            .classList.add("active");

    }

    setInterval(changeShloka, 5000);

});
</script>