/* Extracted from includes/header.php */
:root {
    --hdr-navy:    #0c1f3f;
    --hdr-navy2:   #1a365d;
    --hdr-red:     #dc2626;
    --hdr-red2:    #b91c1c;
    --hdr-border:  #e5e7eb;
    --hdr-bg:      #f8fafc;
    --hdr-bg2:     #f1f5f9;
    --hdr-ink:     #0f172a;
    --hdr-ink2:    #334155;
    --hdr-muted:   #64748b;
    --hdr-pale:    #94a3b8;
    --hdr-gold:    #f59e0b;
    --hdr-ff:      'DM Sans', 'Inter', system-ui, sans-serif;
    --hdr-ff-ser:  'Playfair Display', Georgia, serif;
    --hdr-ease:    cubic-bezier(.4,0,.2,1);
}


html {
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
}

body {
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 800;
    background: #fff;
    border-bottom: 1px solid var(--hdr-border);
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
    font-family: var(--hdr-ff);
    transition: box-shadow .2s;
}
.site-header.hdr-scrolled {
    box-shadow: 0 2px 16px rgba(0,0,0,.1);
}

.hdr-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

/* Logo */
.hdr-logo { display: flex; align-items: center; flex-shrink: 0; text-decoration: none; }
.hdr-logo-img {
    height: 40px; width: auto; max-width: 200px;
    object-fit: contain;
    transition: transform .2s;
}
.hdr-logo:hover .hdr-logo-img { transform: scale(1.03); }

/* Desktop actions */
.hdr-actions {
    display: flex; align-items: center; gap: 10px;
}
.hdr-mobile-actions { display: none; align-items: center; gap: 8px; }

/* Nav links */
.hdr-link {
    display: inline-flex; align-items: center; gap: 7px;
    font-family: var(--hdr-ff);
    font-size: .84rem; font-weight: 600;
    padding: 8px 16px; border-radius: 7px;
    transition: all .18s var(--hdr-ease);
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
}
.hdr-link--outline {
    color: var(--hdr-navy2);
    border: 1.5px solid var(--hdr-navy2);
    background: transparent;
}
.hdr-link--outline:hover { background: var(--hdr-navy2); color: #fff; }

.hdr-link--solid {
    background: var(--hdr-red);
    color: #fff;
    border: 1.5px solid transparent;
}
.hdr-link--solid:hover {
    background: var(--hdr-red2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220,38,38,.3);
}

/* Icon button */
.hdr-icon-btn {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border: none; border-radius: 8px;
    background: transparent;
    color: #4b5563;
    font-size: 1.05rem;
    cursor: pointer;
    transition: background .15s, color .15s;
    font-family: inherit;
    position: relative;
}
.hdr-icon-btn:hover { background: #f3f4f6; color: var(--hdr-navy2); }

/* Pulse dot on search */
#hdrSearchBtn::after {
    content: '';
    position: absolute; top: 7px; right: 7px;
    width: 7px; height: 7px;
    background: var(--hdr-red);
    border-radius: 50%;
    border: 2px solid #fff;
    animation: hdr-pulse 2s ease-in-out 3;
}
@keyframes hdr-pulse {
    0%,100% { transform: scale(1);    opacity: 1;  }
    50%      { transform: scale(1.5); opacity: .3; }
}
.hdr-icon-btn.hdr-used::after { display: none; }

/* Mobile responsive */
@media (max-width: 768px) {
    .hdr-inner { padding: 0 14px; height: 60px; }
    .hdr-logo-img { height: 34px; }
    .hdr-actions { display: none; }
    .hdr-mobile-actions { display: flex; }
    .hdr-icon-btn { width: 36px; height: 36px; font-size: .95rem; }
}
@media (max-width: 480px) {
    .hdr-inner { padding: 0 10px; height: 56px; }
    .hdr-logo-img { height: 30px; }
}


.hdr-srch-overlay {
    position: fixed; inset: 0;
    z-index: 9000;
    display: none;
    font-family: var(--hdr-ff);
}
.hdr-srch-overlay.hdr-srch-open { display: block; }

.hdr-srch-backdrop {
    position: absolute; inset: 0;
    background: rgba(15,23,42,.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: hdr-bd-in .2s ease;
}
@keyframes hdr-bd-in { from { opacity: 0; } to { opacity: 1; } }

/* Panel slides down from top */
.hdr-srch-panel {
    position: absolute;
    top: 0; left: 0; right: 0;
    background: #fff;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 24px 80px rgba(0,0,0,.22);
    display: flex; flex-direction: column;
    max-height: 90vh;
    overflow: hidden;
    animation: hdr-panel-in .28s cubic-bezier(.34,1.36,.64,1);
}
@keyframes hdr-panel-in {
    from { transform: translateY(-100%); opacity: 0; }
    to   { transform: translateY(0);     opacity: 1; }
}

/* Topbar */
.hdr-srch-topbar {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 22px;
    border-bottom: 1px solid var(--hdr-border);
    flex-shrink: 0;
}

.hdr-srch-field-wrap {
    flex: 1; min-width: 0;
    display: flex; align-items: center; gap: 10px;
    background: var(--hdr-bg);
    border: 2px solid var(--hdr-border);
    border-radius: 10px;
    padding: 0 14px;
    transition: border-color .18s, box-shadow .18s;
}
.hdr-srch-field-wrap:focus-within {
    border-color: var(--hdr-navy2);
    box-shadow: 0 0 0 3px rgba(26,54,93,.08);
    background: #fff;
}

.hdr-srch-ico { color: var(--hdr-pale); font-size: .95rem; flex-shrink: 0; }

.hdr-srch-input {
    flex: 1; min-width: 0;
    border: none; outline: none; background: transparent;
    font-family: var(--hdr-ff);
    font-size: 1.05rem; color: var(--hdr-ink);
    padding: 14px 0;
}
.hdr-srch-input::placeholder { color: var(--hdr-pale); }

.hdr-srch-clear {
    border: none; background: transparent;
    color: var(--hdr-pale); font-size: 1rem;
    cursor: pointer; padding: 4px;
    transition: color .15s;
    display: none; flex-shrink: 0;
}
.hdr-srch-clear:hover { color: var(--hdr-red); }
.hdr-srch-clear.hdr-show { display: block; }

.hdr-kbd {
    display: inline-block;
    font-size: .67rem; font-weight: 700;
    color: var(--hdr-pale);
    background: var(--hdr-bg2);
    border: 1px solid var(--hdr-border);
    border-radius: 4px; padding: 2px 6px;
    flex-shrink: 0; font-family: var(--hdr-ff);
}
@media (max-width: 480px) { .hdr-kbd { display: none; } }

.hdr-srch-close {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 14px;
    border: 1.5px solid var(--hdr-border);
    border-radius: 8px; background: transparent;
    font-family: var(--hdr-ff);
    font-size: .83rem; font-weight: 600;
    color: var(--hdr-muted); cursor: pointer;
    transition: all .15s; flex-shrink: 0;
}
.hdr-srch-close:hover { border-color: var(--hdr-red); color: var(--hdr-red); background: #fff1f1; }
@media (max-width: 480px) { .hdr-srch-close span { display: none; } }

/* Body area */
.hdr-srch-body {
    flex: 1; overflow-y: auto; padding: 20px 22px;
    scrollbar-width: thin; scrollbar-color: #cbd5e0 transparent;
}
@media (max-width: 600px) { .hdr-srch-body { padding: 14px; } }

/* Section labels */
.hdr-srch-label {
    display: flex; align-items: center; gap: 7px;
    font-size: .72rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: 1.4px;
    color: var(--hdr-muted); margin-bottom: 12px;
}
.hdr-srch-label i { color: var(--hdr-red); }

.hdr-srch-clear-rec {
    margin-left: auto;
    border: none; background: transparent;
    font-family: var(--hdr-ff);
    font-size: .72rem; font-weight: 600;
    color: var(--hdr-pale); cursor: pointer;
    transition: color .15s;
}
.hdr-srch-clear-rec:hover { color: var(--hdr-red); }

/* Topics */
.hdr-srch-topics { display: flex; flex-wrap: wrap; gap: 8px; }
.hdr-srch-topic {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 14px; border-radius: 30px;
    font-size: .82rem; font-weight: 600;
    background: var(--hdr-bg); color: var(--hdr-ink2);
    border: 1px solid var(--hdr-border);
    text-decoration: none;
    transition: all .16s;
}
.hdr-srch-topic i { font-size: .65rem; color: var(--hdr-pale); }
.hdr-srch-topic:hover { background: var(--hdr-navy); color: #fff; border-color: var(--hdr-navy); }

/* Recent tags */
.hdr-srch-recent { display: flex; flex-wrap: wrap; gap: 7px; }
.hdr-rec-tag {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: 30px;
    font-size: .81rem; font-weight: 500;
    background: var(--hdr-bg2); color: var(--hdr-ink2);
    border: 1px solid var(--hdr-border);
    text-decoration: none; transition: all .15s;
}
.hdr-rec-tag:hover { background: var(--hdr-border); }
.hdr-rec-tag i { font-size: .62rem; color: var(--hdr-pale); }
.hdr-srch-muted { font-size: .82rem; color: var(--hdr-pale); }

/* Spinner */
.hdr-srch-spinner {
    display: flex; align-items: center; gap: 12px;
    padding: 28px 0; font-size: .9rem; color: var(--hdr-muted);
}
.hdr-spin-ring {
    width: 22px; height: 22px;
    border: 2.5px solid var(--hdr-border);
    border-top-color: var(--hdr-navy2);
    border-radius: 50%;
    animation: hdr-spin .7s linear infinite; flex-shrink: 0;
}
@keyframes hdr-spin { to { transform: rotate(360deg); } }

/* Result items */
.hdr-result-item {
    display: flex; align-items: center; gap: 14px;
    padding: 13px 14px; border-radius: 10px;
    text-decoration: none; color: inherit;
    margin-bottom: 3px; position: relative; overflow: hidden;
    transition: background .12s;
}
.hdr-result-item::before {
    content: '';
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 3px; background: var(--hdr-red);
    transform: scaleY(0); transform-origin: bottom;
    transition: transform .18s; border-radius: 0 2px 2px 0;
}
.hdr-result-item:hover,
.hdr-result-item.hdr-focused {
    background: var(--hdr-bg);
}
.hdr-result-item:hover::before,
.hdr-result-item.hdr-focused::before { transform: scaleY(1); }

.hdr-ri-num {
    font-family: var(--hdr-ff-ser);
    font-size: 1.4rem; font-weight: 900;
    color: #f1f5f9; line-height: 1;
    min-width: 26px; text-align: right; flex-shrink: 0;
    transition: color .15s;
}
.hdr-result-item:hover .hdr-ri-num { color: rgba(220,38,38,.12); }

.hdr-ri-cat {
    font-size: .67rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: 1px; color: #fff; background: var(--hdr-navy);
    padding: 3px 9px; border-radius: 4px; white-space: nowrap; flex-shrink: 0;
}

.hdr-ri-body { flex: 1; min-width: 0; }
.hdr-ri-title {
    font-size: .95rem; font-weight: 700; color: #1e293b;
    line-height: 1.35;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    transition: color .12s;
}
.hdr-result-item:hover .hdr-ri-title { color: var(--hdr-red); }
.hdr-ri-title mark {
    background: #fef9c3; color: inherit;
    border-radius: 2px; padding: 0 2px;
}
.hdr-ri-meta {
    font-size: .74rem; color: var(--hdr-pale); margin-top: 2px;
    display: flex; gap: 10px;
}

.hdr-ri-arrow {
    color: #cbd5e1; font-size: .8rem; flex-shrink: 0;
    transition: transform .15s, color .15s;
}
.hdr-result-item:hover .hdr-ri-arrow { transform: translateX(4px); color: var(--hdr-red); }

/* Results header row */
.hdr-results-hd {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 10px;
}
.hdr-results-hd a {
    font-size: .78rem; font-weight: 700; color: var(--hdr-navy2);
    display: flex; align-items: center; gap: 5px; text-decoration: none;
    transition: color .15s;
}
.hdr-results-hd a:hover { color: var(--hdr-red); }

/* Empty state */
.hdr-srch-empty {
    text-align: center; padding: 40px 20px;
    color: var(--hdr-muted);
}
.hdr-srch-empty i { font-size: 2.5rem; color: var(--hdr-border); display: block; margin-bottom: 12px; }
.hdr-srch-empty p { font-size: 1.1rem; font-weight: 700; color: var(--hdr-ink2); margin-bottom: 6px; }
.hdr-srch-empty small a { color: var(--hdr-navy2); font-weight: 600; }
.hdr-srch-empty small a:hover { color: var(--hdr-red); }

/* Footer */
.hdr-srch-footer {
    display: flex; align-items: center; justify-content: space-between;
    flex-wrap: wrap; gap: 10px;
    padding: 11px 22px;
    border-top: 1px solid var(--hdr-bg2);
    background: var(--hdr-bg);
    flex-shrink: 0;
}
.hdr-srch-hints {
    font-size: .73rem; color: var(--hdr-pale);
}
.hdr-srch-hints kbd {
    display: inline-block; background: var(--hdr-bg2);
    border: 1px solid var(--hdr-border); border-radius: 4px;
    padding: 1px 5px; font-size: .67rem; font-family: var(--hdr-ff);
    color: var(--hdr-muted); margin-right: 2px;
}
@media (max-width: 480px) { .hdr-srch-hints { display: none; } }

.hdr-srch-all {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: .8rem; font-weight: 700; color: var(--hdr-navy2);
    padding: 6px 12px; border-radius: 6px;
    border: 1px solid var(--hdr-border); text-decoration: none;
    transition: all .15s;
}
.hdr-srch-all:hover { background: var(--hdr-navy2); color: #fff; border-color: var(--hdr-navy2); }

/* Mobile search topbar sizing */
@media (max-width: 600px) {
    .hdr-srch-topbar { padding: 10px 12px; }
    .hdr-srch-input { font-size: .95rem; padding: 12px 0; }
}
