/*!
 * Embed widget — graphique cours or (TradingView).
 * Thèmes : fond noir (#dark) · fond blanc (#light) · fond or (#gold)
 */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
}

html,
body {
  margin: 0;
  padding: 0;
}

/* Remplit la hauteur de l’iframe : ne pas utiliser 100vh (c’est la fenêtre navigateur, pas l’iframe). */
body.cw-root {
  min-height: 100%;
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--cw-bg);
  color: var(--cw-text);
  font-family:
    Outfit,
    Inter,
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Ubuntu,
    sans-serif;
}

:root,
.cw-root--dark {
  --cw-bg: #001528;
  --cw-text: rgba(255, 255, 255, 0.92);
  --cw-chart-pad-block: clamp(6px, 1.8vw, 12px);
  --cw-chart-pad-inline: clamp(6px, 2.2vw, 14px);
  --cw-border: rgba(206, 172, 106, 0.22);
  --cw-accent: #ceac6a;
  --cw-footer-fill: rgba(0, 20, 45, 0.5);
}

/* —— Blanc (chart clair TradingView) —— */
.cw-root--light {
  --cw-bg: #ffffff;
  --cw-text: rgba(14, 26, 42, 0.92);
  --cw-chart-pad-block: clamp(6px, 1.8vw, 12px);
  --cw-chart-pad-inline: clamp(6px, 2.2vw, 14px);
  --cw-border: rgba(0, 38, 84, 0.12);
  --cw-accent: #002654;
  --cw-footer-fill: rgba(246, 248, 252, 0.97);
}

/* —— Or GIOR — gradient champagne + chart contrasté marine —— */
.cw-root--gold {
  --cw-bg: linear-gradient(160deg, #c19a52 0%, #d9bc78 40%, #e8cf94 92%);
  --cw-text: rgba(14, 26, 42, 0.94);
  --cw-chart-pad-block: clamp(6px, 1.8vw, 12px);
  --cw-chart-pad-inline: clamp(6px, 2.2vw, 14px);
  --cw-border: rgba(0, 38, 84, 0.2);
  --cw-accent: #001f4d;
  --cw-footer-fill: rgba(255, 251, 240, 0.72);
}

.cw-chart-wrap {
  flex: 1 1 auto;
  /* Dans une iframe : pas de vh/svh — suit la hauteur du parent */
  min-height: 220px;
  padding: var(--cw-chart-pad-block) var(--cw-chart-pad-inline) 0;
}

.cs-tv,
.cw-chart-wrap .tradingview-widget-container {
  min-height: 240px !important;
  height: 100% !important;
  width: 100% !important;
  max-width: 100%;
}

.cs-tv .tradingview-widget-container__widget {
  min-height: 220px !important;
  height: 100% !important;
}

.cw-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 12px;
  padding: 10px clamp(10px, 3vw, 14px);
  margin: 6px clamp(6px, 2vw, 10px) 10px;
  border-radius: 10px;
  border: 1px solid var(--cw-border);
  background: var(--cw-footer-fill);
}

.cw-footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  font-weight: 700;
  font-size: clamp(13px, 3.2vw, 14px);
  letter-spacing: 0.04em;
}

.cw-footer-brand img {
  height: clamp(22px, 5.5vw, 28px);
  width: auto;
  display: block;
}

.cw-footer-sep {
  width: 1px;
  flex: 0 0 1px;
  height: 18px;
  align-self: center;
}

.cw-root--dark .cw-footer-sep {
  background: rgba(255, 255, 255, 0.14);
}

.cw-root--light .cw-footer-sep {
  background: rgba(0, 38, 84, 0.14);
}

.cw-root--gold .cw-footer-sep {
  background: rgba(0, 38, 84, 0.2);
}

.cw-footer-link {
  color: var(--cw-accent);
  font-weight: 600;
  font-size: clamp(12px, 3vw, 13px);
  text-decoration: none;
  flex: 0 1 auto;
  min-width: 0;
}

.cw-root--light .cw-footer-link {
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.cw-root--gold .cw-footer-link {
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.cw-footer-link:hover,
.cw-footer-link:focus-visible {
  text-decoration: underline;
}

@media (max-width: 380px) {
  .cw-footer {
    justify-content: flex-start;
    align-items: flex-start;
  }
}
