/**
 * HT Search Results — Scoped styles
 * Loaded conditionally on is_search() only.
 * Version: 2.0
 */

/* ── Page background ─────────────────────────────────────────────────────── */
body.search-results,
body.search { background-color: #f0f5f0; }

/* ── Hide parent-theme title banner — query already in breadcrumb + our header ── */
body.search-results .header-section,
body.search .header-section { display: none !important; }

/* ── Corrected query notice (Intel pipeline → WP) ───────────────────────────── */
.ht-search-corrected { font-size: 0.82rem; color: #555; margin: 0 0 0.6rem; line-height: 1.5; }
.ht-search-corrected strong { color: #013C1A; }
.ht-search-corrected a { color: #01A347; text-decoration: none; }
.ht-search-corrected a:hover { text-decoration: underline; }

/* ── Archive heading suppression (parent theme artifact) ─────────────────── */
body.search .page-title,
body.search .at-pagetitle-text,
body.search .at-pagetitle-wrap,
body.search .at-pagetitle,
body.search [class*="archive-title"] { display: none !important; }

/* ── Wrap ─────────────────────────────────────────────────────────────────── */
.ht-search-wrap { max-width: 1140px; margin: 2rem auto; padding: 0 1rem; }

/* ── Header ──────────────────────────────────────────────────────────────── */
.ht-search-header    { margin-bottom: 1.25rem; }
.ht-search-for-label { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #888; margin: 0 0 0.2rem; }
.ht-search-title     { font-size: 1.6rem; font-weight: 800; color: #013C1A; margin: 0 0 0.3rem; line-height: 1.2; }
.ht-search-count     { font-size: 0.83rem; color: #666; margin: 0 0 0.75rem; }

/* ── Search descriptor (EEAT — no-query landing state) ───────────────────── */
.ht-search-descriptor {
    font-size: 0.88rem;
    color: #555;
    margin: 0 0 0.75rem;
    max-width: 540px;
    line-height: 1.55;
}

/* ── Search refinement box ───────────────────────────────────────────────── */
.ht-search-refine {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0;
    margin: 0.75rem 0 0.9rem;
    max-width: 420px;
}
.ht-search-refine-input {
    flex: 1;
    min-width: 0;
    padding: 0.6rem 1rem;
    font-size: 0.92rem;
    border: 1.5px solid #c8dcc8;
    border-right: none;
    border-radius: 5px 0 0 5px;
    background: #fff;
    color: #1a1a1a;
    outline: none;
    transition: border-color 0.15s;
    box-sizing: border-box;
}
.ht-search-refine-input:focus { border-color: #01A347; }
.ht-search-refine-ai-icon { width: 22px; height: 22px; display: block; flex-shrink: 0; }
.ht-search-refine-btn {
    display: inline-flex;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
    padding: 0.6rem 0.85rem;
    background: #01A347;
    color: #fff;
    border: 1.5px solid #01A347;
    border-radius: 0 5px 5px 0;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.13s, border-color 0.13s;
    line-height: 1;
    white-space: nowrap;
}
.ht-search-refine-btn:hover { background: #018a3c; border-color: #018a3c; }

/* ── New Search — quiet link shown when an active query exists ──────────── */
.ht-new-search-link {
    display: inline-block;
    margin-top: 0.45rem;
    font-size: 0.78rem;
    color: #999;
    text-decoration: none;
    letter-spacing: 0.01em;
}
.ht-new-search-link:hover { color: #013C1A; text-decoration: underline; }

/* ── "People also search for" suggestion chips ───────────────────────────── */
.ht-search-also {
    margin-top: 0.65rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}
.ht-search-also-label { font-size: 0.72rem; color: #999; white-space: nowrap; }
.ht-search-also-chip {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border: 1px solid #b8d4b8;
    border-radius: 2rem;
    font-size: 0.75rem;
    color: #013C1A;
    text-decoration: none;
    background: #fff;
    transition: background 0.12s, border-color 0.12s;
}
.ht-search-also-chip:hover { background: #01A347; border-color: #01A347; color: #fff; }

/* ── Intent bar (Phase 2) — detected constraint chips ───────────────────── */
.ht-intent-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
    padding: 0.55rem 0.85rem;
    background: #f0faf4;
    border: 1px solid #b8dfc8;
    border-radius: 6px;
}
.ht-intent-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #3d7a54;
    white-space: nowrap;
    text-transform: uppercase;
}
.ht-intent-chip {
    display: inline-block;
    padding: 0.18rem 0.65rem;
    background: #01A347;
    color: #fff;
    border-radius: 2rem;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    transition: background 0.13s;
}
.ht-intent-chip:hover { background: #018a3c; color: #fff; }

/* ── Thin-tour CTA variant ───────────────────────────────────────────────── */
.ht-thin-tours-cta {
    margin-bottom: 1.5rem;
    text-align: left;
    padding: 1.1rem 1.5rem;
}

/* ── Autocomplete suggestions dropdown ───────────────────────────────────── */
.ht-suggest-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 200;
    background: #fff;
    border: 1.5px solid #c8dcc8;
    border-top: none;
    border-radius: 0 0 5px 5px;
    list-style: none;
    margin: 0;
    padding: 0;
    box-shadow: 0 6px 16px rgba(1,60,26,0.10);
    max-height: 220px;
    overflow-y: auto;
}
.ht-suggest-item {
    padding: 0.48rem 1rem;
    font-size: 0.88rem;
    color: #333;
    cursor: pointer;
    border-bottom: 1px solid #f3f7f3;
    line-height: 1.4;
}
.ht-suggest-item:last-child { border-bottom: none; }
.ht-suggest-item:hover,
.ht-suggest-item.ht-suggest-active { background: #f0faf4; color: #013C1A; }

/* ── Section labels ──────────────────────────────────────────────────────── */
.ht-section-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: #888;
    margin: 0 0 0.85rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid #d8e8d8;
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
}
.ht-section-count { color: #bbb; font-weight: 400; letter-spacing: 0; }

/* ── Tour card grid ──────────────────────────────────────────────────────── */
.ht-tour-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 1rem;
}

/* ── Tour card ───────────────────────────────────────────────────────────── */
.ht-tour-card {
    border: 1px solid #e0e8e0;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #fff;
    transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.ht-tour-card:hover {
    border-color: #01A347;
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(1,163,71,0.13);
}

/* Tour image — 4:3 ratio */
.ht-tour-card-image {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #eaf3de;
    flex-shrink: 0;
}
.ht-tour-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
/* Image placeholder (no featured photo) */
.ht-img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ht-img-placeholder svg { opacity: 0.35; }

/* ── Badge base ──────────────────────────────────────────────────────────── */
.ht-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 3px;
    line-height: 1.6;
    white-space: nowrap;
}
.ht-grade-badge-easy       { background: rgba(1,163,71,0.12);  color: #01A347; }
.ht-grade-badge-moderate   { background: rgba(230,81,0,0.10);  color: #E65100; }
.ht-grade-badge-difficult  { background: rgba(198,40,40,0.10); color: #C62828; }
.ht-grade-badge-expedition { background: rgba(40,53,147,0.10); color: #283593; }
.ht-dest-badge   { background: #E6F1FB; color: #185FA5; font-weight: 600; }
.ht-stat-badge   { background: #f2f2f2; color: #555; font-weight: 500; }
.ht-family-badge { background: rgba(1,163,71,0.08); color: #01A347; }

/* ── Seasonal status badges (Agent 1 season_status field) ─────────────── */
.ht-season-status--peak      { background: rgba(1,163,71,0.15);   color: #01A347; }
.ht-season-status--shoulder  { background: rgba(230,150,0,0.12);  color: #9a6000; }
.ht-season-status--open      { background: rgba(1,163,71,0.08);   color: #01A347; }
.ht-season-status--closed    { background: rgba(140,140,140,0.10);color: #666;    }

/* ── Confidence / relevance badges ───────────────────────────────────── */
.ht-badge--top-match    { background: rgba(1,163,71,0.15);  color: #01A347; }
.ht-badge--recommended  { background: rgba(24,95,165,0.10); color: #185FA5; }

/* ── Snippet highlight — query-matched terms (Agent 1 snippet_html) ──── */
.ht-search-snippet strong { font-weight: 700; color: #013C1A; }

/* ── Card body ───────────────────────────────────────────────────────────── */
.ht-tour-card-body {
    padding: 0.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.ht-card-badges { display: flex; gap: 0.3rem; flex-wrap: wrap; align-items: center; }
.ht-card-title  { font-size: 0.92rem; font-weight: 700; margin: 0; line-height: 1.3; }
.ht-card-title a { color: #013C1A; text-decoration: none; }
.ht-card-title a:hover { color: #01A347; }
.ht-card-excerpt { font-size: 0.78rem; color: #555; margin: 0; line-height: 1.5; flex: 1; }
.ht-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.3rem;
    padding-top: 0.3rem;
    border-top: 1px solid #f0f0f0;
}
.ht-price      { font-size: 0.9rem; font-weight: 700; color: #01A347; }
.ht-price-na   { font-size: 0.78rem; color: #bbb; }
.ht-view-link  { font-size: 0.78rem; color: #01A347; text-decoration: none; font-weight: 600; white-space: nowrap; }
.ht-view-link:hover { text-decoration: underline; }

/* ── SMAT CTA block ──────────────────────────────────────────────────────── */
.ht-smat-cta {
    background: #013C1A;
    color: #fff;
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}
.ht-smat-cta-copy h3  { font-size: 1rem; font-weight: 700; margin: 0 0 0.2rem; color: #fff; }
.ht-smat-cta-copy p   { font-size: 0.83rem; color: #9ec49e; margin: 0; }
.ht-smat-cta-actions  { display: flex; gap: 0.6rem; flex-shrink: 0; flex-wrap: wrap; }
.ht-smat-primary {
    background: #01A347;
    color: #fff;
    padding: 0.55rem 1.1rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 700;
    white-space: nowrap;
}
.ht-smat-secondary {
    border: 1px solid rgba(255,255,255,0.25);
    color: #fff;
    padding: 0.55rem 1.1rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.88rem;
    white-space: nowrap;
}
.ht-smat-secondary:hover { border-color: rgba(255,255,255,0.6); }

/* ── Blog cards ──────────────────────────────────────────────────────────── */
.ht-blog-cards { display: flex; flex-direction: column; gap: 0.75rem; }
.ht-blog-card {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    padding: 0.85rem;
    border: 1px solid #e0e8e0;
    border-radius: 8px;
    background: #fff;
    transition: border-color 0.18s;
}
.ht-blog-card:hover { border-color: #01A347; }

/* Blog thumbnail — 3:2 ratio */
.ht-blog-thumb {
    flex-shrink: 0;
    width: 180px;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    border-radius: 6px;
    background: #e8f0e8;
}
.ht-blog-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Blog card text */
.ht-blog-card-body  { flex: 1; min-width: 0; }
.ht-blog-meta       { display: flex; gap: 0.4rem; align-items: center; margin-bottom: 0.25rem; flex-wrap: wrap; }
.ht-cat-badge       { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 3px; background: #EEEDFE; color: #3C3489; }
/* Category colour overrides — confirmed by Sapta 2026-05-31 */
.ht-cat-badge--trek-insights                              { background: #E3EEFB; color: #185FA5; }
.ht-cat-badge--travel-tips                               { background: #E8F5E9; color: #01A347; }
.ht-cat-badge--destinations,
.ht-cat-badge--trekking-trail-documentation-in-indian-himalayas { background: #F5EDEA; color: #7B3F00; }
.ht-date-label      { font-size: 10px; color: #bbb; }
.ht-read-time       { font-size: 10px; color: #5E7F62; white-space: nowrap; }
.ht-read-time::before { content: '·'; margin-right: 0.3rem; color: #d4d4d4; }
.ht-blog-title      { font-size: 0.88rem; font-weight: 700; margin: 0 0 0.2rem; line-height: 1.35; }
.ht-blog-title a    { color: #013C1A; text-decoration: none; }
.ht-blog-title a:hover { color: #01A347; }
.ht-blog-excerpt {
    font-size: 0.78rem;
    color: #555;
    margin: 0 0 0.3rem;
    line-height: 1.48;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ht-read-link { font-size: 0.78rem; color: #01A347; text-decoration: none; font-weight: 600; }

/* ── Empty state ─────────────────────────────────────────────────────────── */
.ht-search-empty {
    padding: 2.5rem;
    text-align: center;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e0e8e0;
}
.ht-empty-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; margin-top: 1.25rem; }
.ht-empty-btn-primary {
    background: #01A347;
    color: #fff;
    padding: 0.55rem 1.1rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}
.ht-empty-btn-secondary {
    border: 1px solid #01A347;
    color: #01A347;
    padding: 0.55rem 1.1rem;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
}

/* ── Criteria-change warning (search query changed without resubmit) ────── */
.ht-tf-criteria-warning {
    background: #fff8e1;
    border: 1px solid #ffe082;
    border-left: 3px solid #f59e0b;
    border-radius: 5px;
    padding: 0.7rem 1rem;
    font-size: 0.86rem;
    color: #78350f;
    line-height: 1.55;
    margin-bottom: 1.25rem;
}
.ht-tf-criteria-warning strong { font-weight: 700; }
.ht-tf-criteria-warning em     { font-style: normal; font-weight: 700; }
.ht-search-enquiry .wpcf7-submit:disabled { background: #ccc; cursor: not-allowed; opacity: 0.7; }

@keyframes ht-criteria-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(245,158,11,0.5); }
    60%  { box-shadow: 0 0 0 8px rgba(245,158,11,0); }
    100% { box-shadow: 0 0 0 0 rgba(245,158,11,0); }
}
.ht-tf-criteria-warning.ht-tf-criteria-pulse { animation: ht-criteria-pulse 0.5s ease-out; }

/* ── Discovery CF7 enquiry block (bottom of search results) ─────────────── */
.ht-search-enquiry {
    margin-top: 2.5rem;
    padding: 1.75rem;
    background: #fff;
    border: 1px solid #d4e0d4;
    border-radius: 8px;
    border-top: 3px solid #01A347;
}
.ht-search-enquiry-head h2 { font-size: 1.1rem; font-weight: 800; color: #013C1A; margin: 0 0 0.25rem; }
.ht-search-enquiry-head p  { font-size: 0.88rem; color: #666; margin: 0 0 1.5rem; }

/* ── Section spacing ─────────────────────────────────────────────────────── */
.ht-search-section { margin-bottom: 2.5rem; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .ht-tour-cards  { grid-template-columns: 1fr; }
    .ht-blog-thumb  { width: 110px; }
    .ht-smat-cta    { flex-direction: column; }
    .ht-smat-cta-actions { width: 100%; }
    .ht-smat-primary,
    .ht-smat-secondary { text-align: center; flex: 1; }
}
@media (min-width: 641px) and (max-width: 900px) {
    .ht-tour-cards { grid-template-columns: repeat(2, 1fr); }
}

/* ── Match score badge (§7 — confidence threshold) ──────────────────────── */
.ht-match-badge            { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 3px; }
.ht-match-badge--excellent { background: rgba(1,163,71,0.15);  color: #01A347; }
.ht-match-badge--strong    { background: rgba(245,158,11,0.15); color: #B45309; }

/* ── Pinned hero card (R3 — exact named-trek match) ─────────────────────── */
.ht-tour-card--hero {
    display: grid;
    grid-template-columns: 2fr 3fr;
    border-radius: 10px;
    border-width: 2px;
    border-color: #01A347;
}
.ht-tour-card--hero .ht-tour-card-image {
    aspect-ratio: 4 / 3;
    border-radius: 8px 0 0 8px;
}
.ht-tour-card--hero .ht-tour-card-body   { padding: 1.1rem 1.25rem; gap: 0.5rem; }
.ht-tour-card--hero .ht-card-title       { font-size: 1.1rem; }
.ht-tour-card--hero .ht-card-excerpt     { font-size: 0.83rem; -webkit-line-clamp: 4; }
@media (max-width: 640px) {
    .ht-tour-card--hero { grid-template-columns: 1fr; }
    .ht-tour-card--hero .ht-tour-card-image { border-radius: 8px 8px 0 0; }
}

/* ── Altitude safety — cautious badge (F1) ───────────────────────────────── */
.ht-altitude-cautious {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fbbf24;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 3px;
    line-height: 1.6;
    white-space: nowrap;
}

/* ── Altitude safety — warning box (F3/F5) ───────────────────────────────── */
.ht-altitude-warning {
    margin: 0.6rem 0.75rem 0.75rem;
    padding: 0.6rem 0.85rem;
    background: #fff8f0;
    border-left: 3px solid #f59e0b;
    border-radius: 0 4px 4px 0;
}
.ht-altitude-warning-msg {
    font-size: 0.8rem;
    color: #78350f;
    margin: 0 0 0.45rem;
    line-height: 1.5;
}
.ht-altitude-warning-cta {
    font-size: 0.78rem;
    font-weight: 700;
    color: #01A347;
    text-decoration: none;
}
.ht-altitude-warning-cta:hover { text-decoration: underline; }
