/* ═══════════════════════════════════════════════════════════
   TDN MAGAZINE — Live Search Dropdown
   live-search.css
═══════════════════════════════════════════════════════════ */

/* ── Wrapper must be positioned so dropdown is relative to it ── */
.tdn-live-search-wrap {
    position: relative;
    display: contents; /* Transparent wrapper — doesn't break existing flex/grid layout */
}

/* When wrapping an input that IS a flex/grid child, switch to block */
.tdn-hdr-search-form .tdn-live-search-wrap,
.tdn-search-form .tdn-live-search-wrap {
    display: block;
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
}

/* ── The dropdown panel ────────────────────────────────────── */
.tdn-live-search-dropdown {
    position: absolute;
    top: calc( 100% + 4px );
    left: 0;
    right: 0;
    z-index: 99999;
    background: #fff;
    border: 1px solid var(--tdn-border, #e0e0e0);
    border-radius: 4px;
    box-shadow: 0 8px 32px rgba(0,0,0,.12), 0 2px 8px rgba(0,0,0,.08);
    overflow: hidden;
    max-height: 420px;
    overflow-y: auto;
}

/* ── Individual result items ───────────────────────────────── */
.tdn-live-search-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 16px;
    text-decoration: none;
    color: var(--tdn-text, #1a1a1a);
    border-bottom: 1px solid var(--tdn-border, #ebebeb);
    transition: background .1s;
    cursor: pointer;
    outline: none;
}
.tdn-live-search-item:last-of-type {
    border-bottom: none;
}
.tdn-live-search-item:hover,
.tdn-live-search-item:focus,
.tdn-live-search-item--active {
    background: var(--tdn-bg-soft, #f5f5f5);
}

/* ── Title and highlight ───────────────────────────────────── */
.tdn-live-search-title {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--tdn-text, #1a1a1a);
    flex: 1 1 auto;
    min-width: 0;
}
.tdn-live-search-title mark {
    background: transparent;
    color: var(--tdn-red, #e51a3e);
    font-weight: 700;
}

/* ── Category badge ────────────────────────────────────────── */
.tdn-live-search-cat {
    font-family: var(--font-ui, 'Inter', sans-serif);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--tdn-muted, #777);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Empty state ───────────────────────────────────────────── */
.tdn-live-search-empty {
    padding: 16px;
    font-size: 13px;
    color: var(--tdn-muted, #777);
    text-align: center;
    font-style: italic;
}

/* ── "See all results" footer link ────────────────────────── */
.tdn-live-search-all {
    display: block;
    padding: 10px 16px;
    font-family: var(--font-ui, 'Inter', sans-serif);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--tdn-red, #e51a3e);
    background: var(--tdn-bg-soft, #f5f5f5);
    border-top: 1px solid var(--tdn-border, #e0e0e0);
    text-align: center;
    transition: background .1s;
}
.tdn-live-search-all:hover,
.tdn-live-search-all--active {
    background: #ececec;
}

/* ── Mobile: full-width below the header search ─────────────── */
@media ( max-width: 768px ) {
    .tdn-live-search-dropdown {
        left: -16px;
        right: -16px;
        border-radius: 0 0 4px 4px;
    }
}
