/* Portfolio — portfolio.css */

/* Card Grid (List / Flex layout) */
.pf-grid {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
}

/* Portfolio Card (Horizontal Layout) */
.pf-grid .pf-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 1rem;
    overflow: hidden;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s;
    display: flex !important;
    flex-direction: column !important;
    text-decoration: none;
    color: inherit;
}
@media (min-width: 48rem) {
    .pf-grid .pf-card {
        flex-direction: row !important;
        align-items: stretch;
    }
}
.pf-grid .pf-card:hover {
    transform: translateY(-4px);
    border-color: var(--text-60, var(--text));
    box-shadow: 0 16px 32px -10px rgba(0, 0, 0, 0.08);
}
html.dark .pf-grid .pf-card:hover {
    box-shadow: 0 16px 32px -10px rgba(0, 0, 0, 0.4);
}

/* Left Thumbnail - Strict 1:1 Aspect Ratio Box */
.pf-grid .pf-card-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1 !important;
    overflow: hidden;
    background: var(--bg-surface);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border);
}
@media (min-width: 48rem) {
    .pf-grid .pf-card-thumb {
        width: 260px !important;
        height: 260px !important;
        aspect-ratio: 1 / 1 !important;
        border-bottom: none;
        border-right: 1px solid var(--border);
    }
}
@media (min-width: 64rem) {
    .pf-grid .pf-card-thumb {
        width: 290px !important;
        height: 290px !important;
    }
}

.pf-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.pf-card:hover .pf-card-thumb img {
    transform: scale(1.04);
}

.pf-thumb-fallback {
    display: none;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 1.5rem;
    background: var(--bg-surface);
}

/* Right Side Body Content */
.pf-card-body {
    padding: 1.5rem 1.75rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: center;
}

.pf-card-header {
    margin-bottom: 0.5rem;
}

/* Category Badge */
.pf-badge {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 0.25rem 0.65rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border);
    color: var(--text-60);
    background: var(--bg-surface);
}

/* Title */
.pf-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text);
    margin-bottom: 1rem;
}
@media (min-width: 48rem) {
    .pf-card-title {
        font-size: 1.35rem;
    }
}

/* Metadata Rows (Client, Period, Tech Stack, URL) */
.pf-card-info {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.pf-info-row {
    display: flex;
    align-items: baseline;
    font-size: 0.875rem;
    line-height: 1.5;
}

.pf-info-label {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--text-40, var(--text));
    width: 95px;
    flex-shrink: 0;
}

.pf-info-val {
    color: var(--text-60, var(--text));
    word-break: break-word;
}

.pf-info-val.pf-link {
    color: var(--text);
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 500;
}

/* ================================================================= */
/* Portfolio Detail Page Top Header Box (1:1 Left Thumbnail, Right Info) */
/* ================================================================= */

.pf-detail-header {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 1.25rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
@media (min-width: 48rem) {
    .pf-detail-header {
        flex-direction: row;
        align-items: stretch;
    }
}

/* 1:1 Left Thumbnail Box in Detail Header - 50% Width */
.pf-detail-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--bg-surface);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}
@media (min-width: 48rem) {
    .pf-detail-thumb {
        width: 45% !important;
        height: auto !important;
        aspect-ratio: 1 / 1 !important;
        border-bottom: none;
        border-right: 1px solid var(--border);
    }
}
@media (min-width: 64rem) {
    .pf-detail-thumb {
        width: 50% !important;
        height: auto !important;
        aspect-ratio: 1 / 1 !important;
    }
}

.pf-detail-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain !important;
    object-position: center;
    padding: 0.75rem;
    transition: transform 0.4s ease;
}
.pf-detail-thumb:hover img {
    transform: scale(1.03);
}

/* Right Information in Detail Header */
.pf-detail-info {
    padding: 2rem 2.25rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: center;
}

.pf-detail-title {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.35;
    color: var(--text);
    margin-bottom: 1.25rem;
}
@media (min-width: 64rem) {
    .pf-detail-title {
        font-size: 1.85rem;
    }
}

/* Modern Meta Cards List (1-Column Single Line List) */
.pf-meta-grid-modern {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.pf-meta-box {
    padding: 0.75rem 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 0.65rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.pf-meta-box-label {
    font-family: var(--font-mono);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-40);
    width: 90px;
    flex-shrink: 0;
    margin-bottom: 0;
}

.pf-meta-box-val {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text);
    word-break: break-word;
    line-height: 1.4;
    flex: 1;
}

.pf-meta-box-val .pf-link {
    color: var(--text);
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 600;
}

/* Filter Bar */
.pf-filter {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.pf-filter::-webkit-scrollbar { display: none; }
.pf-filter-btn {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-60);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.pf-filter-btn:hover {
    border-color: var(--text);
    color: var(--text);
}
.pf-filter-btn.active {
    background: var(--btn-bg);
    color: var(--btn-text);
    border-color: var(--btn-bg);
}

/* Gallery */
.pf-gallery {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}
@media (min-width: 48rem) {
    .pf-gallery { grid-template-columns: repeat(2, 1fr); }
}
.pf-gallery img {
    width: 100%;
    border-radius: 0.75rem;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: transform 0.2s;
}
.pf-gallery img:hover {
    transform: scale(1.02);
}

/* Lightbox */
.pf-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.pf-lightbox.active {
    opacity: 1;
    pointer-events: auto;
}
.pf-lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 0.5rem;
}
.pf-lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    transition: background 0.2s;
    line-height: 1;
}
.pf-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Prev/Next Nav */
.pf-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}
.pf-nav-item {
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    transition: border-color 0.2s, background 0.2s;
    text-decoration: none;
    color: var(--text);
}
.pf-nav-item:hover {
    border-color: var(--text);
    background: var(--bg-surface);
}
.pf-nav-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--text-40);
    margin-bottom: 0.25rem;
}
.pf-nav-title {
    font-weight: 600;
    font-size: 0.9rem;
}
.pf-nav-next {
    text-align: right;
}

/* Empty State */
.pf-empty {
    grid-column: 1 / -1;
    padding: 5rem 2rem;
    text-align: center;
    border: 1px dashed var(--border);
    border-radius: 1rem;
    color: var(--text-40);
}
