/* =========================================
   Blog Styles - Dr. Túlio Zago de Brito
   ========================================= */

/* Blog Hero Section */
.blog-hero {
    padding: 140px 0 80px;
    background: linear-gradient(135deg, #0D0D0D 0%, #1A1A1A 50%, #0D0D0D 100%);
    background-size: 200% 200%;
    animation: gradientFlow 8s ease infinite;
    position: relative;
    text-align: center;
    overflow: hidden;
}

.blog-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(195, 161, 118, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(195, 161, 118, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.blog-hero__title {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--color-white);
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.blog-hero__description {
    font-size: 1.35rem;
    color: rgba(255, 255, 255, 0.95);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
    position: relative;
    z-index: 1;
    font-weight: 300;
}

/* Blog Section */
.blog-section {
    padding: 5rem 0 6rem;
    background: var(--color-black);
    position: relative;
}

/* Blog Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 2.5rem;
    margin: 3rem 0;
}

/* Post Card */
.post-card {
    background: #1A1A1A;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.5),
        0 1px 3px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(195, 161, 118, 0.15);
    position: relative;
}

.post-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.post-card:hover {
    transform: translateY(-12px);
    box-shadow:
        0 20px 40px rgba(195, 161, 118, 0.15),
        0 8px 16px rgba(0, 0, 0, 0.5);
    border-color: rgba(195, 161, 118, 0.4);
}

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

.post-card__image {
    position: relative;
    overflow: hidden;
    display: block;
    background: linear-gradient(135deg, #0A0A0A 0%, #1A1A1A 100%);
    aspect-ratio: 16 / 9;
}

.post-card__image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.4) 100%);
    opacity: 0.6;
    transition: opacity 0.4s ease;
    z-index: 2;
}

.post-card:hover .post-card__image::after {
    opacity: 0.2;
}

.post-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    filter: brightness(0.95) contrast(1.05);
}

.post-card:hover .post-card__image img {
    transform: scale(1.1);
    filter: brightness(1) contrast(1.1);
}

.post-card__content {
    padding: 2rem 1.75rem;
}

.post-card__date {
    display: inline-block;
    font-size: 0.8125rem;
    color: var(--color-accent);
    margin-bottom: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.375rem 0.875rem;
    background: rgba(195, 161, 118, 0.12);
    border-radius: 6px;
    border: 1px solid rgba(195, 161, 118, 0.2);
}

.post-card__title {
    margin-bottom: 1.5rem;
    min-height: 3.5rem;
}

.post-card__title a {
    color: var(--color-white);
    text-decoration: none;
    font-size: 1.375rem;
    font-weight: 600;
    line-height: 1.35;
    display: block;
    transition: all 0.3s ease;
    letter-spacing: -0.01em;
}

.post-card__title a:hover {
    color: var(--color-accent);
    text-shadow: 0 0 20px rgba(195, 161, 118, 0.3);
}

.post-card__link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all 0.3s ease;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    background: rgba(195, 161, 118, 0.08);
    border: 1px solid rgba(195, 161, 118, 0.25);
}

.post-card__link:hover {
    color: var(--color-black);
    background: var(--color-accent);
    border-color: var(--color-accent);
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(195, 161, 118, 0.3);
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin: 4rem 0 2rem;
    flex-wrap: wrap;
}

.pagination__btn,
.pagination__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 48px;
    padding: 0 1.25rem;
    border: 2px solid rgba(195, 161, 118, 0.2);
    border-radius: 10px;
    text-decoration: none;
    color: var(--color-white);
    background: rgba(26, 26, 26, 0.6);
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pagination__btn:hover,
.pagination__number:hover {
    background: rgba(195, 161, 118, 0.1);
    border-color: var(--color-accent);
    color: var(--color-accent);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(195, 161, 118, 0.2);
}

.pagination__number--active {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--color-black);
    pointer-events: none;
    box-shadow: 0 4px 16px rgba(195, 161, 118, 0.3);
}

.pagination__numbers {
    display: flex;
    gap: 0.5rem;
}

.pagination__prev,
.pagination__next {
    font-size: 0.9375rem;
    padding: 0 1.5rem;
    gap: 0.5rem;
}

/* Empty State */
.blog-empty {
    text-align: center;
    padding: 6rem 2rem;
    background: linear-gradient(135deg, rgba(26, 26, 26, 0.4), rgba(20, 20, 20, 0.6));
    border-radius: 20px;
    border: 1px solid rgba(195, 161, 118, 0.1);
}

.blog-empty__message {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 2.5rem;
    font-weight: 300;
    letter-spacing: -0.01em;
}

/* Active nav link */
.nav__link--active {
    color: var(--color-accent) !important;
    position: relative;
}

.nav__link--active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
    border-radius: 2px;
    box-shadow: 0 2px 8px rgba(195, 161, 118, 0.4);
}

/* =========================================
   Responsive Design
   ========================================= */

/* Tablet */
@media (max-width: 768px) {
    .blog-hero {
        padding: 110px 0 60px;
    }

    .blog-hero__title {
        font-size: 2.5rem;
    }

    .blog-hero__description {
        font-size: 1.2rem;
    }

    .blog-section {
        padding: 4rem 0 5rem;
    }

    .blog-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 2rem;
    }

    .post-card__content {
        padding: 1.5rem;
    }

    .post-card__title a {
        font-size: 1.25rem;
    }

    .pagination {
        gap: 0.5rem;
    }

    .pagination__btn,
    .pagination__number {
        min-width: 44px;
        height: 44px;
        padding: 0 1rem;
        font-size: 0.875rem;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .blog-hero {
        padding: 100px 0 50px;
    }

    .blog-hero__title {
        font-size: 2rem;
        line-height: 1.2;
    }

    .blog-hero__description {
        font-size: 1.05rem;
        padding: 0 1rem;
    }

    .blog-section {
        padding: 3rem 0 4rem;
    }

    .blog-grid {
        grid-template-columns: 1fr;
        gap: 1.75rem;
    }

    .post-card {
        border-radius: 14px;
    }

    .post-card__content {
        padding: 1.5rem 1.25rem;
    }

    .post-card__title {
        min-height: auto;
        margin-bottom: 1.25rem;
    }

    .post-card__title a {
        font-size: 1.2rem;
    }

    .post-card__date {
        font-size: 0.75rem;
        padding: 0.3rem 0.75rem;
    }

    .post-card__link {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }

    .pagination {
        gap: 0.375rem;
        margin: 3rem 0 1.5rem;
    }

    .pagination__btn,
    .pagination__number {
        min-width: 40px;
        height: 40px;
        padding: 0 0.75rem;
        font-size: 0.875rem;
        border-radius: 8px;
    }

    .pagination__prev,
    .pagination__next {
        padding: 0 1rem;
        font-size: 0.8125rem;
    }

    /* Hide some page numbers on mobile to save space */
    .pagination__numbers a:not(.pagination__number--active):nth-child(n+6) {
        display: none;
    }

    .blog-empty {
        padding: 4rem 1.5rem;
    }

    .blog-empty__message {
        font-size: 1.25rem;
    }
}

/* Desktop Large */
@media (min-width: 1400px) {
    .blog-hero__title {
        font-size: 4rem;
    }

    .blog-hero__description {
        font-size: 1.5rem;
    }

    .blog-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 3rem;
    }

    .post-card__content {
        padding: 2.25rem 2rem;
    }

    .post-card__title a {
        font-size: 1.5rem;
    }
}

/* Animated Gradient Background */
@keyframes gradientFlow {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* Smooth Entry Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-card {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

.post-card:nth-child(1) { animation-delay: 0.1s; }
.post-card:nth-child(2) { animation-delay: 0.2s; }
.post-card:nth-child(3) { animation-delay: 0.3s; }
.post-card:nth-child(4) { animation-delay: 0.4s; }
.post-card:nth-child(5) { animation-delay: 0.5s; }
.post-card:nth-child(6) { animation-delay: 0.6s; }

/* Subtle texture for cards on hover */
.post-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        transparent 0%,
        rgba(195, 161, 118, 0.02) 50%,
        transparent 100%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.post-card:hover::after {
    opacity: 1;
}

/* Print Styles */
@media print {
    .header,
    .pagination,
    .whatsapp-float,
    .footer {
        display: none;
    }

    .blog-hero {
        padding: 2rem 0 1rem;
        background: none;
        color: #000;
    }

    .post-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Dark Mode Support (for future) */
@media (prefers-color-scheme: dark) {
    /* Already optimized for dark mode */
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .post-card {
        opacity: 1;
        animation: none;
    }

    .blog-hero {
        animation: none;
    }

    .post-card:hover {
        transform: none;
    }

    .post-card:hover .post-card__image img {
        transform: none;
    }
}

/* Focus Styles for Accessibility */
.post-card__link:focus,
.post-card__title a:focus,
.pagination__btn:focus,
.pagination__number:focus {
    outline: 3px solid var(--color-accent);
    outline-offset: 3px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .post-card {
        border: 2px solid var(--color-white);
    }

    .post-card__link {
        border: 2px solid currentColor;
    }
}
