/* =========================================
   BLOG.CSS - eSolution TI
   CSS exclusivo para a página do blog
   Layout: HORIZONTAL (Desktop) | VERTICAL (Mobile)
   Design: Moderno e Minimalista
   ========================================= */

/* Blog - Body quando na página do blog */
body.blog-page {
    background: #ffffff;
}

/* Blog Header Hero - Design Minimalista */
.blog-header {
    background: #ffffff;
    color: #1a1a1a;
    padding: 120px 20px 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid #e5e7eb;
}

.blog-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, #fafafa 0%, #ffffff 100%);
    opacity: 1;
}

.blog-header-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
}

.blog-header h1 {
    font-size: clamp(36px, 6vw, 56px);
    margin-bottom: 16px;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: -0.03em;
    animation: fadeInDown 0.8s ease-out;
}

.blog-header p {
    font-size: clamp(16px, 3vw, 20px);
    color: #6b7280;
    font-weight: 400;
    letter-spacing: -0.01em;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

/* Blog Container */
.blog-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px 80px;
    position: relative;
    z-index: 2;
}

/* Blog Filters */
.blog-filters {
    max-width: 1000px;
    margin: 0 auto 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.blog-filter-search {
    width: 100%;
}

.blog-filter-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    color: #1a1a1a;
    transition: all 0.2s ease;
    font-family: inherit;
}

.blog-filter-input:focus {
    outline: none;
    border-color: #9ca3af;
    box-shadow: 0 0 0 3px rgba(156, 163, 175, 0.1);
}

.blog-filter-input::placeholder {
    color: #9ca3af;
}

.blog-filter-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.blog-filter-select {
    flex: 1;
    min-width: 150px;
    padding: 12px 16px;
    font-size: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    color: #1a1a1a;
    transition: all 0.2s ease;
    font-family: inherit;
    cursor: pointer;
}

.blog-filter-select:focus {
    outline: none;
    border-color: #9ca3af;
    box-shadow: 0 0 0 3px rgba(156, 163, 175, 0.1);
}

.blog-filter-clear {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    white-space: nowrap;
}

.blog-filter-clear:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #1a1a1a;
}

.blog-filter-clear:active {
    transform: scale(0.98);
}

/* Blog Posts Grid - 1 COLUNA EM DESKTOP */
.blog-posts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 0;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;

}

/* Blog Post Card - HORIZONTAL EM DESKTOP, VERTICAL EM MOBILE */
.blog-post-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
    display: flex;
    flex-direction: row; /* Horizontal em desktop */
    height: 100px;
    min-height: 250px;
}

.blog-post-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 0;
    background: transparent;
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.blog-post-card:hover::before {
    transform: scaleX(1);
}

.blog-post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    border-color: #d1d5db;
}

.blog-post-card:nth-child(1) { animation-delay: 0.1s; }
.blog-post-card:nth-child(2) { animation-delay: 0.2s; }
.blog-post-card:nth-child(3) { animation-delay: 0.3s; }
.blog-post-card:nth-child(4) { animation-delay: 0.4s; }
.blog-post-card:nth-child(5) { animation-delay: 0.5s; }
.blog-post-card:nth-child(6) { animation-delay: 0.6s; }

/* Imagem do Post - LATERAL EM DESKTOP, TOPO EM MOBILE */
.blog-post-image-wrapper {
    position: relative;
    overflow: hidden;
    width: 30%; /* 40% da largura em desktop */
    min-height: 160px;
    background: #f3f4f6;
    flex-shrink: 0;
}

.blog-post-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.blog-post-card:hover .blog-post-image {
    transform: scale(1.03);
}

/* Badge NOVO */
.blog-post-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #1a1a1a;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Conteúdo do Post - 60% EM DESKTOP */
.blog-post-content {
    padding: 10px 20px 10px 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    width: 60%; /* 60% da largura em desktop */
    justify-content: flex-start;
}

.blog-post-title {
    font-size: 22px; /* Maior em desktop */
    color: #1a1a1a;
    margin-bottom: 8px;
    line-height: 1.4;
    font-weight: 600;
    letter-spacing: -0.02em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Meta Info - COMPACTA */
.blog-post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 13px;
}

.blog-post-author {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #6b7280;
    font-weight: 500;
}

.blog-post-author::before {
    content: '';
    display: none;
}

.blog-post-date {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #9ca3af;
    
}

.blog-post-date::before {
    content: '•';
    font-size: 14px;
}

/* Excerpt - MAIS LINHAS EM DESKTOP */
.blog-post-excerpt {
    color: #4b5563;
    line-height: 1.7;
    margin-bottom: 12px;
    font-size: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* 2 linhas em desktop */
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 0;
    
}

/* Botão Ler Mais - NO FINAL */
.blog-read-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #1a1a1a;
    font-weight: 600;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    margin-top: auto;
    align-self: flex-end;
}

.blog-read-more::after {
    content: '→';
    transition: transform 0.3s ease;
    
}

.blog-read-more:hover::after {
    transform: translateX(4px);
    
}

.blog-read-more:hover {
    color: #374151;
}

/* Blog Loading */
.blog-loading {
    text-align: center;
    padding: 100px 20px;
}

.blog-loading-spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 24px;
    border: 3px solid #f3f4f6;
    border-top: 3px solid #1a1a1a;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.blog-loading p {
    color: #6b7280;
    font-size: 16px;
    font-weight: 400;
}

/* Blog No Posts */
.blog-no-posts {
    text-align: center;
    padding: 120px 20px;
    background: #fafafa;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.blog-no-posts h2 {
    font-size: 32px;
    margin-bottom: 12px;
    color: #1a1a1a;
    font-weight: 600;
}

.blog-no-posts p {
    color: #6b7280;
    font-size: 16px;
}

/* Blog Modal */
.blog-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    z-index: 1000;
    overflow-y: auto;
    animation: fadeIn 0.2s ease;
}

.blog-modal-content {
    background: white;
    max-width: 800px;
    margin: 60px auto;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: slideUp 0.3s ease-out;
}

.blog-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 24px;
    color: white;
    cursor: pointer;
    z-index: 10;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-weight: 300;
    line-height: 1;
}

.blog-modal-close:hover {
    background: rgba(0,0,0,0.7);
    transform: scale(1.05);
}

.blog-modal-image {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
}

.blog-modal-body {
    padding: 48px;
}

.blog-modal-title {
    font-size: clamp(24px, 4vw, 36px);
    color: #1a1a1a;
    margin-bottom: 16px;
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.blog-modal-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #6b7280;
    font-size: 14px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e5e7eb;
}

.blog-modal-meta strong {
    color: #1a1a1a;
}

.blog-modal-text {
    color: #374151;
    font-size: 17px;
    line-height: 1.8;
    white-space: pre-wrap;
}

/* Blog Back to Top */
.blog-back-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    background: #1a1a1a;
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.2s ease;
    z-index: 999;
    font-size: 20px;
    font-weight: 600;
    border: 1px solid #e5e7eb;
}

.blog-back-to-top:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
    background: #374151;
}

.blog-back-to-top.show {
    display: flex;
    animation: fadeInUp 0.3s ease;
}

/* Blog Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Blog Responsive */
@media (max-width: 1024px) {
    .blog-posts-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

@media (max-width: 768px) {
    .blog-filter-group {
        flex-direction: column;
    }

    .blog-filter-select {
        width: 100%;
        min-width: 100%;
    }

    .blog-filter-clear {
        width: 100%;
    }
}

/* MOBILE: LAYOUT VERTICAL (PERFEITO) */
@media (max-width: 768px) {
    .blog-header {
        padding: 80px 20px 40px;
    }

    .blog-container {
        padding: 24px 16px 60px;
    }

    /* Filtros em mobile */
    .blog-filters {
        margin-bottom: 24px;
        gap: 12px;
    }

    .blog-filter-input {
        padding: 10px 14px;
        font-size: 14px;
    }

    .blog-filter-select {
        padding: 10px 14px;
        font-size: 13px;
    }

    .blog-filter-clear {
        padding: 10px 20px;
        font-size: 13px;
    }

    /* MOBILE: Cards VERTICAIS */
    .blog-post-card {
        flex-direction: column !important;
        min-height: auto !important;
        height: auto !important;
        border-radius: 12px;
    }

    .blog-post-image-wrapper {
        width: 100% !important;
        height: 200px !important;
        min-height: 200px !important;
    }

    .blog-post-content {
        width: 100% !important;
        padding: 16px !important;
        justify-content: flex-start !important;
    }

    .blog-posts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-top: 0;
    }

    .blog-post-title {
        font-size: 18px !important;
        margin-bottom: 8px !important;
        line-height: 1.3 !important;
    }

    .blog-post-meta {
        margin-bottom: 8px !important;
        padding-bottom: 8px !important;
        font-size: 12px !important;
    }

    .blog-post-excerpt {
        -webkit-line-clamp: 3 !important;
        font-size: 14px !important;
        margin-bottom: 10px !important;
        line-height: 1.5 !important;
    }

    .blog-read-more {
        font-size: 13px !important;
        margin-top: 8px !important;
    }

    .blog-modal-content {
        margin: 20px;
        border-radius: 16px;
    }

    .blog-modal-body {
        padding: 30px 24px;
    }

    .blog-back-to-top {
        bottom: 20px;
        right: 20px;
        width: 48px;
        height: 48px;
    }

    .blog-no-posts {
        padding: 80px 20px;
    }

    .blog-no-posts h2 {
        font-size: 24px;
    }

    .blog-no-posts p {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .blog-header {
        padding: 60px 16px 32px;
    }

    .blog-header h1 {
        font-size: 32px !important;
    }

    .blog-header p {
        font-size: 15px !important;
    }

    .blog-container {
        padding: 20px 12px 50px;
    }

    .blog-filters {
        gap: 10px;
    }

    .blog-filter-input,
    .blog-filter-select,
    .blog-filter-clear {
        padding: 9px 12px;
        font-size: 13px;
    }

    .blog-post-image-wrapper {
        height: 180px !important;
        min-height: 180px !important;
    }

    .blog-post-content {
        padding: 14px !important;
    }

    .blog-post-title {
        font-size: 17px !important;
        margin-bottom: 6px !important;
    }

    .blog-post-meta {
        font-size: 11px !important;
        gap: 8px !important;
    }

    .blog-post-excerpt {
        font-size: 13px !important;
        margin-bottom: 8px !important;
    }

    .blog-read-more {
        font-size: 12px !important;
    }

    .blog-posts-grid {
        gap: 16px;
    }

    .blog-no-posts {
        padding: 60px 16px;
    }

    .blog-no-posts h2 {
        font-size: 20px;
    }

    .blog-no-posts p {
        font-size: 13px;
    }
}
