/* ============================================
   PÁGINA DE DETALHES DA NOTÍCIA
   ============================================ */

/* Reset e variáveis */
:root {
    --background: #fafafa;
    --foreground: #333333;
    --card: #ffffff;
    --card-foreground: #333333;
    --muted: #f5f5f5;
    --muted-foreground: #737373;
    --primary: #0066cc;
    --primary-foreground: #ffffff;
    --secondary: #f0f4f8;
    --secondary-foreground: #333333;
    --border: #e5e5e5;
    --news-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --news-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.6;
    font-size: 16px;
}

main {
    contain: layout;
}

/* Container */
.news-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.news-header {
    border-bottom: 1px solid var(--border);
    background-color: var(--card);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    color: var(--foreground);
    text-decoration: none;
    border-radius: 6px;
    transition: background-color 0.2s;
    font-size: 14px;
    font-weight: 500;
}

.btn-back:hover {
    background-color: var(--secondary);
}

.btn-back i {
    font-size: 14px;
}

/* Botão voltar mobile */
.btn-back-mobile {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    color: var(--foreground);
    text-decoration: none;
    border-radius: 6px;
    transition: background-color 0.2s;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 16px;
    width: fit-content;
}

.btn-back-mobile:hover {
    background-color: var(--secondary);
}

.btn-back-mobile i {
    font-size: 14px;
}

/* Artigo principal */
.news-article {
    padding: 32px 0;
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Meta informações */
.news-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: nowrap;
}

.news-date {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted-foreground);
    font-size: 13px;
    white-space: nowrap;
}

.news-date i {
    font-size: 13px;
}

.btn-share {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background-color: transparent;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--foreground);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
}

.btn-share:hover {
    background-color: var(--secondary);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-share i {
    font-size: 13px;
}

/* Título */
.news-title {
    font-size: 32px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 24px;
    color: var(--foreground);
}

/* Lead/Descrição */
.news-lead {
    font-size: 18px;
    line-height: 1.7;
    color: var(--muted-foreground);
    margin-bottom: 32px;
    font-weight: 400;
}

/* Imagem */
.news-image-wrapper {
    margin: 40px 0;
    border-radius: 8px;
    overflow: hidden;
}

.news-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* Conteúdo */
.news-content {
    font-size: 18px;
    line-height: 1.8;
    color: var(--foreground);
    max-width: 100%;
}

.news-content p {
    margin-bottom: 24px;
}

.news-content h2 {
    font-size: 28px;
    font-weight: 700;
    margin-top: 48px;
    margin-bottom: 16px;
    color: var(--foreground);
    line-height: 1.3;
}

.news-content h3 {
    font-size: 24px;
    font-weight: 700;
    margin-top: 40px;
    margin-bottom: 16px;
    color: var(--foreground);
    line-height: 1.3;
}

.news-content ul,
.news-content ol {
    margin: 24px 0;
    padding-left: 32px;
}

.news-content li {
    margin-bottom: 12px;
    line-height: 1.7;
}

.news-content strong {
    font-weight: 600;
}

.news-content em {
    font-style: italic;
}

.news-content a {
    color: var(--primary);
    text-decoration: underline;
}

.news-content a:hover {
    text-decoration: none;
}

/* Galeria de Fotos */
.news-gallery {
    margin-top: 24px;
    margin-bottom: 32px;
}

.gallery-grid {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 16px;
    margin-top: 24px;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: var(--muted-foreground, #737373) var(--muted, #f5f5f5);
}

.gallery-grid.gallery-single {
    overflow-x: visible;
    justify-content: center;
}

.gallery-item {
    cursor: pointer;
    overflow: hidden;
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: var(--muted, #f5f5f5);
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: auto;
    flex: 0 0 auto;
    width: 350px;
    scroll-snap-align: start;
}

.gallery-item.gallery-item-single {
    width: 100%;
    max-width: 100%;
    flex: 1 1 100%;
    cursor: default;
    pointer-events: none;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.gallery-item.gallery-item-single:hover {
    transform: none;
    box-shadow: none;
}

.gallery-thumbnail {
    width: 100%;
    height: 350px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.gallery-item-single .gallery-thumbnail {
    height: auto;
    max-height: 600px;
    object-fit: contain;
}

.gallery-item:hover .gallery-thumbnail {
    transform: scale(1.05);
}

/* Modal da Galeria */
.gallery-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.gallery-modal.active {
    display: flex;
}

.gallery-modal-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
    cursor: default;
}

.gallery-modal-image {
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.gallery-modal-caption {
    color: white;
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
    padding: 0 20px;
}

.gallery-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 32px;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s;
}

.gallery-modal-close:hover {
    opacity: 0.7;
}

/* Scrollbar styling para galeria */
.gallery-grid::-webkit-scrollbar {
    height: 6px;
}

.gallery-grid::-webkit-scrollbar-track {
    background: var(--muted, #f5f5f5);
    border-radius: 3px;
}

.gallery-grid::-webkit-scrollbar-thumb {
    background: var(--muted-foreground, #737373);
    border-radius: 3px;
}

.gallery-grid::-webkit-scrollbar-thumb:hover {
    background: var(--foreground, #000);
}

@media (max-width: 768px) {
    .gallery-item {
        width: 200px;
    }
    
    .gallery-thumbnail {
        height: 200px;
    }
    
    .gallery-grid {
        gap: 12px;
    }
    
    .gallery-modal-content {
        max-width: 95%;
        max-height: 85%;
    }
    
    .gallery-modal-close {
        top: -50px;
        font-size: 28px;
    }
}

/* Rodapé do artigo */
.news-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.section-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--foreground);
}

.gallery-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--muted-foreground, #737373);
    display: flex;
    align-items: center;
    gap: 8px;
}

.gallery-title i {
    font-size: 18px;
    color: var(--primary, #0066cc);
}

.gallery-subtitle {
    font-size: 14px;
    color: var(--muted-foreground, #737373);
    margin-top: -12px;
    margin-bottom: 16px;
    font-weight: 400;
}

/* Cards de notícias relacionadas */
.news-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 64px;
}

/* Scroll horizontal no mobile */
@media (max-width: 768px) {
    .news-cards-grid {
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 16px;
        margin-bottom: 48px;
        margin-left: -16px;
        margin-right: -16px;
        padding-left: 20px;
        padding-right: 16px;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x mandatory;
    }
    
    /* Garantir espaço à esquerda do primeiro card */
    .news-cards-grid > .news-card:first-child {
        margin-left: 8px;
    }
    
    .news-cards-grid::-webkit-scrollbar {
        height: 4px;
    }
    
    .news-cards-grid::-webkit-scrollbar-track {
        background: var(--muted);
        border-radius: 2px;
    }
    
    .news-cards-grid::-webkit-scrollbar-thumb {
        background: var(--muted-foreground);
        border-radius: 2px;
    }
    
    .news-card {
        flex: 0 0 85%;
        max-width: 280px;
        scroll-snap-align: start;
    }
}

.news-card {
    display: block;
    background-color: var(--card);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--news-shadow);
    transition: all 0.3s;
    text-decoration: none;
    color: inherit;
}

.news-card {
    text-decoration: none !important;
}

.news-card:hover {
    box-shadow: var(--news-shadow-hover);
    transform: translateY(-2px);
}

.news-card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background-color: var(--muted);
}

.news-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.news-card:hover .news-card-image img {
    transform: scale(1.05);
}

.news-card-content {
    padding: 20px;
}

.news-card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--foreground);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
    text-decoration: none !important;
}

.news-card:hover .news-card-title {
    color: var(--primary);
}

.news-card-description {
    font-size: 14px;
    color: var(--muted-foreground);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-decoration: none !important;
}

.news-card-content {
    text-decoration: none !important;
}

/* Lista de mais notícias */
.news-more {
    margin-top: 48px;
}

.news-more-header {
    margin-bottom: 24px;
}

.news-more-list {
    background-color: var(--card);
    border-radius: 8px;
    padding: 24px;
    box-shadow: var(--news-shadow);
}

.news-more-item {
    display: block;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    margin: 0 -12px;
    padding-left: 12px;
    padding-right: 12px;
    border-radius: 6px;
}

.news-more-item:last-child {
    border-bottom: none;
}

.news-more-item:hover {
    background-color: var(--secondary);
}

.news-more-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--foreground);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s;
}

.news-more-item:hover .news-more-title {
    color: var(--primary);
}

.news-more-date {
    font-size: 12px;
    color: var(--muted-foreground);
}

.news-more-footer {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.btn-all-news {
    display: inline-block;
    padding: 12px 32px;
    background-color: var(--primary);
    color: var(--primary-foreground);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 16px;
    transition: background-color 0.2s;
}

.btn-all-news:hover {
    background-color: #0052a3;
}

/* Responsive */
@media (max-width: 768px) {
    .news-header {
        display: none;
    }
    
    .btn-back-mobile {
        display: inline-flex;
    }
    
    .news-container {
        padding: 0 16px;
    }
    
    .news-article {
        padding: 24px 0;
    }
    
    .news-title {
        font-size: 24px;
        margin-bottom: 16px;
    }
    
    .news-lead {
        font-size: 16px;
        margin-bottom: 24px;
    }
    
    .news-image-wrapper {
        margin: 32px 0;
    }
    
    .news-content {
        font-size: 16px;
    }
    
    .news-content h2 {
        font-size: 22px;
        margin-top: 32px;
    }
    
    .news-content h3 {
        font-size: 20px;
        margin-top: 28px;
    }
    
    .section-title {
        font-size: 24px;
        margin-bottom: 20px;
    }
    
    .news-more-list {
        padding: 20px;
    }
    
    .news-more-item {
        padding: 12px 0;
    }
    
    .news-meta {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .news-title {
        font-size: 22px;
    }
    
    .news-lead {
        font-size: 15px;
    }
    
    .news-content {
        font-size: 15px;
    }
    
    .section-title {
        font-size: 20px;
    }
}

/* ============================================
   CSS INLINE EXTRAÍDO DE noticia.php
   ============================================ */

/* SVG Icons */
.icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    fill: currentColor;
    vertical-align: middle;
}

/* CSS crítico para primeira renderização */
body {
    margin: 0;
    font-family: Inter, sans-serif;
}



.news-title {
    font-size: 2rem;
    font-weight: 700;
    margin: 20px 0;
}

.news-lead {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 20px;
}

.news-image-wrapper {
    width: 100%;
    margin: 20px 0;
}

.news-image {
    width: 100%;
    height: auto;
    display: block;
}

/* CSS para controles de acessibilidade */
.accessibility-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-share {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background-color: transparent;
    border: 1px solid var(--border, #e5e5e5);
    border-radius: 6px;
    color: var(--foreground, #333);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    white-space: nowrap;
    height: auto;
    box-sizing: border-box;
}

.btn-share:hover {
    background-color: var(--secondary, #f0f4f8);
    border-color: var(--primary, #0066cc);
    color: var(--primary, #0066cc);
}

.btn-share:focus {
    outline: 2px solid var(--primary, #0066cc);
    outline-offset: 2px;
}

.btn-share i {
    font-size: 13px;
}

