/* =============================================================
   TNW Portfolio — professional gallery page
   Built 2026-05-11
   ============================================================= */

.tnw-portfolio {
    --tp-green:       #16a34a;
    --tp-green-dark:  #0f5132;
    --tp-green-light: #4ade80;
    --tp-blue:        #2563eb;
    --tp-dark:        #0f172a;
    --tp-text:        #1e293b;
    --tp-muted:       #64748b;
    --tp-bg:          #f8fafc;
    --tp-card:        #ffffff;
    --tp-border:      #e2e8f0;
    --tp-radius:      18px;
    --tp-radius-sm:   12px;
    --tp-shadow:      0 10px 28px -10px rgba(15, 31, 26, .18), 0 4px 12px -4px rgba(15, 31, 26, .08);
    --tp-shadow-lg:   0 28px 60px -20px rgba(15, 31, 26, .35), 0 12px 24px -8px rgba(15, 31, 26, .15);

    background: linear-gradient(180deg, #f0fdf4 0%, #f8fafc 35%, #ffffff 100%);
    padding: 70px 0 80px;
    position: relative;
    overflow: hidden;
}
.tnw-portfolio::before {
    content: '';
    position: absolute;
    top: -200px; right: -200px;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(22, 163, 74, .12) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}
.tnw-portfolio::after {
    content: '';
    position: absolute;
    bottom: -250px; left: -150px;
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(37, 99, 235, .08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}
.tnw-portfolio__container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

/* ===== Hero ===== */
.tnw-portfolio__hero {
    text-align: center;
    margin-bottom: 50px;
}
.tnw-portfolio__eyebrow {
    display: inline-block;
    padding: 7px 18px;
    background: rgba(255, 255, 255, .92);
    color: var(--tp-green-dark);
    border: 1px solid rgba(22, 163, 74, .25);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .6px;
    text-transform: uppercase;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px -3px rgba(15, 81, 50, .15);
}
.tnw-portfolio__title {
    font-size: clamp(2rem, 5vw, 3.4rem);
    font-weight: 900;
    margin: 0 0 14px;
    color: var(--tp-dark);
    letter-spacing: -.02em;
    line-height: 1.1;
    background: linear-gradient(135deg, var(--tp-green-dark) 0%, var(--tp-green) 60%, var(--tp-blue) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.tnw-portfolio__subtitle {
    max-width: 720px;
    margin: 0 auto 32px;
    color: var(--tp-muted);
    font-size: clamp(.95rem, 1.4vw, 1.1rem);
    line-height: 1.6;
}
.tnw-portfolio__stats {
    display: inline-flex;
    gap: 28px;
    padding: 18px 28px;
    background: var(--tp-card);
    border-radius: var(--tp-radius);
    box-shadow: var(--tp-shadow);
    border: 1px solid var(--tp-border);
}
.tnw-portfolio__stat {
    text-align: center;
    min-width: 80px;
}
.tnw-portfolio__stat strong {
    display: block;
    font-size: 1.7rem;
    font-weight: 900;
    color: var(--tp-green-dark);
    line-height: 1;
    margin-bottom: 4px;
}
.tnw-portfolio__stat span {
    font-size: 12px;
    color: var(--tp-muted);
    text-transform: uppercase;
    letter-spacing: .5px;
}

/* ===== Filter chips ===== */
.tnw-portfolio__filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 40px;
    padding: 0 8px;
}
.tnw-portfolio__chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--tp-card);
    border: 1.5px solid var(--tp-border);
    border-radius: 999px;
    color: var(--tp-text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .25s cubic-bezier(.4, 0, .2, 1);
    box-shadow: 0 2px 6px -2px rgba(15, 31, 26, .08);
    font-family: inherit;
    line-height: 1;
}
.tnw-portfolio__chip:hover {
    border-color: var(--tp-green);
    color: var(--tp-green-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -6px rgba(22, 163, 74, .25);
}
.tnw-portfolio__chip.is-active {
    background: linear-gradient(135deg, var(--tp-green) 0%, var(--tp-green-dark) 100%);
    color: #fff;
    border-color: var(--tp-green-dark);
    box-shadow: 0 8px 24px -6px rgba(22, 163, 74, .55);
}
.tnw-portfolio__chip-ico {
    font-size: 16px;
    line-height: 1;
}
.tnw-portfolio__chip-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 22px;
    padding: 0 8px;
    background: rgba(15, 23, 42, .08);
    color: inherit;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
}
.tnw-portfolio__chip.is-active .tnw-portfolio__chip-count {
    background: rgba(255, 255, 255, .22);
    color: #fff;
}

/* ===== Grid ===== */
.tnw-portfolio__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    margin-bottom: 60px;
}
.tnw-portfolio__card {
    position: relative;
    display: block;
    border-radius: var(--tp-radius-sm);
    overflow: hidden;
    text-decoration: none;
    background: var(--tp-card);
    box-shadow: var(--tp-shadow);
    aspect-ratio: 4 / 3;
    transition: all .35s cubic-bezier(.4, 0, .2, 1);
}
.tnw-portfolio__card.is-hidden {
    display: none;
}
.tnw-portfolio__card:hover {
    transform: translateY(-6px);
    box-shadow: var(--tp-shadow-lg);
}
.tnw-portfolio__card-media {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}
.tnw-portfolio__card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .6s cubic-bezier(.4, 0, .2, 1);
    display: block;
}
.tnw-portfolio__card:hover .tnw-portfolio__card-media img {
    transform: scale(1.08);
}
.tnw-portfolio__card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 35%, rgba(15, 23, 42, .85) 100%);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 14px;
    opacity: 0;
    transition: opacity .35s ease;
}
.tnw-portfolio__card:hover .tnw-portfolio__card-overlay {
    opacity: 1;
}
.tnw-portfolio__card-cat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, .96);
    color: var(--tp-green-dark);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 4px 12px -3px rgba(0, 0, 0, .3);
}
.tnw-portfolio__card-zoom {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, .96);
    color: var(--tp-green-dark);
    border-radius: 50%;
    box-shadow: 0 4px 12px -3px rgba(0, 0, 0, .3);
    flex-shrink: 0;
}

/* ===== Empty state ===== */
.tnw-portfolio__empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--tp-muted);
}
.tnw-portfolio__empty-ico {
    display: block;
    font-size: 60px;
    margin-bottom: 16px;
    opacity: .55;
}

/* ===== CTA ===== */
.tnw-portfolio__cta {
    background: linear-gradient(135deg, var(--tp-green-dark) 0%, var(--tp-green) 60%, #047857 100%);
    color: #fff;
    text-align: center;
    border-radius: var(--tp-radius);
    padding: 50px 28px;
    box-shadow: 0 20px 50px -20px rgba(22, 163, 74, .55);
    position: relative;
    overflow: hidden;
}
.tnw-portfolio__cta::before,
.tnw-portfolio__cta::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}
.tnw-portfolio__cta::before {
    width: 320px; height: 320px;
    top: -160px; right: -120px;
    background: radial-gradient(circle, rgba(255, 255, 255, .14) 0%, transparent 70%);
}
.tnw-portfolio__cta::after {
    width: 280px; height: 280px;
    bottom: -140px; left: -100px;
    background: radial-gradient(circle, rgba(255, 255, 255, .10) 0%, transparent 70%);
}
.tnw-portfolio__cta > * { position: relative; z-index: 1; }
.tnw-portfolio__cta h3 {
    margin: 0 0 12px;
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 900;
    color: #fff;
}
.tnw-portfolio__cta p {
    margin: 0 auto 28px;
    max-width: 600px;
    color: rgba(255, 255, 255, .9);
    font-size: 1.05rem;
    line-height: 1.55;
}
.tnw-portfolio__cta-actions {
    display: inline-flex;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
}
.tnw-portfolio__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 15px;
    text-decoration: none;
    transition: all .25s ease;
    letter-spacing: .3px;
}
.tnw-portfolio__btn--primary {
    background: #fff;
    color: var(--tp-green-dark);
    box-shadow: 0 10px 24px -6px rgba(0, 0, 0, .25);
}
.tnw-portfolio__btn--primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 32px -8px rgba(0, 0, 0, .35);
}
.tnw-portfolio__btn--ghost {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, .55);
}
.tnw-portfolio__btn--ghost:hover {
    background: rgba(255, 255, 255, .15);
    border-color: #fff;
}

/* ===== Lightbox ===== */
.tnw-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .92);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 50px 60px;
    animation: tp-lb-in .2s ease;
}
@keyframes tp-lb-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.tnw-lightbox[hidden] { display: none !important; }
.tnw-lightbox__figure {
    margin: 0;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}
.tnw-lightbox__figure img {
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8);
    object-fit: contain;
}
.tnw-lightbox figcaption {
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    padding: 6px 18px;
    background: rgba(255, 255, 255, .12);
    border-radius: 999px;
    backdrop-filter: blur(6px);
}
.tnw-lightbox__close,
.tnw-lightbox__nav {
    position: absolute;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    border: 0;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 26px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s ease;
    backdrop-filter: blur(10px);
}
.tnw-lightbox__close:hover,
.tnw-lightbox__nav:hover {
    background: rgba(255, 255, 255, .25);
    transform: scale(1.06);
}
.tnw-lightbox__close { top: 18px; right: 18px; font-size: 30px; line-height: 1; }
.tnw-lightbox__nav--prev { left: 18px;  top: 50%; transform: translateY(-50%); }
.tnw-lightbox__nav--next { right: 18px; top: 50%; transform: translateY(-50%); }
.tnw-lightbox__nav--prev:hover { transform: translateY(-50%) scale(1.06); }
.tnw-lightbox__nav--next:hover { transform: translateY(-50%) scale(1.06); }
[dir="rtl"] .tnw-lightbox__nav--prev { left: auto; right: 18px; }
[dir="rtl"] .tnw-lightbox__nav--next { right: auto; left: 18px; }
[dir="rtl"] .tnw-lightbox__close { right: auto; left: 18px; }
.tnw-lightbox__counter {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, .85);
    font-size: 13px;
    font-weight: 700;
    background: rgba(255, 255, 255, .12);
    padding: 6px 16px;
    border-radius: 999px;
    letter-spacing: 1px;
}

/* ===== Responsive ===== */
@media (max-width: 1100px) {
    .tnw-portfolio__grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .tnw-portfolio { padding: 50px 0 60px; }
    .tnw-portfolio__container { padding: 0 16px; }
    .tnw-portfolio__grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .tnw-portfolio__stats { gap: 18px; padding: 14px 18px; }
    .tnw-portfolio__stat strong { font-size: 1.4rem; }
    .tnw-portfolio__chip { padding: 8px 14px; font-size: 13px; gap: 6px; }
    .tnw-portfolio__chip-label { display: inline; }
    .tnw-portfolio__cta { padding: 36px 20px; border-radius: 14px; }
    .tnw-portfolio__btn { padding: 12px 22px; font-size: 14px; }
    .tnw-lightbox { padding: 60px 14px; }
    .tnw-lightbox__close,
    .tnw-lightbox__nav { width: 42px; height: 42px; font-size: 22px; }
}
@media (max-width: 480px) {
    .tnw-portfolio__grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .tnw-portfolio__chip-label { font-size: 12px; }
    .tnw-portfolio__chip-count { display: none; }
}
