@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400&family=Cairo:wght@300;400;600;700&display=swap');

:root {
  --bg:         #1c100a;
  --bg2:        #241508;
  --card-bg:    #2a1a0e;
  --terra:      #c1521f;
  --sand:       #d4a05a;
  --indigo:     #3d56b2;
  --rose:       #c0426a;
  --emerald:    #2d8f6f;
  --violet:     #7c5bbf;
  --muted:      #9e8068;
  --text:       #f0e6d6;
  --text2:      #c8b49a;
  --border:     #3d2a1a;
  --glow-t:     rgba(193,82,31,.3);
  --glow-i:     rgba(61,86,178,.25);
}

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

body {
  font-family: 'Cairo', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

.souk-header {
  background: radial-gradient(ellipse at 50% 0%, #3a1e0e 0%, #1c100a 70%);
  border-bottom: 1px solid var(--border);
  text-align: center;
  padding-bottom: 0;
  position: relative;
  overflow: hidden;
}

.souk-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-conic-gradient(from 45deg at 50% 50%, rgba(193,82,31,.04) 0deg 90deg, transparent 90deg 180deg);
  background-size: 60px 60px;
  pointer-events: none;
}

.header-ornament { padding: 24px 0 0; position: relative; }
.arabic-decor { font-family: 'Amiri', serif; font-size: 1.1rem; color: var(--sand); opacity: 0.5; letter-spacing: 0.15em; display: block; margin-bottom: 12px; }
.geo-band { height: 6px; background: repeating-linear-gradient(90deg, var(--terra) 0, var(--terra) 20%, var(--sand) 20%, var(--sand) 40%, var(--indigo) 40%, var(--indigo) 60%, var(--rose) 60%, var(--rose) 80%, var(--emerald) 80%, var(--emerald) 100%); }
.header-content { padding: 36px 24px 24px; }
.header-subtitle { font-size: 0.72rem; letter-spacing: 0.25em; text-transform: uppercase; color: var(--terra); font-weight: 700; margin-bottom: 14px; }
.header-title { font-family: 'Amiri', serif; font-size: clamp(3.5rem, 10vw, 7rem); font-weight: 700; line-height: 0.85; color: var(--text); text-shadow: 0 0 60px var(--glow-t); }
.title-fr { display: block; font-size: 0.42em; color: var(--sand); letter-spacing: 0.18em; font-weight: 400; margin-top: 8px; }
.header-tagline { margin-top: 16px; color: var(--muted); font-size: 0.95rem; }

.souk-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 20px 16px 24px; border-top: 1px solid var(--border); margin-top: 20px; }
.nav-link { display: flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; text-decoration: none; border: 1px solid transparent; transition: all 0.2s; color: var(--text2); background: rgba(255,255,255,.04); }
.nav-link:hover { color: var(--text); }
.nav-link.terracotta:hover { border-color: var(--terra); background: rgba(193,82,31,.15); }
.nav-link.indigo:hover { border-color: var(--indigo); background: rgba(61,86,178,.15); }
.nav-link.sable:hover { border-color: var(--sand); background: rgba(212,160,90,.15); }
.nav-link.rose:hover { border-color: var(--rose); background: rgba(192,66,106,.15); }
.nav-link.emerald:hover { border-color: var(--emerald); background: rgba(45,143,111,.15); }

.souk-main { max-width: 1000px; margin: 0 auto; padding: 48px 24px 80px; display: flex; flex-direction: column; gap: 56px; }

.souk-section { opacity: 0; transform: translateY(32px); transition: opacity .6s, transform .6s; }
.souk-section.visible { opacity: 1; transform: translateY(0); }

.section-header { display: flex; align-items: center; gap: 14px; padding: 14px 22px; border-radius: 10px 10px 0 0; margin-bottom: 0; border-left: 4px solid transparent; }
.section-header.terracotta { background: rgba(193,82,31,.12); border-color: var(--terra); }
.section-header.indigo { background: rgba(61,86,178,.12); border-color: var(--indigo); }
.section-header.sable { background: rgba(212,160,90,.1); border-color: var(--sand); }
.section-header.rose { background: rgba(192,66,106,.12); border-color: var(--rose); }
.section-header.emerald { background: rgba(45,143,111,.12); border-color: var(--emerald); }
.section-icon { font-size: 1.5rem; }
.section-header h2 { font-family: 'Amiri', serif; font-size: 1.5rem; font-weight: 700; color: var(--text); }

.section-body { background: var(--card-bg); border: 1px solid var(--border); border-top: none; border-radius: 0 0 10px 10px; padding: 28px; }
.section-body p { color: var(--text2); line-height: 1.82; font-size: 0.97rem; margin-bottom: 18px; }
.section-body p:last-child { margin-bottom: 0; }
.section-body strong { color: var(--sand); font-weight: 700; }
.section-body em { color: var(--terra); font-style: italic; }

.souk-def-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 22px; }
.def-card { background: rgba(255,255,255,.03); border: 1px solid var(--border); border-radius: 8px; padding: 18px; }
.def-icon { font-size: 1.6rem; display: block; margin-bottom: 8px; }
.def-card h4 { font-family: 'Amiri', serif; font-size: 1rem; color: var(--sand); margin-bottom: 8px; }
.def-card p { font-size: 0.88rem; color: var(--muted); margin-bottom: 0 !important; }

.souk-map-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 18px; }
.souk-place { border: 1px solid var(--border); border-radius: 10px; padding: 18px; background: rgba(255,255,255,.02); transition: transform .2s; }
.souk-place:hover { transform: translateY(-3px); }
.souk-place.terracotta { border-top: 3px solid var(--terra); }
.souk-place.indigo { border-top: 3px solid var(--indigo); }
.souk-place.sable { border-top: 3px solid var(--sand); }
.souk-place.rose { border-top: 3px solid var(--rose); }
.souk-place.violet { border-top: 3px solid var(--violet); }
.souk-place.emerald { border-top: 3px solid var(--emerald); }
.place-header { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.flag { font-size: 1.4rem; flex-shrink: 0; margin-top: 2px; }
.souk-place h4 { font-family: 'Amiri', serif; font-size: 1rem; color: var(--text); margin-bottom: 4px; }
.badge { display: inline-block; font-size: 0.7rem; padding: 2px 8px; border-radius: 4px; background: rgba(212,160,90,.15); color: var(--sand); border: 1px solid rgba(212,160,90,.3); }
.souk-place p { font-size: 0.86rem; color: var(--muted); margin-bottom: 0 !important; }

.eco-mecanism-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 18px; }
.meca-card { background: rgba(255,255,255,.03); border: 1px solid var(--border); border-radius: 8px; padding: 20px; }
.meca-card h4 { font-family: 'Cairo', sans-serif; font-size: 0.95rem; font-weight: 700; color: var(--terra); margin-bottom: 10px; }
.meca-card p { font-size: 0.88rem; color: var(--muted); margin-bottom: 10px !important; }
.meca-card p:last-child { margin-bottom: 0 !important; }

.islam-finance-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 18px 0; }
.if-item { background: rgba(61,86,178,.08); border: 1px solid rgba(61,86,178,.2); border-radius: 8px; padding: 16px; text-align: center; }
.if-icon { font-size: 1.5rem; display: block; margin-bottom: 8px; }
.if-item h5 { font-size: 0.85rem; color: #8fa3e8; font-weight: 700; margin-bottom: 8px; }
.if-item p { font-size: 0.8rem; color: var(--muted); margin-bottom: 0 !important; }

.data-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 20px; }
.data-box { background: rgba(193,82,31,.08); border: 1px solid rgba(193,82,31,.2); border-radius: 8px; padding: 14px; text-align: center; }
.data-num { display: block; font-family: 'Amiri', serif; font-size: 1.6rem; font-weight: 700; color: var(--terra); line-height: 1; margin-bottom: 6px; }
.data-label { font-size: 0.75rem; color: var(--muted); line-height: 1.4; }

.informal-table { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin: 18px 0; }
.itable-header { display: grid; grid-template-columns: 160px 1fr 160px 90px; gap: 12px; background: rgba(255,255,255,.05); padding: 10px 16px; font-size: 0.75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.itable-row { display: grid; grid-template-columns: 160px 1fr 160px 90px; gap: 12px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 0.88rem; color: var(--text2); }
.itable-row:hover { background: rgba(255,255,255,.02); }
.ibar-wrap { display: flex; align-items: center; gap: 8px; }
.ibar { height: 6px; background: var(--terra); border-radius: 3px; min-width: 4px; flex-shrink: 0; }
.trend { font-weight: 700; font-size: 0.8rem; }
.trend.up { color: var(--rose); }
.trend.down { color: var(--emerald); }
.trend.neutral { color: var(--sand); }

.enjeux-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 18px; }
.enjeu-card { background: rgba(255,255,255,.02); border: 1px solid var(--border); border-radius: 8px; padding: 18px; }
.enjeu-card h5 { font-size: 0.9rem; font-weight: 700; color: var(--rose); margin-bottom: 10px; }
.enjeu-card p { font-size: 0.87rem; color: var(--muted); margin-bottom: 0 !important; }

.transition-timeline { display: flex; flex-direction: column; gap: 0; margin: 18px 0; }
.tl-item { display: flex; gap: 16px; padding: 0 0 28px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; position: relative; }
.tl-dot::after { content: ''; position: absolute; top: 14px; left: 50%; transform: translateX(-50%); width: 2px; height: calc(100% + 14px); background: var(--border); }
.tl-item:last-child .tl-dot::after { display: none; }
.tl-dot.terracotta { background: var(--terra); }
.tl-dot.indigo { background: var(--indigo); }
.tl-dot.rose { background: var(--rose); }
.tl-dot.emerald { background: var(--emerald); }
.tl-content { flex: 1; }
.tl-content h5 { font-size: 0.9rem; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.tl-content p { font-size: 0.87rem; color: var(--muted); margin-bottom: 0 !important; }

.souk-quote { background: rgba(212,160,90,.08); border-left: 4px solid var(--sand); border-radius: 0 8px 8px 0; padding: 18px 22px; font-family: 'Amiri', serif; font-style: italic; font-size: 1.05rem; color: var(--text2); line-height: 1.8; margin-top: 18px; }
.souk-quote cite { display: block; font-size: 0.78rem; color: var(--muted); font-style: normal; font-family: 'Cairo', sans-serif; margin-top: 10px; }

.souk-footer { border-top: 1px solid var(--border); padding: 32px 24px; text-align: center; background: var(--bg2); }
.footer-geo { height: 4px; background: repeating-linear-gradient(90deg, var(--terra) 0, var(--terra) 20%, var(--sand) 20%, var(--sand) 40%, var(--indigo) 40%, var(--indigo) 60%, var(--rose) 60%, var(--rose) 80%, var(--emerald) 80%, var(--emerald) 100%); border-radius: 2px; margin-bottom: 20px; }
.footer-arabic { font-family: 'Amiri', serif; font-size: 1.1rem; color: var(--sand); margin-bottom: 8px; }
.souk-footer p:last-child { font-size: 0.8rem; color: var(--muted); }

@media (max-width: 768px) {
  .souk-def-grid, .souk-map-grid, .eco-mecanism-grid, .enjeux-grid { grid-template-columns: 1fr; }
  .islam-finance-strip { grid-template-columns: repeat(2, 1fr); }
  .data-row { grid-template-columns: repeat(2, 1fr); }
  .itable-header, .itable-row { grid-template-columns: 1fr 1fr; font-size: 0.8rem; }
}
