/* =======================================================
   tp.css — Page Travaux Pratiques (Bloc 1 & Bloc 2)
   ======================================================= */


/* -------------------------------------------------------
   EN-TÊTE DE BLOC
   ------------------------------------------------------- */
.bloc-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.bloc-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.3rem 0.8rem;
  border-radius: 4px;
  white-space: nowrap;
}
.b1 {
  background: rgba(110,159,255,0.15);
  color: var(--indigo);
  border: 1px solid rgba(110,159,255,0.3);
}
.b2 {
  background: rgba(57,211,83,0.12);
  color: var(--teal);
  border: 1px solid rgba(57,211,83,0.3);
}

.bloc-title {
  font-family: var(--font-b);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-2);
}

.bloc-spacer { margin-top: 3.5rem; }


/* -------------------------------------------------------
   GRILLE DE CARTES TP
   ------------------------------------------------------- */
.tp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border2);
  border-radius: 8px;
  overflow: hidden;
}

.tp-card {
  background: var(--card);
  padding: 1.4rem 1.5rem;
  position: relative;
  transition: background .2s;
}
/* -------------------------------------------------------
   MODAL PDF — même style que presentation.css
   ------------------------------------------------------- */
.tp-card { cursor: pointer; }

.pdf-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 999;
  align-items: center;
  justify-content: center;
}
.pdf-modal.active { display: flex; }

.pdf-modal__box {
  width: 90vw;
  height: 90vh;
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.1);
  display: flex;
}

.pdf-modal__sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.pdf-modal__sb-header {
  padding: 1.2rem 1rem;
  border-bottom: 1px solid var(--border);
}

.pdf-modal__sb-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.pdf-modal__sb-num {
  font-size: 0.62rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.pdf-modal__sb-badge {
  display: inline-block;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
}
.pdf-modal__sb-badge.b1 {
  background: rgba(110,159,255,0.12);
  color: var(--indigo);
  border: 1px solid rgba(110,159,255,0.25);
}
.pdf-modal__sb-badge.b2 {
  background: rgba(57,211,83,0.1);
  color: var(--teal);
  border: 1px solid rgba(57,211,83,0.25);
}

.pdf-modal__sb-tags {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.pdf-modal__sb-tags span {
  font-size: 0.58rem;
  font-weight: 500;
  padding: 0.15rem 0.45rem;
  border: 1px solid var(--border2);
  border-radius: 3px;
  color: var(--text-2);
}

.pdf-modal__sb-actions {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: auto;
}

.pdf-modal__dl {
  background: transparent;
  border: 1px solid rgba(110,159,255,0.35);
  color: var(--indigo);
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, color .2s;
  font-family: var(--font-b);
  text-align: left;
}
.pdf-modal__dl:hover { background: var(--indigo); color: #0d1117; }

.pdf-modal__close {
  background: transparent;
  border: 1px solid rgba(244,112,103,0.3);
  color: var(--rose);
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, color .2s;
  font-family: var(--font-b);
  text-align: left;
}
.pdf-modal__close:hover { background: var(--rose); color: #0d1117; }

#pdf-frame {
  flex: 1;
  height: 100%;
}

/* -------------------------------------------------------
   CONTENU D'UNE CARTE TP
   ------------------------------------------------------- */

/* Ligne haute : numéro + bouton téléchargement */
.tp-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.7rem;
}

.tp-n {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Bouton ↓ de téléchargement */
.tp-dl {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--border2);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  transition: background .2s, color .2s;
  text-decoration: none;
  line-height: 1;
}
/* Couleur du bouton ↓ selon le bloc au hover */
.b1-card .tp-dl:hover { background: var(--indigo); color: #0d1117; }
.b2-card .tp-dl:hover { background: var(--teal);   color: #0d1117; }

.tp-title {
  font-family: var(--font-h);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
  line-height: 1.25;
}

.tp-desc {
  font-size: 0.78rem;
  line-height: 1.7;
  color: var(--text-2);
  margin-bottom: 0.9rem;
}

/* Étiquettes de technologie */
.tp-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tp-tags span {
  font-size: 0.62rem;
  font-weight: 500;
  border: 1px solid var(--border2);
  padding: 0.18rem 0.55rem;
  border-radius: 3px;
  color: var(--text-2);
}


/* -------------------------------------------------------
   RESPONSIVE
   ------------------------------------------------------- */
@media (max-width: 560px) {
  .tp-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .pdf-modal__sidebar { display: none; }
}
