/* ═══════════════════════════════════════════
   Artist Projects — Frontend Styles
   Clean, modern portfolio gallery
═══════════════════════════════════════════ */

.apf-wrap {
    --acc: #1a1a1a;
    --acc2: #e85d4a;
    --bdr: #e5e7eb;
    --surf: #f9f9f8;
    --mut: #6b7280;
    --r: 14px;
    font-family: -apple-system, 'Helvetica Neue', sans-serif;
    color: #1a1a1a;
    max-width: 1200px;
    margin: 0 auto;
}

/* ── Search ── */
.apf-search-bar {
    position: relative;
    max-width: 360px;
    margin-bottom: 28px;
}
.apf-search-bar input {
    width: 100%;
    padding: 10px 16px 10px 38px;
    border: 1.5px solid var(--bdr);
    border-radius: 100px;
    font-size: 14px;
    background: #fff;
    box-sizing: border-box;
    transition: border-color .2s;
}
.apf-search-bar input:focus { border-color: var(--acc2); outline: none; }
.apf-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--mut);
    display: flex;
    align-items: center;
}

/* ── Grid ── */
.apf-grid {
    display: grid;
    gap: 24px;
}
.apf-cols-2 { grid-template-columns: repeat(2, 1fr); }
.apf-cols-3 { grid-template-columns: repeat(3, 1fr); }
.apf-cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px)  { .apf-cols-3, .apf-cols-4 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 560px)  { .apf-cols-2, .apf-cols-3, .apf-cols-4 { grid-template-columns: 1fr; } }

.apf-empty { text-align: center; color: var(--mut); padding: 48px; font-size: 15px; }

/* ── Project Card ── */
.apf-project-card {
    background: #fff;
    border: 1px solid var(--bdr);
    border-radius: var(--r);
    overflow: hidden;
    transition: box-shadow .2s, transform .15s;
    display: flex;
    flex-direction: column;
}
.apf-project-card:hover { box-shadow: 0 6px 28px rgba(0,0,0,.10); transform: translateY(-2px); }
.apf-project-card.apf-hidden { display: none; }

/* ── Cover ── */
.apf-card-cover {
    position: relative;
    aspect-ratio: 16/9;
    background-size: cover;
    background-position: center;
    background-color: #1a1a1a;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}
.apf-card-cover--empty { background: linear-gradient(135deg, #1a1a2e, #2d2d44); }
.apf-card-cover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.75) 0%, rgba(0,0,0,.1) 55%, transparent 100%);
}
.apf-card-cover-info {
    position: relative;
    padding: 16px;
    color: #fff;
}
.apf-date {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(255,255,255,.7);
    display: block;
    margin-bottom: 4px;
}
.apf-project-name {
    font-size: clamp(15px, 2.5vw, 20px);
    font-weight: 700;
    margin: 0 0 6px;
    line-height: 1.2;
    letter-spacing: -.02em;
}
.apf-file-meta {
    display: flex;
    gap: 10px;
    font-size: 11px;
    color: rgba(255,255,255,.65);
}
.apf-file-meta span::before { content: '·'; margin-right: 4px; }
.apf-file-meta span:first-child::before { content: ''; margin-right: 0; }

/* ZIP download button */
.apf-zip-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: rgba(255,255,255,.95);
    color: #1a1a1a;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: background .15s, transform .1s;
    backdrop-filter: blur(6px);
}
.apf-zip-btn:hover { background: #fff; transform: scale(1.04); }

/* ── Description ── */
.apf-description {
    padding: 12px 16px;
    font-size: 13px;
    color: var(--mut);
    border-bottom: 1px solid var(--bdr);
    line-height: 1.5;
}

/* ── Files toggle ── */
.apf-files-toggle { padding: 0 16px; }
.apf-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 0;
    background: none;
    border: none;
    border-bottom: 1px solid var(--bdr);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    gap: 8px;
}
.apf-toggle-btn:hover { color: var(--acc2); }
.apf-chevron { transition: transform .25s; flex-shrink: 0; }
.apf-toggle-btn.open .apf-chevron { transform: rotate(180deg); }

/* ── Files panel ── */
.apf-files-panel { padding: 12px 14px 14px; }

.apf-type-pills { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
.apf-pill {
    padding: 4px 12px;
    border-radius: 100px;
    border: 1px solid var(--bdr);
    background: #fff;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    color: var(--mut);
    transition: all .15s;
}
.apf-pill:hover { border-color: var(--acc2); color: var(--acc2); }
.apf-pill--on { background: var(--acc2); border-color: var(--acc2); color: #fff; }

/* ── Thumbnails ── */
.apf-thumbs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 6px;
}
.apf-thumb {
    position: relative;
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
}
.apf-thumb.apf-hidden { display: none; }
.apf-thumb-img {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-color: #111;
    transition: transform .25s;
}
.apf-thumb:hover .apf-thumb-img { transform: scale(1.06); }
.apf-thumb-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,.8);
}

/* Download overlay on thumb */
.apf-thumb-dl {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.42);
    color: #fff;
    opacity: 0;
    transition: opacity .2s;
    text-decoration: none;
}
.apf-thumb:hover .apf-thumb-dl { opacity: 1; }

/* ── Dark mode ── */
@media (prefers-color-scheme: dark) {
    .apf-wrap { --bdr: #374151; color: #f3f4f6; }
    .apf-project-card { background: #111827; }
    .apf-search-bar input { background: #1f2937; color: #f3f4f6; border-color: #374151; }
    .apf-description { color: #9ca3af; }
    .apf-toggle-btn { color: #e5e7eb; border-color: #374151; }
    .apf-pill { background: #1f2937; color: #9ca3af; border-color: #374151; }
    .apf-pill--on { background: var(--acc2); color: #fff; }
    .apf-zip-btn { background: rgba(255,255,255,.9); }
}

/* ── Card cover as link ── */
a.apf-card-cover {
    display: block;
    text-decoration: none;
    cursor: pointer;
}
a.apf-card-cover:hover .apf-card-cover-overlay {
    background: linear-gradient(to top, rgba(0,0,0,.88) 0%, rgba(0,0,0,.2) 55%, rgba(0,0,0,.1) 100%);
}

/* ── View project button ── */
.apf-view-btn {
    position: absolute;
    bottom: 56px;
    left: 16px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,.95);
    color: #1a1a1a;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 100px;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .2s, transform .2s;
    pointer-events: none;
}
a.apf-card-cover:hover .apf-view-btn {
    opacity: 1;
    transform: translateY(0);
}
