/* ==========================================================================
   Haj Nimr Tamimi — Design System
   Brand: Deep Navy (#0B2A4A), Sky Blue (#1E88C7), Gold Accent (#D4AF37)
   ========================================================================== */

:root {
  --color-primary: #0B2A4A;
  --color-secondary: #1E88C7;
  --color-accent: #D4AF37;
  --color-bg: #F7F9FC;
  --color-surface: #FFFFFF;
  --color-text: #1A2333;
  --color-text-muted: #5B6B82;
  --radius-lg: 20px;
  --radius-md: 12px;
  --shadow-soft: 0 10px 40px -10px rgba(11, 42, 74, 0.15);
  --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --color-bg: #0A1420;
  --color-surface: #101C2E;
  --color-text: #EAF1F8;
  --color-text-muted: #9AAAC0;
  --shadow-soft: 0 10px 40px -10px rgba(0, 0, 0, 0.5);
}

html, body {
  background: var(--color-bg);
  color: var(--color-text);
  scroll-behavior: smooth;
  /* Defensive guard against any accidental layout overflow (e.g. an
     off-canvas element positioned with a physical left/right offset)
     causing a phantom horizontal scrollbar — this is especially risky in
     RTL documents where such offsets can put content on the wrong side
     and make the whole page horizontally scrollable. */
  overflow-x: hidden;
  max-width: 100vw;
}

/* Respect users who prefer less motion — disable/shorten all decorative
   animations without touching layout, per WCAG best practice. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------------- Scroll progress bar ---------------- */
#scroll-progress-bar {
  position: fixed;
  top: 0; inset-inline-start: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--color-accent), var(--color-secondary));
  z-index: 10000;
  transition: width 0.1s ease-out;
  box-shadow: 0 0 8px rgba(212,175,55,.6);
}

/* ---------------- Glassmorphism ---------------- */
.glass {
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.35);
}
[data-theme="dark"] .glass {
  background: rgba(16, 28, 46, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.glass-nav {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(14px) saturate(150%);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  border-bottom: 1px solid rgba(11, 42, 74, 0.06);
}
[data-theme="dark"] .glass-nav {
  background: rgba(10, 20, 32, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* ---------------- Gradients ---------------- */
.gradient-brand {
  background: linear-gradient(135deg, var(--color-primary) 0%, #14406b 55%, var(--color-secondary) 100%);
}
.gradient-gold-text {
  background: linear-gradient(90deg, var(--color-accent), #f3d878);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.gradient-overlay {
  background: linear-gradient(180deg, rgba(11,42,74,0.15) 0%, rgba(11,42,74,0.85) 100%);
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .75rem 1.75rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  transition: var(--transition-base);
  white-space: nowrap;
}
.btn-primary {
  background: var(--color-primary);
  color: #fff;
}
.btn-primary:hover { background: #0e355e; transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.btn-accent {
  background: var(--color-accent);
  color: var(--color-primary);
}
.btn-accent:hover { background: #e0bd4c; transform: translateY(-2px); box-shadow: var(--shadow-soft); }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--color-primary);
  color: var(--color-primary);
}
[data-theme="dark"] .btn-outline { border-color: #EAF1F8; color: #EAF1F8; }
.btn-outline:hover { background: var(--color-primary); color: #fff; }
/* Distinctive store CTA (homepage hero + header): pill-shaped (unlike the
   rectangular .btn-accent/.btn-outline beside it) with a gold breathing
   glow ring, so it's unmistakably "the store button" at a glance. */
.btn-store {
  background: var(--color-accent);
  color: #0b2a4a;
  border-radius: 999px;
  animation: store-pill-breathe 2.6s ease-in-out infinite;
}
.btn-store:hover { background: #e0bd4c; transform: translateY(-2px); box-shadow: var(--shadow-soft); animation-play-state: paused; }
.btn-store i { transition: transform .3s ease; }
.btn-store:hover i { transform: scale(1.15) rotate(-6deg); }
@media (prefers-reduced-motion: reduce) {
  .btn-store { animation: none; }
}

/* ---------------- Reveal on scroll ---------------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: .1s; }
.reveal-delay-2 { transition-delay: .2s; }
.reveal-delay-3 { transition-delay: .3s; }
.reveal-delay-4 { transition-delay: .4s; }

/* ---------------- Animations ---------------- */
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.animate-float { animation: float 6s ease-in-out infinite; }

@keyframes pulse-soft { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
.animate-pulse-soft { animation: pulse-soft 2.5s ease-in-out infinite; }

@keyframes skeleton-shine {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, #e9edf3 25%, #f5f7fa 37%, #e9edf3 63%);
  background-size: 200% 100%;
  animation: skeleton-shine 1.4s ease infinite;
}

/* ---------------- Nav link underline ---------------- */
.nav-link { position: relative; padding-bottom: 4px; }
.nav-link::after {
  content: '';
  position: absolute;
  right: 0; left: 0; bottom: 0;
  height: 2px;
  background: var(--color-accent);
  transform: scaleX(0);
  transition: transform .3s ease;
}
.nav-link:hover::after, .nav-link.active::after { transform: scaleX(1); }

/* ---------------- Nav dropdown (grouped header links) ---------------- */
.nav-dropdown { transform-origin: top center; }

/* ---------------- Badges ---------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .2rem .65rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
}
.badge-gold { background: rgba(212,175,55,.15); color: #a9821f; }
.badge-blue { background: rgba(30,136,199,.12); color: var(--color-secondary); }
.badge-placeholder { background: rgba(240, 173, 78, .18); color: #a9670c; }
.badge-soon { background: rgba(91,107,130,.15); color: var(--color-text-muted); }

/* ---------------- Hero media mask ---------------- */
.hero-media-mask {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.hero-media-mask::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11,42,74,0) 40%, rgba(11,42,74,.55) 100%);
  pointer-events: none;
  z-index: 1;
}

/* ---------------- Hero section polish (premium redesign) ---------------- */
.hero-section { isolation: isolate; }
.hero-glow {
  position: absolute;
  border-radius: 999px;
  filter: blur(70px);
  pointer-events: none;
  z-index: 0;
}
.hero-glow-1 {
  width: 420px; height: 420px;
  top: -140px; inset-inline-end: -120px;
  background: radial-gradient(circle, rgba(212,175,55,.35), transparent 70%);
}
.hero-glow-2 {
  width: 360px; height: 360px;
  bottom: -160px; inset-inline-start: -100px;
  background: radial-gradient(circle, rgba(30,136,199,.35), transparent 70%);
}
.hero-media-frame {
  box-shadow: 0 25px 60px -15px rgba(0,0,0,.45), 0 0 0 1px rgba(255,255,255,.12), 0 0 0 10px rgba(255,255,255,.06);
}
.hero-media-frame::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  padding: 2px;
  background: linear-gradient(135deg, var(--color-accent), rgba(255,255,255,.15), var(--color-secondary));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
}
/* Elegant logo fallback (used when no admin slider images exist yet) */
.hero-logo-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 40%, rgba(255,255,255,.14), rgba(255,255,255,.02) 70%);
  padding: 2.5rem;
}
.hero-logo-img {
  max-width: 78%;
  max-height: 78%;
  width: auto; height: auto;
  object-fit: contain;
  border-radius: 22px;
  background: rgba(255,255,255,.96);
  padding: 1.5rem;
  box-shadow: 0 20px 45px -12px rgba(0,0,0,.5);
}
[data-slide-video] { display: block; }

/* ---------------- Hero slider (animated header images) ---------------- */
.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 1;
  transition: opacity 1.2s ease-in-out;
}
.hero-slide.opacity-0 {
  opacity: 0;
  pointer-events: none;
}
.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero-slide-caption {
  position: absolute;
  inset-inline-start: 0;
  inset-inline-end: 0;
  bottom: 0;
  padding: 1.25rem 1.5rem;
  z-index: 2;
}
.hero-slide-dots {
  position: absolute;
  bottom: 1rem;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: .4rem;
  z-index: 3;
}
[dir="rtl"] .hero-slide-dots { transform: translateX(50%); }
.hero-slide-dot {
  width: .5rem;
  height: .5rem;
  border-radius: 999px;
  background: rgba(255,255,255,.5);
  border: none;
  cursor: pointer;
  transition: var(--transition-base);
  padding: 0;
}
.hero-slide-dot.w-8 {
  width: 2rem;
  background: var(--color-accent);
}

/* ---------------- Gold divider ---------------- */
.divider-gold {
  width: 64px;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--color-accent), #f3d878);
}

/* ---------------- Stat number ---------------- */
.stat-number {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  color: var(--color-primary);
}
[data-theme="dark"] .stat-number { color: #fff; }

/* ---------------- Timeline ---------------- */
/* Base static line (kept as a faint backdrop rail) */
.timeline-line { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(11,42,74,.12); }
[data-theme="dark"] .timeline-line { background: rgba(255,255,255,.12); }

/* Animated dashed "flow" line — like fuel/liquid streaming down the timeline,
   echoing the fuel-station division. Dashed gradient stroke that continuously
   travels downward via background-position animation. */
.timeline-line-flow {
  position: absolute; top: 0; bottom: 0; width: 3px;
  background-image: repeating-linear-gradient(
    to bottom,
    var(--color-accent) 0px,
    var(--color-accent) 10px,
    transparent 10px,
    transparent 20px
  );
  background-size: 100% 40px;
  animation: timeline-flow 1.6s linear infinite;
  filter: drop-shadow(0 0 3px rgba(212,175,55,.55));
}
[data-theme="dark"] .timeline-line-flow { filter: drop-shadow(0 0 4px rgba(212,175,55,.7)); }
@keyframes timeline-flow {
  from { background-position: 0 -40px; }
  to   { background-position: 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .timeline-line-flow { animation: none; background-position: 0 0; }
}

.timeline-dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--color-accent);
  border: 3px solid var(--color-surface);
  box-shadow: 0 0 0 3px rgba(212,175,55,.3);
  position: relative;
  z-index: 1;
}
/* Soft pulsing ring so each milestone dot feels "alive" as the flow passes it */
.timeline-dot::after {
  content: '';
  position: absolute; inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(212,175,55,.55);
  animation: timeline-dot-pulse 2.4s ease-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .timeline-dot::after { animation: none; opacity: 0; }
}
@keyframes timeline-dot-pulse {
  0%   { transform: scale(.6); opacity: .9; }
  70%  { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* ---------------- Aspect ratio helpers ---------------- */
.aspect-4-3 { aspect-ratio: 4/3; }
.aspect-16-9 { aspect-ratio: 16/9; }
.aspect-1-1 { aspect-ratio: 1/1; }

/* ---------------- Accessibility ---------------- */
/* IMPORTANT: use the logical `inset-inline-start` (NOT physical `left`) to
   hide this off-canvas. A hardcoded `left: -999px` sits on the wrong side
   in an RTL document (content flows from the right), which pushed this
   element — and everything after it — into a huge phantom horizontal
   scroll area, breaking access to the header/login and leaving a large
   blank strip on load. `inset-inline-start` correctly resolves to `right`
   in RTL and `left` in LTR, keeping it truly off-canvas either way. */
.skip-link {
  position: absolute; inset-inline-start: -999px; top: 0;
  background: var(--color-primary); color: #fff;
  padding: .5rem 1rem; z-index: 999;
}
.skip-link:focus { inset-inline-start: 0; }
:focus-visible {
  outline: 2px solid var(--color-secondary);
  outline-offset: 2px;
}

/* ---------------- Line clamp ---------------- */
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------------- Marquee (RTL-aware) ---------------- */
/* ---------------- Top news/currency ticker bar ---------------- */
.ticker-viewport, .currency-viewport { position: relative; }
.ticker-track { animation: ticker-scroll 28s linear infinite; }
.currency-track { animation: ticker-scroll 22s linear infinite; }
[dir="rtl"] .ticker-track, [dir="rtl"] .currency-track { animation-name: ticker-scroll-rtl; }
#top-ticker-bar:hover .ticker-track, #top-ticker-bar:hover .currency-track { animation-play-state: paused; }
@keyframes ticker-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes ticker-scroll-rtl { from { transform: translateX(0); } to { transform: translateX(50%); } }
@media (prefers-reduced-motion: reduce) {
  .ticker-track, .currency-track { animation: none; }
}

.marquee-viewport {
  position: relative;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
}
.marquee-track {
  display: flex;
  gap: 3rem;
  animation: marquee-scroll 30s linear infinite;
  width: max-content;
}
.marquee-track:hover { animation-play-state: paused; }
[dir="rtl"] .marquee-track { animation: marquee-scroll-rtl 30s linear infinite; }
@keyframes marquee-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes marquee-scroll-rtl { from { transform: translateX(0); } to { transform: translateX(50%); } }

/* ---------------- Card hover ---------------- */
.card-hover { transition: var(--transition-base); }
.card-hover:hover { transform: translateY(-8px) scale(1.015); box-shadow: 0 20px 45px -12px rgba(11,42,74,.22); }

/* ---------------- Button shimmer (subtle premium sheen on hover) ---------------- */
.btn { position: relative; overflow: hidden; }
.btn::before {
  content: '';
  position: absolute; top: 0; bottom: 0; inset-inline-start: -60%;
  width: 40%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,.35), transparent);
  transform: skewX(-20deg);
  transition: inset-inline-start .6s ease;
  pointer-events: none;
}
.btn:hover::before { inset-inline-start: 130%; }

/* ---------------- Animated gradient text (gold shimmer) ---------------- */
@keyframes gradient-shift { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.gradient-gold-text-animated {
  background: linear-gradient(90deg, var(--color-accent), #f3d878, var(--color-accent));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradient-shift 4s ease infinite;
}

/* ---------------- Glow pulse (livelier hero glows) ---------------- */
@keyframes glow-pulse { 0%,100% { opacity: .55; transform: scale(1); } 50% { opacity: .9; transform: scale(1.12); } }
.hero-glow-1 { animation: glow-pulse 7s ease-in-out infinite; }
.hero-glow-2 { animation: glow-pulse 8s ease-in-out infinite 1.5s; }

/* ---------------- Glowing gold heritage badge ("since 1926" / founding year) ----------------
   A soft breathing glow behind the text plus a periodic light "sparkle" sweep across it,
   like polished gold catching the light — used on the topbar "Since 1926" badge and the
   hero "Founded in 1926" badge. */
.badge-glow {
  position: relative;
  overflow: hidden;
  text-shadow: 0 0 6px rgba(212,175,55,.65), 0 0 14px rgba(212,175,55,.35);
  animation: badge-glow-breathe 3s ease-in-out infinite;
}
.badge-glow i { animation: badge-glow-breathe 3s ease-in-out infinite; }
@keyframes badge-glow-breathe {
  0%, 100% { text-shadow: 0 0 5px rgba(212,175,55,.55), 0 0 10px rgba(212,175,55,.25); }
  50%      { text-shadow: 0 0 10px rgba(212,175,55,.95), 0 0 22px rgba(212,175,55,.55); }
}
.badge-glow::before {
  content: '';
  position: absolute;
  top: 0; bottom: 0; left: -60%;
  width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.85), transparent);
  transform: skewX(-20deg);
  animation: badge-glow-sparkle 3.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes badge-glow-sparkle {
  0%   { left: -60%; opacity: 0; }
  8%   { opacity: .9; }
  20%  { left: 130%; opacity: 0; }
  100% { left: 130%; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .badge-glow, .badge-glow i { animation: none; text-shadow: 0 0 6px rgba(212,175,55,.5); }
  .badge-glow::before { animation: none; opacity: 0; }
}

/* ---------------- Page-load fade-in (smooth navigation feel) ---------------- */
@keyframes page-fade-in { from { opacity: 0; } to { opacity: 1; } }
body { animation: page-fade-in .45s ease; }

/* ---------------- Section icon micro-interaction ---------------- */
.icon-pop { transition: transform .35s cubic-bezier(0.34, 1.56, 0.64, 1); }
.card-hover:hover .icon-pop { transform: scale(1.12) rotate(-4deg); }

/* ---------------- Store nav pill (distinctive, single store icon-button) ---------------- */
.store-nav-pill {
  position: relative;
  animation: store-pill-breathe 2.6s ease-in-out infinite;
}
.store-nav-pill:hover { animation-play-state: paused; }
.store-nav-pill i { transition: transform .3s ease; }
.store-nav-pill:hover i { transform: scale(1.15) rotate(-6deg); }
@keyframes store-pill-breathe {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212,175,55,.55); }
  50%      { box-shadow: 0 0 0 6px rgba(212,175,55,0); }
}
@media (prefers-reduced-motion: reduce) {
  .store-nav-pill { animation: none; }
}

/* ---------------- Link underline sweep (buttons styled as text links) ---------------- */
.link-sweep { position: relative; }
.link-sweep::after {
  content: '';
  position: absolute; bottom: -2px; inset-inline-start: 0;
  width: 100%; height: 1.5px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: inset-inline-end;
  transition: transform .35s ease;
}
.link-sweep:hover::after { transform: scaleX(1); transform-origin: inset-inline-start; }

/* ---------------- Smooth image zoom container ---------------- */
.zoom-media { overflow: hidden; }
.zoom-media img, .zoom-media video { transition: transform .6s cubic-bezier(0.22, 1, 0.36, 1); }
.zoom-media:hover img, .zoom-media:hover video { transform: scale(1.08); }

/* ---------------- Product card ---------------- */
.product-card { background: var(--color-surface); border-radius: var(--radius-md); overflow: hidden; }

/* ---------------- Custom scrollbar ---------------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(11,42,74,.25); border-radius: 8px; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); }

/* ---------------- Rich content prose (page/news/project HTML body) ---------------- */
/* Baseline typographic rhythm for admin-authored HTML content, since the
   project has no Tailwind Typography plugin loaded (CDN build). */
.prose { color: var(--color-text, #1f2937); line-height: 1.85; }
.prose p { margin: 0 0 1.1em; }
.prose h2 { font-size: 1.5em; font-weight: 800; margin: 1.4em 0 .6em; color: var(--color-primary); }
.prose h3 { font-size: 1.25em; font-weight: 700; margin: 1.2em 0 .5em; color: var(--color-primary); }
.prose ul, .prose ol { margin: 0 0 1.1em; padding-inline-start: 1.5em; }
.prose li { margin-bottom: .4em; }
.prose a { color: var(--color-secondary); text-decoration: underline; text-decoration-thickness: 1px; }
.prose blockquote { border-inline-start: 3px solid var(--color-accent); padding-inline-start: 1em; margin: 1.2em 0; color: var(--color-text-muted); font-style: italic; }
.prose img { max-width: 100%; height: auto; border-radius: var(--radius-md); }

/* Content-editor image position/layout classes — applied by the admin rich
   text editor's "إدراج صورة" toolbar so uploaded images can float left/right,
   sit centered, or stretch full-width within the page's prose content. These
   are the classes users pick from the "control image position" feature. */
.prose img.content-img-center { display: block; margin: 1.5em auto; }
.prose img.content-img-full { display: block; width: 100%; margin: 1.5em 0; }
.prose img.content-img-left {
  float: left; margin: 0 1.5em 1em 0; max-width: 45%; shape-outside: margin-box;
}
.prose img.content-img-right {
  float: right; margin: 0 0 1em 1.5em; max-width: 45%; shape-outside: margin-box;
}
.prose img.content-img-small { max-width: 260px; }
.prose img.content-img-medium { max-width: 420px; }
.prose img.content-img-large { max-width: 100%; }
/* Clear the float after a floated image so trailing headings/sections don't
   visually collide with it — matches a manually-inserted <div style="clear:both">
   but is not required since prose paragraphs naturally wrap the float. */
.prose::after { content: ''; display: block; clear: both; }
@media (max-width: 640px) {
  /* On small screens a 45%-width floated image is cramped; drop the float
     so mobile readers always get a clean full-width stacked layout. */
  .prose img.content-img-left, .prose img.content-img-right { float: none; max-width: 100%; margin: 1.2em 0; }
}

/* ---------------- Admin rich text editor (contenteditable) ---------------- */
.richtext-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 6px; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px 10px 0 0; }
.richtext-toolbar button, .richtext-toolbar label[data-rt-image-btn] {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 7px; border: 1px solid transparent;
  color: #475569; font-size: 13px; background: transparent; cursor: pointer;
  transition: background .15s, color .15s;
}
.richtext-toolbar button:hover, .richtext-toolbar label[data-rt-image-btn]:hover { background: #e2e8f0; color: #0f172a; }
.richtext-toolbar button.is-active { background: var(--color-secondary,#1E88C7); color: #fff; }
.richtext-toolbar .rt-sep { width: 1px; height: 22px; background: #e2e8f0; margin: 0 2px; }
.richtext-editor {
  min-height: 220px; max-height: 520px; overflow-y: auto;
  border: 1px solid #e2e8f0; border-top: none; border-radius: 0 0 10px 10px;
  padding: 14px; font-size: 14px; line-height: 1.85; background: #fff;
}
.richtext-editor:focus { outline: none; box-shadow: inset 0 0 0 2px rgba(30,136,199,.25); }
.richtext-editor img { max-width: 100%; border-radius: 8px; cursor: pointer; outline-offset: 2px; }
.richtext-editor img.rt-img-selected { outline: 2px solid var(--color-secondary,#1E88C7); }
.richtext-editor img.content-img-center { display: block; margin: 10px auto; }
.richtext-editor img.content-img-full { display: block; width: 100%; }
.richtext-editor img.content-img-left { float: left; margin: 0 12px 8px 0; max-width: 45%; }
.richtext-editor img.content-img-right { float: right; margin: 0 0 8px 12px; max-width: 45%; }
.richtext-editor img.content-img-small { max-width: 220px; }
.richtext-editor img.content-img-medium { max-width: 380px; }
/* Small floating position/size popover shown under a selected image inside
   the editor, letting the admin change alignment/size without leaving the
   content flow — this is the actual "image position control" UI. */
.rt-img-popover {
  position: absolute; z-index: 40; background: #0f172a; color: #fff;
  border-radius: 10px; padding: 6px; display: flex; gap: 3px; box-shadow: 0 8px 24px rgba(0,0,0,.25);
  font-size: 11px;
}
.rt-img-popover button {
  background: transparent; border: none; color: #cbd5e1; padding: 6px 8px; border-radius: 6px; cursor: pointer; white-space: nowrap;
}
.rt-img-popover button:hover, .rt-img-popover button.is-active { background: rgba(255,255,255,.15); color: #fff; }
