/* ==========================================================================
   APG Frontend Stylesheet
   Portfolio gallery wrapper, info strip, and image grid.
   ========================================================================== */

/* ── Wrapper ──────────────────────────────────────────────────────────────── */
.apg-portfolio-wrapper {
    max-width: 1200px;
    margin: 0 auto;
}

/* ── Info strip ───────────────────────────────────────────────────────────── */
.apg-portfolio-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    background: #ffffff;
    border: 1px solid #f0f0f0;
    padding: 40px;
    border-radius: 20px;
    margin-bottom: 60px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.03);
    position: relative;
    overflow: hidden;
}

.apg-portfolio-info::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #000;
}

/* ── Info items ───────────────────────────────────────────────────────────── */
.apg-info-item {
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.apg-info-item:hover {
    transform: translateY(-2px);
}

.apg-info-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #a0a0a0;
    margin-bottom: 10px;
    font-weight: 800;
}

.apg-info-value {
    font-size: 18px;
    color: #111;
    font-weight: 600;
    line-height: 1.2;
}

/* ── Gallery grid ─────────────────────────────────────────────────────────── */
.apg-gallery-grid {
    display: grid;
    /* Use variables passed from shortcode inline style with fallbacks */
    grid-template-columns: repeat(var(--apg-cols, 3), 1fr);
    gap: var(--apg-gap, 20px);
    padding: 10px 0;
}

.apg-gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    background: #f7f7f7;
    aspect-ratio: 1 / 1;
    cursor: pointer;
}

.apg-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(0.2, 1, 0.3, 1);
}

.apg-gallery-item:hover img {
    transform: scale(1.08);
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 992px) {
    .apg-gallery-grid {
        /* On medium screens, limit max columns to 2, but allow 1 if --apg-cols is 1 */
        grid-template-columns: repeat(min(2, var(--apg-cols, 3)), 1fr);
    }
}

@media (max-width: 600px) {
    .apg-gallery-grid {
        grid-template-columns: 1fr;
    }

    .apg-portfolio-info {
        grid-template-columns: 1fr;
        padding: 25px;
    }
}
