:root {
    --color-bg: #1b1b1b;
    --color-text-inactive: #d9d9d9;
    --color-text-active: #ffffff;
    font-size: 90%;
}

body {
    background-color: var(--color-bg);
    font-family: 'Inter', sans-serif;
    margin: 0;
    display: flex;
    justify-content: center;
    cursor: default;
    transition: background-color 0.8s cubic-bezier(0.25, 1, 0.5, 1);
    overflow-x: hidden;
}

/* --- ENTRANCE ANIMATION --- */
.list-item {
    opacity: 0;
    transform: translateY(1.875rem);
    transition: opacity 0.6s cubic-bezier(0.25, 1, 0.5, 1),
        transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.list-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.container {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    padding: 25vh 1.5rem;
    max-width: 56.25rem;
    width: 100%;
    box-sizing: border-box;
}

.trigger {
    /* Changed from p.trigger */
    font-size: 1.8rem;
    margin: 0;
    font-weight: 600;
    color: var(--color-text-inactive);
    letter-spacing: -1px;
    transition: color 0.4s ease;
    display: flex;
    align-items: center;
    width: 100%;
    scroll-margin-top: 5vh;
}

.list-item:first-of-type .trigger {
    scroll-margin-top: 25vh;
}

.trigger a {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    width: 100%;
}

.link-title {
    font-size: inherit;
    font-weight: inherit;
    margin: 0;
    /* Original style */
    margin-right: 1.5rem;
}

.meta-info {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.date {
    font-size: 1.2rem;
    font-weight: 400;
    white-space: nowrap;
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    transition: opacity 0.4s ease, max-width 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.list-item:hover .date {
    opacity: 1;
    max-width: 10rem;
}

.pill {
    display: inline-block;
    margin-left: 0;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 999px;
    transition: all 0.4s ease;
    border: 2px solid transparent;
    white-space: nowrap;
    background-color: var(--item-color);
    color: var(--color-text-active);
}

/* --- HOVER & ACTIVE STATES --- */
.link-item:hover>.trigger,
/* Changed from p.trigger */
.dropdown-item:not(.is-open):hover>.trigger {
    color: var(--color-text-active);
}

.link-item:hover .pill,
.dropdown-item:not(.is-open):hover .pill {
    background-color: transparent;
    border-color: var(--color-text-active);
}

.dropdown-item.is-open>.trigger {
    /* Changed from p.trigger */
    color: var(--color-text-active);
}

.dropdown-item.is-open {
    position: relative;
    z-index: 10;
}

.dropdown-item.is-open .pill {
    background-color: transparent;
    border-color: var(--color-text-active);
}

/* --- DROPDOWN SPECIFICS --- */
.dropdown-item>.trigger {
    cursor: pointer;
}

.dropdown-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease-out, padding-top 0.5s ease-out;
    transition-delay: 0.6s;
    /* Wait for image to close */
    color: var(--color-text-active);
    font-size: 1.25rem;
    line-height: 1.6;
}

.dropdown-item.is-open .dropdown-content {
    padding-top: 1rem;
    max-height: 2000px;
    overflow: visible;
    transition-delay: 0s;
    /* Open immediately */
}

/* Ensure overflow is visible during closing phase for breakout images */
.dropdown-item.is-closing .dropdown-content {
    overflow: visible;
}

.dropdown-image {
    width: 80vw;
    max-width: 62.5rem;
    height: auto;
    border-radius: 1rem;
    margin: 2rem 0;
    object-fit: cover;
    position: relative;
    z-index: 1;
    margin-left: 50%;
    transform: translateX(-50%);

    /* Slide Effect */
    clip-path: inset(0 var(--clip-inset, 50%) 0 var(--clip-inset, 50%));
    transition: clip-path 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    transition-delay: 0s;
    /* Close immediately */
}

.dropdown-item.is-open .dropdown-image {
    clip-path: inset(0 0 0 0);
    transition-delay: 0.4s;
    /* Wait for dropdown to open */
}

/* --- IMAGE SLIDER (FULL WIDTH) --- */
.image-slider {
    display: flex;
    gap: 2.5rem;
    overflow-x: auto;
    margin: 2rem 0;
    scroll-snap-type: x mandatory;
    position: relative;
    z-index: 1;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    box-sizing: border-box;
    padding: 0 calc(50vw - 62.5rem / 2);
    scrollbar-width: none;
    -ms-overflow-style: none;

    /* Slide Effect */
    clip-path: inset(0 var(--clip-inset, 50%) 0 var(--clip-inset, 50%));
    transition: clip-path 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    transition-delay: 0s;
}

.dropdown-item.is-open .image-slider {
    clip-path: inset(0 0 0 0);
    transition-delay: 0.4s;
}

.image-slider::-webkit-scrollbar {
    display: none;
}

.slider-image {
    flex: 0 0 80vw;
    width: 80vw;
    max-width: 62.5rem;
    aspect-ratio: 3 / 2;
    height: auto;
    border-radius: 1rem;
    object-fit: cover;
    cursor: pointer;
    scroll-snap-align: center;
}

.button {
    display: inline-block;
    background-color: #fff;
    color: #333;
    border: none;
    padding: 0.5rem 1rem;
    margin-top: 1rem;
    margin-right: 0.8rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.2s ease;
    text-decoration: none;
}

/* --- EXTERNAL LINK ICON --- */
.link-item:hover .pill::after,
.button:hover::after {
    content: '';
    display: inline-block;
    width: 0.8em;
    height: 0.8em;
    margin-left: 0.4em;
    background-color: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3Cpolyline points='15 3 21 3 21 9'/%3E%3Cline x1='10' y1='14' x2='21' y2='3'/%3E%3C/svg%3E") no-repeat center / contain;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6'/%3E%3Cpolyline points='15 3 21 3 21 9'/%3E%3Cline x1='10' y1='14' x2='21' y2='3'/%3E%3C/svg%3E") no-repeat center / contain;
    vertical-align: -0.1em;
}

/* --- DESKTOP CURSORS --- */
@media (min-width: 769px) {
    .slider-image.cursor-left {
        cursor: url("data:image/svg+xml,%3Csvg width='32' height='32' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M19 12H5'/%3E%3Cpath d='M12 19l-7-7 7-7'/%3E%3C/svg%3E") 16 16, w-resize;
    }

    .slider-image.cursor-right {
        cursor: url("data:image/svg+xml,%3Csvg width='32' height='32' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='M12 5l7 7-7 7'/%3E%3C/svg%3E") 16 16, e-resize;
    }
}

/* --- RESPONSIVE --- */
@media (max-width: 1032px) {
    .image-slider {
        padding: 0 1.5rem;
    }
}

@media (max-width: 768px) {
    .trigger {
        /* Changed from p.trigger */
        font-size: 1.2rem;
        flex-wrap: wrap;
    }

    .trigger a {
        flex-wrap: wrap;
    }

    .link-title {
        margin-right: 0;
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .meta-info {
        margin-left: 0;
        gap: 0.8rem;
        width: 100%;
        flex-direction: row-reverse;
        justify-content: flex-end;
    }

    .date {
        font-size: 0.9rem;
        opacity: 1;
        max-width: 10rem;
    }

    .pill,
    .button {
        font-size: 0.9rem;
        padding: 6px 12px;
    }

    .dropdown-content {
        font-size: 1rem;
    }

    .image-slider {
        width: calc(100% + 1.5rem);
        margin: 2rem 0;
        margin-right: -1.5rem;
        padding: 0;
        gap: 1rem;
        margin-left: 0;
    }

    .slider-image {
        flex-basis: 85%;
        width: 85%;
        scroll-snap-align: start;
    }

    .dropdown-image {
        width: 100%;
        margin-left: 0;
        transform: none;
    }

    /* Disable slide animation on mobile */
    .dropdown-image,
    .image-slider {
        clip-path: inset(0 0 0 0) !important;
        transition: none !important;
    }
}

/* --- BIO DROPDOWN SPECIFICS --- */
#bio .dropdown-content {
    position: relative;
}

#bio .bio-overlay {
    position: absolute;
    bottom: 3.5rem;
    left: 1.5rem;
    background-color: #fff;
    color: #1b1b1b;
    padding: 1.5rem;
    border-radius: 0.75rem;
    max-width: 25rem;
    width: calc(100% - 3rem);
    z-index: 10;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}

#bio .bio-overlay p {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 550;
    line-height: 1.5;
}

@media (max-width: 768px) {
    #bio .bio-overlay {
        bottom: 2rem;
        left: 1rem;
        right: 1rem;
        width: auto;
        max-width: none;
    }
}