/* PROJETS — RicAgE.dev */

.projects {
    position: relative;
    min-height: 100svh;
    padding: 6rem clamp(1.25rem, 4vw, 4rem);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5rem;
    align-content: start;
    align-items: start;
}

.projects > .section-heading {
    grid-column: 1 / -1;
    margin-bottom: 1rem;
}

/* Cartes */

.project-card {
    min-width: 0;
    width: 100%;
    max-width: 460px;
    justify-self: center;
    overflow: hidden;
    background: #141414;
    border: 1px solid #383838;
    border-radius: 8px;
    box-shadow: 0 16px 40px rgb(0 0 0 / 25%);
    transition: border-color 0.25s ease;
}

.project-card:hover {
    border-color: #ffffff;
}

.project-card.is-open {
    border-color: #fdb85d;
}

.project-card__trigger {
    display: block;
    width: 100%;
    padding: 1.5rem;
    border: 0;
    background: transparent;
    color: #fff;
    text-align: left;
    font: inherit;
    cursor: pointer;
}

/* Rapprocher les cartes au centre */
.project-card:first-of-type {
    justify-self: end;
}

.project-card:last-of-type {
    justify-self: start;
}

/* Identité */

.project-card__identity {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 64px;
    margin-bottom: 1.25rem;
}

.project-number {
    flex-shrink: 0;
    color: #ff8a00;
    font-size: 0.75rem;
}

.project-card__logo {
    display: block;
    width: 140px;
    max-width: 75%;
    height: 48px;
    object-fit: contain;
    object-position: left center;
}

.project-card--building .project-card__logo {
    width: 210px;
}

/* Zone visuelle commune aux deux projets */

.project-visual {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #080808;
    border: 1px solid #303030;
    border-radius: 4px;
}

.project-card__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
}

.project-card__image:first-child {
    opacity: 1;
}

/* Projet en développement */

.project-visual--building {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    padding: 1.25rem;
    box-sizing: border-box;
}

.project-visual__logo {
    display: block;
    width: 75%;
    max-width: 300px;
    height: auto;
}

.project-card__status {
    display: inline-block;
    padding: 0.45rem 0.7rem;
    border: 1px solid #fdfdfc;
    border-radius: 4px;
    color: #fdfdfc;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
}

/* Texte visible avant ouverture */

.project-card__summary {
    display: block;
    margin-top: 1.25rem;
    color: #e0e0e0;
    font-size: 0.95rem;
    line-height: 1.65;
}

.project-card__action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.5rem;
    color: #ffad4d;
    font-size: 0.8rem;
    font-weight: 600;
}

.project-card__action::after {
    content: "+";
    font-size: 1.4rem;
    line-height: 1;
}

.project-card.is-open .project-card__action::after {
    content: "−";
}

/* Informations dépliées */

.project-card__details {
    padding: 1.5rem;
    border-top: 1px solid #383838;
}

.project-card__details[hidden] {
    display: none;
}

.project-card__details-inner > p {
    margin: 0 0 1.25rem;
    color: #e0e0e0;
    font-size: 0.95rem;
    line-height: 1.75;
}

.project-card__meta {
    margin-top: 1.5rem;
}

.project-card__meta h4 {
    margin: 0 0 0.5rem;
    color: #ffad4d;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
}

.project-card__meta p {
    margin: 0;
    color: #fff;
    font-size: 0.9rem;
    line-height: 1.65;
}

.project-card__visit {
    display: inline-block;
    margin-top: 2rem;
    padding: 0.75rem 1rem;
    border: 1px solid #ff8a00;
    border-radius: 4px;
    color: #fff;
    font-size: 0.8rem;
    text-decoration: none;
}

.project-card__visit:hover {
    background: #ff8a00;
    color: #080808;
}

.project-card__visit:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 4px;
}

/* Mobile et petites tablettes */

@media (max-width: 760px) {
    .projects {
        grid-template-columns: minmax(0, 1fr);
        padding-top: 4rem;
        padding-bottom: 8rem;
        gap: 1.5rem;
    }

    .projects > .section-heading {
        margin-bottom: 0.5rem;
    }

    .project-card__trigger,
    .project-card__details {
        padding: 1.1rem;
    }

    .project-card__identity {
        min-height: 52px;
    }

    .project-card:first-of-type,
    .project-card:last-of-type {
        justify-self: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .project-card {
        transition: none;
    }
}

@media (min-width: 761px) {
    .project-card__summary {
        min-height: 4.95em; /* 3 lignes avec line-height: 1.65 */
    }
}
