/* ==========================================================
   Historical Research Center
   Namespaced with ev-rc- (page content) and ev-quicklinks-
   (right-column Quick Links) to avoid collisions with the
   shared shell CSS in journey-layout.css.
   ========================================================== */

/* ---------- Header (#ev-banner slot) ---------- */

.ev-rc-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: var(--space-16, 16px) var(--space-20, 20px);
    background: var(--color-white, #fff);
    border: 1px solid var(--color-border, #e6e8ec);
    border-radius: var(--radius-16, 16px);
}

.ev-rc-header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-12, 12px);
    background: #EEF5FD;
    color: var(--color-navy, #173763);
    flex-shrink: 0;
}

.ev-rc-header-icon i {
    width: 22px;
    height: 22px;
}

.ev-rc-header-text {
    flex: 1;
    min-width: 0;
}

.ev-rc-title {
    font-family: var(--ev-font-heading, "Playfair Display", "Playfair Display Fallback", serif);
    font-size: var(--font-size-20, 20px);
    font-weight: 700;
    color: var(--color-navy, #173763);
    margin: 0 0 2px;
}

.ev-rc-tagline {
    font-size: var(--font-size-11, 11px);
    color: var(--color-gray-muted, #6b7280);
    margin: 0;
}

/* ---------- Controls: search + view toggle ---------- */

.ev-rc-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 0 12px;
    flex-wrap: wrap;
}

.ev-rc-search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 220px;
    background: var(--color-white, #fff);
    border: 1px solid var(--color-border, #e6e8ec);
    border-radius: var(--radius-10, 10px);
    padding: var(--space-9, 9px) var(--space-14, 14px);
}

.ev-rc-search-icon {
    width: 14px;
    height: 14px;
    color: var(--color-gray-light, #9aa1ab);
    flex-shrink: 0;
}

.ev-rc-search-input {
    border: none;
    outline: none;
    font-size: var(--font-size-12, 12px);
    color: var(--color-ink, #1f2733);
    flex: 1;
    background: transparent;
}

.ev-rc-search-input::placeholder {
    color: var(--color-gray-light, #9aa1ab);
}

.ev-rc-view-toggle {
    display: inline-flex;
    flex-shrink: 0;
}

.ev-rc-view-btn {
    padding: var(--space-9, 9px) var(--space-16, 16px);
    font-weight: 600;
    transition: background 0.15s ease, color 0.15s ease;
}

/* ---------- Category row-plan ---------- */
/* Rows stack in normal block flow — no flex-wrap here anymore. The
   earlier version nested two auto-sizing mechanisms (a flex parent
   waiting on its grid child's width, a grid child using auto-fill
   waiting on its flex parent's width) — neither had a real number to
   resolve against, so every section collapsed to one column. The fix:
   every grid below gets an EXPLICIT column count from research-center.js
   (repeat(N, 1fr), set inline per row) — nothing here is ambiguous. */

#ev-rc-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ev-rc-row {
    width: 100%;
}

.ev-rc-row--split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.ev-rc-row-half {
    min-width: 0;
}

.ev-rc-section-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: var(--space-2, 2px);
}

.ev-rc-section-icon {
    width: 15px;
    height: 15px;
}

.ev-rc-section-title {
    font-size: var(--font-size-12, 12px);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.ev-rc-section-purpose {
    font-size: var(--font-size-11, 11px);
    font-weight:800px;
    color: var(--color-gray-muted, #6b7280);
    margin: 2px 0 10px;
}

/* ---------- Card grid ---------- */
/* No grid-template-columns here — every row sets its own explicit
   repeat(N, 1fr) inline (research-center.js), so column count is
   never ambiguous. --flat is the exception: the "All Analyses" view
   and search results aren't part of the row-plan, so they get a
   normal self-contained fixed-width auto-fill grid instead. */

.ev-rc-card-grid {
    display: grid;
    gap: 6px;
}

.ev-rc-card-grid--flat {
    grid-template-columns: repeat(auto-fill, minmax(160px, 195px));
}

.ev-rc-card-blank {
    visibility: hidden;
}

.ev-rc-card {
    display: block;
    padding: var(--space-6, 6px);
    text-decoration: none;
    position: relative;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.ev-rc-card:hover {
    border-color: var(--color-gold, #F2B45A);
    box-shadow: 0 4px 14px rgba(23, 55, 99, .08);
}

.ev-rc-card-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: var(--radius-8, 8px);
    margin-bottom: var(--space-4, 4px);
}

.ev-rc-card-icon {
    width: 16px;
    height: 16px;
}

.ev-rc-card-title {
    font-size: var(--font-size-12, 12px);
    font-weight: 600;
    color: var(--color-ink, #1f2733);
    margin-bottom: var(--space-4, 4px);
    line-height: 1.3;
}

.ev-rc-card-question {
    font-size: var(--font-size-10, 10px);
    color: var(--color-gray-muted, #6b7280);
    line-height: 1.1;
    margin-bottom: var(--space-4, 4px);
}

.ev-rc-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: var(--space-4, 4px);
}

.ev-rc-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: var(--font-size-9, 9px);
    color: var(--color-gray-light, #9aa1ab);
}

.ev-rc-card-meta-icon {
    width: 10px;
    height: 10px;
    vertical-align: -1px;
}

.ev-rc-card-arrow {
    width: 14px;
    height: 14px;
    color: var(--color-gold, #F2B45A);
    flex-shrink: 0;
}

.ev-rc-empty {
    font-size: var(--font-size-11, 11px);
    color: var(--color-gray-light, #9aa1ab);
    text-align: center;
    padding: 30px 0;
    font-style: italic;
}

/* ---------- Quick Links (appended into #ev-insights) ---------- */

.ev-quicklinks {
    margin-top: var(--space-20, 20px);
    padding-top: var(--space-16, 16px);
    border-top: 1px solid var(--color-border, #e6e8ec);
}

.ev-quicklinks-title {
    font-family: var(--ev-font-heading, "Playfair Display", "Playfair Display Fallback", serif);
    font-size: var(--font-size-12, 12px);
    font-weight: 700;
    color: var(--color-navy, #173763);
    text-transform: uppercase;
    margin-bottom: var(--space-10, 10px);
}

.ev-quicklinks-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    text-decoration: none;
    border-bottom: 1px solid var(--color-bg-muted, #f0f1f3);
}

.ev-quicklinks-item:last-child {
    border-bottom: none;
}

.ev-quicklinks-item-icon {
    width: 14px;
    height: 14px;
    color: var(--color-gray-muted, #6b7280);
    flex-shrink: 0;
}

.ev-quicklinks-item-label {
    flex: 1;
    font-size: var(--font-size-11, 11px);
    color: var(--color-ink, #1f2733);
}

.ev-quicklinks-item-chevron {
    width: 12px;
    height: 12px;
    color: var(--color-gray-light, #9aa1ab);
    flex-shrink: 0;
}

/* ---------- Responsive ---------- */
/* Row-plan grids set their column count via an INLINE style (so desktop
   gets exact, unambiguous column counts per row) — inline styles always
   win over an external stylesheet rule, media query or not, so !important
   is the correct, deliberate way to override it here on narrow screens.
   --flat doesn't need !important (no inline style to fight), but is
   included for clarity/consistency. */

@media (max-width: 540px) {
    .ev-rc-card-grid { grid-template-columns: 1fr !important; }
    .ev-rc-row--split { grid-template-columns: 1fr; gap: 20px; }
    .ev-rc-controls { flex-direction: column; align-items: stretch; }
}

.ev-quicklinks-divider{
    margin:18px 0;
    /* border-top:1px solid #E6E9EF; */
}


/* ---------- Feedback  ---------- */
.ev-feedback-overlay{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.45);
    display:none;
    align-items:center;
    justify-content:center;
    z-index:99999;
}

.ev-feedback-overlay.show{
    display:flex;
}

.ev-feedback-modal{
    width:min(640px,92vw);
    background:var(--color-white, #fff);
    border-radius:var(--radius-16, 16px);
    box-shadow:0 24px 60px rgba(0,0,0,.20);
    overflow:hidden;
    animation:evFade .18s ease;
}

@keyframes evFade{
    from{
        opacity:0;
        transform:translateY(12px);
    }
    to{
        opacity:1;
        transform:translateY(0);
    }

}

.ev-feedback-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:var(--space-22, 22px) var(--space-24, 24px);
    border-bottom:1px solid #ECECEC;

}

.ev-feedback-title{
    font-size:var(--font-size-22, 22px);
    font-weight:700;
    color:var(--color-navy, #173763);

}

.ev-feedback-close{
    border:none;
    background:none;
    cursor:pointer;
    font-size:var(--font-size-26, 26px);
    color:#777;

}

.ev-feedback-body{
    padding:var(--space-24, 24px);
}

.ev-feedback-body label{
    display:block;
    margin-top:var(--space-18, 18px);
    margin-bottom:var(--space-8, 8px);
    font-weight:600;

}

.ev-feedback-body input,
.ev-feedback-body textarea{
    width:100%;
    padding:var(--space-12, 12px);
    border:1px solid #D9D9D9;
    border-radius:var(--radius-10, 10px);
    box-sizing:border-box;
    font:inherit;
}

.ev-feedback-body textarea{
    resize:vertical;
    min-height:150px;
}

.ev-feedback-footer{
    display:flex;
    justify-content:flex-end;
    gap:12px;
    padding:var(--space-20, 20px) var(--space-24, 24px);
    border-top:1px solid #ECECEC;

}

.ev-btn{
    border:none;
    cursor:pointer;
    padding:var(--space-10, 10px) var(--space-18, 18px);
    border-radius:var(--radius-10, 10px);
    font-weight:600;
}

.ev-btn-secondary{
    background:#EEF2F6;
}

.ev-btn-primary{
    background:var(--color-navy, #173763);
    color:white;
}

.ev-fdb-title {
    font-family: var(--ev-font-heading, "Playfair Display", "Playfair Display Fallback", serif);
    font-size: var(--font-size-12, 12px);
    font-weight: 700;
    color: var(--color-navy, #173763);
    text-transform: uppercase;
    margin-bottom: var(--space-10, 10px);
    letter-spacing:.06em;
}
#ev-feedback-category{
    background:#F6F8FA;
    color:var(--color-gray-slate, #4B5563);
    cursor:default;
}

/* ==========================================
   Toast Notification
========================================== */

.ev-toast{

    position:fixed;

    right:24px;

    bottom:24px;

    width:340px;

    display:flex;

    gap:14px;

    align-items:flex-start;

    padding:var(--space-18, 18px) var(--space-20, 20px);

    background:var(--color-white, #ffffff);

    border-radius:var(--radius-14, 14px);

    box-shadow:0 16px 40px rgba(0,0,0,.18);

    z-index:100000;

    opacity:0;

    transform:translateY(20px);

    pointer-events:none;

    transition:
        opacity .25s ease,
        transform .25s ease;

}

.ev-toast.show{

    opacity:1;

    transform:translateY(0);

}

.ev-toast-icon{

    width:34px;

    height:34px;

    border-radius:var(--radius-circle, 50%);

    background:#22C55E;

    color:var(--color-white, #fff);

    display:flex;

    align-items:center;

    justify-content:center;

    font-weight:700;

    font-size:var(--font-size-18, 18px);

    flex-shrink:0;

}

.ev-toast-title{

    font-size:var(--font-size-15, 15px);

    font-weight:700;

    color:var(--color-navy, #173763);

    margin-bottom:var(--space-4, 4px);

}

.ev-toast-message{

    font-size:var(--font-size-13, 13px);

    color:#666;

    line-height:1.45;

}