/*---------------- My Projects page styling ----------------*/

.project-nav ul {
    margin: 0;
    padding: 10px;
    list-style-type: none;
    text-align: center;
}
.project-nav li {
    margin-bottom: 20px;
}
.project-nav a {
    color: var(--heading-color);
    text-decoration: none;
    margin-top: 80px;
    transition: background-color 0.3s, color 0.3s;
}
.project-nav a:hover {
    text-decoration: underline;
}
.project-nav h2 {
    text-align: center;
    text-decoration: underline;
    color: var(--hero-text-color);
}
.project-nav .columns {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 30px 80px 0 80px;
    gap: 40px;
}
.project-nav .columns div {
    flex: 1;
    text-align: center;
}
.projects {
    display: block;
    margin: auto;
    padding: 50px;
    padding-top: 10;
    text-align: center;
}
.projects .hover-word, .hover-word.small {
    transition: color 0.5s;
}
.projects .hover-word:hover {
    color: var(--header-hover-color);
    transition: color 0.5s;
}
.hover-word.small {
    color: rgb(255, 139, 139);
    position: relative;
}
.hover-word.small:hover, .hover-word.small:active {
    color: rgb(255, 40, 40);
    transition: color 0.5s;
}
.touch-tooltip {
    position: absolute;
    left: 100%;
    top: 120%;
    max-width: 200px;
    min-width: 120px;
    transform: translateX(-50%);
    background: #222;
    color: #fff;
    padding: 6px 12px;
    margin: 0;
    font-size: 13px;
    white-space: pre-line;
    word-break: break-word;
    z-index: 100;
    pointer-events: none;
    opacity: 0.95;
}
.highlight {
    color: rgb(255, 123, 0);
    font-weight: bold;
    transition: color 0.3s ease;
}
.projects h1 {
    font-size: 24px;
    border-bottom: 2px solid #ddd;
    padding-bottom: 10px;
}
.projects .container {
    display: flex;
    flex-direction: row;
    gap: 30px;
    margin: 20px;
    align-items: flex-start;
}
.box {
    flex: 0.5;  
    height: auto;
    padding: 30px;
    max-width: 547px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);;
    text-align: justify;
    background-color: var(--box-bg-color);
    transition: background-color 0.3s, flex 0.5s ease;
    overflow: hidden;
    cursor: pointer;
}
.box:hover {
    background-color: var(--box-hover-color);
    transition: background-color 0.3s;
}
.box p::after {
    content: "\A\A Click to expand";
    white-space: pre; 
    font-style: italic;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.box:hover p::after {
    opacity: 1;
    transition: opacity 0.3s ease;
}
.box:hover .box-description::after {
    opacity: 0;
}
.box-description a {
    color: var(--link-color);
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s ease, opacity 0.2s ease;
}
.box-description a:hover {
    opacity: 0.6;
    transition: opacity 0.2s ease;
}
.box-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.box-header h3, .box-header h4 {
    margin: 0;
    padding: 0;
    transition: font-size 0.3s ease;
}
.box-header h4 {
     opacity: 0;
     transition: opacity 0.3s ease;
}
.box:hover h4 {
    opacity: 1;
    transition: opacity 0.3s ease;
}
.box p {
    max-width: 170px;
    text-align: left;
    line-height: 20px;
}
.box-hidden { /* Collapsed box hidden content */
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    clear: both;
}
.box-hidden iframe {
    display: block;
    border: none;
    margin: 0;
    padding: 0;
    width: 500px;
    height: 260px;
    background: transparent;
}
.box.shrink { /* Collapsed box */
    flex: 0 0 50px;
    max-height: 50px;
    align-items: flex-start;
    justify-content: center;
    padding: 0;
    margin: 0;
}
.box.active { /* Opened box */
    flex: 1;
    max-width: none;
    width: 100%;
}
.box.active .box-description { /* Opened box description */
    display: block;
    max-width: 100%;
    margin: 0 40px 0 0;
    text-align: left;
    line-height: 1.4;
}
.box.shrink::before {
    content: "↓";
    display: inline-block;
    font-size: 36px;
    width: 100%;
    text-align: center;
}
.box.active .box-hidden { /* Opened box hidden content */
    max-height: max-content;
    padding-top: 20px;
}
.box video, .img-hidden {
    border-radius: 16px;
    transition: transform 0.3s ease;
    float: right;
    max-width: 400px;
}
.sidebar-column { /* Making sure the images on the side of description text in boxes are styled properly */
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.sidebar-column h3 {
    margin: 20px 0 0;
    color: var(--hero-text-color);
    transition: color 0.3s ease;
}
.img-showcase {
    border-radius: 8px;
    float: right;
    width: 300px;
    height: 300px;
    object-fit: cover;
}
.img-description {
    margin: 20px 30px 20px 0;
    width: 150px;
    height: auto;
}
.img-description.zoom {
    cursor: pointer;
    transition: transform 0.3s ease;
}
.img-description.zoom:active {
    transform: scale(2);
    float: right;
    z-index: 1000;
    position: relative;
}
.box.active h3 {
    font-size: 24px;
}
.box.shrink .box {
    max-height: 20px;
}
.box.active .img-showcase, 
.box.shrink .img-showcase, 
.box.active p, 
.box.shrink p, 
.box.shrink h3, .box.shrink h4 {
    display: none;
}


@media screen and (max-width: 850px) {
    /*---------------- My Projects page styling ----------------*/

    .project-nav h2 {
        margin-top: 0;
        margin-bottom: 10px;
        padding-top: 0;
        line-height: 1.1;
        min-height: 40px;
        display: flex;
        align-items: flex-start;
        justify-content: center;
        width: 100%;
        text-align: center;
        font-size: 20px;
    }
    .project-nav ul {
        flex-direction: column;
        gap: 10px;
        line-height: 30px;
        text-align: center;
    }
    .project-nav li {
        margin-bottom: 0;
    }
    .project-nav .columns {
        flex-direction: row;
        align-items: flex-start;
        gap: 20px;
        justify-content: center;
    }
    .project-nav .columns div {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        min-height: 80px;
        padding-top: 0;
        margin-top: 0;
        flex: 1;
    }
    .projects .container {
        flex-direction: column;
        align-items: center;
    }
    .box {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        padding: 20px;
        width: 100%;
        text-align: center;
    }
    .box-header h3 {
        text-align: left;
        flex: 1;
    }
    .box-header h4 {
        text-align: right;
        flex: 1;
    }
    .box p {
        display: flex;
        flex-direction: column;
        max-width: 100%;
        font-size: 14px;
        padding: 0 4px;
        text-align: center;
    }

    .box.active .box-description {
        text-align: left;
        margin: 0 auto;
    }
    .img-showcase {
        display: block;
        margin: 0 auto;
        float: none;
        width: 100%;
        max-width: 300px;
        height: auto;
    }
    .box-hidden {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .box-hidden iframe {
        width: 100%;
        max-width: 300px;
        height: 200px;
        display: block;
        margin: 0 auto;
    }
    .box video {
        float: none;
        display: block;
        margin: 10px auto;
        width: 100%;
        max-width: 300px;
        height: auto;
    }
}