/* Projects Page - Wider Layout */

.projects-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 3rem;
}

.projects-title {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 3rem;
    color: var(--text-color);
}

/* Project Cards */
.project-card {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 3rem;
    padding-top: 3.5rem;
    margin-bottom: 4rem;
    padding-bottom: 4rem;
    border-bottom: 1px solid var(--muted-color);
    align-items: center;
}

.project-card:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Alternate layout - image on right for even cards */
.project-card:nth-child(even) {
    direction: rtl;
}

.project-card:nth-child(even) > * {
    direction: ltr;
}

/* Project Carousel */
.project-carousel {
    position: relative;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background-color: var(--bg-color);
    border: 1px solid var(--muted-color);
    aspect-ratio: 16 / 9;
    min-height: 350px;
}

.project-carousel.carousel-tall {
    aspect-ratio: 4 / 3;
}

.project-carousel.carousel-contain {
    aspect-ratio: 9 / 16;
    min-height: 500px;
    max-height: 900px;
}

.project-carousel.carousel-contain .carousel-img {
    object-fit: contain;
    background-color: var(--bg-color);
}

.carousel-images {
    width: 100%;
    height: 100%;
    position: relative;
}

.carousel-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.carousel-img.active {
    opacity: 1;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(30, 30, 30, 0.7);
    color: var(--text-color);
    border: none;
    font-size: 2rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 10;
}

.carousel-btn:hover {
    background: rgba(30, 30, 30, 0.9);
}

body:not(.dark-mode) .carousel-btn {
    background: rgba(0, 0, 0, 0.4);
    color: white;
}

body:not(.dark-mode) .carousel-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}

.carousel-btn.prev {
    left: 0;
    border-radius: 0 8px 8px 0;
}

.carousel-btn.next {
    right: 0;
    border-radius: 8px 0 0 8px;
}

.carousel-dots {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--muted-color);
    cursor: pointer;
    transition: background 0.2s;
}

.dot.active {
    background: var(--text-color);
}

.dot:hover {
    background: var(--text-color);
    opacity: 0.8;
}

/* Legacy - keep for backwards compat */
.project-image {
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    background-color: var(--bg-color);
    border: 1px solid var(--muted-color);
    aspect-ratio: 16 / 10;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.project-card:hover .project-image img {
    transform: scale(1.03);
}

/* Project Content */
.project-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.project-name {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--function);
    margin: 0;
}

.project-tagline {
    font-size: 1.1rem;
    color: var(--type);
    margin: 0;
    font-style: italic;
}

.project-description {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-color);
    opacity: 0.9;
    margin: 0.5rem 0;
}

.project-description .sm-br {
    display: block;
    height: 0.4em;
}

/* Project Tags */
.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.project-tag {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
}

.dark-mode .project-tag {
    background-color: rgba(255, 255, 255, 0.1);
}

body:not(.dark-mode) .project-tag {
    background-color: rgba(0, 0, 0, 0.08);
}

/* Project Links */
.project-links {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
}

.project-link {
    color: var(--link-color);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: opacity 0.2s;
}

.project-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 850px) {
    .projects-main {
        padding: 2rem 1.5rem;
    }

    .project-card {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .project-card:nth-child(even) {
        direction: ltr;
    }

    .project-image {
        aspect-ratio: 16 / 9;
    }

    .projects-title {
        font-size: 2rem;
    }
}
