/* ==========================================================================
   Section Gallery - 30 Years Journey
   Coded to match the dark theme design
   ========================================================================== */

.hp-gallery {
    padding: 80px 0;
    background: var(--section-background-gradient);
    overflow: hidden;
    color: #FFFFFF;
}

.hp-gallery-header {
    text-align: center;
    margin-bottom: 50px;
}

.hp-gallery-tag {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-mono, 'Geist Mono', monospace);
    font-size: 0.8125rem;
    font-weight: 600;
    color: #F97316;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 16px;
}

.hp-gallery-tag-line {
    width: 32px;
    height: 1px;
    background-color: #F97316;
}

.hp-gallery-title {
    font-family: var(--font-display, 'Geist', sans-serif);
    font-size: 2.5rem;
    font-weight: 700;
    color: #3B82F6;
    line-height: 1.2;
    margin: 0 0 16px 0;
    text-transform: uppercase;
    letter-spacing: -0.01em;
}

@media (max-width: 1024px) {
    .hp-gallery-title {
        font-size: 2.8rem;
    }
}

@media (max-width: 767px) {
    .hp-gallery-title {
        font-size: 2rem;
    }
}

.hp-gallery-desc {
    font-family: var(--font-body, 'Geist', sans-serif);
    font-size: 1rem;
    color: #94A3B8;
    max-width: 70ch;
    margin: 0 auto;
    line-height: 1.6;
}

/* Timeline Navigation */
.hp-gallery-nav-wrapper {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 20px;
    margin: 0 auto 40px auto;
    max-width: 100%;
}

.hp-gallery-nav-arrow {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94A3B8;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-bottom: -2px;
}

.hp-gallery-nav-arrow:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #FFFFFF;
    border-color: rgba(255, 255, 255, 0.3);
}

.hp-gallery-nav {
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
    position: relative;
    padding: 60px 0 20px 0; /* Extra top padding so the text doesn't clip */
}

.hp-gallery-nav::-webkit-scrollbar {
    display: none;
}

.hp-gallery-tabs-container {
    position: relative;
    min-width: 1000px;
    width: 100%;
}

.hp-gallery-ruler-svg {
    width: 100%;
    height: auto;
    display: block;
}

.hp-gallery-tabs {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    list-style: none;
    padding: 0;
    margin: 0;
    min-width: 100%;
}

.hp-gallery-tab-item {
    position: absolute;
    top: 0 !important; /* Override inline top */
    height: 100%; /* Spans from top of SVG to baseline */
    text-align: center;
    transform: translateX(-50%); /* Center horizontally on the percentage */
    z-index: 2;
}

/* Draw the major tick (cột mốc) from the dot down to the baseline */
.hp-gallery-tab-item::before {
    content: '';
    position: absolute;
    top: -4px; /* Starts exactly from the bottom of the dot */
    bottom: 0; /* Reaches exactly down to the baseline, no matter the SVG height */
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    background-color: #fff;
    z-index: -1;
    pointer-events: none;
}

.hp-gallery-tab-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    outline: none;
    z-index: 2;
    position: absolute;
    bottom: 100%; /* Puts the button exactly above the SVG */
    margin-bottom: 4px; /* Gap above the SVG */
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap; /* Prevent text wrapping */
}

.tab-year {
    font-family: var(--font-body, 'Geist', sans-serif);
    font-size: 1.125rem;
    font-weight: 400;
    color: #94A3B8;
    transition: color 0.3s ease, font-weight 0.3s ease;
}

.tab-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid #94A3B8;
    background-color: #050B14;
    position: relative;
    transition: all 0.3s ease;
}

.hp-gallery-tab-btn:hover .tab-year {
    color: #E2E8F0;
}

.hp-gallery-tab-btn.is-active .tab-year {
    color: #F97316;
    font-weight: 700;
}

.hp-gallery-tab-btn.is-active .tab-dot {
    background-color: #F97316;
    border-color: #F97316;
    transform: scale(1.2);
}

/* Active styling adjustments not needed since tick is removed */

.hp-gallery-sliding-line {
    position: absolute;
    top: 100%; /* Lock to the baseline */
    width: 120px;
    height: 2px;
    background: linear-gradient(90deg, rgba(249, 115, 22, 0), rgba(249, 115, 22, 1) 50%, rgba(249, 115, 22, 0));
    transform: translate(-50%, -50%);
    z-index: 1;
    border-radius: 2px;
    transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    list-style: none;
}

/* Panels */
.hp-gallery-panels {
    position: relative;
    width: 100%;
    margin: 0 auto;
}

.hp-gallery-panel {
    display: none;
}

.hp-gallery-panel.is-active {
    display: block;
}

.hp-gallery-panel-inner {
    display: flex;
    gap: 40px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
}

/* Gallery Grid — Row-fill (left→right) */
.hp-gallery-grid {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
}

.hp-gallery-img-wrapper {
    height: 220px;
    width: auto;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    flex: 0 0 auto;
}

.hp-gallery-img-wrapper img {
    height: 100%;
    width: auto;
    object-fit: contain;
    display: block;
    transition: transform 0.4s ease;
}

.hp-gallery-img-wrapper:hover img {
    transform: scale(1.04);
}

/* Responsive Adjustments */
@media (max-width: 1200px),
(max-width: 1024px),
(max-width: 991px),
(max-width: 767px),
(max-width: 480px) {
    .hp-gallery-grid {
        /* Keep flex layout on all screens */
    }
}
