/* «اللافتة الإعلانية» — rotating promo row on the public home (2026-11-21).
   Colours come from the token bridge (--t-c-*), so dark, light and custom follow the theme.
   Logical properties only (RTL / LTR). Template: templates/components/home_promo.html. */
.hp-banner {
  --hp-text: rgb(var(--t-c-f4f8fa));
  --hp-soft: rgb(var(--t-c-a9bcc8));
  --hp-line: rgba(var(--t-c-7dd3c0), 0.16);
  --hp-surface: linear-gradient(135deg, rgba(var(--t-c-081821), 0.94), rgba(var(--t-c-030c14), 0.97));
  --hp-tone: var(--t-c-2dd4bf);
  --hp-duration: 7000ms;
  position: relative;
  overflow: hidden;
  border-radius: clamp(1.1rem, 2vw, 1.6rem);
  transition: max-height 420ms cubic-bezier(.4, 0, .2, 1), opacity 300ms ease, margin 420ms ease;
}
.hp-banner[hidden] { display: none !important; }
.hp-tone-teal, .hp-banner[data-tone="teal"] { --hp-tone: var(--t-c-2dd4bf); }
.hp-tone-sky, .hp-banner[data-tone="sky"] { --hp-tone: var(--t-c-38bdf8); }
.hp-tone-violet, .hp-banner[data-tone="violet"] { --hp-tone: var(--t-c-a78bfa); }
.hp-tone-amber, .hp-banner[data-tone="amber"] { --hp-tone: var(--t-c-fbbf24); }
.hp-tone-rose, .hp-banner[data-tone="rose"] { --hp-tone: var(--t-c-fb7185); }

.hp-banner__frame {
  position: relative;
  isolation: isolate;
  display: grid;
  gap: 0.9rem;
  padding: clamp(1.15rem, 3vw, 2rem) clamp(1.15rem, 3.4vw, 2.4rem);
  border: 1px solid rgba(var(--hp-tone), 0.32);
  border-radius: inherit;
  background: var(--hp-surface);
  box-shadow: 0 26px 60px -42px rgba(var(--hp-tone), 0.55);
  color: var(--hp-text);
  transition: border-color 500ms ease, box-shadow 500ms ease;
}
.hp-banner__glow {
  position: absolute;
  inset: -40% -10% auto auto;
  z-index: -1;
  width: min(520px, 70%);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--hp-tone), 0.22), transparent 65%);
  transition: background 600ms ease;
  animation: hp-drift 14s ease-in-out infinite alternate;
  pointer-events: none;
}
[dir="rtl"] .hp-banner__glow { inset: -40% auto auto -10%; }
@keyframes hp-drift { to { transform: translate3d(-6%, 10%, 0) scale(1.08); } }

.hp-banner__slides { display: grid; min-height: 7.5rem; }
.hp-slide {
  grid-area: 1 / 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 1.25rem;
  animation: hp-in 520ms cubic-bezier(.2, .8, .2, 1) both;
}
.hp-slide[hidden] { display: none; }
@keyframes hp-in { from { opacity: 0; transform: translate3d(0, 10px, 0); } to { opacity: 1; transform: none; } }
@media (min-width: 760px) {
  .hp-slide--image { grid-template-columns: minmax(0, 1fr) minmax(180px, 32%); }
}
.hp-slide__copy { display: grid; justify-items: start; gap: 0.55rem; min-width: 0; padding-inline-end: 2.25rem; }
.hp-slide__kind {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.7rem;
  border: 1px solid rgba(var(--hp-tone), 0.4);
  border-radius: 999px;
  background: rgba(var(--hp-tone), 0.12);
  color: rgb(var(--hp-tone));
  font-size: 0.78rem;
  font-weight: 800;
}
.hp-slide__kind-icon { display: inline-grid; }
.hp-slide__title {
  margin: 0;
  color: var(--hp-text);
  font-family: "Tajawal", "IBM Plex Sans Arabic", sans-serif;
  font-size: clamp(1.25rem, 2.6vw, 1.9rem);
  font-weight: 900;
  line-height: 1.35;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.hp-slide__text { margin: 0; max-width: 62ch; color: var(--hp-soft); font-size: clamp(0.9rem, 1.4vw, 1rem); line-height: 1.75; }
.hp-slide__cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  margin-top: 0.35rem;
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  background: rgb(var(--hp-tone));
  color: rgb(var(--t-c-04141c));
  font-weight: 900;
  text-decoration: none;
  box-shadow: 0 14px 30px -18px rgba(var(--hp-tone), 0.9);
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}
.hp-slide__cta:hover { transform: translateY(-1px); filter: brightness(1.06); }
.hp-slide__cta:focus-visible { outline: 3px solid rgb(var(--hp-tone)); outline-offset: 3px; }
.hp-slide__arrow { transition: transform 180ms ease; }
.hp-slide__cta:hover .hp-slide__arrow { transform: translateX(3px); }
[dir="rtl"] .hp-slide__arrow { transform: scaleX(-1); }
[dir="rtl"] .hp-slide__cta:hover .hp-slide__arrow { transform: scaleX(-1) translateX(3px); }
.hp-slide__media { display: none; }
/* without a picture: a large tone mark on the end side (wide screens only) */
.hp-slide__art { display: none; }
@media (min-width: 760px) {
  .hp-slide:not(.hp-slide--image) { grid-template-columns: minmax(0, 1fr) auto; }
  .hp-slide__art {
    display: grid;
    place-items: center;
    width: clamp(7rem, 12vw, 9.5rem);
    aspect-ratio: 1;
    margin-inline-end: 2.5rem;
    border: 1px solid rgba(var(--hp-tone), 0.35);
    border-radius: 2rem;
    background: radial-gradient(circle at 30% 25%, rgba(var(--hp-tone), 0.3), rgba(var(--hp-tone), 0.06) 70%);
    color: rgb(var(--hp-tone));
    transform: rotate(-6deg);
    box-shadow: 0 24px 50px -30px rgba(var(--hp-tone), 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    animation: hp-float 6s ease-in-out infinite alternate;
  }
  [dir="rtl"] .hp-slide__art { transform: rotate(6deg); }
  .hp-banner .hp-slide__art svg { display: block; width: 46%; height: 46%; }
}
@keyframes hp-float { to { translate: 0 -6px; } }
@media (min-width: 760px) {
  .hp-slide__media { display: block; overflow: hidden; border: 1px solid var(--hp-line); border-radius: 1rem; aspect-ratio: 16 / 9; }
  .hp-slide__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
}

/* controls */
.hp-banner__controls { display: flex; align-items: center; gap: 0.45rem; }
.hp-ctrl, .hp-close {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--hp-line);
  border-radius: 999px;
  background: rgba(var(--t-c-020a12), 0.35);
  color: var(--hp-text);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}
.hp-ctrl:hover, .hp-close:hover { border-color: rgba(var(--hp-tone), 0.6); background: rgba(var(--hp-tone), 0.14); }
.hp-ctrl:focus-visible, .hp-close:focus-visible, .hp-dot:focus-visible { outline: 2px solid rgb(var(--hp-tone)); outline-offset: 2px; }
[dir="rtl"] .hp-ctrl__prev, [dir="rtl"] .hp-ctrl__next { transform: scaleX(-1); }
/* the home's own svg rules are stronger than one class: scope to the banner */
.hp-banner .hp-ctrl .hp-ctrl__play { display: none; }
.hp-banner .hp-ctrl[aria-pressed="true"] .hp-ctrl__pause { display: none; }
.hp-banner .hp-ctrl[aria-pressed="true"] .hp-ctrl__play { display: block; }
.hp-close { position: absolute; inset-block-start: 0.8rem; inset-inline-end: 0.8rem; z-index: 2; }

.hp-dots { display: flex; align-items: center; gap: 0.35rem; }
.hp-dot {
  position: relative;
  overflow: hidden;
  width: 22px;
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(var(--t-c-94a3b8), 0.3);
  cursor: pointer;
  transition: width 260ms ease;
}
/* bigger touch target without a bigger dot */
.hp-dot::before { content: ""; position: absolute; inset: -12px -4px; }
.hp-dot[aria-current="true"] { width: 44px; }
.hp-dot__fill { position: absolute; inset: 0; background: rgb(var(--hp-tone)); transform: scaleX(0); transform-origin: inline-start; }
.hp-dot[aria-current="true"] .hp-dot__fill { transform: scaleX(1); }
.hp-banner.is-rotating .hp-dot[aria-current="true"] .hp-dot__fill { animation: hp-fill var(--hp-duration) linear both; }
.hp-banner.is-paused .hp-dot[aria-current="true"] .hp-dot__fill { animation-play-state: paused; }
[dir="rtl"] .hp-dot__fill { transform-origin: right; }
[dir="ltr"] .hp-dot__fill { transform-origin: left; }
@keyframes hp-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* closing: the row folds away and the blocks below move back up */
.hp-banner.is-closing { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .hp-banner, .hp-banner__frame, .hp-slide, .hp-banner__glow, .hp-dot, .hp-slide__cta, .hp-slide__arrow, .hp-slide__art { animation: none !important; transition: none !important; }
}

/* light theme: dark text on the tone button, softer surface */
[data-theme="light"] .hp-banner {
  --hp-surface: linear-gradient(120deg, #ffffff 35%, rgba(var(--hp-tone), 0.14));
  --hp-line: rgba(var(--hp-tone), 0.28);
}
[data-theme="light"] .hp-slide__cta { color: #fff; }
[data-theme="light"] :is(.hp-ctrl, .hp-close) { background: rgba(255, 255, 255, 0.7); }
@media (prefers-color-scheme: light) {
  [data-theme="system"] .hp-banner {
    --hp-surface: linear-gradient(120deg, #ffffff 35%, rgba(var(--hp-tone), 0.14));
    --hp-line: rgba(var(--hp-tone), 0.28);
  }
  [data-theme="system"] .hp-slide__cta { color: #fff; }
  [data-theme="system"] :is(.hp-ctrl, .hp-close) { background: rgba(255, 255, 255, 0.7); }
}

/* dashboard preview */
.hp-banner--preview { margin-block: 0.5rem 1rem; }
