/* 
 * NEI-ISEP Theme - Responsive & Animation Adjustments
 * Este arquivo complementa o style.css com melhorias de responsividade e animações
 */

/* ============================================
   SMOOTH SCROLL & LAYOUT FIXES
   ============================================ */

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.site-footer {
    margin-top: auto;
}

/* ============================================
   NEWS POSTS SECTION - ADAPTIVE GRID
   ============================================ */

.news-posts-section {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-posts-section .container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Grid adaptável que ocupa todo o espaço disponível */
.news-posts-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 1.5rem;
    row-gap: 1.5rem;
    margin-bottom: 0;
    flex: 1;
    align-content: start;
    grid-auto-rows: auto;
}

.news-post-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.news-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* ============================================
   SMOOTH ANIMATIONS & TRANSITIONS
   ============================================ */

a {
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.news-card-image {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.news-card-image:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.event-card,
.platform-card {
    scroll-snap-align: start;
    scroll-snap-stop: always;
}

.events-grid,
.platforms-grid {
    scroll-snap-type: x mandatory;
}

/* ============================================
   CAROUSEL NAVIGATION - SMOOTH TRANSITIONS
   ============================================ */

.carousel-nav {
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 1;
}

.carousel-nav:hover {
    transform: translateY(-50%) scale(1.15);
}

/* ============================================
   PAGINATION & SPACING ADJUSTMENTS
   ============================================ */

.pagination {
    margin-top: 2rem;
    margin-bottom: 0;
    padding-bottom: 1rem;
}

.no-posts {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

/* ============================================
   MOBILE OPTIMIZATIONS
   ============================================ */

@media (max-width: 768px) {
    /* Remover setas em mobile completamente */
    .carousel-nav {
        display: none !important;
    }

    .carousel-wrapper {
        margin: 0;
    }

    /* Adaptar grid de notícias em mobile */
    .news-posts-grid {
        grid-template-columns: 1fr;
        gap: 0.9rem;
        grid-auto-rows: auto;
    }

    .news-card-image {
        height: 220px;
        transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    .news-card-image:active {
        transform: translateY(-4px);
    }

    /* Remover margens inferiores desnecessárias */
    .news-posts-section {
        padding: 2.5rem 0;
    }

    .news-posts-section .container {
        padding: 0 var(--site-gutter);
    }

    /* Melhorar espaçamento em mobile */
    .news-post-card {
        margin-bottom: 0;
    }

    .pagination {
        margin-top: 1.5rem;
        margin-bottom: 0;
        padding: 1rem;
    }

    /* Melhorar menu mobile - garantir footer visível */
    .nav-sidebar {
        padding: 80px 30px 30px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav-menu {
        flex: 0 1 auto;
        margin-bottom: 20px;
    }

    .nav-menu > .menu-item {
        margin-bottom: 20px;
    }

    .nav-menu > .menu-item > a {
        font-size: 20px;
        padding: 8px 0;
    }

    .nav-footer {
        margin-top: auto;
        padding-top: 20px;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        flex-shrink: 0;
    }

    .nav-social {
        display: flex;
        gap: 15px;
        margin-bottom: 15px;
        justify-content: flex-start;
    }

    .nav-tagline {
        font-size: 13px;
        opacity: 0.95;
    }
}

@media (max-width: 480px) {
    .news-posts-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .news-card-image {
        height: 200px;
    }

    .news-card-title {
        font-size: 1rem;
    }

    .news-posts-section {
        padding: 1.5rem 0;
    }

    .news-posts-section .container {
        padding: 0 var(--site-gutter);
    }

    /* Otimizar menu mobile para screens pequenos */
    .nav-sidebar {
        width: 100%;
        max-width: 100%;
        right: -100%;
        padding: 70px 20px 20px;
    }

    .nav-menu > .menu-item > a {
        font-size: 18px;
    }

    .nav-footer {
        padding-top: 15px;
    }

    .nav-social {
        gap: 12px;
    }

    .nav-social a {
        font-size: 1.25rem;
    }

    .nav-tagline {
        font-size: 12px;
    }
}

/* ============================================
   SMOOTH SCROLL BEHAVIOR FOR CAROUSELS
   ============================================ */

.events-grid,
.platforms-grid {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Melhorar scrollbars em navegadores que suportam */
.events-grid::-webkit-scrollbar,
.platforms-grid::-webkit-scrollbar {
    height: 6px;
}

.events-grid::-webkit-scrollbar-track,
.platforms-grid::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.events-grid::-webkit-scrollbar-thumb,
.platforms-grid::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 10px;
    opacity: 0.6;
}

.events-grid::-webkit-scrollbar-thumb:hover,
.platforms-grid::-webkit-scrollbar-thumb:hover {
    opacity: 1;
}

/* ============================================
   PREVENT BOTTOM MARGIN WITH FOOTER
   ============================================ */

.site-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-archive-page {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.news-archive-page > * {
    flex: 1 0 auto;
}

.news-archive-page .news-posts-section {
    flex: 1;
}

/* ============================================
   FOCUS & ACCESSIBILITY
   ============================================ */

a:focus,
button:focus {
    outline: none;
}

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--primary-blue);
    outline-offset: 3px;
    box-shadow: 0 0 0 4px rgba(28, 176, 217, 0.18);
}

/* Avoid the browser tap highlight looking like a blue outline on mobile */
a,
button {
    -webkit-tap-highlight-color: transparent;
}

/* ============================================
   LARGE SCREENS
   ============================================ */

@media (min-width: 1200px) {
    .news-posts-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: auto;
    }

    .news-posts-section .container {
        padding: 0 var(--site-gutter);
    }
}
