/*
Block Name: Portfolio
Description: Displays an ACF gallery as a responsive CSS grid with a lightbox.
*/

/* =====================================================================
   GRID
   CSS custom properties --cols-desktop, --cols-tablet, and --portfolio-gap
   are set inline by PHP from the ACF field values.
   ===================================================================== */


body.postid-3404 .portfolio-grid__item img, body.postid-3404 .toast-lightbox__figure img {background: #fff; padding: 4rem; }

.portfolio-grid {
  columns: 3;        /* number of columns */
    column-gap: 8rem;  /
}

.block-portfolio .container { width: 90%; max-width: 90%; }

/* ---- Grid item ---- */
.portfolio-grid__item {
    overflow: hidden;
    border-radius: var( --border-radius );
	margin-bottom: 8rem; 
}

/* ---- Trigger link ---- */
.portfolio-grid__trigger {
    display: block;
    cursor: zoom-in;
}

/* ---- Grid image ---- */
.portfolio-grid__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.portfolio-grid__trigger:hover .portfolio-grid__img {
    transform: scale( 1.04 );
    opacity: 0.9;
}

/* ---- Empty notice (editor only) ---- */
.portfolio-empty-notice {
    padding: 2rem;
    color: #888;
    font-style: italic;
    text-align: center;
}


/* =====================================================================
   LIGHTBOX
   Matches the lightbox used in the archive template.
   ===================================================================== */

.toast-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba( 0, 0, 0, 0.92 );
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-lightbox[hidden] { display: none; }

.toast-lightbox__figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90vw;
    max-height: 90vh;
    margin: 0;
}

.toast-lightbox__img {
    display: block;
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 2rem;
}

.toast-lightbox__caption {
    margin-top: 0.75rem;
    text-align: center;
}

.toast-lightbox__link {
    color: #fff;
    text-decoration: underline;
    opacity: 0.8;
}

.toast-lightbox__link:hover { opacity: 1; }

.toast-lightbox__close,
.toast-lightbox__prev,
.toast-lightbox__next {
    position: fixed;
    background: var( --brand-1 );
    border: none;
    color: #fff;
    cursor: pointer;
    border-radius: 50%;
    line-height: 1;
    transition: background 0.2s;
}

.toast-lightbox__close {
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    width: 2.5rem;
    height: 2.5rem;
}

.toast-lightbox__prev,
.toast-lightbox__next {
    top: 50%;
    transform: translateY( -50% );
    font-size: 3rem;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.toast-lightbox__prev { left: 1rem; }
.toast-lightbox__next { right: 1rem; }

.toast-lightbox__close:hover,
.toast-lightbox__prev:hover,
.toast-lightbox__next:hover {
    background: rgba( 255, 255, 255, 0.3 );
}