/*
 * CSS do template de categoria (category.php). Extraído de lá (onde vivia
 * inline) para cá. Enfileirado condicionalmente (is_category()) em
 * functions.php (temanovo_scripts).
 */

/* ===== VARIÁVEIS ===== */
:root {
    --card-radius: 16px;
    --card-shadow: 0 8px 30px rgba(0,0,0,.08);
    --card-shadow-hover: 0 16px 48px rgba(0,0,0,.15);
    --transition-smooth: all .3s cubic-bezier(0.4, 0, 0.2, 1);
    --primary-gradient: linear-gradient(135deg, var(--tn-color-primary), var(--tn-color-secondary));
}

/* ===== HEADER ===== */
.category-header {
    max-width: 1200px;
    margin: 0 auto 40px;
    padding: 36px 20px 24px;
    border-bottom: 1px solid rgba(0,0,0,.08);
}

.category-header h1 {
    display: inline-block;
    font-size: 32px;
    font-weight: 800;
    color: var(--tn-color-text);
    margin: 0;
    padding-bottom: 14px;
    letter-spacing: -0.02em;
    position: relative;
}

.category-header h1::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 48px;
    height: 4px;
    border-radius: 2px;
    background: var(--primary-gradient);
}

/* Brilho em degradê passando pelo título, igual ao do post/página —
   marca visualmente que é o título principal. Em @supports pra cair
   no texto sólido normal em navegadores sem background-clip: text. */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
    .category-header h1 {
        background-image: linear-gradient(
            100deg,
            var(--tn-color-text) 35%,
            var(--tn-color-primary) 48%,
            var(--tn-color-secondary) 52%,
            var(--tn-color-text) 65%
        );
        background-size: 260% 100%;
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        color: transparent;
        animation: tnTitleShine 4s ease-in-out infinite alternate;
    }
}

@keyframes tnTitleShine {
    0% {
        background-position: 180% 0;
    }
    100% {
        background-position: -80% 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .category-header h1 {
        animation: none;
    }
}

.category-description {
    font-size: 15px;
    line-height: 1.6;
    color: var(--tn-color-muted);
    max-width: 640px;
    margin-top: 14px;
    text-align: justify;
}

.category-count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(var(--tn-color-primary-rgb), .08);
    color: var(--tn-color-primary);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    margin-top: 14px;
}

/* ===== GRID ===== */
.post-grid-wrapper {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 60px;
    flex-wrap: wrap;
}

/* ===== CARD PREMIUM ===== */
.post-card {
    background: var(--tn-color-bg);
    border-radius: var(--card-radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: var(--transition-smooth);
    position: relative;
    isolation: isolate;
    height: 100%;
    width: 100%;
    max-width: 370px;
    flex: 1 1 320px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.post-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--card-shadow-hover);
}

/* Featured Badge */
.featured-badge {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #FF6B35;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: .5px;
    z-index: 5;
    box-shadow: 0 4px 15px rgba(255,107,53,.3);
}

		.post-image{
    position: relative;
    width: 100%;
			height: 200px;
    overflow: hidden;
}
.post-image img {
  width: 100%;
	height: 100%;
  object-fit: cover;
  transition: all 0.3s ease;
}
.post-card:hover .post-image img {
    transform: scale(1.05);
}
.post-image .featured-image{
    width: 100%;
    max-height: 150px;
    object-fit: cover;
    display: block;
}

.post-image::after{
    content: "";
    position: absolute;
    inset: 0;
    background: var(--tn-frame-image) center/cover no-repeat;
    pointer-events: none;
    z-index: 2;
}

/* ===== CONTEÚDO ===== */
.post-content-card {
    padding: 20px 24px 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-meta-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.post-category-tag {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--tn-color-primary);
    background: rgba(var(--tn-color-primary-rgb), .1);
    padding: 2px 12px;
    border-radius: 12px;
    transition: all .2s;
}

.post-card:hover .post-category-tag {
    background: var(--tn-color-primary);
    color: #fff;
}


.post-content-card h2 {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    color: #111;
    margin: 0 0 10px;
    transition: color .2s;
}

.post-card:hover .post-content-card h2 {
    color: var(--tn-color-primary);
}

.post-excerpt {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
    margin: 0 0 16px;
    flex: 1;
}

/* ===== FOOTER DO CARD ===== */
.post-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 16px;
    border-top: 1px solid rgba(0,0,0,.06);
    margin-top: auto;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.post-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--tn-color-primary);
}

.post-author-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--tn-color-text);
}

.post-date {
    font-size: 11px;
    color: var(--tn-color-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.post-date i {
    font-size: 11px;
}

.post-reading-time {
    font-size: 11px;
    color: var(--tn-color-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.post-reading-time i {
    font-size: 11px;
}

/* ===== 3 POSTS EM DESTAQUE ===== */
/* 1 post grande à esquerda (ocupa as 2 linhas) + 2 menores empilhados
   à direita — foto cobrindo o card inteiro, degradê escuro embaixo e
   categoria/título/trecho por cima, em branco. */
.hero-grid-wrapper {
    max-width: 1200px;
    margin: 0 auto 40px;
    padding: 0 20px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-auto-rows: 210px;
    gap: 10px;
}

.hero-grid .post-card.hero-card {
    max-width: none;
    width: 100%;
    background: #111;
}

.hero-grid .hero-card:first-child {
    grid-row: span 2;
}

.hero-card-link {
    display: block;
    flex: 1;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

.hero-card .post-image {
    position: relative;
    width: 100%;
    height: 100%;
}

.hero-card .post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease;
}

.hero-card:hover .post-image img {
    transform: scale(1.06);
}

.hero-card-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,.15) 25%, rgba(0,0,0,.78) 65%, rgba(0,0,0,.95) 100%);
    z-index: 3;
    pointer-events: none;
}

.hero-card-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 20px 22px 22px;
    z-index: 4;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hero-card-badge {
    align-self: flex-start;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #fff;
}

.hero-card-title {
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-grid .hero-card:first-child .hero-card-title {
    font-size: 26px;
    -webkit-line-clamp: 3;
}

.hero-card-excerpt {
    color: rgba(255,255,255,.85);
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-grid .hero-card:first-child .hero-card-excerpt {
    font-size: 15px;
}

/* ===== SEÇÃO "MAIS RECENTES" ===== */
.recentes-section {
    max-width: 1200px;
    margin: 0 auto 60px;
    padding: 0 20px;
}

.section-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--tn-color-text);
    margin: 0 0 28px;
    padding-bottom: 14px;
    border-bottom: 2px solid rgba(0,0,0,.06);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 60px;
    height: 2px;
    background: var(--primary-gradient);
}

.recentes-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    align-items: start;
}

.recentes-layout .post-grid-wrapper {
    max-width: none;
    margin: 0;
    padding: 0;
    justify-content: flex-start;
}

/* ===== MAIS VISTOS ===== */
.mais-vistos {
    background: var(--tn-color-surface);
    border-radius: var(--card-radius);
    padding: 24px;
    border: 1px solid rgba(0,0,0,.04);
    position: sticky;
    top: 20px;
}

.mais-vistos-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 17px;
    font-weight: 700;
    color: var(--tn-color-text);
    margin: 0 0 20px;
    padding-bottom: 14px;
    border-bottom: 2px solid rgba(0,0,0,.06);
}

.mais-vistos-title i {
    color: var(--tn-color-primary);
}

.mais-vistos-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.mais-vistos-item {
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(0,0,0,.05);
}

.mais-vistos-item:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.mais-vistos-link {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    text-decoration: none;
    color: inherit;
}

.mais-vistos-rank {
    font-size: 24px;
    font-weight: 800;
    line-height: 1;
    color: var(--tn-color-primary);
    opacity: .35;
    min-width: 26px;
    flex-shrink: 0;
}

.mais-vistos-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.mais-vistos-category {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--tn-color-primary);
}

.mais-vistos-post-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--tn-color-text);
    line-height: 1.35;
    transition: color .2s ease;
}

.mais-vistos-link:hover .mais-vistos-post-title {
    color: var(--tn-color-primary);
}

.mais-vistos-excerpt {
    font-size: 12px;
    color: #888;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== PAGINAÇÃO ===== */
.pagination-wrapper {
    max-width: 1200px;
    margin: 0 auto 60px;
    padding: 0 20px;
}

.pagination-wrapper .nav-links {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination-wrapper .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 44px;
    height: 44px;
    padding: 0 18px;
    border-radius: 30px;
    background: var(--tn-color-surface);
    color: var(--tn-color-text);
    font-weight: 600;
    font-size: 14px;
    transition: all .3s ease;
    text-decoration: none;
    border: 1px solid var(--tn-color-border);
}

.pagination-wrapper .page-numbers.dots {
    background: transparent;
    border-color: transparent;
    color: var(--tn-color-muted);
}

.pagination-wrapper .page-numbers.current {
    background: var(--tn-color-primary);
    color: #fff;
    border-color: var(--tn-color-primary);
    box-shadow: 0 4px 14px rgba(var(--tn-color-primary-rgb), .3);
}

.pagination-wrapper .page-numbers:hover:not(.current):not(.dots) {
    background: #fff;
    border-color: var(--tn-color-primary);
    color: var(--tn-color-primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,.08);
}

.pagination-wrapper .prev.page-numbers i,
.pagination-wrapper .next.page-numbers i {
    font-size: 12px;
    transition: transform .3s ease;
}

.pagination-wrapper .prev.page-numbers:hover i { transform: translateX(-4px); }
.pagination-wrapper .next.page-numbers:hover i { transform: translateX(4px); }

/* ===== RESPONSIVO ===== */
@media (max-width: 1024px) {
    .post-grid-wrapper {
        gap: 24px;
    }

    .hero-grid {
        grid-template-columns: 1fr;
    }

    .hero-grid .post-card.hero-card {
        max-width: 100%;
    }

    .hero-grid .hero-card:first-child .hero-card-title {
        font-size: 22px;
    }

    .recentes-layout {
        grid-template-columns: 1fr;
    }

    .mais-vistos {
        position: static;
    }
}

@media (max-width: 768px) {
    .category-header h1 {
        font-size: 28px;
    }

    .post-grid-wrapper {
        gap: 20px;
        padding: 0 16px 40px;
    }

    .post-card {
        flex-basis: 100%;
        max-width: 100%;
    }

    .post-content-card h2 {
        font-size: 18px;
    }

    .post-footer {
        flex-wrap: wrap;
        gap: 8px;
    }

    .hero-grid-wrapper,
    .recentes-section {
        padding: 0 16px;
    }

    .recentes-layout .post-grid-wrapper {
        padding: 0;
    }

    .section-title {
        font-size: 22px;
    }

    .pagination-wrapper .page-numbers {
        min-width: 38px;
        height: 38px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .post-content-card {
        padding: 16px 16px 20px;
    }

    .post-content-card h2 {
        font-size: 16px;
    }

    .post-excerpt {
        font-size: 13px;
    }

    .hero-grid-wrapper,
    .recentes-section {
        padding: 0 12px;
    }

    .post-meta-top {
        gap: 8px;
    }
}

/* Lazy Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
