:root {
    --tpg-accent: #ff8a2a;
}

.tpg-portfolio-wrap,
.tpg-portfolio-wrap *,
.tpg-single-wrap,
.tpg-single-wrap * {
    box-sizing: border-box;
}

.tpg-portfolio-wrap {
    width: 100%;
}

.tpg-filter-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 0 0 38px;
    position: relative;
    padding-top: 28px;
}

.tpg-filter-bar::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: 150px;
    height: 3px;
    background: var(--tpg-accent);
    transform: translateX(-50%);
}

.tpg-filter {
    appearance: none;
    border: 0;
    background: #020303;
    color: #fff;
    font: inherit;
    font-size: 16px;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: .02em;
    padding: 15px 18px;
    border-radius: 5px;
    cursor: pointer;
    transition: background .25s ease, transform .25s ease;
}

.tpg-filter:hover,
.tpg-filter:focus-visible,
.tpg-filter.is-active {
    background: var(--tpg-accent);
    color: #fff;
}

.tpg-filter:hover {
    transform: translateY(-1px);
}

.tpg-grid {
    display: grid;
    grid-template-columns: repeat(var(--tpg-columns, 3), minmax(0, 1fr));
    gap: var(--tpg-gap, 20px);
}

.tpg-card {
    min-width: 0;
    background: #efefef;
    border-radius: 0 0 4px 4px;
    overflow: hidden;
}

.tpg-card.is-hidden {
    display: none;
}

.tpg-card-media {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #ddd;
}

.tpg-card-image,
.tpg-card-placeholder {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tpg-card-placeholder {
    background: linear-gradient(135deg, #f0f0f0, #dadada);
}

.tpg-card-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(9, 15, 23, .72);
    opacity: 0;
    transition: opacity .3s ease;
}

.tpg-card:hover .tpg-card-overlay,
.tpg-card:focus-within .tpg-card-overlay {
    opacity: 1;
}

.tpg-card-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateY(12px);
    transition: transform .3s ease;
}

.tpg-card:hover .tpg-card-actions,
.tpg-card:focus-within .tpg-card-actions {
    transform: translateY(0);
}

.tpg-icon-button {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--tpg-accent);
    color: #fff;
    cursor: pointer;
    text-decoration: none !important;
    box-shadow: none !important;
    padding: 0;
}

.tpg-icon-button:hover,
.tpg-icon-button:focus-visible {
    color: #fff;
    filter: brightness(.96);
}

.tpg-icon-button svg {
    width: 19px;
    height: 19px;
    fill: currentColor;
}

.tpg-card-title {
    margin: 0;
    padding: 10px 12px;
    text-align: center;
    font-size: 16px;
    line-height: 1.35;
    font-weight: 700;
    color: #111;
    background: #efefef;
}

.tpg-card-title a {
    color: inherit;
    text-decoration: none !important;
}

.tpg-single-wrap {
    --tpg-banner-height: 280px;
    --tpg-banner-opacity: .62;
    --tpg-banner-image: none;
    width: 100%;
    background: #ffffff !important;
    color: #222222;
}

/* Prevent the active theme's body/page background texture from showing through
   the SRK Portfolio single page. */
body.tpg-single-portfolio,
body.tpg-single-portfolio #page,
body.tpg-single-portfolio .site,
body.tpg-single-portfolio .site-content,
body.tpg-single-portfolio .content-area {
    background-color: #ffffff !important;
}

.tpg-single-hero {
    position: relative;
    min-height: var(--tpg-banner-height);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-image: var(--tpg-banner-image);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    background-color: #f5f5f5;
    overflow: hidden;
}

/* Light/white banner overlay like the supplied page-banner reference. */
.tpg-single-hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, var(--tpg-banner-opacity));
}

.tpg-single-hero-inner {
    position: relative;
    z-index: 2;
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    color: #191919;
}

.tpg-single-hero h1 {
    margin: 0 0 18px;
    color: #191919 !important;
    font-size: clamp(32px, 4vw, 44px);
    line-height: 1.1;
    font-weight: 700;
    text-transform: uppercase;
}

/* White breadcrumb box under the H1, matching the reference layout. */
.tpg-single-breadcrumbs {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 11px;
    min-height: 48px;
    padding: 12px 24px;
    background: #ffffff;
    color: #8a8a8a;
    font-size: 14px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .02);
}

.tpg-single-breadcrumbs a {
    color: #222222;
    text-decoration: none;
}

.tpg-single-breadcrumbs a:hover {
    color: var(--tpg-accent);
}

.tpg-single-breadcrumbs span {
    color: #8a8a8a;
}

.tpg-single-content {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 64px 0 80px;
    background: #ffffff;
}

.tpg-single-description {
    margin-bottom: 48px;
}

.tpg-gallery-section {
    background: #ffffff;
}

.tpg-gallery-section h2 {
    margin: 0;
    text-align: center;
    color: #555;
    font-size: clamp(28px, 3vw, 38px);
    line-height: 1.2;
    font-weight: 500;
}

.tpg-heading-line {
    width: 136px;
    height: 3px;
    margin: 28px auto 26px;
    background: var(--tpg-accent);
}

.tpg-single-gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.tpg-gallery-item {
    position: relative;
    appearance: none;
    border: 0;
    padding: 0;
    margin: 0;
    background: transparent;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    cursor: pointer;
}

.tpg-gallery-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
}

.tpg-gallery-hover {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(8, 13, 20, .62);
    opacity: 0;
    transition: opacity .3s ease;
}

.tpg-gallery-item:hover .tpg-gallery-hover,
.tpg-gallery-item:focus-visible .tpg-gallery-hover {
    opacity: 1;
}

.tpg-gallery-item:hover img {
    transform: scale(1.035);
}

.tpg-gallery-zoom {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tpg-accent);
    color: #fff;
}

.tpg-gallery-zoom svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

html.tpg-lightbox-open {
    overflow: hidden;
}

.tpg-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .92);
    padding: 34px 80px;
}

.tpg-lightbox.is-open {
    display: flex;
}

.tpg-lightbox-stage {
    max-width: min(1200px, 90vw);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.tpg-lightbox-image {
    display: block;
    max-width: 100%;
    max-height: calc(88vh - 48px);
    width: auto;
    height: auto;
    object-fit: contain;
}

.tpg-lightbox-caption {
    color: #fff;
    text-align: center;
    font-size: 14px;
    min-height: 20px;
}

.tpg-lightbox-close,
.tpg-lightbox-prev,
.tpg-lightbox-next {
    position: absolute;
    border: 0;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    cursor: pointer;
}

.tpg-lightbox-close {
    top: 20px;
    right: 22px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 32px;
    line-height: 1;
}

.tpg-lightbox-prev,
.tpg-lightbox-next {
    top: 50%;
    width: 48px;
    height: 64px;
    transform: translateY(-50%);
    font-size: 30px;
}

.tpg-lightbox-prev {
    left: 18px;
}

.tpg-lightbox-next {
    right: 18px;
}

.tpg-empty {
    text-align: center;
    padding: 20px;
}

@media (max-width: 1024px) {
    .tpg-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tpg-single-gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .tpg-filter-bar {
        gap: 8px;
        margin-bottom: 26px;
    }

    .tpg-filter {
        font-size: 13px;
        padding: 12px 13px;
    }

    .tpg-grid {
        grid-template-columns: 1fr;
    }

    .tpg-single-hero {
        min-height: 230px;
    }

    .tpg-single-hero h1 {
        font-size: 30px;
    }

    .tpg-single-content {
        width: min(100% - 28px, 1180px);
        padding: 44px 0 60px;
    }

    .tpg-single-gallery {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .tpg-lightbox {
        padding: 60px 14px 30px;
    }

    .tpg-lightbox-prev,
    .tpg-lightbox-next {
        top: auto;
        bottom: 16px;
        transform: none;
        width: 48px;
        height: 48px;
        border-radius: 50%;
    }

    .tpg-lightbox-prev {
        left: calc(50% - 58px);
    }

    .tpg-lightbox-next {
        right: calc(50% - 58px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .tpg-card-overlay,
    .tpg-card-actions,
    .tpg-gallery-hover,
    .tpg-gallery-item img,
    .tpg-filter {
        transition: none;
    }
}
