/* JourneyBook — Pharaonic / Egypt tourism experience */
:root {
  --jb-gold: #d4af37;
  --jb-gold-light: #f4d03f;
  --jb-gold-dark: #8b6914;
  --jb-bronze: #6b4f2a;
  --jb-lapis: #1a2744;
  --jb-lapis-mid: #243b55;
  --jb-turquoise: #2dd4bf;
  --jb-sand: #e8dcc4;
  --jb-papyrus: #f7f0e3;
  --jb-ink: #0f1419;
  --jb-muted: #9a8b7a;
  --jb-glass: rgba(26, 39, 68, 0.55);
  --jb-glass-light: rgba(255, 250, 240, 0.08);
  --jb-radius: 16px;
  --jb-font: "DM Sans", system-ui, sans-serif;
  --jb-display: "Cinzel", Georgia, serif;
  --jb-deco: "Cinzel Decorative", "Cinzel", serif;
  --jb-ar: "Noto Naskh Arabic", "DM Sans", serif;
  --jb-shadow: rgba(0, 0, 0, 0.35);
}

html[dir="rtl"] body.jb-theme {
  font-family: var(--jb-ar);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

/* WebView / mobile browsers (iOS Safari, Android Chrome, in-app WebView) */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@supports (height: 100dvh) {
  body.jb-theme {
    min-height: 100dvh;
  }
}

/* ---- Animated background ---- */
.jb-bg-layers {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.jb-bg-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    165deg,
    #0d1321 0%,
    #1a2744 28%,
    #243b55 55%,
    #1e3a2f 85%,
    #0f1a14 100%
  );
  background-size: 400% 400%;
  animation: jbGradientShift 18s ease infinite;
}

@keyframes jbGradientShift {
  0%,
  100% {
    background-position: 0% 40%;
  }
  50% {
    background-position: 100% 60%;
  }
}

.jb-bg-stars {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(1.5px 1.5px at 10% 20%, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(1px 1px at 30% 65%, rgba(255, 255, 255, 0.35), transparent),
    radial-gradient(1.5px 1.5px at 70% 30%, rgba(255, 255, 255, 0.45), transparent),
    radial-gradient(1px 1px at 85% 75%, rgba(244, 208, 63, 0.4), transparent),
    radial-gradient(1px 1px at 50% 50%, rgba(255, 255, 255, 0.2), transparent);
  background-size: 100% 100%;
  animation: jbTwinkle 7s ease-in-out infinite;
}

@keyframes jbTwinkle {
  0%,
  100% {
    opacity: 0.85;
  }
  50% {
    opacity: 1;
  }
}

.jb-bg-gold-dust {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(ellipse 80% 50% at 50% 100%, rgba(212, 175, 55, 0.15), transparent 70%);
  animation: jbDustFloat 12s ease-in-out infinite;
}

@keyframes jbDustFloat {
  50% {
    transform: translateY(-4%) scale(1.02);
    opacity: 0.9;
  }
}

.jb-bg-hiero {
  position: absolute;
  inset: 0;
  opacity: 0.07;
  background-image: repeating-linear-gradient(
      90deg,
      transparent,
      transparent 48px,
      rgba(212, 175, 55, 0.35) 48px,
      rgba(212, 175, 55, 0.35) 49px
    ),
    repeating-linear-gradient(0deg, transparent, transparent 32px, rgba(212, 175, 55, 0.12) 32px, rgba(212, 175, 55, 0.12) 33px);
  animation: jbHieroDrift 120s linear infinite;
}

@keyframes jbHieroDrift {
  to {
    background-position: 200px 100px;
  }
}

.jb-pharaoh-frame {
  height: 10px;
  background: linear-gradient(90deg, transparent, var(--jb-gold), var(--jb-gold-light), var(--jb-gold), transparent);
  opacity: 0.85;
  position: relative;
  z-index: 2;
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.35);
}

.jb-pharaoh-frame--top {
  margin-bottom: -1px;
}

.jb-pharaoh-frame--bottom {
  margin-top: 0;
}

body.jb-theme {
  margin: 0;
  min-height: 100vh;
  font-family: var(--jb-font);
  color: var(--jb-papyrus);
  line-height: 1.65;
  position: relative;
  overflow-x: hidden;
  /* Safe area: notch / home indicator (iOS) & gesture bar (Android) */
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  overscroll-behavior-y: contain;
}

.jb-main {
  position: relative;
  z-index: 1;
  max-width: 1040px;
  margin: 0 auto;
  padding: 1.25rem 1.25rem max(5.75rem, calc(4.5rem + env(safe-area-inset-bottom, 0px)));
}

@media (min-width: 768px) {
  .jb-main {
    padding-bottom: 2.5rem;
  }
}

/* ---- Header ---- */
.jb-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: linear-gradient(180deg, rgba(13, 19, 33, 0.92), rgba(26, 39, 68, 0.88));
  border-bottom: 1px solid rgba(212, 175, 55, 0.25);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.jb-header-inner {
  max-width: 1160px;
  margin: 0 auto;
  padding: max(0.85rem, env(safe-area-inset-top, 0px)) 1rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.jb-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--jb-papyrus);
}

.jb-logo-icon {
  flex-shrink: 0;
  filter: drop-shadow(0 0 12px rgba(212, 175, 55, 0.5));
  animation: jbLogoGlow 4s ease-in-out infinite;
}

@keyframes jbLogoGlow {
  50% {
    filter: drop-shadow(0 0 18px rgba(244, 208, 63, 0.75));
  }
}

.jb-logo-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.jb-logo-title {
  font-family: var(--jb-deco);
  font-size: clamp(1.05rem, 2.5vw, 1.35rem);
  font-weight: 400;
  letter-spacing: 0.06em;
  background: linear-gradient(135deg, var(--jb-gold-light), var(--jb-gold), var(--jb-gold-dark));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.jb-logo-sub {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--jb-muted);
}

.jb-nav-desktop {
  display: flex;
  gap: 0.35rem 1rem;
  align-items: center;
  flex-wrap: wrap;
}

@media (max-width: 899px) {
  .jb-logo {
    order: 1;
    flex: 1;
    min-width: 0;
  }
  .jb-header-tools {
    order: 2;
    margin-inline-start: auto;
  }
  .jb-nav-desktop {
    order: 3;
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.5rem 0 0.15rem;
    border-top: 1px solid rgba(212, 175, 55, 0.15);
    gap: 0.75rem;
    scrollbar-width: thin;
  }
  .jb-nav-desktop::-webkit-scrollbar {
    height: 4px;
  }
  .jb-nav-desktop::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.35);
    border-radius: 4px;
  }
}

.jb-nav-desktop a {
  color: var(--jb-sand);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.88rem;
  padding: 0.35rem 0.5rem;
  border-radius: 8px;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s, box-shadow 0.2s;
}

.jb-nav-desktop a:hover {
  color: var(--jb-gold-light);
  background: var(--jb-glass-light);
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.25);
}

.jb-lang-switch {
  font-size: 0.8rem;
  color: var(--jb-muted);
  flex-shrink: 0;
}

.jb-lang-switch a {
  color: inherit;
  text-decoration: none;
  padding: 0.2rem 0.35rem;
}

.jb-lang-switch a.is-active {
  color: var(--jb-gold-light);
  font-weight: 700;
}

.jb-lang-dot {
  opacity: 0.45;
}

.jb-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.jb-lang-select-wrap {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.jb-lang-select {
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--jb-sand);
  background: var(--jb-glass-light);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 10px;
  padding: 0.35rem 1.85rem 0.35rem 0.55rem;
  max-width: min(46vw, 10rem);
  cursor: pointer;
}

.jb-lang-select:focus {
  outline: 2px solid rgba(244, 208, 63, 0.55);
  outline-offset: 2px;
}

html[dir="rtl"] .jb-lang-select {
  padding: 0.35rem 0.55rem 0.35rem 1.85rem;
}

.jb-lang-noscript {
  font-size: 0.72rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem;
}

.jb-lang-noscript a {
  color: var(--jb-muted);
  text-decoration: none;
}

.jb-lang-noscript a.is-active {
  color: var(--jb-gold-light);
  font-weight: 700;
}

body.jb-lang-zh.jb-theme {
  font-family: "Noto Sans SC", var(--jb-font), system-ui, sans-serif;
}

@media (max-width: 480px) {
  .jb-lang-select {
    max-width: 40vw;
    font-size: 0.74rem;
  }
}

/* ---- Buttons ---- */
.jb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 55, 0.45);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  background: linear-gradient(145deg, var(--jb-gold-light), var(--jb-gold) 40%, var(--jb-gold-dark));
  color: #1a1206;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(212, 175, 55, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.jb-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.45) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.jb-btn:hover::after {
  transform: translateX(100%);
}

.jb-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(212, 175, 55, 0.5);
}

.jb-btn-pulse {
  animation: jbBtnPulse 3s ease-in-out infinite;
}

@keyframes jbBtnPulse {
  0%,
  100% {
    box-shadow: 0 4px 24px rgba(212, 175, 55, 0.35);
  }
  50% {
    box-shadow: 0 6px 36px rgba(244, 208, 63, 0.55);
  }
}

.jb-btn-small {
  padding: 0.45rem 0.95rem;
  font-size: 0.88rem;
}

.jb-btn-block {
  width: 100%;
}

.jb-btn-ghost {
  background: transparent;
  color: var(--jb-gold-light);
  border-color: rgba(212, 175, 55, 0.4);
  box-shadow: none;
}

.jb-btn-ghost::after {
  display: none;
}

.jb-btn-ghost:hover {
  background: rgba(212, 175, 55, 0.12);
  color: #fff8e7;
}

.jb-btn-danger {
  color: #ffb4a8 !important;
  border-color: rgba(220, 100, 90, 0.55) !important;
}

.jb-btn-danger:hover {
  background: rgba(180, 60, 50, 0.2) !important;
  color: #ffe8e4 !important;
}

.jb-delete-all-photos {
  margin-top: 0.85rem;
}

.jb-inline-delete-form {
  display: inline;
  margin: 0;
}

.jb-inline-delete-form button {
  vertical-align: middle;
}

/* ---- Hero ---- */
.jb-hero {
  display: grid;
  gap: 2rem;
  align-items: center;
  padding: 2rem 0 3rem;
}

@media (min-width: 880px) {
  .jb-hero {
    grid-template-columns: 1.05fr 0.95fr;
    min-height: 52vh;
  }
}

.jb-eyebrow {
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--jb-turquoise);
  min-height: 1.6em;
  font-weight: 600;
}

.jb-shimmer-text {
  background: linear-gradient(90deg, var(--jb-turquoise), var(--jb-gold-light), var(--jb-turquoise));
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: jbShimmer 5s linear infinite;
}

@keyframes jbShimmer {
  to {
    background-position: 200% center;
  }
}

.jb-hero-title {
  font-family: var(--jb-deco);
  font-size: clamp(2.1rem, 5vw, 3.25rem);
  margin: 0.4rem 0 1rem;
  line-height: 1.12;
}

.jb-gold-text {
  background: linear-gradient(135deg, #fff8e7 0%, var(--jb-gold-light) 35%, var(--jb-gold) 65%, var(--jb-gold-dark) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 24px rgba(212, 175, 55, 0.25));
}

.jb-hero-lead {
  font-size: 1.08rem;
  color: var(--jb-sand);
  max-width: 40ch;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.jb-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 1.75rem;
}

/* Hero viz — pyramids */
.jb-hero-viz {
  position: relative;
  min-height: 260px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.jb-sun {
  position: absolute;
  top: 8%;
  right: 18%;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff9e6, #f4d03f 45%, #e67e22 100%);
  box-shadow: 0 0 60px rgba(244, 208, 63, 0.55), 0 0 120px rgba(230, 126, 34, 0.35);
  animation: jbSunPulse 6s ease-in-out infinite;
}

@keyframes jbSunPulse {
  50% {
    transform: scale(1.06);
    box-shadow: 0 0 80px rgba(244, 208, 63, 0.65), 0 0 140px rgba(230, 126, 34, 0.45);
  }
}

.jb-pyramid {
  position: absolute;
  bottom: 0;
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
  background: linear-gradient(145deg, #c9a961, #6b5428 50%, #3d2f18);
  box-shadow: inset 0 -20px 40px rgba(0, 0, 0, 0.35);
}

.jb-pyramid--lg {
  width: 200px;
  height: 140px;
  left: 50%;
  transform: translateX(-50%);
  animation: jbPyramidFloat 8s ease-in-out infinite;
}

.jb-pyramid--sm {
  width: 110px;
  height: 78px;
  left: 18%;
  bottom: 0;
  opacity: 0.85;
  animation: jbPyramidFloat 8s ease-in-out infinite 0.5s;
}

@keyframes jbPyramidFloat {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  50% {
    transform: translateX(-50%) translateY(-6px);
  }
}

.jb-pyramid--sm {
  transform: translateY(0);
  animation-name: jbPyramidFloatSm;
}

@keyframes jbPyramidFloatSm {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

.jb-dune {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(180deg, transparent, rgba(212, 175, 55, 0.12));
  border-radius: 50% 50% 0 0 / 100% 40px 0 0;
}

/* ---- Sections & cards ---- */
.jb-section {
  padding: 2rem 0 3rem;
}

.jb-section h2 {
  font-family: var(--jb-display);
  font-size: clamp(1.65rem, 3vw, 2.1rem);
  color: var(--jb-gold-light);
  margin-bottom: 1.5rem;
  letter-spacing: 0.04em;
}

.jb-steps {
  display: grid;
  gap: 1.1rem;
}

@media (min-width: 640px) {
  .jb-steps {
    grid-template-columns: repeat(2, 1fr);
  }
}

.jb-card {
  background: linear-gradient(155deg, rgba(36, 59, 85, 0.65), rgba(13, 19, 33, 0.75));
  border-radius: var(--jb-radius);
  border: 1px solid rgba(212, 175, 55, 0.22);
  box-shadow: 0 16px 48px var(--jb-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(8px);
  transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.jb-card:hover {
  transform: translateY(-4px);
  border-color: rgba(244, 208, 63, 0.4);
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.45), 0 0 40px rgba(212, 175, 55, 0.12);
}

.jb-card-pad {
  padding: 1.5rem 1.65rem;
}

.jb-step-num {
  display: inline-flex;
  width: 2.25rem;
  height: 2.25rem;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--jb-gold-light), var(--jb-gold-dark));
  color: #1a1206;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 0.65rem;
  box-shadow: 0 4px 16px rgba(212, 175, 55, 0.35);
}

.jb-card h3 {
  font-family: var(--jb-display);
  margin: 0 0 0.5rem;
  color: var(--jb-gold-light);
  font-size: 1.2rem;
}

.jb-card p {
  color: var(--jb-sand);
  margin: 0;
  font-size: 0.98rem;
}

/* ---- Forms ---- */
.jb-narrow {
  max-width: 520px;
}

.jb-form label {
  display: block;
  margin-bottom: 1rem;
  font-weight: 500;
  color: var(--jb-sand);
}

.jb-form input[type="text"],
.jb-form input[type="email"],
.jb-form input[type="password"],
.jb-form input[type="date"],
.jb-form input[type="file"],
.jb-form select,
.jb-form textarea {
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.7rem 0.95rem;
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 55, 0.25);
  background: rgba(15, 20, 30, 0.65);
  font: inherit;
  color: var(--jb-papyrus);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.jb-form input:focus,
.jb-form select:focus,
.jb-form textarea:focus {
  outline: none;
  border-color: rgba(244, 208, 63, 0.55);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

.jb-form textarea {
  resize: vertical;
}

.jb-fieldset {
  border: none;
  padding: 0;
  margin: 0 0 2rem;
}

.jb-fieldset legend {
  font-family: var(--jb-display);
  font-size: 1.35rem;
  padding: 0 0 0.85rem;
  color: var(--jb-gold-light);
}

.jb-story-block {
  padding: 1rem 0;
  border-bottom: 1px dashed rgba(212, 175, 55, 0.2);
}

.jb-story-block:last-of-type {
  border-bottom: none;
}

.jb-inline {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.jb-inline select {
  width: auto;
  flex: 1;
}

.jb-error {
  color: #ffb4b4;
  background: rgba(180, 40, 40, 0.25);
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 100, 100, 0.35);
}

.jb-muted {
  color: var(--jb-muted);
  font-size: 0.95rem;
}

/* ---- Dashboard ---- */
.jb-page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.jb-page-head h1 {
  font-family: var(--jb-deco);
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
  background: linear-gradient(135deg, var(--jb-gold-light), var(--jb-gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.jb-journey-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.jb-journey-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem 1.5rem;
}

.jb-journey-item h2 {
  font-family: var(--jb-display);
  margin: 0 0 0.35rem;
  font-size: 1.3rem;
}

.jb-journey-item h2 a {
  color: var(--jb-gold-light);
  text-decoration: none;
  transition: color 0.2s;
}

.jb-journey-item h2 a:hover {
  color: #fff8e7;
}

.jb-journey-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.jb-empty {
  text-align: center;
}

/* ---- Story read ---- */
.jb-story-header {
  text-align: center;
  padding: 2rem 0;
}

.jb-story-title {
  font-family: var(--jb-deco);
  font-size: clamp(1.85rem, 4vw, 2.6rem);
  margin: 0.5rem 0;
}

.jb-story-sub {
  font-size: 1.1rem;
  color: var(--jb-sand);
}

.jb-story-section {
  margin: 2rem 0;
}

.jb-story-section h2 {
  font-family: var(--jb-display);
  color: var(--jb-gold-light);
}

.jb-story-card {
  background: linear-gradient(160deg, rgba(36, 59, 85, 0.5), rgba(13, 19, 33, 0.7));
  border-radius: var(--jb-radius);
  padding: 1.35rem 1.5rem;
  margin-bottom: 1rem;
  border: 1px solid rgba(212, 175, 55, 0.18);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
}

.jb-story-card h3 {
  font-family: var(--jb-display);
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  color: var(--jb-gold-light);
}

.jb-story-prose {
  font-size: 1.05rem;
  color: var(--jb-papyrus);
}

.jb-badge {
  display: inline-block;
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(45, 212, 191, 0.2);
  color: var(--jb-turquoise);
  margin-inline-start: 0.35rem;
  vertical-align: middle;
}

.jb-print-area {
  width: 100%;
  font-family: ui-monospace, monospace;
  font-size: 0.88rem;
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 55, 0.25);
  background: rgba(10, 14, 22, 0.85);
  color: var(--jb-sand);
}

.jb-story-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

/* Gallery */
.jb-gallery-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.jb-gallery-toolbar h2 {
  margin: 0;
}

.jb-slider {
  position: relative;
  background: rgba(13, 19, 33, 0.6);
  border-radius: var(--jb-radius);
  overflow: hidden;
  border: 1px solid rgba(212, 175, 55, 0.2);
  min-height: 220px;
}

.jb-slider-track {
  position: relative;
  min-height: 240px;
}

.jb-slide {
  display: none;
  margin: 0;
  height: 100%;
}

.jb-slide.is-active {
  display: block;
}

.jb-slide img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
}

.jb-slider-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  border: 1px solid rgba(212, 175, 55, 0.35);
  background: rgba(13, 19, 33, 0.85);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--jb-gold-light);
}

.jb-slider-prev {
  left: 0.5rem;
}

.jb-slider-next {
  right: 0.5rem;
}

.jb-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
}

.jb-img-tile {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(212, 175, 55, 0.2);
  display: block;
}

.jb-img-tile img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

.jb-img-tile span {
  display: block;
  font-size: 0.78rem;
  padding: 0.35rem;
  text-align: center;
  color: var(--jb-sand);
}

/* Article / legal */
.jb-article {
  background: linear-gradient(165deg, rgba(36, 59, 85, 0.55), rgba(13, 19, 33, 0.8));
  padding: 2rem;
  border-radius: var(--jb-radius);
  border: 1px solid rgba(212, 175, 55, 0.2);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.jb-article h1 {
  font-family: var(--jb-deco);
  color: var(--jb-gold-light);
}

.jb-lead {
  font-size: 1.15rem;
  color: var(--jb-sand);
}

.jb-quote blockquote {
  font-family: var(--jb-display);
  font-size: 1.45rem;
  color: var(--jb-gold-light);
  margin: 2rem 0;
  padding: 1.25rem 1.4rem;
  border-inline-start: 4px solid var(--jb-gold);
  background: rgba(212, 175, 55, 0.08);
  border-radius: 8px;
}

.jb-legal h2 {
  font-family: var(--jb-display);
  margin-top: 1.75rem;
  color: var(--jb-gold-light);
}

/* ---- Admin (polished) ---- */
.jb-page-admin .jb-main {
  max-width: 1100px;
}

.jb-table-wrap {
  overflow-x: auto;
  border-radius: var(--jb-radius);
  border: 1px solid rgba(212, 175, 55, 0.22);
  background: linear-gradient(180deg, rgba(26, 39, 68, 0.75), rgba(13, 19, 33, 0.9));
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.jb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 520px;
}

.jb-table th,
.jb-table td {
  padding: 0.95rem 1.15rem;
  text-align: start;
  border-bottom: 1px solid rgba(212, 175, 55, 0.12);
}

.jb-table th {
  font-family: var(--jb-display);
  font-weight: 600;
  color: var(--jb-gold-light);
  background: rgba(212, 175, 55, 0.08);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.78rem;
}

.jb-table tbody tr {
  transition: background 0.2s;
}

.jb-table tbody tr:hover {
  background: rgba(212, 175, 55, 0.06);
}

.jb-table td a {
  color: var(--jb-turquoise);
  font-weight: 600;
  text-decoration: none;
}

.jb-table td a:hover {
  text-decoration: underline;
}

.jb-admin-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.jb-admin-block {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed rgba(212, 175, 55, 0.15);
}

.jb-admin-block:last-child {
  border-bottom: none;
}

/* Profile */
.jb-dl dt {
  font-weight: 600;
  color: var(--jb-gold-light);
}

.jb-dl dd {
  margin: 0 0 0.75rem;
  color: var(--jb-sand);
}

/* Bottom nav */
.jb-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  padding: 0.4rem 0.5rem calc(0.4rem + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(13, 19, 33, 0.92), rgba(26, 39, 68, 0.95));
  border-top: 1px solid rgba(212, 175, 55, 0.28);
  backdrop-filter: blur(14px);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.45);
}

@media (min-width: 768px) {
  .jb-bottom-nav {
    display: none;
  }
}

.jb-bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  font-size: 0.68rem;
  color: var(--jb-muted);
  text-decoration: none;
  padding: 0.35rem;
  transition: color 0.2s;
}

.jb-bottom-nav a:hover,
.jb-bottom-nav a.jb-bn-add {
  color: var(--jb-gold-light);
}

.jb-bn-icon {
  font-size: 1.25rem;
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.35));
}

.jb-bn-plus {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--jb-gold-light), var(--jb-gold-dark));
  color: #1a1206;
  font-size: 1.5rem;
  line-height: 1;
  box-shadow: 0 6px 22px rgba(212, 175, 55, 0.45);
  animation: jbBtnPulse 3s ease-in-out infinite;
}

/* Footer */
.jb-footer {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem 1rem 5.5rem;
}

@media (min-width: 768px) {
  .jb-footer {
    padding-bottom: 2.5rem;
  }
}

.jb-footer-inner {
  max-width: 560px;
  margin: 0 auto;
}

.jb-footer-line {
  margin: 0 0 0.35rem;
  color: var(--jb-muted);
  font-size: 0.9rem;
}

.jb-footer-line strong {
  color: var(--jb-gold-light);
  font-family: var(--jb-display);
}

.jb-footer-tag {
  margin: 0;
  font-size: 0.85rem;
  color: var(--jb-sand);
  opacity: 0.9;
}

/* Animations */
.jb-fade-in {
  animation: jbFadeIn 0.85s ease both;
}

@keyframes jbFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.jb-page-enter {
  animation: jbPageEnter 1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes jbPageEnter {
  from {
    opacity: 0;
    transform: perspective(900px) rotateX(4deg) translateY(24px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.jb-float-slow {
  animation: jbFloatHero 10s ease-in-out infinite;
}

@keyframes jbFloatHero {
  50% {
    transform: translateY(-10px);
  }
}

.jb-reveal {
  opacity: 0;
  transform: translateY(28px) scale(0.98);
  transition: opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1), transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

.jb-reveal.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Stagger steps */
.jb-steps .jb-reveal:nth-child(1) {
  transition-delay: 0.05s;
}
.jb-steps .jb-reveal:nth-child(2) {
  transition-delay: 0.12s;
}
.jb-steps .jb-reveal:nth-child(3) {
  transition-delay: 0.19s;
}
.jb-steps .jb-reveal:nth-child(4) {
  transition-delay: 0.26s;
}

/* Auth pages */
.jb-page-auth .jb-main {
  padding-top: 2.5rem;
}

/* ---- Theme toggle (navbar — mobile + desktop) ---- */
.jb-header-tools {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.jb-btn,
.jb-theme-toggle,
.jb-nav-desktop a,
.jb-bottom-nav a {
  touch-action: manipulation;
}

.jb-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.65rem;
  height: 2.65rem;
  padding: 0;
  border-radius: 12px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  background: rgba(0, 0, 0, 0.25);
  color: var(--jb-gold-light);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.jb-theme-toggle:hover {
  transform: scale(1.06);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.35);
  background: rgba(212, 175, 55, 0.12);
}

.jb-theme-toggle:focus-visible {
  outline: 2px solid var(--jb-turquoise);
  outline-offset: 2px;
}

.jb-theme-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

html[data-jb-theme="dark"] .jb-theme-icon--moon {
  display: none;
}

html[data-jb-theme="light"] .jb-theme-icon--sun {
  display: none;
}

/* ---- Light theme (فاتح) ---- */
html[data-jb-theme="light"] {
  --jb-papyrus: #2a2318;
  --jb-sand: #4a3f32;
  --jb-muted: #6b5c4a;
  --jb-ink: #1a1510;
  --jb-gold: #9a7209;
  --jb-gold-light: #c9a227;
  --jb-gold-dark: #6b4f0a;
  --jb-turquoise: #0d9488;
  --jb-shadow: rgba(40, 30, 15, 0.12);
}

html[data-jb-theme="light"] .jb-bg-gradient {
  background: linear-gradient(165deg, #fffdf8 0%, #f8f0e0 30%, #f0e6d4 60%, #ebe3d6 100%);
  background-size: 400% 400%;
}

html[data-jb-theme="light"] .jb-bg-stars {
  opacity: 0.18;
  background-image: radial-gradient(1.5px 1.5px at 12% 22%, rgba(180, 140, 40, 0.45), transparent),
    radial-gradient(1px 1px at 40% 60%, rgba(160, 120, 30, 0.25), transparent),
    radial-gradient(1.5px 1.5px at 72% 28%, rgba(200, 160, 60, 0.35), transparent),
    radial-gradient(1px 1px at 88% 70%, rgba(212, 175, 55, 0.3), transparent);
}

html[data-jb-theme="light"] .jb-bg-gold-dust {
  background-image: radial-gradient(ellipse 85% 55% at 50% 100%, rgba(212, 175, 55, 0.18), transparent 72%);
}

html[data-jb-theme="light"] .jb-bg-hiero {
  opacity: 0.045;
  background-image: repeating-linear-gradient(
      90deg,
      transparent,
      transparent 48px,
      rgba(139, 105, 20, 0.25) 48px,
      rgba(139, 105, 20, 0.25) 49px
    ),
    repeating-linear-gradient(0deg, transparent, transparent 32px, rgba(139, 105, 20, 0.1) 32px, rgba(139, 105, 20, 0.1) 33px);
}

html[data-jb-theme="light"] body.jb-theme {
  color: var(--jb-papyrus);
}

html[data-jb-theme="light"] .jb-header {
  background: linear-gradient(180deg, rgba(255, 252, 245, 0.97), rgba(248, 240, 228, 0.95));
  border-bottom: 1px solid rgba(139, 105, 20, 0.22);
  box-shadow: 0 6px 28px rgba(60, 45, 20, 0.08);
}

html[data-jb-theme="light"] .jb-nav-desktop {
  border-top-color: rgba(139, 105, 20, 0.12);
}

html[data-jb-theme="light"] .jb-nav-desktop a {
  color: #4a3f32;
}

html[data-jb-theme="light"] .jb-nav-desktop a:hover {
  color: var(--jb-gold-dark);
  background: rgba(212, 175, 55, 0.12);
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.2);
}

html[data-jb-theme="light"] .jb-lang-switch {
  color: var(--jb-muted);
}

html[data-jb-theme="light"] .jb-lang-switch a.is-active {
  color: var(--jb-gold-dark);
}

html[data-jb-theme="light"] .jb-theme-toggle {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(139, 105, 20, 0.35);
  color: var(--jb-gold-dark);
  box-shadow: 0 2px 12px rgba(60, 45, 20, 0.08);
}

html[data-jb-theme="light"] .jb-theme-toggle:hover {
  background: rgba(212, 175, 55, 0.15);
  box-shadow: 0 4px 18px rgba(212, 175, 55, 0.25);
}

html[data-jb-theme="light"] .jb-logo-sub {
  color: var(--jb-muted);
}

html[data-jb-theme="light"] .jb-gold-text {
  background: linear-gradient(135deg, #6b4f0a 0%, #9a7209 40%, #c9a227 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: none;
}

html[data-jb-theme="light"] .jb-shimmer-text {
  background: linear-gradient(90deg, #0d9488, #9a7209, #0d9488);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

html[data-jb-theme="light"] .jb-eyebrow {
  color: #0f766e;
}

html[data-jb-theme="light"] .jb-hero-lead {
  color: var(--jb-sand);
  text-shadow: none;
}

html[data-jb-theme="light"] .jb-sun {
  box-shadow: 0 0 50px rgba(244, 208, 63, 0.45), 0 0 90px rgba(230, 126, 34, 0.2);
}

html[data-jb-theme="light"] .jb-card {
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.92), rgba(248, 242, 232, 0.95));
  border: 1px solid rgba(139, 105, 20, 0.18);
  box-shadow: 0 12px 40px rgba(60, 45, 20, 0.1);
}

html[data-jb-theme="light"] .jb-card:hover {
  border-color: rgba(212, 175, 55, 0.35);
  box-shadow: 0 20px 50px rgba(60, 45, 20, 0.14);
}

html[data-jb-theme="light"] .jb-card p {
  color: #5c4d3d;
}

html[data-jb-theme="light"] .jb-section h2,
html[data-jb-theme="light"] .jb-card h3 {
  color: var(--jb-gold-dark);
}

html[data-jb-theme="light"] .jb-form input,
html[data-jb-theme="light"] .jb-form select,
html[data-jb-theme="light"] .jb-form textarea {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(139, 105, 20, 0.25);
  color: var(--jb-papyrus);
}

html[data-jb-theme="light"] .jb-fieldset legend {
  color: var(--jb-gold-dark);
}

html[data-jb-theme="light"] .jb-story-card,
html[data-jb-theme="light"] .jb-article {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(245, 238, 224, 0.98));
  border-color: rgba(139, 105, 20, 0.15);
  box-shadow: 0 10px 36px rgba(60, 45, 20, 0.08);
}

html[data-jb-theme="light"] .jb-story-card h3,
html[data-jb-theme="light"] .jb-article h1 {
  color: var(--jb-gold-dark);
}

html[data-jb-theme="light"] .jb-story-prose {
  color: #3d3428;
}

html[data-jb-theme="light"] .jb-print-area {
  background: #fffef9;
  border-color: rgba(139, 105, 20, 0.22);
  color: #3d3428;
}

html[data-jb-theme="light"] .jb-page-head h1 {
  background: linear-gradient(135deg, #6b4f0a, #c9a227);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

html[data-jb-theme="light"] .jb-journey-item h2 a {
  color: var(--jb-gold-dark);
}

html[data-jb-theme="light"] .jb-table-wrap {
  background: linear-gradient(180deg, rgba(255, 252, 245, 0.98), rgba(248, 240, 228, 0.98));
  border-color: rgba(139, 105, 20, 0.2);
  box-shadow: 0 16px 44px rgba(60, 45, 20, 0.1);
}

html[data-jb-theme="light"] .jb-table th {
  color: var(--jb-gold-dark);
  background: rgba(212, 175, 55, 0.12);
}

html[data-jb-theme="light"] .jb-table td {
  color: #3d3428;
  border-bottom-color: rgba(139, 105, 20, 0.12);
}

html[data-jb-theme="light"] .jb-table td a {
  color: #0f766e;
}

html[data-jb-theme="light"] .jb-bottom-nav {
  background: linear-gradient(180deg, rgba(255, 252, 245, 0.98), rgba(248, 240, 228, 0.98));
  border-top: 1px solid rgba(139, 105, 20, 0.22);
  box-shadow: 0 -8px 28px rgba(60, 45, 20, 0.1);
}

html[data-jb-theme="light"] .jb-bottom-nav a {
  color: var(--jb-muted);
}

html[data-jb-theme="light"] .jb-bottom-nav a:hover,
html[data-jb-theme="light"] .jb-bottom-nav a.jb-bn-add {
  color: var(--jb-gold-dark);
}

html[data-jb-theme="light"] .jb-footer-line {
  color: var(--jb-muted);
}

html[data-jb-theme="light"] .jb-footer-line strong {
  color: var(--jb-gold-dark);
}

html[data-jb-theme="light"] .jb-footer-tag {
  color: #5c4d3d;
}

html[data-jb-theme="light"] .jb-slider {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(139, 105, 20, 0.18);
}

html[data-jb-theme="light"] .jb-slider-nav {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(139, 105, 20, 0.25);
  color: var(--jb-gold-dark);
}

html[data-jb-theme="light"] .jb-quote blockquote {
  color: var(--jb-gold-dark);
  background: rgba(212, 175, 55, 0.1);
}

html[data-jb-theme="light"] .jb-legal h2 {
  color: var(--jb-gold-dark);
}

html[data-jb-theme="light"] .jb-dl dt {
  color: var(--jb-gold-dark);
}

html[data-jb-theme="light"] .jb-dl dd {
  color: #4a3f32;
}

html[data-jb-theme="light"] .jb-error {
  color: #7f1d1d;
  background: rgba(254, 202, 202, 0.5);
  border-color: rgba(185, 28, 28, 0.35);
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
