/* =========================================================
   SCINFINITY - MODERN JOURNAL SECTION
   ========================================================= */

.journal-section {
    padding: 75px 0;
    background: #f7f9fc;
}

.journal-section .section-header {
    margin-bottom: 35px;
}

.journal-section .section-header p {
    color: #f5a623;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.journal-section .section-header h2 {
    color: #202b3c;
    font-size: 38px;
    font-weight: 700;
    margin-bottom: 0;
}

/* Category navigation */
.journal-tabs {
    margin-bottom: 42px;
}

.journal-tabs .nav-pills {
    gap: 9px;
}

.journal-tabs .nav-item {
    margin: 0;
}

.journal-tabs .nav-link {
    background: #ffffff;
    color: #26364a;
    border: 1px solid #e1e7ee;
    border-radius: 30px;
    padding: 9px 18px;
    font-size: 14px;
    font-weight: 600;
    transition: all .3s ease;
}

.journal-tabs .nav-link:hover,
.journal-tabs .nav-link.active {
    background: #f5a623;
    border-color: #f5a623;
    color: #ffffff;
}

/* Journal grid */
.journal-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
}

/* Journal card */
.journal-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #ffffff;
    border: 1px solid #e5eaf0;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 6px 24px rgba(31, 45, 61, .07);
    transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease;
}

.journal-card:hover {
    transform: translateY(-8px);
    border-color: #f5a623;
    box-shadow: 0 16px 38px rgba(31, 45, 61, .14);
}

.journal-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    text-decoration: none !important;
}

.journal-image {
    height: 235px;
    overflow: hidden;
    background: #edf1f5;
    position: relative;
}

.journal-image img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform .5s ease;
}

.journal-card:hover .journal-image img {
    transform: scale(1.06);
}

/* Small label on image */
.journal-label {
    position: absolute;
    left: 16px;
    top: 16px;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(255,255,255,.94);
    color: #e69512;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .4px;
}

/* Text */
.journal-content {
    padding: 24px 24px 26px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.journal-content h3 {
    color: #26364a;
    font-size: 19px;
    line-height: 1.45;
    font-weight: 700;
    margin: 0 0 13px;
}

.journal-content p {
    color: #697586;
    font-size: 14px;
    line-height: 1.7;
    margin: 0 0 18px;
}

.journal-meta {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.journal-issn {
    display: inline-block;
    padding: 6px 11px;
    border-radius: 20px;
    background: #eef8dc;
    color: #63a900;
    border: 1px solid #d8edb5;
    font-size: 12px;
    font-weight: 700;
}

.journal-read {
    color: #f0a01c;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.journal-read i {
    margin-left: 4px;
    transition: transform .25s ease;
}

.journal-card:hover .journal-read i {
    transform: translateX(4px);
}

/* Tablet */
@media (min-width: 768px) and (max-width: 991px) {
    .journal-section {
        padding: 60px 0;
    }

    .journal-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 22px;
    }

    .journal-image {
        height: 220px;
    }

    .journal-content {
        padding: 21px;
    }

    .journal-content h3 {
        font-size: 17px;
    }
}

/* Mobile */
@media (max-width: 767px) {
    .journal-section {
        padding: 48px 0;
    }

    .journal-section .section-header {
        margin-bottom: 25px;
    }

    .journal-section .section-header p {
        font-size: 16px;
    }

    .journal-section .section-header h2 {
        font-size: 28px;
        line-height: 1.3;
    }

    .journal-tabs {
        margin-bottom: 28px;
    }

    /* Mobile category buttons: ONE horizontal row */
    .journal-tabs {
        width: 100%;
        margin-bottom: 28px;
        overflow: hidden;
    }

    .journal-tabs .nav-pills {
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        align-items: center;
        width: 100%;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        white-space: nowrap;
        gap: 8px;
        padding: 4px 2px 12px;
        margin: 0;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .journal-tabs .nav-pills .nav-item {
        flex: 0 0 auto !important;
        width: auto !important;
        margin: 0 !important;
    }

    .journal-tabs .nav-link {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        flex: 0 0 auto !important;
        width: auto !important;
        min-width: max-content;
        white-space: nowrap !important;
        padding: 9px 15px !important;
        margin: 0 !important;
        border-radius: 25px;
        font-size: 12px;
        line-height: 1.2;
    }

    .journal-tabs .nav-pills::-webkit-scrollbar {
        height: 4px;
    }

    .journal-tabs .nav-pills::-webkit-scrollbar-track {
        background: transparent;
    }

    .journal-tabs .nav-pills::-webkit-scrollbar-thumb {
        background: #d7dce3;
        border-radius: 10px;
    }

    .journal-grid {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .journal-tabs + .tab-content {
        width: 100%;
        overflow: hidden;
    }

    .journal-tabs + .tab-content > .tab-pane {
        width: 100%;
    }

    .journal-tabs + .tab-content .journal-grid {
        width: 100%;
        margin: 0;
    }

    .journal-card {
        border-radius: 15px;
    }

    .journal-image {
        height: 210px;
    }

    .journal-content {
        padding: 20px;
    }

    .journal-content h3 {
        font-size: 16px;
        line-height: 1.5;
    }

    .journal-content p {
        font-size: 13px;
        line-height: 1.65;
    }
}

@media (max-width: 400px) {
    .journal-image {
        height: 190px;
    }

    .journal-content {
        padding: 17px;
    }

    .journal-content h3 {
        font-size: 15px;
    }

    .journal-content p {
        font-size: 12px;
    }
}
  
    
/* FINAL MOBILE JOURNAL-TAB FIX */
@media (max-width: 767px) {
    .journal-section .container {
        width: 100%;
        max-width: 100%;
        padding-left: 15px;
        padding-right: 15px;
    }

    .journal-tabs {
        width: 100%;
        overflow: hidden;
    }

    .journal-tabs > .nav-pills {
        width: 100%;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        align-items: center !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        white-space: nowrap !important;
    }

    .journal-tabs > .nav-pills > .nav-item {
        display: block !important;
        flex: 0 0 auto !important;
    }

    .journal-tabs > .nav-pills > .nav-item > .nav-link {
        display: inline-flex !important;
        width: auto !important;
        min-width: fit-content !important;
        white-space: nowrap !important;
    }

    .journal-tabs + .tab-content,
    .journal-tabs + .tab-content > .tab-pane {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

/* =========================================================
   MOBILE SLIDER / CAROUSEL WHITE-SPACE FIX
   Keeps the original slider design and only removes the
   unnecessary empty area below the slider image.
   ========================================================= */
@media (max-width: 767px) {

    /* Do not allow the template's fixed carousel height */
    .carousel {
        height: auto !important;
        min-height: 0 !important;
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }

    .carousel .container-fluid {
        height: auto !important;
        min-height: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin: 0 !important;
    }

    .carousel .owl-carousel,
    .carousel .owl-stage-outer,
    .carousel .owl-stage,
    .carousel .owl-item {
        height: auto !important;
        min-height: 0 !important;
    }

    .carousel .owl-stage {
        display: flex !important;
        align-items: flex-start !important;
    }

    .carousel .owl-item {
        float: none !important;
    }

    .carousel .carousel-item {
        height: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        position: relative !important;
    }

    .carousel .carousel-img {
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
    }

    .carousel .carousel-img img {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        object-fit: contain !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Keep slider text from increasing the carousel height.
       Your first two slides already have their text commented out. */
    .carousel .carousel-text {
        position: absolute !important;
        left: 0 !important;
        right: 0 !important;
        top: 0 !important;
        bottom: auto !important;
        height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Hide the old template's large text/buttons on small screens.
       This keeps the slider as an image-only responsive banner. */
    .carousel .carousel-text h1,
    .carousel .carousel-text p,
    .carousel .carousel-text .carousel-btn {
        display: none !important;
    }

    .carousel .owl-nav,
    .carousel .owl-dots {
        margin-bottom: 0 !important;
    }
}

/* Very small phones */
@media (max-width: 400px) {
    .carousel .carousel-img img {
        width: 100% !important;
        height: auto !important;
    }
}


