/* Basic styling for nucleo-comunicacao-grid */
.nucleo-comunicacao-grid {
    display: grid;
    /* 2 colunas quando houver espaço, 1 coluna quando não houver */
    grid-template-columns: repeat(auto-fit, minmax(22.5rem, 1fr));
    gap: 1.5rem 0.4375rem;
    padding: 0.3125rem 0;
    margin-left: -0.3125rem;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 47.9375rem) {
    .nucleo-comunicacao-grid {
        grid-template-columns: 1fr;
    }
}

.wrapper{
    margin: 0;
}

.wrapper.container {
        padding: 0 !important;
        margin:0;
    }

/* Styling for individual nucleo items */
.nucleo-item {
    border: 0.0625rem solid #eee;
    padding: 0.9375rem;
    border-radius: 1rem;
    background-color: #fff;
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.05);
    min-height: 12.8125rem;
    max-height: 12.8125rem;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
}

/* Fallback: se os cards forem renderizados sem o wrapper grid,
   eles ainda ficam em 2 colunas no desktop. */
@media (min-width: 48rem) {
    .nucleo-item {
        display: inline-block;
        vertical-align: top;
        width: calc(50% - 0.625rem);
        margin: 0 0.4375rem 1.5rem 0;
    }
}

@media (max-width: 47.9375rem) {
    .nucleo-item {
        display: block;
        width: 100%;
        margin: 0 0 1.5rem 0;
    }
}

/* Quando o wrapper grid existe, deixe o grid controlar os itens */
.nucleo-comunicacao-grid .nucleo-item {
    display: block;
    width: 100%;
    margin: 0;
}

.nucleo-orgao-header {
    height: 3.125rem;
    margin-bottom: 1.25rem;
}

.nucleo-pessoa-info {
    height: 3.1875rem;
    margin-bottom: 0.625rem;
}

.nucleo-item a.nucleo-contact-info {
    width: 100%;
    max-width: none;
    height: 2.5rem;
    gap: 1rem; /* This gap will only apply if it's a flex/grid container */
    border-radius: 1rem;
    background: #E9F6EB;
    display: flex; /* Make it a flex container to use gap and center text */
    align-items: center; /* Vertically center text */
    justify-content: center; /* Horizontally center text */
    font-family: Kanit;
    font-weight: 500;
    font-size: 1rem;
    line-height: 100%;
    letter-spacing: 0%;
    color: #1B7727;
    text-decoration: none; /* Remove underline for link */
    margin-top: 1rem;
}

@media (max-width: 24.375rem) {
    .nucleo-item a.nucleo-contact-info {
        max-width: 22.375rem;
    }
}

/* Modal Styles */
.nucleo-modal-overlay {
    display: none; /* Reverted */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
}

.nucleo-modal {
    display: none; /* Reverted */
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #fff;
    padding: 1rem;
    border-radius: 1rem;
    border: 0.0625rem solid #ccc;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.2);
    z-index: 1001;
    width: 34.375rem;
    height: 23.6875rem;
    /* Reverted display: flex, flex-direction, gap */
}

.nucleo-modal-body {
    /* Reverted display: flex, flex-direction, gap, flex-grow */
}

.modal-section {
    /* Base styles for sections if needed */
}

.modal-contato-info {
    /* Reverted display: flex, flex-direction, gap */
}

.contato-item {
    flex: 1;
    margin-bottom: 0.9375rem;
}

.contato-item h4 {
    font-family: Kanit;
    font-weight: 300;
    font-size: 1rem;
    line-height: 132%;
    letter-spacing: 0%;
    color: #929292;
    margin: 0 0 0 0; /* Keep existing margin */
}

#nucleo-modal-email,
#nucleo-modal-tel,
#nucleo-modal-email a,
#nucleo-modal-tel a {
    font-family: Kanit;
    font-weight: 400;
    font-size: 1.25rem;
    line-height: 100%;
    letter-spacing: 0%;
    text-decoration: underline;
    text-decoration-style: solid;
    text-decoration-offset: 0%;
    text-decoration-thickness: 0%;
    color: #239832;
    margin: 0.0625rem;
}

.nucleo-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.9375rem;
}

.nucleo-modal-header h3 {
    margin: 0;
    font-size: 1.5em;
}

#nucleo-modal-title {
    font-family: Kanit;
    font-weight: 500;
    font-size: 1.5rem;
    line-height: 140%;
    letter-spacing: 0%;
    color: #3C4650;
    margin: 0; /* Override default h3 margin */
}

.nucleo-modal-orgao-desc {
    font-size: 0.9em;
    color: #666;
    margin-top: 0.3125rem;
}

#nucleo-modal-orgao-desc {
    font-family: Kanit;
    font-weight: 300;
    font-size: 0.875rem;
    line-height: 100%;
    letter-spacing: 0%;
    color: #3C4650;
    margin-bottom: 0.625rem;
}

.nucleo-modal-close-x {
    background: none;
    border: none;
    font-size: 2em;
    cursor: pointer;
    line-height: 1;
}

.nucleo-modal-body p {
    margin: 0.625rem 0;
}


/* Responsive Modal */
@media (max-width: 40rem) {
    .nucleo-modal {
        width: calc(100% - 2rem);
        padding: 1rem;
    }
    .nucleo-modal-header h3 {
        font-size: 1.2em;
    }
}

.nucleo-item h3 {
    font-family: Kanit;
    font-weight: 500;
    font-size: 1.5rem;
    line-height: 140%;
    letter-spacing: 0%;
    color: #3C4650;
    margin-top: 0; 
    margin:0;
}

.nucleo-item h4 {
    font-family: Kanit;
    font-weight: 300;
    font-size: 0.875rem;
    line-height: 100%;
    letter-spacing: 0%;
    color: #3C4650;
    margin-bottom: 0.625rem; /* Keep existing margin-bottom */
}

.nucleo-item p {
    margin: 0.125rem 0;
    font-size: 1rem;
    color: #555;
}

.nucleo-pessoa-info p:nth-of-type(1) { /* Styling for cargo */
    font-family: Kanit;
    font-weight: 300;
    font-size: 1rem;
    line-height: 132%;
    letter-spacing: 0%;
    color: #929292;
    margin-bottom: 0;
}

#nucleo-modal-cargo {
    font-family: Kanit;
    font-weight: 300;
    font-size: 1rem;
    line-height: 132%;
    letter-spacing: 0%;
    color: #929292;
    margin-bottom: 0;
}

.nucleo-pessoa-info p:nth-of-type(2) strong { /* Styling for nome */
    font-family: Kanit;
    font-weight: 400;
    font-size: 1.25rem;
    line-height: 100%;
    letter-spacing: 0%;
    color: #3C4650;
    margin-top: 0;
}

#nucleo-modal-nome {
    font-family: Kanit;
    font-weight: 400;
    font-size: 1.25rem;
    line-height: 100%;
    letter-spacing: 0%;
    color: #3C4650;
    margin-top: 1;
}

.nucleo-item a {
    color: #0073aa; /* WordPress primary blue */
    text-decoration: none;
}@media (max-width: 35.4375rem) {
    .nucleo-comunicacao-grid {
        gap: 1.5rem;
        padding: 0 0.625rem;
    }
}

.nucleo-item a:hover {

}

.comunicacao-wrapper {
    display: flex;
    background: #F8F8F8;
    border-radius: 0.625rem;
    gap: 2.8125rem;
    max-width: 100%;
    margin-top: 1.25rem;
    margin-bottom: 2.5rem;
    margin-left: 0;
}

@media (max-width: 47.9375rem) {
    .comunicacao-wrapper {
        margin-left: 0.75rem;
    }
}

.comunicacao-coluna {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.comunicacao-divisoria {
    width: 0;
    border-left: 0.0625rem solid #C5C5C5;
    opacity: 1;
}
.comunicacao-setor {
    font-family: Kanit, sans-serif;
    font-weight: 300;
    font-style: normal;
    font-size: 1rem;
    line-height: 132%;
    color: #929292;
    margin-top: 0.75rem !important;
    white-space: nowrap;
}
.comunicacao-nome {
    font-family: Kanit, sans-serif;
    font-weight: 400;
    font-style: normal;
    font-size: 1.25rem;
    line-height: 100%;
    color: #465564;
    margin-bottom: 0.125rem;
}

/* ====== Alto Contraste ====== */
body.body-contraste .nucleo-item {
    background-color: #000 !important;
    border: 1px solid #fff !important;
    color: #fff !important;
}

body.body-contraste .nucleo-item h3,
body.body-contraste .nucleo-item h4,
body.body-contraste #nucleo-modal-title,
body.body-contraste #nucleo-modal-nome {
    color: #fff !important;
}

body.body-contraste .nucleo-pessoa-info p:nth-of-type(1),
body.body-contraste .nucleo-pessoa-info p:nth-of-type(2) strong,
body.body-contraste .contato-item h4,
body.body-contraste #nucleo-modal-cargo,
body.body-contraste #nucleo-modal-orgao-desc {
    color: #fff !important;
}

body.body-contraste .nucleo-item a.nucleo-contact-info {
    background: #000 !important;
    border: 1px solid #fff !important;
    color: #fff !important;
}

body.body-contraste .nucleo-item a.nucleo-contact-info:hover {
    background: #333 !important;
}

body.body-contraste .nucleo-modal {
    background-color: #000 !important;
    border: 1px solid #fff !important;
    color: #fff !important;
}

body.body-contraste #nucleo-modal-email,
body.body-contraste #nucleo-modal-tel,
body.body-contraste #nucleo-modal-email a,
body.body-contraste #nucleo-modal-tel a {
    color: #fff !important;
    text-decoration: underline !important;
}

body.body-contraste .nucleo-modal-close-x {
    color: #fff !important;
}

body.body-contraste .comunicacao-wrapper {
    background-color: #000 !important;
    border: none !important;
}

body.body-contraste .comunicacao-nome,
body.body-contraste .comunicacao-setor {
    color: #fff !important;
}

body.body-contraste .comunicacao-divisoria {
    border-color: #fff !important;
}

@media (max-width: 50rem) {
    .comunicacao-wrapper {
        flex-direction: column;
        gap: 1rem;
    }
    .comunicacao-divisoria {
        display: none;
    }
}