/* ============================================================
   Sidebar Flutuante de Notícias - Cativo
   Localizada à direita, recolhível e não interfere no layout
   ============================================================ */

/* Botão de Toggle Flutuante */
.sidebar-toggle {
    display: flex;
    position: fixed;
    top: calc(var(--nav-height) + var(--space-md));
    right: var(--space-md);
    z-index: 100;
    width: 48px;
    height: 48px;
    background: var(--color-primary);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    box-shadow: 0 4px 12px rgba(232, 80, 10, 0.3);
}

.sidebar-toggle:hover {
    background: var(--color-primary-hover, #ff6a1a);
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(232, 80, 10, 0.4);
}

.sidebar-toggle svg {
    width: 24px;
    height: 24px;
    stroke: #fff;
    stroke-width: 2;
}

/* Sidebar Principal */
.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 350px;
    height: 100vh;
    background: rgba(248, 250, 252, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-left: 1px solid rgba(15, 23, 42, 0.1);
    padding: var(--space-xl);
    overflow-y: auto;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
    transform: translateX(100%);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.15);
}

:root:not(.light-theme) .sidebar {
    background: rgba(17, 22, 32, 0.6);
    border-left-color: rgba(255, 255, 255, 0.1);
}

:root.light-theme .sidebar {
    background: rgba(248, 250, 252, 0.75);
    border-left-color: rgba(15, 23, 42, 0.12);
}

.sidebar.open {
    transform: translateX(0);
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--color-border);
    border-radius: var(--radius-full);
}

/* Header da Sidebar */
.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--color-border);
}

.sidebar-header h2 {
    margin: 0;
    font-size: var(--text-xl);
    font-weight: 800;
    color: var(--color-heading);
    letter-spacing: -0.02em;
}

.sidebar-close {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    cursor: pointer;
    font-size: 1.2rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
}

.sidebar-close:hover {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

/* Lista de Notícias */
.sidebar-news-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.news-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.news-item-image {
    width: 100%;
    height: 160px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: var(--space-xs);
}

.news-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-base);
}

.news-item:hover .news-item-image img {
    transform: scale(1.05);
}

.news-item-title {
    font-size: var(--text-md);
    font-weight: 700;
    line-height: 1.4;
    margin: 0;
}

.news-item-title a {
    color: var(--color-heading);
    text-decoration: none;
    transition: color var(--transition-base);
}

.news-item-title a:hover {
    color: var(--color-primary);
}

.news-item-excerpt {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

.news-item-link {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.news-item-link:hover {
    text-decoration: underline;
}

/* Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Responsividade */
@media (max-width: 480px) {
    .sidebar {
        width: 100%;
    }
}

/* Remove classes antigas para evitar conflito */
.sidebar-layout {
    display: block;
}
.sidebar-content-main {
    flex: none;
}
