/* Tableau comparatif « Ferr Studio vs ... » : composant partage.
   Pages : /branding/, /site-web/, /motion-design/, /mascotte/, /generateur-ia/.
   Balisage : .sw-table > .sw-tr (.sw-th pour l'en-tete), 4 colonnes, la
   derniere = Ferr Studio. Une page sombre redefinit les --cmp-* sur .sw-table
   (fond, filets, textes doux, noms des colonnes 2 et 3 sur mobile). */
/* comparatif : bloc blanc a gauche, colonne offre detachee en carte qui depasse */
/* --c4 = largeur exacte de la derniere colonne (grille 1.32 + 1 + 1 + 1 = 4.32fr) */
.sw-table {
  --cmp-fond: var(--white, #fff);
  --cmp-filet: var(--line, rgb(20 20 20 / .12));
  --cmp-doux: var(--muted, #6a6a72);
  --cmp-doux2: #8e8e8e;
  --cmp-marque: var(--brand, #e4002b);
  --cmp-pastille: rgb(20 20 20 / .07);
  --cmp-col2: "Freelance";
  --cmp-col3: "Agence";
}
.sw-table { --c4: calc(100% / 4.32); position: relative; margin-top: 44px; border-radius: 30px; background: none; overflow: visible; }
.sw-table::before { content: ""; position: absolute; inset: 0 calc(var(--c4) + 16px) 0 0; border-radius: 30px; background: var(--cmp-fond); box-shadow: inset 0 0 0 1px var(--cmp-filet); pointer-events: none; }
.sw-table::after { content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: var(--c4); border-radius: 30px; background: var(--cmp-marque) url("/media/img/ferr-card-bg-4.webp") center / cover no-repeat; pointer-events: none; }
.sw-tr { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.32fr) repeat(3, minmax(0, 1fr)); align-items: stretch; }
/* le vide entre le bloc blanc et la carte offre, pris sur la 3e colonne : les
   filets s arretent ainsi exactement au bord du bloc blanc */
.sw-tr > div:nth-child(3) { margin-right: 16px; }
.sw-tr > div:nth-child(-n+3) { border-top: 1px solid var(--cmp-filet); }
.sw-tr > div:last-child { color: #fff; }
.sw-tr:not(.sw-th) > div:last-child { border-top: 1px solid rgb(255 255 255 / .16); }
.sw-tr > div:last-child .sw-no { background: rgb(255 255 255 / .16); color: rgb(255 255 255 / .8); }
.sw-tr:first-child > div { border-top: 0; }
.sw-tr:first-child { border-top: 0; }
.sw-tr > div { min-height: 88px; padding: 14px 24px; display: flex; align-items: center; font-size: 15px; line-height: 1.25; letter-spacing: -.02em; }
.sw-tr > div:not(:first-child) { justify-content: center; text-align: center; }
.sw-th { font-weight: 500; }
.sw-th > div { min-height: 152px; }
.sw-th > div { flex-direction: column; align-items: center; justify-content: center; gap: 5px; font-size: 20px; }
.sw-th > div:first-child { align-items: flex-start; font-size: 15px; color: var(--cmp-doux); font-weight: 500; }
.sw-th small { display: block; font-weight: 400; font-size: 15px; line-height: 1.35; color: var(--cmp-doux2); }
.sw-th > div:last-child, .sw-tr > div:last-child { background: transparent; color: #fff; }
.sw-th > div:last-child small { color: rgb(255 255 255 / .78); }
.sw-tr > div:last-child { font-weight: 500; }
.sw-tr > div.sw-stack { flex-direction: column; justify-content: center; gap: 5px; padding-top: 14px; padding-bottom: 14px; }
.sw-tr > div.sw-stack b { font-weight: 600; }
.sw-tr > div.sw-stack small { font-size: 12px; line-height: 1.35; font-weight: 400; color: rgb(255 255 255 / .8); }
.sw-tr > div:not(:last-child).sw-stack small { color: var(--cmp-doux); }
.sw-yes, .sw-no { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.sw-no { background: var(--cmp-pastille); color: var(--cmp-doux); }
.sw-yes { background: rgb(255 255 255 / .2); color: #fff; }

@media (max-width: 720px) {
  /* Comparatif mobile : cartes empilees, colonne Ferr toujours visible */
  .sw-table {
    overflow: visible;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .sw-table::before,
  .sw-table::after { display: none; }
  .sw-tr {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "crit crit"
      "free age"
      "ferr ferr";
    gap: 0;
    background: var(--cmp-fond);
    border-radius: 18px;
    box-shadow: inset 0 0 0 1px var(--cmp-filet);
    overflow: hidden;
  }
  .sw-tr > div:nth-child(1) { grid-area: crit; }
  .sw-tr > div:nth-child(2) { grid-area: free; }
  .sw-tr > div:nth-child(3) { grid-area: age; margin-right: 0; }
  .sw-tr > div:nth-child(4) { grid-area: ferr; }
  .sw-tr > div {
    min-height: 0;
    padding: 14px 16px;
    font-size: 14px;
    border-top: 0 !important;
  }
  .sw-tr > div:nth-child(-n+3) { border-top: 0; }
  .sw-tr > div:nth-child(1) {
    border-bottom: 1px solid var(--cmp-filet);
    font-weight: 600;
    justify-content: flex-start;
    text-align: left;
  }
  .sw-tr > div:nth-child(2),
  .sw-tr > div:nth-child(3) {
    border-bottom: 1px solid var(--cmp-filet);
    flex-direction: column;
    gap: 8px;
    padding-top: 12px;
    padding-bottom: 12px;
  }
  .sw-tr > div:nth-child(2) { border-right: 1px solid var(--cmp-filet); }
  .sw-tr > div:nth-child(2)::before,
  .sw-tr > div:nth-child(3)::before {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--cmp-doux);
  }
  .sw-tr:not(.sw-th) > div:nth-child(2)::before { content: var(--cmp-col2); }
  .sw-tr:not(.sw-th) > div:nth-child(3)::before { content: var(--cmp-col3); }
  .sw-tr > div:nth-child(4) {
    background: var(--cmp-marque) url("/media/img/ferr-card-bg-4.webp") center / cover no-repeat;
    color: #fff;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    text-align: left;
    gap: 6px;
    font-weight: 600;
    border-top: 0 !important;
  }
  .sw-tr:not(.sw-th) > div:nth-child(4)::before {
    content: "Ferr Studio";
    flex: none;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: rgb(255 255 255 / .78);
  }
  .sw-tr > div:last-child .sw-no {
    background: rgb(255 255 255 / .16);
    color: rgb(255 255 255 / .8);
  }
  .sw-tr > div.sw-stack { align-items: flex-start; }
  .sw-th {
    background: transparent;
    box-shadow: none;
    display: none;
  }
}
