/* MibMed 2: scoped cards and reader. Works with existing homepage wrappers. */
:is(.mma-section,.mma-reader,.mma-article-page) {--mma-bg:#f7f9f8;--mma-surface:#fff;--mma-text:#16334b;--mma-muted:#526473;--mma-accent:#086f6b;--mma-soft:#e8f3f0;--mma-line:#dce5e4;box-sizing:border-box;color:var(--mma-text);font-family:"MibMed Cairo","Cairo",system-ui,sans-serif;line-height:1.9;text-align:start;overflow-wrap:anywhere}
:root[data-mibmed-theme="dark"] :is(.mma-section,.mma-reader,.mma-article-page) {--mma-bg:#101c2a;--mma-surface:#1a2b3c;--mma-text:#edf3f7;--mma-muted:#b3c4d2;--mma-accent:#87ded0;--mma-soft:#213d40;--mma-line:#344858}
:is(.mma-section,.mma-reader) * {box-sizing:border-box}
:is(.mma-section,.mma-reader) [hidden] {display:none!important}
:is(.mma-section,.mma-reader) :is(h1,h2,h3,p,figure) {font-family:inherit;color:inherit;letter-spacing:normal}
:is(.mma-section,.mma-reader) :is(a,button,summary):focus-visible {outline:3px solid var(--mma-accent);outline-offset:4px}
.mma-section {background:var(--mma-surface)}
.mma-section .mma-inner {max-width:1280px;margin:auto;padding:72px 40px}
.mma-section .mma-heading {display:flex;justify-content:space-between;align-items:end;gap:28px;flex-wrap:wrap;margin-bottom:32px}
.mma-section .mma-eyebrow,.mma-reader__eyebrow {font-size:12px;color:var(--mma-accent);font-weight:600;margin:0 0 12px}
.mma-section .mma-heading h2 {font-size:clamp(28px,3vw,43px);line-height:1.55;font-weight:600;max-width:700px;margin:0}
:is(.mma-section,.mma-reader) .mma-link {display:inline-flex;align-items:center;gap:18px;min-height:44px;font-size:13px;font-weight:700;color:var(--mma-accent);text-decoration:none;background:none;box-shadow:none}
.mma-section.mma-section--v2 .mma-story-grid,.mma-related .mma-story-grid {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:24px}
.mma-section .mma-story {position:relative;min-width:0;display:flex;flex-direction:column;overflow:hidden;border:1px solid var(--mma-line);border-radius:22px;background:var(--mma-bg);transition:transform .3s,border-color .3s,box-shadow .3s}
.mma-section .mma-story__visual {position:relative;overflow:hidden;min-width:0;background:var(--mma-soft);aspect-ratio:16/10}
.mma-section .mma-story__photo {display:block;width:100%;height:100%;object-fit:cover;transition:transform .6s;max-width:100%;margin:0;border-radius:0}
.mma-section .mma-story__topic {position:absolute;top:16px;right:16px;padding:5px 13px;border-radius:20px;font-size:10px;font-weight:600;background:var(--mma-surface);color:var(--mma-accent);border:1px solid var(--mma-line)}
.mma-section .mma-story__placeholder {display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;width:100%;height:100%;min-height:160px;background:radial-gradient(ellipse at 25% 20%,var(--mma-surface),transparent 70%),var(--mma-soft)}
.mma-section .mma-story__placeholder svg {display:block;width:145px;height:100px;fill:none;stroke:var(--mma-accent);stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round;opacity:.75}
.mma-section .mma-story__placeholder circle {fill:var(--mma-surface);stroke:none}
.mma-section .mma-story__placeholder>span {font-size:10px;color:var(--mma-accent)}
.mma-section .mma-story__body {display:flex;flex-direction:column;flex:1;min-width:0;padding:23px 25px}
.mma-section .mma-story__meta {display:flex;align-items:center;gap:15px;color:var(--mma-muted);font-size:10px;margin-bottom:10px;flex-wrap:wrap}
.mma-section .mma-story__meta>span+span::before {content:"";display:inline-block;width:3px;height:3px;background:var(--mma-accent);border-radius:50%;margin-inline-end:12px;vertical-align:middle}
.mma-section .mma-story h3 {font-size:21px;font-weight:600;line-height:1.7;margin:0 0 10px;padding:0;color:var(--mma-text)}
.mma-section .mma-story__title {color:inherit;text-decoration:none!important;background:none;box-shadow:none}
.mma-section .mma-story__title::before {content:none}
.mma-section .mma-story__title::after {content:"";position:absolute;inset:0;z-index:2}
.mma-section .mma-story:focus-within {outline:3px solid var(--mma-accent);outline-offset:4px}
.mma-section .mma-story__excerpt {font-size:13px;line-height:1.95;color:var(--mma-muted);margin:0 0 20px;padding:0}
.mma-section .mma-story__bottom {display:flex;align-items:center;justify-content:space-between;gap:15px;border-top:1px solid var(--mma-line);padding-top:14px;margin-top:auto;font-size:10px;color:var(--mma-muted)}
.mma-section .mma-story__arrow {display:grid;place-items:center;width:34px;height:34px;border:1px solid var(--mma-line);border-radius:50%;background:var(--mma-surface);color:var(--mma-accent);font-size:19px;transition:transform .3s,background .3s}
.mma-section.mma-section--v2 .mma-story-grid--featured {grid-template-columns:1.08fr 1fr}
.mma-section .mma-story-grid--featured:not([data-count="1"]):not([data-count="2"])>.mma-story:first-child {grid-row:span 2}
.mma-section .mma-story-grid--featured:not([data-count="1"]):not([data-count="2"])>.mma-story:first-child .mma-story__visual {aspect-ratio:2/1}
.mma-section .mma-story-grid--featured:not([data-count="1"]):not([data-count="2"])>.mma-story:first-child h3 {font-size:26px}
.mma-section .mma-story-grid--featured:not([data-count="1"]):not([data-count="2"])>.mma-story:not(:first-child) {display:grid;grid-template-columns:32% 1fr}
.mma-section .mma-story-grid--featured:not([data-count="1"]):not([data-count="2"])>.mma-story:not(:first-child) .mma-story__visual {aspect-ratio:auto}
.mma-section .mma-story-grid--featured:not([data-count="1"]):not([data-count="2"])>.mma-story:not(:first-child) .mma-story__topic {top:12px;right:9px;left:9px;text-align:center;padding-inline:5px;font-size:9px}
.mma-section .mma-story-grid--featured:not([data-count="1"]):not([data-count="2"])>.mma-story:not(:first-child) .mma-story__body {padding:20px}
.mma-section .mma-story-grid--featured:not([data-count="1"]):not([data-count="2"])>.mma-story:not(:first-child) h3 {font-size:19px}
.mma-section .mma-story-grid--featured:not([data-count="1"]):not([data-count="2"])>.mma-story:not(:first-child) .mma-story__excerpt {display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;margin-bottom:13px}
.mma-section.mma-section--v2 .mma-story-grid--featured[data-count="1"] {grid-template-columns:1fr;max-width:720px}
.mma-section .mma-story-grid--featured[data-count="2"]>.mma-story {grid-row:auto;display:flex}
.mma-section .mma-story-grid--featured[data-count="2"]>.mma-story .mma-story__visual {aspect-ratio:2/1}
.mma-section .mma-notice {font-size:12px;color:var(--mma-muted);margin:24px 0 0}
.mma-section .mma-empty {padding:28px;background:var(--mma-soft);border-radius:16px;color:var(--mma-muted)}
.mma-section .mma-pagination ul {display:flex;gap:8px;flex-wrap:wrap;list-style:none;margin:30px 0 0;padding:0}
.mma-section .mma-pagination li {margin:0;padding:0}
.mma-section .mma-pagination :is(a,span) {display:grid;place-items:center;min-width:44px;min-height:44px;padding:6px 12px;border:1px solid var(--mma-line);border-radius:12px;text-decoration:none;color:var(--mma-text)}
.mma-section .mma-pagination .current {background:var(--mma-soft);color:var(--mma-accent)}
/* Reader: editorial header, comfortable measure, native block content. */
.mma-article-page {width:100%;background:var(--mma-bg);padding-top:1px}
.mma-custom-reader .site-content>.ast-container {display:block;max-width:none;padding:0}
.mma-custom-reader #primary.mma-article-page {width:100%;margin:0;padding:0;border:0}

.mma-reader {max-width:1080px;margin:auto;padding:28px 40px 52px;background:var(--mma-bg)}
.mma-reader--embedded {padding:24px;max-width:940px}
.mma-reader .mma-reader__cover {margin:0 0 28px;overflow:hidden;border-radius:16px}
.mma-reader__cover img {display:block;width:100%;height:auto;max-height:380px;aspect-ratio:2.5/1;object-fit:cover}
.mma-reader__cover figcaption {font-size:12px;color:var(--mma-muted);padding:8px 0;background:transparent}
.mma-reader__column {max-width:740px;margin-inline:auto}
.mma-reader__header {margin-bottom:24px}
.mma-reader .mma-reader__meta {display:flex;align-items:center;flex-wrap:wrap;gap:8px 18px;margin:0 0 20px;font-size:13px;line-height:1.9;color:var(--mma-muted)}
.mma-reader__meta>span+span {position:relative}
.mma-reader__meta>span+span::before {content:"\00b7";position:absolute;inset-inline-start:-11px;color:var(--mma-muted)}
.mma-reader .mma-taxonomy {display:inline-flex;align-items:center;flex-wrap:wrap;gap:6px 10px}
.mma-reader .mma-chip {font:inherit;color:var(--mma-accent);background:none;border:0;padding:0}
.mma-reader .mma-taxonomy--age .mma-chip {color:var(--mma-muted)}
.mma-reader .mma-reader__header h1 {font-size:clamp(29px,3vw,38px);font-weight:700;line-height:1.65;color:var(--mma-text);margin:0 0 18px;padding:0}
.mma-reader .mma-reader__lead {color:var(--mma-muted);font-size:18px;line-height:2;margin:0 0 22px;white-space:pre-line}
.mma-reading-main {min-width:0;width:100%}
.mma-reader .mma-takeaways {padding:24px 0;margin:36px 0 0;border-block:1px solid var(--mma-line);background:none}
.mma-reader .mma-takeaways h2 {font-size:22px;font-weight:600;margin:0 0 12px}
.mma-reader .mma-takeaways ul {padding-inline-start:22px;margin:0;font-size:16px}
.mma-reader .mma-takeaways li {margin-block:8px;padding-inline-start:4px}
.mma-reader .mma-author {display:flex;align-items:center;gap:18px;padding-top:24px;margin-top:36px;border-top:1px solid var(--mma-line);background:none}
.mma-reader .mma-author>div {display:flex;flex-direction:column;gap:4px}
.mma-reader .mma-author__photo {width:72px;height:72px;flex-shrink:0;border-radius:50%;object-fit:cover;object-position:center 25%}
.mma-reader .mma-author span {font-size:13px;color:var(--mma-muted)}
.mma-reader .mma-author strong {font-size:16px;font-weight:600;color:var(--mma-text)}
.mma-reader__actions {display:flex;align-items:center;flex-wrap:wrap;gap:18px}
.mma-reader :is(.mma-reader__share,.mma-reader__print) {display:inline-flex;align-items:center;justify-content:center;gap:8px;border:0;background:none;color:var(--mma-accent);padding:8px 0;min-height:44px;font:inherit;font-size:13px;cursor:pointer;box-shadow:none}
.mma-reader :is(.mma-reader__share,.mma-reader__print):hover {text-decoration:underline;text-underline-offset:4px}
.mma-reader__status:not(:empty) {width:100%;color:var(--mma-accent);font-size:13px}
.mma-reader li::marker {color:var(--mma-accent)}
.mma-reader .mma-content {font-family:"MibMed Cairo","Cairo",sans-serif;font-size:20px;line-height:1.95;color:var(--mma-text)}
.mma-reader .mma-content :is(h2,h3,h4) {font-weight:600;color:var(--mma-text);line-height:1.65;margin:1.4em 0 .6em;scroll-margin-top:140px}
.mma-reader .mma-content h2 {font-size:28px}
.mma-reader .mma-content h3 {font-size:22px}
.mma-reader .mma-content p {margin:0 0 1.1em;color:inherit}
.mma-reader .mma-content a,.mma-references a {color:var(--mma-accent);text-decoration:underline;text-underline-offset:4px}
.mma-reader .mma-content :is(ul,ol) {padding-inline-start:26px;margin-inline:0}
.mma-reader .mma-content li {margin-block:8px}
.mma-reader .mma-content :is(img,video) {max-width:100%;height:auto;border-radius:16px}
.mma-reader .mma-content iframe {max-width:100%}
.mma-reader .mma-content .wp-block-embed.is-type-video .wp-block-embed__wrapper {aspect-ratio:16/9}
.mma-reader .mma-content .wp-block-embed.is-type-video iframe {width:100%;height:100%}
.mma-reader .mma-content figure {max-width:100%;margin-inline:0}
.mma-reader .mma-content figcaption {font-size:12px;color:var(--mma-muted);text-align:center}
.mma-reader .mma-content pre,.mma-reader .wp-block-table {overflow-x:auto}
.mma-reader .mma-content table {width:100%;border-collapse:collapse;font-size:14px}
.mma-reader .mma-content :is(td,th) {padding:12px;border:1px solid var(--mma-line)}
.mma-reader .mma-content blockquote {margin:25px 0;padding:18px 26px;background:var(--mma-soft);border-inline-start:3px solid var(--mma-accent);border-radius:12px;font-size:20px}
.mma-reader .mma-toc {padding:12px 0;border-block:1px solid var(--mma-line);background:none;border-radius:0}
.mma-toc summary {cursor:pointer;font-size:14px;font-weight:700;color:var(--mma-text)}
.mma-toc ol {list-style:none;margin:16px 0 0;padding:0}
.mma-toc li {margin:0}
.mma-toc .is-subheading {padding-inline-start:12px}
.mma-toc a {display:block;padding:9px 12px;border-inline-start:2px solid var(--mma-line);color:var(--mma-muted);font-size:12px;text-decoration:none;line-height:1.8}
.mma-toc a[aria-current] {color:var(--mma-accent);border-color:var(--mma-accent);background:var(--mma-soft);border-radius:4px}
.mma-reader .mma-references {margin-top:44px;padding-top:28px;border-top:1px solid var(--mma-line)}
.mma-reader .mma-references h2 {font-size:23px;margin:0 0 16px}
.mma-references ol {padding-inline-start:22px;margin:0;font-size:13px}
.mma-references li {padding-inline-start:6px;margin-block:12px;overflow-wrap:anywhere}
.mma-reader .mma-disclaimer {margin:22px 0;padding:0;background:none;border:0;font-size:13px}
.mma-reader .mma-disclaimer strong {font-weight:600}
.mma-reader .mma-disclaimer p {color:var(--mma-muted);margin:8px 0 0}
.mma-reader__end {display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap}
.mma-related {border-top:1px solid var(--mma-line)}

/* Balanced one/two-card layouts and readable metadata, including within the homepage. */
.mma-section.mma-section--v2 .mma-story-grid--featured[data-count="2"] {grid-template-columns:repeat(2,minmax(0,1fr))}
.mma-section .mma-story-grid--featured[data-count="2"]>.mma-story h3 {font-size:24px}
.mma-section .mma-story__topic {max-width:calc(100% - 32px);font-size:12px;line-height:1.8;top:16px;right:16px;left:auto;padding:6px 14px;text-align:start;border-radius:9px}
.mma-section .mma-story__meta {font-size:12px;line-height:1.8;margin-bottom:12px}
.mma-section .mma-story__excerpt {font-size:14px;line-height:2;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden}
.mma-section .mma-story__bottom {font-size:12px;line-height:1.8;gap:12px;flex-wrap:wrap}
.mma-section .mma-story__read {display:inline-flex;gap:10px;align-items:center;color:var(--mma-accent);font-size:12px;font-weight:600}
.mma-section .mma-story-grid--featured:not([data-count="1"]):not([data-count="2"])>.mma-story:not(:first-child) .mma-story__topic {font-size:11px}
/* Existing pasted text in Code blocks stays readable without rewriting saved content. */
.mma-reader .mma-content :is(pre,.wp-block-code) {white-space:pre-wrap;overflow-wrap:anywhere;font:inherit;line-height:2.1;letter-spacing:normal;padding:22px 26px;border:1px solid var(--mma-line);border-inline-start:3px solid var(--mma-accent);border-radius:14px;background:var(--mma-soft);color:var(--mma-text);margin:24px 0;direction:inherit;text-align:start}
.mma-reader .mma-content pre code {display:block;white-space:inherit;overflow-wrap:inherit;font:inherit;letter-spacing:normal;background:none;color:inherit;border:0;padding:0}
.mma-reader .mma-content {text-wrap:pretty}
.mma-reader .mma-content> :first-child {margin-top:0}
.mma-reader .mma-content h2 {padding:0;border:0}
.mma-reader .mma-content h3 {color:var(--mma-accent)}
.mma-reader .mma-content :is(.alignleft,.alignright) {max-width:100%}
@media (hover:hover) and (prefers-reduced-motion:no-preference) {:root:not([data-mm-motion="off"]) .mma-story:hover {transform:translateY(-5px);box-shadow:0 18px 38px #16334b0c;border-color:var(--mma-accent)}:root:not([data-mm-motion="off"]) .mma-story:hover .mma-story__photo {transform:scale(1.035)}:root:not([data-mm-motion="off"]) .mma-story:hover .mma-story__arrow {transform:translateX(-3px);background:var(--mma-soft)}}
@media(max-width:1000px) {.mma-section.mma-section--v2 .mma-story-grid,.mma-related .mma-story-grid {grid-template-columns:repeat(2,minmax(0,1fr))}.mma-section .mma-story-grid--featured:not([data-count="1"]):not([data-count="2"])>.mma-story:first-child {grid-column:1/-1;grid-row:auto}.mma-section .mma-story-grid--featured:not([data-count="1"]):not([data-count="2"])>.mma-story:not(:first-child) {display:flex}.mma-section .mma-story-grid--featured:not([data-count="1"]):not([data-count="2"])>.mma-story:not(:first-child) .mma-story__visual {aspect-ratio:16/10}}
@media(max-width:760px) {.mma-reader {padding:20px 20px 40px}.mma-reader .mma-reader__lead {font-size:16px}.mma-reader .mma-content {font-size:18px}.mma-reader .mma-content h2 {font-size:25px}.mma-reader__cover img {aspect-ratio:16/10}.mma-reader .mma-reader__cover {margin-bottom:22px;border-radius:12px}.mma-reader .mma-reader__meta {font-size:12px;gap:6px 16px}.mma-reader .mma-takeaways ul {font-size:15px}}
:root[data-mm-motion="off"] .mma-story,:root[data-mm-motion="off"] .mma-story * {transition:none!important;animation:none!important}
@media print {.mma-reader {max-width:none;padding:0;background:white;color:black}.mma-reader__share,.mma-reader__print,.mma-toc,.mma-related,.mma-reader__end {display:none!important}.mma-reading-main {max-width:none}.mma-reader .mma-content {font-size:12pt}.mma-reader__cover img {max-height:220px;object-fit:contain}.mma-reader :is(.mma-takeaways,.mma-disclaimer) {break-inside:avoid;background:white}}


@media(max-width:540px) {.mma-section.mma-section--v2 .mma-story-grid--featured[data-count="2"] {grid-template-columns:1fr}.mma-reader .mma-content :is(pre,.wp-block-code) {padding:18px}.mma-section .mma-story-grid--featured[data-count="2"]>.mma-story h3 {font-size:22px}}

@media(max-width:540px) {.mma-section .mma-inner {padding:44px 22px}.mma-section.mma-section--v2 .mma-story-grid,.mma-related .mma-story-grid {grid-template-columns:1fr;gap:20px}.mma-section .mma-story-grid--featured:not([data-count="1"]):not([data-count="2"])>.mma-story:first-child {grid-column:auto}.mma-section .mma-story-grid--featured:not([data-count="1"]):not([data-count="2"])>.mma-story:first-child h3 {font-size:23px}.mma-section .mma-story__body {padding:21px}.mma-section .mma-story-grid--featured:not([data-count="1"]):not([data-count="2"])>.mma-story:not(:first-child) h3 {font-size:21px}}
@media(prefers-reduced-motion:reduce) {.mma-story,.mma-story * {transition:none!important;animation:none!important}}

/* Consistent reader and card typography, including pasted text. SVG/icon fonts are left intact. */
:is(.mma-reader,.mma-section,.mma-library) :is(h1,h2,h3,h4,h5,h6,p,li,blockquote,figcaption,td,th,a,button,input,select,textarea,label,summary,time,small,strong,em,b,i,u,mark,div,span):not(.dashicons):not(.fa):not([class*="fa-"]) {font-family:"MibMed Cairo","Cairo",sans-serif!important}
