/**
 * IPDSA Serviços - Estilos
 * Cores: Azul #005d86 | Laranja #f89b1e
 * Fonte: Montserrat
 */

/* ============================================
   GRID DE SERVIÇOS PRINCIPAIS
   ============================================ */

.ipdsa-servicos-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 30px 0;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.ipdsa-servico-card {
    position: relative;
    background: #e8e8e8;
    border-radius: 0;
    padding: 30px;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

/* Primeira card - Destaque Principal (azul escuro) */
.ipdsa-servico-card.destaque-principal {
    background: #005d86;
    color: white;
}

.ipdsa-servico-card.destaque-principal .servico-titulo {
    color: white;
}

.ipdsa-servico-card.destaque-principal .servico-resumo {
    color: rgba(255, 255, 255, 0.9);
}

/* Hover effect nos cards */
.ipdsa-servico-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Conteúdo do card */
.servico-content {
    flex: 1;
}

.servico-titulo {
    font-size: 18px;
    font-weight: 700;
    color: #005d86;
    margin: 0 0 15px 0;
    line-height: 1.3;
}

.servico-resumo {
    font-size: 16px;
    color: #666;
    line-height: 1.6;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Botão '+' no canto inferior direito */
.servico-btn-abrir {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 60px;
    height: 60px;
    background: #005d86;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 0 10px 10px 0;
    color: white;
    transition: all 0.3s ease;
    clip-path: polygon(100% 0, 100% 100%, 0 100%);
    z-index: 10;
    pointer-events: auto;
}

.ipdsa-servico-card.destaque-principal .servico-btn-abrir {
    background: #f89b1e;
}

/* Animação do botão no hover */
.ipdsa-servico-card:hover .servico-btn-abrir {
    transform: translate(5px, 5px);
}

.servico-btn-abrir svg {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
    pointer-events: none;
}

.ipdsa-servico-card:hover .servico-btn-abrir svg {
    transform: rotate(90deg);
}

/* ============================================
   DESTAQUES
   ============================================ */

.ipdsa-destaques-lista {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 30px 0;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.ipdsa-destaque-item {
    background: #f5f5f5;
    padding: 25px 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid #f89b1e;
}

.ipdsa-destaque-item:hover {
    background: #fff;
    padding-left: 40px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.destaque-content {
    max-width: 100%;
}

.destaque-titulo {
    font-size: 18px;
    font-weight: 700;
    color: #005d86;
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.destaque-resumo {
    font-size: 16px;
    color: #8b8b8b;
    line-height: 1.6;
    margin: 0 0 12px 0;
}

.destaque-categorias {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.categoria-tag {
    display: inline-block;
    padding: 8px 16px;
    background: #ffffff;
    color: #005e87;
    font-size: 16px;
    font-style: italic;
    font-weight: 400;
    border-radius: 0;
    border: none;
    box-shadow: none;
}

.destaque-divider {
    display: none;
}

/* ============================================
   MODAL POPUP
   ============================================ */

.ipdsa-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.ipdsa-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    animation: fadeIn 0.3s ease;
}

.ipdsa-modal-content {
    position: relative;
    background: white;
    max-width: 800px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    z-index: 1;
}

.ipdsa-modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: #f89b1e;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s ease;
    z-index: 10;
}

.ipdsa-modal-close:hover {
    background: #005d86;
    transform: rotate(90deg);
}

.ipdsa-modal-header {
    background: #005d86;
    color: white;
    padding: 30px 40px;
    border-radius: 8px 8px 0 0;
}

.ipdsa-modal-header h2 {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.3;
    padding-right: 50px;
}

.ipdsa-modal-body {
    padding: 40px;
}

.modal-descricao {
    font-size: 15px;
    line-height: 1.8;
    color: #333;
    margin-bottom: 30px;
}

.modal-descricao p {
    margin-bottom: 15px;
}

.modal-descricao strong,
.modal-descricao b {
    color: #005d86;
}

.modal-info-container {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #f89b1e;
}

.modal-info-section {
    margin-bottom: 25px;
}

.modal-info-section h3 {
    font-size: 18px;
    font-weight: 700;
    color: #005d86;
    margin: 0 0 15px 0;
}

.modal-info-item {
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.6;
}

.modal-info-item strong {
    color: #005d86;
    font-weight: 600;
    display: inline-block;
    min-width: 120px;
}

.modal-info-item a {
    color: #f89b1e;
    text-decoration: none;
    transition: color 0.3s ease;
}

.modal-info-item a:hover {
    color: #005d86;
    text-decoration: underline;
}

.modal-info-item p {
    margin: 5px 0 0 0;
    color: #666;
}

.btn-link-externo,
.btn-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    background: #f89b1e;
    color: white !important;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.4;
    transition: background-color 0.2s ease;
    margin-top: 10px;
    border: none;
    cursor: pointer;
}

.btn-link-externo:hover,
.btn-download:hover {
    background: #e68a0f;
    color: white !important;
    text-decoration: none;
}

.btn-link-externo:active,
.btn-download:active {
    background: #d47d0d;
}

.btn-link-externo:visited,
.btn-download:visited {
    color: white !important;
}

.btn-link-externo svg,
.btn-download svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.btn-link-externo:hover svg,
.btn-download:hover svg {
    transform: translateX(3px);
}

/* ============================================
   ANIMAÇÕES
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   RESPONSIVIDADE
   ============================================ */

/* Tablets */
@media (max-width: 992px) {
    .ipdsa-servicos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .ipdsa-servico-card {
        min-height: 200px;
        padding: 25px;
    }

    .servico-titulo {
        font-size: 16px;
    }

    .servico-resumo {
        font-size: 13px;
    }

    .ipdsa-modal-content {
        max-width: 95%;
    }

    .ipdsa-modal-header {
        padding: 25px 30px;
    }

    .ipdsa-modal-header h2 {
        font-size: 22px;
    }

    .ipdsa-modal-body {
        padding: 30px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .ipdsa-servicos-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .ipdsa-servico-card {
        min-height: 180px;
        padding: 20px;
    }

    .ipdsa-destaque-item {
        padding: 20px;
    }

    .ipdsa-destaque-item:hover {
        padding-left: 25px;
    }

    .destaque-titulo {
        font-size: 15px;
    }

    .destaque-resumo {
        font-size: 13px;
    }

    .categoria-tag {
        font-size: 11px;
        padding: 4px 12px;
    }

    .ipdsa-modal-content {
        max-width: 95%;
        max-height: 90vh;
    }

    .ipdsa-modal-header {
        padding: 20px;
    }

    .ipdsa-modal-header h2 {
        font-size: 20px;
        padding-right: 40px;
    }

    .ipdsa-modal-body {
        padding: 20px;
    }

    .modal-descricao {
        font-size: 14px;
    }

    .modal-info-item strong {
        display: block;
        margin-bottom: 5px;
        min-width: auto;
    }

    .btn-link-externo,
    .btn-download {
        width: 100%;
        justify-content: center;
    }
}

/* Acessibilidade */
.ipdsa-servico-card:focus,
.ipdsa-destaque-item:focus,
.servico-btn-abrir:focus,
.ipdsa-modal-close:focus {
    outline: 3px solid #f89b1e;
    outline-offset: 2px;
}
