/* =====================================================
   ESTUDOS E PESQUISAS — Listagem
   3 breakpoints:
     - Desktop grande  : base (≥ 1441px)
     - MacBook Air M2  : @media (max-width: 1440px)
     - Mobile          : @media (max-width: 768px)
   ===================================================== */

/* ----- RESET DE PÁGINA ---------------------------------------- */
body.page-template-page-estudos-pesquisas {
    background-color: #ffffff;
    background-image: url('../images/ep-bg.png');
    background-size: 1920px auto;
    background-position: top left;
    background-repeat: no-repeat;
}

/* ----- HERO (imagem banner) ----------------------------------- */
.ep-hero {
    padding: 30px 0 0;
}

.ep-hero__banner {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 24px;
}

/* ----- DESCRIÇÃO ---------------------------------------------- */
.ep-description {
    padding: 24px 0 8px;
}

.ep-description__text {
    font-family: 'Montserrat', sans-serif;
    font-size: 18px;
    line-height: 24px;
    color: #333333;
    word-break: break-word;
    margin: 0;
}

.ep-description__text strong {
    font-weight: 800;
}

/* ----- BUSCA -------------------------------------------------- */
.ep-search {
    padding: 20px 0 30px;
}

.ep-search-form {
    position: relative;
    width: 650px;
    margin: 0 auto;
    display: block;
}

.ep-search-form input[type="search"] {
    width: 100%;
    border: 1px solid #9c9a9a;
    background: #f9f9f9;
    border-radius: 50px;
    padding: 0 60px 0 25px;
    height: 60px;
    font-size: 16px;
    color: #a4a1a1;
    font-family: 'Montserrat', sans-serif;
    outline: none;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.2s;
}

.ep-search-form input[type="search"]:focus {
    border-color: #008f8c;
}

.ep-search-form input[type="search"]::placeholder {
    color: #a4a1a1;
}

.ep-search-form button[type="submit"] {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #fd8204;
    font-size: 22px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    display: flex;
    align-items: center;
}

/* ----- CATEGORIAS --------------------------------------------- */
.ep-categories {
    padding: 0 0 44px;
}

.ep-categories__list {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
    padding-top: 70px; /* espaço para o animal fazer overflow acima do pill */
}

/* Pill base */
.ep-category {
    display: flex;
    align-items: center;
    position: relative;
    overflow: visible;
    text-decoration: none;
    width: 360px;
    height: 80px;
    transition: filter 0.2s, transform 0.15s;
}

.ep-category:hover {
    filter: brightness(1.08);
    transform: translateY(-2px);
}

.ep-category--active {
    box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.75);
    transform: translateY(-2px);
}

.ep-category--inactive {
    opacity: 0.45;
}

.ep-card.ep-card--hidden {
    display: none;
}

.ep-category--estudos {
    background: #e37504;
    padding: 0 0 0 30px;
    border-radius: 0 40px 40px 40px;
}

.ep-category--pesquisas {
    background: #008f8c;
    padding: 0 30px 0 0;
    justify-content: flex-end;
    border-radius: 40px 0 40px 40px;
}

.ep-category__label {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 24px;
    color: #ffffff;
    white-space: nowrap;
    position: relative;
    z-index: 2;
}

/* ----- ANIMAIS DOS BOTÕES ------------------------------------- */

/* Container do animal — posicionado absolutamente, overflow acima do pill */
.ep-category__animal {
    position: absolute;
    overflow: hidden;
}

/*
 * Cachorro (Estudos): à direita do texto, overflow acima
 * left=165px (começa depois do texto), top=-57px (sobe acima do pill)
 * w=195px, h=137px; border-br-radius=40px conforme Figma
 */
.ep-category__animal--estudos {
    width: 195px;
    height: 137px;
    left: 165px;
    top: -57px;
    border-bottom-right-radius: 40px;
}

.ep-category__animal--estudos img {
    position: absolute;
    top: 0;
    left: 0;
    width: 102.56%;
    height: 145.99%;
    max-width: none;
    object-fit: cover;
}

/*
 * Gato (Pesquisas): à esquerda, overflow acima, espelhado horizontalmente
 * left=0, top=-41px, w=168px, h=121px; transform=scaleX(-1) conforme Figma
 */
.ep-category__animal--pesquisas {
    width: 168px;
    height: 121px;
    left: 0;
    top: -41px;
    border-bottom-right-radius: 40px;
    transform: scaleX(-1);
}

.ep-category__animal--pesquisas img {
    position: absolute;
    top: 0;
    left: 0;
    width: 104.17%;
    height: 144.63%;
    max-width: none;
    object-fit: cover;
}

/* ----- LISTA DE POSTS ----------------------------------------- */
.ep-posts {
    padding: 0 0 70px;
}

.ep-posts__title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 30px;
    line-height: 33.6px;
    color: #333333;
    margin: 0 0 16px;
    text-align: left;
    text-transform: none;
}

.ep-posts__list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.ep-posts__empty {
    text-align: center;
    color: #666;
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    margin: 30px 0 0;
}

.ep-posts__load-more {
    display: block;
    margin: 30px auto 0;
    padding: 14px 40px;
    border: none;
    border-radius: 50px;
    background: #fd8204;
    color: #fff;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.ep-posts__load-more[hidden] {
    display: none;
}

.ep-posts__load-more:hover {
    opacity: 0.85;
}

.ep-posts__load-more:disabled {
    opacity: 0.6;
    cursor: default;
}

/* ----- CARD --------------------------------------------------- */
.ep-card {
    display: flex;
    align-items: flex-start;
    text-decoration: none;
    color: inherit;
    border-radius: 14px;
    overflow: hidden;
    transition: opacity 0.2s;
}

.ep-card:hover {
    opacity: 0.85;
}

.ep-card__media {
    position: relative;
    flex: 1 0 0;
    height: 300px;
    border-radius: 14px 0 0 14px;
    overflow: hidden;
}

.ep-card__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100% !important;
    max-width: none;
    object-fit: cover;
    display: block;
}

.ep-card__badge {
    position: absolute;
    top: 12px;
    left: 12px;
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: #ffffff;
    padding: 5px 14px;
    border-radius: 50px;
    z-index: 2;
    line-height: 1;
}

.ep-card__badge--pesquisas {
    background: #008f8c;
}

.ep-card__badge--estudos {
    background: #e37504;
}

.ep-card__content {
    flex: 1 0 0;
    height: 300px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    text-align: left;
    border-radius: 0 14px 14px 0;
    box-sizing: border-box;
}

.ep-card--pesquisas .ep-card__content {
    background: #ebffff;
}

.ep-card--estudos .ep-card__content {
    background: #fff3e6;
}

.ep-card__title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 24px;
    line-height: 28px;
    color: #333333;
    margin: 0;
}

.ep-card__excerpt {
    font-family: 'Montserrat', sans-serif;
    font-size: 18px;
    line-height: 24px;
    color: #555555;
    margin: 0;
}

.ep-card__date {
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    line-height: 19.2px;
    color: #999999;
    display: block;
}

/* ----- PAGINAÇÃO ---------------------------------------------- */
.ep-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 40px 0 0;
}

.ep-pagination__item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 42px;
    border: 1px solid #b0b4b3;
    border-radius: 3px;
    font-family: 'Nunito', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #666666;
    text-decoration: none;
    padding: 0 15px;
    box-sizing: border-box;
    transition: border-color 0.2s, color 0.2s;
}

.ep-pagination__item--active {
    background: #fd8204;
    border-color: #b0b4b3;
    color: #ffffff;
}

.ep-pagination__item--arrow {
    color: #666666;
    font-size: 14px;
}

.ep-pagination__item:hover:not(.ep-pagination__item--active) {
    border-color: #555555;
}


/* ----- NEWSLETTER --------------------------------------------- */
.ep-newsletter-section {
    padding: 60px 0 70px;
}

.ep-newsletter {
    display: flex;
    border: 1px solid #cccccc;
    border-radius: 20px;
    overflow: hidden;
}

.ep-newsletter__image {
    flex: 0 0 44%;
    width: 44%;
    position: relative;
    overflow: hidden;
}

.ep-newsletter__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ep-newsletter__form {
    flex: 1 0 0;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 31px 31px 31px 30px;
    background: #ffffff;
}

.ep-newsletter__inner {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: flex-end;
    width: 100%;
}

.ep-newsletter__desc {
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 19px;
    line-height: 22.8px;
    color: #333333;
    margin: 0;
    text-align: left;
    width: 100%;
}

.ep-newsletter__input {
    width: 100%;
    height: 46px;
    border: 1px solid #cccccc;
    border-radius: 8px;
    padding: 0 17px;
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    color: #333333;
    background: #ffffff;
    box-sizing: border-box;
    outline: none;
}

.ep-newsletter__input::placeholder {
    color: #777777;
}

.ep-newsletter__btn {
    width: 100%;
    height: 46px;
    background: #7eb339;
    color: #ffffff;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 18px;
    border-radius: 45px;
    border: none;
    cursor: pointer;
    text-transform: capitalize;
}


/* ----- SAIU NA MÍDIA ----------------------------------------- */
.ep-media {
    padding: 0 0 70px;
}

.ep-media__card {
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 24px;
    overflow: hidden;
}

.ep-media__hero {
    position: relative;
    height: 190px;
    overflow: hidden;
    border-radius: 24px 24px 0 0;
    display: flex;
    align-items: center;
}

.ep-media__hero-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.ep-media__hero-bg img {
    position: absolute;
    left: 0;
    width: 100%;
    height: 204.44%;
    top: -37.32%;
    object-fit: cover;
    max-width: none;
}

.ep-media__hero-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.54));
}

.ep-media__hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.ep-media__hero-text {
    flex: 1 0 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    text-align: left;
}

.ep-media__hero-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 36px;
    color: #ffffff;
    margin: 0;
    text-transform: none;
    text-align: left;
    line-height: normal;
}

.ep-media__hero-subtitle {
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 18px;
    line-height: 26px;
    color: #ffffff;
    margin: 0;
    white-space: nowrap;
}

.ep-media__hero-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 46px;
    padding: 5px 30px;
    border: 1px solid #ffffff;
    border-radius: 50px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 16px;
    line-height: 22px;
    color: #ffffff;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.2s;
}

.ep-media__hero-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.ep-media__logos {
    overflow: hidden;
}

.ep-media__logos-inner {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 64px;
    width: max-content;
    padding: 22px 30px 16px;
    transition: transform 0.35s ease;
    will-change: transform;
    cursor: grab;
}

.ep-media__logos-inner:active {
    cursor: grabbing;
}

.ep-media__logo-wrap {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.ep-media__logo-wrap img {
    max-height: 48px;
    max-width: none;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
}

.ep-media__logo-wrap:first-child {
    margin-right: -10px;
}

.ep-media__logo-wrap:first-child img {
    max-height: 54px;
    max-width: 54px;
}

.ep-media__logo-wrap:nth-child(5) img {
    height: 48px;
    width: auto;
    max-height: none;
}

.ep-media__logo-wrap:last-child img {
    max-height: 54px;
    max-width: 72px;
}

.ep-media__nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 0 12px;
}

.ep-media__nav-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: #d0d0d0;
    cursor: pointer;
    padding: 0;
    transition: background-color 0.2s, width 0.2s, border-radius 0.2s;
}

.ep-media__nav-dot--active {
    background: #e37504;
    width: 24px;
    border-radius: 4px;
}


/* =====================================================
   MACBOOK AIR M2 — max-width: 1440px
   Proporcoes ajustadas: escala ~85% dos valores base
   para manter fidelidade visual ao Figma (1920px)
   ===================================================== */
@media (max-width: 1700px) {
    body.page-template-page-estudos-pesquisas {
        background-position: -150px top;
    }

    /* Hero: border-radius menor, proporcional ao viewport */
    .ep-hero {
        padding: 22px 0 0;
    }

    .ep-hero__banner {
        border-radius: 18px;
    }

    /* Descrição: mantém 18px — container 1140px é o mesmo do Figma */
    /* word-break já garante quebra proporcional */

    /* Busca */
    .ep-search-form {
        width: 550px;
    }

    .ep-search-form input[type="search"] {
        height: 52px;
        font-size: 15px;
    }

    /* Categorias — escala proporcional dos pills */
    .ep-categories__list {
        padding-top: 58px;
    }

    .ep-category {
        width: 300px;
        height: 68px;
    }

    .ep-category--estudos {
        border-radius: 0 34px 34px 34px;
    }

    .ep-category--pesquisas {
        border-radius: 34px 0 34px 34px;
    }

    .ep-category__label {
        font-size: 20px;
    }

    /* Ajusta posição do cachorro proporcionalmente (300/360 ≈ 0.83) */
    .ep-category__animal--estudos {
        width: 162px;
        height: 114px;
        left: 137px;
        top: -47px;
    }

    /* Ajusta posição do gato proporcionalmente */
    .ep-category__animal--pesquisas {
        width: 140px;
        height: 100px;
        top: -34px;
    }

    /* Posts */
    .ep-posts__title {
        font-size: 26px;
        line-height: 29px;
    }

    /* Card */
    .ep-posts__list {
        gap: 24px;
    }

    .ep-card__media {
        height: 255px;
    }

    .ep-card__content {
        height: 255px;
        padding: 24px;
        gap: 12px;
    }

    .ep-card__title {
        font-size: 20px;
        line-height: 24px;
    }

    .ep-card__excerpt {
        font-size: 15px;
        line-height: 21px;
    }

    .ep-card__date {
        font-size: 14px;
    }

    /* Newsletter */
    .ep-newsletter-section {
        padding: 50px 0 50px;
    }

    .ep-newsletter__desc {
        font-size: 16px;
    }

    .ep-newsletter__btn {
        font-size: 16px;
    }

    /* Saiu na mídia */
    .ep-media {
        padding: 0 0 60px;
    }

    .ep-media__hero-title {
        font-size: 30px;
    }

    .ep-media__hero-subtitle {
        font-size: 15px;
        line-height: 22px;
    }

    .ep-media__hero-btn {
        font-size: 13px;
        height: 40px;
        padding: 0 22px;
    }
}


/* =====================================================
   MOBILE — max-width: 768px
   ===================================================== */
@media (max-width: 768px) {
    /* Hero */
    .ep-hero {
        padding: 16px 0 0;
    }

    .ep-hero__banner {
        border-radius: 12px;
    }

    /* Descrição */
    .ep-description {
        padding: 18px 0 6px;
    }

    .ep-description__text {
        font-size: 16px;
        line-height: 24px;
        text-align: left;
    }

    /* Busca */
    .ep-search {
        padding: 14px 0 20px;
    }

    .ep-search-form {
        width: 100%;
    }

    .ep-search-form input[type="search"] {
        font-size: 15px;
        height: 60px;
    }

    /* Categorias */
    .ep-categories {
        padding: 0 0 24px;
    }

    .ep-categories__list {
        flex-direction: column;
        gap: 30px;
        padding-top: 60px;
    }

    .ep-category {
        width: 100%;
        height: 80px;
    }

    .ep-category--estudos {
        border-radius: 0 40px 40px 40px;
    }

    .ep-category--pesquisas {
        border-radius: 40px 0 40px 40px;
    }


    .ep-category__label {
        font-size: 20px;
    }

    /* Animais no mobile mantêm tamanho desktop */
    .ep-category__animal--estudos {
        width: 195px;
        height: 137px;
        left: 165px;
        top: -57px;
    }

    .ep-category__animal--pesquisas {
        width: 168px;
        height: 121px;
        left: 0;
        top: -41px;
    }

    /* Posts */
    .ep-posts {
        padding: 0 0 40px;
    }

    .ep-posts__title {
        font-size: 24px;
        line-height: 28px;
    }

    /* Card */
    .ep-card {
        flex-direction: column;
        border-radius: 14px;
    }

    .ep-card__media {
        width: 100%;
        flex: none;
        height: 200px;
        border-radius: 14px 14px 0 0;
    }

    .ep-card__content {
        width: 100%;
        flex: none;
        height: auto;
        min-height: 160px;
        border-radius: 0 0 14px 14px;
        padding: 20px;
        gap: 10px;
    }

    .ep-card__title {
        font-size: 20px;
        line-height: 24px;
    }

    .ep-card__excerpt {
        font-size: 16px;
        line-height: 22px;
    }

    /* Paginação */
    .ep-pagination {
        padding-top: 24px;
        gap: 6px;
    }

    .ep-pagination__item {
        min-width: 34px;
        height: 36px;
        font-size: 13px;
        padding: 0 10px;
    }

    /* Newsletter */
    .ep-newsletter-section {
        padding: 32px 0 40px;
    }

    .ep-newsletter {
        flex-direction: column;
    }

    .ep-newsletter__image {
        flex: none;
        width: 100%;
        height: 215px;
    }

    .ep-newsletter__form {
        padding: 24px 20px;
    }

    .ep-newsletter__desc {
        font-size: 15px;
        line-height: 20px;
    }

    .ep-newsletter__btn {
        font-size: 16px;
    }

    /* Saiu na mídia */
    .ep-media {
        padding: 0 0 40px;
    }

    .ep-media__hero {
        height: 220px;
        min-height: 0;
    }

    .ep-media__hero-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        padding: 20px;
    }

    .ep-media__hero-title {
        font-size: 24px;
    }

    .ep-media__hero-subtitle {
        font-size: 16px;
        line-height: 22px;
        white-space: normal;
    }

    .ep-media__hero-btn {
        height: 46px;
        padding: 5px 20px;
    }

    .ep-media__logos-inner {
        gap: 36px;
        padding: 18px 15px 14px;
    }

    .ep-media__logo-wrap img {
        max-height: 34px;
    }

    .ep-media__logo-wrap:first-child img {
        max-height: 48px;
        max-width: 48px;
    }

    .ep-media__logo-wrap:nth-child(5) img {
        height: 34px;
    }

    .ep-media__logo-wrap:last-child img {
        max-height: 48px;
        max-width: 70px;
    }
}
