/* ==========================================================================
   Portfolio (portfolio.php, portfolio-single.php, homepage "Featured work")
   ========================================================================== */

.pf-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 0 0 12px;
    padding: 0;
    list-style: none;
}
.pf-filters + .pf-filters { margin-bottom: 36px; }
.pf-filter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 999px;
    border: 1px solid rgba(var(--bg-dark-1-rgb, 18, 19, 44), .15);
    color: inherit;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: background-color .2s, border-color .2s, color .2s;
}
.pf-filter:hover { border-color: var(--primary-color); color: var(--primary-color); }
.pf-filter[aria-current="page"] {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}
.pf-filter .pf-count { opacity: .7; font-weight: 500; }
.pf-filter-label {
    width: 100%;
    text-align: center;
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    opacity: .6;
    margin-bottom: 2px;
}

.pf-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
}
@media (max-width: 991px) { .pf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575px) { .pf-grid { grid-template-columns: 1fr; gap: 22px; } }

.pf-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid rgba(var(--bg-dark-1-rgb, 18, 19, 44), .08);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 6px 24px rgba(var(--bg-dark-1-rgb, 18, 19, 44), .06);
    transition: transform .25s ease, box-shadow .25s ease;
    height: 100%;
}
.pf-card:hover { transform: translateY(-4px); box-shadow: 0 14px 36px rgba(var(--bg-dark-1-rgb, 18, 19, 44), .12); }
@media (prefers-reduced-motion: reduce) { .pf-card, .pf-card:hover { transition: none; transform: none; } }

.pf-card-media {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    background: linear-gradient(135deg, var(--bg-dark-1), var(--bg-dark-3));
    overflow: hidden;
}
.pf-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
    transition: transform .5s ease;
}
.pf-card:hover .pf-card-media img { transform: scale(1.04); }
.pf-card-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: rgba(255, 255, 255, .18);
}
.pf-type {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .02em;
    color: #fff;
    background: rgba(var(--bg-dark-1-rgb, 18, 19, 44), .78);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}
.pf-type-demo { background: rgba(var(--primary-color-rgb, 74, 129, 211), .92); }

.pf-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 22px 22px 24px;
}
.pf-card-meta {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0 0 6px;
}
.pf-card-title { font-size: 20px; line-height: 1.3; margin: 0 0 10px; }
.pf-card-title a { color: inherit; text-decoration: none; }
.pf-card-title a:hover { color: var(--primary-color); }
.pf-card-summary {
    margin: 0 0 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pf-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 18px;
    padding: 0;
    list-style: none;
}
.pf-tags li {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(var(--primary-color-rgb, 74, 129, 211), .1);
    color: var(--bg-dark-3, #222e66);
}
.pf-tags .pf-tag-more { background: rgba(var(--bg-dark-1-rgb, 18, 19, 44), .06); }

.pf-card-actions {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.pf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 18px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background-color .2s, color .2s, border-color .2s;
}
.pf-btn-primary { background: var(--primary-color); color: #fff; }
.pf-btn-primary:hover { background: var(--secondary-color); color: #fff; }
.pf-btn-ghost { border-color: rgba(var(--bg-dark-1-rgb, 18, 19, 44), .18); color: inherit; }
.pf-btn-ghost:hover { border-color: var(--primary-color); color: var(--primary-color); }
.pf-btn i { font-size: 12px; }
.pf-btn:focus-visible, .pf-filter:focus-visible, .pf-card-title a:focus-visible, .pf-gallery a:focus-visible, .pf-pager a:focus-visible {
    outline: 3px solid var(--primary-color);
    outline-offset: 3px;
}

.pf-empty {
    text-align: center;
    padding: 70px 20px;
    border: 1px dashed rgba(var(--bg-dark-1-rgb, 18, 19, 44), .18);
    border-radius: 16px;
}
.pf-empty i { font-size: 42px; color: var(--primary-color); opacity: .6; margin-bottom: 16px; }

/* Dark section variant (homepage "Featured work") */
.section-dark .pf-card { background: var(--bg-dark-2); border-color: rgba(255, 255, 255, .08); box-shadow: none; }
.section-dark .pf-card-summary { color: rgba(255, 255, 255, .75); }
.section-dark .pf-tags li { background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .85); }
.section-dark .pf-btn-ghost { border-color: rgba(255, 255, 255, .25); color: #fff; }

/* ------------------------------ Detail page ------------------------------ */

.pf-preview-banner {
    background: #fef3c7;
    color: #78350f;
    text-align: center;
    padding: 10px 16px;
    font-weight: 600;
    font-size: 14px;
}

.pf-intro .lead { font-size: 20px; line-height: 1.6; }
.pf-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

.pf-facts {
    background: rgba(var(--primary-color-rgb, 74, 129, 211), .06);
    border: 1px solid rgba(var(--primary-color-rgb, 74, 129, 211), .15);
    border-radius: 14px;
    padding: 26px;
}
.pf-facts h2 { font-size: 18px; margin: 0 0 16px; }
.pf-facts dl { margin: 0; }
.pf-facts dt {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .08em;
    opacity: .6;
    font-weight: 700;
    margin-top: 14px;
}
.pf-facts dt:first-child { margin-top: 0; }
.pf-facts dd { margin: 4px 0 0; font-weight: 600; }
.pf-facts dd a { color: var(--primary-color); text-decoration: none; }
.pf-facts dd a:hover { text-decoration: underline; }
.pf-facts .pf-tags { margin: 6px 0 0; }

.pf-cover {
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, var(--bg-dark-1), var(--bg-dark-3));
}
.pf-cover img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }

.pf-section-title { margin-bottom: 18px; }
.pf-prose p { margin-bottom: 1em; }

.pf-box {
    border-radius: 14px;
    padding: 32px;
    height: 100%;
}
.pf-box h3 { margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }
.pf-box ul { margin: 0; padding: 0; list-style: none; }
.pf-box li { position: relative; padding-left: 30px; margin-bottom: 12px; line-height: 1.6; }
.pf-box li:last-child { margin-bottom: 0; }
.pf-box li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 6px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
}
.pf-box-challenge { background: var(--bg-dark-2); color: rgba(255, 255, 255, .88); }
.pf-box-challenge h3 { color: #fff; }
.pf-box-challenge li::before { border: 2px solid #f59e0b; }
.pf-box-solution { background: var(--primary-color); color: rgba(255, 255, 255, .95); }
.pf-box-solution h3 { color: #fff; }
.pf-box-solution li::before { background: rgba(255, 255, 255, .9); box-shadow: inset 0 0 0 5px var(--primary-color); }

.pf-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 18px;
}
.pf-result {
    border-radius: 14px;
    padding: 26px 22px;
    border: 1px solid rgba(var(--bg-dark-1-rgb, 18, 19, 44), .1);
    text-align: center;
}
.pf-result strong {
    display: block;
    font-size: clamp(30px, 4vw, 42px);
    line-height: 1.1;
    color: var(--primary-color);
    margin-bottom: 6px;
}
.pf-result span { font-weight: 600; }

.pf-gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin: 0;
    padding: 0;
    list-style: none;
}
@media (max-width: 991px) { .pf-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575px) { .pf-gallery { grid-template-columns: 1fr; } }
.pf-gallery figure { margin: 0; }
.pf-gallery a {
    display: block;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: #e9edf5;
}
.pf-gallery img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; transition: transform .4s ease; }
.pf-gallery a:hover img { transform: scale(1.04); }
.pf-gallery a::after {
    content: "\f00e";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(var(--bg-dark-1-rgb, 18, 19, 44), .75);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    opacity: 0;
    transition: opacity .2s;
}
.pf-gallery a:hover::after, .pf-gallery a:focus-visible::after { opacity: 1; }
.pf-gallery figcaption { font-size: 14px; margin-top: 8px; opacity: .75; }

.pf-quote {
    border-radius: 16px;
    padding: 40px;
    background: var(--bg-dark-1);
    color: rgba(255, 255, 255, .9);
    position: relative;
}
.pf-quote blockquote { margin: 0; font-size: 20px; line-height: 1.6; }
.pf-quote .pf-stars { color: #fbbf24; margin-bottom: 14px; }
.pf-quote figcaption { margin-top: 18px; color: #fff; font-weight: 700; }
.pf-quote figcaption span { display: block; font-weight: 500; opacity: .7; font-size: 14px; }

.pf-pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    border-top: 1px solid rgba(var(--bg-dark-1-rgb, 18, 19, 44), .1);
    padding-top: 30px;
}
.pf-pager a {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 18px 20px;
    border-radius: 12px;
    border: 1px solid rgba(var(--bg-dark-1-rgb, 18, 19, 44), .1);
    transition: border-color .2s;
}
.pf-pager a:hover { border-color: var(--primary-color); }
.pf-pager small { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; opacity: .6; margin-bottom: 4px; }
.pf-pager strong { font-size: 16px; }
.pf-pager .pf-next { text-align: right; grid-column: 2; }
.pf-pager .pf-pager-label-short { display: none; }
@media (max-width: 575px) {
    .pf-pager { gap: 10px; }
    .pf-pager a { min-width: 0; padding: 12px 14px; }
    .pf-pager small { font-size: 11px; letter-spacing: .05em; }
    .pf-pager .pf-pager-label { display: none; }
    .pf-pager .pf-pager-label-short { display: inline; }
    .pf-pager strong {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
        overflow-wrap: anywhere;
        font-size: 14px;
        line-height: 1.35;
    }
}

.pf-cta {
    border-radius: 18px;
    padding: 48px;
    background: linear-gradient(var(--primary-gradient));
    color: #fff;
}
.pf-cta h2 { color: #fff; margin-bottom: 10px; }
.pf-cta .pf-btn-light { background: #fff; color: var(--bg-dark-1); }
.pf-cta .pf-btn-light:hover { background: rgba(255, 255, 255, .88); color: var(--bg-dark-1); }
.pf-cta .pf-btn-outline { border-color: rgba(255, 255, 255, .6); color: #fff; }
.pf-cta .pf-btn-outline:hover { border-color: #fff; color: #fff; background: rgba(255, 255, 255, .1); }
.pf-cta .pf-cta-actions { margin-top: 0; }
@media (min-width: 992px) { .pf-cta .pf-cta-actions { justify-content: flex-end; } }
@media (max-width: 575px) { .pf-cta { padding: 32px 22px; } }
