/*
Theme Name: Revista Logística — ColorMag IMAM
Description: Identidade e destaques editoriais da Revista Logística, sem ecommerce.
Author: IMAM
Template: colormag
Version: 1.3.0
Text Domain: colormag-imam
*/

.cm-header-builder .cm-header-main-row {
    background: #122c40;
}

.cm-header-builder .cm-site-branding .custom-logo {
    display: block;
    width: 430px;
    max-width: 100%;
    height: auto;
    max-height: none;
}

.cm-header-builder .custom-logo-link {
    display: block;
}

.cm-header-builder .cm-site-branding {
    max-width: 100%;
}

.cm-header-builder .cm-search-box {
    width: min(100%, 360px);
}

.rl-site-search {
    width: 100%;
    margin: 0;
}

.rl-site-search__fields {
    display: flex;
    gap: 0;
    width: 100%;
    border: 1px solid #b7c5cf;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
}

.rl-site-search .rl-site-search__input {
    flex: 1;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 12px;
    border: 0;
    border-radius: 0;
    color: #172c3d;
    font: inherit;
    background: #fff;
}

.rl-site-search .rl-site-search__submit {
    flex-shrink: 0;
    margin: 0;
    padding: 12px 16px;
    border: 0;
    border-radius: 0;
    color: #fff;
    font: inherit;
    font-weight: 700;
    background: #005b8c;
    cursor: pointer;
}

.rl-site-search .rl-site-search__submit:hover {
    background: #003e61;
}

.rl-site-search__fields:focus-within {
    outline: 3px solid #0077b5;
    outline-offset: 3px;
}

.rl-highlights {
    --rl-ink: #122c40;
    margin: 0 0 36px;
    color: var(--rl-ink);
}

.rl-highlights__heading {
    margin: 0 0 16px;
    padding-left: 12px;
    border-left: 4px solid #0077b5;
    font-size: 24px;
    font-weight: 700;
}

.rl-highlights__track {
    display: flex;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    list-style: none;
    border-radius: 10px;
}

.rl-highlights__slide {
    flex: 0 0 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    list-style: none;
}

.rl-highlights__card {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    height: 100%;
    min-height: 360px;
    overflow: hidden;
    background: var(--rl-ink);
}

.rl-highlights__image-link {
    display: block;
    min-width: 0;
    background: #e8edf1;
}

.rl-highlights__image-link img {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 440px;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.rl-highlights__fallback {
    display: grid;
    height: 100%;
    min-height: 240px;
    place-items: center;
    padding: 32px;
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    background: #005b8c;
}

.rl-highlights__body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 14px;
    min-width: 0;
    padding: clamp(24px, 3vw, 40px);
    color: #fff;
}

.rl-highlights__category {
    padding: 4px 10px;
    border-radius: 3px;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    background: #006fa7;
}

.rl-highlights__title {
    margin: 0;
    font-size: clamp(23px, 2.5vw, 34px);
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.rl-highlights .rl-highlights__title a,
.rl-highlights .rl-highlights__read-more {
    color: #fff;
}

.rl-highlights__date {
    color: #d3e1eb;
    font-size: 13px;
}

.rl-highlights__read-more {
    margin-top: 4px;
    font-size: 15px;
    font-weight: 700;
    text-underline-offset: 5px;
    text-decoration: underline;
}

.rl-highlights__controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 14px;
}

.rl-highlights__controls[hidden] {
    display: none;
}

.rl-highlights__arrows,
.rl-highlights__dots {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rl-highlights .rl-highlights__arrow,
.rl-highlights .rl-highlights__dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    margin: 0;
    padding: 8px;
    border: 1px solid #b7c5cf;
    border-radius: 6px;
    color: var(--rl-ink);
    line-height: 1;
    background: #fff;
    cursor: pointer;
}

.rl-highlights .rl-highlights__dot::before {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #8b9eac;
    content: '';
}

.rl-highlights .rl-highlights__dot[aria-current='true'] {
    border-color: #005b8c;
    background: #e9f4fa;
}

.rl-highlights .rl-highlights__dot[aria-current='true']::before {
    background: #005b8c;
}

.rl-highlights .rl-highlights__arrow:disabled {
    opacity: .4;
    cursor: default;
}

.rl-highlights a:focus-visible,
.rl-highlights button:focus-visible,
.rl-highlights__track:focus-visible {
    outline: 3px solid #ffbc42;
    outline-offset: -4px;
}

@media (max-width: 768px) {
    .cm-mobile-row .cm-site-branding .custom-logo {
        width: 320px;
    }

    .cm-mobile-row .cm-header-bottom-row .cm-header-center-col {
        flex: 1;
        min-width: 0;
    }

    .cm-mobile-row .cm-header-bottom-row .cm-header-right-col:empty {
        display: none;
    }

    .cm-mobile-row .cm-search-box {
        width: 100%;
    }

    .rl-site-search .rl-site-search__submit {
        padding-right: 12px;
        padding-left: 12px;
        font-size: 14px;
    }

    .rl-highlights__card {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
        min-height: 0;
    }

    .rl-highlights__image-link img {
        height: auto;
        max-height: 300px;
        aspect-ratio: 16 / 9;
    }

    .rl-highlights__body {
        gap: 12px;
        padding: 24px;
    }

    .rl-highlights__title {
        font-size: 24px;
    }

    .rl-highlights__dots {
        gap: 2px;
    }

    .rl-highlights .rl-highlights__dot {
        min-width: 32px;
        padding: 4px;
        border-color: transparent;
    }
}

@media (prefers-reduced-motion: reduce) {
    .rl-highlights__track {
        scroll-behavior: auto;
    }
}

/* Home editorial e catálogo: componentes locais, sem plugins de layout. */
.rl-home.cm-primary {
    float: none;
    width: 100%;
    min-width: 0;
}

.rl-home > nav,
.rl-home > section,
.rl-editorial-sections {
    margin-bottom: 48px;
}

.rl-section-title {
    margin: 0;
    padding-left: 12px;
    border-left: 4px solid #0077b5;
    color: #122c40;
    font-size: 24px;
    line-height: 1.3;
}

.rl-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.rl-section-heading > span,
.rl-section-heading p {
    margin: 8px 0 0;
    color: #536574;
    font-size: 15px;
}

.rl-section-link {
    display: inline-block;
    color: #005b8c;
    font-size: 15px;
    font-weight: 700;
    text-underline-offset: 4px;
}

.rl-section-link:hover {
    text-decoration: underline;
}

.rl-topics ul {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0 0;
    padding: 0;
    list-style: none;
}

.rl-topics li {
    max-width: 100%;
    margin: 0;
    list-style: none;
}

.rl-topics a {
    display: block;
    padding: 12px 16px;
    border: 1px solid #c4dce9;
    border-radius: 24px;
    color: #004e78;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    background: #f0f7fb;
}

.rl-topics a:hover {
    border-color: #005b8c;
    background: #e0f0f8;
}

.rl-news-grid,
.rl-editorial-sections {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.rl-news-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid #dce5eb;
    border-radius: 8px;
    background: #fff;
}

.rl-news-card__image {
    display: block;
    overflow: hidden;
    background: #e8edf1;
}

.rl-news-card__image img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.rl-news-card__body {
    padding: 20px;
}

.rl-news-card time,
.rl-topic-link time {
    color: #536574;
    font-size: 13px;
}

.rl-news-card h3 {
    margin: 10px 0;
    font-size: 21px;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.rl-news-card h3 a,
.rl-topic-link h3 a {
    color: #122c40;
}

.rl-news-card p {
    margin: 0;
    color: #445868;
    font-size: 15px;
    line-height: 1.6;
}

.rl-home-news .navigation {
    margin-top: 24px;
}

.rl-home-editions {
    padding: 28px;
    border: 1px solid #dce5eb;
    border-radius: 12px;
    background: #f3f7fa;
}

.rl-editorial-section {
    min-width: 0;
}

.rl-editorial-section > .rl-section-title {
    min-height: 64px;
    margin-bottom: 20px;
    font-size: 22px;
}

.rl-topic-link {
    padding: 18px 0;
    border-bottom: 1px solid #dce5eb;
}

.rl-topic-link h3 {
    margin: 8px 0 0;
    font-size: 18px;
    line-height: 1.4;
}

.rl-editorial-section > .rl-section-link {
    margin-top: 20px;
}

.rl-editions__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

.rl-edition-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border: 1px solid #dce5eb;
    border-radius: 8px;
    background: #fff;
}

.rl-edition-card__cover {
    display: grid;
    place-items: center;
    padding: 20px;
    aspect-ratio: 3 / 4;
    background: #e7eef3;
}

.rl-edition-card__cover img {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 320px;
    object-fit: contain;
}

.rl-edition-card__fallback {
    color: #005b8c;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
}

.rl-edition-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 20px;
}

.rl-edition-card h3 {
    margin: 0;
    font-size: 19px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.rl-edition-card h3 a {
    color: #122c40;
}

.rl-edition-card__details {
    display: block;
    margin-top: auto;
    padding: 8px 0;
    color: #005b8c;
    font-size: 14px;
    font-weight: 700;
}

.rl-editions a.rl-edition-card__pdf {
    display: block;
    padding: 10px;
    border-radius: 5px;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    background: #005b8c;
}

.rl-edition-card__pdf span {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    font-weight: 400;
}

.rl-edition-card__note {
    margin: 0;
    color: #536574;
    font-size: 13px;
}

.rl-editions__filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding: 20px;
    border: 1px solid #dce5eb;
    border-radius: 8px;
    background: #f3f7fa;
}

.rl-editions__filter label {
    color: #122c40;
    font-weight: 700;
}

.rl-editions__filter select {
    width: auto;
    min-width: 150px;
    min-height: 44px;
    margin: 0;
    padding: 8px;
    border: 1px solid #b7c5cf;
    border-radius: 4px;
    color: #122c40;
    background: #fff;
}

.rl-editions__filter button {
    min-height: 44px;
    margin: 0;
    padding: 10px 20px;
    border: 0;
    border-radius: 4px;
    color: #fff;
    font-weight: 700;
    background: #005b8c;
}

.rl-editions__count {
    margin-bottom: 8px;
    color: #536574;
}

.rl-editions__year-note {
    margin-bottom: 24px;
    color: #536574;
    font-size: 13px;
}

.rl-editions__pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 32px 0;
}

.rl-editions__pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid #b7c5cf;
    border-radius: 4px;
    color: #005b8c;
}

.rl-editions__pagination .current {
    border-color: #005b8c;
    color: #fff;
    background: #005b8c;
}

.rl-home a:focus-visible,
.rl-editions a:focus-visible,
.rl-editions select:focus-visible,
.rl-editions button:focus-visible {
    outline: 3px solid #0077b5;
    outline-offset: 3px;
}

@media (max-width: 900px) {
    .rl-news-grid,
    .rl-editions__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .rl-editorial-sections {
        grid-template-columns: 1fr;
        gap: 36px;
    }

    .rl-editorial-section > .rl-section-title {
        min-height: 0;
    }
}

@media (max-width: 600px) {
    .rl-section-heading {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .rl-news-grid {
        grid-template-columns: 1fr;
    }

    .rl-home-editions {
        padding: 16px;
    }

    .rl-editions__grid {
        gap: 12px;
    }

    .rl-edition-card__cover,
    .rl-edition-card__body {
        padding: 12px;
    }

    .rl-edition-card h3 {
        font-size: 17px;
    }

    .rl-editions__filter {
        padding: 16px;
    }

    .rl-editions__filter label {
        flex-basis: 100%;
    }
}

/* Formulários locais: a proteção também é exigida no servidor. */
.rl-newsletter {
    display: grid;
    grid-template-columns: .8fr 1.2fr;
    align-items: start;
    gap: 32px;
    padding: 32px;
    border-radius: 12px;
    background: #122c40;
}

.rl-newsletter__intro h2 {
    margin: 0 0 20px;
    color: #fff;
    font-size: 30px;
    line-height: 1.25;
}

.rl-newsletter__intro p {
    color: #d3e1eb;
    font-size: 16px;
    line-height: 1.6;
}

.rl-secure-form-wrap {
    min-width: 0;
    padding: 24px;
    border: 1px solid #dce5eb;
    border-radius: 8px;
    color: #122c40;
    background: #fff;
}

.rl-form-notice {
    margin: 0 0 20px;
    padding: 14px;
    border-left: 4px solid #0077b5;
    color: #23465f;
    font-size: 14px;
    line-height: 1.6;
    background: #eaf4fa;
}

.rl-form-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.rl-form-field {
    min-width: 0;
}

.rl-form-field--wide {
    grid-column: 1 / -1;
}

.rl-secure-form label {
    color: #122c40;
    font-size: 15px;
    font-weight: 600;
}

.rl-form-field label {
    display: block;
    margin-bottom: 8px;
}

.rl-form-field label > span,
.rl-form-field small {
    color: #536574;
    font-size: 13px;
    font-weight: 400;
}

.rl-form-field input,
.rl-form-field select,
.rl-form-field textarea {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-height: 46px;
    margin: 0;
    padding: 12px;
    border: 1px solid #aabcc9;
    border-radius: 5px;
    color: #122c40;
    font: inherit;
    background: #fff;
}

.rl-form-field textarea {
    resize: vertical;
}

.rl-secure-form .rl-form-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 20px;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.6;
}

.rl-form-consent input {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    margin-top: 2px;
}

.rl-form-privacy,
.rl-form-captcha-pending {
    margin: 16px 0;
    color: #536574;
    font-size: 13px;
    line-height: 1.6;
}

.rl-secure-form .rl-form-submit {
    box-sizing: border-box;
    display: block;
    width: 100%;
    max-width: 100%;
    min-height: 48px;
    margin: 20px 0 0;
    padding: 14px 18px;
    border: 0;
    border-radius: 5px;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    white-space: normal;
    background: #005b8c;
    cursor: pointer;
}

.rl-secure-form .rl-form-submit:disabled {
    opacity: 1;
    color: #344b5c;
    background: #dce5eb;
    cursor: not-allowed;
}

.rl-form-honeypot {
    position: absolute !important;
    left: -10000px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

.rl-cookie-banner {
    box-sizing: border-box;
    position: fixed;
    z-index: 9999;
    right: 16px;
    bottom: 16px;
    left: 16px;
    max-width: 820px;
    margin: 0 auto;
    padding: 20px;
    border: 1px solid #aabcc9;
    border-radius: 10px;
    color: #122c40;
    background: #fff;
    box-shadow: 0 4px 24px #122c4033;
}

.rl-cookie-banner[hidden] { display: none; }
.rl-cookie-banner h2,
.rl-cookie-dialog h2 { margin: 0 0 12px; color: #122c40; font-size: 21px; }
.rl-cookie-banner p,
.rl-cookie-dialog p { margin: 0 0 12px; color: #344b5c; font-size: 14px; line-height: 1.6; }
.rl-cookie-banner .rl-cookie-preview { font-size: 12px; }
.rl-cookie-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.rl-cookie-actions button {
    box-sizing: border-box;
    min-height: 44px;
    margin: 0;
    padding: 12px 16px;
    border: 1px solid #aabcc9;
    border-radius: 5px;
    color: #005b8c;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    background: #fff;
    cursor: pointer;
}
.rl-cookie-actions button.rl-cookie-accept { border-color: #005b8c; color: #fff; background: #005b8c; }
.rl-cookie-dialog { box-sizing: border-box; width: min(600px, calc(100% - 32px)); max-height: 90vh; padding: 24px; border: 1px solid #aabcc9; border-radius: 10px; background: #fff; }
.rl-cookie-dialog::backdrop { background: #122c4080; }
.rl-cookie-dialog label { display: flex; align-items: flex-start; gap: 12px; margin: 20px 0; color: #122c40; font-size: 14px; line-height: 1.6; }
.rl-cookie-dialog label input { flex: 0 0 20px; width: 20px; height: 20px; margin-top: 3px; }
.rl-cookie-settings-link { margin: 0; padding: 16px; text-align: center; background: #f3f7fa; }
.rl-cookie-settings-link button { min-height: 44px; padding: 8px 16px; border: 0; color: #005b8c; font: inherit; font-size: 14px; text-decoration: underline; background: transparent; cursor: pointer; }
.rl-cookie-dialog button:focus-visible,
.rl-cookie-dialog input:focus-visible,
.rl-cookie-banner button:focus-visible { outline: 3px solid #0077b5; outline-offset: 3px; }

.rl-secure-form input:focus-visible,
.rl-secure-form select:focus-visible,
.rl-secure-form textarea:focus-visible,
.rl-secure-form button:focus-visible {
    outline: 3px solid #0077b5;
    outline-offset: 3px;
}

@media (max-width: 900px) {
    .rl-newsletter {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

@media (max-width: 600px) {
    .rl-newsletter {
        padding: 20px;
    }

    .rl-newsletter__intro h2 {
        font-size: 25px;
    }

    .rl-secure-form-wrap {
        padding: 16px;
    }

    .rl-form-fields {
        grid-template-columns: 1fr;
    }
}
