/* =========================================================
   WS Engine — Corporate lesson UI (Astra-friendly)
   File: assets/ws-core.css
   ========================================================= */

/* ---- Layout safety net (Astra / full-width) ---- */
.ws-lesson{
  max-width: 980px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 18px !important;
  padding-right: 18px !important;
  width: 100% !important;
  box-sizing: border-box;
}

.ws-lesson *{ box-sizing: border-box; }

/* ---- Typography baseline ---- */
.ws-lesson{
  color: #0f172a;
  line-height: 1.6;
  font-size: 16px;
}

.ws-lesson h1, .ws-lesson h2, .ws-lesson h3{
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin: 0 0 10px 0;
}

.ws-lesson h1{ font-size: 34px; font-weight: 800; }
.ws-lesson h2{ font-size: 26px; font-weight: 800; }
.ws-lesson h3{ font-size: 18px; font-weight: 800; }

.ws-lesson p{ margin: 0 0 12px 0; }

.ws-lesson ul{ margin: 10px 0 14px 18px; }
.ws-lesson li{ margin: 6px 0; }

/* ---- Hero image control ---- */
.ws-lesson > img:first-of-type{
  display: block;
  width: 100%;
  max-width: 100%;
  height: clamp(220px, 38vw, 420px);
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 18px 45px rgba(15,23,42,.12);
  margin: 12px 0 18px 0;
}

.ws-lesson img{
  max-width: 100%;
  height: auto;
}

/* ---- Generic card component (applies to “boxed” blocks) ----
   Your HTML currently uses classes like:
   - ws-box
   - ws-box-yellow / ws-box-green / ws-box-red / ws-box-blue
*/
.ws-box{
  background: #ffffff;
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 16px;
  padding: 18px 18px;
  margin: 14px 0;
  box-shadow: 0 10px 30px rgba(15,23,42,.06);
}

/* Accent stripe (corporate) */
.ws-box{
  position: relative;
  overflow: hidden;
}
.ws-box:before{
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 0;
  width: 5px;
  border-radius: 999px;
  background: rgba(37,99,235,.45);
}

/* Color variants */
.ws-box-yellow:before{ background: rgba(245,158,11,.55); }
.ws-box-green:before{  background: rgba(34,197,94,.50); }
.ws-box-red:before{    background: rgba(239,68,68,.50); }
.ws-box-blue:before{   background: rgba(59,130,246,.55); }

/* Inside card spacing */
.ws-box > *:last-child{ margin-bottom: 0; }

/* ---- “Badge” (level, metadata) if present ---- */
.ws-badge{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(2,132,199,.10);
  color: #075985;
  border: 1px solid rgba(2,132,199,.18);
}

/* ---- Buttons ---- */
.ws-btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(15,23,42,.10);
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  background: #ffffff;
  color: #0f172a;
  transition: transform .06s ease, box-shadow .12s ease, background .12s ease;
}
.ws-btn:hover{
  box-shadow: 0 10px 24px rgba(15,23,42,.10);
}
.ws-btn:active{
  transform: translateY(1px);
}

/* Primary TTS */
.ws-btn-tts{
  background: #1d4ed8;
  color: #ffffff;
  border-color: rgba(29,78,216,.30);
}
.ws-btn-tts:hover{
  background: #1e40af;
}

/* ---- TTS blocks ---- */
.ws-tts{
  margin: 10px 0 14px 0;
}

/* Optional inline button (if you enable ws-tts-word later) */
.ws-btn-tts-inline{
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
  vertical-align: middle;
}

/* ---- Small separators / sections ---- */
.ws-divider{
  height: 1px;
  background: rgba(15,23,42,.10);
  margin: 16px 0;
}

/* ---- Improve readability on wide screens ---- */
@media (min-width: 1024px){
  .ws-lesson{ font-size: 16.5px; }
}
.ws-btn-tts-inline{
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
}

.ws-tts-inline-wrap{
  display:inline-flex;
  align-items:center;
  margin-right:10px;
}

/* =========================================================
   WS Engine — Vocabulary: remove bullets in front of Listen
   + Headings sizing (corporate)
   ========================================================= */

/* 1) Remove the bullet ONLY when the LI contains an inline TTS button */
.ws-lesson .ws-box li:has(> .ws-tts-inline-wrap),
.ws-lesson .ws-box li:has(> .ws-tts) {
  list-style: none !important;
  padding-left: 0 !important;
}

/* Safety: if theme adds marker spacing */
.ws-lesson .ws-box li:has(> .ws-tts-inline-wrap)::marker,
.ws-lesson .ws-box li:has(> .ws-tts)::marker {
  content: "" !important;
}

/* If you want consistent alignment for vocab lines */
.ws-lesson .ws-box li > .ws-tts-inline-wrap,
.ws-lesson .ws-box li > .ws-tts {
  display: inline-flex;
  vertical-align: middle;
  margin-right: 10px;
}

/* 2) Increase titles size (Read/Listen first, Rules & Grammar, Vocabulary, Guided practice) */
.ws-lesson h2 {
  font-size: clamp(24px, 2.1vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 18px 0 10px;
}

.ws-lesson h3 {
  font-size: clamp(24px, 1.6vw, 22px);
  line-height: 1.8;
  margin: 14px 0 8px;
}

/* Optional: make the emoji headings feel a bit more “title-like” */
.ws-lesson h2 strong,
.ws-lesson h3 strong {
  font-weight: 700;
}

/* =========================================================
   WS Engine — Exercises Premium (startup trendy + accents)
   Add at END of ws-core.css
   ========================================================= */

.ws-ex-group-inner{
  margin: 18px 0 26px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(15,23,42,.10);
  box-shadow: 0 14px 40px rgba(15,23,42,.08);
  background: radial-gradient(1200px 500px at 0% 0%, rgba(99,102,241,.12), transparent 40%),
              radial-gradient(800px 400px at 100% 0%, rgba(16,185,129,.10), transparent 35%),
              linear-gradient(180deg, #ffffff, #f7f9fc);
}

/* Accent alignment (maps ws-box-* colors) */
.ws-ex-group-inner.accent-blue  { --acc: 59,130,246; }
.ws-ex-group-inner.accent-green { --acc: 34,197,94; }
.ws-ex-group-inner.accent-red   { --acc: 239,68,68; }
.ws-ex-group-inner.accent-yellow{ --acc: 245,158,11; }

.ws-ex-group-inner{
  position: relative;
  overflow: hidden;
}
.ws-ex-group-inner:before{
  content:"";
  position:absolute;
  left:0; top:0; bottom:0;
  width:6px;
  background: rgba(var(--acc), .65);
}

/* Progress */
.ws-progress{ margin: 2px 0 16px; }
.ws-progress-track{
  height: 10px;
  border-radius: 999px;
  background: rgba(15,23,42,.08);
  overflow: hidden;
}
.ws-progress-fill{
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(var(--acc), .95), rgba(99,102,241,.85));
  box-shadow: 0 10px 25px rgba(var(--acc), .18);
  transition: width .25s ease;
}
.ws-progress-meta{
  display:flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  color: rgba(15,23,42,.70);
  font-weight: 600;
  font-size: 13px;
}
.ws-progress-count{
  color: rgba(15,23,42,.78);
}
.ws-progress-hint{
  opacity: .9;
}

/* Exercise cards */
.ws-ex{
  background: rgba(255,255,255,.95);
  border: 1px solid rgba(15,23,42,.10);
  border-radius: 18px;
  padding: 16px;
  margin: 14px 0;
  box-shadow: 0 8px 26px rgba(15,23,42,.06);
}

.ws-ex-head{
  display:flex;
  align-items:flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.ws-ex-prompt{
  font-weight: 750;
  color: #0f172a;
  line-height: 1.35;
}

/* Badges */
.ws-badge{
  display:inline-flex;
  align-items:center;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .2px;
  white-space: nowrap;
}
.ws-badge-practice{
  background: rgba(99,102,241,.12);
  border: 1px solid rgba(99,102,241,.22);
  color: #3730a3;
}
.ws-badge-optional{
  background: rgba(16,185,129,.12);
  border: 1px solid rgba(16,185,129,.22);
  color: #065f46;
}

/* Options: trendy tiles */
.ws-ex-options{
  display:grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 10px 0 12px;
}
@media (min-width: 720px){
  .ws-ex-options{ grid-template-columns: 1fr 1fr; }
}

.ws-ex-option{
  position: relative;
  display:flex;
  align-items:flex-start;
  gap: 12px;
  padding: 12px 12px;
  border-radius: 16px;
  border: 1px solid rgba(15,23,42,.10);
  background: linear-gradient(180deg, #ffffff, rgba(15,23,42,.02));
  cursor: pointer;
  transition: transform .08s ease, box-shadow .14s ease, border-color .14s ease;
  user-select: none;
}
.ws-ex-option:hover{
  transform: translateY(-1px);
  border-color: rgba(15,23,42,.14);
  box-shadow: 0 14px 30px rgba(15,23,42,.08);
}

/* hide native radio but keep accessible */
.ws-ex-option input{
  position:absolute;
  opacity:0;
  pointer-events:none;
}

/* custom selector */
.ws-ex-option::before{
  content:"";
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(15,23,42,.22);
  background: #fff;
  margin-top: 2px;
  flex: 0 0 auto;
  box-shadow: inset 0 0 0 3px #fff;
}
.ws-ex-option-text{
  color: #0f172a;
  line-height: 1.35;
}

/* selected */
.ws-ex-option:has(input:checked){
  border-color: rgba(var(--acc), .45);
  background: radial-gradient(600px 220px at 0% 0%, rgba(var(--acc), .12), transparent 45%),
              linear-gradient(180deg, #fff, rgba(var(--acc), .03));
  box-shadow: 0 16px 34px rgba(var(--acc), .12);
}
.ws-ex-option:has(input:checked)::before{
  border-color: rgba(var(--acc), .70);
  background: radial-gradient(circle at 50% 50%, rgba(var(--acc), .95) 0 45%, #fff 46% 100%);
}

/* Fill blank */
.ws-ex-row{
  display:flex;
  gap: 10px;
  align-items:center;
  flex-wrap: wrap;
  margin-top: 8px;
}
.ws-ex-input{
  flex: 1 1 260px;
  min-width: 220px;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(15,23,42,.12);
  background: #fff;
  font-size: 1rem;
  outline: none;
  transition: box-shadow .14s ease, border-color .14s ease;
}
.ws-ex-input:focus{
  border-color: rgba(var(--acc), .55);
  box-shadow: 0 0 0 5px rgba(var(--acc), .12);
}

/* Feedback pill */
.ws-ex-feedback{
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  font-weight: 700;
  line-height: 1.35;
  border: 1px solid rgba(15,23,42,.10);
  background: rgba(15,23,42,.03);
  color: rgba(15,23,42,.70);
}
.ws-ex-feedback-ok{
  background: rgba(34,197,94,.10);
  border-color: rgba(34,197,94,.22);
  color: #14532d;
}
.ws-ex-feedback-bad{
  background: rgba(239,68,68,.10);
  border-color: rgba(239,68,68,.22);
  color: #7f1d1d;
}

/* Completed state (subtle celebration) */
.ws-ex.is-complete{
  border-color: rgba(34,197,94,.22);
  box-shadow: 0 18px 50px rgba(34,197,94,.08);
}
.ws-ex.is-complete:after{
  content: "✓ Completed";
  position: absolute;
  transform: translateY(-8px);
  right: 18px;
  margin-top: -10px;
  background: rgba(34,197,94,.12);
  border: 1px solid rgba(34,197,94,.22);
  color: #14532d;
  padding: 6px 10px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 12px;
}

/* Dictation button inside exercises */
.ws-ex-tts{ margin: 8px 0 10px; }
.ws-ex-tts .ws-btn-tts{
  background: rgba(var(--acc), .10);
  color: rgba(var(--acc), 1);
  border: 1px solid rgba(var(--acc), .22);
  box-shadow: none;
}
.ws-ex-tts .ws-btn-tts:hover{
  transform: translateY(-1px);
  background: rgba(var(--acc), .14);
}

/* =========================================================
   WS Engine — Read / Listen First Premium Frame
   ========================================================= */

/* cible la première vraie section texte après le header */
.ws-lesson .ws-section:has(h3:contains("Read/Listen")) ,
.ws-lesson .ws-section:first-of-type{
  position: relative;
  margin: 22px 0 26px;
  padding: 20px 22px;
  border-radius: 20px;
  background:
    radial-gradient(600px 240px at 0% 0%, rgba(99,102,241,.12), transparent 45%),
    linear-gradient(180deg, #ffffff, #f7f9fc);
  border: 1px solid rgba(15,23,42,.12);
  box-shadow: 0 18px 50px rgba(15,23,42,.08);
  overflow: hidden;
}

/* bande verticale accent */
.ws-lesson .ws-section:first-of-type:before{
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, #6366f1, #22c55e);
  box-shadow: 0 8px 24px rgba(99,102,241,.35);
}

/* titre Read/Listen */
.ws-lesson .ws-section:first-of-type h3{
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: .3px;
  margin-bottom: 10px;
  color: #0f172a;
}

/* texte du paragraphe */
.ws-lesson .ws-section:first-of-type p{
  font-size: 1.02rem;
  line-height: 1.55;
  color: rgba(15,23,42,.85);
}

/* bouton listen dans cette zone */
.ws-lesson .ws-section:first-of-type .ws-btn-tts{
  background: linear-gradient(135deg, #6366f1, #22c55e);
  border: none;
  box-shadow: 0 12px 28px rgba(99,102,241,.28);
}

.ws-lesson .ws-section:first-of-type .ws-btn-tts:hover{
  transform: translateY(-1px);
  box-shadow: 0 18px 36px rgba(99,102,241,.35);
}


