/* ==========================================================================
   Cooper Recent Posts Widget (Search + Recent Posts Sidebar)
   Escala tipográfica base de 4 resoluciones (Funnel Sans, sin !important)
   ========================================================================== */

.cooper-rp-wrap {
    font-family: var(--cooper-font-primary, 'Funnel Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    width: 100%;
    box-sizing: border-box;
}

/* 1. Search Box */
.cooper-rp-search-form {
    position: relative;
    margin: 0 0 42px 0;
    width: 100%;
}

/* Live Search Dropdown Results */
.cooper-rp-live-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 60;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-top: none;
    box-shadow: 0 12px 28px rgba(17, 24, 39, 0.08);
    max-height: 320px;
    overflow-y: auto;
    box-sizing: border-box;
}

.cooper-rp-live-results[hidden] {
    display: none;
}

.cooper-rp-live-list {
    list-style: none;
    margin: 0;
    padding: 6px 0;
}

.cooper-rp-live-item {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #f3f4f6;
}

.cooper-rp-live-item:last-child {
    border-bottom: none;
}

.cooper-rp-live-link {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 18px;
    text-decoration: none;
    color: #111827;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.cooper-rp-live-item.is-active .cooper-rp-live-link,
.cooper-rp-live-link:hover {
    background-color: #f9fafb;
    color: #c8102e;
    text-decoration: none;
}

.cooper-rp-live-title {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.35;
}

.cooper-rp-live-date {
    font-size: 12px;
    font-weight: 400;
    color: #9ca3af;
}

.cooper-rp-live-empty {
    padding: 14px 18px;
    font-size: 14px;
    color: #7a7a7a;
}

.cooper-rp-search-box {
    display: flex;
    align-items: center;
    width: 100%;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0;
    padding: 6px 6px 6px 18px;
    box-sizing: border-box;
    transition: border-color 0.25s ease;
}

.cooper-rp-search-box:focus-within {
    border-color: #c8102e;
}

:where(.cooper-rp-wrap .cooper-rp-search-box) input.cooper-rp-search-input[type="search"] {
    flex: 1 1 auto;
    min-width: 0;
    width: 100%;
    height: auto;
    min-height: 0;
    border: 0;
    border-radius: 0;
    outline: none;
    background: transparent;
    background-color: transparent;
    font-family: inherit;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: -0.2px;
    color: #111827;
    padding: 8px 12px 8px 0;
    margin: 0;
    box-shadow: none;
    appearance: none;
    -webkit-appearance: none;
}

:where(.cooper-rp-wrap .cooper-rp-search-box) input.cooper-rp-search-input[type="search"]::placeholder {
    color: #9ca3af;
    opacity: 1;
}

:where(.cooper-rp-wrap .cooper-rp-search-box) input.cooper-rp-search-input[type="search"]:focus {
    border: 0;
    outline: none;
    box-shadow: none;
    background: transparent;
}

:where(.cooper-rp-wrap .cooper-rp-search-box) button.cooper-rp-search-btn[type="submit"] {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 0;
    min-height: 0;
    background-color: #c8102e;
    color: #ffffff;
    border: 0;
    border-radius: 0;
    padding: 0;
    margin: 0;
    box-shadow: none;
    cursor: pointer;
    transition: background-color 0.25s ease, color 0.25s ease;
}

:where(.cooper-rp-wrap .cooper-rp-search-box) button.cooper-rp-search-btn[type="submit"]:hover,
:where(.cooper-rp-wrap .cooper-rp-search-box) button.cooper-rp-search-btn[type="submit"]:focus {
    background-color: #9e0b23;
    color: #ffffff;
    border: 0;
    outline: none;
}

:where(.cooper-rp-wrap .cooper-rp-search-box) button.cooper-rp-search-btn[type="submit"] svg {
    width: 18px;
    height: 18px;
    display: block;
    flex-shrink: 0;
}

/* Variant 2: Minimal Icon (Left) */
.cooper-rp-search-box.is-style-icon_left {
    flex-direction: row-reverse;
    padding: 12px 18px;
    border: 1px solid #b5b5b5;
}

:where(.cooper-rp-wrap .cooper-rp-search-box.is-style-icon_left) button.cooper-rp-search-btn[type="submit"] {
    width: auto;
    height: auto;
    background-color: transparent;
    color: #8a8a8a;
    padding: 0 16px 0 2px;
}

:where(.cooper-rp-wrap .cooper-rp-search-box.is-style-icon_left) button.cooper-rp-search-btn[type="submit"] svg {
    width: 20px;
    height: 20px;
}

:where(.cooper-rp-wrap .cooper-rp-search-box.is-style-icon_left) button.cooper-rp-search-btn[type="submit"]:hover,
:where(.cooper-rp-wrap .cooper-rp-search-box.is-style-icon_left) button.cooper-rp-search-btn[type="submit"]:focus {
    background-color: transparent;
    color: #c8102e;
}

:where(.cooper-rp-wrap .cooper-rp-search-box.is-style-icon_left) input.cooper-rp-search-input[type="search"] {
    padding: 4px 0;
    font-size: 16px;
    font-weight: 500;
    color: #000000;
}

:where(.cooper-rp-wrap .cooper-rp-search-box.is-style-icon_left) input.cooper-rp-search-input[type="search"]::placeholder {
    color: #000000;
    font-weight: 500;
}

/* 2. Heading ("RECENT POSTS") */
.cooper-rp-heading {
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.2px;
    text-transform: uppercase;
    color: #111827;
    margin: 0 0 24px 0;
}

/* 3. Posts List */
.cooper-rp-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.cooper-rp-item {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cooper-rp-list.has-dividers .cooper-rp-item {
    padding-bottom: 18px;
    border-bottom: 1px solid #e5e7eb;
}

.cooper-rp-list.has-dividers .cooper-rp-item:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.cooper-rp-link {
    font-family: inherit;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: -0.3px;
    color: #7a7a7a;
    text-decoration: none;
    display: block;
    transition: color 0.25s ease;
}

.cooper-rp-link:hover {
    color: #c8102e;
    text-decoration: none;
}

.cooper-rp-date {
    font-family: inherit;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.3;
    color: #9ca3af;
}

.cooper-rp-empty {
    font-size: 16px;
    color: #7a7a7a;
    margin: 0;
}

/* ==========================================================================
   Widescreen (>= 1920px)
   ========================================================================== */
@media (min-width: 1920px) {
    .cooper-rp-heading {
        font-size: 16px;
    }

    .cooper-rp-search-input {
        font-size: 18px;
    }

    .cooper-rp-search-btn {
        width: 50px;
        height: 50px;
    }

    .cooper-rp-link {
        font-size: 20px;
    }
}

/* ==========================================================================
   Tablet (<= 1024px)
   ========================================================================== */
@media (max-width: 1024px) {
    .cooper-rp-heading {
        font-size: 14px;
    }

    .cooper-rp-link {
        font-size: 17px;
    }
}

/* ==========================================================================
   Mobile (<= 767px)
   ========================================================================== */
@media (max-width: 767px) {
    .cooper-rp-search-form {
        margin-bottom: 32px;
    }

    .cooper-rp-heading {
        font-size: 3.5vw;
        margin-bottom: 18px;
    }

    .cooper-rp-search-input {
        font-size: 4.2vw;
    }

    .cooper-rp-search-btn {
        width: 48px;
        height: 48px;
    }

    .cooper-rp-link {
        font-size: 4.4vw;
        line-height: 1.4;
    }

    .cooper-rp-list {
        gap: 18px;
    }
}
