/* ==========================================================================
   calendar-year-shared.css — patterns visuais compartilhados (BR)
   Porte fiel do calendar-year.css/calendrier.css/climate-heatmap.css do site
   piloto FR (joursouvrables.fr) para o contadordeprazo.com.br.

   Inclui:
   - .cm-tool-actions (barra de exportação Imprimir/PDF/Compartilhar)
   - .cal-section-title (título de seção sem decoração)
   - .cal-table-data (tabela rica para listagens)
   - .year-sectoral-section (seção setorial flat)
   - .cal-months-with-holidays + .cf-month-cell (rowspan agrupado)
   - .dynamic-facts-box (override flat — sem card por seção)
   - .facts-list, .two-col-grid-list, .holiday-date
   - .agro-badge, .agro-legend
   - .lunar-year-grid, .lunar-month-card (override harmonizado com FR)
   - .cal-year-hero (hero azul pleno — usado em dias-uteis.php?modo=mes)
   - .climate-heatmap (heatmap 5 regiões BR)

   Carregado APENAS pelas páginas reformadas (calendario.php?ano,
   dias-uteis.php?ano, dias-uteis.php?mes). Não impacta o resto do site.
   ========================================================================== */


/* ==========================================================================
   CAL-SECTION-TITLE — título de seção sobrio, sem sublinhado decorativo.
   ========================================================================== */
.cal-section-title {
    margin-top: 0;
    margin-bottom: 14px;
    padding-bottom: 0;
    font-size: 1.32rem;
    font-weight: 800;
    letter-spacing: -0.015em;
    line-height: 1.2;
    color: var(--text-color, #1d1d1f);
}
.cal-section-title::after { content: none; }


/* ==========================================================================
   CAL-TABLE-DATA — tabela rica para listagens (feriados, prolongados, etc).
   ========================================================================== */
.cal-table-data {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border: 1px solid #d9e4f0;
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.cal-table-data thead th {
    background: linear-gradient(180deg, #edf6ff 0%, #dcecff 100%);
    color: #143252;
    font-weight: 800;
    font-size: 0.92rem;
    text-align: left;
    padding: 14px 16px;
    border-bottom: 1px solid #c9dbef;
}

.cal-table-data th,
.cal-table-data td {
    padding: 12px 16px;
    vertical-align: middle;
    border-bottom: 1px solid #e6eef7;
}

.cal-table-data tbody tr:nth-child(even) {
    background: #f9fcff;
}

.cal-table-data tbody tr:last-child td {
    border-bottom: 0;
}

.cal-table-data .cal-table-date {
    font-weight: 600;
    white-space: nowrap;
    color: #0071e3;
}

.cal-table-data td:first-child {
    min-width: 80px;
    width: auto;
    white-space: normal;
}
.cal-table-data td:nth-child(2) {
    white-space: nowrap;
}

body.dark-mode .cal-table-data {
    background: #1c1c1e;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}
body.dark-mode .cal-table-data thead th {
    background: linear-gradient(180deg, rgba(100, 181, 255, 0.12) 0%, rgba(100, 181, 255, 0.06) 100%);
    color: #f5f5f7;
    border-bottom-color: rgba(255, 255, 255, 0.08);
}
body.dark-mode .cal-table-data th,
body.dark-mode .cal-table-data td {
    border-bottom-color: rgba(255, 255, 255, 0.05);
    color: #f5f5f7;
}
body.dark-mode .cal-table-data tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}
body.dark-mode .cal-table-data .cal-table-date { color: #64b5ff; }

/* Wrapper para scroll horizontal em mobile */
.cal-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 18px;
    margin: 12px 0 20px;
}

@media (max-width: 720px) {
    .cal-table-data {
        font-size: 0.92rem;
    }
    .cal-table-data th,
    .cal-table-data td {
        padding: 10px 12px;
    }
}


/* ==========================================================================
   CM-TOOL-ACTIONS — barra de exportação sob o calendário.
   Padrão unificado: 3 botões CTA em grid, head label discreto.
   ========================================================================== */
.cm-tool-actions {
    margin-top: 18px;
    padding: 14px 14px 12px;
    background: #f8fafc;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    box-sizing: border-box;
}
.cm-tool-actions__head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
}
.cm-tool-actions__head i { color: #0071e3; }
.cm-tool-actions__buttons {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
/* Override .btn-action legacy para padrão FR */
.cm-tool-actions__buttons .btn-action {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 10px 14px !important;
    background: #fff !important;
    background-color: #fff !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    border-radius: 10px !important;
    color: #0f172a !important;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease, background 0.15s ease !important;
    text-align: left;
    box-shadow: none !important;
    width: auto !important;
    min-height: 0 !important;
    font-weight: 400 !important;
    font-size: inherit !important;
}
.cm-tool-actions__buttons .btn-action:hover,
.cm-tool-actions__buttons .btn-action:focus-visible {
    background: #f8fafc !important;
    background-color: #f8fafc !important;
    border-color: rgba(0, 113, 227, 0.4) !important;
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.12) !important;
    transform: translateY(-1px) !important;
    outline: none;
    color: #0f172a !important;
}
.cm-tool-actions__buttons .btn-action .icon {
    flex-shrink: 0;
    color: #0071e3;
    display: inline-flex;
    align-items: center;
    font-size: 1em !important;
}
.cm-tool-actions__buttons .btn-action.btn-print .icon { color: #0071e3; }
.cm-tool-actions__buttons .btn-action.btn-custom-pdf .icon { color: #dc2626; }
.cm-tool-actions__buttons .btn-action.btn-share .icon { color: #0071e3; }
.cm-tool-actions__label {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
}
.cm-tool-actions__label strong {
    font-size: 0.92rem;
    font-weight: 700;
    color: #0f172a;
}
.cm-tool-actions__label small {
    font-size: 0.72rem;
    font-weight: 500;
    color: #64748b;
    margin-top: 2px;
}

body.dark-mode .cm-tool-actions {
    background: #111827;
    border-color: rgba(255, 255, 255, 0.08);
}
body.dark-mode .cm-tool-actions__head { color: #aeaeb2; }
body.dark-mode .cm-tool-actions__head i { color: #64b5ff; }
body.dark-mode .cm-tool-actions__buttons .btn-action,
body.dark-mode .cm-tool-actions__buttons .btn-action.btn-print,
body.dark-mode .cm-tool-actions__buttons .btn-action.btn-custom-pdf,
body.dark-mode .cm-tool-actions__buttons .btn-action.btn-share {
    background: #1c1c1e !important;
    background-color: #1c1c1e !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    color: #f5f5f7 !important;
}
body.dark-mode .cm-tool-actions__buttons .btn-action:hover,
body.dark-mode .cm-tool-actions__buttons .btn-action:focus-visible,
body.dark-mode .cm-tool-actions__buttons .btn-action.btn-print:hover,
body.dark-mode .cm-tool-actions__buttons .btn-action.btn-custom-pdf:hover,
body.dark-mode .cm-tool-actions__buttons .btn-action.btn-share:hover {
    background: #2c2c2e !important;
    background-color: #2c2c2e !important;
    border-color: rgba(100, 177, 255, 0.4) !important;
    box-shadow: 0 4px 12px rgba(100, 177, 255, 0.18) !important;
    color: #f5f5f7 !important;
}
body.dark-mode .cm-tool-actions__buttons .btn-action .icon { color: #64b5ff; }
body.dark-mode .cm-tool-actions__buttons .btn-action.btn-custom-pdf .icon { color: #ff6b6b; }
body.dark-mode .cm-tool-actions__label strong { color: #f5f5f7; }
body.dark-mode .cm-tool-actions__label small { color: #aeaeb2; }

@media (max-width: 720px) {
    .cm-tool-actions__buttons { grid-template-columns: 1fr; }
}

/* Variante --year : mode ano, alinhada ao calendário (full width). */
.cm-tool-actions--year {
    width: 100%;
    margin-top: 24px;
    margin-bottom: 24px;
    box-sizing: border-box;
}


/* ==========================================================================
   AGRO-BADGE — pastilhas para calendário agrícola (mode ano).
   ========================================================================== */
.agro-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    color: #ffffff;
    box-sizing: border-box;
    text-align: center;
    vertical-align: middle;
}

.agro-badge--S { background: #34c759; } /* Semeadura = verde */
.agro-badge--C { background: #ff9500; } /* Colheita = laranja */
.agro-badge--F { background: #af52de; } /* Floração = roxo */
.agro-badge--D { background: #007aff; } /* Desenvolvimento = azul */
.agro-badge--idle { background: #e5e5ea; color: #8e8e93; }

body.dark-mode .agro-badge--idle { background: #3a3a3c; color: #98989d; }

.agro-legend {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    margin: 6px 0 16px;
    font-size: 0.86rem;
    color: var(--secondary-color, #6e6e73);
    align-items: center;
}

.agro-legend > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

body.dark-mode .agro-legend { color: #aeaeb2; }


/* ==========================================================================
   YEAR-SECTORAL-SECTION — espacamento entre seções setoriais.
   Flat (sem card próprio). O wrapper-article externo fornece o cadre visual.
   ========================================================================== */
.year-sectoral-section {
    margin: 36px 0;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    box-sizing: border-box;
}

.year-sectoral-section > h2.cal-section-title {
    margin-top: 0;
    margin-bottom: 14px;
}

.year-sectoral-section > p {
    margin-top: 0;
    margin-bottom: 14px;
    line-height: 1.55;
    color: #475569;
}

body.dark-mode .year-sectoral-section > p {
    color: #aeaeb2;
}


/* ==========================================================================
   CAL-MONTHS-WITH-HOLIDAYS — tabela com rowspan agrupando por mês.
   ========================================================================== */
.cal-months-with-holidays .cf-month-cell {
    background: #f1f5f9;
    color: #0f172a;
    font-weight: 700;
    text-align: left;
    padding: 14px 16px;
    vertical-align: middle;
    border-right: 2px solid #cbd5e1;
}
.cal-months-with-holidays .cf-month-group--first td {
    border-top: 2px solid #cbd5e1;
}
.cal-months-with-holidays tbody tr:first-child td,
.cal-months-with-holidays tbody tr:first-child .cf-month-cell {
    border-top: 0;
}
body.dark-mode .cal-months-with-holidays .cf-month-cell {
    background: rgba(255, 255, 255, 0.06);
    color: #f5f5f7;
    border-right-color: rgba(255, 255, 255, 0.16);
}
body.dark-mode .cal-months-with-holidays .cf-month-group--first td {
    border-top-color: rgba(255, 255, 255, 0.16);
}


/* ==========================================================================
   DYNAMIC-FACTS-BOX (override) — flat, sem card por seção.
   BR tinha card com border-left azul; agora o wrapper-article externo
   fornece o cadre. Cada bloco fica plano para fluxo continuo.
   ========================================================================== */
.dynamic-facts-box {
    background: transparent !important;
    border: 0 !important;
    border-left: 0 !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 36px 0 !important;
    box-shadow: none !important;
    transition: none !important;
}
.dynamic-facts-box:hover {
    border-color: transparent;
    box-shadow: none;
}

.dynamic-facts-box > h3 {
    margin: 0 0 6px !important;
    font-size: 1.18rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.25;
    letter-spacing: -0.015em;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.dynamic-facts-box > p {
    margin: 0 0 16px;
    color: #475569;
    line-height: 1.6;
    font-size: 0.94rem;
}

.dynamic-facts-box ul,
.dynamic-facts-box ol {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.dynamic-facts-box ol {
    counter-reset: facts-counter;
    padding-left: 0;
    list-style: none;
}

.dynamic-facts-box ol > li {
    counter-increment: facts-counter;
    position: relative;
    padding: 12px 14px 12px 52px;
    margin-bottom: 8px;
    background: rgba(15, 23, 42, 0.025);
    border-radius: 10px;
    line-height: 1.5;
    font-size: 0.96rem;
    color: #0f172a;
}
.dynamic-facts-box ol > li::before {
    content: counter(facts-counter);
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0071e3, #5ab2ff);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.86rem;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: 0 2px 6px -2px rgba(0, 113, 227, 0.5);
}


/* ==========================================================================
   FACTS-LIST — flex rows label/valor, divider hairline.
   ========================================================================== */
.dynamic-facts-box .facts-list li {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 11px 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    line-height: 1.4;
    color: #1d1d1f;
    font-size: 0.96rem;
}
.dynamic-facts-box .facts-list li:last-child { border-bottom: 0; }
.dynamic-facts-box .facts-list li > strong:first-child {
    flex: 0 0 auto;
    min-width: 200px;
    color: #475569;
    font-weight: 600;
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.dynamic-facts-box .facts-list li > strong + * {
    color: #0f172a;
}

@media (max-width: 600px) {
    .dynamic-facts-box .facts-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    .dynamic-facts-box .facts-list li > strong:first-child { min-width: 0; }
}


/* ==========================================================================
   TWO-COL-GRID-LIST — listas em grid (feriados, datas).
   ========================================================================== */
.two-col-grid-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 4px 0 0;
}

.two-col-grid-list > li {
    padding: 12px 14px;
    background: rgba(15, 23, 42, 0.025);
    border-radius: 10px;
    line-height: 1.45;
    color: #1d1d1f;
    font-size: 0.94rem;
    transition: background 0.15s ease, transform 0.15s ease;
}
.two-col-grid-list > li:hover {
    background: rgba(15, 23, 42, 0.05);
    transform: translateX(2px);
}
.two-col-grid-list > li > strong {
    color: #0f172a;
    display: inline;
    font-weight: 700;
}

.two-col-grid-list > li ul {
    padding-left: 0;
    margin: 6px 0 0;
    color: #475569;
    font-size: 0.92rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.two-col-grid-list > li ul li {
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 6px;
    line-height: 1.4;
}

/* Pill para a data */
.holiday-date {
    display: inline-block;
    padding: 2px 9px;
    background: #0071e3;
    color: #ffffff;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    margin-right: 6px;
    font-variant-numeric: tabular-nums;
    vertical-align: baseline;
}
.holiday-date time { color: inherit; }

/* Variantes thematic flat — sem card colorido */
.dynamic-facts-box--blue,
.dynamic-facts-box--green,
.dynamic-facts-box--orange,
.dynamic-facts-box--gray,
.dynamic-facts-box--red,
.dynamic-facts-box--yellow,
.dynamic-facts-box--pink,
.dynamic-facts-box--purple { background: transparent !important; }


/* Dark mode dynamic-facts-box */
body.dark-mode .dynamic-facts-box,
body.dark-mode .dynamic-facts-box--blue,
body.dark-mode .dynamic-facts-box--green,
body.dark-mode .dynamic-facts-box--orange,
body.dark-mode .dynamic-facts-box--gray,
body.dark-mode .dynamic-facts-box--red,
body.dark-mode .dynamic-facts-box--yellow,
body.dark-mode .dynamic-facts-box--pink,
body.dark-mode .dynamic-facts-box--purple {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
}
body.dark-mode .dynamic-facts-box > h3 { color: #f5f5f7; }
body.dark-mode .dynamic-facts-box > p { color: #aeaeb2; }
body.dark-mode .dynamic-facts-box .facts-list li {
    color: #f5f5f7;
    border-bottom-color: rgba(255, 255, 255, 0.06);
}
body.dark-mode .dynamic-facts-box .facts-list li > strong:first-child { color: #aeaeb2; }
body.dark-mode .dynamic-facts-box ol > li {
    background: rgba(255, 255, 255, 0.04);
    color: #f5f5f7;
}
body.dark-mode .two-col-grid-list > li {
    background: rgba(255, 255, 255, 0.04);
    color: #f5f5f7;
}
body.dark-mode .two-col-grid-list > li:hover { background: rgba(255, 255, 255, 0.07); }
body.dark-mode .two-col-grid-list > li ul li {
    background: rgba(255, 255, 255, 0.05);
}
body.dark-mode .two-col-grid-list > li ul { color: #aeaeb2; }
body.dark-mode .holiday-date { background: #0a84ff; color: #ffffff; }

@media (max-width: 720px) {
    .two-col-grid-list { grid-template-columns: 1fr; }
}


/* ==========================================================================
   LUNAR-YEAR-GRID — cartões mensais das fases da Lua (override harmonizado).
   ========================================================================== */
.lunar-year-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
    gap: 16px !important;
    margin-top: 16px !important;
}

.lunar-month-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.lunar-month-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    border-color: rgba(88, 86, 214, 0.4);
}

.lunar-month-title {
    font-size: 0.94rem;
    font-weight: 700;
    color: #5856d6;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding-bottom: 8px;
    margin-bottom: 10px;
}

.lunar-phase-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.05);
    font-size: 0.88rem;
    color: #475569;
    gap: 8px;
}
.lunar-phase-row:last-child { border-bottom: 0; }

.lunar-phase-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.lunar-icon {
    font-size: 1.18rem;
    line-height: 1;
    flex-shrink: 0;
}

.lunar-info { display: flex; flex-direction: column; min-width: 0; }

.lunar-name {
    font-weight: 600;
    color: #1d1d1f;
    font-size: 0.86rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lunar-date {
    font-size: 0.82em;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.lunar-phase-row.is-full-moon .lunar-name {
    color: #5856d6;
    font-weight: 700;
}

body.dark-mode .lunar-month-card {
    background: #1c1c1e;
    border-color: rgba(255, 255, 255, 0.08);
}
body.dark-mode .lunar-month-card:hover {
    border-color: rgba(120, 119, 230, 0.5);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}
body.dark-mode .lunar-month-title {
    color: #a5a3f0;
    border-bottom-color: rgba(255, 255, 255, 0.06);
}
body.dark-mode .lunar-phase-row {
    color: #aeaeb2;
    border-bottom-color: rgba(255, 255, 255, 0.05);
}
body.dark-mode .lunar-name { color: #f5f5f7; }
body.dark-mode .lunar-date { color: #98989d; }
body.dark-mode .lunar-phase-row.is-full-moon .lunar-name { color: #a5a3f0; }


/* ==========================================================================
   CAL-YEAR-HERO — hero azul pleno (usado em dias-uteis.php?modo=mes).
   Para BR não usamos full-bleed (não há body.cal-year-wide); o hero é um
   bloco padrão dentro do container existente.
   ========================================================================== */
/* Neutraliza apenas o CARD VISIVEL do .container automatico de header.php
   (background, border, shadow, padding) — mantem max-width 1000px para que
   toolbar+calendar herdem a mesma largura padrao das secoes editoriais
   (serp-wrapper, tool-aux-wrapper, article-wrapper). O hero escapa para
   full-bleed via 100vw + margin negativa. */
body.tool-calendario main#main > .container,
body.tool-dias-uteis main#main > .container,
body.tool-quinto-dia-util main#main > .container,
body.tool-quantas-semanas-tem main#main > .container {
    background: transparent !important;
    box-shadow: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0 !important;
}
/* Containers internos explicitos (serp-wrapper, tool-aux-wrapper, article-wrapper,
   related-wrapper) voltam ao card branco padrao (background + border + shadow). */
body.tool-calendario main#main > .container > .container,
body.tool-dias-uteis main#main > .container > .container,
body.tool-quinto-dia-util main#main > .container > .container,
body.tool-quantas-semanas-tem main#main > .container > .container {
    background-color: var(--content-bg, #ffffff) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
    border: 1px solid var(--border-color, #e5e5e5) !important;
    border-radius: 12px !important;
    padding: 25px !important;
}

/* Suprime o breadcrumb global de header.php quando o hero ja injeta o seu.
   Mantem aria/SEO porque o hero contem o breadcrumb completo com aria-current. */
body.tool-calendario main#main > .container > nav.breadcrumb,
body.tool-dias-uteis main#main > .container > nav.breadcrumb,
body.tool-quinto-dia-util main#main > .container > nav.breadcrumb,
body.tool-quantas-semanas-tem main#main > .container > nav.breadcrumb {
    display: none !important;
}

/* Hero full-bleed: escapa do <div class="container"> via width 100vw + margin
   negativa, igual jfhub-hero do FR. */
.cal-year-hero {
    position: relative;
    overflow: hidden;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding: 56px 28px 64px;
    color: #ffffff;
    background:
        radial-gradient(900px 420px at 90% -10%, rgba(255,255,255,0.10) 0, transparent 55%),
        radial-gradient(700px 360px at 0% 110%, rgba(255,255,255,0.06) 0, transparent 55%),
        linear-gradient(135deg, rgba(0, 60, 135, 0.92) 0%, rgba(0, 40, 95, 0.96) 100%),
        linear-gradient(135deg, var(--primary-color, #0071e3) 0%, var(--primary-hover, #005bb5) 100%);
    margin-top: -20px;
    margin-bottom: 24px;
    border-radius: 0;
}
/* Evita scroll horizontal causado pelo 100vw em telas com scrollbar */
html { overflow-x: clip; }
body { overflow-x: clip; }
.cal-year-hero::before {
    content: "";
    position: absolute; inset: 0;
    background-image:
        radial-gradient(circle at 25% 60%, rgba(255,255,255,0.05) 2px, transparent 3px),
        radial-gradient(circle at 75% 30%, rgba(255,255,255,0.04) 2px, transparent 3px);
    background-size: 80px 80px, 100px 100px;
    opacity: 0.6;
    pointer-events: none;
}
.cal-year-hero__inner {
    position: relative;
    z-index: 1;
    max-width: 1700px;
    margin: 0 auto;
}

/* Breadcrumb capsule horizontal (pill glassmorphic) */
.cal-year-hero__breadcrumb {
    display: flex;
    width: fit-content;
    max-width: 100%;
    margin: 0 0 14px;
    padding: 5px 13px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.24);
    border-radius: 999px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-size: 0.8rem;
    color: rgba(255,255,255,0.88);
}
.cal-year-hero__breadcrumb ol {
    list-style: none;
    margin: 0; padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}
.cal-year-hero__breadcrumb li {
    display: inline-flex;
    align-items: center;
    line-height: 1.2;
}
.cal-year-hero__breadcrumb a {
    color: rgba(255,255,255,0.88);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.18s ease;
}
.cal-year-hero__breadcrumb a:hover,
.cal-year-hero__breadcrumb a:focus-visible {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: rgba(255,255,255,0.6);
}
.cal-year-hero__breadcrumb [aria-current="page"] {
    color: #fff;
    font-weight: 700;
}
.cal-year-hero__breadcrumb-sep {
    color: rgba(255,255,255,0.55);
    font-size: 0.88rem;
    user-select: none;
    line-height: 1;
}

/* Badge capsule (igual breadcrumb FR) */
.cal-year-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    max-width: 100%;
    margin: 0 0 14px;
    padding: 5px 13px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.24);
    border-radius: 999px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255,255,255,0.92);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.cal-year-hero__badge i {
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.85em;
}

.cal-year-hero__title {
    color: #fff;
    font-size: clamp(1.8rem, 3vw + 0.8rem, 2.8rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.1;
    margin: 0 0 14px;
    text-wrap: balance;
}

.cal-year-hero__lede {
    color: rgba(255,255,255,0.92);
    font-size: clamp(0.96rem, 0.6vw + 0.85rem, 1.08rem);
    line-height: 1.6;
    max-width: 78ch;
    margin: 0;
    font-weight: 400;
}

@media (max-width: 720px) {
    .cal-year-hero { padding: 36px 18px 40px; }
    .cal-year-hero__title { font-size: clamp(1.55rem, 6vw, 2.1rem); }
    .cal-year-hero__lede { font-size: 0.94rem; }
}


/* ==========================================================================
   CLIMATE-HEATMAP — heatmap de 5 macrorregiões do Brasil.
   Tabela aérea, scroll horizontal em mobile.
   ========================================================================== */
.climate-heatmap-wrap {
    margin: 8px 0 22px;
    padding: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.18) transparent;
}
.climate-heatmap-wrap::-webkit-scrollbar { height: 8px; }
.climate-heatmap-wrap::-webkit-scrollbar-track { background: transparent; }
.climate-heatmap-wrap::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.16);
    border-radius: 8px;
}

.climate-heatmap {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    table-layout: fixed;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter",
                 "Helvetica Neue", Arial, sans-serif;
    font-variant-numeric: tabular-nums;
}

.climate-heatmap--year {
    /* 240px região + 12 colunas × 64px = 1008px mínimo */
    min-width: 1008px;
}

.climate-heatmap--month {
    min-width: 480px;
}

.climate-heatmap thead th {
    background: #f8fafc;
    color: #475569;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 12px 4px;
    text-align: center;
    white-space: nowrap;
    border-bottom: 2px solid rgba(0, 0, 0, 0.06);
    text-transform: uppercase;
    vertical-align: middle;
}

.climate-heatmap__corner {
    text-align: left !important;
    padding-left: 16px !important;
    width: 240px;
    min-width: 240px;
}

.climate-heatmap--year .climate-heatmap__col-header {
    width: 64px;
    min-width: 64px;
}

.climate-heatmap__row-header {
    background: #ffffff;
    color: #1d1d1f;
    text-align: left;
    font-weight: 600;
    padding: 14px 16px;
    width: 240px;
    min-width: 240px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    vertical-align: middle;
}

.climate-heatmap tbody tr:last-child .climate-heatmap__row-header,
.climate-heatmap tbody tr:last-child .climate-heatmap__cell {
    border-bottom: 0;
}

.climate-heatmap__region {
    display: block;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.25;
    color: #0f172a;
    letter-spacing: -0.01em;
}

.climate-heatmap__city {
    display: block;
    font-size: 0.72rem;
    font-weight: 500;
    color: #64748b;
    margin-top: 3px;
    letter-spacing: 0.01em;
}

.climate-heatmap__cell {
    text-align: center;
    padding: 12px 4px;
    font-size: 0.84rem;
    color: #0f172a;
    line-height: 1.18;
    vertical-align: middle;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.55);
    transition: filter 0.15s ease;
}

.climate-heatmap tbody tr:hover .climate-heatmap__row-header {
    background: #eef2ff;
    color: #1e1b4b;
}
.climate-heatmap tbody tr:hover .climate-heatmap__cell {
    filter: brightness(0.94) saturate(1.15);
}
body.dark-mode .climate-heatmap tbody tr:hover .climate-heatmap__row-header {
    background: rgba(165, 163, 240, 0.12);
    color: #f5f5f7;
}
body.dark-mode .climate-heatmap tbody tr:hover .climate-heatmap__cell {
    filter: brightness(1.05);
}

.climate-heatmap--year .climate-heatmap__cell {
    width: 64px;
    min-width: 64px;
}

.climate-heatmap__max,
.climate-heatmap__min {
    display: block;
    font-variant-numeric: tabular-nums;
}
.climate-heatmap__max {
    font-weight: 800;
    color: #0f172a;
    font-size: 1.05em;
    letter-spacing: -0.02em;
}
.climate-heatmap__min {
    font-weight: 500;
    color: rgba(15, 23, 42, 0.55);
    font-size: 0.78em;
    margin-top: 1px;
}

.climate-heatmap__cell--empty {
    background: #f8fafc;
    color: #cbd5e1;
}

.climate-heatmap--month .climate-heatmap__cell {
    padding: 14px 18px;
    font-size: 0.96rem;
    text-align: center;
}

.climate-heatmap--month .climate-heatmap__cell--label {
    font-weight: 700;
    text-align: left;
    padding-left: 18px;
    letter-spacing: 0.01em;
}

.climate-heatmap__legend {
    margin: 14px 16px 4px;
    font-size: 0.84rem;
    color: #475569;
    line-height: 1.5;
}

.climate-heatmap__legend strong {
    color: #0f172a;
    font-weight: 700;
}

.climate-heatmap__source {
    margin: 4px 0 14px;
    padding: 0 16px;
    font-size: 0.74rem;
    color: #94a3b8;
    font-style: italic;
}

body.dark-mode .climate-heatmap-wrap {
    background: transparent;
    border-color: transparent;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

body.dark-mode .climate-heatmap thead th {
    background: rgba(255, 255, 255, 0.04);
    color: #aeaeb2;
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

body.dark-mode .climate-heatmap__row-header {
    background: #1c1c1e;
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

body.dark-mode .climate-heatmap__region { color: #f5f5f7; }
body.dark-mode .climate-heatmap__city { color: #98989d; }

body.dark-mode .climate-heatmap__cell {
    color: #1d1d1f;
    border-bottom-color: rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 0 0 9999px rgba(0, 0, 0, 0.06);
}

body.dark-mode .climate-heatmap__legend { color: #aeaeb2; }
body.dark-mode .climate-heatmap__legend strong { color: #f5f5f7; }
body.dark-mode .climate-heatmap__source { color: #6b7280; }

@media (max-width: 880px) {
    .climate-heatmap--year { min-width: 960px; }
    .climate-heatmap__corner,
    .climate-heatmap__row-header { width: 200px; min-width: 200px; }
    .climate-heatmap__region { font-size: 0.84rem; }
    .climate-heatmap__cell { padding: 12px 3px; font-size: 0.78rem; }
    .climate-heatmap--year .climate-heatmap__cell { width: 60px; min-width: 60px; }
}

@media (max-width: 600px) {
    .climate-heatmap--year { min-width: 880px; }
    .climate-heatmap__corner,
    .climate-heatmap__row-header { width: 180px; min-width: 180px; padding: 12px 12px; }
    .climate-heatmap__cell { padding: 10px 2px; font-size: 0.74rem; }
    .climate-heatmap--year .climate-heatmap__cell { width: 56px; min-width: 56px; }
    .climate-heatmap--month .climate-heatmap__cell { font-size: 0.86rem; padding: 11px 12px; }
}

@media print {
    .climate-heatmap-wrap {
        overflow: visible;
        border: 1px solid rgba(0, 0, 0, 0.3);
        box-shadow: none;
        page-break-inside: avoid;
    }
    .climate-heatmap--year,
    .climate-heatmap--month {
        min-width: 0;
        width: 100%;
    }
    .climate-heatmap__cell {
        font-size: 0.74rem;
        padding: 6px 2px;
    }
}


/* ==========================================================================
   CM-TOOL-SHELL — wrapper unificado da ferramenta em mes mode
   (toolbar + 2-col layout de calendar+resumo). Card branco com padding
   interno e separador hairline entre toolbar e calendar.
   ========================================================================== */
.cm-tool-shell {
    margin-top: 16px;
    margin-bottom: 24px;
    max-width: 1080px;
    margin-left: auto;
    margin-right: auto;
}
.cm-tool-shell__inner {
    background: var(--content-bg, #ffffff);
    border: 1px solid var(--border-color, rgba(0, 0, 0, 0.08));
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
}
.cm-tool-shell__toolbar {
    margin: 0 0 22px !important;
    padding: 0 0 18px !important;
    /* Hairline separadora entre toolbar e o layout do calendario abaixo */
    border-bottom: 1px solid rgba(0, 0, 0, 0.1) !important;
    background: transparent !important;
    box-shadow: none !important;
}
.cm-tool-shell__body { padding: 0; }
/* Garante margem entre cm-tool-shell e o cm-tool-actions abaixo */
.cm-tool-shell + .cm-tool-actions,
.cm-tool-shell + .container + .cm-tool-actions {
    margin-top: 18px;
}

body.dark-mode .cm-tool-shell__inner {
    background: #1c1c1e;
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}
body.dark-mode .cm-tool-shell__toolbar {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

/* Override do card branco padrao quando o cm-tool-shell.container existe:
   ele ja eh card por conta propria, evita double-card. */
body.tool-dias-uteis main#main > .container > .container.cm-tool-shell {
    max-width: 1080px !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
}


/* ==========================================================================
   CM-SERP-INLINE — chips inline para busca SERP (BR).
   ========================================================================== */
.cm-serp-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
}
.cm-serp-inline > li {
    margin: 0;
}
.cm-serp-inline a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 13px;
    background: rgba(0, 113, 227, 0.06);
    border: 1px solid rgba(0, 113, 227, 0.2);
    border-radius: 999px;
    color: #0071e3;
    font-size: 0.86rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.cm-serp-inline a:hover,
.cm-serp-inline a:focus-visible {
    background: rgba(0, 113, 227, 0.12);
    border-color: rgba(0, 113, 227, 0.4);
    transform: translateY(-1px);
    text-decoration: none;
    outline: none;
}

body.dark-mode .cm-serp-inline a {
    background: rgba(100, 181, 255, 0.1);
    border-color: rgba(100, 181, 255, 0.25);
    color: #64b5ff;
}
body.dark-mode .cm-serp-inline a:hover,
body.dark-mode .cm-serp-inline a:focus-visible {
    background: rgba(100, 181, 255, 0.18);
    border-color: rgba(100, 181, 255, 0.5);
}
