/* ==========================================================================
   Projects list page — resources/views/website/projects/index.blade.php
   + resources/views/website/projects/includes/content.blade.php
   Classes are prefixed with "pj". Card look matches the "previous works" showcase.
   ========================================================================== */

:root {
    --pj-primary: #421f61;
    --pj-violet: #6b3a93;
    --pj-deeper: #24103a;
    --pj-accent: #dea8e4;
    --pj-soft: #f7f2fa;
    --pj-line: rgba(66, 31, 97, 0.1);
    --pj-muted: rgba(66, 31, 97, 0.75);
    --pj-nav: 58px; /* compact phone header */
}

@media (min-width: 1200px) {
    :root {
        --pj-nav: 96px;
    }
}

/* body { overflow-x: hidden } on this site breaks position: sticky; "clip" hides sideways overflow without that */
body:has(.pj-filters) {
    overflow-x: clip !important;
    overflow-y: visible !important;
}

/* ---------- header ---------- */

.pj-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
    padding-top: clamp(24px, 5vw, 56px);
    padding-bottom: clamp(24px, 4vw, 40px);
}

.pj-crumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.65);
}

.pj-crumbs a {
    color: rgba(255, 255, 255, 0.8) !important;
    text-decoration: none;
}

.pj-crumbs [aria-current] {
    color: var(--pj-accent);
    font-weight: 700;
}

.pj-hero__title {
    margin: 0;
    color: #fff;
    font-weight: 800;
    font-size: clamp(32px, 5vw, 58px);
    line-height: 1.3;
}

.pj-hero__lead {
    margin: 0;
    max-width: 640px;
    color: rgba(255, 255, 255, 0.82);
    font-size: clamp(16px, 1.6vw, 19px);
    line-height: 1.8;
}

.pj-hero__stats {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.pj-hero__stats li {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.pj-hero__stats strong {
    color: #fff;
    font-size: 24px;
    font-weight: 800;
}

/* ---------- section + filter chips ---------- */

.pj {
    padding-bottom: clamp(56px, 7vw, 96px);
    background: linear-gradient(180deg, var(--pj-soft) 0%, #fff 60%);
}

.pj-filters {
    position: sticky;
    top: var(--pj-nav);
    z-index: 30;
    margin-bottom: clamp(24px, 3vw, 36px);
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--pj-line);
}

.pj-filters__track {
    display: flex;
    gap: 8px;
    padding-block: 14px;
    overflow-x: auto;
    scrollbar-width: none;
}

.pj-filters__track::-webkit-scrollbar {
    display: none;
}

.pj-chip {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 999px;
    border: 1px solid var(--pj-line);
    background: #fff;
    color: var(--pj-primary);
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.pj-chip span {
    min-width: 24px;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--pj-soft);
    color: var(--pj-violet);
    font-size: 12px;
    text-align: center;
}

.pj-chip:hover {
    border-color: rgba(107, 58, 147, 0.4);
}

.pj-chip.is-active {
    background: var(--pj-primary);
    border-color: var(--pj-primary);
    color: #fff;
}

.pj-chip.is-active span {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

@media (min-width: 1024px) {
    .pj-filters__track {
        flex-wrap: wrap;
        justify-content: center;
        overflow: visible;
    }
}

/* ---------- grid + cards ---------- */

.pj-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.pj-card {
    display: flex;
    flex-direction: column;
    border-radius: 22px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--pj-line);
    text-decoration: none;
    box-shadow: 0 12px 30px rgba(66, 31, 97, 0.08);
    transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.pj-card[hidden] {
    display: none;
}

.pj-card.is-entering {
    animation: pj-in 0.4s ease both;
}

@keyframes pj-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

.pj-card:hover {
    transform: translateY(-6px);
    border-color: rgba(107, 58, 147, 0.25);
    box-shadow: 0 22px 44px rgba(66, 31, 97, 0.16);
}

.pj-card__media {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--pj-soft);
}

.pj-card__media > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.pj-card:hover .pj-card__media > img {
    transform: scale(1.06);
}

.pj-card__year {
    position: absolute;
    top: 14px;
    inset-inline-start: 14px;
    padding: 5px 11px;
    border-radius: 999px;
    background: rgba(36, 16, 58, 0.78);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    direction: ltr;
}

.pj-card__body {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 8px;
    padding: 26px 22px 22px;
    text-align: start;
}

.pj-card__logo {
    position: absolute;
    top: -26px;
    inset-inline-end: 18px;
    z-index: 1;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    background: #fff;
    box-shadow: 0 8px 18px rgba(66, 31, 97, 0.18);
}

.pj-card__logo img {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.pj-card__industry {
    color: var(--pj-violet);
    font-size: 12px;
    font-weight: 700;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pj-card__title {
    margin: 0;
    color: var(--pj-primary);
    font-weight: 800;
    font-size: 19px;
    line-height: 1.5;
}

.pj-card__text {
    margin: 0 0 6px;
    color: var(--pj-muted);
    font-size: 14.5px;
    line-height: 1.8;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pj-card__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    color: var(--pj-primary);
    font-weight: 700;
    font-size: 15px;
}

.pj-card__link i {
    font-size: 13px;
    transition: transform 0.3s ease;
}

.pj-card:hover .pj-card__link i {
    transform: translateX(-4px);
}

html[dir="ltr"] .pj-flip {
    transform: scaleX(-1);
}

html[dir="ltr"] .pj-card:hover .pj-card__link i {
    transform: scaleX(-1) translateX(-4px);
}

/* closing call-to-action card */
.pj-card--cta {
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 32px 24px;
    text-align: center;
    border: 1px dashed rgba(255, 255, 255, 0.35);
    background:
        radial-gradient(circle at 100% 0%, rgba(222, 168, 228, 0.35), transparent 55%),
        linear-gradient(135deg, var(--pj-violet), var(--pj-primary));
}

.pj-card--cta .pj-card__title {
    color: #fff;
    font-size: 21px;
}

.pj-card--cta .pj-card__text {
    color: rgba(255, 255, 255, 0.85);
    -webkit-line-clamp: 3;
}

.pj-card__cta-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 30px;
}

.pj-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 24px;
    border-radius: 14px;
    background: #fff;
    color: var(--pj-primary);
    font-weight: 700;
    font-size: 15px;
}

.pj a:focus-visible,
.pj button:focus-visible {
    outline: 3px solid var(--pj-accent);
    outline-offset: 3px;
}

@media (min-width: 640px) {
    .pj-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 22px;
    }
}

@media (min-width: 1024px) {
    .pj-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 26px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pj-card, .pj-card img, .pj-chip, .pj-card__link i {
        transition: none !important;
    }

    .pj-card.is-entering {
        animation: none;
    }
}
