/* ================================
   FONTS
   ================================ */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,100..700;1,100..700&display=swap');

/* ================================
   RESET & BASE STYLES
   ================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-weight: 450;
    line-height: 1.6;
    color: #000;
    background: #fff;
}

a {
    color: #000;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* ================================
   LAYOUT: DESKTOP TWO-COLUMN
   ================================ */
body {
    display: flex;
    align-items: flex-start;
}

/* Left Column: Profile (fixed width) */
.profile {
    width: 280px;
    padding: 40px 60px 40px 30px;
    position: sticky;
    top: 0;
    height: 100vh;
    flex-shrink: 0;
}

.profile-content {
    max-width: 220px;
}

.profile-name {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 20px;
    line-height: 1.2;
}

.profile-name-link {
    text-decoration: none;
    color: inherit;
}

.profile-name-link:hover {
    text-decoration: none;
}

.profile-image {
    max-width: 150px;
    width: 100%;
    margin-bottom: 20px;
}

.profile-intro {
    font-size: 0.8rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

.profile-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.nav-link {
    font-size: 0.875rem;
    display: block;
    text-decoration: underline;
}

/* Right Column: Main Content (fixed width) */
.content {
    width: 750px;
    padding: 40px 40px 80px 0;
    flex-shrink: 0;
}

/* ================================
   PAGE VISIBILITY
   ================================ */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* ================================
   SLIDER STYLES
   ================================ */
.slider {
    margin-bottom: 50px;
}

.slider-viewport {
    overflow: hidden;
    border: none;
    position: relative;
}

/* Autoplay slider: 3:1 ratio (cinematic widescreen) */
.autoplay-slider .slider-viewport {
    aspect-ratio: 3 / 1;
}

/* Manual slider: 16:9 ratio (standard) */
.manual-slider .slider-viewport {
    aspect-ratio: 16 / 9;
}

.slider-track {
    width: 100%;
    height: 100%;
    position: relative;
}

.slider-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    z-index: 1;
}

.slider-slide.active {
    opacity: 1;
    z-index: 2;
}

.slider-slide img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

/* Manual slider: contain to show full images */
.manual-slider .slider-slide img {
    object-fit: contain;
    background: #ffffff;
}

.slider-caption {
    font-size: 0.85rem;
    margin-top: 8px;
    color: #000;
}

/* Slider Thumbnails (manual slider only) */
.slider-thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.slider-thumb {
    width: 80px;
    height: 60px;
    border: none;
    cursor: pointer;
    overflow: hidden;
}

.slider-thumb.active {
    border-width: 0;
}

.slider-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Hide autoplay slider on mobile */
@media (max-width: 500px) {
    .autoplay-slider {
        display: none;
    }
}

/* ================================
   PROJECT LIST
   ================================ */
.project-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px 30px;
}

.project-item {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.project-item:hover {
    text-decoration: none;
}

.project-thumbnail {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border: none;
    overflow: hidden;
}

.project-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-item-content {
    flex: 1;
    min-width: 0;
    font-size: 0.8rem;
    line-height: 1.4;
}

.project-item-content::before {
    content: '';
    display: block;
    height: 0;
    width: 0;
    margin-top: calc((1 - 1.5) * 0.5em);
}

.project-item-title {
    font-size: inherit;
    font-weight: 700;
    line-height: inherit;
    display: inline;
}

.project-item-description {
    font-size: inherit;
    line-height: inherit;
    display: inline;
    white-space: pre-line; /* render \n as line breaks in descriptions */
}

.project-item:hover .project-item-title {
    text-decoration: underline;
}

/* Disabled projects (no data file) - keep visual appearance normal */
.project-item.disabled {
    cursor: default;
    pointer-events: none;
}

.slider-slide .disabled-link {
    cursor: default;
    pointer-events: none;
}

/* ================================
   PROJECT DETAIL
   ================================ */
.project-detail {
    max-width: 680px;
}

.project-title {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 15px;
    line-height: 1.3;
}

.project-description {
    font-size: 0.85rem;
    margin-bottom: 30px;
    line-height: 1.6;
    white-space: pre-line; /* render \n as line breaks in project detail */
}

.project-content {
    font-size: 0.85rem;
    line-height: 1.7;
    margin-bottom: 40px;
}

.project-content p {
    margin-bottom: 20px;
    white-space: pre-line; /* render \n as line breaks in content paragraphs */
}

.project-links h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.project-links ul {
    list-style: none;
}

.project-links li {
    margin-bottom: 8px;
}

.project-links a {
    font-size: 0.85rem;
    border-bottom: 1px solid #000;
}

.project-links a:hover {
    text-decoration: none;
    border-bottom-width: 2px;
}

/* ================================
   MOBILE LAYOUT (single breakpoint)
   ================================ */
@media (max-width: 500px) {
    body {
        flex-direction: column;
        min-width: 0;
    }

    /* Profile becomes full-width top section */
    .profile {
        width: 100%;
        min-width: 0;
        height: auto;
        position: static;
        padding: 30px 20px 0px 20px;
    }

    .profile-content {
        max-width: 100%;
        min-width: 0;
    }

    .profile-nav {
        display: flex;
        flex-direction: row;
        gap: 10px;
        margin-top: 20px;
        position: fixed;
        bottom: 15px;
        right: 15px;
        z-index: 100;
        background-color: #e0e0e0;
        padding: 7px 9px;
        box-shadow: 4px 4px 0px 0px #363636;
    }

    .nav-link {
        font-size: 0.875rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        text-decoration: none;
    }

    .nav-link.active {
        border-bottom: none;
    }

    /* Content becomes full-width */
    .content {
        width: 100%;
        min-width: 0;
        padding: 30px 20px 60px;
    }

    /* Project list becomes single column */
    .project-list {
        grid-template-columns: 1fr;
        gap: 35px;
    }

    .slider-thumbnails {
        gap: 8px;
    }

    .slider-thumb {
        width: 60px;
        height: 45px;
    }
}

/* ================================
   CV PAGE & HOBBIES
   ================================ */
.cv-section {
    margin-bottom: 40px;
}

.cv-link {
    font-size: 0.9375rem;
    border-bottom: 1px solid #000;
}

.cv-link:hover {
    text-decoration: none;
    border-bottom-width: 2px;
}

.hobbies h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 15px;
    line-height: 1.3;
}

/* Personal Hobbies Table */
.personal_desktop {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    border-collapse: collapse;
}

.personal_desktop tbody tr {
    vertical-align: middle;
}

.personal_desktop tbody tr td {
    padding: 1.25%;
}

/* Image column */
.personal_desktop tbody tr td:first-child {
    padding-left: 0;
    width: 46%;
}

/* Text column */
.personal_desktop tbody tr td:last-child {
    padding-right: 0;
    width: 54%;
}

.personal_desktop .hobby-images {
    display: flex;
    gap: 2.5%;
}

.personal_desktop .hobby-images > div {
    flex: 1;
    min-width: 0;
}

.personal_desktop .hobby-images img {
    width: 100%;
    height: auto;
    display: block;
}

.personal_desktop p {
    font-size: 0.8rem;
    line-height: 1.4;
    margin: 0;
}

.personal_desktop a {
    color: #000;
    text-decoration: underline;
}

.personal_desktop a:hover {
    text-decoration: none;
}

/* Mobile responsive layout */
@media (max-width: 500px) {
    .personal_desktop {
        display: block;
        max-width: 100%;
    }

    .personal_desktop tbody,
    .personal_desktop tr {
        display: block;
        width: 100%;
    }

    .personal_desktop tbody tr td {
        display: block;
        width: 100% !important;
        padding: 0 0 20px 0 !important;
    }

    .personal_desktop tbody tr td:last-child {
        padding-bottom: 30px !important;
    }

    .personal_desktop .hobby-images {
        margin-bottom: 15px;
    }
}
