/* Search enhancement only. All selectors are isolated with the tm-search prefix. */
.tm-search-trigger {
    width: 34px;
    height: 34px;
    min-width: 34px;
    padding: 0;
    margin: 0 12px 0 8px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color .2s ease, transform .2s ease;
    flex: 0 0 auto;
}

.tm-search-trigger svg {
    width: 17px;
    height: 17px;
    fill: currentColor;
}

.tm-search-trigger:hover,
.tm-search-trigger:focus-visible {
    background: #FE9F53;
}

.tm-search-trigger:focus-visible,
.tm-search-close:focus-visible,
.tm-search-submit:focus-visible,
.tm-search-form input:focus-visible,
.tm-search-results-form input:focus-visible,
.tm-search-results-form button:focus-visible {
    outline: 2px solid #FE9F53;
    outline-offset: 3px;
}

body.tm-search-open {
    overflow: hidden !important;
}

.tm-search-overlay[hidden] {
    display: none !important;
}

.tm-search-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(20, 18, 32, 0.52);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.tm-search-dialog {
    position: relative;
    width: min(720px, 100%);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .24);
}

.tm-search-dialog-inner {
    padding: 52px 52px 48px;
}

.tm-search-close {
    position: absolute;
    top: 15px;
    right: 16px;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f5f3f7;
    color: #342d42;
    font-size: 30px;
    line-height: 38px;
    cursor: pointer;
}

.tm-search-eyebrow {
    margin-bottom: 10px;
    color: #FE9F53;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.tm-search-dialog h2 {
    margin: 0 0 26px;
    color: #272727;
    font-family: 'Gilroy', sans-serif;
    font-size: 34px;
    line-height: 1.2;
    font-weight: 600;
}

.tm-search-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tm-search-input-icon {
    position: absolute;
    left: 18px;
    width: 20px;
    height: 20px;
    fill: #77717f;
    pointer-events: none;
}

.tm-search-form input[type="search"] {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    height: 56px;
    padding: 0 18px 0 50px;
    border: 1px solid #e0dce5;
    border-radius: 12px;
    background: #fff;
    color: #272727;
    font-family: 'Gilroy', sans-serif;
    font-size: 16px;
    appearance: none;
    -webkit-appearance: none;
}

.tm-search-submit {
    height: 56px;
    padding: 0 27px;
    border: 0;
    border-radius: 12px;
    background: #FE9F53;
    color: #fff;
    font-family: 'Gilroy', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    flex: 0 0 auto;
}

/* Search results page */
.tm-search-results-hero {
    box-sizing: border-box;
    min-height: 330px;
    padding: 155px 0 70px;
    background: linear-gradient(135deg, #2f2948 0%, #4b3c67 100%);
}

.tm-search-results-kicker {
    margin: 0 0 8px;
    color: #FE9F53;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.tm-search-results-hero h1 {
    margin: 0;
    color: #fff;
    font-family: 'Gilroy', sans-serif;
    font-size: 46px;
    line-height: 1.12;
    font-weight: 600;
}

.tm-search-results-page {
    padding: 60px 0 80px;
    background: #fff;
}

.tm-search-results-summary {
    margin: 0 0 28px;
    color: #68636c;
    font-size: 16px;
    line-height: 1.55;
}

.tm-search-results-form {
    display: flex;
    gap: 10px;
    max-width: 700px;
    margin-top: 28px;
}

.tm-search-results-form input[type="search"] {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    height: 54px;
    padding: 0 18px;
    border: 1px solid rgba(255,255,255,.38);
    border-radius: 12px;
    background: rgba(255,255,255,.12);
    color: #fff;
    font: inherit;
}

.tm-search-results-form input[type="search"]::placeholder {
    color: rgba(255,255,255,.72);
}

.tm-search-results-form button {
    height: 54px;
    padding: 0 26px;
    border: 0;
    border-radius: 12px;
    background: #FE9F53;
    color: #fff;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    flex: 0 0 auto;
}

.tm-search-results-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.tm-search-result-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid #ece9ef;
    border-radius: 16px;
    background: #fff;
    transition: transform .2s ease, box-shadow .2s ease;
}

.tm-search-result-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 34px rgba(35, 28, 48, .09);
}

.tm-search-result-media {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #f4f2f6;
}

.tm-search-result-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}

.tm-search-result-card:hover .tm-search-result-media img {
    transform: scale(1.025);
}

.tm-search-result-body {
    padding: 22px;
}

.tm-search-result-type {
    display: block;
    margin-bottom: 8px;
    color: #FE9F53;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.tm-search-result-title {
    margin: 0 0 10px;
    font-size: 21px;
    line-height: 1.3;
    font-weight: 600;
}

.tm-search-result-title a {
    color: #272727;
}

.tm-search-result-excerpt {
    margin: 0 0 18px;
    color: #68636c;
    font-size: 15px;
    line-height: 1.55;
}

.tm-search-result-link {
    color: #FE9F53;
    font-size: 14px;
    font-weight: 600;
}

.tm-search-empty {
    padding: 34px;
    border-radius: 16px;
    background: #f7f5f8;
    color: #5e5963;
}

.tm-search-pagination {
    margin-top: 42px;
}

.tm-search-pagination .nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tm-search-pagination .page-numbers {
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f4f2f6;
    color: #302a37;
}

.tm-search-pagination .page-numbers.current,
.tm-search-pagination a.page-numbers:hover {
    background: #FE9F53;
    color: #fff;
}

@media (max-width: 992px) {
    .tm-search-trigger {
        width: 40px;
        height: 40px;
        min-width: 40px;
        margin: 0 10px 0 0;
        background: rgba(255, 255, 255, .22);
    }

    .tm-search-trigger svg {
        width: 18px;
        height: 18px;
    }

    .tm-search-results-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .tm-search-overlay {
        padding: 16px;
    }

    .tm-search-dialog {
        border-radius: 17px;
    }

    .tm-search-dialog-inner {
        padding: 48px 20px 24px;
    }

    .tm-search-dialog h2 {
        margin-bottom: 20px;
        font-size: 27px;
    }

    .tm-search-input-wrap,
    .tm-search-results-form {
        flex-direction: column;
        align-items: stretch;
    }

    .tm-search-submit,
    .tm-search-results-form button {
        width: 100%;
    }

    .tm-search-results-hero {
        min-height: 300px;
        padding: 135px 0 50px;
    }

    .tm-search-results-hero h1 {
        font-size: 34px;
    }

    .tm-search-results-page {
        padding: 38px 0 58px;
    }

    .tm-search-results-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tm-search-trigger,
    .tm-search-result-card,
    .tm-search-result-media img {
        transition: none;
    }
}
