/* Chapter-only layout; shared MarocMaths variables are loaded unchanged. */
body:has(.mm-chapter) { overflow-x: visible; background: #fff; }
.mm-chapter *, .mm-chapter-brandbar * { box-sizing: border-box; }
.mm-chapter-width { width: min(calc(100% - 160px), 1220px); margin-inline: auto; }
.mm-chapter-brandbar { height: 67px; background: var(--mm-color-navy); color: white; }
.mm-chapter-brandbar .mm-chapter-width { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.mm-chapter-logo { width: 146px; height: 38px; object-fit: contain; }
.mm-chapter-brandbar nav { display: flex; gap: 34px; font-size: 15px; }
.mm-chapter-brandbar a { color: inherit; text-decoration: none; }
.mm-chapter-grid { display: grid; grid-template-columns: minmax(0, 764px) minmax(0, 1fr); column-gap: 100px; grid-template-areas: 'intro intro' 'actions actions' 'about sections' 'stats sections' 'figure sections'; }
.mm-chapter-intro { grid-area: intro; padding-top: 39px; }
.mm-chapter-eyebrow { text-transform: uppercase; color: var(--mm-color-blue); font-size: 13px; font-weight: 700; letter-spacing: .09em; margin: 0 0 10px; }
.mm-chapter-eyebrow, .mm-chapter-meta { position: relative; }
.mm-chapter-eyebrow { top: 1px; }
.mm-chapter h1 { margin: 0; color: var(--mm-color-navy); font-size: 48px; font-weight: 400; letter-spacing: -1.8px; line-height: 1.25; }
.mm-chapter-meta { top: -1px; margin: 8px 0 15px; color: var(--mm-color-secondary); font-size: 16px; }
.mm-chapter-meta span { margin-inline: 12px; }
.mm-chapter-description { margin: 0; font-size: 18px; }
.mm-chapter-actions { grid-area: actions; display: flex; position: relative; gap: 27px; padding: 25px 0 40px; margin-bottom: 38px; }
.mm-chapter-actions::after { content: ''; position: absolute; bottom: 0; left: calc((1220px - 100vw)/2); width: 100vw; border-bottom: 1px solid var(--mm-color-border); }
.mm-chapter-button { display: inline-flex; align-items: center; justify-content: space-between; gap: 22px; min-height: 52px; padding: 10px 22px; border: 1px solid var(--mm-color-blue); border-radius: 4px; font: inherit; font-size: 17px; font-weight: 500; color: #10349c; background: white; text-decoration: none; }
.mm-chapter-button-primary { color: white; background: #0f3595; }
.mm-action-arrow { width: 22px; height: 24px; object-fit: contain; }
.mm-action-icon { display: none; }
.mm-chapter-button[aria-disabled] { cursor: not-allowed; }
.mm-chapter-unavailable { position: absolute; top: 84px; left: 0; font-size: 12px; background: white; padding: 4px; opacity: 0; pointer-events: none; }
.mm-chapter-actions:has([aria-disabled]:focus) .mm-chapter-unavailable, .mm-chapter-actions:has([aria-disabled]:hover) .mm-chapter-unavailable { opacity: 1; }
.mm-chapter h2 { font-size: 17px; line-height: 1.5; color: var(--mm-color-navy); margin: 0 0 12px; font-weight: 700; }
.mm-chapter-about { grid-area: about; }
.mm-chapter-about h2 { margin-bottom: 10px; font-weight: 600; }
.mm-chapter-about p { font-size: 17px; line-height: 1.65; margin: 0 0 23px; }
.mm-chapter-stats { grid-area: stats; display: grid; grid-template-columns: 1fr 1fr; padding: 23px 0; border-block: 1px solid var(--mm-color-border); }
.mm-chapter-stats > div { display: flex; gap: 28px; align-items: center; padding: 0 6px; }
.mm-chapter-stats > div + div { border-left: 1px solid var(--mm-color-border); padding-left: 39px; }
.mm-chapter-stats img { width: 60px; height: 60px; object-fit: contain; }
.mm-chapter-stats p { margin: 0; }
.mm-chapter-stats strong { font-size: 19px; color: #0c2781; }
.mm-chapter-stats small { display: block; font-size: 14px; white-space: nowrap; }
.mm-chapter-figure { grid-area: figure; margin: 31px 0 55px; }
.mm-chapter-figure picture { display: block; margin-top: -14px; text-align: center; transform: translateX(-25px); }
.mm-chapter-figure picture img { width: 320px; height: 166px; max-width: 100%; object-fit: contain; }
.mm-chapter-figure figcaption { font-size: 14px; text-align: center; color: var(--mm-color-secondary); margin-top: 6px; }
.mm-chapter-sections { grid-area: sections; border-left: 1px solid var(--mm-color-border); padding-left: 56px; margin-bottom: 55px; }
.mm-chapter-sections h2 { text-transform: uppercase; font-size: 14px; letter-spacing: .08em; margin: 2px 0 18px; }
.mm-chapter-sections ol { margin: 0; padding: 0; list-style: none; }
.mm-chapter-sections li + li { border-top: 1px solid var(--mm-color-border); }
.mm-chapter-sections a { display: grid; grid-template-columns: 24px 1fr; gap: 18px; padding: 25px 18px; color: var(--mm-color-ink); text-decoration: none; font-size: 16px; line-height: 1.6; }
.mm-chapter-sections li:first-child a { border-left: 2px solid var(--mm-color-green); padding-block: 10px; margin-bottom: 17px; }
.mm-chapter-sections a > span:first-child { color: #123596; }
.mm-chapter-sections img, .mm-mobile-only { display: none; }
.mm-chapter a:focus-visible, .mm-chapter button:focus-visible, .mm-chapter-brandbar a:focus-visible { outline: 3px solid var(--mm-color-green); outline-offset: 3px; }
.mm-chapter a:hover { text-decoration: underline; }
@media (max-width: 1300px) and (min-width: 701px) {
 .mm-chapter-width { width: calc(100% - 80px); }
 .mm-chapter-grid { grid-template-columns: minmax(0, 2fr) minmax(250px, 1fr); column-gap: 36px; }
 .mm-chapter-sections { padding-left: 24px; }
 .mm-chapter-actions::after { left: -40px; }
 .mm-chapter-stats > div { gap: 12px; }
 .mm-chapter-stats > div + div { padding-left: 14px; }
 .mm-chapter-stats small { white-space: normal; }
}
@media (max-width: 700px) {
 .mm-chapter-width { width: calc(100% - 48px); }
 .mm-chapter-brandbar { height: 51px; }
 .mm-chapter-logo { width: 114px; height: 30px; }
 .mm-chapter-brandbar nav, .mm-desktop-only, .mm-chapter-about { display: none; }
 .mm-chapter-grid { display: flex; flex-direction: column; }
 .mm-chapter-intro { order: 0; padding-top: 19px; }
 .mm-chapter-eyebrow { top: 0; font-size: 11px; letter-spacing: .04em; margin-bottom: 4px; }
 .mm-chapter h1 { font-size: 30px; line-height: 1.3; letter-spacing: -.65px; font-weight: 600; }
 .mm-chapter-meta { top: 0; font-size: 11px; letter-spacing: .005em; margin: 4px 0 11px; white-space: nowrap; }
 .mm-chapter-meta span { margin-inline: 5px; }
 .mm-chapter-description { font-size: 13px; line-height: 1.7; letter-spacing: -.2px; max-width: 300px; }
 .mm-chapter-figure { order: 1; margin: 11px 0 19px; }
 .mm-chapter-figure picture { margin-top: 0; transform: translateX(-2.5px); }
 .mm-chapter-figure picture img { width: 205px; height: 100px; }
 .mm-chapter-figure picture img { content: url('../images/chapter/illustration-mobile.png'); }
 .mm-chapter-figure figcaption { font-size: 9px; margin-top: 2px; }
 .mm-chapter-actions { order: 2; padding: 0; margin: 0 0 13px; flex-direction: column; gap: 11px; }
 .mm-chapter-actions::after { display: none; }
 .mm-chapter-button { min-height: 50px; border-radius: 6px; padding: 10px 16px; font-size: 12px; font-weight: 700; gap: 16px; justify-content: flex-start; }
 .mm-chapter-button-primary { background: #143f98; }
 .mm-action-icon { display: block; width: 19px; height: 21px; object-fit: contain; }
 .mm-action-arrow { margin-left: auto; width: 12px; height: 18px; object-fit: contain; }
 .mm-chapter-button-primary .mm-action-arrow { content: url('../images/chapter/chevron-white.png'); }
 .mm-chapter-button[aria-disabled] .mm-action-arrow { content: url('../images/chapter/chevron-blue.png'); }
 .mm-chapter-unavailable { top: 110px; z-index: 2; }
 .mm-chapter-stats { order: 3; border: 1px solid var(--mm-color-border); border-radius: 7px; background: white; padding: 12px 0; }
 .mm-chapter-stats > div, .mm-chapter-stats > div + div { flex-direction: column; padding: 0; gap: 5px; }
 .mm-chapter-stats img { width: 17px; height: 18px; }
 .mm-chapter-stats > div:first-child img { content: url('../images/chapter/document-mobile.png'); }
 .mm-chapter-stats > div + div img { content: url('../images/chapter/pencil-mobile.png'); }
 .mm-chapter-stats p { display: flex; align-items: baseline; gap: 7px; line-height: 1.3; }
 .mm-chapter-stats strong { font-size: 12px; color: var(--mm-color-navy); }
 .mm-chapter-stats small { display: none; }
 .mm-mobile-only { display: inline; color: var(--mm-color-secondary); font-size: 10.5px; }
 .mm-chapter-sections { order: 4; padding: 0; border: 0; margin: 15px 0 37px; }
 .mm-chapter-sections h2 { text-transform: none; font-size: 14px; letter-spacing: 0; font-weight: 600; margin: 0 0 12px; }
 .mm-chapter-sections ol { border: 1px solid var(--mm-color-border); border-radius: 4px; }
 .mm-chapter-sections a, .mm-chapter-sections li:first-child a { grid-template-columns: 27px 1fr 8px; gap: 12px; padding: 11px 7px; margin: 0; border: 0; font-size: 10.5px; font-weight: 500; line-height: 1.72; }
 .mm-chapter-sections img { display: block; width: 8px; height: 13px; align-self: center; }
}
