/*
 * Theme: Umrah.
 * Ihram white and Haram gold by day, the green of a Makkah night after dark. Beyond the
 * colours it changes shapes: cards and course covers rise into domes, the doctor's
 * portrait stands in a mihrab arch, headings are written in Ruqaa, the eyebrows become
 * ornaments, lanterns hang over the home page and the Haram's skyline closes it.
 * A theme is plain CSS: it can give the platform's colour names new values and restyle
 * any part of the page, but it cannot load anything from other sites.
 */

/* ---------- Colours ---------- */

html:root, html:root[data-palette] {
    --bg: #fbf7ec;
    --bg-elevated: #fffdf7;
    --surface: #fffdf7;
    --surface-2: #f4ecd6;
    --surface-3: #e9dcb8;
    --border: rgb(150 112 20 / 0.18);
    --border-strong: rgb(150 112 20 / 0.34);
    --fg: #1d1708;
    --fg-muted: #5e5440;
    --fg-subtle: #8b806a;
    --accent: #8f6a0a;
    --accent-strong: #6f5205;
    --accent-fg: #ffffff;
    --accent-soft: rgb(176 134 20 / 0.12);
    --glow: rgb(176 134 20 / 0.3);
    --pink: #c9a227;
    --orange: #e3c565;
    --cyan: #1f7a5a;
    --brand: linear-gradient(135deg, #0f4d3a 0%, #146b4f 55%, #b8901f 100%);
    --gold: #b8901f;
    --gold-line: rgb(184 144 31 / 0.45);
    --shadow-sm: 0 1px 2px rgb(60 44 6 / 0.07);
    --shadow-md: 0 2px 4px rgb(60 44 6 / 0.05), 0 12px 28px -10px rgb(60 44 6 / 0.2);
    --shadow-lg: 0 4px 8px rgb(60 44 6 / 0.06), 0 28px 56px -18px rgb(60 44 6 / 0.32);
}

html.dark, html.dark[data-palette] {
    --bg: #04261c;
    --bg-elevated: #073326;
    --surface: #073326;
    --surface-2: #0b3f30;
    --surface-3: #114d3b;
    --border: rgb(226 191 92 / 0.18);
    --border-strong: rgb(226 191 92 / 0.32);
    --fg: #f8f3e3;
    --fg-muted: #c4c0a4;
    --fg-subtle: #8fa294;
    --accent: #e6c463;
    --accent-strong: #f3da92;
    --accent-fg: #082a1f;
    --accent-soft: rgb(230 196 99 / 0.14);
    --glow: rgb(230 196 99 / 0.28);
    --pink: #e6c463;
    --orange: #f3da92;
    --cyan: #e6c463;
    --brand: linear-gradient(135deg, #0a3a2c 0%, #12684d 50%, #c9a227 100%);
    --gold: #e6c463;
    --gold-line: rgb(230 196 99 / 0.45);
}

html { color-scheme: light; }
html.dark { color-scheme: dark; }

/* A faint eight-pointed-star lattice behind every page */
body {
    background-color: var(--bg);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23b8901f' stroke-width='1' opacity='.13'%3E%3Crect x='20' y='20' width='24' height='24'/%3E%3Crect x='20' y='20' width='24' height='24' transform='rotate(45 32 32)'/%3E%3Cpath d='M0 32h8M56 32h8M32 0v8M32 56v8'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 64px 64px;
}

.text-gradient {
    background-image: linear-gradient(120deg, #8a6508 0%, #c9a227 50%, #9a7410 100%);
    animation: none;
}
html.dark .text-gradient { background-image: linear-gradient(120deg, #e6c463 0%, #f8e7b0 50%, #d4ac3f 100%); }

/* ---------- The kiswah band, with the competition written on it ---------- */

body::before {
    content: '\2726\00a0\00a0 مين هيسافر العمرة مع د. محمد الفار؟ \00a0\00a0\2726';
    display: block;
    height: 3rem;
    line-height: 3rem;
    overflow: hidden;
    white-space: nowrap;
    text-align: center;
    font-family: 'Aref Ruqaa', 'Readex Pro Variable', serif;
    font-weight: 700;
    font-size: clamp(.95rem, 3.6vw, 1.3rem);
    color: #e9c968;
    border-bottom: 3px double #c9a227;
    background:
        linear-gradient(90deg, transparent calc(50% - min(16rem, 47%)), #0c0c0c 0 calc(50% + min(16rem, 47%)), transparent 0),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cg fill='none' stroke='%23c9a227' stroke-width='1.1' opacity='.8'%3E%3Crect x='15' y='15' width='18' height='18'/%3E%3Crect x='15' y='15' width='18' height='18' transform='rotate(45 24 24)'/%3E%3C/g%3E%3C/svg%3E") center / 48px 48px repeat-x,
        #0c0c0c;
}

/* ---------- Writing: Ruqaa headings, ornament eyebrows ---------- */

h1, h2 {
    font-family: 'Aref Ruqaa', 'Readex Pro Variable', serif;
    font-weight: 700;
    letter-spacing: normal !important;
    line-height: 1.45 !important;
}

.eyebrow {
    background: none;
    border-radius: 0;
    padding: 0;
    gap: .6rem;
    font-size: .9rem;
    font-weight: 700;
    color: var(--accent);
}
.eyebrow svg { display: none; }
.eyebrow::before, .eyebrow::after {
    content: '';
    width: 2.6rem;
    height: 14px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='42' height='14' viewBox='0 0 42 14'%3E%3Cg fill='%23b8901f'%3E%3Crect x='0' y='6.4' width='28' height='1.2'/%3E%3Cpath d='M35 0l2 5 5 2-5 2-2 5-2-5-5-2 5-2z'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}
.eyebrow::after { transform: scaleX(-1); }

/* A gold divider with a star under centred section titles */
.text-center > h2::after {
    content: '';
    display: block;
    width: 11rem;
    height: 18px;
    margin: .9rem auto 0;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='176' height='18' viewBox='0 0 176 18'%3E%3Cg fill='%23b8901f'%3E%3Crect x='0' y='8.4' width='70' height='1.2'/%3E%3Crect x='106' y='8.4' width='70' height='1.2'/%3E%3Cpath d='M88 0l2.8 6.2L97 9l-6.2 2.8L88 18l-2.8-6.2L79 9l6.2-2.8z'/%3E%3Ccircle cx='75' cy='9' r='2'/%3E%3Ccircle cx='101' cy='9' r='2'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---------- Shapes: domes and arches ---------- */

/* Every card gets the double gold frame of an old manuscript page */
.card, .university-card {
    border-color: var(--gold-line);
    box-shadow: inset 0 0 0 4px var(--surface), inset 0 0 0 5px var(--border), var(--shadow-sm);
}

/* Course cards: the card rises into a dome, and the cover is an arched window */
a.card[data-accent] {
    border-radius: 50% 50% 1.1rem 1.1rem / 4.2rem 4.2rem 1.1rem 1.1rem;
    padding: .7rem;
}
a.card[data-accent] > div:first-child {
    border-radius: 50% 50% .7rem .7rem / 3.6rem 3.6rem .7rem .7rem;
}

.faculty-card {
    border-radius: 50% 50% 1.4rem 1.4rem / 4.5rem 4.5rem 1.4rem 1.4rem;
    padding-top: 3.4rem;
    border-color: var(--gold-line);
    box-shadow: inset 0 0 0 5px var(--surface), inset 0 0 0 6px var(--border), var(--shadow-sm);
}

.free-card { border-radius: 50% 50% 1.1rem 1.1rem / 3.6rem 3.6rem 1.1rem 1.1rem; overflow: hidden; }
.free-card-cover { border-radius: 50% 50% .7rem .7rem / 3rem 3rem .7rem .7rem; }

.university-card { border-radius: 50% 50% 1.2rem 1.2rem / 3rem 3rem 1.2rem 1.2rem; padding-top: 2.4rem; }

/* The doctor stands in a mihrab arch instead of a circle */
.portrait-ring, .portrait-dots { display: none; }
.portrait-glow { border-radius: 50% 50% 2rem 2rem / 40% 40% 2rem 2rem; }
.portrait-disc {
    inset: 3% 15% 9%;
    border-radius: 50% 50% 1.5rem 1.5rem / 36% 36% 1.5rem 1.5rem;
    box-shadow: 0 0 0 6px var(--bg), 0 0 0 8px var(--gold), 0 0 0 14px var(--bg), 0 0 0 15px var(--gold-line), 0 40px 80px -30px var(--glow);
}
.portrait-img { width: 70%; clip-path: inset(-50% 0 0 0 round 0 0 1.5rem 1.5rem); }
.portrait-chip, .portrait-hello, .portrait-name { border-color: var(--gold-line); }

/* ---------- The home page: lanterns above, the Haram's skyline below ---------- */

#main > section:has([data-portrait]) { position: relative; isolation: isolate; }

#main > section:has([data-portrait])::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='150' viewBox='0 0 44 150'%3E%3Cg fill='%23b8901f'%3E%3Crect x='21.4' y='0' width='1.2' height='52'/%3E%3Cpath d='M22 50l12 12H10z'/%3E%3Crect x='9' y='62' width='26' height='3'/%3E%3Cpath d='M11 66h22l-2 40H13z' fill-opacity='.22' stroke='%23b8901f' stroke-width='1.6'/%3E%3Cpath d='M22 72c-5 7-5 20 0 28 5-8 5-21 0-28z' fill='%23e9c968'/%3E%3Crect x='9' y='106' width='26' height='3'/%3E%3Cpath d='M13 109h18l-9 14z'/%3E%3Ccircle cx='22' cy='127' r='2.4'/%3E%3C/g%3E%3C/svg%3E") left 5% top 0 / 44px auto no-repeat,
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='190' viewBox='0 0 44 190'%3E%3Cg fill='%23b8901f'%3E%3Crect x='21.4' y='0' width='1.2' height='92'/%3E%3Cpath d='M22 90l12 12H10z'/%3E%3Crect x='9' y='102' width='26' height='3'/%3E%3Cpath d='M11 106h22l-2 40H13z' fill-opacity='.22' stroke='%23b8901f' stroke-width='1.6'/%3E%3Cpath d='M22 112c-5 7-5 20 0 28 5-8 5-21 0-28z' fill='%23e9c968'/%3E%3Crect x='9' y='146' width='26' height='3'/%3E%3Cpath d='M13 149h18l-9 14z'/%3E%3Ccircle cx='22' cy='167' r='2.4'/%3E%3C/g%3E%3C/svg%3E") right 5% top 0 / 44px auto no-repeat;
}

#main > section:has([data-portrait])::after {
    content: '';
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    height: 120px;
    z-index: -1;
    pointer-events: none;
    opacity: .3;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='720' height='120' viewBox='0 0 720 120'%3E%3Cg fill='%23b8901f'%3E%3Crect x='0' y='104' width='720' height='16'/%3E%3Crect x='0' y='92' width='720' height='6'/%3E%3Crect x='344' y='34' width='32' height='70'/%3E%3Crect x='351' y='14' width='18' height='22'/%3E%3Crect x='358.8' y='0' width='2.4' height='16'/%3E%3Ccircle cx='360' cy='44' r='9' fill='%23fbf7ec'/%3E%3Crect x='310' y='60' width='30' height='44'/%3E%3Crect x='380' y='60' width='30' height='44'/%3E%3Cpath d='M222 92a30 30 0 0 1 60 0z'/%3E%3Cpath d='M438 92a30 30 0 0 1 60 0z'/%3E%3Cpath d='M150 92a18 18 0 0 1 36 0z'/%3E%3Cpath d='M534 92a18 18 0 0 1 36 0z'/%3E%3Cg%3E%3Crect x='112' y='34' width='7' height='58'/%3E%3Crect x='109' y='48' width='13' height='3'/%3E%3Cpath d='M112 34l3.5-14 3.5 14z'/%3E%3Crect x='204' y='40' width='7' height='52'/%3E%3Crect x='201' y='52' width='13' height='3'/%3E%3Cpath d='M204 40l3.5-14 3.5 14z'/%3E%3Crect x='509' y='40' width='7' height='52'/%3E%3Crect x='506' y='52' width='13' height='3'/%3E%3Cpath d='M509 40l3.5-14 3.5 14z'/%3E%3Crect x='601' y='34' width='7' height='58'/%3E%3Crect x='598' y='48' width='13' height='3'/%3E%3Cpath d='M601 34l3.5-14 3.5 14z'/%3E%3C/g%3E%3Cpath d='M20 92a14 14 0 0 1 28 0zM60 92a14 14 0 0 1 28 0zM632 92a14 14 0 0 1 28 0zM672 92a14 14 0 0 1 28 0z'/%3E%3C/g%3E%3C/svg%3E") center bottom / 720px 120px repeat-x;
}
html.dark #main > section:has([data-portrait])::after { opacity: .4; }

/* The same skyline closes every page, above the footer */
#main + footer, footer.border-t { position: relative; }
footer.border-t::before {
    content: '';
    display: block;
    height: 64px;
    margin-top: -64px;
    pointer-events: none;
    opacity: .35;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='720' height='64' viewBox='0 0 720 64'%3E%3Cg fill='%23b8901f'%3E%3Crect x='0' y='58' width='720' height='6'/%3E%3Crect x='348' y='18' width='24' height='40'/%3E%3Crect x='354' y='6' width='12' height='14'/%3E%3Crect x='359' y='0' width='2' height='8'/%3E%3Cpath d='M300 58a20 20 0 0 1 40 0zM380 58a20 20 0 0 1 40 0z'/%3E%3Crect x='270' y='22' width='5' height='36'/%3E%3Cpath d='M270 22l2.5-9 2.5 9z'/%3E%3Crect x='445' y='22' width='5' height='36'/%3E%3Cpath d='M445 22l2.5-9 2.5 9z'/%3E%3C/g%3E%3C/svg%3E") center bottom / 720px 64px repeat-x;
}

/* ---------- Small screens: no lanterns, so nothing covers the text ---------- */

@media (max-width: 640px) {
    #main > section:has([data-portrait])::before { display: none; }
    a.card[data-accent], .faculty-card, .free-card { border-top-left-radius: 50% 3.2rem; border-top-right-radius: 50% 3.2rem; }
}

/* The theme sets the colours, so the colour picker would change nothing: it is hidden
   while the theme is on and comes back with the platform's own look. */
.palette, [data-palette-switcher] { display: none !important; }

/* The logo's chip: a gold edge */
a[aria-label] > .bg-brand { box-shadow: inset 0 0 0 1.5px #c9a227; }

@media print {
    body::before, footer.border-t::before, #main > section:has([data-portrait])::before, #main > section:has([data-portrait])::after { display: none; }
    body { background-image: none; }
}
