:root {
    --feed-blue-900: #003366;
    --feed-blue-700: #0055a5;
    --feed-blue-500: #1e5c99;
    --feed-blue-50:  #e6f0fa;
    --feed-bg:       #f6f7fb;
    --feed-card:     #ffffff;
    --feed-ink:      #374151;
    --feed-muted:    #6b7280;
    --feed-line:     #e5e9f2;
    --feed-orange:   #e8833a;
}

/* ---------- Página ---------- */
.feed-page {
    min-height: 100vh;
    background-color: var(--feed-bg);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--feed-ink);
}

/* ---------- Hero ---------- */
.feed-hero {
    position: relative;
    background: linear-gradient(135deg, var(--feed-blue-900) 0%, var(--feed-blue-700) 100%);
    color: #fff;
    padding: 15px 16px 52px;
    overflow: hidden;
}
.feed-hero-inner {
    max-width: 960px;
    margin: 0 auto;
}
.feed-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    line-height: 1.15;
    margin: 0 0 12px 0;
    letter-spacing: -0.02em;
}
.feed-subtitle {
    font-size: 1rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.85);
    margin: 0;
    max-width: 620px;
    white-space: nowrap;
}
.feed-hero-wave {
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 100%;
    height: 56px;
    display: block;
}
.feed-hero-wave path {
    fill: var(--feed-bg);
}

/* ---------- Wrapper ---------- */
.feed-wrapper {
    max-width: 960px;
    margin: 0 auto;
    padding: 40px 16px 64px;
}

/* ---------- Linha do tempo ---------- */
.feed-timeline {
    position: relative;
    list-style: none;
    margin: 0;
    padding: 0;
}
.feed-timeline::before {
    content: "";
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: 11px;
    width: 2px;
    background: linear-gradient(to bottom,
        var(--feed-blue-700),
        rgba(0, 85, 165, 0.15));
}
.feed-item {
    position: relative;
    padding-left: 44px;
    margin-bottom: 5px;
}
.feed-item:last-child {
    margin-bottom: 0;
}

/* Marcador na linha do tempo */
.feed-marker {
    position: absolute;
    left: 4px;
    top: 24px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid var(--feed-orange);
    box-shadow: 0 0 0 4px var(--feed-bg);
    z-index: 1;
}


/* Marcador Exclusivo para Notícias NOVAS */
.feed-item--novo .feed-marker {
    background-color: #2ec4b6; 
    border-color: #2ec4b6;     
    animation: feed-pulse-verde 2s ease-in-out infinite;
}

/* Animação de pulso esverdeado para os novos */
@keyframes feed-pulse-verde {
    0%, 100% { 
        box-shadow: 0 0 0 4px var(--feed-bg), 0 0 0 4px rgba(46, 196, 182, 0); 
    }
    50% { 
        box-shadow: 0 0 0 4px var(--feed-bg), 0 0 0 8px rgba(46, 196, 182, 0.25); 
    }
}

/* ---------- Card ---------- */
.feed-card {
    background-color: var(--feed-card);
    border: 1px solid var(--feed-line);
    border-radius: 16px;
    box-shadow: 0 1px 3px rgba(16, 24, 40, 0.05);
    padding: 19px 26px;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.feed-card:hover {
    box-shadow: 0 10px 24px rgba(16, 24, 40, 0.10);
    transform: translateY(-2px);
}

/* ---------- Meta ---------- */
.feed-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}
.feed-date {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--feed-muted);
    text-transform: capitalize;
}
.feed-tags {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.feed-tag-sistema {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background-color: var(--feed-blue-50);
    color: var(--feed-blue-700);
    padding: 4px 10px;
    border-radius: 999px;
}
.feed-badge-novo {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #fff;
    background-color: #00bb80;
    padding: 4px 10px;
    border-radius: 999px;
}

/* ---------- Título ---------- */
.feed-card-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--feed-blue-900);
    line-height: 1.3;
    margin: 0 0 10px 0;
}

/* ---------- Conteúdo ---------- */
.feed-content-wrap {
    position: relative;
}
.feed-content {
    color: var(--feed-ink);
    line-height: 1.65;
    font-size: 0.95rem;
}
.feed-content :first-child { margin-top: 0; }
.feed-content :last-child  { margin-bottom: 0; }

.feed-content--limited {
    position: relative;
    max-height: 132px;
    overflow: hidden;
}
.feed-content--limited::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 48px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--feed-card));
    pointer-events: none;
}
.feed-content--limited.feed-content--open {
    max-height: none;
    overflow: visible;
}
.feed-content--limited.feed-content--open::after {
    display: none;
}

/* ---------- Botão "Saiba mais" ---------- */
.feed-btn-more {
    background: none;
    border: none;
    color: var(--feed-blue-700);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    margin-top: 12px;
    display: inline-flex;
    align-items: center;
    transition: color 0.2s ease;
}
.feed-btn-more:hover { color: var(--feed-blue-900); }
.feed-btn-more:focus-visible {
    outline: 2px solid var(--feed-blue-700);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ---------- Rodapé do card ---------- */
.feed-footer {
    margin-top: 16px;
    padding-top: 5px;
    border-top: 1px solid var(--feed-line);
    display: flex;
    justify-content: flex-end;
    align-items: center;
}
.feed-link-sistema {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: var(--feed-blue-700);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    margin-right: auto; /* Empurra os botões de admin para a direita */
}
.feed-link-sistema:hover { 
    background-color: var(--feed-blue-700);
    color: #ffffff;
}

/* ---------- Estado vazio ---------- */
.feed-item--empty { padding-left: 0; }
.feed-card--empty {
    text-align: center;
    color: var(--feed-muted);
}
.feed-card--empty p { margin: 0; }

/* ---------- Paginação ---------- */
.feed-pagination {
    margin-top: 36px;
    display: flex;
    justify-content: center;
}

/* ---------- Alpine ---------- */
[x-cloak] { 
    display: none !important; 
}

/* ---------- Ações Admin ---------- */
.feed-admin-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}
.feed-btn-admin {
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s ease;
}
.feed-btn-admin--edit {
    background-color: var(--feed-blue-50, #e6f0fa);
    color: var(--feed-blue-700, #0055a5);
}
.feed-btn-admin--edit:hover {
    background-color: #d5e6f7;
}
.feed-btn-admin--delete {
    background-color: #fdecea;
    color: #c0392b;
}
.feed-btn-admin--delete:hover {
    background-color: #fbdad7;
}

/* ---------- Modais ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}
.modal-box {
    background: #fff;
    border-radius: 12px;
    padding: 28px;
    max-width: 560px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}
.modal-box--small {
    max-width: 420px;
}
.modal-title {
    margin: 0 0 16px;
    font-size: 1.2em;
    font-weight: 700;
    color: var(--feed-ink, #374151);
}
.modal-text {
    margin: 0 0 20px;
    color: var(--feed-muted, #6b7280);
    line-height: 1.5;
}
.cf-btn--danger {
    background-color: #c0392b;
    color: #fff;
}
.cf-btn--danger:hover {
    background-color: #a5322a;
}

/* ---------- Link Voltar ---------- */
.feed-voltar {
    display: inline-block;
    margin-bottom: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--feed-blue-700);
    text-decoration: none;
}
.feed-voltar:hover {
    color: var(--feed-blue-900);
    text-decoration: underline;
}

/* ---------- Barra de Busca ---------- */
.feed-busca {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
    align-items: center;
    background-color: #ffffff;
    padding: 8px;
    border-radius: 8px;
    /*box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    border: 1px solid var(--feed-line);
    /*box-shadow: 0 0 0 3px rgba(65, 92, 120, 0.059);*/
    /*transition: border-color 0.2s, box-shadow 0.2s;*/
}/*
.feed-busca:focus-within {
    /*border-color: var(--feed-blue-500);
    /*box-shadow: 0 0 0 3px rgba(30, 92, 153, 0.15);
}
.feed-busca-input {
    flex: 1;
    padding: 10px 14px;
    border: none;
    background: transparent;
    font-size: 0.95rem;
}*/
.feed-busca-input:focus {
    outline: none;
    box-shadow: none;
}

/* ---------- Visual de Inativo ---------- */
.feed-item--inativo .feed-card {
    opacity: 0.65;
    filter: grayscale(80%);
    background-color: #fbfbfc;
    border: 1px dashed #a0aec0;
}
.feed-item--inativo .feed-card:hover {
    opacity: 0.9;
    filter: grayscale(20%);
}
.feed-item--inativo .feed-marker {
    border-color: #9ca3af;
    background-color: #e5e7eb;
}

.sistema-item-badge {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background-color: #fdecea;
    color: #c0392b;
    padding: 4px 10px;
    border-radius: 999px;
}

/* ---------- Notícias Vinculadas / Contexto ---------- */
.feed-children-container {
    position: relative;
    margin-top: 12px;
    padding-left: 40px; 
    margin-bottom: 8px;
}

/* Criação da linha conectora (curva em formato de "L" deitado) */

/* Criação da linha conectora reajustada */
.feed-children-container::before {
    content: "";
    position: absolute;
    top: -16px;       /* Sobe menos, já que o espaço diminuiu */
    left: -9px;      
    width: 24px;      
    height: 36px;     /* Linha mais curta para acompanhar o novo espaçamento */
    border-left: 3px solid var(--feed-line);
    border-bottom: 3px solid var(--feed-line);
    border-bottom-left-radius: 12px;
    display: block !important; 
}
.feed-children-container::after {
    display: none !important;
}


.feed-card--child {
    background-color: #dcdcdc7d; 
    padding: 10px 25px; 
    border: 1px solid var(--feed-line);
    border-color: #a5a5a556;
    border-radius: 0 12px 12px 0;
    box-shadow: none; 
    border-radius: 10px;
}
.feed-card--child:hover {
    box-shadow: 0 4px 5px rgba(16, 24, 40, 0.04);
    transform: none; 
}

/* ---------- Responsivo e Acessibilidade ---------- */
@media (max-width: 900px) {
    .feed-wrapper { padding: 32px 16px 56px; }
}

@media (max-width: 640px) {
    .feed-hero { padding: 44px 16px 60px; }
    .feed-timeline::before { left: 7px; }
    .feed-item { padding-left: 32px; }
    .feed-marker { left: 0; top: 22px; }
    .feed-card { padding: 18px 18px; border-radius: 14px; }
    .feed-meta { gap: 6px; }
    .feed-children-container { padding-left: 24px; }
    .feed-children-container::before { left: -9px; width: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .feed-card,
    .feed-item--novo .feed-marker {
        transition: none;
        animation: none;
    }
}