/* FHP Portfolio Slider Styles */

#fhp-portfolio-root {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    z-index: 10;
}

/* Hide scrollbar but keep functionality */
#fhp-portfolio-root::-webkit-scrollbar {
    width: 0px;
    background: transparent;
}

#fhp-portfolio-root {
    scrollbar-width: none;
}

.fhp-portfolio-page {
    padding: 0;
    margin: 0;
}

/* Slide Container */
.fhp-slide {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 24px;
    width: 100vw;
    min-height: 100vh;
    min-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    padding: var(--space-8);
    margin: 0;
    box-sizing: border-box;
    position: relative;
    z-index: 15;
    scroll-snap-align: start;
    scroll-snap-stop: always;

    transition: opacity 0.6s ease;
}

.fhp-slide[data-slide="6"] {
    width: 100vw;
    max-width: 100vw;
    padding: 0;
    margin: 0;
    touch-action: pan-x pan-y;
}

.fhp-slide.active {
    opacity: 1;
}

/* Hero Slide */
.hero-slide {
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 24px;
    font-weight: var(--font-heading-weight);
    color: var(--color-text-primary);
    margin-bottom: var(--space-7);
    line-height: 1.2;
    /* text-shadow: var(--shadow-glow); */
    display: block;
    /* height: 100px */
}

.typewriter-text {
    white-space: pre-wrap;
    display: inline;
}

.typewriter-cursor {
    display: inline-block;
    width: 4px;
    height: 1.2em;
    background-color: var(--color-accent);
    box-shadow: 0 0 10px var(--color-accent);
    animation: none;
    align-self: center;
    vertical-align: baseline;
    margin-bottom: -5px; /* nudge down to sit with baseline */
}

.typewriter-cursor.hidden {
    opacity: 0;
}

.typewriter-cursor.blinking {
    animation: cursorBlink 1s infinite;
}

@keyframes cursorBlink {
    0%, 50% { opacity: 1; }
    50.01%, 100% { opacity: 0; }
}

.hero-disclaimer {
    font-size: var(--font-base-size);
    color: var(--color-text-primary);
    /* line-height: 1.6; */
    max-width: 600px;
    margin: 0 auto;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.hero-disclaimer.visible {
    opacity: 1;
}

.hero-down-btn {
    opacity: 0;
    transition: opacity 0.4s ease;
}

.hero-down-btn.visible {
    opacity: 1;
}

.hero-disclaimer p {
    margin-bottom: var(--space-4);
}

.hero-disclaimer p:last-child {
    margin-bottom: 0;
}

/* Regular Slide Content */
.slide-content {
    max-width: 800px;
    width: 100%;
    padding: var(--space-6);
    display: flex;
    flex-direction: column;
    gap: var(--space-6);
    align-items: start;
    background: #191226;
    box-shadow: 0 0 50px 0 rgba(244, 243, 198, 0.25);
    position: relative;
    z-index: 25;
    pointer-events: auto;
    overflow: hidden;
}

.slide-header {
    display: flex;
    flex-direction: row;
    gap: var(--space-6);
}

.slide-header-trailing {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-start;
    flex: 1 0 0;
    padding:  var(--space-3) 0;
}


.slide-title-hold {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap:  var(--space-3);
    align-self: stretch;
}

.slide-title {
    color: var(--color-yellow-87, #F4F3C7);
    text-shadow: 0 0 12px #F4F3C6;
    font-family: "iA Writer Quattro S";
    font-size: 18px;
    font-style: normal;
    font-weight: 700;
    line-height: normal;
    margin: 0;
}

.slide-subtitle {
    color: var(--color-yellow-87, #F4F3C7);
    font-family: "iA Writer Quattro S";
    font-size: var(--font-base-size);
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    margin: 0;
}

.slide-description {
    font-size: var(--font-base-size);
    margin: 0;
    max-width: 600px;
}

.slide-context-info {
    color: var(--color-text-muted);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
}

.slide-thumb {
    width: 240px;
    height: 180px;
    aspect-ratio: 4/3;
    object-fit: cover;
}

.slide-gallery {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    margin: 0;
    overflow-x: scroll;
    width: 100%;
    padding: 0 24px;
    margin: 0 -24px;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.slide-gallery::-webkit-scrollbar {
    display: none;
  }
  
/* Hide scrollbar for IE, Edge and Firefox */
.slide-gallery {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.slide-gallery img {
    height: 80px;
    /* aspect-ratio: 4/3; */
    object-fit: cover;
    cursor: pointer;
}

.slide-gallery img:hover {
    outline: 2px solid var(--color-accent);
    outline-offset: -2px;
    /* use outline instead of border to avoid resizing the image on hover */
}

.minor-projects-container {
    width: 100vw;
    overflow: visible;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    position: relative;
    z-index: 30;
    pointer-events: none;
}

.minor-projects {
    pointer-events: none;
}

.minor-projects * {
    pointer-events: auto;
}

.minor-projects {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--space-7);
    transition: transform 0.6s ease;
    will-change: transform;
}

.minor-project-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-6);
    width: 288px;
    min-width: 288px;
    max-width: 288px;
    flex-shrink: 0;
    box-shadow: 0 0 20px 0 rgba(244, 243, 198, 0.1);
    padding: var(--space-6);
    background: #191226;
    opacity: 1;
    transition: box-shadow 0.6s ease, color 0.6s ease;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
    color: var(--color-text-muted);
    pointer-events: auto;
    position: relative;
    z-index: 20;
}

.minor-project-content.active {
    box-shadow: 0 0 50px 0 rgba(244, 243, 198, 0.25);
    color: var(--color-text-primary);
}

.minor-project-content.active * {
    color: var(--color-text-primary);
}

.minor-project-content:not(.active) * {
    color: var(--color-text-muted);
    text-shadow: none;
}

.minor-project-content * {
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.minor-project-content a:hover {
    color: var(--color-accent);
}

/* Minor Projects Navigation Buttons */
.fhp-slide[data-slide="6"] .minor-nav-btn {
    position: absolute;
    bottom: 0;
    height: 50vh;
    width: 50vw;
    background: none;
    border: none;
    padding: 0;
    z-index: 10;
    pointer-events: auto;
    cursor: pointer;
    display: block;
    visibility: visible;
}

.fhp-slide[data-slide="6"] .minor-nav-btn:hover {
    background-color: rgba(244, 243, 198, 0.05);
}

.fhp-slide[data-slide="6"] .minor-nav-btn:active,
.fhp-slide[data-slide="6"] .minor-nav-btn:focus {
    background-color: transparent;
    outline: none;
}

.fhp-slide[data-slide="6"] .minor-nav-left {
    left: 0;
    cursor: url('/static/icons/cursor/arrow-left.svg') 8 20, pointer;
}

.fhp-slide[data-slide="6"] .minor-nav-right {
    right: 0;
    cursor: url('/static/icons/cursor/arrow-right.svg') 8 20, pointer;
}

.slide-buttons {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    align-self: stretch;
}

.slide-buttons-trailing {
    display: flex;
    flex-direction: row;
    gap: var(--space-6);
}

.slide-buttons-leading {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

a:hover {
    color: var(--color-accent);
    text-decoration: none;
}

/* Lightbox Modal */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(25, 18, 38, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;

}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-image-container {
    position: relative;
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
}

.lightbox-image-container img {
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Description Lightbox */
.description-lightbox {
    position: relative;
    max-width: 90vw;
    max-width: 600px;
    padding: var(--space-6);
    color: var(--color-text-primary);
    font-size: var(--font-base-size);
    line-height: 1.6;
    cursor: default;
}

.description-lightbox p {
    margin: 0 0 var(--space-4) 0;
}

.description-lightbox p:last-child {
    margin-bottom: 0;
}

/* Links lightbox: allow full available width */
.links-lightbox {
    max-width: 90vw;
    width: 90vw;
    box-sizing: border-box;
    padding: 0;
}


/* Navigation Buttons */
.slide-nav-btn {
    position: absolute;
    left: 0;
    right: 0;
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 10;
    pointer-events: auto;
}

.slide-nav-btn:hover {
    background-color: rgba(244, 243, 198, 0.05);
}

.slide-nav-btn:active,
.slide-nav-btn:focus {
    background-color: transparent;
    outline: none;
}

.hero-slide .up-btn {
    display: none;
}

.fhp-slide:last-of-type .down-btn {
    display: none;
}

.up-btn {
    top: 0;
    height: 50vh;
    cursor: url('/static/icons/cursor/arrow-up.svg') 8 20, pointer;
}

.down-btn {
    bottom: 0;
    height: 50vh;
    align-items: flex-end;
    cursor: url('/static/icons/cursor/arrow-down.svg') 8 20, pointer;
}

/* Global buttons visibility handled by JavaScript */

/* Arrow icons removed - using cursor instead */

/* Mobile Responsive Design (< 900px) */
@media (max-width: 899px) {
    /* Remove margins and padding from html and body on mobile for this page only */
    body:has(#fhp-portfolio-root) {
        margin: 0;
        padding: 0;
        width: 100vw;
        max-width: 100vw;
    }

    html:has(#fhp-portfolio-root) {
        margin: 0;
        padding: 0;
        width: 100vw;
        max-width: 100vw;
        overflow-x: hidden;
    }

    /* Full screen slides */
    .fhp-slide {
        padding: 0 var(--space-6);
        width: 100vw;
        height: 100vh;
        height: 100dvh;
    }

    /* Remove glow from slide content and expand to full height */
    .slide-content {
        box-shadow: none;
        height: 100%;
        display: flex;
        flex-direction: column;
        gap: var(--space-6);
        justify-content: flex-start;
        padding: var(--space-6);
    }

    /* Ensure all elements have 24px gap */
    .slide-content > * {
        margin: 0;
    }

    /* Push links to bottom with dynamic gap */
    .slide-buttons {
        margin-top: auto;
        padding-top: var(--space-8);
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-6);
    }

    /* Stack inner divs vertically */
    .slide-buttons-leading,
    .slide-buttons-trailing {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-3);
    }

    /* Hide description by default, show on click */
    .slide-description {
        margin: 0;
        display: none;
    }

    .slide-description.show {
        display: block;
    }

    /* Gallery with horizontal scroll on mobile */
    .slide-gallery {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0;
        margin: 0;
        margin-left: calc(-1 * var(--space-6));
        margin-right: calc(-1 * var(--space-6));
        padding-left: var(--space-6);
        padding-right: var(--space-6);
        width: calc(100% + 2 * var(--space-6));
    }

    .slide-gallery img {
        height: 144px;
    }

    /* Hide navigation buttons on mobile (using swipe instead) */
    .slide-nav-btn {
        display: none !important;
    }

    /* Collapse header into vertical layout */
    .slide-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-6);
    }

    /* Keep image size, left bound */
    .slide-header img {
        width: 100%;
        max-width: 400px;
        height: auto;
        align-self: flex-start;
    }

    .slide-header-trailing {
        width: 100%;
        gap: var(--space-6);
        padding: 0;
    }

    /* Show arrow indicator on hero slide only */
    .hero-slide::after {
        content: '';
        position: absolute;
        bottom: 40px;
        left: 50%;
        transform: translateX(-50%);
        width: 48px;
        height: 48px;
        background-image: url('/static/icons/cursor/arrow-down.svg');
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        background-color: var(--color-text-primary);
        mask-image: url('/static/icons/cursor/arrow-down.svg');
        mask-size: contain;
        mask-repeat: no-repeat;
        mask-position: center;
        -webkit-mask-image: url('/static/icons/cursor/arrow-down.svg');
        -webkit-mask-size: contain;
        -webkit-mask-repeat: no-repeat;
        -webkit-mask-position: center;
        opacity: 0.8;
        animation: bounce 2s infinite;
        pointer-events: none;
        z-index: 20;
    }

    @keyframes bounce {
        0%, 100% {
            transform: translateX(-50%) translateY(0);
        }
        50% {
            transform: translateX(-50%) translateY(-10px);
        }
    }

    /* Truncate descriptions */
    .slide-description {
        display: -webkit-box;
        -webkit-line-clamp: 5;
        line-clamp: 5;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        max-height: 7.5em;
        line-height: 1.5em;
    }

    /* Read more / Show weblinks links */
    .read-more-link,
    .show-links-link {
        display: inline-block;
        margin: 0;
        color: var(--color-text-primary);
        text-decoration: underline;
        cursor: pointer;
        font-size: var(--font-base-size);
        background: none;
    }

    .read-more-link:hover,
    .show-links-link:hover {
        color: var(--color-accent);
    }

    /* Hide minor project navigation buttons on mobile */
    .fhp-slide[data-slide="6"] .minor-nav-btn {
        display: none !important;
    }

    /* Slide 6: Center active item, show next on right */
    .fhp-slide[data-slide="6"] .minor-projects-container {
        overflow-x: visible;
        pointer-events: auto;
    }

    .fhp-slide[data-slide="6"] .minor-projects {
        overflow: visible;
    }
}

/* Smooth transitions for slide content */
.slide-content > * {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger animation delays for slide content */
.slide-content > *:nth-child(1) { animation-delay: 0.1s; }
.slide-content > *:nth-child(2) { animation-delay: 0.2s; }
.slide-content > *:nth-child(3) { animation-delay: 0.3s; }
.slide-content > *:nth-child(4) { animation-delay: 0.4s; }
.slide-content > *:nth-child(5) { animation-delay: 0.5s; }


