@font-face {
	font-family: baliana;
	src: url(../fonts/baliana/Baliana.ttf);
}

p {
	color: #2E2E2E;
	white-space: pre-wrap;
}

ul a {
	/*background-color: #fce0ad;*/
	background-color: #B86B4A;
	/*color: #000000;*/
	color: #2E2E2E;
	padding: 20px;
	padding-bottom: 15px;
	padding-top: 15px;
	border-radius: 25px;
	text-decoration: none;
	font-weight: bold;
}

body{
	/*background-color: #bf1c1e;*/
	background-color: #fff7e1;
}

hr{
	/*color: #fce092;*/
	color: #1B4D3E;
}

.vote {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: 16px;
  margin: 0 auto;
  padding: 50px;
}

.livre_vote {
  width: 250px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  grid-row: span 4;
  align-items: center;
}

.cover {
	width: 100%;
	aspect-ratio: 2 / 3;
	overflow: hidden;
}

div{
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.cover img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.titre, .auteur{
	margin-top: 8px;
	font-size: 14px;
	text-align: center;
}

.election {
    display: flex;
    flex-direction: column;
    align-items: stretch;

    padding-top: 20px;
    padding-bottom: 20px;

    box-sizing: border-box;
}

.elected {
	display: flex;
	flex-direction: row;
}

.livreElu {
	height:661px;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.comments, .listVotesDash {
    flex: 1;
    max-height: 661px;

    display: flex;
    flex-direction: column;

    box-sizing: border-box;
    min-height: 0;

    margin-left: 100px;
    margin-right: 100px;

    padding-left: 50px;
    padding-right: 30px;
    padding-bottom: 50px;

    background-color: #B86B4A;
    border-radius: 25px;

    overflow: hidden;
}

.comments h2 {
    flex-shrink: 0;
    margin: 20px 0;
}

.comments_list, .listeVote {
    flex: 1;
    min-height: 0;

    overflow-y: auto;
    overflow-x: hidden;
    justify-content: flex-start;
    padding-right: 20px;
}

.solo_comment {
    flex: 1;
    min-height: 0;

    overflow-y: auto;
    justify-content: center;
    padding-right: 20px;
}

.livre_seul{
	max-width: 250px;
	display: grid;
	gap: 5px;
  justify-items: center;
}

.livre_solo{
	max-width: 500px;
	align-self: center;
	background-color: #B86B4A;
	padding: 20px;
	padding-bottom: 0;
	border-radius: 15px;

}

.livre_solo .titre {
	padding-top: 15px;
}

.comment {
    margin-bottom: 10px;
}

.comment_title, .comment_body, .comDash, .comTitleDash{
    border-style: solid;
    margin: 0;
}

.comment_title, .comTitleDash{
	display: flex;
	flex-direction: row;
	justify-content: space-between;
	background-color: #6B7F72;
	padding-top: 10px;
	padding-left: 10px;
	padding-bottom: 10px;
	padding-right: 10px;
}

.comment_body, .comDash{
	border-top: 0;
	padding-top: 10px;
	padding-left: 10px;
	padding-bottom: 10px;
	padding-right: 10px;
	background-color: #cdae99;
}

.comtitle, .userName, .comTitleDash{
	margin:0;
}

h1{
	padding-left: 10px;
	padding-right: 10px;
	padding-top: 10px;
	padding-bottom: 10px;
	font-size: 50px;
	/*background-color: #fce0ad;*/
	background-color: #B86B4A;
	width: fit-content;
	border-radius: 25px;
	font-family: baliana;
	color: #2E2E2E;
}

ul {
	display: flex;
	justify-content: space-evenly;
}

.infos {
	margin: 20px;
	color: #2E2E2E;
}

.footer-infos p{
	margin-left: 25px;
	font-size: 75%;
}

header {
	background-color: #1B4D3E;
}

.header-elements {
	display: flex;
	flex-direction: row;
	justify-content: space-between;
	margin-left: 40px;
	align-items: center;
}

.header-elements nav {
	flex: 2;
}

button {
	background-color: #B86B4A;
	color: #2E2E2E;
	border-style: hidden;
	border-radius: 5px;
	padding: 5px;
	font-family: baliana;
	font-size: 35px;
	padding-left: 15px;
	padding-right: 15px;
	cursor: pointer;
}

.formContainer {
	display: flex;
	align-items: center;
}

.formComments{
	display: flex;
	flex-direction: column;
	gap: 25px;
	width: 500px;
}

.formComments input{
	height: 25px;
}

.formComments button {
	width: 250px;
	align-self: center;
}

.formPseudo, .formMail, .formPassword {
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
}

.formPseudo div, .formMail div, .formPassword div {
	display: flex;
	flex-direction: row;
	justify-content: flex-start;
	
}

.modifier {
	align-self: center;
	background-color: #B86B4A;
	color: #2E2E2E;
	border-style: hidden;
	font-family: baliana;
	font-size: 20px;
	border-radius: 5px;
	padding-top: 5px;
	padding-bottom: 5px;
	padding-left: 7px;
	padding-right: 7px;
	margin-left: 15px;
}

.dashboard, .voteDash{
	display: flex;
	flex-direction: row;
	justify-content: flex-start;
	align-items: center;
}

.infosCompte {
	flex: 1;
	padding-left: 25px;
}

.coverDash {
	width: 150px;
	aspect-ratio: 2 / 3;
}

.comDash {
	overflow-y: auto;
	overflow-x: hidden;
}

.voteInfosDash {
	margin-left: 15px;
	max-height: 225px;
	flex-grow: 1;
}

.listeVote {
	gap: 5px;
}

.formChange {
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	align-items: center;
	gap: 15px;
	margin-bottom: 50px;
}

.formChange input{
	padding: 10px;
}

.formElemRow{
	flex-direction: row;
	justify-content: flex-start;
}

.erreur{
	color: red;
	font-size: 75%;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

/* Règles de base : évite les débordements */
img { max-width: 100%; }

.formComments textarea,
.formComments input {
	box-sizing: border-box;
	width: 100%;
}

.formComments { max-width: 100%; }

.formContainer {
	flex-direction: column;
	padding: 0 15px;
}

/* Un ul de liens sans <li> : on laisse les liens passer à la ligne */
ul {
	flex-wrap: wrap;
	gap: 10px;
	padding-left: 0;
	margin: 10px 0;
}

/* ---------- Tablette (≤ 900px) ---------- */
@media (max-width: 900px) {

	.header-elements { margin-left: 20px; margin-right: 20px; }

	/* Livre + commentaires : empilés au lieu de côte à côte */
	.elected { flex-direction: column; align-items: center; }

	.livreElu {
		height: auto;
		width: 100%;
		margin-bottom: 20px;
	}

	.comments,
	.listVotesDash {
		width: calc(100% - 40px);
		max-height: 500px;
		margin-left: 20px;
		margin-right: 20px;
		padding-left: 20px;
		padding-right: 10px;
		padding-bottom: 20px;
	}

	/* Page de vote : les livres passent à la ligne */
	.vote {
		flex-wrap: wrap;
		justify-content: center;
		padding: 20px;
	}

	/* Dashboard : infos du compte au-dessus des commentaires */
	.dashboard {
		flex-direction: column;
		align-items: stretch;
		gap: 20px;
	}

	.infosCompte { padding-left: 20px; padding-right: 20px; }

	.livre_solo { max-width: 300px; }
}

/* ---------- Téléphone (≤ 600px) ---------- */
@media (max-width: 600px) {

	/* En-tête : titre au-dessus, menu en dessous */
	.header-elements {
		flex-direction: column;
		align-items: stretch;
		margin-left: 10px;
		margin-right: 10px;
	}

	.header-elements nav { flex: none; }

	h1 {
		font-size: 32px;
		align-self: center;
		text-align: center;
	}

	ul { justify-content: center; }

	ul a {
		padding: 10px 16px;
		font-size: 14px;
	}

	button { font-size: 24px; }

	.modifier { font-size: 16px; }

	.infos { margin: 10px; }

	/* Un seul livre par ligne sur la page de vote */
	.vote { padding: 10px; gap: 30px; }

	.livre_vote { width: min(250px, 80%); }

	/* Commentaires un peu plus compacts */
	.comments,
	.listVotesDash {
		width: calc(100% - 20px);
		margin-left: 10px;
		margin-right: 10px;
		padding-left: 10px;
		padding-right: 5px;
		max-height: 450px;
		border-radius: 15px;
	}

	.comment_title { flex-direction: column; gap: 4px; }

	/* Dashboard : chaque vote en colonne */
	.voteDash { flex-direction: column; align-items: stretch; }

	.coverDash { width: 100px; align-self: center; }

	.voteInfosDash { margin-left: 0; max-height: none; }

	.formPseudo div,
	.formMail div,
	.formPassword div { flex-wrap: wrap; gap: 5px; }

	/* Formulaires (login, register, changement de mot de passe) */
	.formChange { padding: 0 15px; }

	.formChange input { width: 100%; box-sizing: border-box; }

	.formChange > div { width: 100%; }

	.formComments button { width: 100%; }

	.footer-infos p { margin-left: 10px; margin-right: 10px; }
}