/* Project section Styles */

/* ---- Override global article opacity rule for dynamically rendered cards ----
   The global `article { opacity: 0 }` in style.css is for scroll-triggered
   animations. Project cards are injected by JS so the IntersectionObserver
   never sees them — we handle their own animation here instead. */
article.projects__card {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.5s ease forwards;
}
article.projects__card:nth-child(2) { animation-delay: 0.12s; }
article.projects__card:nth-child(3) { animation-delay: 0.24s; }
article.projects__card:nth-child(4) { animation-delay: 0.36s; }
article.projects__card:nth-child(5) { animation-delay: 0.48s; }
article.projects__card:nth-child(6) { animation-delay: 0.60s; }

/* Tech tags */
.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0.5rem 0 0.85rem;
}

.tech-tag {
    background: rgba(74, 112, 144, 0.18);
    color: var(--color-text-muted);
    border: 1px solid rgba(74, 112, 144, 0.3);
    border-radius: 2rem;
    padding: 0.15rem 0.7rem;
    font-size: 0.78rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Project date & header meta */
.project-date {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.project-header-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.4rem;
}

/* Empty state */
.no-projects {
    text-align: center;
    color: var(--color-text-muted);
    padding: 3rem 1rem;
    font-size: 1rem;
    grid-column: 1 / -1;
}

/* Projects grid layout */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    width: 100%;
    max-width: 1100px;
    margin-top: 1rem;
}

.projects__desc-body {
    margin-top: 0.5rem;
    line-height: 1.7;
    color: var(--color-text-muted) !important;
}

.carousel-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.projects__image--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 2.5rem 2rem;
    border: 2px dashed rgba(74, 112, 144, 0.4);
    border-radius: 1rem;
    width: 100%;
    text-align: center;
}

.project-placeholder span {
    font-size: 3rem;
}

.project-placeholder p {
    color: var(--color-text-muted) !important;
    font-size: 0.9rem;
}

/* Dark background for projects page only */
.main-content {
    background-color: var(--color-bg-dark);
}

.main-content p {
    color: var(--color-text-muted);
}

.carousel-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 20px;
    justify-items: center;
    align-items: center;
    width: 100%;
    margin-top: 10px;
    margin-bottom: 10px;
}


.carousel-thumb-size {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    margin-top: 4px;
    text-align: center;
    font-weight: 500;
}

.carousel-thumb {
    width: 100%;
    max-width: 140px;
    aspect-ratio: 1/1;
    object-fit: contain;
    cursor: pointer;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    background: var(--color-bg-mid);
    padding: 8px;
    display: block;
    border: 2px solid transparent;
}
.carousel-thumb:hover {
    transform: scale(1.07);
    box-shadow: 0 0 18px rgba(74, 112, 144, 0.5);
    border-color: var(--color-accent);
    z-index: 2;
}
.image-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0; top: 0;
    width: 100vw; height: 100vh;
    background: rgba(28, 51, 71, 0.95);
    justify-content: center;
    align-items: center;
    overflow: auto;
    opacity: 0;
    transition: opacity 0.2s;
}

.image-modal.active {
    display: flex;
    opacity: 1;
}
.image-modal .modal-content {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: auto;
    max-width: 90vw;
    max-height: 80vh;
    background: var(--color-bg-mid);
    border-radius: 14px;
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(74, 112, 144, 0.4);
}

.image-modal img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 12px;
    object-fit: contain;
}


.close-modal {
    position: absolute;
    top: 24px;
    right: 32px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
    background: rgba(0,0,0,0.3);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.close-modal:focus {
    outline: 2px solid #fff;
}

.close-modal:hover {
    color: var(--color-accent);
    background: rgba(28, 51, 71, 0.8);
}


.projects__section {
    padding: 4rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    color: var(--color-text-light);
}

.projects__section .title {
    background: linear-gradient(to right, var(--color-text-light), var(--color-accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.projects__section .section__text__p1 {
    color: var(--color-text-muted);
}

.projects .section__text__p1 {
    margin-left: 1.5rem;
    margin-bottom: auto;
}

.projects__card {
    position: relative;
    background-color: var(--color-bg-mid);
    padding: 1.5rem;
    border-radius: var(--radius-card);
    overflow: hidden;
    border: 1px solid rgba(74, 112, 144, 0.3);
    color: var(--color-text-light);
}

.projects__number,
.projects__data,
.projects__image {
    position: relative;
    z-index: 1;
    font-size: 20px;
}

.projects__number {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.projects__number h1 {
    font-size: 50px;
}

.projects__number h1 {
    color: var(--color-text-muted);
}

.projects__number h3 {
    font-weight: 500;
    font-size: 30px;
    color: var(--color-text-muted);
}

.projects__data {
    margin-block: 2rem;
}

.projects__title {
    margin-bottom: 1rem;
    color: var(--color-text-light);
}

.projects__subtitle {
    font-size: 20px;
    margin-bottom: .5rem;
    font-weight: 600;
    color: var(--color-accent);
}

.projects__description {
    font-size: 20px;
    font-weight: 500;
    color: var(--color-text-muted);
}

.projects__image {
    border-radius: 1.5rem;
}

.slider-wrapper {
    position: relative;
}

.slider-nav {
    display: flex;
    column-gap: 1rem;
    position: absolute;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
}

.slider {
    aspect-ratio: 10/11;
    overflow-x: auto;
    margin-top: 2rem;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    align-items: center;
    padding: 1rem;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    box-shadow: 0 1.5rem 3rem -0.75rem hsla(0, 0%, 0%, 0.25);
    border-radius: 1.5rem;
    gap: 1rem;
}

.projects__buttons {
    font-weight: 100;
}

.projects__button {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-top: 1rem;
}

.projects__button-link {
    font-size: 20px;
    color: var(--color-text-light);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition);
}

.projects__button-link:hover {
    color: var(--color-accent);
}

.projects__button .icon {
    width: 25px;
    height: 25px;
}

.projects__image img {
    height: auto;
    border-radius: 1.5rem;
}

.projects__card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(74, 112, 144, 0.04);
    border-radius: var(--radius-card);
    z-index: 0;
    pointer-events: none;
}

.projects__card:hover::before {
    background-color: rgba(74, 112, 144, 0.1);
}

.projects__card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 40px rgba(28, 51, 71, 0.4);
    border-color: var(--color-accent);
    transition: all 0.3s ease;
}

.projects__card {
    transition: all 0.3s ease;
}

.projects__card .icon {
    width: 30px;
    height: 30px;
    transition: transform 0.3s ease;
}

.projects__card:hover .icon {
    transform: scale(1.1);
}

/* Media Queries for responsiveness */
@media screen and (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: center;
    }

    .projects__section {
        padding: 2rem 1rem;
    }

    .projects__card {
        padding: 1rem;
    }

    .projects__number h1 {
        font-size: 40px;
    }

    .projects__number h3 {
        font-size: 24px;
    }

    .projects__title {
        font-size: 24px;
    }

    .projects__subtitle {
        font-size: 18px;
    }

    .projects__description {
        font-size: 18px;
    }

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

     .projects__image {
        max-width: 98vw;
        padding: 0 2vw;
    }
    .carousel-thumbnails {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 10px;
    }
    .carousel-thumb {
        max-width: 80px;
        padding: 4px;
    }
    .image-modal .modal-content {
        max-width: 98vw;
        max-height: 60vh;
    }
    .close-modal {
        top: 10px;
        right: 16px;
        font-size: 32px;
        width: 36px;
        height: 36px;
    }
}

@media screen and (max-width: 600px) {
    .section__text__p1 {
        font-size: 1.1rem;
        margin-left: 0;
        text-align: center;
    }

    .projects__section {
        padding: 2rem 1rem;
        margin: 0 1rem;
        align-items: center;
        text-align: center;
    }

    .projects__card {
        padding: 1rem;
        margin-bottom: 2rem;
    }

    .projects__number h1 {
        font-size: 35px;
    }

    .projects__number h3 {
        font-size: 20px;
    }

    .projects__title {
        font-size: 20px;
    }

    .projects__subtitle {
        font-size: 16px;
    }

    .projects__description {
        font-size: 16px;
    }

    .projects__button-link {
        font-size: 16px;
    }

    .projects__button .icon {
        width: 20px;
        height: 20px;
    }

    .projects__image {
        max-width: 100vw;
        padding: 0 2vw;
    }
    .carousel-thumbnails {
        display: flex;
        flex-direction: column;
        gap: 14px;
        align-items: center;
        width: 100%;
    }
    .carousel-thumb {
        max-width: 90vw;
        width: 90vw;
        aspect-ratio: 1/1;
        padding: 2px;
    }
    .image-modal .modal-content {
        max-width: 98vw;
        max-height: 50vh;
    }
    .close-modal {
        top: 8px;
        right: 8px;
        font-size: 28px;
        width: 32px;
        height: 32px;
    }

        .carousel-thumbnails {
        justify-content: center;
        align-items: center;
    }
}

/* --- Hide scrollbars for modal --- */
.image-modal {
    scrollbar-width: none;
}
.image-modal::-webkit-scrollbar {
    display: none;
}


.carousel-thumb,
.image-modal .modal-content {
    object-fit: contain;
    background: var(--color-bg-mid);
}

.carousel-thumbnails > img {
    margin: 0;
}


@media screen and (max-width: 480px) {
    .section__text__p1 {
        font-size: 1rem;
        margin-left: 0;
        text-align: center;
    }

    .projects__section {
        padding: 2rem 1rem;
        margin: 0 .5rem;
        align-items: center;
        text-align: center;
    }

    .projects__card {
        padding: .75rem;
        margin-bottom: 1.5rem;
    }

    .projects__number h1 {
        font-size: 30px;
    }

    .projects__number h3 {
        font-size: 18px;
    }

    .projects__title {
        font-size: 18px;
    }

    .projects__subtitle {
        font-size: 14px;
    }

    .projects__description {
        font-size: 14px;
    }

    .projects__button-link {
        font-size: 14px;
    }

    .projects__button .icon {
        width: 18px;
        height: 18px;
    }

    .projects__image img {
        width: 100%;
        height: auto;
        border-radius: 1rem;
    }
}

@media screen and (max-width: 480px) {
    #tech-stack {
        padding: 1rem 0.5rem;
    }

    .article-container {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .details-container {
        padding: 1rem;
        border-radius: 10px;
    }

    article {
        padding: 0.75rem;
    }

    article .icon {
        width: 45px;
        height: 45px;
        padding: 0.4rem;
    }

    article h3 {
        font-size: 1rem;
    }

    #tech-stack .title {
        font-size: 2rem;
        margin-bottom: 1rem;
    }

    .section-subtitle {
        font-size: 1.4rem;
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
    }
}

@media screen and (max-width: 768px) {
    .section__text__p1 {
        font-size: 1.1rem;
        margin-left: 0;
        text-align: center;
    }

    .projects__section {
        padding: 2rem 1rem;
    }

    .projects__card {
        padding: 1rem;
    }

    .projects__number h1 {
        font-size: 40px;
    }

    .projects__number h3 {
        font-size: 24px;
    }

    .projects__title {
        font-size: 24px;
    }

    .projects__subtitle {
        font-size: 18px;
    }

    .projects__description {
        font-size: 18px;
    }

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

    .projects__button .icon {
        width: 20px;
        height: 20px;
    }

    .projects__image img {
        width: 100%;
        height: auto;
        border-radius: 1.5rem;
    }
}

@media screen and (max-width: 600px) {
    .section__text__p1 {
        font-size: 1rem;
        margin-left: 0;
        text-align: center;
    }

    .projects__section {
        padding: 2rem 1rem;
        margin: 0 1rem;
        align-items: center;
        text-align: center;
    }

    .projects__card {
        padding: 1rem;
        margin-bottom: 2rem;
    }

    .projects__number h1 {
        font-size: 35px;
    }

    .projects__number h3 {
        font-size: 20px;
    }

    .projects__title {
        font-size: 20px;
    }

    .projects__subtitle {
        font-size: 16px;
    }

    .projects__description {
        font-size: 16px;
    }

    .projects__button-link {
        font-size: 16px;
    }

    .projects__button .icon {
        width: 20px;
        height: 20px;
    }

    .projects__image img {
        width: 100%;
        height: auto;
        border-radius: 1rem;
    }
}

@media screen and (min-width: 769px) {
    #tech-stack {
        padding: 2rem 1rem;
    }

    .projects__section {
        padding: 2rem 1rem;
    }

    .projects__card {
        padding: 1rem;
    }

    .projects__number h1 {
        font-size: 40px;
    }

    .projects__number h3 {
        font-size: 24px;
    }

    .projects__title {
        font-size: 24px;
    }

    .projects__subtitle {
        font-size: 18px;
    }

    .projects__description {
        font-size: 18px;
    }

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

    .projects__button .icon {
        width: 20px;
        height: 20px;
    }

    .projects__image img {
        height: auto;
        border-radius: 1.5rem;
    }
}

@media screen and (max-width: 1024px) {
    .section__text__p2 {
        font-size: 1.3rem;
    }

    .title {
        font-size: 2.5rem;
    }

    .text-container {
        text-align: justify;
        padding: 1rem;
    }

    .main-content {
        padding: 15px;
    }

    .details-container.color-container {
        width: 100%;
        margin: 0.5rem 0;
    }

    .project-img {
        width: 100%;
        height: auto;
    }

    section {
        margin: 0;
        padding: 1rem 1rem;
    }

    .hamburger-icon {
        margin-right: 1.5rem;
    }

    article {
        width: 100%;
        margin: 0.5rem 0;
        justify-content: flex-start;
    }

    .article-container {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .menu-links li {
        width: 100%;
        text-align: center;
    }

    .nav-links-container {
        width: 100%;
        display: flex;
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .projects__image {
        max-width: 98vw;
        padding: 0 4vw;
    }
    .carousel-thumbnails {
        gap: 6px;
    }
    .carousel-thumb {
        width: 56px;
        height: 56px;
    }
    .image-modal .modal-content {
        max-width: 98vw;
        max-height: 60vh;
    }
    .close-modal {
        top: 10px;
        right: 20px;
        font-size: 32px;
    }
}
