/* =========================================================
   PERFRIG — UNIFIED ARTICLE CARD
   Single source of truth for all article card displays.

   The image slot uses aspect-ratio: 16/9.
   Editorial policy: always upload 16:9 images.
   Result: full image always visible — nothing cropped.
========================================================= */

/* ---------------------------------------------------------
   CARD WRAPPER
--------------------------------------------------------- */
.pf-card {
    position: relative;
    background: linear-gradient(145deg, #1C1F26, #14161B);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    overflow: hidden;
    transition:
        transform      0.35s ease,
        border-color   0.35s ease,
        box-shadow     0.35s ease;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    /* Ensure card stretches to grid cell height */
    display: flex;
    flex-direction: column;
}

/* Top glow line — appears on hover */
.pf-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, #06D7F6, #00FF9C);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
    pointer-events: none;
}

.pf-card:hover {
    transform: translateY(-6px) scale(1.01);
    border-color: rgba(6, 215, 246, 0.3);
    box-shadow:
        0 20px 50px rgba(0, 0, 0, 0.55),
        0 0 25px rgba(6, 215, 246, 0.15);
}

.pf-card:hover::before {
    opacity: 1;
}

/* ---------------------------------------------------------
   LINK — covers the full card
--------------------------------------------------------- */
.pf-card-link {
    display: flex;
    flex-direction: column;
    flex: 1;
    color: inherit;
    text-decoration: none;
}

/* ---------------------------------------------------------
   IMAGE SLOT
   aspect-ratio: 16/9 — matches uploaded image format.
   object-fit: fill — old images (non-16:9) stretch to fill
   the slot fully. New uploads are always 16:9 so no stretch.
--------------------------------------------------------- */
.pf-card-image-wrap {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #0d1117;
    flex-shrink: 0;
}

.pf-card-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: fill;
    display: block;
    transition: transform 0.5s ease, filter 0.5s ease;
    filter: brightness(0.92);
}

.pf-card:hover .pf-card-image-wrap img {
    transform: scale(1.04);
    filter: brightness(1);
}

/* Placeholder when post has no thumbnail */
.pf-card-no-image {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0d1117, #1C1F26);
}

/* ---------------------------------------------------------
   CATEGORY BADGE — overlaid on image (top-left)
--------------------------------------------------------- */
.pf-card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #06D7F6;
    background: rgba(6, 215, 246, 0.12);
    border: 1px solid rgba(6, 215, 246, 0.3);
    border-radius: 20px;
    padding: 3px 10px;
    backdrop-filter: blur(4px);
    line-height: 1.6;
    white-space: nowrap;
}

/* ---------------------------------------------------------
   BODY — text content below the image
--------------------------------------------------------- */
.pf-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
}

/* ---------------------------------------------------------
   META — author and/or date
--------------------------------------------------------- */
.pf-card-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 12px;
    font-size: 12px;
}

.pf-card-meta::after {
    /* visually separates author from date when both present */
    content: '';
}

.pf-card-author {
    color: #9CA3AF;
    font-weight: 500;
}

.pf-card-date {
    color: #6B7280;
}

/* ---------------------------------------------------------
   TITLE
--------------------------------------------------------- */
.pf-card-title {
    font-family: 'Exo 2', sans-serif;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    color: #E5E7EB;
    margin: 0;
    transition: color 0.25s ease;

    /* Max 3 lines */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pf-card:hover .pf-card-title {
    color: #06D7F6;
}

/* ---------------------------------------------------------
   EXCERPT
--------------------------------------------------------- */
.pf-card-excerpt {
    font-size: 13px;
    color: #9CA3AF;
    line-height: 1.55;
    margin: 0;

    /* Max 2 lines */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------------------------------------------------------
   FOOTER — reading time + "Read More"
   Only rendered when show_reading_time is true.
--------------------------------------------------------- */
.pf-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.pf-card-readtime {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #6B7280;
}

.pf-card-readtime svg {
    flex-shrink: 0;
    color: #06D7F6;
}

.pf-card-readmore {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    color: #06D7F6;
    transition: gap 0.2s ease, color 0.2s ease;
}

.pf-card:hover .pf-card-readmore {
    gap: 8px;
    color: #00FF9C;
}


/* =========================================================
   GRID LAYOUTS
   Each grid class controls column count only.
   Card styles above are shared across all grids.
========================================================= */

/* Home — Latest Articles (3 col) */
.pf-grid-home {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* Category / Tag / Search (3 col) */
.pf-grid-archive {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

/* Home — Tab panes / Gaming (4 col, compact) */
.pf-grid-tabs {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* Article — Related posts (2 col) */
.pf-grid-related {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 1200px) {
    .pf-grid-home,
    .pf-grid-archive    { grid-template-columns: repeat(2, 1fr); }
    .pf-grid-tabs       { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
    .pf-grid-tabs       { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .pf-grid-home,
    .pf-grid-archive    { grid-template-columns: 1fr; }
    .pf-grid-related    { grid-template-columns: 1fr; }

    .pf-card-title      { font-size: 15px; }
}

@media (max-width: 480px) {
    .pf-grid-tabs       { grid-template-columns: 1fr; }
}
