/* static/css/components/latest_articles.css */
@import url('https://fonts.googleapis.com/css2?family=Abril+Fatface&family=Abel&display=swap');

/* Base Styles */
.latest-articles-wrapper {
    margin: 2rem 0;
    box-sizing: border-box;
    position: relative;
}

/* Card Styles - Consistent Across All Devices */
.latest-article-card {
    width: 210px;
    height: 200px;
    padding: 15px;
    background: transparent;
    position: relative;
    flex-shrink: 0;
    box-sizing: border-box;
}

.card-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Text Styles */
.article-title {
    font-family: "Abril Fatface", serif;
    font-size: 1rem;
    line-height: 1.3;
    margin: 0 0 30px 0;
    color: #333;
}

.latest-article-card a {
    text-decoration: none;
}

.article-meta {
    font-family: "Abel", sans-serif;
    font-size: 1rem;
    color: #666;
    margin: 0;
}

/* Desktop Layout */
.latest-articles-desktop {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: space-between; /* Space between left and right columns */
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
}

.latest-articles-logo {
    width: 300px;
    margin: 0 -30px;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.latest-articles-logo img {
    max-width: 100%;
    height: auto;
}

.desktop-meta {
    text-align: left;
    /* Left align only on desktop */
}

/* Mobile Carousel Layout */
.latest-articles-mobile-logo {
    text-align: center;
}

.latest-articles-mobile-logo img {
    max-height: 280px;
    margin-top: -70px;
    margin-bottom: -50px;
    width: auto;
}

.latest-articles-mobile {
    height: 200px;
    display: flex;
    align-items: center;
    width: 100%;
    position: relative;
    justify-content: center;
}

.latest-articles-carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    width: 210px;
    /* Exactly one card width */
    height: 100%;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.latest-articles-carousel .latest-article-card a {
    scroll-snap-align: center;
    display: flex;
    height: 100%;
    padding: 20px 0;
    flex-direction: column;
    justify-content: space-between;
}

/* Arrow Styles */
.carousel-arrow {
    width: 40px;
    height: 100%;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    margin: 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.arrow-img {
    width: 25px;
    height: 100px;
    object-fit: contain;
}

/* Responsive Handling */
@media (min-width: 768px) {

    /* Desktop styles */
    .latest-articles-desktop {
        display: flex;
    }

    .latest-articles-mobile {
        display: none;
    }

    .article-title {
        text-align: left;
        /* Left align titles on desktop */
    }
}

@media (max-width: 767px) {

    /* Mobile styles */
    .latest-articles-desktop {
        display: none;
    }

    .latest-articles-mobile {
        display: flex;
    }

    .running-text-container {
        margin-top: 20px !important;
        margin-bottom: -40px !important;
    }
}

/* Hide scrollbar and prevent selection */
.latest-articles-carousel::-webkit-scrollbar {
    display: none;
}

.latest-article-card {
    user-select: none;
    -webkit-user-select: none;
    transition: transform 0.2s ease;
}

/* Safe hover effects */
@media (hover: hover) {
    .latest-article-card:hover {
        transform: translateY(-3px);
    }
}



.running-text-container {
    width: 100%;
    overflow: hidden;
    transform: translateY(-50%);
    padding: 5px 0;
    background-color: #EEE8A9;
    margin-top: 50px;
    margin-bottom: -30px;
}

.desktop-running-line {
    display: flex;
    white-space: nowrap;
}

.desktop-running-line span {
    font-size: 17px;
    color: #8B8661;
    font-family: "Luxurious Roman", serif;
}

.separator {
    margin: auto 20px;
    font-weight: bold;
    color: #8B8661;
}

/* Animation for the running text */
@keyframes run-text {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

.desktop-running-line {
    animation: run-text 30s linear infinite;
}

.separator {
    margin: auto 20px;
    font-weight: bold;
    color: #8B8661;
}


@keyframes running-line {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-100%);
    }
}

.left-articles {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
    justify-content: center;
    margin-right: auto; /* Push to left */
}

.right-articles {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 15px;
    justify-content: center;
    margin-left: auto; /* Push to right */
}

.left-articles .article-title,
.left-articles .article-meta {
    text-align: right;
}

.right-articles .article-title,
.right-articles .article-meta {
    text-align: left;
}

.latest-articles-logo-center {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    width: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.latest-articles-logo-center img {
    max-width: 100%;
    height: auto;
}

.slogan h2 {
    font-family: "Abril Fatface", serif;
    font-size: 2rem;
    color: #CCCB86;
    text-align: center;
}

.slogan p {
    font-family: "Abril Fatface", serif;
    font-size: 1rem;
    color: #CCCB86;
    text-align: center;
}
