/*
 * Estilos para a Página Inicial Personalizada
 * Noticiário 24H
 */

/* Layout Principal */
.site-main {
    padding: 2rem 0;
    background-color: var(--color-background, #ffffff);
    transition: background-color 0.3s ease;
}

.container {
    width: 100%;
    max-width: var(--container-width, 1200px);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.content-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 2.5rem;
    margin-top: 1.5rem;
}

.main-content {
    flex: 1;
    min-width: 0;
    /* Previne quebra de layout em telas pequenas */
    position: relative;
}

.sidebar {
    width: 100%;
    max-width: 350px;
    position: relative;
}

/* Melhorias na transição entre o cabeçalho e o conteúdo */
.site-header+#content {
    position: relative;
    z-index: 5;
    background: var(--color-background, #ffffff);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-top: -10px;
    /* Garante que não haja espaços entre o cabeçalho e o conteúdo */
}

/* Estilo para o rodapé */
.site-footer {
    margin-top: 3rem;
    padding: 3rem 0;
    background-color: var(--color-footer-bg, #f8f9fa);
    border-top: 1px solid var(--color-border, #eaeaea);
}

/* Ajustes para o botão de voltar ao topo */
#scrollToTop {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background-color: var(--color-primary, #2563eb);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#scrollToTop.visible {
    opacity: 1;
    visibility: visible;
}

#scrollToTop:hover {
    background-color: var(--color-primary-dark, #1d4ed8);
    transform: translateY(-3px);
}

/* Seção Hero */
.hero-section {
    margin-bottom: 3rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.hero-post {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
    padding-bottom: 2rem;
}

.hero-post:hover {
    transform: translateY(-5px);
}

.hero-post-link {
    display: block;
    color: #fff;
    text-decoration: none;
}

.hero-post-thumbnail {
    position: relative;
    padding-top: 56.25%;
    /* 16:9 Aspect Ratio */
    background: var(--color-bg-alt);
}

.hero-post-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.hero-post:hover .hero-post-img {
    transform: scale(1.05);
}

.hero-post-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 2rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
}

.hero-post-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    margin-bottom: 0.75rem;
    background: var(--color-accent);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 4px;
}

.hero-post-title {
    margin: 0 0 1rem;
    font-size: 1.5rem;
    line-height: 1.3;
}

.hero-post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Seções de Categorias */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 3rem 0 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--color-primary);
}

.section-title {
    margin: 0;
    font-size: 1.5rem;
    color: var(--color-primary);
}

.section-title a {
    color: inherit;
    text-decoration: none;
}

.section-title a:hover {
    color: var(--color-accent);
}

.view-all {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-light);
    text-decoration: none;
    transition: color 0.2s ease;
}

.view-all:hover {
    color: var(--color-accent);
}

/* Grid de Posts */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.post-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.post-thumbnail {
    position: relative;
    padding-top: 56.25%;
    /* 16:9 Aspect Ratio */
    overflow: hidden;
}

.post-thumbnail-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.post-card:hover .post-thumbnail-img {
    transform: scale(1.05);
}

.post-content {
    padding: 1.5rem;
}

.entry-title {
    margin: 0 0 0.75rem;
    font-size: 1.125rem;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.entry-title a {
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.2s ease;
}

.entry-title a:hover {
    color: var(--color-accent);
}

.entry-meta {
    margin-bottom: 0.75rem;
    font-size: 0.8125rem;
    color: var(--color-text-light);
}

.entry-summary {
    margin-bottom: 1rem;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--color-text);
}

.entry-footer {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.read-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
    position: absolute;
    bottom: 0.5rem;
    right: 1rem;
    background: var(--color-accent);
    padding: 0.3rem 0.8rem;
    border-radius: 3px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    min-width: 70px;
    text-align: center;
    z-index: 5;
}

.read-more:hover {
    background: #c1001d;
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.25);
}

.form-privacy a {
    color: var(--color-accent);
    text-decoration: none;
    transition: color 0.2s;
    margin-left: 4px;
}

.read-more:hover {
    color: var(--color-primary);
}

.read-more::after {
    content: '→';
    margin-left: 0.5rem;
    transition: transform 0.2s ease;
}

.read-more:hover::after {
    transform: translateX(3px);
}

/* Seção de Vídeos */
.videos-carousel {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    scrollbar-width: thin;
    scrollbar-color: var(--color-accent) transparent;
}

.videos-carousel::-webkit-scrollbar {
    height: 6px;
}

.videos-carousel::-webkit-scrollbar-track {
    background: transparent;
}

.videos-carousel::-webkit-scrollbar-thumb {
    background-color: var(--color-accent);
    border-radius: 3px;
}

.video-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.video-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.video-thumbnail {
    position: relative;
    padding-top: 56.25%;
    /* 16:9 Aspect Ratio */
    background: var(--color-bg-alt);
}

.video-thumbnail-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-accent);
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.video-card:hover .play-button {
    background: var(--color-accent);
    color: #fff;
    transform: translate(-50%, -50%) scale(1.1);
}

.video-content {
    padding: 1.25rem;
}

.video-title {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    line-height: 1.4;
}

.video-title a {
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.2s ease;
}

.video-title a:hover {
    color: var(--color-accent);
}

.video-meta {
    font-size: 0.8125rem;
    color: var(--color-text-light);
}

/* Seção de Mais Lidas */
.trending-posts {
    display: grid;
    gap: 1rem;
    margin-bottom: 3rem;
}

.trending-post {
    display: flex;
    align-items: flex-start;
    padding: 1rem;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.trending-post:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.trending-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-right: 1rem;
    background: var(--color-accent);
    color: #fff;
    font-weight: 700;
    font-size: 0.875rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.trending-content {
    flex: 1;
}

.trending-title {
    margin: 0 0 0.25rem;
    font-size: 0.9375rem;
    line-height: 1.4;
}

.trending-title a {
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.2s ease;
}

.trending-title a:hover {
    color: var(--color-accent);
}

.trending-date {
    display: block;
    font-size: 0.75rem;
    color: var(--color-text-light);
}

/* Widget de Newsletter */
.newsletter-widget {
    background: linear-gradient(135deg, var(--color-primary) 0%, #0d2a4a 100%);
    color: #fff;
    border-radius: 10px;
    overflow: hidden;
    margin: 100px auto 2rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    box-sizing: border-box;
    width: 100%;
}

.newsletter-content {
    padding: 2rem;
}

.newsletter-title {
    margin: 0 0 1rem;
    font-size: 1.25rem;
    color: #fff;
}

.newsletter-description {
    margin: 0 0 1.5rem;
    font-size: 0.9375rem;
    opacity: 0.9;
    line-height: 1.6;
}

.newsletter-form .form-group {
    display: flex;
    margin-bottom: 1rem;
}

.newsletter-form input[type="email"] {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 4px 0 0 4px;
    font-size: 0.9375rem;
    color: var(--color-text);
}

.newsletter-form input[type="email"]:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--color-accent);
}

.newsletter-submit {
    padding: 0 1.5rem;
    background: var(--color-accent);
    color: #fff;
    border: none;
    border-radius: 0 4px 4px 0;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.newsletter-submit:hover {
    background: #c1001d;
}

.form-privacy {
    font-size: 0.75rem;
    opacity: 0.8;
    line-height: 1.5;
    margin-top: 1rem;
    display: flex;
    align-items: flex-start;
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    position: relative;
    padding-left: 28px;
    margin: 0;
    user-select: none;
    line-height: 1.4;
}

.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 2px;
    left: 0;
    height: 18px;
    width: 18px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.checkbox-container:hover input~.checkmark {
    background-color: rgba(255, 255, 255, 0.2);
}

.checkbox-container input:checked~.checkmark {
    background-color: var(--color-accent);
    border-color: var(--color-accent);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-container input:checked~.checkmark:after {
    display: block;
}

.checkbox-container .checkmark:after {
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-container a {
    color: #fff;
    text-decoration: underline;
    transition: opacity 0.2s ease;
}

.checkbox-container a:hover {
    opacity: 0.8;
}

/* Responsividade */
@media (min-width: 768px) {
    .hero-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 300px 300px;
    }

    .hero-post.main-feature {
        grid-row: 1 / -1;
    }

    .content-wrapper {
        flex-direction: row;
    }

    .main-content {
        flex: 1;
        min-width: 0;
    }

    .sidebar {
        width: 350px;
        flex-shrink: 0;
    }
}

@media (min-width: 1024px) {
    .hero-grid {
        grid-template-columns: 2fr 1fr 1fr;
        grid-template-rows: 300px 300px;
    }

    .hero-post.main-feature {
        grid-row: 1 / -1;
    }

    .hero-post.secondary-feature:first-of-type {
        grid-column: 2 / -1;
    }

    .hero-post.secondary-feature:last-of-type {
        grid-column: 2 / -1;
    }

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

/* Ajustes de acessibilidade */
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-post {
    animation: fadeIn 0.6s ease-out forwards;
    opacity: 0;
}

.hero-post:nth-child(1) {
    animation-delay: 0.1s;
    height: 650px;
}

.hero-post:nth-child(2) {
    animation-delay: 0.2s;
}

.hero-post:nth-child(3) {
    animation-delay: 0.3s;
}

.hero-post:nth-child(4) {
    animation-delay: 0.4s;
}

/* Ajuste de altura para mobile */
@media (max-width: 767px) {
    .hero-post:nth-child(1) {
        height: 450px;
    }
}

/* Efeito de hover nos cards */
.post-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--color-accent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.post-card:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Melhorias de desempenho */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Suporte para dark mode */
@media (prefers-color-scheme: dark) {

    .post-card,
    .trending-post,
    .video-card {
        background: var(--color-bg-alt);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    }

    .entry-title a,
    .video-title a,
    .trending-title a {
        color: #f0f0f0;
    }

    .entry-summary {
        color: #e0e0e0;
    }

    .entry-meta,
    .video-meta,
    .trending-date {
        color: #a0a0a0;
    }
}