/* ============================================
   Sticky Slider Component (from Codegrid Elementis)
   Prefix: cg- (codegrid) for unique class names
   ============================================ */
/* Component Container */
.cg-sticky-slider {
    position: relative;
    width: 100%;
    height: 100dvh;
    padding: 1.5em;
    overflow: hidden;
}

/* Image Layers */
.cg-slide-images,
.cg-img,
.cg-img-container,
.cg-strip {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.cg-slide-images img,
.cg-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform-origin: center center;
}

/* Darkened Overlay */
.cg-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.15);
    z-index: 2;
    pointer-events: none;
}

/* Slide Counter (Bottom Left) */
.cg-slide-counter {
    position: absolute;
    bottom: 3.5rem;
    left: 5rem;
    z-index: 20;
    pointer-events: none;
    color: var(--color-text-inverted);
    font-variant-numeric: tabular-nums;

    /* mix-blend-mode: exclusion; */
}

.cg-counter-inner {
    display: flex;
    align-items: baseline;

    /* baseline alignment for text */
    gap: 0.35rem;
    font-weight: 500;
}

.cg-counter-mask {
    display: inline-flex;
    justify-content: flex-end;

    /* Align number to right if fixed width is larger */
    width: 1.4em;

    /* Fixed width for 2 digits to prevent jumping */
    height: 1em;

    /* Match text height */
    /* Match line-height roughly */
    overflow: hidden;
    position: relative;
    vertical-align: bottom;
    align-items: center;
}

#cg-counter-current {
    display: block;
    line-height: 1;
    position: relative;
}

.cg-counter-separator,
#cg-counter-total {
    line-height: 1;
}

/* Pagination Indicator (Bottom Right) */
.cg-slide-pagination {
    position: absolute;
    bottom: 3.5rem;
    right: 5rem;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    pointer-events: none;
}

.cg-pagination-past,
.cg-pagination-current,
.cg-pagination-remaining {
    display: flex;
    gap: 0.25rem;
}

.cg-pagination-line {
    width: 2px;
    height: 14px;
    background-color: var(--color-text-inverted);
    opacity: 0.4;
}

.cg-pagination-current .cg-pagination-line {
    opacity: 1;
}

/* Slide Info Overlay */
.cg-slide-info {
    position: absolute;
    top: 50%;
    left: 0;
    z-index: 20;
    transform: translateY(-50%);
    width: 100%;
    padding: 0.5rem 5em;
    display: flex;
    gap: 2rem;

    /* border-top: 3px solid  var(--color-bg-light); */
    align-items: center;
}

.cg-slide-info>* {
    flex: 1;
}

.cg-slide-info p,
.cg-slide-link a {
    color: var(--color-text-inverted);

    /* font-weight: 500 */
    /* line-height: 100% */
    /* letter-spacing: -0.02rem */
    /* -webkit-font-smoothing: antialiased */
    /* font-size: 36px */
    text-decoration: none;

    /* top: -0.9rem */
}

.cg-slide-link {
    display: flex;
    justify-content: flex-end;
}

.cg-slide-title {
    position: relative;
    flex: 2;
    padding-bottom: 1rem;
    top: 0.6rem;

    /* height: 68px */
    overflow: hidden;
    padding-left: 0.5rem;
    left: -0.1rem;
    align-items: center;
    display: flex;
}

.cg-slide-title p {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%);
    padding-bottom: 1.2rem;
}

/* Responsive */
@media (max-width: 991px) {
    .cg-slide-title-prefix {
        display: none;
    }

    .cg-slide-title {
        height: 22px;
    }

    .cg-slide-info p,
    .cg-slide-link a {
        font-size: 18px;
    }
}

/* ============================================
   Dropdown Panel (Projects-style layout)
   Light theme, 2-column: text left, image right
   ============================================ */
.cg-dropdown-panel {
    position: absolute;

    /* Dynamically set by JS to align with .cg-slide-title */
    top: var(--dropdown-top, 50%);
    left: 0;
    width: 100%;
    background: var(--color-bg-light);
    z-index: 100;
    padding: 2.5rem 5rem 2.5rem 5rem;

    /* Initial state: hidden via clip-path (controlled by JS) */
    clip-path: inset(0% 0% 100% 0%);
    pointer-events: none;
}

.cg-dropdown-panel.is-open {
    pointer-events: auto;
    overflow-y: auto;

    /* max-height: calc(50vh - 40px); */
}

/* Two-column content layout */
.cg-dropdown-content {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 3rem;
}

/* Left Column: Text content */
.cg-dropdown-text {
    flex: 1;
    max-width: 55%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    min-height: 100%;
}

/* Brand Title - positioned to align with overlay title */
.cg-dropdown-title {
    position: relative;
    top: -0.7rem;

    /* Match overlay title offset */
    margin: 0 0 1.5rem 0;
    padding-left: 0.5rem;
    color: var(--color-text-main);
    letter-spacing: -0.025em;
    line-height: 1.1;
}

/* Description */
.cg-dropdown-description {
    margin: 0 0 2rem 0;
    color: var(--color-text-muted);
    line-height: 1.6;
}

/* Metadata Grid (Origin, Specialty) */
.cg-dropdown-meta {
    display: grid;
    grid-template-columns: repeat(3, 12rem);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.cg-meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.cg-meta-label {
    text-transform: uppercase;
    opacity: 0.7;
    color: var(--color-text-main);
}

.cg-dropdown-origin,
.cg-dropdown-specialty {
    color: var(--color-text-main);
}

/* Actions Row (Close + Visit Website) */
.cg-dropdown-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-top: auto;
}

/* Close Button */
.cg-dropdown-close {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: 1px solid var(--color-text-main);
    color: var(--color-text-main);
    font-family: var(--font-primary);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.cg-dropdown-close:hover {
    background: var(--color-text-main);
    color: var(--color-bg-light);
}

/* Visit Website Link */
.cg-dropdown-website {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-primary);
    font-size: 0.875rem;
    font-weight: 500;
    text-transform: lowercase;
    letter-spacing: 0;
    color: var(--color-text-main);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.cg-dropdown-website:hover {
    opacity: 0.6;
}

/* Right Column: Image */
.cg-dropdown-image {
    width: 25%;
    aspect-ratio: 4 / 3;
    border-radius: 0.1rem;
    overflow: hidden;
    flex-shrink: 0;
    align-self: flex-start;
}

.cg-image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.cg-image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1s ease;
}

.cg-image-wrapper img:first-child {
    opacity: 1;
}

/* Dropdown Responsive */
@media (max-width: 991px) {
    .cg-dropdown-panel {
        /* top is set dynamically by JS */
        padding: 1.5rem;
    }

    .cg-dropdown-panel.is-open {
        max-height: 60vh;
    }

    .cg-dropdown-content {
        flex-direction: column;
    }

    .cg-dropdown-text {
        max-width: 100%;
    }

    .cg-dropdown-image {
        width: 100%;
        max-height: 200px;
    }
}

@media (max-width: 479px) {
    .cg-dropdown-panel.is-open {
        padding: 1rem;
    }

    .cg-dropdown-meta {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .cg-dropdown-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}