/* ========================================= */
/* หน้ากิจกรรมแบบ Image Accordion */
/* ========================================= */

.activity-page {
    padding-top: 34px;
    padding-bottom: 70px;
}

.activity-section-heading {
    margin-bottom: 25px;
    text-align: center;
}

.activity-section-heading p {
    margin-bottom: 4px;
    color: var(--primary-red);
    font-size: 0.85rem;
    font-weight: 500;
}

.activity-section-heading h1 {
    color: var(--heading-color);
    font-size: clamp(1.75rem, 4vw, 2.35rem);
}

.activity-section-heading span {
    display: block;
    width: 92px;
    height: 3px;
    margin: 11px auto 0;
    background: var(--primary-red);
    border-radius: 10px;
}

.activity-showcase {
    padding: clamp(15px, 3vw, 28px);
    background: #090e1c;
    border-radius: 24px;
    box-shadow: 0 18px 45px rgba(9, 14, 28, 0.18);
}

.activity-accordion {
    display: flex;
    gap: 10px;
    height: 470px;
    padding: 16px;
    overflow: hidden;
    background: #ffffff;
    border-radius: 19px;
}

.activity-panel {
    position: relative;
    flex: 0 0 78px;
    min-width: 0;
    overflow: hidden;
    cursor: pointer;
    background: #1e293b;
    border-radius: 5px;
    outline: none;
    transition:
        flex-basis 0.55s cubic-bezier(0.2, 0.8, 0.2, 1),
        transform 0.35s ease,
        opacity 0.35s ease;
}

.activity-panel.is-active {
    flex: 1 1 520px;
    transform: translateY(-2px);
}

.activity-panel:not(.is-active) {
    opacity: 0.72;
}

.activity-panel:focus-visible {
    box-shadow:
        0 0 0 4px rgba(255, 255, 255, 0.8),
        0 0 0 7px var(--primary-red);
}

.activity-panel img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition:
        transform 0.7s ease,
        filter 0.35s ease;
}

.activity-panel.is-active img {
    transform: scale(1.035);
}

.activity-panel:not(.is-active) img {
    filter: saturate(0.72) brightness(0.8);
}

.activity-panel-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            to top,
            rgba(5, 9, 20, 0.93) 0%,
            rgba(5, 9, 20, 0.44) 42%,
            rgba(5, 9, 20, 0.06) 72%
        );
    opacity: 0;
    transition: opacity 0.35s ease;
}

.activity-panel.is-active .activity-panel-shade {
    opacity: 1;
}

.activity-panel-content {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2;
    padding: 28px;
    color: #ffffff;
    opacity: 0;
    transform: translateY(24px);
    pointer-events: none;
    transition:
        opacity 0.35s ease 0.12s,
        transform 0.35s ease 0.12s;
}

.activity-panel.is-active .activity-panel-content {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.activity-panel-content time {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
    font-size: 0.76rem;
    opacity: 0.9;
}

.activity-panel-content h2 {
    max-width: 700px;
    margin: 0 0 8px;
    font-size: clamp(1.25rem, 3vw, 2rem);
    line-height: 1.4;
}

.activity-panel-content p {
    max-width: 650px;
    margin-bottom: 17px;
    font-size: 0.9rem;
    line-height: 1.7;
    opacity: 0.91;
}

.activity-detail-button {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 9px 17px;
    color: #ffffff;
    font-size: 0.82rem;
    text-decoration: none;
    background: var(--primary-red);
    border: 1px solid rgba(255, 255, 255, 0.48);
    border-radius: 24px;
}

.activity-vertical-title {
    position: absolute;
    right: 50%;
    bottom: 18px;
    z-index: 2;
    width: 330px;
    overflow: hidden;
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
    transform:
        translateX(50%)
        rotate(-90deg);
    transform-origin: center;
    transition: opacity 0.2s ease;
}

.activity-panel.is-active .activity-vertical-title {
    opacity: 0;
}

.activity-dots {
    display: flex;
    justify-content: center;
    gap: 9px;
    margin-top: 18px;
}

.activity-dots button {
    width: 9px;
    height: 9px;
    padding: 0;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.35);
    border: 0;
    border-radius: 50%;
    transition: 0.25s;
}

.activity-dots button.is-active {
    width: 28px;
    background: #ffffff;
    border-radius: 20px;
}

.activity-empty-state {
    display: grid;
    place-items: center;
    min-height: 420px;
    padding: 30px;
    color: #64748b;
    text-align: center;
    background: #ffffff;
    border-radius: 19px;
}

.activity-empty-state i {
    margin-bottom: 12px;
    color: var(--primary-red);
    font-size: 3.8rem;
}

.activity-empty-state h2 {
    color: #172554;
}

.activity-empty-state p {
    max-width: 570px;
    margin-top: 8px;
    line-height: 1.8;
}

.activity-detail-page {
    padding-top: 45px;
    padding-bottom: 70px;
}

.activity-detail-card {
    padding: clamp(22px, 5vw, 48px);
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
}

.activity-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 22px;
    color: var(--primary-red);
    text-decoration: none;
}

.activity-detail-card h1 {
    color: var(--heading-color);
    font-size: clamp(1.6rem, 4vw, 2.45rem);
    line-height: 1.45;
}

.activity-detail-date {
    margin-top: 10px;
    color: var(--muted-text);
}

.activity-detail-summary {
    padding: 16px 18px;
    margin-top: 22px;
    color: var(--text-color);
    line-height: 1.8;
    background: var(--topbar-bg);
    border-left: 4px solid var(--primary-red);
    border-radius: 8px;
}

.activity-detail-image {
    display: block;
    width: 100%;
    max-height: 650px;
    margin-top: 25px;
    object-fit: contain;
    background: #0b1020;
    border-radius: 13px;
}

.activity-detail-content {
    margin-top: 28px;
    color: var(--text-color);
    line-height: 1.95;
    overflow-wrap: anywhere;
}

@media (hover: hover) and (min-width: 801px) {
    .activity-panel:hover {
        flex: 1 1 520px;
        opacity: 1;
    }

    .activity-panel:hover .activity-panel-shade {
        opacity: 1;
    }

    .activity-panel:hover .activity-panel-content {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    .activity-panel:hover .activity-vertical-title {
        opacity: 0;
    }
}

@media (max-width: 800px) {
    .activity-showcase {
        padding: 12px;
        border-radius: 18px;
    }

    .activity-accordion {
        height: 430px;
        padding: 10px;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }

    .activity-accordion::-webkit-scrollbar {
        display: none;
    }

    .activity-panel,
    .activity-panel.is-active {
        flex: 0 0 78vw;
        scroll-snap-align: center;
        opacity: 1;
        transform: none;
    }

    .activity-panel-shade,
    .activity-panel.is-active .activity-panel-shade {
        opacity: 1;
    }

    .activity-panel-content,
    .activity-panel.is-active .activity-panel-content {
        padding: 20px;
        opacity: 1;
        transform: none;
        pointer-events: auto;
    }

    .activity-panel-content p {
        display: -webkit-box;
        overflow: hidden;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
    }

    .activity-vertical-title {
        display: none;
    }

    .activity-dots {
        display: none;
    }
}

@media (max-width: 520px) {
    .activity-accordion {
        height: 390px;
    }

    .activity-panel,
    .activity-panel.is-active {
        flex-basis: 84vw;
    }

    .activity-panel-content h2 {
        font-size: 1.2rem;
    }
}
