/* =========================
   BASE
========================= */

body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: #AAA;
}

@media (min-width: 768px) {
  main {
    max-width: 1024px;
    margin: auto;
  }
}

/* =========================
   BANDEAU SUPÉRIEUR
========================= */

#top-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1rem;
  background: #222;
  color: #fff;
  font-weight: 600;
}

.banner-title {
  font-size: 0.95rem;
}

#info-btn {
  font-weight: bold;
  cursor: pointer;
  background: none;
  border: 1px solid #fff;
  color: #fff;
  padding: 0.3rem 0.6rem;
}

/* =========================
   ONGLES QUESTIONS
========================= */

#questions-tabs {
  display: flex;
  position: sticky;
  top: 0;
  background: #f5f5f5;
  z-index: 10;
  background: #DDD;
}

.tab {
	flex: 1;
	display: flex;
	align-items: flex-end;
	justify-content: center; 
	text-align: center;
	padding: 0.8rem 0.2rem;
	text-decoration: none;
	color: #000;
	font-weight: 600; 
	border: solid 1px #AAA;
	border-bottom-width: 3px;
	cursor: pointer;
}

.tab:last-child {
  border-right: none;
}

.tab.active {
	background: #b6ffd8;
	border-width: 2px 2px 0 2px;
	color: #b40909;
}

/* =========================
   RÉPONSES
========================= */

#reponses {
  background: #FFF;
  font-size: 0.9em;
}

.response-item {
  padding: 0 1rem;
  background: #fff;
}

.response-item p {
  white-space: pre-wrap;
}

.response-item h3 {
    color: #b40909;
    margin-top: 0;
}
.response-header {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.response-content {
  margin-top: 0.5rem;
}

.response-content p {
  white-space: pre-wrap;
}

.question-label {
  font-weight: bold;
  font-size: 110%;
  margin-top: 0.8rem;
}

/* =========================
   OVERLAY POPUP
========================= */

#info-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  z-index: 1000;
}

#info-overlay.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

.info-content {
  background: #fff;
  max-width: 90vw;
  max-height: 90vh;
  margin: 1rem;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
}

.info-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid #ddd;
  background: #ddd;
  flex-shrink: 0;
}

.info-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

#close-info {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
}

.info-body {
  padding: 1rem;
  overflow-y: auto;
  line-height: 1.5;
  flex-grow: 1;
}
#listes-panel {
  padding: 0.8rem 1rem;
  background: #ddd;
  text-align: center;
   line-height: 2rem;
}
#listes-selector {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    gap: 0.2rem;
    font-size: 0.8em;
    background: #DDD;
    padding: 1rem;
}

.liste-checkbox {
  font-weight: 600;
  cursor: pointer;
}

#question-long {
  font-weight: bold;
  padding: 1rem;
  background: #b6ffd8;
  color: #000;
}

table.municipales-grenoble-2026 {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.7rem;
  line-height: 1.4;
  background: #fff;
}

/* En-têtes */
table.municipales-grenoble-2026 thead th {
  background: #f2f2f2;
  font-weight: 700;
  text-align: left;
  padding: 0.6rem 0.7rem;
  border-bottom: 2px solid #999;
  border-right: 1px solid #ccc;
}

table.municipales-grenoble-2026 thead th:last-child {
  border-right: none;
}

/* Cellules */
table.municipales-grenoble-2026 tbody td {
  padding: 0.6rem 0.7rem;
  vertical-align: top;
  border-bottom: 1px solid #ddd;
  border-right: 1px solid #eee;
}

table.municipales-grenoble-2026 tbody td:last-child {
  border-right: none;
}

/* Alternance des lignes */
table.municipales-grenoble-2026 tbody tr:nth-child(even) {
  background: #eee;
}

/* Effet au survol (facultatif mais utile) */
table.municipales-grenoble-2026 tbody tr:hover {
  background: #f0f7ff;
}


/* ==========================================
   BOUTONS IMPRESSION
========================================== */
#printBtn,
#pdfBtn {
    display: none;
    position: fixed;
    bottom: 2em;
    right: 2em;
    z-index: 9999;
    padding: 1em;
    border-radius: 2em;
    border: none;
    background: #1976d2;
    color: white;
    opacity: 0.85;
    font-size: 15px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

#pdfBtn {
    bottom: 2vw;
    right: 2vw;
    width: 96vw;
}
/* hover */
#printBtn:hover,
#pdfBtn:hover {
    background: #0d5bb5;
}

/*    DESKTOP → IMPRIMER*/
@media (min-width: 769px) {#printBtn { display: block;  } }
/*    MOBILE → EXPORTER*/
@media (max-width: 768px) { #pdfBtn { display: block; } }
/* ===========================
   MODE IMPRESSION
=========================== */

@media print {

    /* cacher tout */
    body * {
        visibility: hidden;
    }

    /* afficher uniquement le div ciblé */
    #reponses-listes,
    #reponses-listes * {
        visibility: visible;
    }

    /* repositionner le bloc */
    #reponses-listes {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }

    /* cacher le bouton */
    #printBtn {
        display: none !important;
    }
}
