/* ============================================================
   Learn hawser — course styling
   Tuned for mdBook's dark "navy" theme: light text on dark bg.
   Palette: hawser violet / teal / amber.
   ============================================================ */

:root {
  --hw-violet: #b39cff;
  --hw-violet-dim: rgba(139, 108, 255, 0.14);
  --hw-teal: #5fe3c8;
  --hw-teal-dim: rgba(56, 209, 178, 0.13);
  --hw-blue: #79b8ff;
  --hw-blue-dim: rgba(88, 145, 235, 0.14);
  --hw-amber: #ffcf6b;
  --hw-amber-dim: rgba(230, 168, 45, 0.14);
  --hw-green: #7ee29a;
  --hw-green-dim: rgba(70, 200, 120, 0.14);
}

/* ------------------------------------------------------------
   Colored callout boxes
   Used as: <div class="callout tip">…</div>
   ------------------------------------------------------------ */
.callout {
  position: relative;
  margin: 1.4em 0;
  padding: 0.9em 1.1em 0.9em 3em;
  border-radius: 8px;
  border-left: 4px solid var(--hw-teal);
  background: var(--hw-teal-dim);
  line-height: 1.55;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.callout > :first-child { margin-top: 0; }
.callout > :last-child { margin-bottom: 0; }

/* Emoji marker, positioned in the left gutter */
.callout::before {
  position: absolute;
  left: 0.85em;
  top: 0.82em;
  font-size: 1.05em;
  line-height: 1.4;
}

.callout p,
.callout li { color: #e8ecf4; }

.callout strong { color: #ffffff; }

/* Inline code inside callouts stays readable on the tint */
.callout code {
  background: rgba(255, 255, 255, 0.08);
  color: #f1eaff;
  border-radius: 4px;
  padding: 0.05em 0.35em;
}

/* --- Tip: teal/green --- */
.callout.tip {
  border-left-color: var(--hw-teal);
  background: var(--hw-teal-dim);
}
.callout.tip::before { content: "\1F4A1"; } /* 💡 */

/* --- Note: blue --- */
.callout.note {
  border-left-color: var(--hw-blue);
  background: var(--hw-blue-dim);
}
.callout.note::before { content: "\1F4DD"; } /* 📝 */

/* --- Warning: amber --- */
.callout.warning {
  border-left-color: var(--hw-amber);
  background: var(--hw-amber-dim);
}
.callout.warning::before { content: "\26A0\FE0F"; } /* ⚠️ */

/* --- Success: green --- */
.callout.success {
  border-left-color: var(--hw-green);
  background: var(--hw-green-dim);
}
.callout.success::before { content: "\2705"; } /* ✅ */

/* ------------------------------------------------------------
   Inline accent utilities (use sparingly)
   ------------------------------------------------------------ */
.k {
  color: var(--hw-violet);
  font-weight: 600;
  font-family: var(--mono-font, monospace);
}

.hl {
  color: var(--hw-amber);
  font-weight: 600;
}

/* ------------------------------------------------------------
   Nicer images — centered GIFs and banner
   ------------------------------------------------------------ */
.content img {
  display: block;
  margin: 1.4em auto;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.4);
}

/* Top-of-chapter hero banner */
.hero-banner {
  max-width: 100%;
  margin: 0.6em auto 1.8em auto !important;
  border-radius: 12px;
  border: 1px solid rgba(179, 156, 255, 0.28) !important;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5) !important;
}

/* Italic one-line caption under a GIF (an <em> on its own line) */
.content p > em:only-child {
  display: block;
  text-align: center;
  color: #aeb6c6;
  font-size: 0.9em;
  margin-top: -0.6em;
}

/* ------------------------------------------------------------
   Chapter hero illustration (unDraw flat SVG, brand-violet)
   Used as: <img class="chapter-illus" src="../assets/img/x.svg">
   These SVGs have transparent bg — no frame/shadow box, just a
   soft glow so they sit lightly on the navy background.
   ------------------------------------------------------------ */
.content img.chapter-illus,
.content img.side-illus {
  display: block;
  margin: 1.2em auto 1.4em auto;
  width: 100%;
  height: auto;
  border: none !important;
  border-radius: 0 !important;
  background: transparent;
  box-shadow: none !important;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.35));
}

.content img.chapter-illus { max-width: 360px; }
.content img.side-illus    { max-width: 300px; }

/* An italic caption directly following an illustration reads as a
   centered, muted one-liner (already handled by the em:only-child
   rule above; this just tightens spacing after SVG illustrations). */
.content img.chapter-illus + p > em:only-child,
.content img.side-illus + p > em:only-child {
  margin-top: -0.4em;
}

/* ------------------------------------------------------------
   Objectives panel — "🎯 In this chapter, you'll learn to…"
   OpenClassrooms-style opener: violet left border + tinted bg.
   Used as: <div class="objectives"><strong>🎯 …</strong><ul>…</ul></div>
   ------------------------------------------------------------ */
.objectives {
  margin: 1.6em 0 1.8em 0;
  padding: 1.05em 1.2em 1.1em 1.2em;
  border-radius: 10px;
  border: 1px solid rgba(179, 156, 255, 0.30);
  border-left: 4px solid var(--hw-violet);
  background: var(--hw-violet-dim);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
  line-height: 1.55;
}

.objectives > strong:first-child,
.objectives > p:first-child {
  display: block;
  color: var(--hw-violet);
  font-size: 1.05em;
  letter-spacing: 0.01em;
  margin: 0 0 0.55em 0;
}
.objectives > p:first-child > strong { color: inherit; }

.objectives ul {
  margin: 0;
  padding-left: 1.3em;
}

.objectives li {
  color: #e8ecf4;
  margin: 0.28em 0;
}

.objectives li::marker { color: var(--hw-violet); }

.objectives code {
  background: rgba(255, 255, 255, 0.08);
  color: #f1eaff;
  border-radius: 4px;
  padding: 0.05em 0.35em;
}

/* ------------------------------------------------------------
   "🙌 Your turn" exercise box — amber + teal accent so it reads
   as a hands-on challenge, distinct from the callouts.
   Used as: <div class="your-turn"><strong>🙌 Your turn</strong> … </div>
   ------------------------------------------------------------ */
.your-turn {
  position: relative;
  margin: 1.8em 0;
  padding: 1.0em 1.2em 1.05em 1.2em;
  border-radius: 10px;
  border: 1px solid rgba(230, 168, 45, 0.35);
  border-left: 4px solid var(--hw-amber);
  background: linear-gradient(
    100deg,
    var(--hw-amber-dim) 0%,
    var(--hw-teal-dim) 100%
  );
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
  line-height: 1.55;
}

.your-turn > strong:first-child,
.your-turn > p:first-child {
  display: block;
  color: var(--hw-amber);
  font-size: 1.05em;
  margin: 0 0 0.45em 0;
}
.your-turn > p:first-child > strong { color: inherit; }

.your-turn > :last-child { margin-bottom: 0; }

.your-turn p,
.your-turn li { color: #e8ecf4; }

.your-turn code {
  background: rgba(255, 255, 255, 0.08);
  color: #f1eaff;
  border-radius: 4px;
  padding: 0.05em 0.35em;
}

.your-turn a { color: var(--hw-teal); }

/* ------------------------------------------------------------
   Reaction memes — small, playful GIFs at comedic beats.
   Hotlinked from Giphy (external). Used as:
   <img class="meme" src="…giphy.gif" alt="…">
   followed by a one-line italic caption.
   Smaller and a touch more playful than .chapter-illus.
   ------------------------------------------------------------ */
.content img.meme {
  display: block;
  margin: 1.5em auto 0.4em auto;
  max-width: 300px;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid rgba(179, 156, 255, 0.28);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

/* Tighten the italic caption that follows a meme. */
.content img.meme + p > em:only-child {
  margin-top: 0;
  color: #b7bfd0;
}

/* Bilingual language switcher (EN/FR toggle in the menu bar) */
.lang-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  height: 2.1rem;
  margin-left: 0.3rem;
  padding: 0 0.5rem;
  border: 1px solid var(--icons, #67809f);
  border-radius: 5px;
  color: var(--icons, #67809f);
  font-weight: 700;
  font-size: 0.82rem;
  text-decoration: none;
  line-height: 1;
}
.lang-switch:hover {
  color: var(--sidebar-active, #1f6feb);
  border-color: var(--sidebar-active, #1f6feb);
}
