.ccm-search-block {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.ccm-search-block-box {
    position: relative;
}

.ccm-search-form {
    margin: 0;
}

.ccm-search-input-wrapper {
    position: relative;
    display: flex;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.ccm-search-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    font-size: 0.95rem;
    outline: none;
}

.ccm-search-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.3);
}

.ccm-search-submit {
    border: none;
    background: #2563eb;
    color: #fff;
    border-radius: 999px;
    padding: 0 0.9rem;
    margin-left: 0.4rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ccm-search-submit:hover {
    background: #1d4ed8;
}

.ccm-search-icon {
    font-size: 1rem;
}

.ccm-search-suggestions {
    position: absolute;
    z-index: 20;
    top: 100%;
    left: 0;
    margin-top: 0.35rem;
    width: 100%;
    max-width: 640px;
    background: #ffffff;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.15);
    overflow: hidden;
}

.ccm-search-suggestion {
    width: 100%;
    text-align: left;
    padding: 0.6rem 0.9rem;
    border: none;
    background: #ffffff;
    font-size: 0.9rem;
    cursor: pointer;
    display: block;
}

.ccm-search-suggestion + .ccm-search-suggestion {
    border-top: 1px solid #f3f4f6;
}

.ccm-search-suggestion:hover {
    background: #f9fafb;
}

.ccm-search-block-results h2 {
    margin-bottom: 0.5rem;
}

.ccm-search-query {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #4b5563;
}

.ccm-pagination {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    align-items: center;
}

.ccm-page-link {
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    font-size: 0.85rem;
    text-decoration: none;
    color: #374151;
}

.ccm-page-link:hover {
    background: #f3f4f6;
}

.ccm-page-link-active {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

.ccm-page-prev, .ccm-page-next {
    font-weight: 500;
}

/* === CCM custom: responsive search input + anchored overlay === */
.ccm-search-block,
.ccm-search-block-box {
    width: 100%;
}

.ccm-search-block-box .ccm-search-form {
    width: 100%;
}

.ccm-search-block-box .ccm-search-input {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    font-size: clamp(14px, 4vw, 18px);
    box-sizing: border-box;
}

/* Search button inside input on small screens */
@media (max-width: 768px) {
    .ccm-search-input {
        padding-right: 2.5rem;
    }

    .ccm-search-submit {
        position: absolute;
        right: 0.35rem;
        top: 50%;
        transform: translateY(-50%);
        margin-left: 0;
        height: 2.1rem;
        width: 2.1rem;
        padding: 0;
        border-radius: 999px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

/* Overlay root just for click capture, transparent */
.ccm-search-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    pointer-events: none;
}

.ccm-search-overlay.is-open {
    display: block;
    pointer-events: auto;
}

/* Panel positioned by JS under search bar */
.ccm-search-overlay-panel {
    position: fixed;
    background: #ffffff;
    border-radius: 1.5rem;
    padding: 1rem 1.25rem 1.5rem;
    box-shadow: 0 24px 80px rgba(15, 23, 42, 0.35);
    max-height: 70vh;
    overflow: hidden;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    /* Prevent any horizontal overflow on small screens */
    max-width: calc(100vw - 16px);
}

.ccm-search-overlay-results {
    overflow-y: auto;
    padding-right: 0.25rem;
    overflow-x: hidden;
}

/* Suggestion items */
.ccm-search-suggestion {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    padding: 0.45rem 0.4rem;
    border-radius: 0.6rem;
    border: none;
    width: 100%;
    background: transparent;
    cursor: pointer;
}

/* When suggestions are rendered as <a>, keep them looking like list items (not links). */
.ccm-search-suggestion {
    text-decoration: none;
    color: inherit;
}

.ccm-search-suggestion + .ccm-search-suggestion {
    border-top: none;
}

.ccm-search-suggestion:hover {
    background: #f3f4f6;
}

.ccm-search-suggestion-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.1rem;
    overflow-wrap: anywhere;
}

.ccm-search-suggestion-text {
    font-size: 0.8rem;
    color: #4b5563;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Avoid accidental page-level horizontal scroll caused by the overlay */
#ccm-search-overlay {
    overflow-x: hidden;
}

/* Small screens: slightly softer radius */
@media (max-width: 768px) {
    .ccm-search-overlay-panel {
        border-radius: 1rem;
    }
}

.ccm-search-submit{
  display: none;
}
