/* ============================================================
   Modify Portfolio Widget v3.0 — mpw.css
   ============================================================ */

/* ── Wrap ────────────────────────────────────────────────── */
.mpw-wrap { width: 100%; }

/* ── Filter dropdowns ────────────────────────────────────── */
.mpw-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 28px;
    align-items: center;
}

.mpw-filter-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    display: inline-block;
    font-size: 11px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    padding: 9px 36px 9px 16px;
    border: 1px solid #444;
    background-color: transparent;
    color: #888;
    cursor: pointer;
    line-height: 1.4;
    transition: color .25s, border-color .25s;
    border-radius: 0;
    outline: none;
    min-width: 170px;
    font-family: inherit;

    /* Custom arrow */
    --mpw-arrow-color: #888;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23888888' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 10px 6px;
}

/* Option styling (limited cross-browser) */
.mpw-filter-select option {
    background: #1a1a1a;
    color: #bbb;
    padding: 6px 12px;
}

.mpw-filter-select:hover {
    border-color: #666;
    color: #bbb;
}

.mpw-filter-select:focus {
    border-color: #C8B89A;
    color: #C8B89A;
}

/* Active state — a filter value is selected */
.mpw-filter-select.has-value {
    border-color: #C8B89A;
    color: #C8B89A;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23C8B89A' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* Firefox: remove native outline */
.mpw-filter-select:-moz-focusring {
    color: transparent;
    text-shadow: 0 0 0 currentColor;
}

/* IE / Edge: remove native arrow */
.mpw-filter-select::-ms-expand { display: none; }

/* ── Sticky filter bar ───────────────────────────────────── */
.mpw-sticky-sentinel {
    height: 0;
    margin: 0;
    padding: 0;
    visibility: hidden;
    pointer-events: none;
}

.mpw-filters.mpw-sticky {
    position: sticky;
    top: 0;
    z-index: 100;
    --mpw-sticky-bg: #0a0a0a;
    background-color: transparent;
    border-bottom: 0 solid transparent;
    transition: background-color .3s, box-shadow .3s, border-color .3s, padding .3s, backdrop-filter .3s;
}

.mpw-filters.mpw-sticky.is-stuck {
    background-color: var(--mpw-sticky-bg);
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding-top: 14px;
    padding-bottom: 14px;
    margin-bottom: 0;
}

/* ── Count (inside filter bar) ────────────────────────────── */
.mpw-count {
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #777;
    margin: 0;
    margin-left: auto;
    white-space: nowrap;
    line-height: 1.4;
    padding: 9px 0;
}

/* ── Grid ────────────────────────────────────────────────── */
.mpw-grid {
    display: grid;
    width: 100%;
    column-gap: 20px;
    row-gap: 20px;
}

/* Desktop columns */
.mpw-cols-1 { grid-template-columns: repeat(1, 1fr); }
.mpw-cols-2 { grid-template-columns: repeat(2, 1fr); }
.mpw-cols-3 { grid-template-columns: repeat(3, 1fr); }
.mpw-cols-4 { grid-template-columns: repeat(4, 1fr); }
.mpw-cols-5 { grid-template-columns: repeat(5, 1fr); }
.mpw-cols-6 { grid-template-columns: repeat(6, 1fr); }

/* Tablet */
@media (max-width: 1024px) {
    .mpw-cols-tablet-1 { grid-template-columns: repeat(1, 1fr); }
    .mpw-cols-tablet-2 { grid-template-columns: repeat(2, 1fr); }
    .mpw-cols-tablet-3 { grid-template-columns: repeat(3, 1fr); }
    .mpw-cols-tablet-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Mobile */
@media (max-width: 767px) {
    .mpw-cols-mobile-1 { grid-template-columns: repeat(1, 1fr); }
    .mpw-cols-mobile-2 { grid-template-columns: repeat(2, 1fr); }
    .mpw-cols-mobile-3 { grid-template-columns: repeat(3, 1fr); }
}

/* ── Card ────────────────────────────────────────────────── */
.mpw-card {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: transparent;
}

.mpw-card.mpw-hidden {
    display: none !important;
}

/* ── Image ───────────────────────────────────────────────── */
.mpw-img-wrap {
    position: relative;
    display: block;
    width: 100%;
    height: 0;
    overflow: hidden;
    text-decoration: none;
}

.mpw-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .5s ease;
}

.mpw-card:hover .mpw-img { transform: scale(1.04); }

.mpw-overlay {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity .3s;
    pointer-events: none;
}

.mpw-card:hover .mpw-overlay { opacity: 1; }

/* ── Card body ───────────────────────────────────────────── */
.mpw-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 14px 0 0;
}

.mpw-card-title {
    margin: 0 0 8px;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.35;
}

.mpw-card-title a {
    text-decoration: none;
    color: inherit;
    transition: color .2s;
}

.mpw-meta {
    font-size: 12px;
    color: #888;
    margin: 0 0 6px;
    line-height: 1.4;
}

.mpw-meta a {
    color: inherit;
    text-decoration: none;
}

.mpw-meta-cats {
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 10px;
    margin-bottom: 6px;
}

.mpw-excerpt {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #888;
    margin: 0 0 12px;
    flex: 1;
}

.mpw-read-more {
    font-size: 12px;
    text-decoration: none;
    color: inherit;
    margin-top: auto;
    display: inline-block;
}

.mpw-read-more:hover { text-decoration: underline; }

/* ── Skin: Cards ─────────────────────────────────────────── */
.mpw-skin-cards .mpw-card {
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.mpw-skin-cards .mpw-card-body {
    padding: 16px;
}

/* ── Skin: Overlay ───────────────────────────────────────── */
.mpw-skin-overlay .mpw-card { overflow: hidden; }
.mpw-skin-overlay .mpw-img-wrap { padding-bottom: 100%; height: 0; }
.mpw-skin-overlay .mpw-overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0) 60%);
    opacity: 1;
}
.mpw-skin-overlay .mpw-overlay-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 16px 16px;
    transform: translateY(8px);
    transition: transform .3s;
    pointer-events: none;
}
.mpw-skin-overlay .mpw-card:hover .mpw-overlay-caption { transform: translateY(0); }
.mpw-skin-overlay .mpw-card-title { margin: 0; }
.mpw-skin-overlay .mpw-card-title a { color: #fff; }
.mpw-skin-overlay .mpw-meta { color: rgba(255,255,255,0.7); margin-bottom: 4px; }

/* ── Pagination ──────────────────────────────────────────── */
.mpw-pagination {
    margin-top: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mpw-pagination a,
.mpw-pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border: 1px solid currentColor;
    text-decoration: none;
    font-size: 13px;
    transition: opacity .2s;
}

.mpw-pagination .current { opacity: 0.4; cursor: default; }

.mpw-load-more-wrap {
    margin-top: 2rem;
    text-align: center;
}

.mpw-load-more {
    display: inline-block;
    padding: 10px 32px;
    border: 1px solid currentColor;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: opacity .2s;
}

.mpw-load-more:hover { opacity: 0.7; }

/* ── Filter animations (Web Animations API — controlled via JS) ── */
.mpw-wrap[data-animation="fade"]  .mpw-card,
.mpw-wrap[data-animation="slide"] .mpw-card,
.mpw-wrap[data-animation="zoom"]  .mpw-card {
    opacity: 0;
    will-change: opacity, transform;
}

.mpw-wrap[data-animation="none"] .mpw-card { opacity: 1; }

/* ── Misc ────────────────────────────────────────────────── */
.mpw-no-posts {
    color: #888;
    font-size: 13px;
    padding: 2rem 0;
}

/* ============================================================
   Skin: Full bleed
   ============================================================ */
.mpw-skin-fullbleed {
    --mpw-fb-min-h: 62vh;
    --mpw-fb-accent: #B89A6A;
    --mpw-fb-soft: #8B8A82;
}

.mpw-skin-fullbleed .mpw-grid {
    display: block;
    column-gap: 0;
    row-gap: 0;
}

.mpw-fb-project {
    display: flex;
    min-height: var(--mpw-fb-min-h);
    border-bottom: 1px solid var(--mpw-fb-soft);
}

.mpw-fb-project.mpw-fb-reverse { flex-direction: row-reverse; }

.mpw-fb-image {
    flex: 1.3;
    position: relative;
    display: block;
    overflow: hidden;
    background: rgba(139, 138, 130, 0.08);
}

.mpw-fb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .5s ease;
}

.mpw-fb-project:hover .mpw-fb-img { transform: scale(1.03); }

.mpw-fb-reg {
    position: absolute;
    width: 12px;
    height: 12px;
    color: var(--mpw-fb-soft);
    opacity: .45;
    pointer-events: none;
    transition: opacity .25s ease, color .25s ease;
}
.mpw-fb-reg::before, .mpw-fb-reg::after { content: ''; position: absolute; background: currentColor; }
.mpw-fb-reg::before { top: 50%; left: 0; width: 100%; height: 1px; transform: translateY(-50%); }
.mpw-fb-reg::after  { left: 50%; top: 0; width: 1px; height: 100%; transform: translateX(-50%); }
.mpw-fb-reg.tl { top: 20px; left: 20px; } .mpw-fb-reg.tr { top: 20px; right: 20px; }
.mpw-fb-reg.bl { bottom: 20px; left: 20px; } .mpw-fb-reg.br { bottom: 20px; right: 20px; }
.mpw-fb-project:hover .mpw-fb-reg { opacity: 1; color: var(--mpw-fb-accent); }

.mpw-fb-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 56px 64px;
    gap: 10px;
}

.mpw-fb-index {
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--mpw-fb-soft);
    margin: 0;
}

.mpw-fb-coord {
    font-size: 11px;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--mpw-fb-soft);
    margin: 0 0 6px;
}

.mpw-fb-title {
    position: relative;
    display: inline-block;
    font-weight: 500;
    font-size: 30px;
    margin: 0 0 18px;
}

.mpw-fb-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -8px;
    height: 2px;
    width: 0;
    background: var(--mpw-fb-accent);
    transition: width .35s ease;
}

.mpw-fb-project:hover .mpw-fb-title::after { width: 100%; }

.mpw-fb-excerpt {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--mpw-fb-soft);
    margin: 0 0 6px;
}

.mpw-fb-cta {
    font-size: 12px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--mpw-fb-accent);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    text-decoration: none;
}

.mpw-fb-cta svg { width: 13px; height: 13px; transition: transform .25s ease; }
.mpw-fb-project:hover .mpw-fb-cta svg { transform: translateX(4px); }

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 780px) {
    .mpw-fb-project { flex-direction: column; min-height: auto; }
    .mpw-fb-image { min-height: 280px; }
    .mpw-fb-text { padding: 32px 28px 40px; }
    .mpw-fb-title { font-size: 24px; }
}

@media (max-width: 767px) {
    .mpw-filters { flex-direction: column; }
    .mpw-filter-select { width: 100%; min-width: 0; }
    .mpw-count { margin-left: 0; padding: 4px 0 0; }
}

@media (prefers-reduced-motion: reduce) {
    .mpw-fb-reg, .mpw-fb-title::after, .mpw-fb-cta svg { transition: none; }
}
