/* Projects container styling */
.project_container {
    padding: 20px;
    background-color: #f5f5f5;
    /* or any desired color */
    display: flex;
    flex-wrap: wrap;
    /* allows the flex items to wrap */
    justify-content: space-between;
    /* provides spacing between the projects */

}

.jobs {
    margin: auto;
}


h2 {
    margin-top: 30px;
}


article {
    flex-basis: calc(33.3333% - 20px);
    /* this takes up one third of the container's width minus 20px for the margin */
    margin: 10px;
    padding: 10px 10px 10px 10px;
    /* margin around each project */
    background-color: #ffffff;
    /* white background for each card */
    border: 1px solid #e0e0e0;
    /* light border around each card */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    /* subtle shadow */
    /* spacing between cards */
}

.article_text {
    padding-left: 5px;
    padding-right: 5px;
}

article img {
    width: 100%;
    /* make the image span the entire width of the card */
    height: auto;
    margin-bottom: 15px;
    /* space below the image */
}

article video {
    width: 100%;
    /* make the image span the entire width of the card */
    height: auto;
    margin-bottom: 15px;
    /* space below the image */
}

article h2 {
    font-size: 20px;
    margin-bottom: 10px;
    /* space below the title */
}

article p {
    font-size: 16px;
    color: #666;
    /* slightly grayish text */
    margin-bottom: 10px;
    /* space below the description */
}

article ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    margin-bottom: 15px;
    /* space below the authors list */
}

article ul li {
    font-size: 14px;
    color: #888;
    /* even more grayish text for authors */
}

article a {
    font-size: 16px;
    color: #76b900;
    /* link color similar to bootstrap default */
    text-decoration: none;
    margin-left: 5px;
    margin-right: 5px;
    /* spacing between the "Project" and "Video" links */
    padding-bottom: 2px;
}

article a:hover {
    text-decoration: underline;
    /* add underline on hover for better UX */
}

article p sup {
    font-size: 10px;
}

.products-section {
    position: relative;
    /* allows absolute positioning within */
    width: 100%;
    /* or a specific width */
    overflow: hidden;
    /* hides the overflowing sessions */
}

.products-slider {
    display: flex;
    /* lays out sessions side-by-side */
    /* white-space: nowrap; */
    /* prevents wrapping */
    overflow-x: auto;
    /* horizontal scroll */
    scrollbar-width: thin;
    /* optional: thinner scrollbar for some browsers */
    scroll-padding: 0 20%;
    /* gives some padding during scroll snapping */
    scroll-snap-type: x mandatory;
    /* enables horizontal scroll snapping */
}

.product {
    height: 300px;
    flex-basis: calc(33.3333% - 20px);
    /* does not grow or shrink */
    width: calc(100% / 3);
    /* 3 sessions visible at a time */
    scroll-snap-align: start;
    /* aligns to the start edge */
    box-sizing: border-box;
    /* padding and borders included in width */
    padding: 10px;
    /* adjust as needed */
    /* additional styles for layout, colors, etc. */
}

.product img,
.product video {
    /* make the image span the entire width of the card */
    height: 80%;
    /* margin-bottom: 15px; */
    /* space below the image */
    display: block;
    margin: 0 auto;
}

.product p {
    width: 100%;
    font-size: 16px;
    color: #666;
    /* slightly grayish text */
    margin-bottom: 10px;
    /* space below the description */
}


/* Media query for mobile and tablet screens */
@media only screen and (max-width: 768px) {

    /* Adjust the projects container */
    .project_container {
        flex-direction: column;
    }

    /* Adjust each article to span the full width of the container */
    article {
        flex-basis: 100%;
        margin: 10px 0;
        /* Adjust margin */
    }

    /* Adjust product slider for mobile */
    .products-slider {
        flex-direction: column;
    }

    /* Adjust product to span the full width of the container */
    .product {
        flex-basis: 100%;
        width: 100%;
        /* Adjust width */
    }

    /* Adjust images inside products */
    .product img,
    .product video {
        width: 100%;
        height: auto;
    }

    /* Adjust font sizes for better readability on mobile */
    article h2 {
        font-size: 18px;
    }

    article p,
    article a {
        font-size: 14px;
    }

    article ul li {
        font-size: 12px;
    }

    .article_text {
        padding-left: 15px;
        padding-right: 15px;
    }
}


/* Image grid */

.image-grid {
    width: 100%;
    /* max-width: 1500px; */
    /* max-height: 820px; */
    width: 1500px;
    ;
    height: 820px;
    margin: 0 auto;
}

.row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    /* Ensure rows have a height */
}

.first-row {
    height: 306px;
    /* Adjusted height */
}

.second-row {
    height: 510px;
    /* Adjusted height */
}

.img-container {
    position: relative;
    width: 100%;
    height: 100%;
    perspective: 1000px;
}

.img-container .flip {
    position: absolute;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.img-container.flipped .flip {
    transform: rotateY(180deg);
}

.img-container .front,
.img-container .back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    object-fit: cover;
}

.img-container .back {
    transform: rotateY(180deg);
}

.img-3x5 {
    width: calc(33.33% - 4px);
}

.img-5x3 {
    width: calc(18% - 5px);
}

.img-5x5 {
    width: calc(32% - 5px);
}

.ft-image-grid {
    width: 100%;
    max-width: 950px;
    margin: 0 auto;
}


.ft-row {
    height: 232px;
    /* height: 322px; */
}

.image-text-container {
    height: 100%;
    align-items: center;
    width: 25%;
}

.caption-under-image {
    color: black;
    text-align: center;
    font-size: 16px;
    margin-top: 5px;
    width: 100%;
}

.fangyintrain {
    width: calc(100% - 5px);
}

.sstrain {
    width: calc(100% - 5px);
}

.icontrain {
    width: calc(100% - 5px);
}

.cartrain {
    width: calc(100% - 5px);
}

.fangyin1 {
    width: calc(100% - 5px);
}

.fangyin3 {
    width: calc(100% - 5px);
}

.fangyin4 {
    width: calc(100% - 5px);
}

.sidGroup {
    width: calc(100% - 5px);
}

.sidSjGroup {
    width: calc(100% - 5px);
}

.sjGroup {
    width: calc(100% - 5px);
}

.icon {
    width: calc(100% - 5px);
}

.car {
    width: calc(100% - 5px);
}

@media (max-width: 768px) {
    .row {
        flex-wrap: wrap;
    }

    .first-row,
    .second-row {
        height: auto;
    }

    .img-container {
        width: calc(50% - 5px);
        height: 200px;
        margin-bottom: 5px;
    }
}

.img-container:hover .front,
.img-container:hover .back {
    opacity: 0.5;
    /* Decrease opacity on hover */
}

.img-container .caption {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 5px;
    display: none;
    /* Initially hidden */
    font-size: 14px;
    border-radius: 3px;
}

.img-container:hover .caption:not(:empty) {
    display: block;
    /* Show caption on hover only if it's not empty */
}

/* -------------------------------------- */
/* Display buttons */

.button-container {
    text-align: center;
}

.button {
    display: inline-block;
    padding: 10px 20px;
    margin: 10px;
    font-size: 16px;
    background-color: #76b900;
    border: none;
    color: white;
    border-radius: 20px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.button:hover {
    background-color: #518000;
    /* Darker color on hover */
}

/* -------------------------------------- */
/* Image carousel */

.carousel {
    position: relative;
    max-width: 1200px;
    margin: auto;
    overflow: hidden;
    /* background-color: #fff; */
}

.carousel-images {
    display: flex;
    width: 1200px;
    height: 900px;
    transition: transform 0.5s ease-in-out;
    position: relative;
}

.carousel-figure {
    flex: 0 0 100%;
    height: 100%;
    /* Ensure this matches your desired carousel height */
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.carousel-figure img {
    max-height: 750px;
    display: block;
    object-fit: cover;
}

.carousel-figure figcaption {
    max-width: 1000px;
    padding-top: 10px;
    font-size: 16px;
}

/* .carousel-item .caption {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  padding: 10px;
  border-radius: 5px;
} */

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    padding: 10px;
    cursor: pointer;
    font-size: 18px;
    border-radius: 5px;
    z-index: 100;
}

.carousel-btn.prev {
    left: 10px;
}

.carousel-btn.next {
    right: 10px;
}