/* ==========================================================================
   عرض تقديمي — مواقعي في مادة بناء ونشر المواقع
   تنسيق عربي RTL — شرائح بملء الشاشة + قواعد طباعة A4 أفقي
   ========================================================================== */

:root {
  --color-bg: #f4ecdf;
  --color-bg-soft: #ede0d0;
  --color-surface: #fffaf3;
  --color-surface-soft: #fbf4ea;
  --color-brown-900: #382114;
  --color-brown-800: #4a2d1b;
  --color-brown-700: #5f3b25;
  --color-brown-600: #7b4e33;
  --color-brown-500: #966746;
  --color-tan: #c9a98a;
  --color-line: #e2d1bd;
  --color-muted: #765744;
  --color-accent: #a85f36;
  --color-cream: #fffaf3;
  --color-shadow: rgba(74, 45, 27, 0.16);
  --font-main: "Cairo", "Segoe UI", Tahoma, "Noto Kufi Arabic", sans-serif;
  --radius-md: 0.9rem;
  --radius-lg: 1.35rem;
  --transition: 200ms ease;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  direction: rtl;
  text-align: right;
  font-family: var(--font-main);
  font-size: 1rem;
  color: var(--color-brown-900);
  background:
    radial-gradient(circle at 88% 10%, rgba(201, 169, 138, 0.38), transparent 34rem),
    radial-gradient(circle at 8% 92%, rgba(150, 103, 70, 0.18), transparent 30rem),
    linear-gradient(135deg, #f8f1e7 0%, var(--color-bg) 52%, var(--color-bg-soft) 100%);
}

img {
  max-width: 100%;
}

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

/* --------------------------------------------------------------------------
   هيكل العرض: شريحة واحدة ظاهرة في كل وقت
   -------------------------------------------------------------------------- */

.deck {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

.slide {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  font-size: clamp(1.15rem, 0.85rem + 1.45vw, 1.75rem);
  line-height: 1.72;
  transition:
    opacity var(--transition),
    visibility 0s linear var(--transition);
}

.slide::before {
  content: "";
  position: absolute;
  inset: 1.15rem;
  z-index: -1;
  border: 1px solid rgba(150, 103, 70, 0.18);
  border-radius: 1.7rem;
  pointer-events: none;
}

.slide.is-active {
  z-index: 2;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition: opacity var(--transition);
}

.slide-inner {
  display: flex;
  flex-direction: column;
  gap: clamp(0.55rem, 1.15vh, 0.95rem);
  width: min(1180px, 100%);
  margin: auto;
  padding:
    clamp(2.25rem, 5vh, 4.25rem)
    clamp(1.35rem, 5vw, 4.75rem)
    clamp(6.25rem, 10vh, 8rem);
}

.slide-inner > *,
.project-body > * {
  margin: 0;
}

.slide-inner-center {
  align-items: center;
  max-width: 1000px;
  text-align: center;
}

.slide-cover .slide-inner {
  max-width: 1000px;
}

/* --------------------------------------------------------------------------
   الخطوط والعناصر النصية
   -------------------------------------------------------------------------- */

.eyebrow {
  align-self: flex-start;
  display: inline-block;
  padding: 0.18em 0.85em;
  border: 1px solid rgba(150, 103, 70, 0.28);
  border-radius: 999px;
  color: var(--color-brown-700);
  background: rgba(168, 95, 54, 0.09);
  font-size: 0.72em;
  font-weight: 700;
  line-height: 1.65;
}

.slide-inner-center .eyebrow {
  align-self: center;
}

.slide-title {
  margin: 0;
  color: var(--color-brown-900);
  font-size: clamp(2rem, 3.5vw, 3.15rem);
  font-weight: 800;
  line-height: 1.3;
  text-wrap: balance;
}

.slide-cover .slide-title {
  max-width: 24ch;
  font-size: clamp(2.4rem, 4.8vw, 4.2rem);
  line-height: 1.22;
}

.slide-lead {
  max-width: 64ch;
  color: var(--color-muted);
  font-size: 1em;
  line-height: 1.8;
}

.slide-cover .slide-lead {
  max-width: 52ch;
  font-size: 1.04em;
}

.slide-sub {
  color: var(--color-brown-700);
  font-weight: 700;
}

strong {
  color: var(--color-brown-800);
  font-weight: 800;
}

.author-name {
  color: var(--color-accent);
  font-size: 1.2em;
  font-weight: 800;
  line-height: 1.4;
}

.slide-cover .author-name {
  margin-top: 0.4em;
  font-size: 1.35em;
}

/* --------------------------------------------------------------------------
   القوائم
   -------------------------------------------------------------------------- */

.points {
  display: flex;
  flex-direction: column;
  gap: 0.55em;
  margin: 0;
  padding: 0;
  list-style: none;
}

.points li {
  position: relative;
  padding-inline-start: 1.45em;
}

.points li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0.15em;
  top: 0.72em;
  width: 0.42em;
  height: 0.42em;
  border-radius: 50%;
  background: var(--color-accent);
}

.points-numbered {
  counter-reset: point;
  gap: 0.85em;
}

.points-numbered li {
  padding-inline-start: 2.15em;
  counter-increment: point;
}

.points-numbered li::before {
  content: counter(point);
  display: grid;
  place-items: center;
  top: 0.08em;
  width: 1.55em;
  height: 1.55em;
  border-radius: 50%;
  color: var(--color-cream);
  background: var(--color-brown-700);
  font-size: 0.78em;
  font-weight: 800;
  line-height: 1;
}

.note {
  max-width: 82ch;
  margin-top: 0.35em;
  padding: 0.7em 1em;
  border: 1px solid var(--color-line);
  border-inline-start: 5px solid var(--color-brown-500);
  border-radius: 0.8rem;
  color: var(--color-muted);
  background: rgba(255, 250, 243, 0.82);
  font-size: 0.84em;
  line-height: 1.75;
}

.slide-inner-center .note {
  text-align: center;
  border-inline-start-width: 1px;
  border-top: 4px solid var(--color-brown-500);
}

/* --------------------------------------------------------------------------
   شرائح المشاريع
   -------------------------------------------------------------------------- */

.project-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.84fr) minmax(0, 1.16fr);
  align-items: center;
  gap: clamp(1.5rem, 3.6vw, 3.75rem);
  width: 100%;
}

.project-body {
  display: flex;
  flex-direction: column;
  gap: clamp(0.65rem, 1.2vh, 1rem);
  min-width: 0;
}

.project-thumb {
  align-self: center;
  margin: 0;
  padding: 0.55rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  box-shadow:
    0 1.4rem 2.8rem rgba(74, 45, 27, 0.14),
    0 0.2rem 0.55rem rgba(74, 45, 27, 0.06);
}

.project-thumb img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(64vh, 620px);
  margin-inline: auto;
  border-radius: var(--radius-md);
  background: var(--color-surface-soft);
  object-fit: contain;
}

.badge {
  align-self: flex-start;
  display: inline-block;
  padding: 0.18em 0.8em;
  border-radius: 999px;
  color: var(--color-cream);
  background: var(--color-brown-600);
  font-size: 0.68em;
  font-weight: 700;
  line-height: 1.65;
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55em;
  margin-top: 0.3em;
}

/* --------------------------------------------------------------------------
   الأزرار والروابط
   -------------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45em;
  min-height: 2.65em;
  max-width: 100%;
  padding: 0.42em 1em;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.84em;
  font-weight: 700;
  line-height: 1.6;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 180ms ease,
    color 180ms ease,
    border-color 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease;
}

.btn svg {
  flex: 0 0 auto;
  width: 1.1em;
  height: 1.1em;
}

.btn-primary {
  color: var(--color-cream);
  background: var(--color-brown-700);
  border-color: var(--color-brown-700);
  box-shadow: 0 0.4rem 1rem rgba(74, 45, 27, 0.18);
}

.btn-primary:hover {
  background: var(--color-brown-600);
  border-color: var(--color-brown-600);
  transform: translateY(-2px);
  box-shadow: 0 0.6rem 1.3rem rgba(74, 45, 27, 0.22);
}

.btn-outline {
  color: var(--color-brown-700);
  background: transparent;
  border-color: var(--color-brown-600);
}

.btn-outline:hover {
  color: var(--color-cream);
  background: var(--color-brown-700);
  border-color: var(--color-brown-700);
  transform: translateY(-2px);
}

.btn-ghost {
  max-width: 100%;
  color: var(--color-brown-600);
  background: rgba(255, 250, 243, 0.72);
  border-color: var(--color-line);
  font-size: 0.7em;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.btn-ghost:hover {
  color: var(--color-brown-800);
  background: var(--color-surface);
  border-color: var(--color-tan);
}

.btn:focus-visible,
.btn-nav:focus-visible,
.nav-arrow:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
}

.link-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6em;
  margin: 0.25em 0;
  padding: 0;
  list-style: none;
}

/* --------------------------------------------------------------------------
   التنقل: الأسهم الجانبية + شريط التحكم + شريط التقدم
   -------------------------------------------------------------------------- */

.nav-arrow {
  position: fixed;
  top: 50%;
  z-index: 55;
  display: grid;
  place-items: center;
  width: 3.35rem;
  height: 3.35rem;
  padding: 0;
  border: 1px solid rgba(150, 103, 70, 0.28);
  border-radius: 50%;
  color: var(--color-brown-700);
  background: rgba(255, 250, 243, 0.86);
  box-shadow: 0 0.55rem 1.5rem rgba(74, 45, 27, 0.14);
  backdrop-filter: blur(10px);
  cursor: pointer;
  transform: translateY(-50%);
  transition:
    background-color 180ms ease,
    color 180ms ease,
    transform 180ms ease,
    opacity 180ms ease;
}

.nav-arrow svg {
  width: 1.45rem;
  height: 1.45rem;
}

.nav-arrow:hover:not(:disabled) {
  color: var(--color-cream);
  background: var(--color-brown-700);
  transform: translateY(-50%) scale(1.06);
}

.nav-arrow:disabled {
  opacity: 0.32;
  cursor: not-allowed;
  box-shadow: none;
}

/* في RTL: زر «السابق» على اليمين، وزر «التالي» على اليسار */
.nav-prev {
  right: clamp(0.7rem, 2.1vw, 1.9rem);
}

.nav-next {
  left: clamp(0.7rem, 2.1vw, 1.9rem);
}

.deck-bar {
  position: fixed;
  bottom: clamp(0.8rem, 2vh, 1.4rem);
  left: 50%;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  max-width: calc(100vw - 1.5rem);
  padding: 0.32rem 0.42rem;
  border: 1px solid var(--color-line);
  border-radius: 999px;
  background: rgba(255, 250, 243, 0.93);
  box-shadow: 0 0.75rem 2rem rgba(74, 45, 27, 0.16);
  backdrop-filter: blur(12px);
  transform: translateX(-50%);
}

.btn-nav {
  min-height: 2.75rem;
  padding: 0.5rem 0.85rem;
  border: 0;
  border-radius: 999px;
  color: var(--color-brown-700);
  background: transparent;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 180ms ease,
    color 180ms ease,
    opacity 180ms ease;
}

.btn-nav:hover:not(:disabled) {
  color: var(--color-brown-900);
  background: rgba(201, 169, 138, 0.28);
}

.btn-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.slide-counter {
  padding-inline: 0.35rem;
  color: var(--color-brown-700);
  font-size: 0.93rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  direction: ltr;
  unicode-bidi: isolate;
}

.btn-fullscreen {
  border: 1px solid var(--color-line);
  background: rgba(237, 224, 208, 0.7);
}

.progress {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 70;
  height: 5px;
  overflow: hidden;
  background: rgba(74, 45, 27, 0.12);
  pointer-events: none;
}

.progress-fill {
  width: 12.5%;
  height: 100%;
  border-start-end-radius: 999px;
  border-end-end-radius: 999px;
  background: linear-gradient(to left, var(--color-brown-700), var(--color-accent), var(--color-tan));
  transition: width var(--transition);
}

/* --------------------------------------------------------------------------
   الشاشات المتوسطة والصغيرة
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .slide::before {
    inset: 0.65rem;
    border-radius: 1.15rem;
  }

  .slide-inner {
    padding-top: clamp(1.8rem, 4vh, 3rem);
    padding-bottom: 6.5rem;
  }

  .project-layout {
    grid-template-columns: 1fr;
    gap: 1.1rem;
  }

  .project-thumb {
    width: min(100%, 430px);
    margin-inline: auto;
    padding: 0.4rem;
  }

  .project-thumb img {
    max-height: 34vh;
  }

  .slide-title {
    font-size: clamp(1.85rem, 5.5vw, 2.6rem);
  }

  .slide-cover .slide-title {
    font-size: clamp(2.05rem, 7vw, 3.1rem);
  }

  .nav-arrow {
    display: none;
  }
}

@media (max-width: 600px) {
  .slide {
    font-size: clamp(1.05rem, 0.82rem + 1.7vw, 1.35rem);
    line-height: 1.68;
  }

  .slide-inner {
    gap: 0.5rem;
    padding-inline: 1.2rem;
  }

  .project-thumb img {
    max-height: 30vh;
  }

  .deck-bar {
    bottom: 0.7rem;
    gap: 0.1rem;
    padding: 0.28rem 0.32rem;
  }

  .btn-nav {
    min-height: 2.6rem;
    padding: 0.45rem 0.55rem;
    font-size: 0.78rem;
  }

  .slide-counter {
    padding-inline: 0.2rem;
    font-size: 0.82rem;
  }

  .btn-fullscreen {
    padding-inline: 0.5rem;
  }

  .btn {
    font-size: 0.86em;
  }

  .btn-ghost {
    font-size: 0.7em;
  }

  .note {
    font-size: 0.82em;
  }
}

@media (max-height: 650px) and (min-width: 901px) {
  .slide-inner {
    padding-top: 1.75rem;
    padding-bottom: 5.8rem;
  }

  .project-thumb img {
    max-height: 58vh;
  }

  .slide-title {
    font-size: clamp(1.8rem, 3vw, 2.5rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* --------------------------------------------------------------------------
   الطباعة إلى PDF — A4 أفقي، شريحة واحدة لكل صفحة
   -------------------------------------------------------------------------- */

@page {
  size: A4 landscape;
  margin: 0;
}

@media print {
  html,
  body {
    width: 297mm;
    height: auto;
    overflow: visible !important;
    background: var(--color-bg) !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .deck {
    position: static;
    overflow: visible;
  }

  .slide {
    position: relative;
    inset: auto;
    display: flex;
    width: 297mm;
    height: 210mm;
    min-height: 210mm;
    max-height: 210mm;
    overflow: hidden;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    font-size: 11pt;
    line-height: 1.55;
    background: transparent;
    break-after: page;
    page-break-after: always;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .slide:last-of-type {
    break-after: auto;
    page-break-after: auto;
  }

  .slide::before {
    display: none;
  }

  .slide-inner {
    width: 100%;
    max-width: none;
    gap: 3.5mm;
    padding: 10mm 13mm;
  }

  .slide-title {
    font-size: 25pt;
    line-height: 1.25;
  }

  .slide-cover .slide-title {
    font-size: 34pt;
  }

  .slide-lead {
    font-size: 12pt;
    line-height: 1.6;
  }

  .slide-cover .slide-lead {
    font-size: 13pt;
  }

  .points {
    gap: 2.2mm;
    font-size: 10.5pt;
  }

  .points-numbered {
    gap: 3.2mm;
  }

  .note {
    padding: 3mm 4mm;
    font-size: 9pt;
    line-height: 1.55;
  }

  .badge {
    font-size: 8.5pt;
  }

  .btn {
    min-height: 0;
    padding: 1.6mm 3.2mm;
    font-size: 9pt;
  }

  .btn-ghost {
    font-size: 8pt;
  }

  .project-layout {
    gap: 9mm;
  }

  .project-thumb {
    padding: 2mm;
    box-shadow: none;
  }

  .project-thumb img {
    max-height: 138mm;
  }

  .project-body {
    gap: 3mm;
  }

  .nav-arrow,
  .deck-bar,
  .progress {
    display: none !important;
  }

  .project-layout,
  .project-thumb,
  .project-body,
  .note,
  .points li {
    break-inside: avoid;
    page-break-inside: avoid;
  }

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