/* Madressa Mahmoodia: the shared look for every Mahmoodia web page.
   Copy this file and fonts/ into an app's assets; keep the app's own CSS for what only it has.
   The look comes from the Mufti Moosa Academy (letters) pages: bright, simple, plenty of room,
   one maroon accent, everything else quiet. Guidelines: projects/brand/guidelines/.

   Type:   the name and app titles in Lexend Bold (the wordmark); headings in Spectral;
           everything else in the device's own system font, which reads best on a phone.
   Shape:  controls are full pills, cards 22px, small things 12px.
   Colour: always light, whatever the phone's dark-mode setting (Amir, 2026-10-21: the
           Mahmoodia look is bright; letters does the same). A page can opt in to the dark
           tokens with <html data-theme="dark">, but no Mahmoodia page does. */

@font-face {
    font-family: 'Lexend'; font-style: normal; font-weight: 300 700; font-display: swap;
    src: url(fonts/Lexend-VF-latin.woff2) format('woff2');
}
@font-face {
    font-family: 'Spectral'; font-style: normal; font-weight: 400; font-display: swap;
    src: url(fonts/Spectral-Regular-latin.woff2) format('woff2');
}
@font-face {
    font-family: 'Spectral'; font-style: normal; font-weight: 600; font-display: swap;
    src: url(fonts/Spectral-SemiBold-latin.woff2) format('woff2');
}

/* ---------- tokens ---------- */
:root {
    --ground:     #ECEFF3;   /* the page behind everything */
    --surface:    #FBFCFD;   /* cards, the header, fields */
    --surface-2:  #E4E8EE;   /* wells, segmented controls, table heads */
    --ink:        #1B2130;   /* text */
    --ink-2:      #556072;   /* quieter text */
    --line:       #D6DBE2;   /* hairlines and borders */
    --maroon:     #7E101B;   /* the logo's maroon: logo, print */
    --accent:     #8F1D2F;   /* maroon for screens: buttons, links, focus */
    --accent-strong: #741624;
    --accent-ink: #FFFFFF;
    --accent-soft: rgb(143 29 47 / .09);
    --glow:       #E9A92B;   /* a highlight: "this one", new, attention */
    --glow-soft:  rgb(233 169 43 / .22);
    --ok:         #1F7A4D;   --ok-soft:   #E3F2EA;
    --warn:       #9A5B00;   --warn-soft: #FBF0DC;
    --bad:        #B42318;   --bad-soft:  #FCE9E7;
    --info:       #2E5C8A;   --info-soft: #E6EEF6;
    --shadow-1: 0 1px 2px rgb(27 33 48 / .06), 0 6px 18px -10px rgb(27 33 48 / .18);
    --shadow-2: 0 1px 2px rgb(27 33 48 / .06), 0 14px 34px -12px rgb(27 33 48 / .22);
    --ease: cubic-bezier(.16, 1, .3, 1);
    --r-pill: 999px; --r-card: 22px; --r-small: 12px;
    --font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-display: 'Spectral', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
    --font-brand: 'Lexend', var(--font-ui);
    color-scheme: light;
}
:root[data-theme="dark"] {
    --ground: #111419; --surface: #1B2028; --surface-2: #262C36;
    --ink: #EDEFF3; --ink-2: #A4ACBA; --line: #2C333E;
    --accent: #D9606F; --accent-strong: #E57C89; --accent-ink: #1C0A0F; --accent-soft: rgb(217 96 111 / .14);
    --glow: #F4C058; --glow-soft: rgb(244 192 88 / .2);
    --ok: #5BC48C; --ok-soft: rgb(91 196 140 / .13);
    --warn: #F0B356; --warn-soft: rgb(240 179 86 / .13);
    --bad: #F07A6E; --bad-soft: rgb(240 122 110 / .13);
    --info: #7FB0E0; --info-soft: rgb(127 176 224 / .13);
    --shadow-1: 0 1px 2px rgb(0 0 0 / .4), 0 6px 18px -10px rgb(0 0 0 / .6);
    --shadow-2: 0 1px 2px rgb(0 0 0 / .4), 0 14px 34px -12px rgb(0 0 0 / .6);
    color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; }
body {
    margin: 0; background: var(--ground); color: var(--ink);
    font-family: var(--font-ui); font-size: 16px; line-height: 1.5;
    -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
::selection { background: var(--accent-soft); color: var(--ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
a { color: var(--accent); text-underline-offset: .18em; }
img, svg { max-width: 100%; }
[hidden] { display: none !important; }

/* ---------- the site header: mark | hairline | name ---------- */
.mm-header {
    position: sticky; top: 0; z-index: 20;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    -webkit-backdrop-filter: saturate(180%) blur(12px); backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
    padding: env(safe-area-inset-top) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
}
.mm-header-in {
    max-width: var(--page-max, 1080px); margin: 0 auto; min-height: 64px;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.mm-logo { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; min-width: 0; }
.mm-logo img { height: 40px; width: auto; flex: none; }
.mm-logo .rule { width: 1px; height: 34px; background: var(--line); flex: none; }
.mm-logo .words { display: grid; min-width: 0; line-height: 1.15; }
.mm-logo .name {
    font-family: var(--font-brand); font-weight: 700; font-size: 20px; letter-spacing: -.02em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mm-logo .by { font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mm-nav { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.mm-nav a {
    padding: 8px 12px; border-radius: var(--r-pill); color: var(--ink-2); text-decoration: none;
    font-size: 14px; font-weight: 500;
}
.mm-nav a:hover { background: var(--surface-2); color: var(--ink); }
.mm-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
@media (max-width: 389px) { .mm-logo .rule { display: none; } .mm-logo { gap: 9px; } }

/* ---------- page ---------- */
.mm-page {
    max-width: var(--page-max, 640px); margin: 0 auto;
    padding: 24px max(16px, env(safe-area-inset-right)) max(56px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.mm-title { font-family: var(--font-display); font-weight: 600; font-size: clamp(28px, 6vw, 38px); line-height: 1.1; letter-spacing: -.015em; margin: 4px 2px 6px; }
.mm-lede { color: var(--ink-2); margin: 0 2px 22px; }
h2.mm-h2, .mm-h2 { font-family: var(--font-display); font-weight: 600; font-size: 22px; letter-spacing: -.01em; margin: 30px 2px 12px; }

/* ---------- cards ---------- */
.mm-card { background: var(--surface); border-radius: var(--r-card); padding: 20px; box-shadow: var(--shadow-1); margin-bottom: 16px; }

/* ---------- fields ---------- */
.mm-label { display: block; font-weight: 600; font-size: 14px; margin: 16px 2px 7px; }
.mm-field {
    width: 100%; min-height: 50px; padding: 12px 16px; font: inherit; font-size: 16px; /* 16px stops iOS zoom */
    color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px;
    transition: border-color .15s, box-shadow .15s;
}
.mm-field:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

/* ---------- buttons ---------- */
.mm-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 52px; padding: 0 24px; border: 0; border-radius: var(--r-pill);
    font: inherit; font-size: 16px; font-weight: 600; text-decoration: none; cursor: pointer;
    background: var(--accent); color: var(--accent-ink);
    transition: transform .15s var(--ease), background .15s;
}
.mm-btn:hover { background: var(--accent-strong); }
.mm-btn:active { transform: scale(.97); }
.mm-btn.quiet { background: var(--surface-2); color: var(--ink); }
.mm-btn.outline { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.mm-btn.block { width: 100%; }

/* ---------- notices and tags ---------- */
.mm-note { padding: 12px 16px; border-radius: 14px; font-size: 15px; margin-bottom: 14px; }
.mm-note.ok { background: var(--ok-soft); color: var(--ok); }
.mm-note.bad { background: var(--bad-soft); color: var(--bad); }
.mm-note.info { background: var(--info-soft); color: var(--info); }
.mm-note.warn { background: var(--warn-soft); color: var(--warn); }
.mm-tag { display: inline-block; padding: 3px 10px; border-radius: var(--r-pill); font-size: 13px; font-weight: 600; }
.mm-tag.ok { background: var(--ok-soft); color: var(--ok); }
.mm-tag.bad { background: var(--bad-soft); color: var(--bad); }
.mm-tag.warn { background: var(--warn-soft); color: var(--warn); }

/* ---------- footer ---------- */
.mm-footer { text-align: center; color: var(--ink-2); font-size: 13px; padding: 8px 16px 32px; }
.mm-footer img { height: 28px; width: auto; opacity: .9; display: block; margin: 0 auto 6px; }
