* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@font-face {
    font-family: 'Leelawadee';
    src: url('../fonts/Leelawadee.woff2') format('woff2'),
         url('../fonts/Leelawadee.woff') format('woff'),
         url('../fonts/Leelawadee.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

body {
    font-family: 'Leelawadee', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    background: white;
    color: black;
    line-height: 1.6;
}
.container {
    width: 100%;
    padding: 0;
    margin: 0;
}

header {
    padding: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
}

header h1 {
    font-size: clamp(28px, 7.1vw, 107px);
    font-weight: normal;
    letter-spacing: 0.5px;
    padding: 20px 20px 0px 20px;
    cursor: default;
    word-wrap: break-word;
    overflow-wrap: break-word;
    color: red;
    display: flex;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
}

header h1 span {
    flex-shrink: 0;
}

.cv-link {
    font-size: clamp(14px, 3.5vw, 53px);
    font-weight: normal;
    padding: 0 20px 4px 20px;
    margin-bottom: 40px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    color: red;
    display: flex;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
}

.cv-link span {
    cursor: pointer;
    transition: opacity 0.2s;
}

.cv-link span:hover {
    opacity: 0.6;
}

.cv-link .separator {
    cursor: default;
    flex-shrink: 0;
}

.cv-link .separator:hover {
    opacity: 1;
}

.cv-link span:not(.separator) {
    flex-shrink: 0;
}

main {
    width: 100%;
    padding: 0;
}

.index-column {
    width: 100%;
    padding: 0;
}

.portfolio-index {
    list-style: none;
    width: 100%;
}

.portfolio-index li {
    font-size: clamp(14px, 3.5vw, 53px);
    margin-bottom: 0;
    padding: 2px 0 2px 20px;
    cursor: pointer;
    transition: opacity 0.2s;
    line-height: 1.2;
    width: 100%;
    border-bottom: 1px solid transparent;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.portfolio-index li:hover {
    opacity: 0.6;
}

.content-column {
    display: none;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    z-index: 1000;
    overflow-y: auto;
}

.modal.active {
    display: block;
}

.modal-content {
    background: white;
    width: 25%;
    min-width: 300px;
    padding: 40px;
    margin: 0;
    border: 1px solid #000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-height: 90vh;
    overflow-y: auto;
}

/* Popup modal in top left corner */
#popup-modal.active {
    display: block;
    background: transparent;
}

#popup-modal .modal-content {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background: white;
}

#popup-modal.large-modal .modal-content {
    width: 50%;
    min-width: 400px;
}

.popup-header {
    margin-bottom: 15px;
}

.popup-header h2 {
    font-size: 28px;
    font-weight: normal;
    color: black;
}

.popup-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.action-link {
    color: black;
    text-decoration: none;
    font-size: 18px;
    white-space: nowrap;
}

.action-link:hover {
    opacity: 0.6;
}

/* Image Slideshow */
.image-slideshow {
    margin-bottom: 30px;
}

.slideshow-container {
    position: relative;
    width: 100%;
    margin-bottom: 15px;
    overflow: hidden;
}

.slideshow-container img {
    width: 100%;
    height: auto;
    display: block;
    cursor: ew-resize;
    transition: opacity 0.25s ease-in-out;
}

.slideshow-container img.slide-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 1;
    z-index: 1;
}

.slideshow-container img.slide-image.hidden {
    opacity: 0;
    pointer-events: none;
    z-index: 0;
}

.slideshow-container img.slide-image:first-child {
    position: relative;
    z-index: 2;
}

.slideshow-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.slide-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: black;
    padding: 5px 10px;
    transition: opacity 0.2s;
}

.slide-btn:hover {
    opacity: 0.6;
}

.slide-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.slide-counter {
    font-size: 16px;
}

.popup-description {
    font-size: 20px;
    line-height: 1.8;
}

.popup-description p {
    margin-bottom: 10px;
}

/* Detail View */
.detail-page-content {
    width: 50%;
    min-width: 400px;
    max-width: 800px;
    margin: 40px auto;
    padding: 40px;
    border: 1px solid #000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    background: white;
}

.detail-modal.active {
    display: block;
    background: transparent;
}

.detail-modal .modal-content,
#cv-view .modal-content {
    width: 50%;
    min-width: 400px;
    padding: 40px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid #000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1002;
    background: white;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 10px;
}

.detail-header h2 {
    font-size: 36px;
    font-weight: normal;
    flex: 1;
    min-width: 200px;
    color: red;
}

.detail-images {
    margin-bottom: 30px;
}

.detail-images img {
    width: 100%;
    height: auto;
    display: block;
    margin-bottom: 20px;
}

.detail-description {
    font-size: 24px;
    line-height: 1.8;
    margin-bottom: 30px;
}

.detail-description p {
    margin-bottom: 20px;
}

/* CV Content */
.cv-content {
    font-size: 24px;
    line-height: 1.8;
}

.cv-content p {
    font-size: 24px;
    margin-bottom: 20px;
}

.cv-content a {
    font-size: 24px;
}

.cv-content strong {
    font-size: 24px;
}

.cv-content h3 {
    font-size: 28px;
    font-weight: normal;
    margin-top: 30px;
    margin-bottom: 15px;
}

.cv-content h3 strong {
    font-weight: bold;
}

.cv-content h3:first-of-type {
    margin-top: 0;
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: clamp(25px, 5.3vw, 64px);
        padding: 30px 20px 15px 20px;
    }

    .cv-link {
        font-size: clamp(13px, 2.7vw, 32px);
        padding: 0 20px 4px 20px;
        margin-bottom: 30px;
    }

    main {
        width: 100%;
        padding: 0;
    }

    .index-column {
        width: 100%;
        padding: 0;
    }

    .portfolio-index li {
        font-size: clamp(13px, 3.5vw, 32px);
        padding: 15px 20px;
    }

    .modal.active {
        display: block;
    }

    #popup-modal.active {
        display: block;
        background: transparent;
    }

    #popup-modal .modal-content {
        width: 50%;
        min-width: 280px;
        padding: 30px 20px;
        max-height: 95vh;
        position: fixed;
        top: 15px;
        left: 15px;
        z-index: 1001;
    }
    
    #popup-modal.large-modal .modal-content {
        width: 95%;
        min-width: 280px;
    }

    .popup-header {
        flex-direction: column;
        gap: 15px;
    }

    .popup-header h2 {
        font-size: 24px;
        min-width: auto;
    }

    .popup-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .popup-description {
        font-size: 18px;
    }

    .action-link {
        font-size: 18px;
    }

    .detail-modal.active {
        display: block;
        background: transparent;
    }

    .detail-modal .modal-content,
    #cv-view .modal-content {
        width: 95%;
        min-width: 280px;
        padding: 30px 20px;
        max-height: 95vh;
        position: fixed;
        top: 15px;
        left: 15px;
        right: auto;
        z-index: 1002;
    }

    .detail-header {
        flex-direction: column;
        gap: 15px;
    }

    .detail-header h2 {
        font-size: 28px;
        min-width: auto;
    }

    .detail-description {
        font-size: 20px;
    }
}

