/* =====================================================================
   سي ليفل دار: المكونات (components.css)
   كل مكوّن هنا يطلبه محتوى الموقع الفعلي (Website Content.md).
   يُستورد بعد tokens.css وbase.css. لا اعتماد على إطار عمل.
   ===================================================================== */

/* ---------- الشعار ---------- */
.logo { fill: currentColor; display: block; overflow: visible; }
.logo.lg-h { aspect-ratio: 454.36 / 150; }
.logo.lg-v { aspect-ratio: 285.6077 / 404.594; }
.logo.lg-s { aspect-ratio: 1 / 1; }

/* ---------- الأزرار ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--control-h); padding: 0 var(--control-px);
  font-family: var(--font-ar); font-size: var(--fs-body); font-weight: var(--fw-medium); line-height: 1.3;
  color: var(--cld-burgundy); background: transparent;
  border: var(--control-border-w) solid var(--cld-burgundy); border-radius: var(--radius-s);
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.btn:hover { background: var(--surface-hover); text-decoration: none; }
.btn:active { background: var(--surface-active); }
.btn:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; }
.btn-primary { color: var(--cld-light); background: var(--cld-burgundy); border-color: var(--cld-burgundy); }
.btn-primary:hover { background: var(--cld-burgundy-deep); border-color: var(--cld-burgundy-deep); }
.btn-primary:active { background: var(--cld-burgundy-deep); }
.btn-text { border-color: transparent; padding-inline: var(--space-2); text-decoration: underline; text-underline-offset: .2em; }
.btn-text:hover { background: transparent; text-decoration-thickness: 2px; }
.btn-s { min-height: var(--control-h-s); padding-inline: var(--space-4); font-size: var(--fs-small); }
.btn:disabled, .btn[aria-disabled="true"] { color: var(--text-disabled); background: var(--surface-stone-soft); border-color: var(--surface-stone-soft); cursor: not-allowed; }
.btn[aria-busy="true"] { pointer-events: none; }
.btn[aria-busy="true"]::before { content: ""; width: 1em; height: 1em; border: 2px solid currentColor; border-inline-end-color: transparent; border-radius: 50%; animation: cld-spin .8s linear infinite; }
@keyframes cld-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn[aria-busy="true"]::before { animation: none; border-style: dotted; } }
/* على الأسطح البرغندية */
.on-brand .btn { color: var(--cld-light); border-color: var(--cld-light); }
.on-brand .btn:hover { background: var(--surface-hover); }
.on-brand .btn-primary { color: var(--cld-burgundy); background: var(--cld-light); border-color: var(--cld-light); }
.on-brand .btn-primary:hover { background: var(--cld-white); border-color: var(--cld-white); }
.on-brand .btn:disabled { color: rgba(233,233,229,.5); background: rgba(233,233,229,.12); border-color: transparent; }
.actions { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }

/* ---------- الوسوم والمرشحات ---------- */
.tag { display: inline-block; font-size: var(--fs-caption); line-height: 1; padding: .45em .6em; border: 1px solid var(--line-strong); border-radius: var(--radius-s); color: var(--text-muted); white-space: nowrap; }
.filters { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.filter { min-height: var(--control-h-s); padding: 0 var(--space-4); background: transparent; color: var(--text-body); border: var(--control-border-w) solid var(--line-control); border-radius: var(--radius-s); cursor: pointer; font-weight: var(--fw-medium); font-size: var(--fs-small); transition: background-color var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast); }
.filter:hover { background: var(--surface-hover); border-color: var(--cld-burgundy); }
.filter[aria-pressed="true"] { background: var(--cld-burgundy); color: var(--cld-light); border-color: var(--cld-burgundy); }
.filter-status { font-size: var(--fs-small); color: var(--text-muted); margin: var(--space-3) 0 0; }

/* ---------- الرأس والتنقل ---------- */
.site-header { position: sticky; top: 0; z-index: var(--z-header); background: var(--surface-page); border-bottom: 1px solid var(--line-subtle); }
.site-header.on-brand { border-bottom-color: var(--line-on-brand); }
.site-header .bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); min-height: var(--header-h); position: relative; }
.brand-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--text-heading); text-decoration: none; }
.brand-link .logo { height: var(--logo-h-header); width: auto; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--space-6); align-items: center; }
.site-nav li + li { margin: 0; }
.site-nav ul a { display: inline-block; padding: .5rem 0; min-height: 44px; line-height: 1.75rem; color: var(--text-body); font-weight: var(--fw-medium); text-decoration: none; border-bottom: 2px solid transparent; }
.site-nav ul a:hover { border-bottom-color: var(--line-strong); }
.site-nav ul a[aria-current="page"] { color: var(--text-heading); border-bottom-color: currentColor; }
.site-nav .cta-mobile { display: none; }
.menu-toggle { display: none; align-items: center; gap: var(--space-2); min-height: 44px; min-width: 44px; padding: 0 var(--space-3); background: transparent; border: var(--control-border-w) solid var(--line-control); border-radius: var(--radius-s); color: var(--text-heading); cursor: pointer; font-weight: var(--fw-medium); }
.menu-toggle .bars { position: relative; width: 1.125rem; height: 2px; background: currentColor; display: inline-block; }
.menu-toggle .bars::before, .menu-toggle .bars::after { content: ""; position: absolute; left: 0; width: 100%; height: 2px; background: currentColor; }
.menu-toggle .bars::before { top: -6px; } .menu-toggle .bars::after { top: 6px; }
.menu-toggle[aria-expanded="true"] .bars { background: transparent; }
.menu-toggle[aria-expanded="true"] .bars::before { top: 0; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .bars::after { top: 0; transform: rotate(-45deg); }
@media (max-width: 1023px) {
  .menu-toggle { display: inline-flex; }
  .site-header .cta { display: none; }
  .site-nav { display: none; position: absolute; inset-inline: 0; top: 100%; background: var(--surface-page); border-bottom: 1px solid var(--line-strong); padding: var(--space-3) var(--page-gutter) var(--space-6); }
  .site-header.on-brand .site-nav { background: var(--surface-brand); }
  .site-nav[data-open="true"] { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .site-nav li + li { border-top: 1px solid var(--line-subtle); }
  .site-nav ul a { display: block; padding: .875rem 0; border-bottom: 0; }
  .site-nav ul a[aria-current="page"] { font-weight: var(--fw-semibold); }
  .site-nav .cta-mobile { display: block; margin-top: var(--space-5); }
  .site-nav .cta-mobile .btn { width: 100%; }
}

/* ---------- مسار الصفحة ---------- */
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-2); padding: 0; margin: 0 0 var(--space-5); font-size: var(--fs-small); color: var(--text-muted); }
.breadcrumb li + li { margin: 0; }
.breadcrumb li + li::before { content: "/"; margin-inline-end: var(--space-2); opacity: .6; }
.breadcrumb a { color: inherit; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb [aria-current="page"] { color: var(--text-body); }

/* ---------- الافتتاحية ورأس الصفحة ---------- */
.hero { padding-block: var(--section-y); position: relative; overflow: hidden; }
.hero-grid { display: grid; gap: var(--space-7); align-items: center; }
/* منع تمدد الشبكات بسبب العرض الطبيعي للصور الكبيرة */
.hero-grid > *, .split > *, .section-head > *, .band-brand .inner > *, .facts > *, .def > *, .site-footer .cols > *, .figure, .figure picture { min-width: 0; }
@media (min-width: 1024px) { .hero-grid { grid-template-columns: 6fr 6fr; } }
.hero h1 { margin-bottom: var(--space-5); }
.hero .lead { margin-bottom: 0; max-width: var(--measure); }
.hero .actions { margin-top: var(--space-6); }
.hero .figure img { width: 100%; }
.page-header { padding-block: var(--space-8) var(--space-7); }
.page-header .lead { max-width: var(--measure); }
@media (prefers-reduced-motion: no-preference) {
  .hero .reveal { animation: cld-rise var(--dur-slow) var(--ease-out) both; }
  .hero .reveal:nth-child(2) { animation-delay: 80ms; }
  .hero .reveal:nth-child(3) { animation-delay: 160ms; }
  .hero .reveal:nth-child(4) { animation-delay: 240ms; }
}
@keyframes cld-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- الفواصل البرغندية والحجرية ---------- */
.band-brand { position: relative; overflow: hidden; }
.band-brand .motif { position: absolute; inset-inline-end: -14%; top: -45%; width: min(60vw, 40rem); aspect-ratio: 1; color: rgba(233,233,229,.07); fill: currentColor; pointer-events: none; }
.band-brand .inner { position: relative; display: grid; gap: var(--space-5); align-items: center; }
@media (min-width: 1024px) { .band-brand .inner { grid-template-columns: 1fr auto; } }
.band-brand .display { margin: 0; }
.band-stone { position: relative; }

/* ---------- رؤوس الأقسام والنصوص ---------- */
.section-head { display: grid; gap: var(--space-4); margin-bottom: var(--space-7); }
@media (min-width: 1024px) { .section-head { grid-template-columns: 4fr 8fr; align-items: start; } .section-head h2 { margin: 0; } }
.section-head .lead { margin: 0; max-width: var(--measure); }

/* ---------- الصور ---------- */
.figure { margin: 0; }
.figure img { width: 100%; height: auto; border-radius: var(--radius-m); object-fit: cover; }
.figure.cover-16x9 img { aspect-ratio: 16 / 9; }
.figure.cover-4x3 img { aspect-ratio: 4 / 3; }
.figure figcaption { margin-top: var(--space-3); font-size: var(--fs-caption); color: var(--text-muted); }
@media (max-width: 767px) { .figure.cover-mobile-4x5 img { aspect-ratio: 4 / 5; } }

/* ---------- اللوحة المرفوعة ---------- */
.panel { background: var(--surface-raised); border: 1px solid var(--line-subtle); border-radius: var(--radius-l); padding: clamp(1.5rem, 1rem + 2vw, 3rem); }
.panel .meta { font-size: var(--fs-small); color: var(--text-muted); margin: 0 0 var(--space-3); }
.panel h3 { margin-bottom: var(--space-3); }
.panel .note { font-size: var(--fs-caption); color: var(--text-muted); margin: var(--space-4) 0 0; }

/* ---------- حقائق البرنامج ---------- */
.facts { display: grid; gap: var(--space-6); margin: 0; }
@media (min-width: 768px) { .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.facts > div { border-top: 1px solid var(--line-strong); padding-top: var(--space-4); }
.facts dt { font-family: var(--font-en); font-size: var(--fs-numeral); font-weight: var(--fw-semibold); color: var(--text-heading); line-height: var(--lh-tight); direction: ltr; unicode-bidi: isolate; text-align: start; font-variant-numeric: tabular-nums; }
.facts dd { margin: var(--space-2) 0 0; font-size: var(--fs-small); color: var(--text-muted); }
.facts-note { font-size: var(--fs-caption); color: var(--text-muted); margin: var(--space-4) 0 0; }

/* ---------- قوائم التعريف ---------- */
.def { display: grid; gap: var(--space-6); margin: 0; }
@media (min-width: 768px) { .def { grid-template-columns: 1fr 1fr; } }
.def > div { border-top: 1px solid var(--line-strong); padding-top: var(--space-4); }
.def dt { font-weight: var(--fw-semibold); color: var(--text-heading); font-size: var(--fs-h3); line-height: var(--lh-heading); }
.def dt.en-block { font-size: calc(var(--fs-h3) * .95); }
.def dd { margin: var(--space-2) 0 0; max-width: var(--measure); }

/* ---------- الجلسات ---------- */
.month { border-top: 1px solid var(--line-strong); padding-block: var(--space-5) var(--space-4); }
.month h3 { margin: 0 0 var(--space-2); }
.sessions { list-style: none; margin: 0; padding: 0; }
.sessions li + li { margin: 0; }
.session { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); width: 100%; min-height: 56px; padding: var(--space-3) var(--space-3); text-align: start; background: transparent; border: 0; border-bottom: 1px solid var(--line-subtle); border-radius: var(--radius-s); color: var(--text-body); cursor: pointer; transition: background-color var(--dur-fast); }
.session:hover { background: var(--surface-hover); }
.session .title { font-weight: var(--fw-medium); color: var(--text-heading); }
.session .tag { flex: none; }

/* ---------- الحوار ---------- */
.dialog { border: 0; border-radius: var(--radius-l); padding: 0; width: min(40rem, calc(100% - 2rem)); background: var(--surface-raised); color: var(--text-body); box-shadow: var(--shadow-overlay); }
.dialog::backdrop { background: rgba(28, 18, 22, .55); }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-4); padding: var(--space-6) var(--space-6) 0; }
.dialog-head h2 { margin: 0; font-size: var(--fs-h3); }
.dialog-body { padding: var(--space-4) var(--space-6) var(--space-6); }
.dialog-body .meta { color: var(--text-muted); font-size: var(--fs-small); margin-bottom: var(--space-4); }
.dialog-body table { margin: var(--space-5) 0; }
.dialog-body th { width: 30%; }
.btn-close { position: relative; flex: none; width: 44px; height: 44px; margin: -8px -8px 0 0; background: transparent; border: 0; border-radius: var(--radius-s); color: var(--text-heading); cursor: pointer; }
.btn-close::before, .btn-close::after { content: ""; position: absolute; left: 50%; top: 50%; width: 1.125rem; height: 2px; background: currentColor; transform: translate(-50%, -50%) rotate(45deg); }
.btn-close::after { transform: translate(-50%, -50%) rotate(-45deg); }
.btn-close:hover { background: var(--surface-hover); }

/* ---------- النماذج ---------- */
.form { display: grid; gap: var(--space-5); }
.field { display: grid; gap: var(--space-2); }
.field > label, .field legend { font-weight: var(--fw-medium); color: var(--text-heading); padding: 0; }
.field .hint { font-size: var(--fs-caption); color: var(--text-muted); margin: 0; }
.req { color: var(--state-error); font-weight: var(--fw-semibold); margin-inline-start: .2em; }
.input { width: 100%; min-height: var(--control-h); padding: .65rem 1rem; line-height: 1.5; color: var(--text-body); background: var(--surface-raised); border: var(--control-border-w) solid var(--line-control); border-radius: var(--radius-s); transition: border-color var(--dur-fast); }
textarea.input { min-height: 8rem; resize: vertical; }
.input::placeholder { color: var(--text-muted); opacity: 1; }
.input:hover { border-color: var(--cld-burgundy); }
.input:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; border-color: var(--cld-burgundy); border-radius: var(--radius-s); }
.input[aria-invalid="true"] { border-color: var(--state-error); border-width: 2px; }
.input:disabled { background: var(--surface-stone-soft); color: var(--text-disabled); border-color: var(--line-subtle); cursor: not-allowed; }
.field .error { font-size: var(--fs-small); color: var(--state-error); font-weight: var(--fw-medium); margin: 0; }
.field .error:empty { display: none; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.choices { display: grid; gap: var(--space-3); }
@media (min-width: 480px) { .choices { grid-template-columns: 1fr 1fr; } }
.choice { display: flex; gap: var(--space-3); align-items: flex-start; min-height: 44px; padding: var(--space-3) var(--space-4); background: var(--surface-raised); border: var(--control-border-w) solid var(--line-subtle); border-radius: var(--radius-s); cursor: pointer; transition: border-color var(--dur-fast); }
.choice:hover { border-color: var(--line-control); }
.choice:has(input:checked) { border-color: var(--cld-burgundy); }
.choice:has(input:focus-visible) { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.choice input { width: 1.25rem; height: 1.25rem; margin: .2rem 0 0; accent-color: var(--cld-burgundy); flex: none; }
.choice input:focus-visible { outline: none; }
.choice span { line-height: 1.5; }
.form-actions { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }

/* ---------- التنبيهات ---------- */
.notice { display: grid; gap: var(--space-2); padding: var(--space-4) var(--space-5); background: var(--surface-raised); border: var(--control-border-w) solid var(--line-strong); border-radius: var(--radius-m); color: var(--text-body); }
.notice strong { display: block; color: var(--text-heading); }
.notice ul { margin: 0; }
.notice-success { border-color: var(--state-success); }
.notice-success strong { color: var(--state-success); }
.notice-error { border-color: var(--state-error); }
.notice-error strong { color: var(--state-error); }
.notice:focus-visible { outline-offset: 2px; }

/* ---------- الأسئلة الشائعة ---------- */
.faq { border-top: 1px solid var(--line-strong); }
.faq details { border-bottom: 1px solid var(--line-strong); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); padding: var(--space-4) var(--space-1); min-height: 56px; font-weight: var(--fw-medium); color: var(--text-heading); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: .875rem; height: .875rem; background: linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat, linear-gradient(currentColor, currentColor) center / 2px 100% no-repeat; transition: transform var(--dur-base) var(--ease-out); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:hover { background: var(--surface-hover); }
.faq summary:focus-visible { outline-offset: -2px; }
.faq .answer { padding: 0 var(--space-1) var(--space-5); max-width: var(--measure); }

/* ---------- التذييل ---------- */
.site-footer { border-top: 1px solid var(--line-strong); padding-block: var(--space-8) var(--space-6); }
.site-footer .cols { display: grid; gap: var(--space-7); }
@media (min-width: 768px) { .site-footer .cols { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer .logo.lg-v { height: 6rem; width: auto; color: var(--text-heading); margin-bottom: var(--space-4); }
.site-footer h2 { font-size: var(--fs-body); font-weight: var(--fw-medium); margin-bottom: var(--space-3); }
.site-footer nav ul { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-2); }
.site-footer nav a { color: var(--text-body); text-decoration: none; }
.site-footer nav a:hover { text-decoration: underline; }
.site-footer .legal { margin-top: var(--space-7); padding-top: var(--space-4); border-top: 1px solid var(--line-subtle); font-size: var(--fs-small); color: var(--text-muted); display: flex; flex-wrap: wrap; gap: var(--space-4); justify-content: space-between; }

[hidden] { display: none !important; }
.facts dt { text-align: end; }
.btn-close { margin: 0; margin-block-start: -8px; margin-inline-end: -8px; }
