/**
 * ConductScience Educational Hub v1.0.0
 *
 * Enhanced article layout for high-value educational content.
 * Extends cs-ra (resource-article.css) — loads AFTER it.
 * Depends on cs-tokens.css (global).
 *
 * BEM prefix: cs-eh__ (educational hub)
 * Applied via: .cs-eh class on article element (alongside .cs-ra)
 *
 * @package ConductScience
 */

/* ============================================
   Hero Header
   ============================================ */
.cs-eh__hero {
    background: linear-gradient(135deg, #0f1f4d 0%, var(--cs-primary) 60%, #2a5bc7 100%);
    position: relative;
    overflow: hidden;
}

/* Subtle noise texture via CSS */
.cs-eh__hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    background-size: 200px 200px;
    pointer-events: none;
}

.cs-eh__hero-inner {
    max-width: 1088px;
    margin: 0 auto;
    padding: var(--cs-space-5) 24px var(--cs-space-4);
    position: relative;
    z-index: 1;
}

/* Override Elementor kit-9 h1 with doubled class */
.cs-eh.cs-eh .cs-eh__hero-title {
    font-size: 2.4em;
    font-weight: 800;
    line-height: 1.15;
    color: #fff;
    margin: 0 0 12px;
    letter-spacing: -0.02em;
    max-width: 720px;
}

.cs-eh__hero-subtitle {
    font-size: 1.05rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.78);
    margin: 0 0 20px;
    max-width: 600px;
}

.cs-eh__hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.cs-eh__hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--cs-radius-pill);
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.cs-eh__hero-pill svg {
    opacity: 0.7;
    flex-shrink: 0;
}

/* Hide the default cs-ra header when hero is present */
.cs-eh .cs-ra__header {
    display: none;
}

/* ============================================
   Quick Jump Navigation
   ============================================ */
.cs-eh__quickjump {
    background: var(--cs-bg-white);
    border-bottom: 1px solid var(--cs-border);
    position: sticky;
    top: 64px; /* mega-menu clearance */
    z-index: 90;
    transition: box-shadow var(--cs-transition);
}

.cs-eh__quickjump.cs-eh__quickjump--shadow {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.cs-eh__quickjump-inner {
    max-width: 1088px;
    margin: 0 auto;
    padding: 10px 24px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.cs-eh__quickjump-inner::-webkit-scrollbar {
    display: none;
}

.cs-eh__quickjump-pill {
    display: inline-block;
    padding: 6px 16px;
    background: var(--cs-bg-gray);
    border-radius: var(--cs-radius-pill);
    font-size: 13px;
    font-weight: 600;
    color: var(--cs-text-mid);
    text-decoration: none;
    white-space: nowrap;
    transition: background var(--cs-transition), color var(--cs-transition);
}

.cs-eh__quickjump-pill:hover {
    background: var(--cs-primary-light);
    color: var(--cs-primary);
}

.cs-eh__quickjump-pill.cs-eh__quickjump-pill--active {
    background: var(--cs-primary);
    color: #fff;
}

/* ============================================
   Enhanced Sidebar — Progress Bar
   ============================================ */
.cs-eh__sidebar {
    position: relative;
}

.cs-eh__progress {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--cs-border);
    border-radius: 2px;
    overflow: hidden;
}

.cs-eh__progress-bar {
    width: 100%;
    height: 0%;
    background: var(--cs-primary);
    border-radius: 2px;
    transition: height 0.15s ease-out;
}

/* Shift TOC right to make room for progress bar */
.cs-eh__sidebar .cs-ra__toc {
    border-left: none;
    padding-left: 20px;
    margin-left: 3px;
}

/* ============================================
   Equipment Quick Links (Sidebar)
   ============================================ */
.cs-eh__equip-links {
    margin-top: var(--cs-space-3);
    padding-top: var(--cs-space-3);
    border-top: 1px solid var(--cs-border);
}

.cs-eh__equip-links-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--cs-text-gray);
    margin: 0 0 10px;
}

.cs-eh__equip-links-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cs-eh__equip-links-list li {
    margin-bottom: 4px;
}

.cs-eh__equip-links-list a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--cs-text-mid);
    text-decoration: none;
    transition: background var(--cs-transition), color var(--cs-transition);
}

.cs-eh__equip-links-list a:hover {
    background: var(--cs-primary-light);
    color: var(--cs-primary);
}

.cs-eh__equip-links-list svg {
    color: var(--cs-text-light);
    flex-shrink: 0;
    transition: color var(--cs-transition);
}

.cs-eh__equip-links-list a:hover svg {
    color: var(--cs-primary);
}

/* ============================================
   Mobile Equipment Links (visible <768px)
   ============================================ */
.cs-eh__equip-links-mobile {
    display: none;
}

/* ============================================
   Enhanced Tables (scoped to .cs-eh)
   ============================================ */
.cs-eh .cs-ra__content table {
    border: 1px solid var(--cs-border);
    border-radius: var(--cs-radius);
    overflow: hidden;
}

.cs-eh .cs-ra__content thead th {
    background: var(--cs-primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 10px 14px;
    border-bottom: none;
}

.cs-eh .cs-ra__content tbody td {
    border-bottom: 1px solid var(--cs-border);
    vertical-align: top;
}

.cs-eh .cs-ra__content tbody tr:last-child td {
    border-bottom: none;
}

.cs-eh .cs-ra__content tbody tr:hover td {
    background: rgba(30, 66, 168, 0.03);
}

/* Tables scroll horizontally on mobile only */
@media (max-width: 768px) {
    .cs-eh .cs-ra__content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .cs-eh .cs-ra__content thead,
    .cs-eh .cs-ra__content tbody {
        display: table;
        width: 100%;
    }
}

/* ============================================
   Enhanced Content Typography (scoped to .cs-eh)
   ============================================ */

/* Section H2 — subtle top border separator */
.cs-eh .cs-ra__content h2 {
    padding-top: 1.5em;
    border-top: 1px solid var(--cs-border);
}

.cs-eh .cs-ra__content h2:first-child {
    border-top: none;
    padding-top: 0;
}

/* Blockquote / critical notes — enhanced */
.cs-eh .cs-ra__content blockquote {
    border-left-color: var(--cs-primary);
    background: var(--cs-primary-light);
}

/* Strong emphasis within content — subtle color accent */
.cs-eh .cs-ra__content > p > strong:first-child,
.cs-eh .cs-ra__content > ul > li > strong:first-child {
    color: var(--cs-text-dark);
}

/* ============================================
   Responsive: Tablet (≤1024px)
   ============================================ */
@media (max-width: 1024px) {
    .cs-eh.cs-eh .cs-eh__hero-title {
        font-size: 2em;
    }

    .cs-eh__quickjump {
        top: 56px;
    }
}

/* ============================================
   Responsive: Mobile (≤768px)
   ============================================ */
@media (max-width: 768px) {
    .cs-eh__hero-inner {
        padding: var(--cs-space-4) 24px var(--cs-space-3);
    }

    .cs-eh.cs-eh .cs-eh__hero-title {
        font-size: 1.6em;
    }

    .cs-eh__hero-subtitle {
        font-size: 0.95rem;
    }

    .cs-eh__hero-meta {
        gap: 6px;
    }

    .cs-eh__hero-pill {
        font-size: 12px;
        padding: 4px 10px;
    }

    /* Quick jump — not sticky on mobile, horizontal scroll */
    .cs-eh__quickjump {
        position: relative;
        top: auto;
    }

    .cs-eh__quickjump-inner {
        padding: 8px 16px;
    }

    .cs-eh__quickjump-pill {
        font-size: 12px;
        padding: 5px 12px;
    }

    /* Hide sidebar equipment links, show mobile version */
    .cs-eh__equip-links {
        display: none;
    }

    .cs-eh__equip-links-mobile {
        display: block;
        max-width: 1088px;
        margin: 0 auto;
        padding: var(--cs-space-3) 24px;
    }

    .cs-eh__equip-links-mobile-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .cs-eh__equip-link-card {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 14px;
        background: var(--cs-bg-gray);
        border-radius: var(--cs-radius);
        font-size: 13px;
        font-weight: 600;
        color: var(--cs-text-mid);
        text-decoration: none;
        transition: background var(--cs-transition);
    }

    .cs-eh__equip-link-card:hover {
        background: var(--cs-primary-light);
        color: var(--cs-primary);
    }

    .cs-eh__equip-link-card svg {
        color: var(--cs-text-light);
        flex-shrink: 0;
    }

    /* Enhanced tables on mobile */
    .cs-eh .cs-ra__content table {
        font-size: 14px;
    }

    .cs-eh .cs-ra__content thead th {
        font-size: 11px;
        padding: 8px 10px;
    }

    .cs-eh .cs-ra__content tbody td {
        padding: 8px 10px;
    }
}
