/* Modal de Detalhes do Jornal - Tema Premium Marrom/Dourado
     Mantém markup e layout originais, apenas aplica identidade visual.
     Cores principais: marrom (#6a4f00), dourado (#d4a574), destaque (#f4d03f)
*/

:root {
    --phc-brown: #6a4f00;
    --phc-gold: #d4a574;
    --phc-highlight: #f4d03f;
    --phc-dark: #3b2f19;
    --phc-muted: #6c757d;
}

/* Header (sem gradiente - cor sólida) */
#modalDetalhesJornal .modal-header {
    background-color: var(--phc-gold);
    color: var(--phc-dark);
    border-bottom: 2px solid rgba(106,79,0,0.12);
}

#modalDetalhesJornal .modal-header h5 {
    color: var(--phc-dark);
    font-weight: 700;
    text-shadow: none;
}

#modalDetalhesJornal .modal-header small {
    color: rgba(59,47,25,0.8);
}

/* Close button: exibir X preto e manter funcionalidade data-bs-dismiss */
#modalDetalhesJornal .btn-close {
    background-image: none !important;
    border: none !important;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: rgba(255,255,255,0.9);
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    padding: 0;
    cursor: pointer;
}

#modalDetalhesJornal .btn-close::after {
    content: '✕';
    font-size: 1.05rem;
    color: #000;
    line-height: 1;
    font-weight: 700;
}

#modalDetalhesJornal .btn-close:hover {
    background: rgba(0,0,0,0.06);
}

#modalDetalhesJornal .btn-close:focus {
    outline: 3px solid rgba(106,79,0,0.12);
}

/* Make the modal box match the newspapers list card style */
#modalDetalhesJornal .modal-content {
    background: #fff; /* same as .jornais-lista-container */
    border-radius: 12px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
    border: none;
    overflow: hidden;
}

/* Keep header visual but align spacing with card style */
#modalDetalhesJornal .modal-header {
    padding: 18px 20px;
}

#modalDetalhesJornal .modal-body {
    padding: 22px !important;
}

/* Body */
#modalDetalhesJornal .modal-body {
    background: linear-gradient(180deg, #fff 0%, #fffaf6 100%);
    color: var(--phc-dark);
}

#modalDetalhesJornal .modal-body h6 {
    color: var(--phc-brown);
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

#modalDetalhesJornal .modal-body p {
    color: #232323;
    line-height: 1.7;
}

/* Capa do Jornal */
#modal-capa-container {
    transition: transform 0.28s cubic-bezier(.2,.9,.2,1), box-shadow 0.28s;
    border: 1px solid rgba(106,79,0,0.06);
    background: linear-gradient(180deg, rgba(250,245,235,0.5), rgba(255,255,255,0.6));
}

#modal-capa-jornal {
    box-shadow: 0 6px 24px rgba(106,79,0,0.12);
    transition: transform 0.28s ease;
    max-height: 300px;
}

#modal-capa-jornal:hover {
    transform: translateY(-4px) scale(1.01);
}

#modal-capa-placeholder {
    color: rgba(59,47,25,0.5);
}

/* Estatísticas e tabelas */
#modalDetalhesJornal .table {
    margin-bottom: 0;
}

#modalDetalhesJornal .table td {
    padding: 0.55rem 0.75rem;
    font-size: 0.95rem;
}

#modalDetalhesJornal .table .text-muted {
    color: var(--phc-muted) !important;
}

#modalDetalhesJornal .table .fw-bold {
    color: var(--phc-dark);
    font-weight: 700;
}

/* Footer */
#modalDetalhesJornal .modal-footer {
    background: linear-gradient(90deg, rgba(250,245,235,0.6), rgba(255,255,255,0.8));
    border-top: 2px solid rgba(212,165,116,0.12);
}

/* Primary action button - Ver Edições */
#modal-btn-ver-edicoes {
    background: linear-gradient(90deg, var(--phc-gold), var(--phc-highlight));
    color: #3b2f19;
    border: 1px solid rgba(59,47,25,0.06);
    box-shadow: 0 8px 20px rgba(106,79,0,0.12);
}

#modal-btn-ver-edicoes:hover {
    transform: translateY(-2px);
    filter: brightness(1.02);
}

/* Secondary button */
#modalDetalhesJornal .btn-secondary {
    background: #f4f4f4;
    color: #333;
    border: 1px solid rgba(0,0,0,0.06);
}

/* Small utility styles kept for compatibility with existing markup */
.card-img-top-wrapper {
    border-bottom: 1px solid rgba(0,0,0,0.04);
}

.card-img-top {
    transition: transform 0.3s ease;
}

.card:hover .card-img-top {
    transform: scale(1.03);
}

/* Responsive tweaks */
@media (max-width: 768px) {
    #modalDetalhesJornal .modal-body {
        padding: 1.25rem !important;
    }
    #modal-capa-container { min-height: 200px !important; }
    #modal-capa-jornal { max-height: 240px; }
}

/* Accessibility: focus states */
#modalDetalhesJornal .btn:focus, #modal-btn-ver-edicoes:focus {
    outline: 3px solid rgba(212,165,116,0.25);
    outline-offset: 2px;
}

/* Subtle decorative divider */
#modalDetalhesJornal .modal-body hr {
    border-color: rgba(106,79,0,0.06);
}

/* Ensure modal content scrolls internally and page stays fixed while open */
#modalDetalhesJornal .modal-dialog {
    max-width: 920px;
    margin: 1.5rem auto;
}

#modalDetalhesJornal .modal-content {
    display: flex;
    flex-direction: column;
    max-height: 90vh; /* keep modal within viewport */
}

#modalDetalhesJornal .modal-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
    padding: 20px 22px !important;
}

#modalDetalhesJornal .modal-header,
#modalDetalhesJornal .modal-footer {
    flex: 0 0 auto;
}

/* Ensure body doesn't scroll when modal is open (reinforce Bootstrap behaviour) */
body.modal-open {
    overflow: hidden;
}
