/* Useful Links Section */
.useful-links-section {
    position: relative;
    width: 100%;
    padding: var(--spacing-xxxl) 0 100px 0;
    background-color: var(--color-secondary);
    overflow: hidden;
    color: var(--color-white);
}

@media (max-width: 768px) {
    .useful-links-section {
        padding: var(--spacing-mxl) 0;
    }
}

/* Background Image - Ideally this should be dynamic or fixed from assets */
.useful-links-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../../images/frontpage_useful-links.jpg');
    background-size: cover;
    background-position: center;
    z-index: 1;
}

/* Dark Overlay Gradient */
.useful-links-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #00000099;
    z-index: 2;
}

.useful-links-section .container {
    position: relative;
    z-index: 10;
}


/* Header Styles */
.useful-links-header {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-mxl);
}

.useful-links-header .section-title {
    font-size: 40px;
    color: var(--color-white);
    font-family: 'Cinzel', serif;
    font-weight: 400;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.useful-links-header .jp-title {
    font-size: 18px;
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 700;
    opacity: 0.9;
    margin-top: 0.3em;
}

.useful-links-header p {
    font-size: 14px;
    line-height: 1.8;
    opacity: 0.9;
    letter-spacing: 3px;
}

/* Slider Layout (Horizontal Scroll) */
.useful-links-grid {
    display: flex;
    gap: var(--spacing-mlg);
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding-top: var(--spacing-mxl);
    scrollbar-width: none;
    -ms-overflow-style: none;
    position: relative;
    z-index: 10;
    --slider-padding: max(var(--spacing-md), calc((100% - var(--container-width)) / 2 + 0px));
    padding-left: calc(var(--slider-padding) + 20px);
    padding-right: var(--slider-padding);
    scroll-padding-left: calc(var(--slider-padding) + 20px);
}

.useful-links-grid::-webkit-scrollbar {
    display: none;
}

/* Card Styles */
.link-card {
    position: relative;
    display: block;
    flex: 0 0 calc(25% - 15px);
    scroll-snap-align: start;
    height: 205px;
    border-radius: 5.09px;
    overflow: hidden;
    text-decoration: none;
    color: var(--color-white);
    opacity: 0;
    transform: translateX(50px);
    transition: transform 0.5s ease-out, box-shadow 0.3s ease, opacity 0.5s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.link-card.visible {
    opacity: 1;
    transform: translateX(0);
}

.link-card:hover {
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.link-card-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.5s ease;
    z-index: 1;
}

.link-card:hover .link-card-image {
    transform: scale(1.1);
}

/* Gradient only at the bottom */
.link-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60%;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.9) 100%);
    pointer-events: none;
    z-index: 2;
}

/* Card Content */
.link-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: var(--spacing-mlg);
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.link-title {
    width: 180px;
    display: block;
    margin-bottom: 10px;
    border-radius: 1.27px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    overflow: visible;
}

.link-subtitle {
    width: 100%;
    font-size: 18px;
    font-weight: 700;
    color: var(--color-white);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.arrow-icon {
    position: absolute;
    width: 16px;
    height: auto;
    right: 12px;
}

.link-card:hover .arrow-icon {
    transform: translateX(5px);
}

/* Scroll Navigation Wrapper - Full Overlay */
.scroll-navigation {
    position: absolute;
    inset: 0;
    pointer-events: none;
    /* Allow clicks through empty space */
    z-index: 20;
}

/* Individual Indicator (Restored "Original Form" Styling) */
.scroll-indicator {
    position: absolute;
    bottom: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-white);
    font-family: serif;
    font-style: italic;
    font-size: 16px;
    opacity: 0.8;
    cursor: pointer;
    transition: opacity 0.3s ease;
    pointer-events: auto;
}

.scroll-indicator.prev {
    left: 50px;
}

.scroll-indicator.next {
    right: 50px;
}

.scroll-indicator:hover {
    opacity: 1;
}

.scroll-indicator.hidden {
    opacity: 0;
    pointer-events: none;
}

.scroll-indicator img {
    width: var(--spacing-mlg);
    height: auto;
    filter: brightness(0) invert(1);
    display: block;
}



@media (max-width: 786px) {
    .useful-links-grid {
        gap: 10px;
        margin-bottom: -70px;
        padding-top: var(--spacing-lg);
        padding-left: 24px;
        padding-right: 24px;
        scroll-padding-left: 24px;
    }

    .useful-links-section {
        position: relative;
        width: 100%;
        overflow: visible;
    }


    .useful-links-header .section-title {
        flex-direction: column;
        gap: 0px;
        justify-content: center;
        font-size: 20px;
    }

    .useful-links-header p {
        font-size: 12px;
        text-align: center;

    }

    .useful-links-header {
        gap: var(--spacing-lg);
    }


    .link-card {
        flex: none;
        width: 220px;
        height: 160px;
    }

    .scroll-indicator {
        display: none;
    }



    .useful-links-header {
        margin-bottom: var(--spacing-lg);
    }

    .link-title {
        width: 140px;
        font-size: 10px;
    }

    .link-subtitle {
        font-size: 14px;
    }

    .arrow-icon {
        right: 21px;
    }
}