/* ERC landing page (/erc). Scoped under #erc2-app so it cannot
   affect the legacy /erc/index page or any other Bootstrap/Bulma-based views. */

#erc2-app {
    --erc2-indigo: #4f46e5;
    --erc2-indigo-dark: #4338ca;
    --erc2-slate-900: #0f172a;
    --erc2-slate-600: #475569;
    --erc2-slate-400: #94a3b8;
    --erc2-slate-100: #f1f5f9;
    --erc2-slate-50: #f8fafc;
    --erc2-border: #e2e8f0;
    font-family: "Roboto", -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--erc2-slate-900);
    background: var(--erc2-slate-50);
}

#erc2-app *, #erc2-app *::before, #erc2-app *::after { box-sizing: border-box; }

/* assets/css/shared.css forces color/font-weight directly onto h1..h6,p,span,div,label,a,button,
   input,select,... site-wide. Those direct rules beat anything we only set on an ancestor, so
   re-assert "inherit" here (equal-tag selector prefixed with our id beats a bare-tag selector)
   before any of the more specific rules below apply their real colors/weights. */
#erc2-app h1, #erc2-app h2, #erc2-app h3, #erc2-app h4, #erc2-app h5, #erc2-app h6,
#erc2-app p, #erc2-app span, #erc2-app div, #erc2-app label, #erc2-app li,
#erc2-app a, #erc2-app button, #erc2-app small, #erc2-app input, #erc2-app select, #erc2-app option {
    color: inherit;
    font-weight: inherit;
    font-family: inherit;
}

#erc2-app a { text-decoration: none; }
#erc2-app button { cursor: pointer; }
#erc2-app details > summary { cursor: pointer; list-style: none; }
#erc2-app details > summary::-webkit-details-marker { display: none; }

/* Hero */
#erc2-app .erc2-hero {
    background: var(--erc2-slate-900);
    color: #fff;
    padding: 64px 32px 56px;
}
#erc2-app .erc2-hero-inner { max-width: 1120px; margin: 0 auto; }
#erc2-app .erc2-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,.1);
    color: #fff;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: 20px;
}
#erc2-app .erc2-hero h1 { color: #fff; font-size: 40px; font-weight: 900; line-height: 1.15; margin: 0 0 16px; }
#erc2-app .erc2-hero h1 .erc2-accent { color: #818cf8; }
#erc2-app .erc2-hero p { color: var(--erc2-slate-400); font-size: 17px; max-width: 560px; margin: 0 0 32px; }
#erc2-app .erc2-search-box { position: relative; max-width: 640px; }
#erc2-app .erc2-search-box svg {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    stroke: var(--erc2-slate-400);
    pointer-events: none;
}
#erc2-app .erc2-search-box input {
    width: 100%;
    padding: 16px 44px 16px 48px;
    border-radius: 16px;
    border: none;
    color: var(--erc2-slate-900);
    font-size: 15px;
    box-shadow: 0 20px 40px rgba(0,0,0,.25);
}
#erc2-app .erc2-search-box input:focus { outline: 3px solid rgba(99,102,241,.4); }
#erc2-app .erc2-search-clear {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    font-size: 20px;
    color: var(--erc2-slate-400);
}

/* Layout */
#erc2-app .erc2-body { max-width: 1120px; margin: 0 auto; padding: 32px 32px 80px; }
#erc2-app .erc2-mobile-bar { display: none; margin-bottom: 16px; }
#erc2-app .erc2-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 40; }
#erc2-app .erc2-layout { display: flex; align-items: flex-start; gap: 32px; }

/* Sidebar */
#erc2-app .erc2-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid var(--erc2-border);
    border-radius: 24px;
    padding: 20px;
    position: sticky;
    top: 24px;
}
#erc2-app .erc2-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--erc2-slate-100);
    margin-bottom: 4px;
}
#erc2-app .erc2-sidebar-header h2 { color: var(--erc2-slate-900); font-size: 13px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; margin: 0; }
#erc2-app .erc2-clear-link { border: none; background: none; color: #f43f5e; font-weight: 700; font-size: 12px; }
#erc2-app .erc2-sidebar-close { display: none; border: none; background: none; font-size: 22px; line-height: 1; color: var(--erc2-slate-600); }

#erc2-app .erc2-filter-section { border-bottom: 1px solid var(--erc2-slate-100); padding: 14px 0; }
#erc2-app .erc2-filter-section:last-child { border-bottom: none; }
#erc2-app .erc2-filter-section summary {
    font-size: 13px;
    font-weight: 700;
    color: var(--erc2-slate-900);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
#erc2-app .erc2-caret {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    fill: none;
    stroke: var(--erc2-slate-400);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform .2s ease;
}
#erc2-app .erc2-filter-section[open] > summary .erc2-caret { transform: rotate(90deg); }
#erc2-app .erc2-check-list { margin-top: 10px; display: flex; flex-direction: column; gap: 2px; }
#erc2-app .erc2-check-row { display: flex; align-items: center; gap: 10px; padding: 4px 0; font-size: 13.5px; }
#erc2-app .erc2-check-row span { color: var(--erc2-slate-600); }
#erc2-app .erc2-check-row input { width: 16px; height: 16px; accent-color: var(--erc2-indigo); }
#erc2-app .erc2-check-row input:checked ~ span { color: var(--erc2-slate-900); font-weight: 600; }

#erc2-app .erc2-standard-tree { margin-top: 10px; max-height: 320px; overflow-y: auto; }
#erc2-app .erc2-standard-node { padding: 2px 0; }
#erc2-app .erc2-standard-node.is-hidden { display: none; }
#erc2-app .erc2-standard-count { color: var(--erc2-slate-400); font-weight: 400; }
#erc2-app .erc2-standard-empty { margin: 10px 0 0; font-size: 12.5px; color: var(--erc2-slate-400); }
#erc2-app .erc2-standards-search {
    width: 100%;
    margin-top: 10px;
    padding: 8px 12px;
    border: 1px solid var(--erc2-border);
    border-radius: 10px;
    font-size: 12.5px;
    color: var(--erc2-slate-900);
}
#erc2-app .erc2-standard-details { margin: 2px 0 4px; }
#erc2-app .erc2-standard-details > summary {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--erc2-indigo);
    padding: 2px 0;
}
#erc2-app .erc2-standard-details > summary::before { content: '+ '; }
#erc2-app .erc2-standard-details[open] > summary::before { content: '\2212 '; }
#erc2-app .erc2-standard-children { margin-left: 16px; border-left: 1px solid var(--erc2-slate-100); padding-left: 10px; }
#erc2-app .erc2-standard-node .erc2-check-row { font-size: 13px; }
#erc2-app .erc2-depth-0 > .erc2-check-row { font-weight: 700; }

/* Main column */
#erc2-app .erc2-main { flex: 1; min-width: 0; }
#erc2-app .erc2-results-bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
#erc2-app .erc2-result-count { font-size: 14px; color: var(--erc2-slate-600); margin: 0; }
#erc2-app .erc2-result-count span { font-weight: 800; color: var(--erc2-slate-900); }
#erc2-app .erc2-sort { font-size: 13px; color: var(--erc2-slate-600); display: flex; align-items: center; gap: 8px; }
#erc2-app .erc2-sort select { color: var(--erc2-slate-900); border: 1px solid var(--erc2-border); border-radius: 10px; padding: 6px 10px; font-size: 13px; }

#erc2-app .erc2-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
#erc2-app .erc2-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #eef2ff;
    color: var(--erc2-indigo-dark);
    font-size: 11px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 999px;
}
#erc2-app .erc2-chip button { border: none; background: none; color: inherit; font-size: 12px; line-height: 1; }

/* Grid + cards */
#erc2-app .erc2-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
#erc2-app .erc2-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--erc2-border);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15,23,42,.04);
    transition: box-shadow .2s ease, border-color .2s ease, transform .2s ease;
}
#erc2-app .erc2-card:hover { box-shadow: 0 16px 32px rgba(15,23,42,.1); border-color: #c7d2fe; transform: translateY(-2px); }
#erc2-app .erc2-card-thumb { position: relative; height: 168px; }
#erc2-app .erc2-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
#erc2-app .erc2-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255,255,255,.92);
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    color: var(--erc2-slate-600);
}
#erc2-app .erc2-card-body { padding: 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
#erc2-app .erc2-card-tags { display: flex; flex-wrap: wrap; gap: 6px; }
#erc2-app .erc2-tag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 3px 8px; border-radius: 6px; }
#erc2-app .erc2-tag-subject { background: #eef2ff; color: var(--erc2-indigo-dark); }
#erc2-app .erc2-tag-restype { background: #f5f3ff; color: #7c3aed; }
#erc2-app .erc2-card-title { color: var(--erc2-slate-900); font-size: 16px; font-weight: 700; margin: 0; line-height: 1.35; }
#erc2-app .erc2-card:hover .erc2-card-title { color: var(--erc2-indigo-dark); }
#erc2-app .erc2-card-desc { font-size: 13.5px; color: var(--erc2-slate-600); line-height: 1.5; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
#erc2-app .erc2-card-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--erc2-slate-100); font-size: 12px; color: var(--erc2-slate-400); }
#erc2-app .erc2-card-view { color: var(--erc2-indigo); font-weight: 700; }

/* Empty state */
#erc2-app .erc2-empty { grid-column: 1 / -1; text-align: center; padding: 64px 20px; }
#erc2-app .erc2-empty h3 { color: var(--erc2-slate-900); font-size: 19px; font-weight: 800; margin: 0 0 8px; }
#erc2-app .erc2-empty p { color: var(--erc2-slate-600); font-size: 14px; margin: 0 0 20px; }

/* Buttons */
#erc2-app .erc2-btn { border-radius: 14px; font-weight: 700; font-size: 13.5px; padding: 12px 20px; border: 1px solid transparent; }
#erc2-app .erc2-btn-primary { background: var(--erc2-indigo); color: #fff; }
#erc2-app .erc2-btn-primary:hover { background: var(--erc2-indigo-dark); }
#erc2-app .erc2-btn-outline { background: #fff; border-color: var(--erc2-border); color: var(--erc2-slate-900); }
#erc2-app .erc2-btn-outline:hover { border-color: #c7d2fe; color: var(--erc2-indigo-dark); }
#erc2-app .erc2-loadmore-wrap { display: flex; justify-content: center; margin-top: 28px; }
#erc2-app .erc2-count-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--erc2-indigo);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    margin-left: 6px;
}

/* Loading state */
#erc2-app .erc2-grid.is-loading { opacity: .5; pointer-events: none; }

/* Responsive */
@media (max-width: 900px) {
    #erc2-app .erc2-mobile-bar { display: flex; align-items: center; }
    #erc2-app .erc2-layout { display: block; }
    #erc2-app .erc2-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 320px;
        max-width: 85vw;
        z-index: 50;
        border-radius: 0;
        overflow-y: auto;
        transform: translateX(-100%);
        transition: transform .25s ease;
    }
    #erc2-app .erc2-sidebar.is-open { transform: translateX(0); }
    #erc2-app .erc2-sidebar-close { display: block; }
    #erc2-app .erc2-grid { grid-template-columns: 1fr; }
    #erc2-app .erc2-hero h1 { font-size: 30px; }
}
