* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    font-family: Arial, "Noto Sans Arabic", sans-serif;
    color: #172033;
    --blue: #155e9b;
    --blue-dark: #104775;
    --teal: #147c8c;
    --muted: #64748b;
    --line: #d8e2ec;
    --card: #fff;
}

body {
    min-height: 100vh;
    padding: 22px clamp(14px, 4vw, 48px) 0;
    color: #172033;
    background: linear-gradient(135deg, rgba(9, 22, 43, .84), rgba(20, 45, 73, .76)), url("back.jpeg") center / cover fixed;
}

a {
    color: inherit;
    text-decoration: none;
}

body > img:first-of-type {
    display: inline-block;
    width: 54px;
    height: 54px;
    margin: 0 0 14px;
    object-fit: contain;
    vertical-align: middle;
    background: #fff;
    border-radius: 12px;
}

ul.box,
ul.box1 {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 22px;
    min-height: 50px;
    margin: 0 0 14px 12px;
    padding: 12px 20px;
    list-style: none;
    vertical-align: middle;
    background: rgba(255, 255, 255, .96);
    border: 1px solid rgba(216, 226, 236, .9);
    border-radius: 12px;
    box-shadow: 0 5px 18px rgba(0, 0, 0, .12);
}

body > a.box1 {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    margin: 0 0 14px 12px;
    padding: 10px 18px;
    color: #fff;
    background: var(--blue);
    border-radius: 10px;
    font-weight: 700;
}

ul a,
body > a.box1 {
    font-size: 15px;
    font-weight: 700;
    transition: color .2s ease, background .2s ease;
}

ul a:hover,
ul a:focus-visible {
    color: var(--teal);
}

body > a.box1:hover,
body > a.box1:focus-visible {
    color: #fff;
    background: var(--blue-dark);
}

.lesson1,
.lesson2,
.lesson3,
.lesson22 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 390px), 1fr));
    align-items: start;
    gap: 20px;
    width: min(1240px, 100%);
    margin: 14px auto 34px;
}

/* The source pages wrap cards in an extra div; expose its contents to the grid. */
.lesson1 > div,
.lesson2 > div,
.lesson3 > div {
    display: contents;
}

.lesson3 > div > div {
    display: contents;
}

.lesson22 {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr));
}

.lesson1 iframe,
.lesson2 iframe,
.lesson3 iframe,
.lesson22 iframe,
.experiment iframe {
    display: block;
    width: 100%;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    border: 0;
    border-radius: 14px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .22);
}

.lesson1 > div:first-child > .box:first-child,
.lesson2 > div:first-child > .box:first-child,
.lesson3 > div > div:first-child > .box:first-child {
    grid-column: 1 / -1;
}

.lesson1 .box,
.lesson2 .box,
.lesson3 .box,
.lesson22 .box,
.lesson22 .box1,
section.box {
    min-width: 0;
    padding: clamp(18px, 2.6vw, 28px);
    color: #172033;
    background: rgba(255, 255, 255, .97);
    border: 1px solid var(--line);
    border-radius: 15px;
    box-shadow: 0 9px 26px rgba(0, 0, 0, .14);
    text-align: start;
    overflow-wrap: anywhere;
}

.lesson1 .box,
.lesson2 .box,
.lesson3 .box,
.lesson22 .box {
    display: block;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.75;
}

.lesson1 h1,
.lesson2 h1,
.lesson3 h1,
.lesson22 h1,
.lesson1 h2,
.lesson2 h2,
.lesson3 h2,
.lesson22 h2,
.lesson1 h3,
.lesson2 h3,
.lesson3 h3,
.lesson22 h3 {
    margin: 0 0 12px;
    color: #123b5c;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.lesson1 h1,
.lesson2 h1,
.lesson3 h1,
.lesson22 h1 {
    font-size: clamp(23px, 3vw, 32px);
}

.lesson1 h2,
.lesson2 h2,
.lesson3 h2,
.lesson22 h2 {
    font-size: clamp(18px, 2vw, 22px);
}

.lesson1 p,
.lesson2 p,
.lesson3 p,
.lesson22 p,
.lesson1 pre,
.lesson2 pre,
.lesson3 pre,
.lesson22 pre,
section.box p {
    margin: 0 0 12px;
    color: #334155;
    font-size: 16px;
    line-height: 1.85;
    text-align: start;
    unicode-bidi: plaintext;
}

.lesson1 pre,
.lesson2 pre,
.lesson3 pre,
.lesson22 pre {
    max-width: 100%;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: normal;
    font-family: inherit;
}

.lesson1 .box img,
.lesson2 .box img,
.lesson3 .box img,
.lesson22 .box img,
.lesson22 .box1 img,
section.box img {
    display: block;
    width: min(100%, 760px);
    height: auto;
    margin: 16px auto 0;
    object-fit: contain;
    border-radius: 10px;
}

.lesson22 .box1 {
    grid-column: 1 / -1;
}

.lesson22 .box1 img {
    width: min(100%, 900px);
}

.experiment {
    width: min(760px, 100%);
    margin: 0 auto 26px;
}

section.box {
    width: min(1000px, 100%);
    margin: 20px auto;
}

.quze h1 {
    margin-bottom: 10px;
    color: #123b5c;
}



.copyright {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px 24px;
    margin: 28px calc(-1 * clamp(14px, 4vw, 48px)) 0;
    padding: 20px clamp(18px, 5vw, 72px);
    color: #d6e1ed;
    background: #0c1e35;
    font-size: 14px;
}

.copyright span {
    color: #77d5ee;
    font-weight: 700;
}

.copyright p {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    line-height: 1.6;
}

.copyright img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    border-radius: 50%;
}

@media (max-width: 600px) {
    body {
        padding: 14px 12px 0;
        background-attachment: scroll;
    }

    .lesson1,
    .lesson2,
    .lesson3,
    .lesson22 {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    .lesson1 > div:first-child > .box:first-child,
    .lesson2 > div:first-child > .box:first-child,
    .lesson3 > div > div:first-child > .box:first-child,
    .lesson22 .box1 {
        grid-column: auto;
    }

    .copyright {
        flex-direction: column;
        align-items: flex-start;
        margin-right: -12px;
        margin-left: -12px;
    }
}
