/* is_login() */
.is-login header {
    margin-top: 40px; /* Add top margin for Admin Toolbar */
}

/* Section */


/* ============================================================
   Article Gallery Layout  –  50:50 split (info | gallery)
   ============================================================ */

.hc-split-container {
    display: flex;
    gap: 0;
    align-items: flex-start;
}

/*  Left panel: info  */
.hc-split-info {
    width: 50%;
    flex-shrink: 0;
    padding: 0rem 3rem 2rem 0;
}

.hc-info-sticky {
    position: sticky;
    top: 5rem;
}

.hc-title {
    font-size: clamp(1.5rem, 2.5vw, 2.25rem);
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
}

.hc-excerpt {
    margin-top: 1rem;
}

/*  Right panel: gallery  */
.hc-split-gallery {
    width: 50%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.375rem; /* gap between rows */
}

/* Each row is a horizontal flex strip */
.hc-gallery-row {
    display: flex;
    gap: 0.375rem;
    width: 100%;
}

/* Each item stretches to fill its flex ratio */
.hc-gallery-item {
    overflow: hidden;
    min-width: 0;
    /* Height is driven by the image inside */
}

.hc-gallery-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.hc-gallery-item:hover img {
    transform: scale(1.03);
}

/*  Responsive: stack on mobile / tablet  */
@media (max-width: 1023px) {
    .hc-split-container {
        flex-direction: column;
    }

    .hc-split-info,
    .hc-split-gallery {
        width: 100%;
    }

    .hc-split-info {
        padding: 0 0 1.5rem 0;
    }

    .hc-info-sticky {
        position: static;
    }
}



/* ---- Home : Hero slider home ---- */
/* Setup Animation for Title and Subtitle */
.animate-title-up {
    animation: fadeUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards; /* Delay 0.3s */
}
.animate-subtitle-down {
    animation: fadeDown 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.4s forwards; /* Delay 0.4s */
}
/* Setup Animation for Description Text */
.animate-desc-fade {
    animation: fadeInOnly 0.7s ease forwards;
    animation-delay: 0.5s; /* Delay after Title/Subtitle */
}

@keyframes fadeInOnly {
    0% { opacity: 0; }
    100% { opacity: 1; }
}
@keyframes fadeUp {
    0% { opacity: 0; transform: translateY(40px); }
    100% { opacity: 1; transform: translateY(0); }
}
@keyframes fadeDown {
    0% { opacity: 0; transform: translateY(-40px); }
    100% { opacity: 1; transform: translateY(0); }
}

/*  Hero Background Ken Burns Zoom  */
@keyframes heroBgZoom {
    0%   { transform: scale(1.0); }
    50%  { transform: scale(1.06); }
    100% { transform: scale(1.0); }
}
/* Apply this class to the background div of each slide */
.hero-bg-zoom {
    animation: heroBgZoom 10s ease-in-out infinite;
    transform-origin: center center;
    will-change: transform;
}


/* ---- Home : About Section ---- */
.text-sweep-animation {
    background: linear-gradient(
        -45deg, 
        #000000 35%, 
        #c8102e 50%, 
        #000000 65%
    );
    background-size: 300% auto;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    animation: redLightSweep 8s linear infinite;
}

@keyframes redLightSweep {
    0%   { background-position: 300% center; }
    50%  { background-position: -100% center; }  /* Complete 4 seconds (25% of 16 seconds) */
    100% { background-position: -100% center; }  /* Remain still for the remaining 12 seconds */
}

/* ---- Home : Introduce Moding ---- */
/* Hide Scrollbar for the horizontal scroll container */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Variables for card sizes */
:root {
    --card-width-mobile: 85vw;
    --card-width-desktop: 480px;
    --card-width-desktop-lg: 600px;
}

.post-slider-track {
    padding-left: calc(50% - (var(--card-width-mobile) / 2));
    padding-right: calc(50% - (var(--card-width-mobile) / 2));
}

/* --- Add Effect to the card in the center --- */
.post-card {
    width: var(--card-width-mobile);
    scroll-snap-align: center;
    transform: scale(0.85); /* Scale down the card that is not in the center slightly */
    opacity: 0.6; /* Make the card that is not in the center fade */
    transition: transform 0.4s ease-out, opacity 0.4s ease-out, box-shadow 0.4s ease;
    will-change: transform, opacity; /* Improve performance during scrolling */
    user-select: none;
    -webkit-user-select: none;
}

/* While dragging, block pointer events on all child elements to prevent title tooltip/ghost from appearing */
.post-slider-track.is-dragging .post-card * {
    pointer-events: none !important;
}

/* This class will be added by JavaScript to the card in the center */
.post-card.center-active {
    transform: scale(1.13);
    opacity: 1;
    z-index: 10;
    box-shadow: 0 28px 38px -8px rgba(0,0,0,0.02), 0 12px 20px -6px rgba(0,0,0,0.10);
}

@media (min-width: 768px) {
    .post-slider-track {
        padding-left: calc(50% - (var(--card-width-desktop) / 2));
        padding-right: calc(50% - (var(--card-width-desktop) / 2));
    }
    .post-card {
        width: var(--card-width-desktop);
    }
}
@media (min-width: 1280px) {
    .post-slider-track {
        padding-left: calc(50% - (var(--card-width-desktop-lg) / 2));
        padding-right: calc(50% - (var(--card-width-desktop-lg) / 2));
    }
    .post-card {
        width: var(--card-width-desktop-lg);
    }
}

/*  Card bounce-in animation 
   Use CSS custom property --fly to store the "fly-in" transform
   so it can be combined with the scale of center-active without conflict */
.post-card {
    --fly: scale(0.85);          /* Default value (matches the normal scale) */
    opacity: 0;
    transform: var(--fly);
    transition: opacity  0.5s ease,
                transform 0.65s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.4s ease,
                outline 0.3s ease;
}

/* Direction of each card's fly-in */
.post-card.card-fly-left  { --fly: translateX(-130px) scale(0.85) rotate(-4deg); }
.post-card.card-fly-top   { --fly: translateY(-90px)  scale(0.75); }
.post-card.card-fly-right { --fly: translateX(130px)  scale(0.85) rotate(4deg); }

/* cards-in: Fly in to the normal position */
#moding-slider-section.cards-in .post-card         { opacity: 0.6; --fly: scale(0.85); }
/* The center card (center-active) stands out more than the others */
#moding-slider-section.cards-in .post-card.center-active { opacity: 1; --fly: scale(1.13); }



/* ---- Home : Section Assemble Animation ---- */
/*  Scroll Reveal Classes (used with Section Loop Layout)  */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}
.reveal-on-scroll.is-revealed {
    opacity: 1;
    transform: translateY(0);
}
.zoom-on-scroll {
    transform: scale(1.08);
    opacity: 0;
    will-change: transform, opacity;
}

/*  Section Assemble Animation  */
/* Each piece starts: transparent + slightly moved down from the top */
.sec-assemble-item {
    opacity: 0;
    transform: translateY(-22px) scaleY(0.97);
    transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}
/* When the wrap receives the class .assembled → the pieces fly in */
.sec-assemble-wrap.assembled .sec-assemble-item {
    opacity: 1;
    transform: translateY(0) scaleY(1);
}
/* reset when scrolling out */
.sec-assemble-wrap.disassembled .sec-assemble-item {
    opacity: 0;
    transform: translateY(-22px) scaleY(0.97);
    transition: none; /* reset immediately, no need to wait for animation */
}