/*
 * Omamori - Styles documentation (v1.21).
 *
 * Workflows visuels (diagrammes d'etapes type BPMN, en HTML/SVG inline,
 * responsives, sans dependance externe) + accordeons (balise <details>
 * native, interactive et accessible, zero JS requis).
 *
 * Charge uniquement sur les pages documentation via le layout.
 */

/* =====================================================================
   WORKFLOW (diagramme d'etapes horizontal -> vertical sur mobile)
   ===================================================================== */
.oma-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0;
  margin: 22px 0 26px;
  padding: 18px;
  background: linear-gradient(135deg, #f3faf9 0%, #eef6f5 100%);
  border: 1px solid #d7e8e6;
  border-radius: 14px;
}
.oma-flow-title {
  flex: 1 0 100%;
  font-weight: 700;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #178c81;
  margin-bottom: 14px;
}
.oma-flow-step {
  flex: 1 1 0;
  min-width: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 4px 6px;
  position: relative;
}
.ofs-num {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #1ea69a;
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(30, 166, 154, 0.28);
  flex: 0 0 auto;
}
.oma-flow-step.is-end .ofs-num { background: #0f8a5f; }
.oma-flow-step.is-decision .ofs-num {
  border-radius: 8px;
  transform: rotate(45deg);
  background: #e8a33d;
}
.oma-flow-step.is-decision .ofs-num span { transform: rotate(-45deg); }
.ofs-lbl {
  font-size: .86rem;
  font-weight: 600;
  color: #0f2c2a;
  line-height: 1.25;
}
.ofs-sub {
  font-size: .76rem;
  color: #6c807c;
  line-height: 1.2;
}
/* Fleche entre les etapes (pseudo-element) */
.oma-flow-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 19px;
  right: -8px;
  width: 16px;
  height: 2px;
  background: #9cc6c1;
}
.oma-flow-step:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 14px;
  right: -10px;
  border-left: 7px solid #9cc6c1;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  z-index: 1;
}

@media (max-width: 720px) {
  .oma-flow { flex-direction: column; gap: 4px; }
  .oma-flow-step {
    flex-direction: row;
    justify-content: flex-start;
    text-align: left;
    min-width: 0;
    width: 100%;
    gap: 12px;
    padding: 8px 4px;
  }
  .ofs-txt { display: flex; flex-direction: column; }
  /* Fleche verticale sur mobile */
  .oma-flow-step:not(:last-child)::after {
    top: auto; bottom: -4px; right: auto; left: 18px;
    width: 2px; height: 10px;
  }
  .oma-flow-step:not(:last-child)::before {
    top: auto; bottom: -6px; right: auto; left: 14px;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 7px solid #9cc6c1;
    border-bottom: 0;
  }
}

/* =====================================================================
   ACCORDEON (balise <details>/<summary> native)
   ===================================================================== */
.oma-acc { margin: 20px 0 26px; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border, #e3eae9); }
.oma-acc-item { border-bottom: 1px solid var(--border, #e3eae9); background: #fff; }
.oma-acc-item:last-child { border-bottom: 0; }
.oma-acc-item > summary {
  list-style: none;
  cursor: pointer;
  padding: 15px 46px 15px 18px;
  font-weight: 600;
  font-size: .98rem;
  color: #0f2c2a;
  position: relative;
  transition: background .15s ease;
  user-select: none;
}
.oma-acc-item > summary::-webkit-details-marker { display: none; }
.oma-acc-item > summary:hover { background: #f4f7f7; }
/* Chevron */
.oma-acc-item > summary::after {
  content: "";
  position: absolute;
  right: 18px;
  top: 50%;
  width: 9px; height: 9px;
  border-right: 2.4px solid #1ea69a;
  border-bottom: 2.4px solid #1ea69a;
  transform: translateY(-65%) rotate(45deg);
  transition: transform .2s ease;
}
.oma-acc-item[open] > summary::after { transform: translateY(-35%) rotate(-135deg); }
.oma-acc-item[open] > summary { background: #f3faf9; color: #178c81; }
.oma-acc-body {
  padding: 4px 18px 18px;
  font-size: .94rem;
  line-height: 1.55;
  color: #33474a;
}
.oma-acc-body ol, .oma-acc-body ul { margin: 8px 0 8px 18px; }
.oma-acc-body li { margin-bottom: 5px; }
.oma-acc-body .doc-note, .oma-acc-body .doc-warn { margin-top: 12px; }

/* =====================================================================
   BADGE "module a configurer" / "natif" / "Omamori"
   ===================================================================== */
.oma-tag {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  padding: 3px 9px;
  border-radius: 999px;
  margin-left: 6px;
  vertical-align: middle;
}
.oma-tag.config { background: #fdf0d8; color: #9a6a16; }
.oma-tag.yofi   { background: #e4f3ee; color: #0f8a5f; }
.oma-tag.new    { background: #e6f0fb; color: #1d6fc4; }
