/* ========================================
   PAGE: PORTFOLIO (tabs + gallery)
   ======================================== */

.c-porto {
    padding: var(--space-4xl) 0;
    background: var(--color-bg);
    overflow: hidden;
}

.c-porto__header {
    max-width: 980px;
    margin: 0 auto var(--space-2xl);
    text-align: center;
}

.c-porto__title {
    margin: 0 0 var(--space-md);
}

.c-porto__lead {
    color: var(--color-muted);
    line-height: 1.7;
    font-size: 16px;
}

.c-porto__layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: var(--space-2xl);
    align-items: start;

    background: var(--color-bg);
    border-radius: 18px;
    box-shadow: 0 20px 60px rgba(31, 31, 41, 0.08);
    padding: var(--space-xl);
    min-width: 0;
}

.c-porto__menu {
    display: flex;
    align-items: center;
    min-width: 0;
}

.c-porto__menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    display: grid;
    gap: 10px;
    align-content: center;
}

.c-porto__tab {
    width: 100%;
    border: 0;
    cursor: pointer;

    font-family: var(--font-heading);
    font-weight: 600;
    letter-spacing: 0.2px;

    color: var(--color-text);
    opacity: 0.92;

    background: transparent;
    padding: 10px 14px;
    border-radius: 12px;

    transition: color .15s ease, opacity .15s ease, background .15s ease, transform .15s ease;
    text-align: left;
}

.c-porto__tab:hover {
    opacity: 1;
    color: var(--color-primary);
    background: rgba(31, 31, 41, 0.04);
    transform: translateY(-1px);
}

.c-porto__tab.is-active {
    opacity: 1;
    color: var(--color-primary);
    background: rgba(31, 31, 41, 0.04);
}

.c-porto__panels {
    min-height: 420px;
    min-width: 0;
}

.c-porto__panel {
    display: none;
    animation: portoFade .22s ease;
    min-width: 0;
}

.c-porto__panel.is-active {
    display: block;
}

@keyframes portoFade {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.c-porto__panel-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.c-porto__panel-title {
    margin: 0;
}

.c-porto__panel-link {
    color: var(--color-primary);
    border-bottom: 1px solid rgba(0, 0, 0, .2);
}

.c-porto__panel-link:hover {
    border-bottom-color: rgba(0, 0, 0, .45);
}

.c-porto__content--loading {
    opacity: .7;
}

.c-porto__content {
    min-width: 0;
}

/* podstawy dla treści */
.c-porto__content .wp-block-gallery {
    margin: 0;
}

.c-porto__content figure {
    overflow: hidden;
}

.c-porto__content img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
}

/* Mobile nav section */
@media (max-width: 900px) {
    .c-porto__header {
        text-align: left;
    }

    .c-porto__layout {
        grid-template-columns: 1fr;
        padding: var(--space-lg);
        gap: var(--space-lg);
    }

    .c-porto__menu {
        align-items: stretch;
        min-width: 0;
    }

    .c-porto__menu-list {
        display: flex;
        flex-wrap: nowrap;
        gap: 8px;
        overflow-x: auto;
        overflow-y: hidden;
        width: 100%;
        padding-bottom: 6px;
        scrollbar-width: none;
    }

    .c-porto__menu-list::-webkit-scrollbar {
        display: none;
    }

    .c-porto__menu-list li {
        flex: 0 0 auto;
    }

    .c-porto__tab {
        width: auto;
        white-space: nowrap;
    }

    .c-porto__panel-head {
        flex-direction: column;
        align-items: flex-start;
    }
}

#portfolio.reveal,
#portfolio .reveal {
    opacity: 1 !important;
    transform: none !important;
}

/* ========================================
   PORTFOLIO GALLERY – true masonry
   działa:
   - na stronie Portfolio
   - na podstronach galerii
   ======================================== */

.c-porto__content .wp-block-gallery,
.entry-content .wp-block-gallery,
.page .wp-block-gallery,
.site-main .wp-block-gallery {
    display: block !important;
    columns: 4 260px;
    column-gap: 25px;
    margin: 0 !important;
    max-width: 100%;
}

.c-porto__content .wp-block-gallery.has-nested-images,
.entry-content .wp-block-gallery.has-nested-images,
.page .wp-block-gallery.has-nested-images,
.site-main .wp-block-gallery.has-nested-images {
    display: block !important;
}

.c-porto__content .wp-block-gallery .wp-block-image,
.c-porto__content .wp-block-gallery .blocks-gallery-item,
.c-porto__content .wp-block-gallery figure,
.entry-content .wp-block-gallery .wp-block-image,
.entry-content .wp-block-gallery .blocks-gallery-item,
.entry-content .wp-block-gallery figure,
.page .wp-block-gallery .wp-block-image,
.page .wp-block-gallery .blocks-gallery-item,
.page .wp-block-gallery figure,
.site-main .wp-block-gallery .wp-block-image,
.site-main .wp-block-gallery .blocks-gallery-item,
.site-main .wp-block-gallery figure {
    display: inline-block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 20px !important;
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
    overflow: hidden;
    vertical-align: top;
}

.c-porto__content .wp-block-gallery .wp-block-image img,
.c-porto__content .wp-block-gallery .blocks-gallery-item img,
.c-porto__content .wp-block-gallery figure img,
.entry-content .wp-block-gallery .wp-block-image img,
.entry-content .wp-block-gallery .blocks-gallery-item img,
.entry-content .wp-block-gallery figure img,
.page .wp-block-gallery .wp-block-image img,
.page .wp-block-gallery .blocks-gallery-item img,
.page .wp-block-gallery figure img,
.site-main .wp-block-gallery .wp-block-image img,
.site-main .wp-block-gallery .blocks-gallery-item img,
.site-main .wp-block-gallery figure img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    display: block;
    transition: transform .35s ease;
}

.c-porto__content .wp-block-gallery .wp-block-image:hover img,
.c-porto__content .wp-block-gallery .blocks-gallery-item:hover img,
.c-porto__content .wp-block-gallery figure:hover img,
.entry-content .wp-block-gallery .wp-block-image:hover img,
.entry-content .wp-block-gallery .blocks-gallery-item:hover img,
.entry-content .wp-block-gallery figure:hover img,
.page .wp-block-gallery .wp-block-image:hover img,
.page .wp-block-gallery .blocks-gallery-item:hover img,
.page .wp-block-gallery figure:hover img,
.site-main .wp-block-gallery .wp-block-image:hover img,
.site-main .wp-block-gallery .blocks-gallery-item:hover img,
.site-main .wp-block-gallery figure:hover img {
    transform: scale(1.02);
}

@media (max-width: 1100px) {

    .c-porto__content .wp-block-gallery,
    .entry-content .wp-block-gallery,
    .page .wp-block-gallery,
    .site-main .wp-block-gallery {
        columns: 3 220px;
        column-gap: 18px;
    }

    .c-porto__content .wp-block-gallery .wp-block-image,
    .c-porto__content .wp-block-gallery .blocks-gallery-item,
    .c-porto__content .wp-block-gallery figure,
    .entry-content .wp-block-gallery .wp-block-image,
    .entry-content .wp-block-gallery .blocks-gallery-item,
    .entry-content .wp-block-gallery figure,
    .page .wp-block-gallery .wp-block-image,
    .page .wp-block-gallery .blocks-gallery-item,
    .page .wp-block-gallery figure,
    .site-main .wp-block-gallery .wp-block-image,
    .site-main .wp-block-gallery .blocks-gallery-item,
    .site-main .wp-block-gallery figure {
        margin-bottom: 18px !important;
    }
}

@media (max-width: 700px) {

    .c-porto__content .wp-block-gallery,
    .entry-content .wp-block-gallery,
    .page .wp-block-gallery,
    .site-main .wp-block-gallery {
        columns: 1;
        column-gap: 0;
    }

    .c-porto__content .wp-block-gallery .wp-block-image,
    .c-porto__content .wp-block-gallery .blocks-gallery-item,
    .c-porto__content .wp-block-gallery figure,
    .entry-content .wp-block-gallery .wp-block-image,
    .entry-content .wp-block-gallery .blocks-gallery-item,
    .entry-content .wp-block-gallery figure,
    .page .wp-block-gallery .wp-block-image,
    .page .wp-block-gallery .blocks-gallery-item,
    .page .wp-block-gallery figure,
    .site-main .wp-block-gallery .wp-block-image,
    .site-main .wp-block-gallery .blocks-gallery-item,
    .site-main .wp-block-gallery figure {
        margin-bottom: 14px !important;
    }
}

@media (max-width: 480px) {

    .c-porto__content .wp-block-gallery,
    .entry-content .wp-block-gallery,
    .page .wp-block-gallery,
    .site-main .wp-block-gallery {
        columns: 1;
        column-gap: 0;
    }

    .c-porto__content .wp-block-gallery .wp-block-image,
    .c-porto__content .wp-block-gallery .blocks-gallery-item,
    .c-porto__content .wp-block-gallery figure,
    .entry-content .wp-block-gallery .wp-block-image,
    .entry-content .wp-block-gallery .blocks-gallery-item,
    .entry-content .wp-block-gallery figure,
    .page .wp-block-gallery .wp-block-image,
    .page .wp-block-gallery .blocks-gallery-item,
    .page .wp-block-gallery figure,
    .site-main .wp-block-gallery .wp-block-image,
    .site-main .wp-block-gallery .blocks-gallery-item,
    .site-main .wp-block-gallery figure {
        margin-bottom: 12px !important;
    }
}