/**********************************************************************
*
*              Mise en page spécifique Pokémon
*
**********************************************************************/


/**********************************************************************
*                         Structure générale
**********************************************************************/

.page-layout {
    grid-template-columns: 250px minmax(0, 1fr) 250px;

    width: auto;

    margin-left: 10px;
    margin-right: 10px;
}


/**********************************************************************
*                         Sidebar gauche
**********************************************************************/

.sidebar-colonne-gauche {
    grid-column: 1;

    min-width: 0;
}


/**********************************************************************
*                         Contenu central
**********************************************************************/

.contenu {
    grid-column: 2;

    min-width: 0;
    width: auto;

    margin: 10px;

    justify-self: stretch;
}


/**********************************************************************
*                         Sidebar droite
**********************************************************************/

.sidebar-colonne-droite {
    grid-column: 3;

    min-width: 0;
}


/**********************************************************************
*                         Boîtes des sidebars v3
**********************************************************************/

.sidebar-colonne-gauche .sidebar,
.sidebar-colonne-droite .sidebar {
	width: auto;

	padding: 0 20px 20px 20px;

	/*
	 * C'est la sidebar elle-même qui porte l'arrondi extérieur.
	 */
	border-radius: var(--taille-rond-boite);

	/*
	 * Coupe tout ce qui dépasse des coins arrondis.
	 */
	overflow: hidden;
}


/*
 * Le CSS général rend transparentes les sidebars
 * qui ne contiennent aucun lien.
 */
.sidebar-colonne-droite .sidebar:not(:has(a)) {
	background-color: var(--couleur-menu);
}


/**********************************************************************
*                         Titres des sidebars
**********************************************************************/

.sidebar h3 {
	background-image: url("img/titremenupoke2.jpg");
	background-repeat: no-repeat;
	background-position: center;
	background-size: 100% 100%;

	width: calc(100% + 40px);
	aspect-ratio: 1946 / 363;

	height: auto;
	min-height: 0;

	margin: 0 -20px 10px -20px;
	padding: 0 20px;

	box-sizing: border-box;

	display: flex;
	align-items: center;
	justify-content: center;

	text-align: center;

	border-radius: 0;
}


/**********************************************************************
*                         Limites du contenu
**********************************************************************/

.limite {
    width: 100%;
    max-width: 1050px;
    min-width: 0;

    box-sizing: border-box;
    overflow: hidden;
}

.limite img {
    max-width: 100% !important;
    height: auto !important;

    object-fit: contain;
}


/**********************************************************************
*                         Hasar'Dex
**********************************************************************/

.sidebar-colonne-gauche {
    min-width: 0;
}

.sidebar-colonne-gauche .sidebar {
    min-width: 0;
}

.sidebar-colonne-gauche .sidebar img {
    display: block;

    max-width: 100% !important;
    height: auto !important;

    margin-left: auto;
    margin-right: auto;
}

.sidebar-colonne-gauche .sidebar:has(.hasardex) > a {
	display: block;
	width: 100%;
	text-align: center;

	margin-top: 0.25em;
	margin-bottom: 0;
}

/* Le <br> après "Liste des Pokémon" devient inutile */
.sidebar-colonne-gauche .sidebar:has(.hasardex) > a + br {
	display: none;
}

/**********************************************************************
*                         Jaquette
**********************************************************************/

.jaquettes-jeu {
    text-align: center;

    margin: 20px 0;
}

.jaquette-jeu {
    max-width: 15%;
    height: auto;

    margin: 5px 10px;
}


/**********************************************************************
*                 Titres des boîtes centrales
**********************************************************************/

/*
 * Un peu moins d'espace en haut des boîtes centrales
 */
.contenu .boite-message {
    padding-top: 20px;
}


/*
 * Titres principaux internes
 */
.contenu .boite-message h3 {
    margin-top: 0;
    margin-bottom: 12px;
}


/*
 * Sous-titres internes
 */
.contenu .boite-message h4 {
    font-size: 120%;

    margin-top: 20px;
    margin-bottom: 10px;
}


/**********************************************************************
*                         Pokédex
**********************************************************************/

/*
 * Colonne de l'icône Pokémon
 */
.contenu .pokedex-image {
    width: 64px;
    min-width: 64px;
}


/*
 * Icône du Pokémon
 */
.contenu .pokedex-image > img {
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    height: 30px !important;

    display: inline-block;

    object-fit: contain;
}


/*
 * Types
 */
.contenu .pokedex-types {
    white-space: nowrap;
}

.contenu .pokedex-types img {
    width: auto !important;
    height: auto !important;
    max-width: none !important;

    display: inline-block;

    vertical-align: middle;

    margin: 2px;
}


/**********************************************************************
*                         Soluce
**********************************************************************/

.navigation-soluce {
    text-align: center;

    margin-top: 25px;
}


/**********************************************************************
*                         Images des listes Pokémon
**********************************************************************/

.contenu .pokemon-liste-image {
    width: 90px;
    min-width: 90px;
}

.contenu .pokemon-liste-image img {
    width: 70px !important;
    min-width: 70px !important;
    max-width: 70px !important;
    height: auto !important;
}


/**********************************************************************
*                         Personnages
**********************************************************************/

.personnage-fiche {
    display: flex;
    flex-wrap: wrap;

    align-items: flex-start;

    gap: 10px 20px;

    margin: 10px 0;
}

.personnage-fiche h4 {
    width: 100%;

    margin: 0;

    text-align: center;
}

.personnage-zone-image {
    flex: 0 0 auto;
}

.contenu .limite img.personnage-image {
	display: block;

	width: auto !important;
	height: auto !important;

	max-width: 180px !important;
	max-height: 260px !important;

	object-fit: contain;
}

.personnage-contenu {
    flex: 1;

    min-width: 0;
}


/*
 * Image à gauche
 */
.personnage-fiche-gauche .personnage-zone-image,
.personnage-fiche-droite .personnage-contenu {
    order: 1;
}


/*
 * Image à droite
 */
.personnage-fiche-gauche .personnage-contenu,
.personnage-fiche-droite .personnage-zone-image {
    order: 2;
}


.personnage-description {
    margin-bottom: 8px;
}


.personnage-groupe-introduction {
    margin-bottom: 10px;
}

.personnage-groupe-conclusion {
    margin-top: 10px;
}


/**********************************************************************
*                         Distribution Pokémon
**********************************************************************/


/**********************************************************************
*                         Bloc principal
**********************************************************************/

.distribution {
	display: grid;

	grid-template-columns:
		40%
		minmax(0, 1fr);

	gap: 25px;

	width: 100%;
	min-width: 0;

	align-items: start;
}


/**********************************************************************
*                         Image du Pokémon
**********************************************************************/

.distribution-image {
	display: flex;

	justify-content: center;
	align-items: center;

	align-self: stretch;

	width: 100%;
	min-width: 0;
}

.distribution-image img {
	display: block;

	width: 100%;
	max-width: 100%;
	height: auto;

	object-fit: contain;
}


/**********************************************************************
*                         Partie droite
**********************************************************************/

.distribution-contenu {
	min-width: 0;
	width: 100%;
}


/**********************************************************************
*                         Description
**********************************************************************/

.distribution-description {
	width: 100%;

	margin: 0 0 20px 0;

	line-height: 1.5;
}


.distribution-lien {
	margin-top: 8px;
}


/**********************************************************************
*                         Tableau
**********************************************************************/

.distribution-table {
	width: 100%;

	border-collapse: collapse;

	margin: 0;
}


.distribution-table th,
.distribution-table td {
	padding: 8px 12px;

	vertical-align: top;
}


.distribution-table thead th {
	text-align: center;
}


.distribution-table tbody th {
	width: 120px;

	text-align: left;

	white-space: nowrap;
}


/**********************************************************************
*                         Attaques
**********************************************************************/

.distribution-attaques {
	list-style: none;

	margin: 0;
	padding: 0;
}


.distribution-attaques li {
	list-style: none;

	margin: 0 0 0.25em 0;
	padding: 0;
}


.distribution-attaques li:last-child {
	margin-bottom: 0;
}


/**********************************************************************
*                         Responsive
**********************************************************************/

@media screen and (max-width: 700px) {

	.distribution {
		grid-template-columns: 1fr;

		gap: 15px;
	}


	.distribution-image img {
		width: auto;

		max-width: min(300px, 80%);
	}


	.distribution-description {
		margin-bottom: 15px;
	}


	.distribution-table tbody th {
		width: auto;

		white-space: normal;
	}

}


/**********************************************************************
*                         Très petits écrans
**********************************************************************/

@media screen and (max-width: 450px) {

	.distribution-table th,
	.distribution-table td {
		padding: 6px 8px;
	}
}




/**********************************************************************
*                         Starters
**********************************************************************/

.starter-fiche {
	display: grid;

	grid-template-columns:
		33%
		minmax(0, 1fr);

	gap: 25px;

	align-items: center;

	width: 100%;
	min-width: 0;
}


/*
 * Image + types
 */

.starter-visuel {
	display: flex;
	flex-direction: column;

	align-items: center;
	justify-content: center;

	min-width: 0;
}

.starter-visuel figure {
	width: 100%;
	margin: 0;

	text-align: center;
}

.image-starter {
	display: block;

	width: 100%;
	max-width: 250px;
	height: auto;

	margin: 0 auto;

	object-fit: contain;
}


.starter-types {
	margin-top: 8px;

	text-align: center;

	white-space: nowrap;
}


.starter-types img {
	display: inline-block;

	width: auto !important;
	height: auto !important;
	max-width: none !important;

	margin: 2px;

	vertical-align: middle;
}


/*
 * Description
 */

.starter-description {
	min-width: 0;

	text-align: left;
}


/**********************************************************************
*                         Starters - petit écran
**********************************************************************/

@media screen and (max-width: 700px) {

	.starter-fiche {
		grid-template-columns: 1fr;

		gap: 15px;
	}


	.image-starter {
		width: auto;
		max-width: min(250px, 70%);
	}


	.starter-description {
		text-align: center;
	}

}

/**********************************************************************
*                         Combats contre les rivaux
**********************************************************************/


/**********************************************************************
*                         Bloc de combat
**********************************************************************/

.rival-combat {
	width: 100%;
	min-width: 0;

	margin: 0 0 20px 0;

	border: 1px solid black;

	box-sizing: border-box;
}


/*
 * Titre du combat
 */
.rival-combat-titre {
	margin: 0;
	padding: 8px 12px;

	background-color: var(--couleur-entete-tableau);

	text-align: center;
	font-size: 150%;
}


/**********************************************************************
*                         Introduction
**********************************************************************/

.rival-combat-introduction {
	padding: 12px;

	border-top: 1px solid black;
	border-bottom: 1px solid black;
}


.rival-combat-description {
	text-align: center;
}


/**********************************************************************
*                         Images du rival
**********************************************************************/

.rival-combat-illustrations {
	display: flex;

	justify-content: center;
	align-items: flex-end;

	gap: 20px;

	width: 100%;

	margin-top: 10px;
}


/*
 * Lorsque les deux images existent, chacune peut prendre
 * au maximum la moitié de la largeur disponible.
 */
.contenu .limite .rival-combat-illustration {
	display: block;

	width: auto !important;
	height: auto !important;

	max-width: calc(50% - 10px) !important;

	object-fit: contain;
}


/*
 * Une image seule peut utiliser toute la largeur disponible.
 */
.contenu .limite .rival-combat-illustration:only-child {
	max-width: 100% !important;
}


/**********************************************************************
*                         Liste des équipes
**********************************************************************/

.rival-combat-equipes {
	padding: 10px 12px 12px 12px;
}


.rival-equipe {
	width: 100%;

	margin: 0;
}


.rival-equipe + .rival-equipe {
	margin-top: 20px;
}


.rival-equipe-titre {
	margin: 0 0 10px 0;

	text-align: center;

	font-size: 120%;
}


/**********************************************************************
*                         Tableau d'une équipe
**********************************************************************/

/*
 * Permet de conserver la présentation horizontale même sur
 * les écrans trop étroits.
 */
.rival-equipe-table-conteneur {
	width: 100%;
	min-width: 0;

	overflow-x: auto;
}


.rival-equipe-table {
	width: 100%;

	margin: 0;

	border-collapse: collapse;
}


.rival-equipe-table td {
	padding: 4px 8px;

	border: 0;

	text-align: center;
	vertical-align: middle;
}


/*
 * Les colonnes gardent suffisamment de place pour les sprites.
 */
.rival-equipe-table td {
	min-width: 90px;
}


/**********************************************************************
*                         Types
**********************************************************************/

.rival-pokemon-types {
	white-space: nowrap;
}


.rival-pokemon-types img {
	display: inline-block;

	width: auto !important;
	height: auto !important;
	max-width: none !important;

	margin: 2px;

	vertical-align: middle;
}


/**********************************************************************
*                         Espacement des lignes
**********************************************************************/

.rival-pokemon-noms td {
	padding-bottom: 2px;

	font-weight: bold;
}


.rival-pokemon-niveaux td {
	padding-top: 2px;
	padding-bottom: 4px;
}


.rival-pokemon-images td {
	padding-top: 2px;
	padding-bottom: 2px;
}


.rival-pokemon-types-ligne td {
	padding-top: 4px;
}