/* Project Page Template Styles */
/* Shared styles for all project pages */

/* Override background image from main style.css */
body {
    background-image: none;
    background-color: var(--color-dark);
    color: var(--color-light);
}

/* Link styling for project pages */
a {
    color: var(--color-light);
    text-decoration: none;
    font-weight: 700;
}

a:hover {
    color: var(--color-light);
    text-decoration: underline;
}

/* Override flex container behavior from main CSS */
#flex-container {
    position: static;
    height: auto;
    display: block;
}

#wrap {
    width: 100%;
    margin: 0;
}

/* Additional styles for project page */
.project-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

/* Shared projects listing styles */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 40px;
}

@media (max-width: 900px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

.project-card {
    border: 1px solid var(--color-light);
    border-radius: 0px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background-color: var(--color-light);
    color: var(--color-dark);
    text-decoration: none;
}

/* Keep card headings bold while body/link text stays normal */
.project-card h3 {
    font-weight: 700;
}

.project-card p,
.project-card .project-link a {
    font-weight: 400;
}

.project-card:hover {
    background-color: var(--color-dark);
    color: var(--color-light);
}

.project-card:link,
.project-card:visited,
.project-card:hover,
.project-card:active {
    text-decoration: none;
}

.project-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.project-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-info h3 {
    margin: 0 0 10px 0;
    font-family: 'Lato', sans-serif;
    font-size: 1.4em;
    color: var(--color-dark);
}

.project-card:hover .project-info h3 {
    color: var(--color-light);
}

.project-info p {
    margin: 0 0 15px 0;
    color: var(--color-dark);
    line-height: 1.5;
    flex-grow: 1;
}

.project-card:hover .project-info p {
    color: var(--color-light);
}

.project-link {
    margin-top: auto;
}

.project-link a {
    color: var(--color-dark);
    text-decoration: none;
}

.project-card:hover .project-link a {
    color: var(--color-light);
}

.projects-intro {
    text-align: justify;
    margin: 30px auto 40px auto;
    max-width: 800px;
    line-height: 1.6;
    color: var(--color-light);
}

.projects-intro p:first-of-type {
    margin-bottom: 15px;
}

.project-header {
    text-align: center;
    margin-bottom: 30px;
}

.project-title {
    font-family: 'lato', sans-serif;
    color: var(--color-light);
    margin-bottom: 10px;
    text-transform: uppercase;
}

.project-authors {
    font-size: 1.2em;
    color: var(--color-light);
    margin-bottom: 20px;
    font-style: italic;
}

.project-authors-noitalic {
    font-size: 1.2em;
    color: var(--color-light);
    margin-bottom: 20px;
    font-style: normal;
}

.project-description {
    font-size: 1.1em;
    line-height: 1.6em;
    text-align: justify;
    margin-bottom: 30px;
}

.project-images {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.image-container {
    text-align: center;
}

.image-container img {
    max-width: 100%;
    height: auto;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.image-container img:hover {
    opacity: 0.8;
}

/* Figure table styling (used for image + caption) */
.figure-table {
    width: auto;
    border-collapse: collapse;
    table-layout: fixed;
    margin: 30px auto;
    display: inline-block;
    max-width: 100%;
}

.figure-table tr {
    display: block;
}

.figure-table td {
    padding: 0;
    text-align: center;
    max-width: 720px;
    border: none;
    display: block;
}

.figure-table img {
    display: block;
    width: auto;
    max-width: 720px;
    height: auto;
    margin: 0 auto;
}

.figure-caption {
    display: block;
    text-align: center;
    font-weight: 400;
    font-size: 0.9em;
    background-color: var(--color-light);
    color: var(--color-dark);
    padding: 8px;
    margin-top: 6px;
    line-height: 1.3;
    width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

@media (max-width: 600px) {
    .figure-table {
        width: 100%;
    }

    .figure-table td {
        display: block;
        width: 100%;
    }

    .figure-caption {
        display: block;
        margin-top: 8px;
    }

    .figure-table img {
        width: 100%;
        max-width: 100%;
    }
}

.image-caption {
    font-size: 0.9em;
    color: var(--color-light);
    margin-top: 8px;
    font-style: italic;
}

/* Language selector styling */
.language-selector {
    text-align: left;
    margin-bottom: 20px;
}

.language-dropdown {
    background-color: transparent;
    color: var(--color-light);
    border: 1px solid var(--color-light);
    padding: 5px 10px;
    border-radius: 0px;
    cursor: pointer;
    font-family: 'Lato', sans-serif;
    font-size: 0.8em;
}

.language-dropdown:hover {
    background-color: var(--color-light);
    color: var(--color-dark);
}

.language-dropdown:focus {
    outline: none;
    background-color: var(--color-light);
    color: var(--color-dark);
}

.language-dropdown option {
    background-color: var(--color-dark);
    color: var(--color-light);
    padding: 4px;
}

/* Image row styling (for top galleries) */
.image-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 30px;
    width: 100%;
}

.image-row-item {
    flex: 1;
    text-align: center;
}

.image-row-item img {
    width: 100%;
    height: 300px;
    object-fit: contain;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.image-row-item img:hover {
    opacity: 0.8;
}

/* Media row styling (for video + image side by side) */
.media-row {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 30px;
    width: 100%;
}

.media-row-item {
    flex: 1;
    text-align: center;
}

.media-row-item iframe {
    width: 100%;
    height: 250px;
    border: none;
    background-color: var(--color-dark);
}

.media-row-item img {
    width: 100%;
    height: 250px;
    object-fit: contain;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.media-row-item img:hover {
    opacity: 0.8;
}

/* Navigation and contact styling */
.project-link {
    margin-top: 30px;
}

.project-link a {
    background-color: transparent;
    color: var(--color-light);
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 0px;
    border: 1px solid var(--color-light);
    display: inline-block;
}

.project-link a:hover {
    background-color: var(--color-light);
    color: var(--color-dark);
}

/* CTA link at bottom of listing pages */
.cta-container {
    text-align: center;
    margin-top: 20px;
    margin-bottom: 30px;
}

.cta-container a {
    background-color: transparent;
    color: var(--color-light);
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 0px;
    border: 1px solid var(--color-light);
    display: inline-block;
}

.cta-container a:hover {
    background-color: var(--color-light);
    color: var(--color-dark);
}

/* Back link styling to match CTA buttons */
.back-link {
    display: block;
    width: max-content;
    margin: 20px auto 20px auto;
    background-color: transparent;
    color: var(--color-light);
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 0px;
    border: 1px solid var(--color-light);
}

.back-link:hover,
.back-link:focus {
    background-color: var(--color-light);
    color: var(--color-dark);
}

.contact-info {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9em;
    color: var(--color-light);
}

/* Publication section styling */
.publication-section {
    margin-top: 30px;
    padding: 20px;
    background-color: var(--color-light);
    border-radius: 0px;
    border: 1px solid var(--color-light);
    color: var(--color-dark);
}

/* Make entire project cards clickable without showing a button */
/* Cards are anchors; overlay styles removed */

.publication-section h3 {
    margin-top: 0;
    font-size: 1.1em;
    color: var(--color-dark);
}

.publication-section p {
    font-size: 0.95em;
    line-height: 1.5;
    margin-bottom: 0;
    text-align: justify;
    color: var(--color-dark);
}

.publication-section a {
    color: var(--color-dark);
    text-decoration: none;
}

.publication-section a:hover {
    color: var(--color-dark);
    text-decoration: underline;
}

/* Responsive design */
@media screen and (max-width: 900px) {
    .project-content {
        padding: 15px;
    }
    
    .project-title {
        font-size: 2em;
    }
    
    .project-images {
        gap: 15px;
    }
    
    .language-selector {
        text-align: center;
        margin-bottom: 15px;
    }
    
    .language-dropdown {
        padding: 4px 8px;
        font-size: 0.75em;
    }
    
    .image-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .media-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .media-row-item iframe,
    .media-row-item img {
        height: 200px;
    }
}

/* Figure container styles */
.figure {
    display: block;
    margin: 30px auto;
    text-align: center;
    max-width: 100%;
}

.figure img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.figure figcaption {
    text-align: center;
    font-weight: bold;
    font-size: 0.9em;
    color: var(--color-light);
    margin-top: 6px;
    line-height: 1.3;
}