body {
    background-color: #0d0d0d;
    color: #f8f8f8;
    font-family: 'Inter', sans-serif;
}

main {
    display: flex;
    flex-direction: column;
    gap: 5vh;
    width: 100%;
    padding: 10% 10%;
    padding-bottom: 0px;
}

.container1 {
    width: 100%;
    background-color: #33353B;
    background-image: url(../images/resources/blogBG.png);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    border-radius: 20px;
    padding: clamp(1.5rem, 4vw, 3rem);
    margin-bottom: 1vh;
    position: relative;
    overflow: hidden;
    height: 40vh;
}

/* Hero text */
.container1 p {
    width: 60%;
    opacity: 0.8;
}

/* Images */
/* .metal-image {
    position: absolute;
    left: 0;
    top: 0;
    width: 100vw;
    max-width: 100%;
    opacity: 0.5;
    height: 380px;
} */

.laptop-image {
    position: absolute;
    right: 5%;
    bottom: 0;
    width: 30vw;
    max-width: 900px;
}

.nav-container {
    width: 100%;
    padding: 10px;
    overflow: hidden;
}

.nav-bar {
    background: #fff;
    height: 6vh;
    border-radius: 6vh;
    padding: 0 2vw;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lists {
    list-style: none;
    padding: 0;
    margin: 0;
    margin-top: 2px;
    display: flex;
    gap: 20px;
}

.lists li a {
    text-decoration: none;
    color: #0d0d0d;
    font-size: 2vh;
}

.featued-hero {
    width: 100%;
    height: 45vh;
    gap: 2vh;
}

.left-box {
    width: 50%;
    height: 100%;
}

.main-img {
    width: 100%;
    height: 100%;
    /* object-fit: cover; */
}

.right-box {
    width: 50%;
    height: 100%;
    gap: 1vh;
    display: flex;
    flex-direction: column;
    /* overflow: hidden; */
}

.row-box {
    display: flex;
    width: 100%;
    height: 49%;
    gap: 1vh;
}

.img-box {
    width: 49%;
    height: 100%;
    object-fit: cover;
}

.mobile-track {
    display: none;
}

.carousel-wrapper {
    position: relative;
    width: 100%;
    padding: 0px 0px;
    margin: 0;
}

.carousel-container {
    overflow: hidden;
    width: 100%;
}

.carousel-track {
    display: flex;
    gap: 28px;
    transition: transform 0.4s ease;
}

.card-s {
    min-width: 330px;
    max-width: 400px;
    background: #111;
    border-radius: 12px;
    overflow: hidden;
    padding-bottom: 12px;
    color: white;
    /* margin-right: 20px; */
    user-select: none;
    position: relative;
}

.imag-box {
    width: 100%;
    height: 160px;
    /* margin-bottom: 0px; */
}

.imag-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.date {
    position: absolute;
    /* top: 190px; */
    bottom: 7px;
    left: 10px;
    padding: 4px 10px;
    background: #053fff;
    border-radius: 4px;
    font-size: 13px;
}

.text-padding {
    padding: 12px 12px 22px 12px;
    width: 100%;
}

.carouselo-btn {
    position: absolute;
    top: 40%;
    background: transparent;
    border: none;
    color: #ffffff;
    padding: 1px 18px;
    cursor: pointer;
    border-radius: 50%;
    z-index: 10;
    /* opacity: 4px; */
}

h6 {
    margin: 0px;
    padding: 0px;
}

.left-btn {
    left: -33px;
    font-size: 35px;
}

.right-btn {
    right: -33px;
    font-size: 35px;
}

.card-s,
.card-s .imag-box,
.card-s .imag-box a {
    pointer-events: auto;
}

.carousel-track,
.carousel-track .imag-box,
.carousel-track .imag-box a {
    cursor: grab;
}

.carouselo-btn:hover {
    background:
        linear-gradient(0deg, #0147FF, #0147FF),
        radial-gradient(63.11% 63.11% at 31.97% 19.67%,
            rgba(255, 255, 255, 0.7) 0%,
            rgba(255, 255, 255, 0) 70%);
    background-blend-mode: overlay;
}

.move-page {
    border: none;
    padding: 1px 10px;
    font-size: 30px;
    background: linear-gradient(0deg, #0147FF, #0147FF),
        radial-gradient(63.11% 63.11% at 31.97% 19.67%,
            rgba(255, 255, 255, 0.7) 0%,
            rgba(255, 255, 255, 0) 70%);
    background-blend-mode: overlay;
}


.hide-carousel-btns .carouselo-btn {
    display: none !important;
}

/* Base grid for stacked cards */
.blog-cards-stack,
.whitepapers-cards-stack,
.newsletters-cards-stack {
    display: grid !important;
    /* override flex from carousel JS */
    gap: 16px;
    /* spacing between cards */
    transform: translateX(0) !important;
    /* reset any leftover transforms */
}

/* Make each card fill the grid cell */
.blog-cards-stack .card-s,
.whitepapers-cards-stack .card-s,
.newsletters-cards-stack .card-s {
    width: 100%;
    /* full width of grid cell */
    min-width: 0;
    /* prevent overflow */
    box-sizing: border-box;
}

.carousel-wrapper.disabled,
.blog-carousel.disabled,
.whitepaper-carousel.disabled,
.newsletter-carousel.disabled,
.allresources.disabled {
    display: none !important;
}

/* --- NAVBAR BASE STYLES --- */
.nav-container {
    width: 100%;
    padding: 10px 15px;
    /* Adjusted horizontal padding */
    overflow: hidden;
}

.nav-bar {
    background: #fff;
    /* Changed from fixed height to auto/min-height to prevent squashing */
    height: auto;
    min-height: 6vh;
    border-radius: 6vh;
    padding: 4px 20px;
    /* Added vertical padding for spacing */
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.lists {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 20px;
    /* Ensure list takes up available space to distribute links */
    flex-grow: 1;
    justify-content: space-around;
}

.lists li a {
    text-decoration: none;
    color: #0d0d0d;
    /* Using vh for base scaling on desktop */
    font-size: 16px;
    white-space: nowrap;
    /* Prevents links from breaking into 2 lines */
    padding: 6px 10px;
    display: block;
}

/* Active state */
.lists li a.active {
    background: linear-gradient(0deg, #0147FF, #0147FF),
        radial-gradient(63.11% 63.11% at 31.97% 19.67%,
            rgba(255, 255, 255, 0.7) 0%,
            rgba(250, 250, 250, 0.637) 70%);
    box-shadow: 0 0 25px rgba(1, 71, 255, 0.55);
    color: rgb(255, 246, 246);
    border-radius: 20px;
    padding: 5px 18px;
    /* Match default link padding */
}

.search-place {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 1vw;
    /* Prevents search bar from getting squashed */
}

.search-bar {
    background: #000;
    height: 5vh;
    min-height: 35px;
    width: 19vw;
    border-radius: 4vw;
    display: flex;
    align-items: center;
    border: none;
}

.search-bar input {
    width: 85%;
    background: transparent;
    border: none;
    color: white;
    padding: 0.8vh;
    padding-left: 32px;
    outline: none;
}

.search-icon {
    width: 15%;
    height: 100%;
    background: linear-gradient(0deg, #0147FF, #0147FF),
        radial-gradient(63.11% 63.11% at 31.97% 19.67%,
            rgba(255, 255, 255, 0.7) 0%,
            rgba(255, 255, 255, 0) 70%);
    background-blend-mode: overlay;
    box-shadow: 0 0 25px rgba(1, 71, 255, 0.55);
    border-radius: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* MEDIA QUERIES starts here */

/* Large Laptops (1400px and down) */
@media (max-width:1400px) {
    main {
        padding: 10% 10%;
        padding-bottom: 0px;
        /* margin-top: 80px; */
    }

    .blog-cards-stack,
    .whitepapers-cards-stack,
    .newsletters-cards-stack {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px !important;
    }
}

/* Desktop: 4 cards per row */
@media (min-width: 1025px) {

    .blog-cards-stack,
    .whitepapers-cards-stack,
    .newsletters-cards-stack {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 768px) and (max-width:1024px) {
    main {
        padding: 30px 5%;
        padding-bottom: 0px;
        margin-top: 80px;
    }
}

/* Tablets & Small Laptops (1024px and down) */
@media (max-width: 1024px) {
    .card-s {
        min-width: 300px;
        max-width: 300px;
        border-radius: 0px;
    }

    .carousel-track {
        gap: 10px;
    }

    .laptop-image {
        width: 400px;
        right: 0%;
    }

    .search-icon {
        width: 25%;
    }

    .nav-bar {
        padding: 8px 15px;
        /* Reduce padding */
    }

    /* Hide search bar completely to save space for long links like "Whitepapers" */
    .search-place {
        display: none;
    }

    .lists {
        gap: 10px;
        /* Reduce gap between links */
    }

    .lists li a {
        font-size: 16px;
        /* Switch to px for better control */
        padding: 5px 8px;
    }

    .lists li a.active {
        padding: 5px 8px;
    }
}

/* Tablet: 3 cards per row */
@media (min-width: 768px) and (max-width: 1024px) {

    .blog-cards-stack,
    .whitepapers-cards-stack,
    .newsletters-cards-stack {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media(max-width:991px) {
    .imag-box {
        height: 150px;
    }

    .date {
        padding: 3px 5px;
        font-size: 10px;
    }

    .search-place {
        display: none;
    }

    .lists {
        justify-content: space-around;
    }
}

/* Large Mobiles (767px and down) */
@media (max-width: 767px) {
    main {
        width: 100%;
        margin-top: 80px;
        padding: 30px 5%;
        padding-bottom: 0px;
        overflow-x: hidden;
    }

    .featued-hero {
        height: 35vh;
        gap: 7px;
    }

    .card-s {
        min-width: 250px;
    }

    .title {
        font-size: 15px;
    }

    .laptop-image {
        width: 390px;
    }

    .carouselo-btn {
        padding: 0% 10px;
    }

    .right-btn {
        right: -20px;
        font-size: 25px;
    }

    .left-btn {
        left: -20px;
        font-size: 25px;
    }

    .search-place {
        display: none;
    }

    .nav-bar {
        /* Flatten the pill shape slightly */
        border-radius: 12px;
        padding: 10px;
        min-height: 32px;
    }

    .lists {
        gap: 4px;
        /* Very tight gap */
    }

    .lists li a {
        font-size: 14px;
        padding: 4px 2px;
        /* Minimal padding to fit width */
        text-align: center;
    }

    .lists li a.active {
        padding: 4px 4px;
        border-radius: 8px;
    }
}

/* Small tablets / large mobiles: 2 cards per row */
@media (min-width: 481px) and (max-width: 767px) {

    .blog-cards-stack,
    .whitepapers-cards-stack,
    .newsletters-cards-stack {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media(max-width:625px) {
    .search-place {
        display: none;
    }

    /* .metal-image {
        display: none;
    } */

    .container1 {
        align-items: center;
        display: flex;
        flex-direction: column;
        height: 40vh;
        text-align: center;
    }

    .container1 p {
        width: 100%;
    }

    .laptop-image {
        right: 17%;
        bottom: 0px;
        width: 60vw;
    }

    .lists {
        width: 100%;
        justify-content: space-around;
        margin-top: 0px;
    }

    .left-box {
        display: none;
    }

    .right-box {
        width: 100%;
        display: flex;
        flex-direction: column;
    }

    .row-box {
        padding: 0px 10px;
    }

    .featued-hero {
        height: 40vh;
    }

    .imag-box {
        height: 140px;
    }

    .right-btn {
        display: none !important;
    }

    .left-btn {
        display: none !important;
    }
}

/* Medium Mobiles (575px and down) */
@media (max-width: 575px) {
    .nav-container {
        padding: 5px;
    }

    .lists {
        gap: 2px;
    }

    .lists li a {
        font-size: 12px;
    }
}

@media (max-width:520px) {
    .lists li a {
        font-size: 13px;
        justify-content: space-around;
    }
}

/* Small Mobiles (480px and down) */
@media(max-width:480px) {
    body {
        overflow-x: hidden;
    }

    main {
        padding: 20px 20px;
        padding-bottom: 0px;
        gap: 1.5vh;
    }

    .nav-bar {
        padding: 6px 5px;
        /* Minimal horizontal padding */
    }

    .lists li a.active {
        padding: 3px 3px;
        font-size: 10px;
    }

    .laptop-image {
        width: 310px;
        right: 0;
    }

    .lists li a {
        font-size: 12px;
        padding: 2px 1px;
    }

    .lists {
        gap: 16px;

    }

    .card-s {
        min-width: 175px;
    }

    .imag-box {
        height: 110px;
    }

    .title {
        font-size: 10px;
    }

    .text-secondary {
        font-size: 8.7px;
    }

    .text-padding {
        padding: 5px 3px 12px 3px;
    }

    .date {
        padding: 1px 4px;
        font-size: 8px;
        left: 4px;
    }

    .left-box {
        display: none;
    }

    .featued-hero {
        width: 100%;
        height: auto;
        padding: 0 0px;
    }

    .carousel-wrapper {
        padding: 0px 0px;
    }

    .right-box {
        width: 100%;
        overflow: hidden;
    }

    /* HORIZONTAL TRACK */
    .mobile-track {
        /* display: block ; */

        display: flex;
        gap: 10px;
        touch-action: pan-x;
        will-change: transform;
        transition: transform 0.3s ease;
    }

    /* 2 images visible */
    .mobile-track .img-box {
        flex: 0 0 auto;
        /* allow JS to control spacing */
        width: calc(50% - 5px);
        /* ~2 images per row on small screens */
        height: 15vh;
        aspect-ratio: 1 / 1; 
        object-fit: cover;
        border-radius: 2px;
    }

    /* Disable old rows on mobile */
    .row-box {
        display: none;
    }

    .lists {
        gap: 2px;
    }

    .nav-container {
        padding: 0px;
    }

    .blog-cards-stack,
    .whitepapers-cards-stack,
    .newsletters-cards-stack {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width:375px) {
    .lists li a {
        font-size: 11px;
    }

    .lists li a.active {
        padding: 4px 5px;
    }

    .nav-bar {
        border-radius: 12px;
    }

    .card-s {
        min-width: 165px;
    }
}
/* MEDIA QUERIES ends here */