/* v111 — Photos de projet, et la vue téléphone (voir la seconde partie). */

/* ── Photos de projet ── */
.photos-form { display:flex; flex-direction:column; gap:8px; margin:8px 0; }
.photos-form select, .photos-form input[name="commentaire"] { margin:0; }
.photos-boutons { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.photos-boutons .btn { display:flex; align-items:center; justify-content:center;
                       min-height:52px; margin:0; cursor:pointer; text-align:center; }
.photos-etat { margin:0; font-size:.85rem; font-weight:600; }
.photos-etat:empty { display:none; }
.photos-occupe { pointer-events:none; opacity:.5; }
.photos-liens { display:flex; flex-wrap:wrap; gap:4px 14px; font-size:.82rem; }
.photos-jour { font-size:.9rem; margin:14px 0 6px; }
.photos-grille { display:grid; grid-template-columns:repeat(auto-fill, minmax(150px, 1fr)); gap:8px; }
.photos-grille figure { margin:0; }
.photos-grille img { width:100%; aspect-ratio:4/3; object-fit:cover; border-radius:8px; display:block; }
.photos-grille figcaption { font-size:.72rem; color:var(--texte-2, #6b7280); margin-top:2px; }
.photos-dossier { margin-top:14px; padding-top:10px; border-top:1px solid var(--trait, #dcdfe6); }
@media (max-width: 700px) {
  .photos-grille { grid-template-columns:repeat(3, 1fr); gap:4px; }
  .photos-grille figcaption { display:none; }
}

/* ══════════════════════════════════════════════════════════════════
   v111 — LA VUE TÉLÉPHONE : ON NE DÉFILE QUE DE HAUT EN BAS
   « Aujourd'hui tu navigues du haut vers le bas mais aussi de la gauche vers
   la droite. J'aimerais n'avoir qu'à naviguer du haut vers le bas. Très
   simple, avec toutes les infos, pas une page trop longue, et les boutons
   faciles d'accès. »
   - Un tableau plus large que l'écran devient une pile de fiches (voir
     telephone.js) : une fiche par ligne, deux colonnes « libellé / valeur ».
   - La grille de planification : une fiche par personne, seulement les
     semaines où elle travaille.
   - Les cartes et les jauges se resserrent ; rien n'est retiré.
   - Le bouton d'enregistrement d'une grille reste collé au-dessus de la
     barre du bas.
   ══════════════════════════════════════════════════════════════════ */
@media (max-width: 760px) {
  html, body { overflow-x: hidden; }
  .card { padding: 12px; margin-bottom: 10px; }
  .card h2 { font-size: 1.05rem; margin-bottom: 6px; }
  h1 { font-size: 1.45rem; }

  /* Jauges d'heures : la même information, moitié moins haute. */
  .budget-chiffres { margin: 2px 0; }
  .budget-grand { font-size: 1.5rem; }
  .budget-pied { font-size: .82rem; }

  /* ── Tableaux en fiches ── */
  table.en-fiches, table.en-fiches > tbody { display: block; width: 100% !important; min-width: 0 !important; }
  table.en-fiches > thead, table.en-fiches tr.fiche-tete { display: none; }
  table.en-fiches tr { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 6px 8px;
                       padding: 10px 2px; border-bottom: 1px solid var(--trait, #dcdfe6); }
  table.en-fiches tr > td, table.en-fiches tr > th {
    display: block; position: static !important; min-width: 0 !important; width: auto !important;
    max-width: none !important; border: 0 !important; padding: 0 !important; text-align: left;
    background: none; white-space: normal; }
  table.en-fiches tr > :first-child { grid-column: 1 / -1; font-weight: 700; font-size: .95rem; }
  table.en-fiches tr > .fiche-pleine { grid-column: 1 / -1; }
  table.en-fiches [data-label]::before { content: attr(data-label); display: block;
       font-size: .68rem; font-weight: 600; color: var(--texte-2, #6b7280);
       text-transform: none; letter-spacing: 0; margin-bottom: 2px; text-align: left; }
  table.en-fiches input:not([type=checkbox]):not([type=radio]) { min-height: 40px; padding: 6px 8px; margin: 0; }
  table.en-fiches select { margin: 0; }
  table.en-fiches tr > :empty { display: none; }
  table.en-fiches input:not([type=checkbox]):not([type=radio]), table.en-fiches select:not(.select2-hidden-accessible) {
       width: 100% !important; min-width: 0 !important; }
  .table-responsive:has(> table.en-fiches), .table-large:has(table.en-fiches) { overflow: visible; }

  /* ── Grille de planification : une fiche par personne ── */
  .mo-defilement:has(table.en-fiches) { overflow: visible; }
  table.mo-tableau.en-fiches tr.mo-ligne-chantier, table.mo-tableau.en-fiches tr.mo-ligne-projet,
  table.mo-tableau.en-fiches tr.mo-ligne-quart { display: block; padding: 0; border: 0; }
  table.mo-tableau.en-fiches tr.mo-ligne-chantier > th,
  table.mo-tableau.en-fiches tr.mo-ligne-projet > th,
  table.mo-tableau.en-fiches tr.mo-ligne-quart > th { padding: 6px 10px !important; }
  table.mo-tableau.en-fiches tr.mo-ligne-chantier > th { color: #fff; }
  table.mo-tableau.en-fiches tr.mo-espace { display: block; height: 8px; padding: 0; }
  table.mo-tableau.en-fiches tr.mo-ligne-personne,
  table.mo-tableau.en-fiches tr.mo-ligne-ajout,
  table.mo-tableau.en-fiches tr.mo-ligne-etapes { grid-template-columns: 1fr; padding: 8px 6px; }
  table.mo-tableau.en-fiches td.mo-vide { display: none; }
  table.mo-tableau.en-fiches .mo-case { align-items: flex-start; }
  table.mo-tableau.en-fiches .mo-col-lieu .mo-personne,
  table.mo-tableau.en-fiches .mo-col-lieu .mo-sous { display: inline; margin-right: 6px; }

  table.mo-tableau.en-fiches td.mo-cellule { display: flex; align-items: center; gap: 6px; }
  table.mo-tableau.en-fiches td.mo-cellule[data-label]::before { width: 66px; flex: 0 0 66px; margin: 0; font-size: .62rem; line-height: 1.2; }
  table.mo-tableau.en-fiches .mo-case { flex-direction: row; flex-wrap: wrap; gap: 4px; padding: 2px; }
  table.mo-tableau.en-fiches .mo-jours { gap: 2px; }
  table.mo-tableau.en-fiches .mo-jours button { width: 24px; height: 28px; font-size: .66rem; }
  table.mo-tableau.en-fiches .mo-case { flex-wrap: nowrap; align-items: center; }
  table.mo-tableau.en-fiches .mo-case-pied { flex-wrap: wrap; justify-content: flex-start; }
  table.mo-tableau.en-fiches .mo-case-pied:empty { display: none; }

  /* ── Carte trop longue : repliée derrière son titre ── */
  .carte-pliee:not(.carte-ouverte) > :not(h2) { display: none; }
  .carte-pliee > h2 { cursor: pointer; margin-bottom: 0; }
  .carte-pliee > h2::after { content: "▸ afficher"; float: right; font-size: .75rem;
       font-weight: 600; color: var(--accent, #556a88); margin-top: 4px; }
  .carte-pliee.carte-ouverte > h2::after { content: "▾ replier"; }
  .carte-pliee.carte-ouverte > h2 { margin-bottom: 8px; }

  /* Les onglets d'une page passent à la ligne au lieu de défiler de côté. */
  .fiche-onglets { flex-wrap: wrap; overflow-x: visible !important; }

  /* ── Les boutons restent sous le pouce ── */
  .barre-collee { position: sticky; z-index: 30;
                  bottom: calc(var(--bottom-h, 64px) + 18px + env(safe-area-inset-bottom, 0px));
                  background: var(--carte, #fff); padding: 8px; margin: 8px -4px 0;
                  border-radius: 14px; box-shadow: 0 4px 18px rgba(0,0,0,.14); }
  .barre-collee button, .barre-collee .btn { flex: 1; min-height: 48px; }
}
