/* ---------------------------------------------------------
   Hx Portfolio (heavy styling)
--------------------------------------------------------- */

.hx-portfolio-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 10px 0 10px;
}

.hx-portfolio-searchwrap {
    position: relative;
    width: 100%;
    max-width: 560px;
}

.hx-portfolio-searchwrap i {
    position: absolute;
    left: 12px;
    top: 50%;
    margin-top: -10px;
    font-size: 18px;
    opacity: 0.9;
}

.hx-portfolio-search {
    width: 100%;
    padding: 10px 14px 10px 42px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.22);
    color: #fff;
    outline: none;
}

.hx-portfolio-search::placeholder {
    color: rgba(255,255,255,0.70);
}

.hx-portfolio-meta {
    white-space: nowrap;
    opacity: 0.92;
    font-size: 13px;
}

.hx-portfolio-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0 18px;
}

.hx-chip {
    border: 1px solid rgba(255,255,255,0.22);
    background: rgba(255,255,255,0.05);
    color: #fff;
    padding: 7px 10px;
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
}

.hx-chip .hx-chip-count {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 7px;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(0,0,0,0.15);
    font-size: 11px;
}

.hx-chip.active {
    border-color: rgba(255,255,255,0.55);
    background: rgba(255,255,255,0.12);
}

.hx-chip.hx-chip-clear {
    border-color: rgba(255,255,255,0.45);
    background: rgba(0,0,0,0.22);
}

.hx-portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 22px;
}

/* Cards */
.hx-card {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.14);
    overflow: hidden;
    border-radius: 6px;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.hx-card:hover {
    transform: translateY(-6px);
    border-color: rgba(255,255,255,0.28);
    box-shadow: 0 18px 40px rgba(0,0,0,0.28);
}

.hx-card-thumb {
    display: block;
    position: relative;
    width: 100%;
    height: 210px;
    background-size: cover;
    background-position: center;
    background-color: rgba(0,0,0,0.25);
    text-decoration: none;
}

.hx-card-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.55), rgba(0,0,0,0.05));
}

.hx-card-view {
    position: absolute;
    left: 14px;
    bottom: 14px;
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    border: 1px solid rgba(255,255,255,0.22);
    background: rgba(0,0,0,0.22);
    padding: 6px 10px;
}

.hx-card-body {
    padding: 14px 14px 16px;
}

.hx-card-title {
    margin: 0 0 6px;
    font-size: 18px;
}

.hx-card-subtitle {
    font-size: 13px;
    opacity: 0.85;
    margin-bottom: 10px;
}

.hx-card-summary {
    font-size: 13px;
    opacity: 0.92;
    line-height: 20px;
    margin-bottom: 12px;
    min-height: 60px;
}

.hx-card-row {
    margin-bottom: 10px;
}

.hx-card-row-muted {
    opacity: 0.92;
}

.hx-card-actions {
    text-align: right;
}

.hx-link {
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #fff;
    opacity: 0.9;
}

.hx-link:hover {
    opacity: 1;
    text-decoration: underline;
}

.hx-pillwrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hx-pill {
    display: inline-block;
    padding: 5px 9px;
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 20px;
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.98;
}

.hx-pill-tag {
    background: rgba(255,255,255,0.05);
}

.hx-pill-stack {
    background: rgba(0,0,0,0.10);
}

.hx-pill-meta {
    background: rgba(0,0,0,0.18);
    margin-right: 8px;
    margin-bottom: 8px;
}

.hx-portfolio-empty {
    padding: 26px 0;
    text-align: center;
    opacity: 0.9;
}

/* Detail page */
.hx-backlink {
    display: inline-block;
    margin: 60px 0 18px;
    color: #fff;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 12px;
}

.hx-backlink:hover {
    opacity: 1;
    text-decoration: underline;
}

.hx-cs-summary {
    max-width: 920px;
    margin: 0 auto;
    opacity: 0.92;
    font-size: 14px;
    line-height: 22px;
}

.hx-cs-meta {
    margin: 0 auto 18px;
    text-align: center;
}

/* FIXED: was broken in your file */
.hx-cs-block {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 6px;
    padding: 14px;
    margin-bottom: 14px;
}

.hx-kv {
    margin-top: 10px;
}

.hx-kv-row {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}

.hx-kv-row:last-child {
    border-bottom: 0;
}

.hx-kv-key {
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.9;
}

.hx-kv-val {
    font-size: 13px;
    line-height: 20px;
    opacity: 0.95;
}

.hx-kv-muted {
    opacity: 0.75;
}

.hx-kv-card {
    margin: 10px 0;
    padding: 10px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(0,0,0,0.10);
    border-radius: 6px;
}

/* =========================================================
   Case Study Gallery: bulletproof sizing (detail page)
   Works for BOTH:
   1) <a class="hx-cs-img"><img ...></a>
   2) <a class="hx-cs-img"><span class="hx-cs-imgbox"><img ...></span></a>
========================================================= */

.hx-cs-gallery{
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

@media (max-width: 991px){
    .hx-cs-gallery{
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px){
    .hx-cs-gallery{
        grid-template-columns: 1fr;
    }
}

.hx-cs-img{
    display: block !important;
    text-decoration: none;
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(0,0,0,0.18);
    transition: transform .18s ease, opacity .18s ease, border-color .18s ease;
}

.hx-cs-img:hover{
    transform: translateY(-2px);
    opacity: .96;
    border-color: rgba(255,255,255,0.35);
}

/* Stable height, prevents scattered layout */
.hx-cs-img,
.hx-cs-imgbox{
    height: 220px;
}

@media (max-width: 520px){
    .hx-cs-img,
    .hx-cs-imgbox{
        height: 200px;
    }
}

/* If you use the wrapper box */
.hx-cs-imgbox{
    display: block;
    position: relative;
    width: 100%;
    overflow: hidden;
    background: rgba(0,0,0,0.18);
}

/* For both HTML structures */
.hx-cs-img > img,
.hx-cs-imgbox img{
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    object-fit: cover;
    object-position: center;
}

/* subtle overlay icon */
.hx-cs-img::after{
    content: "\f065"; /* fa-expand */
    font-family: FontAwesome;
    position: absolute;
    right: 10px;
    bottom: 10px;
    font-size: 14px;
    opacity: 0;
    transform: translateY(3px);
    transition: opacity .18s ease, transform .18s ease;
}

.hx-cs-img:hover::after{
    opacity: .85;
    transform: translateY(0);
}
