/* static/css/portfolio.css*/



.portfolio-hero,
.portfolio-filter-bar,
.portfolio-grid-section,
.portfolio-detail-hero {
    background-color: none;
}

.portfolio-filter-btn {
    background-color: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #cbd5e1;
    border-radius: 999px;
    padding: 0.4rem 1.1rem;
    transition: var(--transition);
}

.portfolio-filter-btn:hover {
    border-color: var(--primary-color);
    color: #fff;
}

.portfolio-filter-btn.active {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}


/* ===========================================
   Filter bar: sticky under navbar, collapses to
   the selected category only while pinned
   =========================================== */

#portfolioFilterSentinel {
    height: 1px;
}

.portfolio-filter-bar {
    position: sticky;
    top: var(--navbar-height, 76px);
    z-index: 900; /* stays below the navbar's own z-index so it tucks under it */
    transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

/* Once pinned under the navbar, give it an opaque "overlay" surface so
   page content scrolling underneath doesn't show through */


.portfolio-filter-bar .portfolio-filter-btn {
    transition: var(--transition), opacity 0.2s ease;
}

/* Hide every pill except the active one while pinned */
.portfolio-filter-bar.is-stuck .portfolio-filter-btn:not(.active) {
    display: none;
}

/* ...unless the user expanded it back open to switch categories */
.portfolio-filter-bar.is-stuck.expanded .portfolio-filter-btn:not(.active) {
    display: inline-flex;
}

.portfolio-filter-expand-btn {
    display: none; /* only shown once pinned, via the rule below */
    background-color: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #cbd5e1;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.portfolio-filter-expand-btn:hover {
    border-color: var(--primary-color);
    color: #fff;
}

.portfolio-filter-bar.is-stuck .portfolio-filter-expand-btn {
    display: inline-flex;
}

.portfolio-filter-bar.is-stuck.expanded .portfolio-filter-expand-btn i {
    transform: rotate(90deg);
}

/* ===========================================
   Filter pills: stay auto-width on mobile
   =========================================== */

/* responsive.css sets a blanket .btn { width: 100% } below 576px for
   normal action buttons — that's not meant for pill-style filters, so
   override it here specifically for the category filter bar. !important
   is needed since both rules share the same class-selector specificity
   and load order between responsive.css and portfolio.css isn't
   guaranteed to favor this one otherwise. */
@media (max-width: 575.98px) {
    .portfolio-filter-btn {
        width: auto !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        line-height: 1.2 !important;
        margin-bottom: 10 !important;
        padding: 0.4rem 1.1rem !important;
    }

     /* The rule above needs !important to beat responsive.css's blanket
       .btn { width: 100% }, but that same !important also beats the
       is-stuck hiding rule further up this file. Re-assert display:none
       here, scoped to non-active pills while stuck, so mobile collapse
       still works. */
    .portfolio-filter-bar.is-stuck .portfolio-filter-btn:not(.active) {
        display: none !important;
    }

    .portfolio-filter-bar.is-stuck.expanded .portfolio-filter-btn:not(.active) {
        display: inline-flex !important;
    }
}

.portfolio-card-img-link {
    display: block;
    text-decoration: none;
}

/* Registers --border-progress as an animatable percentage so the
   conic-gradient sweep transitions smoothly instead of snapping. */
@property --border-progress {
    syntax: '<percentage>';
    initial-value: 0%;
    inherits: false;
}

.portfolio-card {
    background-color: #0f172a;
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: var(--transition), --border-progress 0.6s ease, box-shadow 0.3s ease;
    position: relative;
    border: 2px solid transparent; /* reserves the 2px ring, kept transparent at rest */
    background-image:
        linear-gradient(#0f172a, #0f172a),
        conic-gradient(
            from var(--corner-angle, -45deg),
            rgba(242, 235, 82, 0.95) 0%,
            rgba(242, 235, 82, 0.95) var(--border-progress),
            transparent var(--border-progress),
            transparent calc(100% - var(--border-progress)),
            rgba(242, 235, 82, 0.95) calc(100% - var(--border-progress)),
            rgba(242, 235, 82, 0.95) 100%
        );
    background-origin: padding-box, border-box;
    background-clip: padding-box, border-box;
}

.portfolio-card:hover {
    transform: translateY(-6px);
    --border-progress: 50%; /* each arm grows to 50%, meeting = full 100% loop */
   box-shadow: 0 0 20px 4px rgba(242, 235, 82, 0.35),
              0 4px 8px rgba(0,0,0,0.3);
}

.portfolio-card-img-wrap {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background-color: #1e293b;
}

.portfolio-card-img {
    width: 100%;
    height: 100%;
    object-fit: scale-down;;
    transition: var(--transition);
}

.portfolio-card:hover .portfolio-card-img {
    transform: scale(1.05);
}

.portfolio-badge {
    display: inline-block;
    background-color: #0f172a;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.portfolio-client {
    color: #94a3b8;
    font-size: 0.9rem;
}

.portfolio-client-link {
    color: #93c5fd;
    text-decoration: none;
}

.portfolio-client-link:hover {
    text-decoration: underline;
}

.portfolio-back-link {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.95rem;
}

.portfolio-back-link:hover {
    color: #fff;
}

/* ===========================================
   Portfolio Image Gallery (mirrors service gallery)
   =========================================== */

.portfolio-gallery {
    width: 100%;
}

.portfolio-main-image-container {
    width: 100%;
    height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 12px;
    background-color: #0f172a;
    margin-bottom: 15px;
}

.portfolio-main-image {
    width: 100%;
    height: 100%;
    object-fit: scale-down;
    display: block;
    transition: opacity 0.25s ease;
    cursor: zoom-in;
}

.portfolio-thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
}

.portfolio-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    border: 2px solid transparent;
    background-image:
        linear-gradient(#0f172a, #0f172a),
        conic-gradient(
            from var(--corner-angle, -45deg),
            rgba(242, 235, 82, 0.95) 0%,
            rgba(242, 235, 82, 0.95) var(--border-progress),
            transparent var(--border-progress),
            transparent calc(100% - var(--border-progress)),
            rgba(242, 235, 82, 0.95) calc(100% - var(--border-progress)),
            rgba(242, 235, 82, 0.95) 100%
        );
    background-origin: padding-box, border-box;
    background-clip: padding-box, border-box;
    transition: --border-progress 0.6s ease, box-shadow 0.3s ease;
}

.portfolio-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: scale-down;
    display: block;
}

.portfolio-thumbnail:hover {
    --border-progress: 50%; /* each arm grows to 50%, meeting = full 100% loop */

}

.portfolio-thumbnail.active {
    --border-progress: 50%; /* fully solid ring, same mechanism as hover */
    box-shadow: 0 0 0 0px rgba(242, 235, 82, 0.2);
}

@media (max-width: 768px) {
    .portfolio-main-image-container { height: 300px; }
    .portfolio-thumbnail { width: 65px; height: 65px; }
}

@media (max-width: 480px) {
    .portfolio-main-image-container { height: 240px; }
    .portfolio-thumbnail { width: 60px; height: 60px; }
}
/****************************************************************/

/* ===========================================
   Portfolio Info Panel (matches gallery height,
   only the description scrolls)
   =========================================== */

.portfolio-info-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
}

.portfolio-info-fixed-top {
    flex: 0 0 auto;
}

@media (max-width: 575.98px) {
    .portfolio-info-fixed-bottom {
        text-align: center;
    }

    .portfolio-info-fixed-bottom .btn {
        width: auto !important;
        margin-bottom: 0 !important;
    }
}

.portfolio-description-scroll {
    flex: 1 1 auto;
    min-height: 0; /* required so the flex child scrolls instead of growing */
    overflow-y: auto;
    overflow-x: hidden;
    margin-top: 0.75rem;
    padding-right: 6px; /* keeps text clear of the scrollbar */
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.portfolio-description-scroll p {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.portfolio-info-fixed-bottom {
    flex: 0 0 auto;
    padding-top: 0.75rem;
}

/* Below lg, columns stack and no longer share a stretched height,
   so give the description a sensible cap instead of 100% */
@media (max-width: 991.98px) {
    .portfolio-info-panel {
        height: auto;
    }

    .portfolio-description-scroll {
        max-height: 260px;
    }
}

/* Desktop: cap both columns to a shared height so the row can't grow
   with a long description — this is what makes height:100% meaningful */
@media (min-width: 992px) {
    .portfolio-gallery,
    .portfolio-info-panel {
        max-height: 520px;
        overflow: hidden; /* gallery itself shouldn't scroll, only its inner scroll areas do */
    }

    .portfolio-thumbnails {
        max-height: 130px;
        overflow-y: auto; /* safety net if a project has many thumbnail images */
    }
}
/***************************************************************************/


/* ===========================================
   Portfolio Image Lightbox
   =========================================== */

.portfolio-image-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.94);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    touch-action: none;
}

.portfolio-image-lightbox.active {
    display: flex;
}

.portfolio-lightbox-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

#portfolioLightboxImage {
    max-width: 92%;
    max-height: 88%;
    object-fit: contain;
    cursor: grab;
    transition: transform 0.15s ease-out;
    user-select: none;
    -webkit-user-drag: none;
    touch-action: none;
}

#portfolioLightboxImage.dragging {
    transition: none;
    cursor: grabbing;
}

.portfolio-lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: 2px solid rgba(242, 235, 82, 0.6);
    color: #f2eb52;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.portfolio-lightbox-close:hover {
    background: rgba(242, 235, 82, 0.2);
    box-shadow: 0 0 15px rgba(242, 235, 82, 0.5);
}

.portfolio-lightbox-hint {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.8rem;
    text-align: center;
    pointer-events: none;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .portfolio-lightbox-close {
        width: 40px;
        height: 40px;
        font-size: 24px;
        top: 12px;
        right: 12px;
    }
    .portfolio-lightbox-hint {
        font-size: 0.7rem;
        padding: 0 10px;
        white-space: normal;
    }
}

.portfolio-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: 2px solid rgba(242, 235, 82, 0.6);
    color: #f2eb52;
    font-size: 18px;
    cursor: pointer;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.portfolio-lightbox-nav:hover {
    background: rgba(242, 235, 82, 0.2);
    box-shadow: 0 0 15px rgba(242, 235, 82, 0.5);
}

.portfolio-lightbox-nav.hidden {
    display: none;
}

.portfolio-lightbox-prev { left: 20px; }
.portfolio-lightbox-next { right: 20px; }

.portfolio-lightbox-counter {
    position: absolute;
    top: 22px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    .portfolio-lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 15px;
    }
    .portfolio-lightbox-prev { left: 8px; }
    .portfolio-lightbox-next { right: 8px; }
}