:root {
    --text-navy: #041b34;
    --text-gray: #304153;
    --border-color: #041b34;
    --bg-white: #ffffff;
    --tag-bg: transparent;
    --font-main: 'DM Sans', sans-serif;
    --transition: 0.3s ease;
}
.ebooks-section {
  font-family: var(--font-main);
    background-color: var(--bg-white);
    color: var(--text-navy);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    width: 100%;
    padding: 48px 15px;
    display: flex;
    justify-content: center;
}

.ebooks-container {
    width: 100%;
    max-width: 1340px;
    display: flex;
    flex-direction: column;
}

/* ============================
    TAG BADGE
============================ */
.tag {
    display: inline-flex;
    align-items: center;
    padding: 6px 16px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-weight: 700;
    font-size: 18px;
    color: var(--text-navy);
    background-color: var(--tag-bg);
    margin-bottom: 40px;
    align-self: flex-start;
  line-height: 1.5rem;
}

/* ============================
    SLIDER UTILITIES
============================ */
.slider-wrapper {
    width: 100%;
    position: relative;
    min-width: 0;
}

.slider-container {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 8px;
    align-items: stretch;
}

.slider-container::-webkit-scrollbar {
    display: none;
}

.slider-item {
    scroll-snap-align: start;
    flex-shrink: 0;
    -webkit-user-drag: none;
    user-select: none;
}

/* On Desktop: Exactly 3 items perfectly sized if 3 */
.ebooks-slider .slider-item {
    flex: 0 0 calc((100% - 48px) / 3);
    /* exactly 1/3 minus gap */
}

/* ============================
    EBOOK CARD
============================ */
.ebook-card {
    display: flex;
    flex-direction: column;
  {#border: 1px solid var(--border-color);#}
    border-radius: 20px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text-navy);
    background-color: var(--bg-white);
    transition: var(--transition);
}

.ebook-card:hover {
    box-shadow: 0 8px 24px rgba(4, 27, 52, 0.08);
    transform: translateY(-4px);
    border-color: #082d56;
}

.card-img-wrapper {
    width: 100%;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.card-img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    object-position: center;
}

.card-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 0 24px 24px 24px;
}

.card-content h3 {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.5px;
    margin-bottom: 12px;
}

.card-content p {
    color: var(--text-gray);
    font-size: 0.95rem;
    margin-bottom: 24px;
    flex-grow: 1;
}

.card-action {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
    margin-top: auto;
}

.action-text {
    font-size: 0.95rem;
    font-weight: 700;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background-color: var(--text-navy);
    color: var(--bg-white);
    border-radius: 8px;
    font-size: 1.2rem;
    transition: var(--transition);
}

.ebook-card:hover .action-btn {
    background-color: #082d56;
    transform: translateX(4px);
}

/* ============================
    SLIDER PAGINATION (DOTS)
============================ */
.slider-pagination {
    display: none;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    width: 100%;
}

.slider-pagination .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(4, 27, 52, 0.2);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    padding: 0;
}

.slider-pagination .dot:hover {
    background: rgba(4, 27, 52, 0.6);
}

.slider-pagination .dot.active {
    background: var(--text-navy);
    transform: scale(1.3);
}

.slider-wrapper.has-nav .slider-pagination {
    display: flex;
}

/* ============================
    RESPONSIVE MEDIA QUERIES
============================ */

/* Medium Devices (Tablets) */
@media screen and (max-width: 1024px) {
    .ebooks-slider .slider-item {
        flex: 0 0 calc((100% - 24px) / 2);
        /* 2 items on tablet */
    }
}

/* Mobile Devices */
@media screen and (max-width: 768px) {
    .ebooks-section {
        padding: 40px 20px;
    }

    .tag {
        margin-bottom: 24px;
    }

    /* 1 item plus a little bit on mobile */
    .ebooks-slider .slider-item {
        flex: 0 0 calc(85vw - 16px);
    }

    .ebooks-slider .slider-container {
        gap: 16px;
    }
}