/* ===== رحلة الأولى باك — أنماط صفحة الدرس (الهوية المعتمدة) ===== */
:root{
  --desk:#eef1f5; --paper:#ffffff; --navy:#12294a; --navy-2:#1c3a63;
  --ink:#22364d; --muted:#5d6f83; --orange:#e8820e; --gold:#e0a53a; --line:#c9d3df;
  --blue:#2b6cb0; --green:#2f9e5f; --amber:#e07b1a; --purple:#7b4d9f; --teal:#1f9d9d; --red:#c0392b;
  --blue-bg:#eaf2fb; --green-bg:#e8f6ee; --amber-bg:#fdf0e2; --red-bg:#fbece9;
  --shadow:0 20px 55px rgba(18,41,74,.16); --card-sh:0 6px 18px rgba(18,41,74,.08);
  --sheet-max:1000px;
}
@media (prefers-color-scheme:dark){ :root{ --desk:#0e141c; --shadow:0 20px 55px rgba(0,0,0,.6); } }
:root[data-theme="dark"]{ --desk:#0e141c; --shadow:0 20px 55px rgba(0,0,0,.6); }
:root[data-theme="light"]{ --desk:#eef1f5; }

*{ box-sizing:border-box; }
body{ margin:0; background:var(--desk); color:var(--ink); direction:rtl;
  font-family:"Noto Naskh Arabic","Amiri","Segoe UI",Tahoma,Arial,sans-serif; line-height:1.85; -webkit-text-size-adjust:100%; }
h1,h2,h3{ font-family:"Cairo","Tajawal","Segoe UI",Tahoma,sans-serif; }
a{ color:var(--navy); }

.topbar{ background:var(--navy); color:#fff; padding:9px clamp(14px,4vw,26px); font-family:Tahoma,sans-serif; font-size:.84rem;
  display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.topbar a{ color:#fff; text-decoration:none; }
.topbar .back{ border:1px solid rgba(255,255,255,.35); padding:5px 13px; border-radius:8px; }
.topbar .back:hover{ background:rgba(255,255,255,.15); }
.print-btn{ border:1px solid rgba(255,255,255,.4); background:rgba(255,255,255,.08); color:#fff; font:inherit; padding:6px 14px; border-radius:8px; cursor:pointer; }
.print-btn:hover{ background:rgba(255,255,255,.2); }
.print-btn:focus-visible{ outline:2px solid var(--orange); outline-offset:2px; }

.sheet-wrap{ padding:clamp(12px,3.5vw,36px) clamp(8px,3vw,26px); display:flex; justify-content:center; }
.sheet{ width:100%; max-width:var(--sheet-max); background:var(--paper); color:var(--ink);
  box-shadow:var(--shadow); border-radius:10px; overflow:hidden; padding:0 clamp(14px,3.5vw,42px) clamp(24px,4vw,44px); }

.doc-head{ display:flex; align-items:center; justify-content:space-between; gap:18px; flex-wrap:wrap;
  padding:20px 0 16px; border-bottom:3px solid var(--orange); margin-bottom:8px; }
.brand{ display:flex; align-items:center; gap:12px; }
.crest{ width:56px; height:56px; flex:0 0 auto; }
.brand-txt{ display:flex; flex-direction:column; }
.brand-txt .inst{ font-weight:800; color:var(--navy); font-size:1.02rem; }
.brand-txt .sub{ color:var(--muted); font-size:.78rem; font-family:Tahoma,sans-serif; }
.season{ color:var(--muted); font-size:.76rem; font-family:Tahoma,sans-serif; text-align:left; }

.title-band{ text-align:center; padding:18px 6px 4px; }
.title-band .lvl{ display:inline-flex; gap:10px; align-items:center; background:var(--navy); color:#fff;
  font-family:Tahoma,sans-serif; font-size:.8rem; font-weight:700; padding:6px 16px; border-radius:999px; margin-bottom:14px; }
.title-band .lvl span{ color:var(--orange); }
.title-band h1{ margin:0; color:var(--navy); font-size:clamp(1.4rem,3.6vw,2.15rem); line-height:1.5; font-weight:800; text-wrap:balance; }
.title-band .lesson-tag{ display:inline-block; margin-top:12px; background:var(--orange); color:#fff;
  font-family:Tahoma,sans-serif; font-weight:700; font-size:.82rem; padding:5px 16px; border-radius:8px; }

.banner{ background:linear-gradient(90deg,var(--navy),var(--navy-2)); color:#fff; text-align:center; padding:11px 18px;
  border-radius:10px; margin:26px 0 16px; font-weight:800; font-size:clamp(1rem,2.4vw,1.22rem); box-shadow:var(--card-sh); }

.note{ display:flex; gap:14px; align-items:flex-start; border-radius:12px; padding:15px 18px; margin:14px 0; box-shadow:var(--card-sh); }
.note .ic{ flex:0 0 auto; width:42px; height:42px; border-radius:10px; display:grid; place-items:center; font-size:1.3rem; color:#fff; }
.note .bd b{ display:block; font-family:Tahoma,sans-serif; font-size:.86rem; margin-bottom:3px; }
.note .bd p{ margin:0; text-align:justify; }
.note.intro{ background:var(--blue-bg); } .note.intro .ic{ background:var(--navy); } .note.intro .bd b{ color:var(--navy); }
.note.problem{ background:var(--red-bg); } .note.problem .ic{ background:var(--red); } .note.problem .bd b{ color:var(--red); }
.note.method{ background:var(--amber-bg); } .note.method .ic{ background:var(--amber); } .note.method .bd b{ color:var(--amber); }
.note.conclusion{ background:var(--green-bg); } .note.conclusion .ic{ background:var(--green); } .note.conclusion .bd b{ color:var(--green); }

.lead{ text-align:justify; margin:12px 0; }
.table-wrap{ overflow-x:auto; margin:14px 0; -webkit-overflow-scrolling:touch; border-radius:10px; }
table{ border-collapse:collapse; width:100%; min-width:520px; font-size:.95rem; background:#fff; }
th,td{ border:1px solid var(--line); padding:10px 13px; text-align:right; vertical-align:top; }
thead th{ background:var(--navy); color:#fff; text-align:center; font-weight:700; border-color:var(--navy); }
tbody th{ background:#eef3f9; color:var(--navy); white-space:nowrap; text-align:center; }
tbody tr:nth-child(even) td{ background:#f7fafd; }

.cards{ display:grid; grid-template-columns:repeat(auto-fit,minmax(230px,1fr)); gap:14px; margin:14px 0; }
.card{ background:#fff; border-radius:12px; box-shadow:var(--card-sh); overflow:hidden; border:1px solid #eef1f5; display:flex; flex-direction:column; }
.card .cap{ color:#fff; font-weight:800; font-family:Tahoma,sans-serif; padding:9px 14px; display:flex; align-items:center; gap:8px; font-size:.95rem; }
.card .cap .e{ font-size:1.15rem; }
.card .bd{ padding:12px 15px; font-size:.93rem; text-align:justify; }
.card .bd ul{ margin:0; padding-right:18px; }
.card .bd li{ margin:4px 0; }

.infographics{ display:grid; gap:18px; margin:14px 0; }
.info-fig{ margin:0; background:#f5f8fb; border:1px solid var(--line); border-radius:12px; overflow:hidden; box-shadow:var(--card-sh); }
.info-fig img{ display:block; width:100%; height:auto; }
.info-fig figcaption{ padding:10px 14px; font-family:Tahoma,sans-serif; font-size:.82rem; color:var(--muted); }
.info-fig figcaption a{ color:var(--orange); font-weight:700; text-decoration:none; }
.info-fig figcaption a:hover{ text-decoration:underline; }
.c-blue .cap{ background:var(--blue); } .c-green .cap{ background:var(--green); } .c-amber .cap{ background:var(--amber); }
.c-purple .cap{ background:var(--purple); } .c-teal .cap{ background:var(--teal); } .c-red .cap{ background:var(--red); }

.questions{ list-style:none; margin:14px 0; padding:0; counter-reset:q; display:grid; gap:9px; }
.questions li{ position:relative; padding:11px 50px 11px 14px; background:#f5f8fb; border-radius:10px; border-right:4px solid var(--orange); text-align:justify; }
.questions li::before{ counter-increment:q; content:counter(q); position:absolute; right:13px; top:50%; transform:translateY(-50%);
  width:27px; height:27px; border-radius:50%; background:var(--navy); color:#fff; font-family:Tahoma,sans-serif; font-size:.85rem; display:grid; place-items:center; }

.doc-foot{ margin-top:30px; background:linear-gradient(90deg,var(--orange),#f2a13e); color:#fff; border-radius:10px;
  padding:13px 20px; display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; font-family:Tahoma,sans-serif; font-size:.82rem; font-weight:600; }

@media (max-width:520px){ .doc-head{ justify-content:center; text-align:center; } .season{ text-align:center; width:100%; } }
@media print{
  .topbar{ display:none; }
  body,.sheet-wrap{ background:#fff; padding:0; }
  .sheet{ box-shadow:none; border-radius:0; max-width:none; }
  .banner,.card .cap,.note .ic,.title-band .lvl,.title-band .lesson-tag,.doc-foot,thead th{ -webkit-print-color-adjust:exact; print-color-adjust:exact; }
  .card,.questions li,tr{ break-inside:avoid; }
}
@media (prefers-reduced-motion:reduce){ *{ transition:none!important; } }

/* ===== موارد الدرس ===== */
.resources{ display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:14px; margin:14px 0; }
.res{ display:flex; align-items:center; gap:13px; text-decoration:none; background:var(--paper);
  border:1px solid var(--line); border-right:6px solid var(--navy); border-radius:12px;
  padding:13px 15px; box-shadow:var(--card-sh); transition:.18s; }
.res:hover{ transform:translateY(-3px); box-shadow:var(--shadow); border-right-color:var(--orange); }
.res-ic{ flex:0 0 auto; width:46px; height:46px; border-radius:11px; display:grid; place-items:center;
  font-size:1.5rem; background:linear-gradient(135deg,var(--navy),var(--navy-2)); }
.res-tx{ flex:1; min-width:0; }
.res-tx b{ display:block; color:var(--navy); font-size:.98rem; line-height:1.5; }
.res-tx small{ font-family:Tahoma,sans-serif; color:var(--muted); font-size:.75rem; }
.res-go{ flex:0 0 auto; font-family:Tahoma,sans-serif; font-weight:800; color:var(--orange); font-size:.82rem; }
@media print{ .resources{ grid-template-columns:1fr 1fr; } .res{ break-inside:avoid; } }

/* ===== أكتب في دفتري ===== */
.notebook{ margin:18px 0 26px; border:2px solid var(--gold); border-radius:14px; overflow:hidden; background:#fffdf6; box-shadow:var(--card-sh); }
.nb-head{ display:flex; align-items:center; gap:10px; background:var(--gold); color:#1b1b1b; font-family:Tahoma,sans-serif; font-weight:700; font-size:1rem; padding:9px 16px; }
.nb-ic{ font-size:1.15rem; }
.nb-body{ padding:12px 18px 14px; line-height:1.95; border-right:4px double rgba(200,40,40,.35); }
.nb-body p{ margin:0 0 8px; }
.nb-body h4{ margin:2px 0 6px; color:var(--navy); font-size:1.02rem; }
.nb-body ul{ margin:0 0 6px; padding-right:22px; }
.nb-body li{ margin-bottom:4px; }
.nb-body table{ width:100%; min-width:0; table-layout:fixed; border-collapse:collapse; margin:6px 0 10px; background:#fff; line-height:1.55; font-size:.93rem; }
.nb-body th,.nb-body td{ text-align:right; border:1px solid rgba(15,36,56,.3); padding:6px 7px; vertical-align:top; overflow-wrap:anywhere; }
.nb-body th{ background:#f3ead2; color:var(--navy); text-align:center; }
.nb-body tbody tr:nth-child(even) td{ background:#fbf7ea; }
@media (max-width:560px){ .nb-body{ padding:10px 12px; } .nb-body table{ font-size:.8rem; } .nb-body th,.nb-body td{ padding:5px 4px; } }
@media print{ .notebook{ box-shadow:none; } .nb-head,.nb-body th{ -webkit-print-color-adjust:exact; print-color-adjust:exact; } }
