/* شرح العملي: الصفحات تستعمل theory.css للهيدر والتبويبات والفهرس واللوحة،
   وهذا الملف بس للأشياء الخاصة بالعملي (المشهد، نص الملزمة، الخلاصة، وصفحة القائمة). */
:root {
  --paper: #f5f1e7;
  --ink: #19212b;
  --yellow: #ffe16a;
  --blue: #284dbb;
  --red: #cc2f29;
}

/* ===== صفحة القائمة (PRACTICAL/index.html) ===== */
.practical {
  max-width: 1280px;
  margin: auto;
  padding: 24px 5% 65px;
}
.hero-practical {
  padding: 28px 0 26px;
  border-bottom: 3px solid var(--ink);
  margin-bottom: 24px;
}
.hero-practical h1 {
  font-size: clamp(32px, 4vw, 54px);
  margin: 10px 0;
  line-height: 1.5;
}
.hero-practical p {
  color: #545b64;
  max-width: 730px;
  font-size: 0.875rem;
  line-height: 2;
}
.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px;
  margin-top: 25px;
}
.lesson-card {
  padding: 32px;
  background: #fffdf7;
  border: 2px solid var(--ink);
  box-shadow: 5px 5px var(--ink);
  text-decoration: none;
}
.lesson-card:hover {
  background: var(--yellow);
}
.lesson-card .number {
  font: 900 3.125rem "AWAPHs Arabic", Arial, sans-serif;
  color: var(--blue);
}
.lesson-card h2 {
  font-size: 1.6875rem;
}
.lesson-card p {
  font-size: 0.875rem;
  color: #545b64;
}
.lesson-card b {
  font-size: 0.75rem;
}

/* ===== صفحة المحاضرة ===== */
.practical-page .eyebrow {
  color: var(--blue);
}
.practical-page .learn-layout > * {
  min-width: 0;
}
.practical-index {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 2px 2px 6px;
}
.practical-index label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.practical-index input {
  width: 100%;
  min-width: 0;
  border: 2px solid var(--ink);
  border-radius: 0;
  padding: 10px 12px;
  background: #fffdf7;
  font: inherit;
  font-size: 0.8125rem;
  margin-bottom: 12px;
}
.practical-index .chapter-list button em {
  font-style: normal;
  display: block;
}
.practical-index .chapter-list button small {
  display: block;
  font-size: 0.75rem;
  color: #606672;
  line-height: 1.5;
}
.toc-empty {
  font-size: 0.8125rem;
  color: #545b64;
  padding: 10px 2px;
}

/* المشهد */
.practical-scene .scene-top span {
  font: 700 0.8125rem monospace;
}
.scene-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  direction: ltr;
}
.stage-wrap {
  background: #f8f6ef;
  border-inline-end: 2px solid var(--ink);
  min-width: 0;
}
#stage svg {
  display: block;
  width: 100%;
  height: auto;
  min-height: 260px;
}
.scene-copy {
  direction: rtl;
  align-self: center;
  padding: 22px 24px;
  background: #fffdf7;
  height: 100%;
}
.scene-copy h3 {
  font-size: 1.125rem;
  line-height: 1.8;
  margin: 0;
}
.scene-copy .scene-sub {
  font-size: 0.75rem;
  color: #606672;
  margin: 0 0 12px;
  text-align: right;
}
.scene-copy h4 {
  font-size: 0.9375rem;
  line-height: 1.8;
  margin: 0 0 6px;
}
.scene-copy p {
  font-size: 0.8125rem;
  line-height: 2.1;
  margin: 0;
  color: #333b47;
}
.scene-en {
  border-top: 1px dashed #19212b55;
  margin-top: 16px;
  padding-top: 14px;
}
.scene-en h4 {
  color: var(--blue);
}
.practical-scene .phase-controls button.active span {
  color: white;
}
.play-row {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-top: 2px solid var(--ink);
  background: #fffdf7;
}
.play-row button {
  padding: 9px 18px;
  background: var(--ink);
  color: white;
  border: 2px solid var(--ink);
  box-shadow: 3px 3px var(--red);
  font-size: 0.8125rem;
  font-weight: 700;
  white-space: nowrap;
}
.play-row span {
  font-size: 0.75rem;
  color: #545b64;
}

/* الخلاصة: نفس بطاقة «مفتاح الحفظ» بالنظري، مع سطر إنكليزي */
.practical-page .takeaway .takeaway-en {
  border-top: 1px dashed #19212b66;
  margin-top: 10px;
  padding-top: 10px;
  font-size: 0.875rem;
  line-height: 1.8;
}
.practical-page .external-note summary {
  cursor: pointer;
  line-height: 2;
}

/* نص الملزمة: آخر شي، مسكّر افتراضياً */
.source-box {
  border: 2px solid var(--ink);
  background: #fffdf7;
  margin: 20px 0 6px;
}
.source-box summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  padding: 12px 16px;
  font-size: 0.8125rem;
  background: #eae6dc;
}
.source-box[open] summary {
  border-bottom: 2px solid var(--ink);
}
.source-box summary span {
  font: 700 0.75rem monospace;
}
.source-box .quote {
  padding: 6px 20px 4px;
  color: #293447;
  overflow-wrap: anywhere;
}
.source-box .quote p {
  font: 1rem/1.85 Georgia, "Times New Roman", serif;
  text-align: left;
  margin: 12px 0;
}
.source-box .quote .quote-head {
  font-weight: 700;
  color: var(--blue);
  margin: 18px 0 4px;
}
.source-ar-note,
.source-caption {
  font-size: 0.8125rem;
  padding: 0 20px;
  color: #545b64;
}
.source-image img {
  display: block;
  width: calc(100% - 40px);
  height: auto;
  margin: 14px 20px;
  border: 1px solid #19212b44;
  background: white;
}
.source-pdf {
  display: inline-block;
  margin: 4px 20px 16px;
  color: var(--blue);
  font-weight: 700;
  font-size: 0.8125rem;
}

/* الخلاصة السريعة */
.summary-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.summary-list button {
  display: block;
  width: 100%;
  height: 100%;
  text-align: right;
  padding: 18px 20px;
  background: #fffdf7;
  border: 2px solid var(--ink);
  box-shadow: 4px 4px var(--ink);
  transition: transform 0.15s, background 0.15s;
}
.summary-list button:hover {
  background: var(--yellow);
  transform: translate(-2px, -2px);
}
.summary-number {
  font: 900 1.375rem "AWAPHs Arabic", Arial;
  color: var(--blue);
}
.summary-list strong {
  display: block;
  font-size: 1rem;
  margin-top: 4px;
}
.summary-list small {
  display: block;
  font-size: 0.75rem;
  color: #606672;
  text-align: left;
}
.summary-list p {
  font-size: 0.8125rem;
  line-height: 2;
  margin: 10px 0 0;
  color: #333b47;
}

.storage-line {
  font-size: 0.75rem;
  color: #545b64;
  margin: 26px 0 0;
}
.study-notice {
  font-size: 0.75rem;
  line-height: 2;
  color: #545b64;
  margin: 14px 0 0;
  padding-top: 14px;
  border-top: 1px solid #19212b33;
}

.practical a:focus-visible,
.practical button:focus-visible,
.practical-page a:focus-visible,
.practical-page button:focus-visible,
.practical-page summary:focus-visible,
.practical-page input:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
}

/* ===== حركة رسوم المشاهد (visuals.js) ===== */
.float { animation: float 2.5s ease-in-out infinite; animation-delay: var(--delay, 0s); }
.clearance { animation: clearance 2.8s linear infinite; animation-delay: var(--delay, 0s); }
.drying { animation: dry 2s ease-out both; transform-box: fill-box; transform-origin: center; }
.air-pulse, .spray-pulse { animation: pulse 1.8s ease-in-out infinite; }
.dash { animation: dash 2s linear infinite; }
.coat { animation: coat 1s ease-out both; }
.draw-line { stroke-dasharray: 350; stroke-dashoffset: 350; animation: draw 1.5s forwards; }
.lining { transition: stroke-width 0.6s; }
.hidden-particle { opacity: 0.1; }
.spotlight { animation: pulse 2s infinite; }
.still * { animation: none !important; transition: none !important; }
.still .draw-line { stroke-dashoffset: 0; }
.still .drying { opacity: 0.3; }
@keyframes float { 50% { transform: translateY(-6px); } }
@keyframes clearance { 0% { transform: translateY(30px); opacity: 0; } 25% { opacity: 1; } 100% { transform: translateY(-140px); opacity: 0; } }
@keyframes dry { to { transform: scale(0.3); opacity: 0.25; } }
@keyframes pulse { 50% { opacity: 0.4; } }
@keyframes dash { to { stroke-dashoffset: -34; } }
@keyframes coat { from { opacity: 0; stroke-width: 1; } to { opacity: 1; stroke-width: 12; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .draw-line { stroke-dashoffset: 0; }
  .drying { opacity: 0.3; }
}

@media (max-width: 1100px) {
  .scene-layout { grid-template-columns: 1fr; }
  .stage-wrap { border-inline-end: 0; border-bottom: 2px solid var(--ink); }
  #stage { max-width: 560px; margin: auto; width: 100%; }
}
@media (max-width: 740px) {
  .practical-index { position: static; max-height: none; overflow: visible; }
  .practical-index .chapter-list { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
  .practical-index .chapter-list button { flex: 0 0 72%; scroll-snap-align: start; }
  #stage svg { min-height: 0; }
  .scene-copy { padding: 18px; }
  .cards { grid-template-columns: 1fr; }
  .practical { padding: 18px 20px 45px; }
  .hero-practical h1 { font-size: 2.125rem; }
  .action-row .primary { flex: 1 0 100%; order: -1; }
  .action-row .secondary { flex: 1; }
}

/* تعديل ليلي باليد: المحور المحدد أصفر، فنصه الصغير يبقى غامق. */
html[data-theme="dark"] .practical-index .chapter-list button.selected small {
  color: #3a4250;
}
/* تعديل ليلي باليد: الزر الفعّال أزرق، فنصه يبقى أبيض. */
html[data-theme="dark"] .practical-scene .phase-controls button.active span {
  color: #fff;
}

/* ===== قراءة مريحة (2026-11-22): نص القراءة 16px والثانوي 14px على الأقل. ===== */
.hero-practical p,
.lesson-card p,
.scene-copy p,
.summary-list p,
.practical-page .takeaway .takeaway-en,
.source-caption {
  font-size: 1rem;
  line-height: 1.85;
  max-width: 70ch;
}
.lesson-card b,
.practical-index label,
.practical-index input,
.practical-index .chapter-list button small,
.toc-empty,
.scene-copy .scene-sub,
.play-row button,
.play-row span,
.source-box summary,
.source-pdf,
.summary-list small,
.storage-line,
.study-notice {
  font-size: 0.875rem;
}

/* ===== الوضع الليلي (مولّد تلقائياً بـ npm run build:dark، لا تعدله يدوياً) ===== */
html[data-theme="dark"] {
  color-scheme: dark;
  --dark-line: #3d4757;
  --dark-hard: #030508;
}
html[data-theme="dark"] {
  --paper: #0a0f15;
  --ink: #e6e9ed;
  --yellow: #e5c959;
  --blue: #6897ff;
  --red: #ff6356;
}
html[data-theme="dark"] .hero-practical {
  border-bottom: 3px solid var(--dark-line);
}
html[data-theme="dark"] .hero-practical p {
  color: #aeb6c0;
}
html[data-theme="dark"] .lesson-card {
  background: #11171f;
  border: 2px solid var(--dark-line);
  box-shadow: 5px 5px var(--dark-hard);
}
html[data-theme="dark"] .lesson-card:hover {
  color: #19212b;
  background: var(--yellow);
}
html[data-theme="dark"] .lesson-card .number {
  color: var(--blue);
}
html[data-theme="dark"] .lesson-card p {
  color: #aeb6c0;
}
html[data-theme="dark"] .practical-page .eyebrow {
  color: var(--blue);
}
html[data-theme="dark"] .practical-index input {
  border: 2px solid var(--dark-line);
  background: #11171f;
}
html[data-theme="dark"] .practical-index .chapter-list button small {
  color: #a1a8b5;
}
html[data-theme="dark"] .toc-empty {
  color: #aeb6c0;
}
html[data-theme="dark"] .stage-wrap {
  background: #0c1219;
  border-inline-end: 2px solid var(--dark-line);
}
html[data-theme="dark"] .scene-copy {
  background: #11171f;
}
html[data-theme="dark"] .scene-copy .scene-sub {
  color: #a1a8b5;
}
html[data-theme="dark"] .scene-copy p {
  color: #d8dbdf;
}
html[data-theme="dark"] .scene-en {
  border-top: 1px dashed #464e5855;
}
html[data-theme="dark"] .scene-en h4 {
  color: var(--blue);
}
html[data-theme="dark"] .play-row {
  border-top: 2px solid var(--dark-line);
  background: #11171f;
}
html[data-theme="dark"] .play-row button {
  background: var(--ink);
  color: #121923;
  border: 2px solid var(--dark-line);
  box-shadow: 3px 3px var(--red);
}
html[data-theme="dark"] .play-row span {
  color: #aeb6c0;
}
html[data-theme="dark"] .practical-page .takeaway .takeaway-en {
  border-top: 1px dashed #464e5866;
}
html[data-theme="dark"] .source-box {
  border: 2px solid var(--dark-line);
  background: #11171f;
}
html[data-theme="dark"] .source-box summary {
  background: #04080d;
}
html[data-theme="dark"] .source-box[open] summary {
  border-bottom: 2px solid var(--dark-line);
}
html[data-theme="dark"] .source-box .quote {
  color: #c4d2ea;
}
html[data-theme="dark"] .source-box .quote .quote-head {
  color: var(--blue);
}
html[data-theme="dark"] .source-ar-note,
html[data-theme="dark"] .source-caption {
  color: #aeb6c0;
}
html[data-theme="dark"] .source-image img {
  border: 1px solid #464e5844;
  background: #121923;
}
html[data-theme="dark"] .source-pdf {
  color: var(--blue);
}
html[data-theme="dark"] .summary-list button {
  background: #11171f;
  border: 2px solid var(--dark-line);
  box-shadow: 4px 4px var(--dark-hard);
}
html[data-theme="dark"] .summary-list button:hover {
  color: #19212b;
  background: var(--yellow);
}
html[data-theme="dark"] .summary-number {
  color: var(--blue);
}
html[data-theme="dark"] .summary-list small {
  color: #a1a8b5;
}
html[data-theme="dark"] .summary-list p {
  color: #d8dbdf;
}
html[data-theme="dark"] .storage-line {
  color: #aeb6c0;
}
html[data-theme="dark"] .study-notice {
  color: #aeb6c0;
  border-top: 1px solid #464e5833;
}
html[data-theme="dark"] .practical a:focus-visible,
html[data-theme="dark"] .practical button:focus-visible,
html[data-theme="dark"] .practical-page a:focus-visible,
html[data-theme="dark"] .practical-page button:focus-visible,
html[data-theme="dark"] .practical-page summary:focus-visible,
html[data-theme="dark"] .practical-page input:focus-visible {
  outline: 3px solid var(--blue);
}
@media (max-width: 1100px) {
  html[data-theme="dark"] .stage-wrap {
    border-bottom: 2px solid var(--dark-line);
  }
}
