/* ============================================================
   PORTFOLIO — Página pública de proyectos
   Usa variables CSS globales (themes.css) para adaptarse a
   todos los temas: dark, light, solarized, dracula, nord.
   ============================================================ */

/* ── Layout raíz ────────────────────────────────────────── */
.pf-layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 6.5rem 2rem 5rem;
}

/* ── Hero ───────────────────────────────────────────────── */
.pf-hero {
    margin-bottom: 3rem;
}

.pf-hero-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
    flex-wrap: wrap;
}

.pf-hero-text {
    flex: 1;
    min-width: 260px;
}

/* Eyebrow */
.pf-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 0.63rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.65rem;
}

.pf-eyebrow-line {
    display: inline-block;
    width: 22px;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
    flex-shrink: 0;
}

/* Título principal */
.pf-hero-title {
    font-size: 2.8rem;
    font-weight: 800;
    margin: 0 0 0.9rem;
    line-height: 1.05;
    color: var(--text);
    letter-spacing: -0.02em;
}

/* Texto introductorio */
.pf-hero-intro {
    font-size: 0.93rem;
    color: var(--text-muted);
    line-height: 1.7;
    max-width: 560px;
    margin: 0 0 1.25rem;
}

/* Chips de meta */
.pf-hero-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.pf-count-chip,
.pf-author-chip {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.3rem 0.8rem;
    border-radius: 100px;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    color: var(--text-muted);
    white-space: nowrap;
}

.pf-count-chip {
    color: var(--accent);
    border-color: rgba(37, 99, 235, 0.3);
    background: rgba(37, 99, 235, 0.07);
}

/* Avatar de portafolio */
.pf-hero-avatar {
    flex-shrink: 0;
}

.pf-avatar-img {
    width: 240px;
    height: 240px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--card-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

/* ── Divisor ────────────────────────────────────────────── */
.pf-divider {
    height: 1px;
    background: var(--card-border);
    margin-bottom: 2.5rem;
}

/* ── Sección grid ───────────────────────────────────────── */
.pf-section { /* contenedor de la cuadrícula */ }

/* ── Grid ───────────────────────────────────────────────── */
.pf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* ── Tarjeta ────────────────────────────────────────────── */
.pf-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
    animation: pfCardIn 0.45s ease-out backwards;
}

.pf-card:nth-child(1) { animation-delay: 0.04s; }
.pf-card:nth-child(2) { animation-delay: 0.09s; }
.pf-card:nth-child(3) { animation-delay: 0.14s; }
.pf-card:nth-child(4) { animation-delay: 0.19s; }
.pf-card:nth-child(5) { animation-delay: 0.24s; }
.pf-card:nth-child(6) { animation-delay: 0.29s; }

@keyframes pfCardIn {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

.pf-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.15);
    border-color: rgba(37, 99, 235, 0.4);
}

/* ── Portada de tarjeta ─────────────────────────────────── */
.pf-card-cover {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.pf-card-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

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

.pf-card-cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--card-border);
}

/* Degradado inferior sobre la imagen */
.pf-card-cover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.45) 0%, transparent 55%);
    pointer-events: none;
}

/* Número de proyecto */
.pf-card-num {
    position: absolute;
    top: 0.7rem;
    left: 0.75rem;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: rgba(255,255,255,0.75);
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(6px);
    padding: 0.2rem 0.55rem;
    border-radius: 100px;
    border: 1px solid rgba(255,255,255,0.1);
}

/* ── Cuerpo de tarjeta ──────────────────────────────────── */
.pf-card-body {
    padding: 1.1rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    flex: 1;
}

.pf-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.pf-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    line-height: 1.3;
}

.pf-card-date {
    font-size: 0.64rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.pf-card-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Botones de tarjeta ─────────────────────────────────── */
.pf-card-actions {
    display: flex;
    gap: 0.45rem;
    flex-wrap: wrap;
    padding-top: 0.55rem;
    border-top: 1px solid var(--card-border);
    margin-top: auto;
}

.pf-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    padding: 0.38rem 0.85rem;
    border-radius: 100px;
    font-size: 0.74rem;
    font-weight: 600;
    font-family: 'JetBrains Mono', monospace;
    text-decoration: none;
    transition: all 0.18s ease;
    border: 1px solid transparent;
    cursor: pointer;
}

.pf-btn-primary {
    background: rgba(37, 99, 235, 0.1);
    color: var(--accent);
    border-color: rgba(37, 99, 235, 0.3);
}

.pf-btn-primary:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 3px 12px rgba(37, 99, 235, 0.3);
}

.pf-btn-ghost {
    background: var(--bg-secondary);
    color: var(--text-muted);
    border-color: var(--card-border);
}

.pf-btn-ghost:hover {
    background: var(--card-border);
    color: var(--text);
}

/* ── Estado vacío ───────────────────────────────────────── */
.pf-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
    padding: 5rem 2rem;
    text-align: center;
}

.pf-empty-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.pf-empty p {
    color: var(--text-muted);
    font-size: 0.88rem;
    margin: 0;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 960px) {
    .pf-layout        { padding: 5rem 1.25rem 3.5rem; }
    .pf-hero-title    { font-size: 2.1rem; }
    .pf-grid          { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
    .pf-hero-avatar   { display: none; }
}

@media (max-width: 580px) {
    .pf-grid          { grid-template-columns: 1fr; }
    .pf-hero-intro    { font-size: 0.87rem; }
}
