/* =========================================================
   REUSABLE PROJECT CARD
========================================================= */

.project-card {
    min-width: 0;
}


/* =========================================================
   MEDIA
========================================================= */

.project-card__media {
    position: relative;

    display: block;

    width: 100%;

    overflow: hidden;

    border-radius: 8px;

    aspect-ratio: 1.42 / 1;

    background: var(--color-charcoal);

    text-decoration: none;
}


/* =========================================================
   IMAGE
========================================================= */

.project-card__media img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
    object-position: center;

    transition:
        transform 0.65s cubic-bezier(.2, .7, .2, 1);
}


/* =========================================================
   OVERLAY
========================================================= */

.project-card__overlay {
    position: absolute;

    inset: 0;

    z-index: 1;

    background:
        linear-gradient(
            180deg,
            rgba(4, 4, 8, 0.08) 0%,
            rgba(4, 4, 8, 0.18) 45%,
            rgba(4, 4, 8, 0.55) 100%
        );

    transition: background 0.35s ease;
}


/* =========================================================
   NORMAL CONTENT
========================================================= */

.project-card__base-content {
    position: absolute;

    left: 18px;
    right: 18px;
    bottom: 17px;

    z-index: 2;

    display: flex;

    flex-direction: column;

    color: #ffffff;

    transition:
        opacity 0.25s ease,
        transform 0.35s ease;
}

.project-card__base-title {
    color: #ffffff;

    font-family: var(--font-heading);

    font-size: clamp(17px, 1.25vw, 22px);
    font-weight: 600;

    letter-spacing: -0.025em;

    line-height: 1.05;
}

.project-card__base-client {
    display: block;

    margin-top: 5px;

    color: rgba(255, 255, 255, 0.78);

    font-size: 11px;
    font-weight: 500;

    line-height: 1.3;
}


/* =========================================================
   DEFAULT CARD CONTENT
========================================================= */

.project-card__default {
    position: absolute;

    left: 18px;
    right: 18px;
    top: 50%;

    z-index: 3;

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    padding: 14px 16px;

    border-radius: 7px;

    background: rgba(0, 0, 0, 0.48);

    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);

    text-align: center;

    opacity: 1;
    visibility: visible;

    transform: translateY(-50%);

    transition:
        opacity 0.3s ease,
        transform 0.3s ease,
        visibility 0.3s ease,
        background-color 0.3s ease;
}

.project-card__default-title {
    color: #ffffff;

    font-family: var(--font-heading);

    font-size: clamp(17px, 1.25vw, 22px);
    font-weight: 600;

    letter-spacing: -0.025em;

    line-height: 1.1;
}

.project-card__default-client {
    display: block;

    margin-top: 5px;

    color: rgba(255, 255, 255, 0.88);

    font-size: 12px;
    font-weight: 500;

    line-height: 1.3;
}


/* =========================================================
   HOVER CONTENT
========================================================= */

.project-card__hover {
    position: absolute;

    left: 18px;
    right: 18px;
    top: 50%;

    z-index: 4;

    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    padding: 16px 18px;

    border-radius: 7px;

    background: rgba(0, 0, 0, 0.72);

    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);

    text-align: center;

    opacity: 0;
    visibility: hidden;

    transform: translateY(-50%) translateY(10px);

    pointer-events: none;

    transition:
        opacity 0.35s ease,
        transform 0.35s ease,
        visibility 0.35s ease;
}

.project-card__hover-title {
    color: #ffffff;

    font-family: var(--font-heading);

    font-size: clamp(17px, 1.2vw, 21px);
    font-weight: 600;

    line-height: 1.1;
}

.project-card__hover-client {
    margin-top: 4px;

    color: rgba(255, 255, 255, 0.88);

    font-size: 11px;
}

.project-card__hover-description {
    max-width: 90%;

    margin-top: 10px;

    color: rgba(255, 255, 255, 0.94);

    font-size: 11px;
    line-height: 1.45;

    text-align: center;
}


/* =========================================================
   HOVER
========================================================= */

@media (hover: hover) and (pointer: fine) {

    .project-card__media:hover img {
        transform: scale(1.045);
    }

    .project-card__media:hover .project-card__overlay {
        background:
            linear-gradient(
                180deg,
                rgba(5, 5, 8, 0.14) 0%,
                rgba(5, 5, 8, 0.34) 45%,
                rgba(5, 5, 8, 0.70) 100%
            );
    }

    .project-card__media:hover .project-card__base-content {
        opacity: 0;

        transform: translateY(-8px);
    }

   .project-card__media:hover .project-card__default {
        opacity: 0;
        visibility: hidden;

        transform: translateY(-50%) translateY(-6px);
    }

    .project-card__media:hover .project-card__hover {
        opacity: 1;
        visibility: visible;

        transform: translateY(-50%);

        pointer-events: auto;
    }
}


/* =========================================================
   PLACEHOLDER
========================================================= */

.project-card__placeholder {
    display: flex;

    width: 100%;
    height: 100%;

    align-items: center;
    justify-content: center;

    background: var(--color-charcoal);

    color: #ffffff;
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 991px) {

    .project-card__media {
        aspect-ratio: 1.45 / 1;
    }

    .project-card__base-content {
        left: 16px;
        right: 16px;
        bottom: 15px;
    }

    .project-card__default {
        left: 16px;
        right: 16px;
        bottom: 16px;

        padding: 13px 15px;
    }

    .project-card__hover {
        left: 16px;
        right: 16px;
        bottom: 16px;

        padding: 15px 16px;
    }

    .project-card__base-title,
    .project-card__hover-title {
        font-size: 18px;
    }

    .project-card__hover-description {
        margin-top: 10px;

        font-size: 11px;
    }
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 767px) {

    .project-card__media {
        aspect-ratio: 1.5 / 1;
    }


    /* Default content - centered in card */

    .project-card__default {
        left: 14px;
        right: 14px;

        top: 50%;
        bottom: auto;

        opacity: 1;
        visibility: visible;

        transform: translateY(-50%);

        padding: 13px 14px;

        background: rgba(0, 0, 0, 0.52);

        text-align: center;
    }


    /* Detail content - centered in card but hidden initially */

    .project-card__hover {
        left: 14px;
        right: 14px;

        top: 50%;
        bottom: auto;

        opacity: 0;
        visibility: hidden;

        transform: translateY(-50%) translateY(8px);

        padding: 15px;

        background: rgba(0, 0, 0, 0.76);

        align-items: center;
        justify-content: center;

        text-align: center;

        pointer-events: none;
    }


    /* First tap - hide normal title */

    .project-card__media.is-active .project-card__default {
        opacity: 0;
        visibility: hidden;

        transform: translateY(-50%) translateY(-6px);
    }


    /* First tap - show details in center */

    .project-card__media.is-active .project-card__hover {
        opacity: 1;
        visibility: visible;

        transform: translateY(-50%);

        pointer-events: auto;
    }


    .project-card__media.is-active .project-card__overlay {
        background:
            linear-gradient(
                180deg,
                rgba(5, 5, 8, 0.18) 0%,
                rgba(5, 5, 8, 0.40) 45%,
                rgba(5, 5, 8, 0.75) 100%
            );
    }


    .project-card__hover-title {
        width: 100%;

        font-size: 20px;

        text-align: center;
    }


    .project-card__hover-client {
        width: 100%;

        font-size: 12px;

        text-align: center;
    }


    .project-card__hover-description {
        width: 95%;
        max-width: 95%;

        margin: 10px auto 0;

        font-size: 12px;

        line-height: 1.45;

        text-align: center;
    }

}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 480px) {

    .project-card__media {
        aspect-ratio: 1.3 / 1;
    }

    .project-card__default,
    .project-card__hover {
        left: 12px;
        right: 12px;

        top: 50%;
        bottom: auto;

        transform: translateY(-50%);
    }

    .project-card__default {
        padding: 12px 13px;
    }

    .project-card__hover {
        padding: 14px;

        transform: translateY(-50%) translateY(8px);
    }

    .project-card__media.is-active .project-card__default {
        transform: translateY(-50%) translateY(-6px);
    }

    .project-card__media.is-active .project-card__hover {
        transform: translateY(-50%);
    }

    .project-card__hover-title {
        font-size: 19px;
    }

    .project-card__hover-description {
        font-size: 11px;
    }
}