/* ============================================================
   RESEARCH METHODOLOGY PAGE
   Extends research-survey.css (rs-*) with document-style components.
   ============================================================ */

.rm-page .rs-layout-inner { grid-template-columns: 292px minmax(0, 1fr); }
.rm-page .rs-head { margin-bottom: 28px; }
.rm-page .rs-head p { margin-top: 12px; }
.rm-page .rs-head-left { max-width: 900px; }

/* compact table of contents (20 links) */
.rm-toc a { padding: 6px 10px; font-size: 12.8px; line-height: 1.35; align-items: flex-start; }
.rm-toc a i { margin-top: 1px; font-size: 16px; }

/* ---------- Hero: methodology at a glance ---------- */
.rm-doc {
    position: relative;
    isolation: isolate;
    padding: 52px 30px 26px;
    border-radius: 24px;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.13), rgba(255, 255, 255, 0.04));
    border: 1px solid rgba(212, 168, 67, 0.45);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.rm-doc-ribbon {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 22px;
    border-radius: 0 0 14px 14px;
    background: linear-gradient(135deg, #F2D27A, #D4A843);
    color: var(--rs-forest);
    font-family: 'Manrope', sans-serif;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    white-space: nowrap;
    box-shadow: 0 8px 20px rgba(212, 168, 67, 0.35);
}

.rm-doc-list { margin: 0; }

.rm-doc-list > div {
    padding: 14px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.rm-doc-list > div:first-child { border-top: 0; padding-top: 0; }

.rm-doc-list dt {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--rs-gold);
}

.rm-doc-list dt i { font-size: 16px; }

.rm-doc-list dd {
    margin: 0;
    font-family: 'Manrope', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.35;
}

.rm-doc-list dd small { font-size: 0.78rem; font-weight: 600; color: rgba(255, 255, 255, 0.65); }

/* ---------- Shared helpers ---------- */
.rm-lead-left { text-align: left; margin-bottom: 18px; }
.rm-gap-top { margin-top: 22px; }

.rm-page .rs-note.rm-note-flat { margin: 0; max-width: none; height: 100%; }

.rm-page .rs-facts { margin: 8px 0 0; }
.rm-facts-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rm-facts-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.rm-tile-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.rm-tile { padding: 24px 22px; }
.rm-tile h3 { font-size: 1rem; line-height: 1.35; }
.rm-tile .rs-icon { margin-bottom: 14px; }

.rm-page .rs-note { margin-top: 24px; max-width: none; }

/* numbered cards (eligibility) */
.rm-numbered {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.rm-numbered li,
.rm-process li {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    padding: 20px 22px;
    background: #fff;
    border: 1px solid var(--rs-line);
    border-radius: 14px;
    transition: transform var(--transition, 0.2s ease), border-color var(--transition, 0.2s ease), box-shadow var(--transition, 0.2s ease);
}

.rm-numbered li:hover,
.rm-process li:hover {
    transform: translateY(-3px);
    border-color: rgba(212, 168, 67, 0.55);
    box-shadow: 0 14px 28px rgba(11, 59, 47, 0.08);
}

.rm-numbered p,
.rm-process p { margin: 0; color: var(--rs-ink); font-weight: 600; line-height: 1.6; }

.rm-num {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--rs-forest);
    color: var(--rs-gold);
    font-family: 'Manrope', sans-serif;
    font-weight: 800;
    font-size: 0.95rem;
}

.rm-process {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.rm-process li { padding: 16px 18px; }
.rm-process p { font-size: 0.95rem; font-weight: 600; }

/* ---------- Businesses evaluated ---------- */
.rm-county-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.rm-county-total {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Manrope', sans-serif;
    font-weight: 800;
    color: var(--rs-forest);
}

.rm-county-total i { color: #A87B14; font-size: 20px; }

.rm-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 8px;
    padding: 9px 16px;
    border: 1px solid var(--rs-line);
    border-radius: 999px;
    background: #fff;
    color: var(--rs-forest);
    font-family: 'Manrope', sans-serif;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: background var(--transition, 0.2s ease), border-color var(--transition, 0.2s ease);
}

.rm-btn:first-child { margin-left: 0; }
.rm-btn:hover { background: var(--rs-gold-soft); border-color: rgba(212, 168, 67, 0.6); }

.rm-county-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.rm-county {
    background: #fff;
    border: 1px solid var(--rs-line);
    border-radius: 16px;
    overflow: hidden;
    transition: border-color var(--transition, 0.2s ease), box-shadow var(--transition, 0.2s ease);
}

.rm-county[open] { border-color: rgba(212, 168, 67, 0.6); box-shadow: 0 12px 28px rgba(11, 59, 47, 0.08); }

.rm-county summary {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    cursor: pointer;
    list-style: none;
}

.rm-county summary::-webkit-details-marker { display: none; }

.rm-county-name {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Manrope', sans-serif;
    font-weight: 800;
    color: var(--rs-forest);
}

.rm-county-name i { color: #A87B14; font-size: 20px; }

.rm-county-count {
    min-width: 34px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--rs-forest);
    color: var(--rs-gold);
    font-family: 'Manrope', sans-serif;
    font-size: 13px;
    font-weight: 800;
    text-align: center;
}

.rm-caret { color: var(--rs-muted); transition: transform var(--transition, 0.2s ease); }
.rm-county[open] .rm-caret { transform: rotate(180deg); }

.rm-county-table {
    max-height: 400px;
    overflow: auto;
    border: 0;
    border-top: 1px solid var(--rs-line);
    border-radius: 0;
    box-shadow: none;
}

.rm-table th { position: sticky; top: 0; z-index: 1; }
.rm-county-table .rs-table { font-size: 13.5px; }
.rm-county-table .rs-table td,
.rm-county-table .rs-table th { padding: 11px 14px; }

/* ---------- Callouts & cards ---------- */
.rm-callout {
    background: #fff;
    border: 1px solid var(--rs-line);
    border-left: 4px solid var(--rs-gold);
    border-radius: 14px;
    padding: 24px 26px;
}

.rm-callout h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 10px;
    font-family: 'Manrope', sans-serif;
    font-size: 1.1rem;
    color: var(--rs-forest);
}

.rm-callout h3 i { color: #A87B14; font-size: 24px; }
.rm-callout p { margin: 0; color: var(--rs-muted); line-height: 1.75; }
.rm-callout-wide { max-width: none; }

.rm-lounge { text-align: center; }
.rm-lounge .rs-icon { margin-left: auto; margin-right: auto; }
.rm-lounge h3 { margin-bottom: 6px; }
.rm-lounge p { display: flex; justify-content: center; align-items: center; gap: 6px; }
.rm-lounge p i { color: #A87B14; }

.rm-calc h3,
.rm-rule h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.rm-calc h3 i { color: #A87B14; font-size: 24px; }
.rm-calc p + p { margin-top: 12px; }

/* row 1: two equal cards; row 2: short card narrow, long card wide, so heights stay close */
.rm-calc-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.rm-calc-grid .rm-calc { grid-column: span 3; }
.rm-calc-grid .rm-calc:nth-child(3) { grid-column: span 2; }
.rm-calc-grid .rm-calc:nth-child(4) { grid-column: span 4; }

.rm-calc-primary .rm-formula { max-width: 560px; }

.rs-card .rm-formula {
    padding: 14px 18px;
    border-radius: 12px;
    background: var(--rs-forest);
    color: #fff;
    font-family: 'Manrope', sans-serif;
    font-weight: 800;
    line-height: 1.5;
}

.rm-rule-list { margin: 14px 0 14px 22px; padding: 0; color: var(--rs-muted); line-height: 1.7; }
.rm-rule-list li { padding-left: 6px; margin-bottom: 8px; }
.rm-rule-list li::marker { color: #A87B14; font-weight: 800; }
.rm-rule-end { padding-top: 12px; border-top: 1px solid var(--rs-line); }

/* limitations */
.rm-limits {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.rm-limits li {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 18px 20px;
    background: #fff;
    border: 1px solid var(--rs-line);
    border-radius: 14px;
    color: var(--rs-ink);
    font-weight: 600;
    line-height: 1.6;
}

.rm-limits li i { flex-shrink: 0; color: #C58A12; font-size: 24px; }
.rm-limits li:last-child { grid-column: 1 / -1; }

/* direct answers */
.rm-answer {
    padding: 28px;
    margin-bottom: 22px;
    background: #FBFAF4;
    border: 1px solid var(--rs-line);
    border-radius: 18px;
}

.rm-answer:last-child { margin-bottom: 0; }
.rm-answer .rs-question { margin-top: 0; }
.rm-answer > p { margin: 12px 0 0; color: var(--rs-muted); line-height: 1.75; }
.rm-answer .rs-facts { margin-top: 22px; }

/* history */
.rm-history {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    padding: 24px 26px;
    background: #fff;
    border: 1px solid var(--rs-line);
    border-radius: 16px;
}

.rm-history-dot {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin-top: 5px;
    border-radius: 50%;
    background: var(--rs-gold);
    box-shadow: 0 0 0 5px var(--rs-gold-soft);
}

.rm-history strong { margin-right: 10px; font-family: 'Manrope', sans-serif; font-size: 1.15rem; color: var(--rs-forest); }
.rm-history p { margin: 10px 0 0; color: var(--rs-muted); line-height: 1.7; }

.rm-back { margin-top: 10px; }

/* ---------- Responsive ---------- */
@media (max-width: 1500px) {
    .rm-process { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1100px) {
    .rm-calc-grid { grid-template-columns: minmax(0, 1fr); }
    .rm-calc-grid .rm-calc,
    .rm-calc-grid .rm-calc:nth-child(3),
    .rm-calc-grid .rm-calc:nth-child(4) { grid-column: auto; }
    .rm-page .rs-layout-inner { grid-template-columns: minmax(0, 1fr); }
    .rm-toc a { align-items: center; font-size: 13px; }
    .rm-county-list { grid-template-columns: 1fr; }
    .rm-tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
    .rm-numbered,
    .rm-process,
    .rm-limits,
    .rm-facts-2,
    .rm-facts-3 { grid-template-columns: 1fr; }
    .rm-limits li:last-child { grid-column: auto; }
    .rm-doc { padding: 52px 22px 22px; }
    .rm-answer { padding: 22px 18px; }
    .rm-history { padding: 20px; flex-direction: column; }

    /* the business lists stay as real tables on phones (3 short columns) */
    .rm-county-table .rs-table { display: table; width: 100%; }
    .rm-county-table .rs-table thead { display: table-header-group; }
    .rm-county-table .rs-table tbody { display: table-row-group; }
    .rm-county-table .rs-table tr { display: table-row; padding: 0; border-top: 0; }
    .rm-county-table .rs-table td { display: table-cell; width: auto; padding: 10px 12px; text-align: left; border-top: 1px solid var(--rs-line); }
    .rm-county-table .rs-table td::before { content: none; }
    .rm-county-table .rs-row-win { box-shadow: none; }
}

@media (max-width: 420px) {
    .rm-tile-grid { grid-template-columns: 1fr; }
}
