/* ============================================================================
   Global Suntech — Project Showcase section + project detail modal.

   Loaded by the landing pages together with gs-projects.js. Colours come
   from the page's own CSS custom properties (--accent, --bg2, --border,
   --text, --muted), with fallbacks, so the section inherits each theme.
   ========================================================================= */

.gpj-wrap {
    width: min(1260px, 92%);
    margin-inline: auto;
}

.gpj-head {
    max-width: 760px;
    margin-bottom: clamp(34px, 4vw, 60px);
}

.gpj-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .24em;
    text-transform: uppercase;
    color: var(--accent, #ffb703);
}

.gpj-eyebrow i {
    width: 26px;
    height: 1px;
}

.gpj-title {
    font-size: clamp(1.9rem, 4.2vw, 3.4rem);
    font-weight: 700;
    letter-spacing: -.025em;
    line-height: 1.08;
    margin: .5em 0 .4em;
    color: var(--text, #eaf3ee);
}

.gpj-sub {
    color: var(--muted, #9db4aa);
    font-size: clamp(.95rem, 1.2vw, 1.05rem);
    line-height: 1.65;
    max-width: 62ch;
}

/* ---- cards ---- */
.gpj-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(16px, 2vw, 26px);
}

.gpj-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 12px;
    border-radius: 22px;
    border: 1px solid var(--border, rgba(255, 255, 255, .1));
    background: var(--bg2, #0d211a);
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: inherit;
    transition: transform .5s cubic-bezier(.22, .85, .24, 1), border-color .4s, box-shadow .5s;
}

.gpj-card:hover {
    transform: translateY(-7px);
    border-color: var(--accent, #ffb703);
    box-shadow: 0 34px 60px -40px var(--accent-glow, rgba(255, 183, 3, .35));
}

.gpj-card__ph {
    position: relative;
    border-radius: 14px;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: var(--surface, rgba(255, 255, 255, .06));
}

.gpj-card__ph img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1s cubic-bezier(.22, .85, .24, 1);
}

.gpj-card:hover .gpj-card__ph img {
    transform: scale(1.06);
}

.gpj-card__year {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: .28rem .65rem;
    border-radius: 100px;
    background: rgba(4, 14, 10, .68);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #fff;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .12em;
}

.gpj-card__body {
    padding: 18px 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.gpj-card__tag {
    font-size: .66rem;
    letter-spacing: .2em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--accent, #ffb703);
}

.gpj-card__body h3 {
    font-size: clamp(1.05rem, 1.6vw, 1.3rem);
    font-weight: 700;
    letter-spacing: -.02em;
    color: var(--text, #eaf3ee);
}

.gpj-card__body p {
    color: var(--muted, #9db4aa);
    font-size: .9rem;
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gpj-card__meta {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--dim, #7e958a);
    font-size: .82rem;
    font-weight: 600;
}

.gpj-card__meta svg {
    flex: none;
}

.gpj-card__cta {
    margin-top: auto;
    padding-top: 6px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: .88rem;
    color: var(--accent, #ffb703);
}

/* ---- modal ---- */
.gpj-modal {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(14px, 4vw, 40px);
    overflow-y: auto;
}

.gpj-modal[hidden] {
    display: none;
}

.gpj-modal__bd {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: rgba(2, 10, 7, .6);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
}

.gpj-modal__card {
    position: relative;
    z-index: 1;
    width: min(860px, 100%);
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--bg2, #0d211a);
    border: 1px solid var(--border, rgba(255, 255, 255, .1));
    border-radius: 26px;
    box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .6);
    padding: clamp(20px, 3.4vw, 38px);
}

.gpj-modal__x {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid var(--border, rgba(255, 255, 255, .1));
    border-radius: 50%;
    background: var(--surface, rgba(255, 255, 255, .06));
    color: var(--muted, #9db4aa);
    cursor: pointer;
    transition: color .3s, border-color .3s, transform .4s cubic-bezier(.22, .85, .24, 1);
    z-index: 2;
}

.gpj-modal__x:hover {
    color: var(--text, #eaf3ee);
    border-color: var(--accent, #ffb703);
    transform: rotate(90deg);
}

.gpj-modal__hero {
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 22px;
    aspect-ratio: 16/8;
    background: var(--surface, rgba(255, 255, 255, .06));
}

.gpj-modal__hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gpj-chip {
    display: inline-block;
    padding: .35rem .85rem;
    border-radius: 100px;
    border: 1px solid var(--border, rgba(255, 255, 255, .1));
    background: var(--surface, rgba(255, 255, 255, .06));
    font-size: .72rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--accent, #ffb703);
    margin-bottom: 12px;
}

.gpj-h2 {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 700;
    letter-spacing: -.025em;
    line-height: 1.15;
    color: var(--text, #eaf3ee);
    margin-bottom: .5em;
}

.gpj-h3 {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--text, #eaf3ee);
    margin: 26px 0 .6em;
}

.gpj-lead {
    color: var(--muted, #9db4aa);
    font-size: .97rem;
    line-height: 1.75;
    max-width: 66ch;
}

/* ---- meta strip: client / location / year ---- */
.gpj-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 26px;
    padding: 14px 0 4px;
    margin: 4px 0 14px;
    border-bottom: 1px solid var(--border, rgba(255, 255, 255, .1));
}

.gpj-meta__item {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: .88rem;
}

.gpj-meta__item span {
    color: var(--dim, #7e958a);
    font-size: .7rem;
    letter-spacing: .16em;
    text-transform: uppercase;
    font-weight: 700;
}

.gpj-meta__item b {
    color: var(--text, #eaf3ee);
    font-weight: 600;
}

/* ---- facts table ---- */
.gpj-facts {
    width: 100%;
    border-collapse: collapse;
    margin: 4px 0 8px;
    font-size: .92rem;
}

.gpj-facts td {
    padding: 11px 4px;
    border-bottom: 1px solid var(--border, rgba(255, 255, 255, .1));
    vertical-align: top;
}

.gpj-facts td:first-child {
    color: var(--dim, #7e958a);
    width: 38%;
    font-weight: 600;
}

.gpj-facts td:last-child {
    color: var(--text, #eaf3ee);
}

/* ---- gallery ---- */
.gpj-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 6px;
}

.gpj-gallery figure {
    margin: 0;
    border-radius: 16px;
    overflow: hidden;
    background: var(--surface, rgba(255, 255, 255, .06));
    border: 1px solid var(--border, rgba(255, 255, 255, .1));
}

.gpj-gallery img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    display: block;
}

.gpj-gallery figcaption {
    padding: 10px 14px;
    color: var(--muted, #9db4aa);
    font-size: .82rem;
    line-height: 1.5;
}

.gpj-gallery figure:only-child,
.gpj-gallery figure:first-child:nth-last-child(3),
.gpj-gallery figure:first-child:nth-last-child(3) ~ figure {
    /* a lone image or a 3-image row reads better full width */
    grid-column: 1 / -1;
}

.gpj-gallery figure:first-child:nth-last-child(3) img {
    aspect-ratio: 16/8;
}

/* ---- responsive ---- */
@media (max-width: 900px) {
    .gpj-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 620px) {
    .gpj-grid {
        grid-template-columns: 1fr;
    }

    .gpj-gallery {
        grid-template-columns: 1fr;
    }
}
