.course-search { position: relative; width: 100%; min-width: 0; font-family: Inter, sans-serif; }
.course-search-nav-row { padding: 0 1rem 1rem; max-width: 64rem; margin: 0 auto; }
#main-nav .course-search-nav-row form.course-search { display: block !important; width: 100%; }
#main-nav .course-search-nav-row form.course-search--mobile { display: none !important; }
.course-search__field { display: flex; align-items: center; gap: .75rem; padding: .35rem .4rem .35rem 1.1rem; border: 1px solid #b6cbd0; border-radius: 999px; background: #f8fafc; transition: border-color .15s, box-shadow .15s; }
.course-search__field:focus-within { border-color: #009baa; box-shadow: 0 0 0 3px #009baa20; background: #fff; }
.course-search__icon { color: #64748b; flex-shrink: 0; }
.course-search__input { min-width: 0; width: 100%; border: 0; background: transparent; color: #0f172a; padding: .55rem 0; font-size: .95rem; box-shadow: none !important; outline: none; }
.course-search__input::placeholder { color: #64748b; opacity: 1; }
.course-search__submit { flex-shrink: 0; display: flex; align-items: center; gap: .5rem; padding: .7rem 1.15rem; border-radius: 999px; background: #007e8a; color: #fff; font-weight: 600; font-size: .875rem; }
.course-search__submit:hover { background: #006975; }
.course-search__submit:focus-visible, .course-search__all:focus-visible { outline: 3px solid #009baa; outline-offset: 3px; }
.course-search__panel { position: absolute; top: calc(100% + .5rem); left: 0; right: 0; z-index: 60; border: 1px solid #e2e8f0; border-radius: 1rem; background: #fff; box-shadow: 0 16px 36px #0f172a24; overflow: hidden; color: #0f172a; }
.course-search [hidden] { display: none !important; }
.course-search__message { padding: 1rem; margin: 0; font-size: .875rem; color: #475569; }
.course-search [role="listbox"] { max-height: max(6rem, min(26rem, 50vh, calc(100dvh - 17rem))); overflow-y: auto; overscroll-behavior: contain; }
.course-search__option { display: flex; align-items: center; gap: .8rem; padding: .8rem 1rem; color: #0f172a; text-decoration: none; border-bottom: 1px solid #f1f5f9; }
.course-search__option:hover, .course-search__option[aria-selected="true"], .course-search__option:focus-visible { background: #ecfeff; outline: none; }
.course-search__image { width: 3.25rem; height: 3.25rem; border-radius: .5rem; object-fit: cover; flex-shrink: 0; background: #f1f5f9; }
.course-search__image-placeholder { display: flex; justify-content: center; align-items: center; color: #007e8a; }
.course-search__text { min-width: 0; }
.course-search__title { display: block; font-size: .9rem; line-height: 1.4; font-weight: 600; }
.course-search__category { display: block; margin-top: .2rem; color: #64748b; font-size: .8rem; }
.course-search__all { display: block; padding: 1rem; font-size: .875rem; font-weight: 700; color: #006975; background: #f0fdfa; text-align: center; }
.course-search--drawer .course-search__panel { position: relative; top: auto; margin-top: .5rem; box-shadow: none; }
@media (max-width: 1023px) {
    #main-nav .course-search-nav-row form.course-search--desktop { display: none !important; }
    #main-nav .course-search-nav-row form.course-search--mobile { display: block !important; }
    .course-search-nav-row { padding-bottom: .75rem; }
    .course-search__input { font-size: 1rem; }
}
@media (max-width: 400px) {
    .course-search__field { gap: .45rem; padding-left: .8rem; }
    .course-search__submit { padding: .65rem .8rem; }
    .course-search__submit span { display: none; }
}

.course-search__error { margin: .5rem .75rem; font-size: .875rem; color: #b91c1c; }

/* Homepage search: centered focal point with unclipped suggestions. */
.welcome-hero.welcome-hero--search { overflow: visible; isolation: isolate; z-index: 2; }
.welcome-hero-search { position: relative; z-index: 20; width: 100%; max-width: 50rem; margin: 0 auto; text-align: center; color: #fff; }
.welcome-hero-search__eyebrow { display: flex; justify-content: center; align-items: center; gap: .5rem; margin: 0 0 .6rem; font-size: .75rem; font-weight: 600; letter-spacing: .04em; color: #a5e6df; }
.welcome-hero-search__title { margin: 0 0 1rem; color: #fff; font-size: clamp(1.3rem, 3vw, 1.8rem); font-weight: 700; letter-spacing: -.02em; }
.welcome-hero-search__hint { margin: .8rem 0 0; font-size: .8rem; color: #ffffffb8; }
.course-search--hero { padding: .5rem; border: 1px solid #ffffff38; border-radius: 1.4rem; background: #ffffff12; box-shadow: 0 18px 48px #00182040; backdrop-filter: blur(12px); }
.course-search--hero .course-search__field { border: 1px solid #fff; border-radius: 1rem; padding: .45rem .5rem .45rem 1.3rem; background: #fff; transition: box-shadow .2s, border-color .2s, transform .2s; }
.course-search--hero .course-search__field:focus-within { border-color: #6fe3d9; box-shadow: 0 0 0 4px #4dd9cc33, 0 10px 35px #00252b30; transform: translateY(-1px); }
.course-search--hero .course-search__icon { color: #007e8a; font-size: 1.2rem; }
.course-search--hero .course-search__input { padding: .9rem 0; font-size: 1.05rem; }
.course-search--hero .course-search__submit { border-radius: .75rem; padding: .9rem 1.45rem; background: linear-gradient(135deg, #009baa, #006975); box-shadow: 0 4px 12px #007e8a30; transition: transform .2s, box-shadow .2s; }
.course-search--hero .course-search__submit:hover { transform: translateY(-1px); box-shadow: 0 6px 16px #007e8a40; }
.course-search--hero .course-search__panel { top: calc(100% + .6rem); text-align: left; border-radius: 1.25rem; box-shadow: 0 24px 60px #001b3560; }
.course-search--hero [role="listbox"] { max-height: min(20rem, 24dvh); }
.course-search__panel { transform-origin: top center; animation: course-search-reveal .18s ease-out both; }
.course-search__message { border-bottom: 1px solid #f1f5f9; font-weight: 500; }
.course-search__option { transition: background .15s, box-shadow .15s; animation: course-search-row .2s ease-out both; }
.course-search__option:nth-child(2) { animation-delay: 20ms; }
.course-search__option:nth-child(3) { animation-delay: 40ms; }
.course-search__option:nth-child(4) { animation-delay: 60ms; }
.course-search__option:nth-child(5) { animation-delay: 80ms; }
.course-search__option:nth-child(6) { animation-delay: 100ms; }
.course-search__option:nth-child(n+7) { animation-delay: 120ms; }
.course-search__option:hover, .course-search__option[aria-selected="true"] { box-shadow: inset 3px 0 #009baa; }
.course-search__option-arrow { margin-left: auto; flex-shrink: 0; color: #007e8a; opacity: .35; transition: opacity .15s, transform .15s; }
.course-search__option:hover .course-search__option-arrow, .course-search__option[aria-selected="true"] .course-search__option-arrow { opacity: 1; transform: translateX(3px); }
.course-search__highlight, .course-search__title mark { color: #006975; background: #ccfbf1; border-radius: .2rem; padding: 0 .05rem; }
.course-search__all { transition: background .15s; }
.course-search__all:hover { background: #ccfbf1; }
.course-search__skeleton { display: flex; align-items: center; gap: .8rem; padding: .8rem 1rem; border-bottom: 1px solid #f1f5f9; }
.course-search__skeleton-image, .course-search__skeleton-lines span { background: linear-gradient(100deg, #e8eff2 25%, #f8fafc 45%, #e8eff2 65%); background-size: 220% 100%; animation: course-search-shimmer 1.2s ease-in-out infinite; }
.course-search__skeleton-image { width: 3.25rem; height: 3.25rem; flex-shrink: 0; border-radius: .6rem; }
.course-search__skeleton-lines { display: flex; flex: 1; flex-direction: column; gap: .65rem; }
.course-search__skeleton-lines span { height: .7rem; width: 76%; border-radius: .3rem; }
.course-search__skeleton-lines span + span { width: 43%; height: .55rem; }
@keyframes course-search-reveal { from { opacity: 0; transform: translateY(-6px) scale(.99); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes course-search-row { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes course-search-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (max-width: 767px) {
    .welcome-hero--search > .container { padding-top: 2rem; padding-bottom: 2rem; }
    .welcome-hero--search .welcome-hero__title { font-size: 2.25rem; }
    .welcome-hero-search__eyebrow { font-size: .7rem; }
    .course-search--hero { padding: .35rem; border-radius: 1.15rem; }
    .course-search--hero .course-search__field { gap: .6rem; padding-left: .8rem; }
    .course-search--hero .course-search__input { font-size: 1rem; padding: .7rem 0; }
    .course-search--hero .course-search__submit { padding: .8rem 1rem; }
    .course-search--hero .course-search__panel { position: relative; top: auto; margin-top: .6rem; }
    .course-search--hero [role="listbox"] { max-height: min(22rem, 50dvh); }
}
@media (min-width: 1024px) {
    .welcome-hero-grid { align-items: start; column-gap: 2rem; row-gap: 1.5rem; }
    .welcome-hero-intro { grid-column: 1 / 8; grid-row: 1; }
    .welcome-hero-search { grid-column: 1 / 8; grid-row: 2; }
    .welcome-hero-actions { grid-column: 1 / 8; grid-row: 3; }
    .welcome-hero-upcoming { grid-column: 8 / -1; grid-row: 1 / 4; align-self: center; }
    .welcome-hero--search .welcome-hero__title { font-size: clamp(2.5rem, 4vw, 3.75rem); }
}
@media (prefers-reduced-motion: reduce) {
    .course-search__panel, .course-search__option, .course-search__skeleton-image, .course-search__skeleton-lines span { animation: none; }
    .course-search__field, .course-search__submit, .course-search__option, .course-search__option-arrow, .course-search__all { transition: none !important; }
    .course-search--hero .course-search__field:focus-within, .course-search--hero .course-search__submit:hover, .course-search__option:hover .course-search__option-arrow, .course-search__option[aria-selected="true"] .course-search__option-arrow { transform: none; }
}

/* Native dialog keeps search results outside the hero layout. */
.course-search-modal-open { overflow: hidden; }
.course-search--hero { min-height: 84px; }
.course-search-dialog { box-sizing: border-box; width: min(760px, calc(100vw - 40px)); max-width: none; max-height: min(760px, calc(100dvh - 64px)); margin: auto; padding: 28px; border: 1px solid #e2e8f0; border-radius: 24px; background: #fff; color: #163841; box-shadow: 0 32px 100px #00182055; text-align: left; overflow-y: auto; overscroll-behavior: contain; }
.course-search-dialog::backdrop { background: #00252bc4; backdrop-filter: blur(5px); }
.course-search-dialog__header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 22px; }
.course-search-dialog__header h2 { margin: 0; font-size: 25px; font-weight: 700; letter-spacing: -.025em; color: #103e46; }
.course-search-dialog__close { display: grid; place-items: center; flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%; background: #f1f5f6; color: #425c65; font-size: 28px; cursor: pointer; }
.course-search-dialog__close:hover { background: #e3eded; }
.course-search-dialog__close:focus-visible { outline: 2px solid #007e8a; outline-offset: 3px; }
.course-search-dialog .course-search__field { border-color: #bfd6d8; background: #f7fafb; }
.course-search-dialog__hint { margin: 14px 0; font-size: 13px; color: #677980; }
.course-search--hero .course-search-dialog .course-search__panel { position: static; margin-top: 16px; border: 0; border-radius: 0; box-shadow: none; animation: none; }
.course-search--hero .course-search-dialog [role="listbox"] { max-height: min(390px, 44dvh); overflow-y: auto; }
.course-search-dialog .course-search__option { padding: 16px 10px; gap: 16px; }
.course-search-dialog .course-search__image { width: 64px; height: 64px; border-radius: 10px; }
.course-search-dialog .course-search__title { font-size: 16px; }
.course-search-dialog .course-search__category { font-size: 13px; }
.course-search-dialog .course-search__message { padding: 12px 4px; }
.course-search-dialog .course-search__all { margin-top: 16px; border-radius: 12px; }
@media (max-width: 600px) {
    .course-search-dialog { width: 100%; height: 100dvh; max-height: 100dvh; max-width: 100%; margin: 0; padding: 22px 16px; border: 0; border-radius: 0; }
    .course-search--hero .course-search-dialog [role="listbox"] { max-height: calc(100dvh - 330px); }
    .course-search-dialog .course-search__title { font-size: 14px; }
    .course-search-dialog .course-search__image { width: 52px; height: 52px; }
}
