/* ==========================================================================
   V3 Premium Solaire — Custom CSS
   Banque Postale du Burkina Faso
   Design: Warm earth tones + Faso Dan Fani woven textile patterns
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS CUSTOM PROPERTIES
   -------------------------------------------------------------------------- */
:root {
  /* Brand Colors */
  --v3-soleil:      #C8951A;
  --v3-terre:       #8B6914;
  --v3-ebene:       #2D2418;
  --v3-ivoire:      #FAF7F2;
  --v3-laterite:    #D4785A;
  --v3-creme:       #E8E0D0;
  --v3-sable:       #8B7355;
  --v3-karite:      #D4C4A8;
  --v3-deep-ebene:  #1E1810;

  /* Derived / Utility */
  --v3-dore:        #D4A838;
  --v3-soleil-10:   rgba(200, 149, 26, 0.10);
  --v3-soleil-20:   rgba(200, 149, 26, 0.20);
  --v3-ebene-80:    rgba(45, 36, 24, 0.80);

  /* Typography */
  --v3-font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --v3-font-body:   'Inter', system-ui, -apple-system, sans-serif;

  /* Spacing */
  --v3-radius-sm:   4px;
  --v3-radius-md:   8px;
  --v3-radius-lg:   16px;
  --v3-radius-pill: 9999px;

  /* Shadows */
  --v3-shadow-warm:       0 4px 24px rgba(45, 36, 24, 0.12);
  --v3-shadow-warm-hover: 0 8px 40px rgba(45, 36, 24, 0.18);
  --v3-shadow-gold:       0 4px 20px rgba(200, 149, 26, 0.30);
  --v3-shadow-gold-hover: 0 6px 28px rgba(200, 149, 26, 0.50);

  /* Transitions */
  --v3-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --------------------------------------------------------------------------
   2. TYPOGRAPHY HELPERS
   -------------------------------------------------------------------------- */

/* Main hero / page heading */
.v3-heading {
  font-family: var(--v3-font-heading);
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--v3-ebene);
  letter-spacing: -0.01em;
}

/* Section-level heading */
.v3-heading-section {
  font-family: var(--v3-font-heading);
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 600;
  line-height: 1.3;
  color: var(--v3-ebene);
  letter-spacing: -0.01em;
}

/* Stat / KPI number */
.v3-stat-number {
  font-family: var(--v3-font-heading);
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1;
  color: var(--v3-soleil);
  letter-spacing: -0.02em;
}

/* --------------------------------------------------------------------------
   3. FASO DAN FANI PATTERN CLASSES
   Traditional Burkinabè woven textile geometric patterns
   -------------------------------------------------------------------------- */

/* Horizontal woven strip — 4px tall border divider */
.fdf-border-h {
  height: 4px;
  width: 100%;
  background: repeating-linear-gradient(
    90deg,
    #C8951A 0px,   #C8951A 8px,
    transparent    8px,  transparent 12px,
    #2D2418 12px,  #2D2418 20px,
    transparent   20px,  transparent 24px,
    #D4785A 24px,  #D4785A 32px,
    transparent   32px,  transparent 36px
  );
}

/* Vertical woven strip — 4px wide border divider */
.fdf-border-v {
  width: 4px;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    #C8951A 0px,   #C8951A 8px,
    transparent    8px,  transparent 12px,
    #2D2418 12px,  #2D2418 20px,
    transparent   20px,  transparent 24px,
    #D4785A 24px,  #D4785A 32px,
    transparent   32px,  transparent 36px
  );
}

/* Subtle woven grid overlay — light sections (20px grid, 3% gold opacity) */
.fdf-grid-overlay {
  background:
    repeating-linear-gradient(
      0deg,
      transparent 0px, transparent 20px,
      rgba(200, 149, 26, 0.03) 20px, rgba(200, 149, 26, 0.03) 21px
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0px, transparent 20px,
      rgba(200, 149, 26, 0.03) 20px, rgba(200, 149, 26, 0.03) 21px
    );
}

/* Subtle woven grid overlay — dark sections (30px grid, 4% gold opacity) */
.fdf-grid-overlay-dark {
  background:
    repeating-linear-gradient(
      0deg,
      transparent 0px, transparent 30px,
      rgba(200, 149, 26, 0.04) 30px, rgba(200, 149, 26, 0.04) 31px
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0px, transparent 30px,
      rgba(200, 149, 26, 0.04) 30px, rgba(200, 149, 26, 0.04) 31px
    );
}

/* --------------------------------------------------------------------------
   4. CARD HOVER — FDF RIGHT-EDGE STRIPE ON HOVER
   -------------------------------------------------------------------------- */
.v3-card-hover {
  position: relative;
  overflow: hidden;
  transition:
    transform var(--v3-transition),
    box-shadow var(--v3-transition);
}

.v3-card-hover::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 4px;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    #C8951A 0px,   #C8951A 8px,
    transparent    8px,  transparent 12px,
    #2D2418 12px,  #2D2418 20px,
    transparent   20px,  transparent 24px,
    #D4785A 24px,  #D4785A 32px,
    transparent   32px,  transparent 36px
  );
  opacity: 0;
  transition: opacity var(--v3-transition);
  pointer-events: none;
}

.v3-card-hover:hover {
  transform: translateY(-3px);
  box-shadow: var(--v3-shadow-warm-hover);
}

.v3-card-hover:hover::after {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   5. BUTTON — GOLD GRADIENT
   -------------------------------------------------------------------------- */
.v3-btn-gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  background: linear-gradient(135deg, #C8951A, #D4A838);
  color: var(--v3-ivoire);
  font-family: var(--v3-font-body);
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1;
  border: none;
  border-radius: var(--v3-radius-md);
  cursor: pointer;
  text-decoration: none;
  transition:
    transform var(--v3-transition),
    box-shadow var(--v3-transition),
    background var(--v3-transition);
}

.v3-btn-gold:hover,
.v3-btn-gold:focus-visible {
  transform: translateY(-1px);
  box-shadow: var(--v3-shadow-gold-hover);
  background: linear-gradient(135deg, #D4A838, #E0B84A);
}

.v3-btn-gold:active {
  transform: translateY(0);
  box-shadow: var(--v3-shadow-gold);
}

/* --------------------------------------------------------------------------
   6. GLASSMORPHISM — WARM IVORY GLASS
   -------------------------------------------------------------------------- */
.v3-glass {
  background: rgba(250, 247, 242, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(200, 149, 26, 0.18);
  border-radius: var(--v3-radius-lg);
}

/* --------------------------------------------------------------------------
   7. IMAGE FRAME — FDF GRID ACCENT BEHIND TOP-RIGHT CORNER
   -------------------------------------------------------------------------- */
.v3-frame-accent {
  position: relative;
}

.v3-frame-accent::before {
  content: '';
  position: absolute;
  top: -8px;
  right: -8px;
  width: 120px;
  height: 120px;
  background:
    repeating-linear-gradient(
      0deg,
      transparent 0px, transparent 20px,
      rgba(200, 149, 26, 0.18) 20px, rgba(200, 149, 26, 0.18) 21px
    ),
    repeating-linear-gradient(
      90deg,
      transparent 0px, transparent 20px,
      rgba(200, 149, 26, 0.18) 20px, rgba(200, 149, 26, 0.18) 21px
    );
  border-radius: var(--v3-radius-sm);
  pointer-events: none;
  z-index: 0;
}

.v3-frame-accent > * {
  position: relative;
  z-index: 1;
}

/* --------------------------------------------------------------------------
   8. ANIMATIONS
   -------------------------------------------------------------------------- */

/* Floating bob — for premium/hero cards */
@keyframes v3-bob {
  0%,  100% { transform: translateY(0);    }
  40%        { transform: translateY(-4px); }
  60%        { transform: translateY(4px);  }
}

.v3-bob {
  animation: v3-bob 3s ease-in-out infinite;
}

/* Shimmer — FDF border page-load entrance */
@keyframes v3-shimmer {
  0%   { opacity: 0.3; }
  50%  { opacity: 1;   }
  100% { opacity: 0.8; }
}

.v3-shimmer {
  animation: v3-shimmer 2s ease-in-out forwards;
}

/* --------------------------------------------------------------------------
   9. TAG / BADGE
   -------------------------------------------------------------------------- */
.v3-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  background: var(--v3-soleil-10);
  color: var(--v3-soleil);
  font-family: var(--v3-font-body);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--v3-radius-pill);
  border: 1px solid rgba(200, 149, 26, 0.20);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   10. LOGO MARK — MICRO HORIZONTAL WEAVE
   -------------------------------------------------------------------------- */
.v3-logo-mark {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.v3-logo-mark::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.20) 0px, rgba(255, 255, 255, 0.20) 3px,
    transparent                3px, transparent               6px
  );
  border-radius: inherit;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   11. RANGE INPUT — WARM GOLD SLIDER
   -------------------------------------------------------------------------- */
input[type="range"].v3-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: var(--v3-radius-pill);
  background: linear-gradient(
    90deg,
    var(--v3-soleil) 0%,
    var(--v3-dore) 100%
  );
  outline: none;
  cursor: pointer;
}

input[type="range"].v3-range::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: var(--v3-radius-pill);
  background: linear-gradient(90deg, var(--v3-soleil), var(--v3-dore));
}

input[type="range"].v3-range::-moz-range-track {
  height: 6px;
  border-radius: var(--v3-radius-pill);
  background: var(--v3-creme);
}

input[type="range"].v3-range::-moz-range-progress {
  height: 6px;
  border-radius: var(--v3-radius-pill);
  background: linear-gradient(90deg, var(--v3-soleil), var(--v3-dore));
}

input[type="range"].v3-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--v3-soleil), var(--v3-dore));
  border: 3px solid var(--v3-ivoire);
  box-shadow: 0 2px 8px rgba(200, 149, 26, 0.40);
  cursor: pointer;
  transition: box-shadow var(--v3-transition), transform var(--v3-transition);
  margin-top: -7px;
}

input[type="range"].v3-range::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--v3-soleil), var(--v3-dore));
  border: 3px solid var(--v3-ivoire);
  box-shadow: 0 2px 8px rgba(200, 149, 26, 0.40);
  cursor: pointer;
  transition: box-shadow var(--v3-transition), transform var(--v3-transition);
}

input[type="range"].v3-range::-webkit-slider-thumb:hover,
input[type="range"].v3-range:focus::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px rgba(200, 149, 26, 0.20), 0 2px 8px rgba(200, 149, 26, 0.40);
  transform: scale(1.1);
}

input[type="range"].v3-range::-moz-range-thumb:hover,
input[type="range"].v3-range:focus::-moz-range-thumb {
  box-shadow: 0 0 0 4px rgba(200, 149, 26, 0.20), 0 2px 8px rgba(200, 149, 26, 0.40);
  transform: scale(1.1);
}

/* --------------------------------------------------------------------------
   12. ACCESSIBILITY
   -------------------------------------------------------------------------- */

/* Skip to main content link */
.v3-skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  z-index: 9999;
  padding: 0.75rem 1.5rem;
  background: var(--v3-soleil);
  color: var(--v3-ivoire);
  font-family: var(--v3-font-body);
  font-weight: 700;
  font-size: 0.9375rem;
  text-decoration: none;
  border-radius: 0 0 var(--v3-radius-md) 0;
  transition: top var(--v3-transition);
}

.v3-skip-link:focus {
  top: 0;
}

/* Focus-visible utility */
.v3-focus:focus-visible {
  outline: 3px solid var(--v3-soleil);
  outline-offset: 3px;
  border-radius: var(--v3-radius-sm);
}

/* Remove default outline only where v3-focus replaces it */
.v3-focus:focus:not(:focus-visible) {
  outline: none;
}

/* --------------------------------------------------------------------------
   13. LEAFLET MAP FIX
   -------------------------------------------------------------------------- */
.bpbf-marker {
  /* Ensure Leaflet custom markers render above tile layers */
  z-index: 1000 !important;
}

.bpbf-marker img {
  display: block;
  width: auto;
  height: auto;
}
