/* Origin-country guides (ADR 0007). Fully scoped to .cg-* so it can't touch any other page.
   Built on Bootstrap's --bs-* theme tokens, so light/dark both come out right. */

.cg-wrap {
    --cg-line: var(--bs-border-color, #dfe3dd);
    --cg-muted: var(--bs-secondary-color, #5b6560);
    --cg-accent: var(--bs-primary, #1f7a54);
    --cg-panel: var(--bs-tertiary-bg, #f4f6f2);
}

.cg-container {
    max-width: 64rem;
    margin-inline: auto;
    padding-inline: 1.25rem;
}

/* ── Hero ─────────────────────────────────────────────────────────────── */
.cg-hero {
    padding: 3rem 0 1.5rem;
}

.cg-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--cg-muted);
    margin-bottom: .5rem;
}

.cg-flag {
    font-size: 1.4rem;
    line-height: 1;
}

.cg-hero .cg-lede :first-child {
    margin-top: 0;
}

.cg-hero h1 {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    line-height: 1.12;
    margin: 0 0 .75rem;
}

/* ── Jump-nav tabs (anchor links; all sections stay in the DOM) ────────── */
.cg-tabs {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    padding: .75rem 0;
    margin-bottom: .5rem;
    background: var(--bs-body-bg, #fff);
    border-bottom: 1px solid var(--cg-line);
}

.cg-tab {
    display: inline-block;
    padding: .35rem .85rem;
    border-radius: 999px;
    border: 1px solid var(--cg-line);
    font-size: .85rem;
    font-weight: 600;
    color: var(--bs-body-color, #1a1a1a);
    text-decoration: none;
    transition: background .12s ease, border-color .12s ease;
}

.cg-tab:hover,
.cg-tab:focus-visible {
    border-color: var(--cg-accent);
    background: color-mix(in srgb, var(--cg-accent) 10%, transparent);
}

.cg-tab.is-active {
    border-color: var(--cg-accent);
    background: var(--cg-accent);
    color: #fff;
}

/* JS switches tabs by hiding the inactive sections; all stay in the DOM (crawlable), and with no
   JS none carries [hidden], so every section shows stacked. */
.cg-section[hidden] {
    display: none;
}

/* ── A destination section ────────────────────────────────────────────── */
.cg-section {
    padding: 2rem 0;
    border-top: 1px solid var(--cg-line);
    scroll-margin-top: 4rem; /* clear the sticky tab bar when jumped to */
}

.cg-section:first-of-type {
    border-top: 0;
}

.cg-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: .5rem 1rem;
    margin-bottom: 1rem;
}

.cg-section-head h2 {
    font-size: 1.5rem;
    margin: 0;
}

.cg-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.cg-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .25rem .7rem;
    border-radius: 999px;
    background: var(--cg-panel);
    border: 1px solid var(--cg-line);
    font-size: .8rem;
    color: var(--bs-body-color, #1a1a1a);
}

.cg-chip b {
    color: var(--cg-muted);
    font-weight: 600;
}

.cg-intro {
    color: var(--bs-body-color, #1a1a1a);
    margin-bottom: 1.5rem;
}

/* ── Timeline of steps ────────────────────────────────────────────────── */
.cg-steps {
    list-style: none;
    counter-reset: cg-step;
    margin: 0;
    padding: 0;
}

.cg-step {
    counter-increment: cg-step;
    position: relative;
    padding: 0 0 1.5rem 3rem;
    border-left: 2px solid var(--cg-line);
    margin-left: 1rem;
}

.cg-step:last-child {
    border-left-color: transparent;
    padding-bottom: 0;
}

.cg-step::before {
    content: counter(cg-step);
    position: absolute;
    left: -1rem;
    top: -.2rem;
    width: 2rem;
    height: 2rem;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--cg-accent);
    color: #fff;
    font-size: .9rem;
    font-weight: 700;
}

.cg-step-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 .25rem;
}

.cg-step-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem .6rem;
    margin-bottom: .5rem;
    font-size: .8rem;
    color: var(--cg-muted);
}

.cg-step-meta span {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}

.cg-step-body :last-child {
    margin-bottom: 0;
}

/* ── Change-country row + hub picker ──────────────────────────────────── */
.cg-changerow {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .75rem;
    padding: 1rem 0;
    color: var(--cg-muted);
    font-size: .9rem;
}

.cg-picker {
    display: inline-flex;
    gap: .5rem;
    align-items: center;
    flex-wrap: wrap;
}

.cg-picker select {
    min-width: 12rem;
    padding: .4rem .6rem;
    border-radius: .5rem;
    border: 1px solid var(--cg-line);
    background: var(--bs-body-bg, #fff);
    color: var(--bs-body-color, #1a1a1a);
    font: inherit;
}

.cg-btn {
    display: inline-block;
    padding: .45rem 1rem;
    border-radius: .5rem;
    border: 1px solid var(--cg-accent);
    background: var(--cg-accent);
    color: #fff;
    font-weight: 600;
    font-size: .9rem;
    text-decoration: none;
    cursor: pointer;
}

.cg-btn-ghost {
    background: transparent;
    color: var(--cg-accent);
}

/* ── Hub grid of country cards ────────────────────────────────────────── */
.cg-hubgrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: 1rem;
    margin: 1.5rem 0 2.5rem;
}

.cg-card {
    display: flex;
    flex-direction: column;
    gap: .35rem;
    padding: 1.1rem 1.2rem;
    border-radius: .9rem;
    border: 1px solid var(--cg-line);
    background: var(--bs-body-bg, #fff);
    text-decoration: none;
    color: inherit;
    transition: border-color .12s ease, transform .12s ease;
}

.cg-card:hover {
    border-color: var(--cg-accent);
    transform: translateY(-2px);
}

.cg-card-title {
    display: flex;
    align-items: center;
    gap: .55rem;
    font-size: 1.15rem;
    font-weight: 700;
}

.cg-card-sub {
    color: var(--cg-muted);
    font-size: .88rem;
}

.cg-card-cta {
    margin-top: auto;
    padding-top: .4rem;
    color: var(--cg-accent);
    font-weight: 600;
    font-size: .85rem;
}

.cg-notfound {
    padding: 4rem 0;
    text-align: center;
}

/* ── Suggestion ribbon (injected by origin-ribbon.js) ─────────────────── */
.cg-ribbon {
    --cg-line: var(--bs-border-color, #dfe3dd);
    --cg-accent: var(--bs-primary, #1f7a54);
    /* Pinned just below the sticky .mkt-header (64px tall, z-index 100) so it stays visible on
       scroll instead of sliding away with the page. Its background mixes into the opaque body-bg,
       so page content scrolls cleanly underneath. */
    position: sticky;
    top: 64px;
    z-index: 99;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: .6rem 1.25rem;
    background: color-mix(in srgb, var(--cg-accent) 10%, var(--bs-body-bg, #fff));
    border-bottom: 1px solid color-mix(in srgb, var(--cg-accent) 25%, transparent);
    font-size: .92rem;
    animation: cg-ribbon-in .25s ease;
}

/* Phone (2026-10): one compact strip, not a three-line block - the short question ("Starting from
   Nepal?") and the guide button share a line, the long sentence is dropped, and the site CTA bar
   (medax-ui.css) steps aside while the ribbon shows, so the first screen carries ONE banner. The child rules
   are scoped under .cg-ribbon so they outrank the base rules that follow this block in the file. */
@media (max-width: 640px) {
    .cg-ribbon {
        position: relative;
        top: auto;
        justify-content: flex-start;
        gap: .3rem .6rem;
        padding: .4rem 2.2rem .4rem .75rem;
        font-size: .8rem;
    }
    .cg-ribbon .cg-ribbon-long { display: none; }
    .cg-ribbon .cg-ribbon-msg { flex: 0 1 auto; line-height: 1.3; }
    .cg-ribbon .cg-ribbon-actions { flex-wrap: wrap; gap: .3rem .7rem; }
    .cg-ribbon .cg-ribbon-cta { padding: .22rem .65rem; font-size: .78rem; }
    .cg-ribbon .cg-ribbon-not { font-size: .76rem; }
    .cg-ribbon .cg-ribbon-close { position: absolute; right: .4rem; top: .3rem; }
}

@keyframes cg-ribbon-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

.cg-ribbon--quiet {
    background: var(--bs-tertiary-bg, #f4f6f2);
    border-bottom-color: var(--cg-line);
    font-size: .86rem;
}

.cg-ribbon-msg {
    color: var(--bs-body-color, #1a1a1a);
    font-weight: 500;
}

.cg-ribbon-actions {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
}

/* Dark: the ribbon sits outside .mkt-shell, so it takes the dark palette's blue family itself - a fill that carries
   white text (4.6:1) and the light blue for its text link (the old #5B8DEF failed with white text at 3.2:1). */
:root[data-bs-theme="dark"] .cg-ribbon { --cg-accent: #4F6FD8; --cg-link: #A9B9F4; }
@media (prefers-color-scheme: dark) {
    :root:not([data-bs-theme="light"]) .cg-ribbon { --cg-accent: #4F6FD8; --cg-link: #A9B9F4; }
}

.cg-ribbon-cta {
    display: inline-flex;
    align-items: center;
    padding: .4rem 1rem;
    border-radius: 999px;
    background: var(--cg-accent);
    color: #fff;
    font-weight: 600;
    font-size: .88rem;
    text-decoration: none;
    white-space: nowrap;
}

.cg-ribbon-cta:hover {
    color: #fff;
    filter: brightness(1.08);
}

.cg-ribbon-not {
    color: var(--cg-link, var(--cg-accent));
    font-weight: 600;
    text-decoration: none;
    font-size: .85rem;
}

.cg-ribbon-not:hover {
    text-decoration: underline;
}

.cg-ribbon-close {
    border: 0;
    background: transparent;
    color: var(--bs-secondary-color, #5b6560);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 .25rem;
    border-radius: .3rem;
}

.cg-ribbon-close:hover {
    color: var(--bs-body-color, #1a1a1a);
}

/* ── Staff "viewing as" chip (server-rendered for CmsManage previewers only) ── */
.cg-preview-chip {
    position: fixed;
    left: 1rem;
    bottom: 1rem;
    z-index: 60;
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    padding: .5rem .9rem;
    border-radius: 999px;
    background: #3a2d00;
    color: #ffd75e;
    border: 1px solid #ffd75e;
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
}

.cg-preview-chip:hover {
    color: #fff;
}

.cg-preview-reset {
    padding-left: .6rem;
    border-left: 1px solid rgba(255, 215, 94, .4);
    opacity: .85;
}

/* ── Persistent "your guide" chip in the header (injected by origin-ribbon.js) ── */
.mkt-origin-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .3rem .7rem;
    margin-right: .25rem;
    border-radius: 999px;
    border: 1px solid var(--bs-border-color, #dfe3dd);
    background: color-mix(in srgb, var(--bs-primary, #1f7a54) 8%, transparent);
    color: var(--bs-primary, #1f7a54);
    font-size: .82rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
}

.mkt-origin-chip:hover {
    background: color-mix(in srgb, var(--bs-primary, #1f7a54) 16%, transparent);
    color: var(--bs-primary, #1f7a54);
}

/* Prominent "your guide" header button - the CONFIDENT counterpart of the chip, for a candidate
   whose country we KNOW (their profile, or an explicit pick). Filled coral = the app's action colour,
   so it reads as the clear call-to-action the chip's quiet pill does not. */
.mkt-origin-cta {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .4rem .85rem;
    margin-right: .25rem;
    border-radius: 999px;
    border: 1px solid var(--mx-action, #d0402d);
    background: var(--mx-action, #d0402d);
    color: var(--mx-action-on, #fff);
    font-size: .82rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
}

.mkt-origin-cta:hover {
    background: var(--mx-action-hover, #b23422);
    border-color: var(--mx-action-hover, #b23422);
    color: var(--mx-action-on, #fff);
}

/* The header must never overflow. The guide link is the first thing to give way - by folding,
   never by shrinking: a shrinkable chip got crushed to a sliver with its label painted under
   the search button. So it never shrinks, and instead:
   - laptop band (where the account pills already fold to icons): icon-only round button;
   - signed in, at any width: icon-only too - that bar has no room for the label even in the
     wide header row, and Dashboard is already its one loud action;
   - phone widths: removed from the bar entirely - origin-ribbon.js mirrors it as the first
     entry of the hamburger panel (.mkt-menu-origin), which only shows when the burger does. */
.mkt-origin-chip, .mkt-origin-cta { flex: 0 0 auto; }
.mkt-origin-cta svg, .mkt-origin-chip svg { flex: 0 0 auto; }
.mkt-menu-origin { display: none !important; }
@media (max-width: 1599px) {
    .mkt-origin-chip span, .mkt-origin-cta span { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
    .mkt-origin-chip, .mkt-origin-cta { flex: 0 0 34px; width: 34px; height: 34px; padding: 0; margin-right: 0; justify-content: center; }
}
.mkt-header--member .mkt-origin-chip span, .mkt-header--member .mkt-origin-cta span { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.mkt-header--member .mkt-origin-chip, .mkt-header--member .mkt-origin-cta { flex: 0 0 34px; width: 34px; height: 34px; padding: 0; margin-right: 0; justify-content: center; }
@media (max-width: 640px) {
    .mkt-origin-chip, .mkt-origin-cta { display: none; }
}
@media (max-width: 640px) {
    .mkt-menu-panel .mkt-menu-origin { display: flex !important; align-items: center; gap: .45rem; font-weight: 700; color: var(--mx-nav-action-ink, #9A4F0C); }   /* orange as TEXT: the fill orange was 2.5:1 on the white panel */
    .mkt-menu-origin svg { width: 1rem; height: 1rem; }
}

/* ── "Add this route to my plan" (signed-in candidates, per destination section) ── */
/* English requirement callout (ADR 0011 E) - verified figures + an entry point to prep. */
.cg-english {
    margin-top: 1.4rem;
    padding: 1.1rem 1.25rem;
    border: 1px solid var(--cg-line);
    border-radius: 14px;
    background: var(--cg-card, rgba(0, 0, 0, .02));
}
.cg-english-title {
    margin: 0 0 .6rem;
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--cg-heading, inherit);
}
.cg-english-list { list-style: none; margin: 0 0 .8rem; padding: 0; display: grid; gap: .6rem; }
.cg-english-item { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .6rem; }
.cg-english-fact { font-weight: 600; }
.cg-english-note { color: var(--cg-muted); font-size: .92rem; }
.cg-english-note :is(p) { margin: 0; }
.cg-english-verified {
    font-size: .72rem;
    font-weight: 600;
    color: var(--cg-accent);
    border: 1px solid var(--cg-line);
    border-radius: 999px;
    padding: .05rem .5rem;
}
.cg-english-cta { display: flex; flex-wrap: wrap; gap: .6rem; }

.cg-adopt {
    display: flex;
    align-items: center;
    gap: .75rem 1rem;
    flex-wrap: wrap;
    margin-top: 1.4rem;
    padding-top: 1.2rem;
    border-top: 1px dashed var(--cg-line);
}

.cg-adopt-form { margin: 0; }

.cg-adopt-in {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-weight: 600;
    color: var(--cg-accent);
}

.cg-adopt-note {
    font-size: .82rem;
    color: var(--cg-muted);
}

/* ── Passers from this origin (proof that looks like the reader) ── */
.cg-passers {
    margin-top: 1rem;
    padding-top: 1.8rem;
    border-top: 1px solid var(--cg-line);
}

.cg-passers h2 {
    font-size: 1.35rem;
    margin: 0 0 1.2rem;
}

.cg-passer-wall {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

/* The shared PasserFigure (.pf) sizes itself; keep the cards a sensible width on this page. */
.cg-passer-wall .pf {
    flex: 0 1 220px;
}

/* ── Related articles for this origin (the guide as a content hub) ── */
.cg-related {
    margin-top: 1rem;
    padding-top: 1.8rem;
    border-top: 1px solid var(--cg-line);
}

.cg-related h2 {
    font-size: 1.35rem;
    margin: 0 0 1.2rem;
}

.cg-related-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr));
    gap: 1rem;
}

.cg-related-card {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    padding: 1rem 1.1rem;
    border-radius: .8rem;
    border: 1px solid var(--cg-line);
    background: var(--bs-body-bg, #fff);
    text-decoration: none;
    color: inherit;
    transition: border-color .12s ease, transform .12s ease;
}

.cg-related-card:hover {
    border-color: var(--cg-accent);
    transform: translateY(-2px);
}

.cg-related-title { font-weight: 700; line-height: 1.3; }
.cg-related-sum { color: var(--cg-muted); font-size: .88rem; }
.cg-related-go { margin-top: auto; color: var(--cg-accent); font-weight: 600; font-size: .85rem; }
