/* moodle-hosting.php - the page's own pictures, each a different shape: a course page in a browser
   frame, an exam morning on a meter, a spec sheet on rules, the first week as a Gantt, and a move
   from one host to another. One copper accent, flat surfaces, hairlines, figures in mono.
   Motion: transform and opacity only, once, on the section's own reveal; hover movement only on a
   real pointer; all of it off under reduced motion. */

.mdl-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.mdl-actions.is-center { justify-content: center; }

.mdl-cap { margin: 12px 4px 0; font-size: 12.5px; color: var(--text-muted); text-align: center; }
.mdl-cap-start { text-align: start; max-width: 70ch; }
.mdl-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
figure.mdl-course-fig, figure.mdl-meter-fig, figure.mdl-gantt-fig { margin: 0; }

/* ── 1. The course page ─────────────────────────────────────────────── */
.mdl-frame { border: 1px solid var(--line-strong); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-2); overflow: hidden; }
.mdl-bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.mdl-bar i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); display: block; }
.mdl-bar span { margin-inline-start: 12px; font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); padding: 3px 12px; border-radius: 999px; background: var(--tint-05); direction: ltr; }
.mdl-screen { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.mdl-main { padding: clamp(18px, 2.6vw, 30px); border-inline-end: 1px solid var(--line); }
.mdl-side { padding: clamp(18px, 2.6vw, 30px); display: grid; gap: 14px; align-content: start; background: var(--tint-03); }
.mdl-crumb { margin: 0 0 6px; font-size: 12.5px; color: var(--text-muted); }
.mdl-course { margin: 0 0 18px; font-size: clamp(20px, 2.2vw, 26px); color: var(--text-strong); letter-spacing: -0.015em; }
html[dir="rtl"] .mdl-course { letter-spacing: 0; }
.mdl-week { border-top: 1px solid var(--line); padding: 14px 0 6px; }
.mdl-week h4 { display: flex; align-items: baseline; gap: 10px; margin: 0 0 8px; font-size: 15px; color: var(--text-strong); }
.mdl-week h4 span { font-family: var(--font-mono); font-weight: 400; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
html[dir="rtl"] .mdl-week h4 span { letter-spacing: 0; text-transform: none; font-size: 12.5px; }
.mdl-week.is-now h4 span { color: var(--copper-ink); }
.mdl-week ul { list-style: none; margin: 0; padding: 0; }
.mdl-week li { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 0; font-size: 14px; color: var(--text); }
.mdl-week li b { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: block; box-sizing: border-box; }
.mdl-week li.done b { border: 0; background: var(--patina-500, #35A08F) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M3.5 7.2l2.3 2.3 4.7-4.9' fill='none' stroke='%2312101A' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; }
.mdl-week li.now b { border-color: var(--copper-500); border-width: 2px; }
.mdl-week li.lock { color: var(--text-muted); }
.mdl-week li em { font-style: normal; font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.mdl-week li.now em { color: var(--copper-ink); font-weight: 600; }

.mdl-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: var(--surface); }
.mdl-card small { display: block; font-size: 12px; color: var(--text-muted); }
.mdl-card b { color: var(--text-strong); }
.mdl-progress { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; align-items: center; }
.mdl-progress b { display: block; font-size: 15px; margin-bottom: 2px; }
/* a static ring: a conic fill with the card's own surface punched through the middle */
.mdl-ring { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
    background: radial-gradient(closest-side, var(--surface) 76%, transparent 78% 100%), conic-gradient(var(--copper-500) calc(var(--p) * 1%), var(--tint-10) 0); }
.mdl-ring span { font-family: var(--font-mono); font-size: 14px; font-weight: 600; color: var(--text-strong); font-variant-numeric: tabular-nums; direction: ltr; }
.mdl-timer b { display: block; font-size: 15px; margin: 2px 0 10px; }
.mdl-clock { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--well); }
.mdl-clock span { font-size: 12px; color: var(--text-2); }
.mdl-clock time { font-family: var(--font-mono); font-size: 22px; font-weight: 600; color: var(--text-strong); font-variant-numeric: tabular-nums; direction: ltr; }
.mdl-qs { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; margin-top: 10px; }
.mdl-qs i { height: 6px; border-radius: 3px; background: var(--tint-10); display: block; }
.mdl-qs i.a { background: var(--text-muted); opacity: .55; }
.mdl-qs i.c { background: var(--copper-500); }
.mdl-grade > div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 4px; font-size: 13.5px; color: var(--text-2); }
.mdl-note b { display: block; font-size: 14px; font-weight: 600; margin-top: 4px; line-height: 1.45; }
.mdl-note { border-inline-start: 3px solid var(--copper-500); }
.mdl-grade > div b { font-family: var(--font-mono); font-size: 16px; white-space: nowrap; direction: ltr; unicode-bidi: isolate; }

/* who it is for: three columns divided by vertical hairlines, no boxes */
.mdl-who { list-style: none; margin: clamp(36px, 5vw, 56px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mdl-who li { padding: 4px clamp(18px, 3vw, 36px); border-inline-start: 1px solid var(--line-strong); }
.mdl-who li:first-child { padding-inline-start: 0; border-inline-start: 0; }
.mdl-who h3 { margin: 0 0 8px; font-size: clamp(20px, 2vw, 24px); color: var(--text-strong); letter-spacing: -0.015em; }
html[dir="rtl"] .mdl-who h3 { letter-spacing: 0; }
.mdl-who p { margin: 0; color: var(--text-2); font-size: 15px; line-height: 1.65; }

/* ── 2. Exam morning ───────────────────────────────────────────────── */
.mdl-exam { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 520px); gap: clamp(32px, 6vw, 80px); align-items: center; }
.mdl-ready { list-style: none; margin: 0; padding: 0; }
.mdl-ready li { padding: 16px 0 16px 22px; border-top: 1px solid var(--line); position: relative; }
html[dir="rtl"] .mdl-ready li { padding: 16px 22px 16px 0; }
.mdl-ready li::before { content: ""; position: absolute; top: 24px; inset-inline-start: 0; width: 8px; height: 8px; border-radius: 2px; background: var(--copper-500); }
.mdl-ready h3 { margin: 0 0 6px; font-size: 18px; color: var(--text-strong); }
.mdl-ready p { margin: 0; color: var(--text-2); font-size: 15px; line-height: 1.65; }

.mdl-meter { border: 1px solid var(--line-strong); border-radius: 18px; background: var(--surface); padding: clamp(18px, 2.4vw, 26px); box-shadow: var(--shadow-1); }
.mdl-meter-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 22px; }
.mdl-meter-top b { font-family: var(--font-mono); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--copper-ink); }
html[dir="rtl"] .mdl-meter-top b { letter-spacing: 0; text-transform: none; font-size: 13px; }
.mdl-meter-top span { font-size: 12.5px; color: var(--text-muted); }
/* a chart reads left to right in every language on this site, like the log's times */
.mdl-plot, .mdl-axis { direction: ltr; }
.mdl-plot { position: relative; height: clamp(150px, 18vw, 200px); display: grid; grid-template-columns: repeat(15, minmax(0, 1fr)); gap: 5px; align-items: end; padding-top: 26px; border-bottom: 1px solid var(--line-strong); }
.mdl-plot i { display: block; height: calc(var(--h) * 1%); border-radius: 4px 4px 0 0; background: var(--tint-14); transform-origin: 50% 100%; }
.mdl-plot i.pk { background: var(--copper-500); }
.mdl-mark { position: absolute; top: 0; left: calc(4 / 15 * 100%); font-family: var(--font-mono); font-size: 11.5px; color: var(--text-strong); padding-left: 8px; border-left: 1px dashed var(--copper-ink); height: 100%; box-sizing: border-box; white-space: nowrap; }
.mdl-axis { display: grid; grid-template-columns: repeat(15, minmax(0, 1fr)); gap: 5px; margin-top: 8px; font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.mdl-axis span { white-space: nowrap; }
.mdl-state { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 20px 0 0; border-top: 1px solid var(--line); }
.mdl-state div { padding: 14px 12px 0; border-inline-start: 1px solid var(--line); }
.mdl-state div:first-child { border-inline-start: 0; padding-inline-start: 0; }
.mdl-state dt { font-family: var(--font-mono); font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--text-muted); }
html[dir="rtl"] .mdl-state dt { letter-spacing: 0; text-transform: none; font-size: 12px; }
.mdl-state dd { margin: 4px 0 0; font-size: 14px; font-weight: 600; color: var(--patina-ink); display: flex; align-items: center; gap: 7px; }
.mdl-state dd::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }

/* ── 3. The spec sheet ─────────────────────────────────────────────── */
.mdl-sheet-wrap { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.mdl-sheet-wrap .sp-head { position: sticky; top: 96px; }
.mdl-sheet { margin: 0; counter-reset: row; border-bottom: 1px solid var(--line); }
.mdl-sheet > div { counter-increment: row; display: grid; grid-template-columns: 36px minmax(0, 190px) minmax(0, 1fr); gap: 8px 20px; padding: 18px 0; border-top: 1px solid var(--line); transition: background-color var(--dur-1) ease-out; }
.mdl-sheet > div::before { content: counter(row, decimal-leading-zero); font-family: var(--font-mono); font-size: 12px; color: var(--copper-ink); padding-top: 3px; }
.mdl-sheet dt { font-weight: 700; font-size: 16px; color: var(--text-strong); }
.mdl-sheet dd { margin: 0; color: var(--text-2); font-size: 15px; line-height: 1.65; }

/* ── 4. The first week, as a Gantt ─────────────────────────────────── */
.mdl-gantt { border: 1px solid var(--line-strong); border-radius: 18px; background: var(--surface); padding: clamp(14px, 2vw, 22px) clamp(16px, 2.4vw, 26px); }
.mdl-gantt ol { list-style: none; margin: 0; padding: 0; }
.mdl-g-row { display: grid; grid-template-columns: minmax(200px, 1.6fr) repeat(5, minmax(0, 1fr)); align-items: center; min-height: 46px; }
.mdl-gantt ol .mdl-g-row { border-top: 1px solid var(--line); }
.mdl-g-head { min-height: 34px; }
.mdl-g-day { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); padding-inline-start: 6px; border-inline-start: 1px solid var(--line); line-height: 34px; }
.mdl-g-task { grid-column: 1; grid-row: 1; font-size: 14.5px; font-weight: 600; color: var(--text-strong); padding-inline-end: 14px; }
.mdl-g-bar { grid-row: 1; height: 14px; margin-inline: 4px; border-radius: 999px; background: var(--tint-20); transform-origin: left center; }
html[dir="rtl"] .mdl-g-bar { transform-origin: right center; }
.mdl-g-bar.is-end { background: var(--copper-500); }

/* ── 5. The move ───────────────────────────────────────────────────── */
.mdl-move { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) minmax(0, 1fr); align-items: stretch; }
.mdl-end { border: 1px solid var(--line-strong); border-radius: 18px; padding: clamp(20px, 2.6vw, 30px); display: grid; align-content: center; gap: 6px; background: var(--bg); }
.mdl-end small { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }
html[dir="rtl"] .mdl-end small { letter-spacing: 0; text-transform: none; font-size: 12.5px; }
.mdl-end b { font-family: var(--font-display); font-size: clamp(22px, 2.4vw, 30px); line-height: 1.15; color: var(--text-strong); letter-spacing: -0.02em; }
html[dir="rtl"] .mdl-end b { letter-spacing: 0; line-height: 1.35; }
.mdl-end span { font-size: 14.5px; color: var(--text-2); }
.mdl-end.is-new { border-color: var(--copper-500); }
.mdl-end.is-new small { color: var(--copper-ink); }
/* the cargo rides a line between the two ends; the arrow head points the way reading goes */
.mdl-cargo { position: relative; padding: 18px clamp(20px, 3vw, 40px); display: grid; align-content: center; }
.mdl-cargo::before { content: ""; position: absolute; top: 50%; inset-inline: 0 6px; border-top: 1px dashed var(--line-strong); }
.mdl-cargo::after { content: ""; position: absolute; top: calc(50% - 5px); inset-inline-end: 0; width: 0; height: 0; border-block: 5px solid transparent; border-inline-start: 8px solid var(--copper-500); }
.mdl-cargo p, .mdl-cargo ul { position: relative; background: var(--bg); }
.mdl-cargo p { margin: 0 auto 10px; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); padding: 0 8px; text-align: center; }
html[dir="rtl"] .mdl-cargo p { letter-spacing: 0; text-transform: none; font-size: 12.5px; }
.mdl-cargo ul { list-style: none; margin: 0 auto; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 360px; }
.mdl-cargo li { font-size: 13.5px; color: var(--text); padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--bg); }
.mdl-steps { list-style: none; margin: clamp(28px, 4vw, 44px) 0 0; padding: 0; counter-reset: st; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 28px; }
.mdl-steps li { counter-increment: st; display: flex; gap: 12px; align-items: baseline; padding-top: 14px; border-top: 1px solid var(--line); font-size: 15px; color: var(--text-2); line-height: 1.6; }
.mdl-steps li::before { content: counter(st); font-family: var(--font-mono); font-size: 13px; color: var(--copper-ink); }

/* ── Motion: once, on reveal, transform and opacity only ────────────── */
@keyframes mdl-grow-y { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes mdl-grow-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes mdl-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.mdl-meter-fig.revealed .mdl-plot i { animation: mdl-grow-y 240ms var(--ease-out) both; animation-delay: calc(120ms + var(--i) * 25ms); }
.mdl-gantt-fig.revealed .mdl-g-bar { animation: mdl-grow-x 240ms var(--ease-out) both; animation-delay: calc(120ms + var(--i) * 60ms); }
.mdl-course-fig.revealed .mdl-side > * { animation: mdl-rise 220ms var(--ease-out) both; }
.mdl-course-fig.revealed .mdl-side > :nth-child(2) { animation-delay: 60ms; }
.mdl-course-fig.revealed .mdl-side > :nth-child(3) { animation-delay: 120ms; }

@media (hover: hover) and (pointer: fine) {
    .mdl-sheet > div:hover { background: var(--tint-03); }
    .mdl-cargo li { transition: border-color 160ms ease-out; }
    .mdl-cargo li:hover { border-color: var(--copper-500); }
}

@media (prefers-reduced-motion: reduce) {
    .mdl-meter-fig .mdl-plot i, .mdl-gantt-fig .mdl-g-bar, .mdl-course-fig .mdl-side > * { animation: none !important; }
}

/* ── Widths ────────────────────────────────────────────────────────── */
@media (max-width: 1000px) {
    .mdl-exam { grid-template-columns: minmax(0, 1fr); }
    .mdl-meter-fig { max-width: 560px; width: 100%; }
    .mdl-sheet-wrap { grid-template-columns: minmax(0, 1fr); }
    .mdl-sheet-wrap .sp-head { position: static; }
}
@media (max-width: 900px) {
    .mdl-screen { grid-template-columns: minmax(0, 1fr); }
    .mdl-main { border-inline-end: 0; border-bottom: 1px solid var(--line); }
    .mdl-side { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
    .mdl-move { grid-template-columns: minmax(0, 1fr); }
    .mdl-cargo { padding: 28px 0; }
    /* the line turns to run down between the two ends */
    .mdl-cargo::before { top: 0; bottom: 6px; inset-inline: auto; left: 50%; border-top: 0; border-left: 1px dashed var(--line-strong); }
    .mdl-cargo::after { top: auto; bottom: 0; inset-inline: auto; left: calc(50% - 5px); border-block: 0; border-inline: 5px solid transparent; border-top: 8px solid var(--copper-500); }
}
@media (max-width: 760px) {
    .mdl-who { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .mdl-who li { padding: 16px 0; border-inline-start: 0; border-top: 1px solid var(--line); }
    .mdl-sheet > div { grid-template-columns: 30px minmax(0, 1fr); }
    .mdl-sheet dd { grid-column: 2; }
    /* the task takes its own line and the five days keep the full width below it */
    .mdl-g-row { grid-template-columns: 0 repeat(5, minmax(0, 1fr)); }
    .mdl-gantt ol .mdl-g-row { padding: 10px 0 12px; row-gap: 8px; }
    .mdl-g-task { grid-column: 1 / -1; padding: 0; }
    .mdl-g-bar { grid-row: 2; }
    .mdl-g-day { font-size: 11px; padding-inline-start: 4px; }
    .mdl-steps { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .mdl-steps li { padding-block: 12px; }
}
@media (max-width: 720px) {
    .sp-hero .mdl-actions .btn, .sp-close .mdl-actions .btn { width: 100%; justify-content: center; }
}
@media (max-width: 600px) {
    /* the phone keeps the three cards that say the most; the grade and the forum stay on wider screens */
    .mdl-grade, .mdl-note { display: none; }
    .mdl-state div { padding-inline: 8px; }
    .mdl-state dd { font-size: 13px; }
    .mdl-axis { font-size: 10px; }
}

/* Arabic labels leave the mono face: its Latin-width space pulls Arabic words apart. Figures
   (times, the timer, the ring, the grade) stay mono. */
html[dir="rtl"] .mdl-week h4 span, html[dir="rtl"] .mdl-meter-top b, html[dir="rtl"] .mdl-state dt,
html[dir="rtl"] .mdl-g-day, html[dir="rtl"] .mdl-end small, html[dir="rtl"] .mdl-cargo p, html[dir="rtl"] .mdl-mark { font-family: var(--font-body); }
