/* ==================================================================
   migration.css — the migration guide layout (2026-10-27).

   Used by /migrations/keka-to-niyuk/. Loaded directly by the page,
   not built, like css/pune.css. The layout follows the weekmate.in guide
   the user supplied: hero copy beside a banner, then a sticky table of
   contents and demo card in a left column beside the article.
   ------------------------------------------------------------------ */

.mg {
    --mg-ink: #1D1D1D;
    --mg-body: #3B4250;
    --mg-muted: #5B6472;
    --mg-line: #E3E8F0;
    --mg-brand: #2563EB;
    --mg-soft: #F3F6FC;
    color: var(--mg-body);
}

.mg-wrap {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 16px;
}

@media (min-width: 640px) {
    .mg-wrap { padding: 0 32px; }
}

/* ---- Hero -------------------------------------------------------- */

.mg-hero {
    padding: calc(var(--nav-h, 72px) + 40px) 0 48px;
    border-bottom: 1px solid var(--mg-line);
    background: linear-gradient(180deg, #F5F8FE 0%, #FFFFFF 100%);
}

.mg-hero__grid {
    display: grid;
    gap: 36px;
    align-items: center;
}

@media (min-width: 1024px) {
    .mg-hero { padding-bottom: 64px; }
    .mg-hero__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 48px; }
}

.mg-crumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 14px;
    color: var(--mg-muted);
}

.mg-crumbs a {
    color: var(--mg-brand);
    text-decoration: none;
}

.mg-crumbs a:hover { text-decoration: underline; }

.mg-hero__title {
    margin-top: 18px;
    font-size: clamp(30px, 3.6vw, 46px);
    line-height: 1.12;
    letter-spacing: -0.01em;
    color: var(--mg-ink);
}

.mg-hero__cta { margin-top: 28px; }

.mg-hero__art img {
    display: block;
    width: 100%;
    max-width: 460px;          /* the square banner, at no more than its own 500px */
    margin-inline: auto;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 20px 50px -24px rgba(37, 99, 235, 0.35);
}

/* ---- Body: sidebar + article ------------------------------------ */

.mg-body {
    display: grid;
    gap: 32px;
    padding-top: 40px;
    padding-bottom: 56px;
}

@media (min-width: 1024px) {
    .mg-body {
        grid-template-columns: 320px minmax(0, 1fr);
        gap: 64px;
        padding-top: 64px;
    }

    .mg-side {
        position: sticky;
        top: calc(var(--nav-h, 72px) + 24px);
        align-self: start;
    }

    /* A long list scrolls inside itself, and stops clear of the floating
       demo bar (includes/detail-demo-bar.php) at the foot of the screen. The
       sidebar's demo card was taken out on 2026-10-27 (asked for). */
    .mg-toc ol {
        max-height: max(200px, calc(100vh - var(--nav-h, 72px) - 240px));
        overflow-y: auto;
        scrollbar-width: thin;
    }
}

.mg-toc summary {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    list-style: none;
    font-family: 'Bricolage Grotesque', 'Bricolage Grotesque Fallback', system-ui, sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: var(--mg-ink);
}

.mg-toc summary::-webkit-details-marker { display: none; }

.mg-toc__chev {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--mg-line);
    border-radius: 8px;
}

.mg-toc__chev::before {
    content: '';
    width: 7px;
    height: 7px;
    border-right: 1.8px solid var(--mg-muted);
    border-bottom: 1.8px solid var(--mg-muted);
    transform: translateY(-2px) rotate(45deg);
    transition: transform 250ms ease;
}

.mg-toc[open] .mg-toc__chev::before { transform: translateY(2px) rotate(225deg); }

.mg-toc ol {
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
}

.mg-toc li + li { border-top: 1px solid var(--mg-line); }

.mg-toc a {
    display: block;
    padding: 9px 10px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.45;
    color: var(--mg-body);
    text-decoration: none;
    transition: background-color 200ms ease, color 200ms ease;
}

.mg-toc a:hover { color: var(--mg-brand); }

.mg-toc a.is-on {
    background: var(--mg-soft);
    color: var(--mg-ink);
    font-weight: 500;
}

@media (max-width: 1023px) {
    .mg-toc {
        padding: 16px 18px;
        border: 1px solid var(--mg-line);
        border-radius: 16px;
    }
    .mg-toc summary { justify-content: space-between; font-size: 18px; }
}

/* ---- Article ---------------------------------------------------- */

.mg-article { min-width: 0; }

.mg-sec {
    scroll-margin-top: calc(var(--nav-h, 72px) + 24px);
}

.mg-article h2 {
    margin: 44px 0 16px;
    font-size: clamp(26px, 2.6vw, 34px);
    line-height: 1.2;
    color: var(--mg-ink);
}

.mg-article h3 {
    margin: 30px 0 10px;
    font-size: clamp(20px, 1.8vw, 23px);
    line-height: 1.3;
    color: var(--mg-ink);
}

.mg-prose p,
.mg-faq p {
    margin: 0 0 14px;
    font-size: 17px;
    line-height: 1.7;
}

.mg-prose a {
    color: var(--mg-brand);
    font-weight: 600;
    text-decoration: none;
}

.mg-prose a:hover { text-decoration: underline; }

.mg-prose ul {
    margin: 4px 0 18px;
    padding-left: 22px;
    list-style: disc;
}

.mg-prose li {
    margin: 6px 0;
    font-size: 17px;
    line-height: 1.6;
}

.mg-prose li::marker { color: var(--mg-brand); }

/* The checklist: an empty box before each line, to tick off on paper. */
.mg-prose ul.mg-check {
    padding-left: 0;
    list-style: none;
}

.mg-check li {
    display: flex;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid var(--mg-line);
    border-radius: 12px;
}

.mg-check li::before {
    content: '';
    flex: none;
    width: 18px;
    height: 18px;
    margin-top: 4px;
    border: 2px solid #9DB8F3;
    border-radius: 5px;
}

.mg-table {
    margin: 8px 0 22px;
    overflow-x: auto;
    border: 1px solid var(--mg-line);
    border-radius: 14px;
}

.mg-table table {
    width: 100%;
    min-width: 480px;
    border-collapse: collapse;
    font-size: 16px;
    line-height: 1.5;
}

.mg-table th,
.mg-table td {
    padding: 13px 18px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--mg-line);
}

.mg-table th {
    background: var(--mg-soft);
    font-weight: 600;
    color: var(--mg-ink);
}

.mg-table td:first-child { font-weight: 500; color: var(--mg-ink); }
.mg-table tr:last-child td { border-bottom: 0; }

.mg-prose a.mg-inline-cta {
    display: inline-block;
    margin: 4px 0;
    padding: 12px 26px;
    border-radius: 100px;
    background: linear-gradient(150deg, #7CB0FC 0%, #3B82F6 45%, #2563EB 100%);
    color: #fff;
    text-decoration: none;
}

.mg-faq h3 { font-size: 19px; margin-top: 24px; }

/* ---- Demo boxes inside the article ----------------------------- */

.mg-cta {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin: 36px 0 8px;
    padding: 28px;
    border-radius: 22px;
    background: linear-gradient(135deg, #EEF4FF 0%, #E3ECFE 60%, #ECE7FD 100%);
    border: 1px solid #D7E3FB;
}

@media (min-width: 768px) {
    .mg-cta {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 30px 34px;
    }
}

.mg-cta__title {
    font-family: 'Bricolage Grotesque', 'Bricolage Grotesque Fallback', system-ui, sans-serif;
    font-size: 23px;
    font-weight: 600;
    line-height: 1.25;
    color: var(--mg-ink);
}

.mg-cta__lead {
    margin-top: 6px;
    max-width: 46ch;
    font-size: 15.5px;
    line-height: 1.55;
}

.mg-cta__btn { flex: none; }
.mg-cta--end { margin-top: 44px; }

/* ---- Author and further reading -------------------------------- */

.mg-author {
    display: grid;
    gap: 24px;
    padding: 24px;
    border-radius: 24px;
    background: var(--mg-soft);
}

@media (min-width: 768px) {
    .mg-author {
        grid-template-columns: 200px minmax(0, 1fr);
        align-items: center;
        gap: 32px;
        padding: 24px 32px 24px 24px;
    }
}

.mg-author__photo {
    width: 160px;
    height: auto;
    border-radius: 18px;
    object-fit: cover;
}

@media (min-width: 768px) {
    .mg-author__photo { width: 200px; }
}

.mg-author__kicker {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--mg-brand);
}

.mg-author__name {
    margin-top: 8px;
    font-family: 'Bricolage Grotesque', 'Bricolage Grotesque Fallback', system-ui, sans-serif;
    font-size: 21px;
    font-weight: 600;
    color: var(--mg-ink);
}

.mg-author__name a { color: inherit; text-decoration: none; }
.mg-author__name a:hover { color: var(--mg-brand); }

.mg-author__bio {
    margin-top: 10px;
    font-size: 15.5px;
    line-height: 1.65;
}

.mg-author__in {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin-top: 16px;
    border: 1px solid #C9D3E3;
    border-radius: 50%;
    color: var(--mg-ink);
}

.mg-author__in:hover { color: var(--mg-brand); border-color: var(--mg-brand); }

.mg-related {
    padding: 56px 0 72px;
    text-align: center;
}

.mg-related h2 {
    font-size: clamp(26px, 2.6vw, 34px);
    color: var(--mg-ink);
}

.mg-related ul {
    display: grid;
    gap: 16px;
    margin: 28px 0 0;
    padding: 0;
    list-style: none;
    text-align: left;
}

@media (min-width: 768px) {
    .mg-related ul { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.mg-related a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 100%;
    padding: 22px 24px;
    border: 1px solid #DCE6FA;
    border-radius: 18px;
    background: linear-gradient(170deg, #F1F5FE 0%, #FDFEFF 100%);
    font-family: 'Bricolage Grotesque', 'Bricolage Grotesque Fallback', system-ui, sans-serif;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--mg-ink);
    text-decoration: none;
    transition: border-color 250ms ease, transform 250ms ease;
}

.mg-related a:hover { border-color: var(--mg-brand); transform: translateY(-2px); }
.mg-related a svg { flex: none; color: var(--mg-brand); }
