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

/* Header */
body:not(.home) header.site-header {
    border-bottom: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.header-subheading {
    font-size: 1.08rem;
    letter-spacing: 0.015rem;
}
/* Nav Menu */
/*  Multi-level dropdown  */
/* Level-1 dropdown */
.nav-item { position: relative; }
.nav-item:hover > .dropdown-l1,
.dropdown-l1:hover { display: block; }

.dropdown-l1 {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    z-index: 9999;
    background: white;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    padding: 0 0;
}

/* Level-2 dropdown (flies right) */
.dropdown-l1 .sub-item { position: relative; }
.dropdown-l1 .sub-item:hover > .dropdown-l2,
.dropdown-l2:hover { display: block; }

.dropdown-l2 {
    display: none;
    position: absolute;
    top: 0;
    left: 100%;
    min-width: 220px;
    z-index: 10000;
    background: white;
    border-left: 2px solid rgba(0,0,0,0.7);
    box-shadow: 6px 8px 24px rgba(0,0,0,0.25);
    padding: 0 0;
}

/* Shared dropdown link styles */
.dropdown-l1 a,
.dropdown-l2 a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 16px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #000;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    border-bottom: 1px solid #cacaca;
    border-top: 1px solid #fbfbfb;

}
.dropdown-l1 a:hover,
.dropdown-l2 a:hover { background: rgba(0,0,0,0.7); color: #fff; }
.dropdown-l1 a.is-active,
.dropdown-l2 a.is-active { color: #000; background: rgba(0,0,0,0.04); }

/* Chevron icon for items that have children */
.has-children > a .chevron-right { display: inline-block; }
.chevron-right { width: 14px; height: 14px; flex-shrink: 0; opacity: 0.6; }

/* Caret on top-nav items */
.nav-item > a .caret-down { display: inline-block; margin-left: 3px; opacity: 0.7; transition: transform 0.15s; }
.nav-item:hover > a .caret-down { transform: rotate(180deg); }

/* Mobile accordion */
.mobile-sub { display: none; }
.mobile-sub.open { display: block; }
.mobile-sub-2 { display: none; }
.mobile-sub-2.open { display: block; }



/* ---- Home : Section Loop Layout ---- */
@media (max-width: 767px) {
    .section-background {
        background-size: 110% auto !important;
        background-position: top right !important;
    }
}
/* 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 ---- */
.hero-text-shadow {
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}
/* 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: 65vw;
    --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.9; --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 */
}



/* ---- Post : Gallery Layout ---- */
/*  Lightbox  */
.hc-gallery-item { cursor: zoom-in; }

.hc-lightbox {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
}
.hc-lightbox[hidden] { display: none !important; }

.hc-lightbox-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,.93);
    backdrop-filter: blur(6px);
}

/* Close */
.hc-lightbox-close {
    position: absolute; top: 1rem; right: 1rem; z-index: 10;
    width: 2.5rem; height: 2.5rem;
    background: rgba(255,255,255,.12); border: none; border-radius: 50%;
    color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s;
}
.hc-lightbox-close:hover { background: rgba(255,255,255,.25); }

/* Counter */
.hc-lightbox-counter {
    position: absolute; top: 1.1rem; left: 50%; transform: translateX(-50%);
    color: rgba(255,255,255,.7); font-size: .8rem; z-index: 10;
    letter-spacing: .05em; pointer-events: none;
}

/* Nav buttons */
.hc-lightbox-nav {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 10;
    width: 3rem; height: 3rem;
    background: rgba(255,255,255,.12); border: none; border-radius: 50%;
    color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .2s, opacity .2s;
}
.hc-lightbox-nav:hover { background: rgba(255,255,255,.25); }
.hc-lightbox-nav:disabled { opacity: .2; cursor: default; }
.hc-lightbox-prev { left: 1rem; }
.hc-lightbox-next { right: 1rem; }

/* Track wrap – the draggable/swipeable viewport */
.hc-lightbox-track-wrap {
    position: relative; z-index: 5;
    width: 100%; flex: 1;
    overflow: hidden;
    cursor: grab;
    user-select: none;
}
.hc-lightbox-track-wrap.is-dragging { cursor: grabbing; }

.hc-lightbox-track {
    display: flex;
    height: 100%;
    will-change: transform;
    transition: transform .32s cubic-bezier(.4,0,.2,1);
}
.hc-lightbox-track.no-transition { transition: none !important; }

/* Each slide */
.hc-lightbox-slide {
    flex: 0 0 100%;
    width: 100%;
    display: flex; align-items: center; justify-content: center;
    padding: 4rem 5rem; /* room for nav buttons */
    box-sizing: border-box;
}
@media (max-width: 640px) {
    .hc-lightbox-slide { padding: 4rem 1.5rem 1rem; }
    .hc-lightbox-nav { display: none; }
}

.hc-lightbox-img-wrap {
    display: flex; flex-direction: column;
    align-items: center; max-width: 100%; max-height: 100%;
}

.hc-lightbox-img {
    display: block;
    max-width: 100%; max-height: calc(100vh - 12rem);
    object-fit: contain;
    border-radius: .75rem;
    box-shadow: 0 8px 40px rgba(0,0,0,.6);
    pointer-events: none;
    opacity: 0;
    transition: opacity .25s;
}
.hc-lightbox-img.loaded { opacity: 1; }

.hc-lightbox-caption {
    margin-top: .75rem;
    color: rgba(255,255,255,.6); font-size: .8rem;
    text-align: center; max-width: 36rem;
    pointer-events: none;
}

/* Thumbnail strip */
.hc-lightbox-thumbs {
    position: relative; z-index: 10;
    display: flex; gap: .375rem;
    overflow-x: auto; padding: .625rem 1rem;
    max-width: 100%;
    scrollbar-width: none;
}
.hc-lightbox-thumbs::-webkit-scrollbar { display: none; }

.hc-lightbox-thumb {
    flex-shrink: 0;
    width: 3.25rem; height: 3.25rem;
    border-radius: .375rem; overflow: hidden;
    border: 2px solid transparent;
    background: none; padding: 0; cursor: pointer;
    transition: border-color .2s, opacity .2s;
    opacity: .55;
}
.hc-lightbox-thumb img {
    width: 100%; height: 100%; object-fit: cover; display: block;
}
.hc-lightbox-thumb.active,
.hc-lightbox-thumb:hover { border-color: #fff; opacity: 1; }