/* ── Stock Homepage ───────────────────────────────────
   Layout styles for the homepage only.
   Loads after delvantic-ui.css.
   ────────────────────────────────────────────────── */

/* ── Hero ──────────────────────────────────────────── */
.hp-hero {
    background: #f8f9fa;
    padding: 72px 24px 56px;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
}

.hp-hero-inner {
    max-width: 640px;
    margin: 0 auto;
}

.hp-hero-logo {
    margin-bottom: 20px;
}

.hp-hero-logo canvas {
    display: block;
    margin: 0 auto;
    border: none;
    background: transparent;
}

.hp-hero h1 {
    font-size: 34px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 8px;
    letter-spacing: -0.02em;
}

.hp-hero-subtitle {
    font-size: 16px;
    color: #6b7280;
    line-height: 1.6;
    margin: 0 0 28px;
}

.hp-hero-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ── How It Works Link ─────────────────────────────── */
.hp-how-link {
    display: inline-block;
    margin-top: 16px;
    font-size: 13px;
    color: #6b7280;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.15s;
}
.hp-how-link:hover {
    color: #198754;
}

/* ── Search Section ────────────────────────────────── */
.hp-search-section {
    padding: 48px 24px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

.hp-search-inner {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.hp-search-label {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 16px;
}

.hp-search-box {
    margin: 0 0 14px;
}

.hp-search-box .sc-ac-wrap {
    width: 100%;
}

.hp-search-box .sc-ac-input-row {
    padding: 4px 14px;
    border-width: 2px;
    border-radius: 10px;
}

.hp-search-box .sc-ac-input {
    font-size: 16px;
    padding: 10px 10px;
}

.hp-search-box .sc-ac-icon {
    font-size: 18px;
}

.hp-search-box .sc-ac-input-row:focus-within {
    border-color: #198754;
    box-shadow: 0 0 0 4px rgba(25, 135, 84, 0.1);
}

.hp-search-hint {
    font-size: 13px;
    color: #9ca3af;
    margin: 0;
}

/* ── Sections ──────────────────────────────────────── */
.hp-section {
    padding: 56px 24px;
    background: #fff;
}

.hp-section--alt {
    background: #f8f9fa;
}

.hp-section-inner {
    max-width: 1060px;
    margin: 0 auto;
}

.hp-section-title {
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 4px;
}

.hp-section-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

/* ── Disclaimer ──────────────────────────────────── */
.hp-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    line-height: 1.5;
    color: #475569;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 20px;
}
.hp-disclaimer i {
    color: #d97706;
    font-size: 18px;
    line-height: 1.4;
    flex-shrink: 0;
}

/* ── Level Cards ───────────────────────────────────── */
.hp-level-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    margin-bottom: 16px;
    overflow: hidden;
}

.hp-level-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 16px;
    background: #f9fafb;
    border-bottom: 1px solid #f3f4f6;
}

.hp-level-badge {
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hp-level-label {
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
}

.hp-level-count {
    font-size: 12px;
    color: #9ca3af;
}

.hp-level-bar {
    display: flex;
    gap: 3px;
    margin-left: auto;
}

.hp-level-seg {
    width: 18px;
    height: 6px;
    border-radius: 3px;
    background: #e5e7eb;
}

/* ── Company Rows ──────────────────────────────────── */
.hp-company-list {
    display: flex;
    flex-direction: column;
}

.hp-company-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f3f4f6;
    transition: background 0.1s;
}

.hp-company-row:last-child {
    border-bottom: none;
}

.hp-company-row:hover {
    background: #f9fafb;
    color: inherit;
    text-decoration: none;
}

.hp-company-id {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    min-width: 130px;
}

.hp-company-logo {
    width: 28px;
    height: 28px;
    border-radius: 5px;
    object-fit: contain;
    background: #f8f9fa;
}

.hp-company-logo-fb {
    width: 28px;
    height: 28px;
    border-radius: 5px;
    background: #198754;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 11px;
}

.hp-company-ticker {
    font-weight: 700;
    font-size: 14px;
    color: #198754;
}

.hp-company-info {
    flex: 0 0 220px;
    min-width: 0;
}

.hp-company-note {
    flex: 1 1 0;
    min-width: 0;
    font-size: 12px;
    line-height: 1.4;
    color: #4b5563;
    padding: 0 14px;
    border-left: 2px solid #fde68a;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hp-company-name {
    font-weight: 600;
    font-size: 13px;
    color: #1f2937;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hp-company-industry {
    font-size: 12px;
    color: #9ca3af;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hp-company-stats {
    display: flex;
    gap: 20px;
    flex-shrink: 0;
}

.hp-company-stat-val {
    font-weight: 600;
    font-size: 13px;
    color: #1f2937;
}

.hp-company-stat-lbl {
    font-size: 10px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.hp-depth-chip {
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border: 1.5px solid;
    border-radius: 8px;
    margin-left: auto;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Depth Explainer ───────────────────────────────── */
.hp-depth-explainer {
    margin-bottom: 16px;
}

.hp-depth-explainer-inner {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px;
}

.hp-depth-groups {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.hp-depth-group-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: 13px;
    padding: 6px 10px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
}

.hp-depth-group-name {
    font-weight: 700;
    color: #1f2937;
    min-width: 120px;
    flex-shrink: 0;
}

.hp-depth-group-count {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    background: #f3f4f6;
    padding: 1px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}

.hp-depth-group-items {
    font-size: 12px;
    color: #9ca3af;
    text-transform: capitalize;
}

.hp-depth-scale {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.hp-depth-scale-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6b7280;
}

.hp-depth-scale-badge {
    width: 22px;
    height: 22px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    color: #fff;
}

.hp-depth-scale-range {
    font-weight: 500;
}

/* ── Filter Input ──────────────────────────────────── */
.hp-company-search:focus {
    border-color: #198754;
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.15);
}

/* ── CTA ───────────────────────────────────────────── */
.hp-cta {
    padding: 56px 24px;
    background: #f8f9fa;
    text-align: center;
    border-top: 1px solid #e5e7eb;
}

.hp-cta-inner {
    max-width: 520px;
    margin: 0 auto;
}

.hp-cta h2 {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 8px;
}

.hp-cta p {
    font-size: 15px;
    color: #6b7280;
    line-height: 1.6;
    margin: 0 0 24px;
}

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 768px) {
    .hp-hero {
        padding: 48px 20px 40px;
    }
    .hp-hero h1 {
        font-size: 26px;
    }
    .hp-section {
        padding: 40px 20px;
    }
    .hp-cta {
        padding: 40px 20px;
    }
    /* Stackable rows — every sub-element stays visible, rows wrap instead
       of clipping. Order of stacking inside each row:
         1. hp-company-id + hp-company-info + any chip — first wrap line
         2. hp-company-note                            — second wrap line (full width)
         3. hp-company-stats                           — third wrap line (full width)
    */
    .hp-company-row {
        flex-wrap: wrap;
        row-gap: 6px;
        padding: 10px 12px;
    }
    .hp-company-id {
        min-width: 0;
    }
    .hp-company-info {
        flex: 1 1 auto;
        min-width: 0;
    }
    .hp-company-note {
        flex: 0 0 100%;
        padding: 6px 10px;
        border-left: 3px solid #fde68a;
        -webkit-line-clamp: 3;   /* a bit more room on mobile vs 2 lines on desktop */
    }
    .hp-company-stats {
        flex: 0 0 100%;
        gap: 14px;
        margin-left: 40px;       /* align under name/industry, not under the logo */
    }
    .hp-search-section {
        padding: 36px 20px;
    }
    .hp-depth-explainer-inner {
        padding: 16px;
    }
    /* Stack the group row: name + count on top line, items wrapped below. */
    .hp-depth-group-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 10px 12px;
    }
    .hp-depth-group-name {
        min-width: 0;
    }
    .hp-depth-group-items {
        line-height: 1.5;
        word-break: break-word;
    }
    /* Let scale badges wrap into a compact grid instead of one flex row. */
    .hp-depth-scale {
        flex-wrap: wrap;
        gap: 8px 14px;
        justify-content: flex-start;
    }
}

/* ── Reviewed By Delvantic section ─────────────────── */
.hp-reviewed-section {
    margin-bottom: 20px;
}
.hp-reviewed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px 10px;
}
.hp-reviewed-header h5 {
    font-weight: 700;
    color: #1f2937;
}
.hp-reviewed-count {
    font-size: 12px;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.hp-reviewed-chip {
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 12px;
    letter-spacing: 0.3px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
    margin-left: 10px;
    flex-shrink: 0;
    align-self: center;
}

/* AI review chip — shows on a reviewed row when at least one AI reviewer
 * has completed. Label on top, colored per-reviewer badges below with counts.
 * Clicking opens the company detail page scrolled to the AI Findings card. */
.hp-ai-review-chip {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    padding: 4px 8px 3px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    flex-shrink: 0;
    white-space: nowrap;
}
.hp-ai-review-chip:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
    transform: translateY(-1px);
}
.hp-ai-review-label {
    font-size: 9px;
    font-weight: 700;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    line-height: 1;
}
.hp-ai-review-icons {
    display: inline-flex;
    gap: 3px;
}
.hp-ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    padding: 2px 4px 2px 2px;
    border-radius: 8px;
    color: #fff;
}
.hp-ai-badge-logo {
    width: 14px;
    height: 14px;
    display: inline-flex;
    flex-shrink: 0;
    color: #fff;
    opacity: 0.9;
}
.hp-ai-badge-count {
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    padding-right: 2px;
}
/* Brand-adjacent chip colors: Anthropic rust for Claude, softened charcoal
 * for GPT (pure black read as a punch hole next to the rust chip). SVG
 * inside uses currentColor → inherits white for contrast. */
.hp-ai-badge--claude { background: #D97757; } /* Anthropic brand rust */
.hp-ai-badge--gpt    { background: #4b5563; } /* Slate-600, tonned-down */

.hp-company-row--reviewed {
    background: linear-gradient(to right, #fffbeb 0%, #fff 30%);
    border-left: 3px solid #f59e0b;
}
.hp-company-row--reviewed:hover {
    background: linear-gradient(to right, #fef3c7 0%, #fff 30%);
}
.hp-section-divider {
    display: flex;
    align-items: center;
    margin: 24px 0 16px;
    color: #6b7280;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
.hp-section-divider::before,
.hp-section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}
.hp-section-divider span {
    padding: 0 14px;
}
