/* appartements-chamrousse.fr — charte du site statique.
   Palette reprise du thème WordPress qu'il remplace (Twenty Twenty-Five,
   variation Evening) pour que la bascule ne dépayse personne.

   Contrainte tenue partout : tout texte à 4,5:1 au moins sur son fond réel.
   Le site précédent posait des composants clairs sur fond sombre, d'où des
   libellés noirs sur noir ; ici le calendrier est sombre par construction. */

@font-face {
	font-family: "Manrope";
	src: url("/fonts/Manrope-VariableFont_wght.woff2") format("woff2-variations");
	font-weight: 200 800;
	font-display: swap;
}

:root {
	--fond: #1b1b1b;
	--surface: #262626;
	--surface-haute: #353535;
	--texte: #f0f0f0;
	--texte-doux: #c4c4c4;
	--lien: #d1d0ea;
	--bordure: #ffffff26;
	--occupe: #8a4a2f;
	--libre: #3f5c3f;
	--mesure: 42rem;
	--large: 72rem;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
}

body {
	margin: 0;
	background: var(--fond);
	color: var(--texte);
	font-family: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
	font-size: 1.0625rem;
	line-height: 1.65;
	text-wrap: pretty;
}

/* --- Accessibilité ---------------------------------------------------- */

.evitement {
	position: absolute;
	left: -9999px;
	top: 0;
	background: var(--texte);
	color: var(--fond);
	padding: 0.6rem 1rem;
	z-index: 10;
}

.evitement:focus {
	left: 0;
}

:where(a, button, input, textarea, [tabindex]):focus-visible {
	outline: 2px solid var(--lien);
	outline-offset: 3px;
}

.leurre {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* --- Structure -------------------------------------------------------- */

.entete {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem 2rem;
	align-items: center;
	justify-content: space-between;
	max-width: var(--large);
	margin: 0 auto;
	padding: 1.5rem 1.5rem 1rem;
}

.logo {
	font-size: 1.05rem;
	font-weight: 700;
	letter-spacing: 0.01em;
	color: var(--texte);
	text-decoration: none;
}

nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem 1.4rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

nav a {
	color: var(--texte-doux);
	text-decoration: none;
}

nav a:hover,
nav a[aria-current="page"] {
	color: var(--texte);
	text-decoration: underline;
	text-underline-offset: 0.25em;
}

main {
	max-width: var(--mesure);
	margin: 0 auto;
	padding: 1rem 1.5rem 4rem;
}

.gallery,
.calendrier,
.hero {
	max-width: var(--large);
}

/* Les blocs larges débordent la mesure de lecture, centrés sur la page. */
.gallery,
.calendrier {
	margin-inline: calc((var(--mesure) - min(var(--large), 100vw - 3rem)) / 2);
}

a {
	color: var(--lien);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.15em;
}

h1,
h2,
h3 {
	line-height: 1.2;
	font-weight: 700;
}

h1 {
	font-size: clamp(2rem, 5vw, 2.9rem);
	margin: 0.5rem 0 1rem;
}

h2 {
	font-size: clamp(1.4rem, 3vw, 1.8rem);
	margin: 2.5rem 0 0.75rem;
}

h3 {
	font-size: 1.15rem;
	margin: 1.75rem 0 0.5rem;
}

hr {
	border: 0;
	border-top: 1px solid var(--bordure);
	margin: 2.5rem 0;
}

ul:not(nav ul):not(.legende) {
	padding-left: 1.2rem;
}

li {
	margin: 0.3rem 0;
}

.hero {
	padding: 2rem 0 1rem;
}

.hero h1 {
	margin-bottom: 0.5rem;
}

.accroche {
	font-size: clamp(1.1rem, 2.5vw, 1.35rem);
	color: var(--texte-doux);
	max-width: 34ch;
}

.ariane {
	font-size: 0.9rem;
	color: var(--texte-doux);
	margin-bottom: 0.5rem;
}

.ariane span {
	color: var(--texte-doux);
}

/* --- Images ----------------------------------------------------------- */

img {
	max-width: 100%;
	height: auto;
	display: block;
}

figure {
	margin: 0;
}

.gallery {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
	gap: 0.75rem;
	margin-block: 2rem;
}

.gallery img {
	width: 100%;
	aspect-ratio: 3 / 2;
	object-fit: cover;
	border-radius: 4px;
}

.portrait img {
	width: 9rem;
	border-radius: 50%;
	margin-block: 1.5rem;
}

/* --- Boutons ---------------------------------------------------------- */

.button,
button {
	display: inline-block;
	background: var(--texte);
	color: var(--fond);
	border: 0;
	border-radius: 3px;
	padding: 0.7rem 1.6rem;
	font: inherit;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
}

.button:hover,
button:hover {
	background: #ffffff;
}

.cta {
	margin: 1.5rem 0;
}

/* --- Formulaires ------------------------------------------------------ */

.formulaire {
	background: var(--surface);
	border: 1px solid var(--bordure);
	border-radius: 6px;
	padding: 1.5rem;
	margin-block: 2rem;
}

.field {
	margin: 0 0 1.1rem;
}

.field label {
	display: block;
	margin-bottom: 0.35rem;
	font-weight: 600;
	color: var(--texte);
}

.field abbr {
	color: var(--lien);
	text-decoration: none;
}

input,
textarea {
	width: 100%;
	background: var(--fond);
	color: var(--texte);
	border: 1px solid var(--bordure);
	border-radius: 3px;
	padding: 0.6rem 0.7rem;
	font: inherit;
}

input:focus,
textarea:focus {
	border-color: var(--lien);
}

.mentions {
	font-size: 0.9rem;
	color: var(--texte-doux);
}

/* --- Calendrier ------------------------------------------------------- */

.calendrier {
	margin-block: 2rem;
}

.mois-grille {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
	gap: 1.25rem;
}

.mois {
	width: 100%;
	border-collapse: collapse;
	background: var(--surface);
	border: 1px solid var(--bordure);
	border-radius: 6px;
	padding: 0.5rem;
	font-size: 0.95rem;
}

.mois caption {
	caption-side: top;
	text-align: left;
	font-weight: 700;
	padding: 0.6rem 0.5rem;
	color: var(--texte);
}

.mois th {
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--texte-doux);
	padding: 0.3rem 0;
}

.mois td {
	text-align: center;
	padding: 0.3rem 0;
}

.mois td time {
	display: block;
	padding: 0.35rem 0;
	border-radius: 3px;
}

.libre time {
	background: var(--libre);
	color: var(--texte);
}

.occupe time {
	background: var(--occupe);
	color: var(--texte);
	text-decoration: line-through;
}

.passe time {
	color: #8f8f8f;
}

.vide {
	visibility: hidden;
}

.legende {
	display: flex;
	flex-wrap: wrap;
	gap: 1.5rem;
	list-style: none;
	margin: 0 0 1rem;
	padding: 0;
	font-size: 0.9rem;
	color: var(--texte-doux);
}

.pastille {
	display: inline-block;
	width: 0.8rem;
	height: 0.8rem;
	border-radius: 2px;
	vertical-align: -0.05rem;
	margin-right: 0.35rem;
}

.pastille.libre {
	background: var(--libre);
}

.pastille.occupe {
	background: var(--occupe);
}

.maj {
	font-size: 0.9rem;
	color: var(--texte-doux);
	margin-top: 1rem;
}

/* --- Pied ------------------------------------------------------------- */

.pied {
	border-top: 1px solid var(--bordure);
	max-width: var(--large);
	margin: 0 auto;
	padding: 2rem 1.5rem 3rem;
	color: var(--texte-doux);
	font-size: 0.95rem;
}

.pied p {
	margin: 0.3rem 0;
}

.pied nav {
	margin-top: 1.25rem;
}

/* --- Messages de l'endpoint ------------------------------------------- */

.message {
	background: var(--surface);
	border: 1px solid var(--bordure);
	border-left: 3px solid var(--lien);
	border-radius: 4px;
	padding: 1.25rem 1.5rem;
	margin-block: 2rem;
}

.message.erreur {
	border-left-color: #e08a6a;
}

/* --- Tableaux ---------------------------------------------------------- */

/* Le conteneur défile pour lui-même : sur mobile, un tableau de tarifs ne
   doit jamais forcer la page entière à défiler horizontalement. */
.tableau {
	overflow-x: auto;
	margin-block: 1.5rem;
}

.tableau table {
	border-collapse: collapse;
	width: 100%;
	min-width: 26rem;
	font-size: 0.98rem;
}

.tableau th,
.tableau td {
	text-align: left;
	padding: 0.6rem 0.8rem;
	border-bottom: 1px solid var(--bordure);
}

.tableau th {
	color: var(--texte);
	font-weight: 700;
	border-bottom-color: var(--texte-doux);
}

.tableau tbody tr:last-child td {
	border-bottom: 0;
}

/* --- Guides (pied de page) -------------------------------------------- */

.guides {
	margin-top: 1.75rem;
}

.guides h2 {
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--texte-doux);
	margin: 0 0 0.5rem;
	font-weight: 600;
}

/* --- Bloc de réservation ----------------------------------------------- */

/* Deux colonnes sur grand écran : le calendrier à gauche, le prix et le
   formulaire à droite, visibles ensemble. C'est ce qui permet de décider
   pendant qu'on choisit ses dates, au lieu de découvrir le prix à la fin. */
.reservation {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(19rem, 24rem);
	gap: 2rem;
	align-items: start;
	margin-block: 2rem;
	max-width: var(--large);
	margin-inline: calc((var(--mesure) - min(var(--large), 100vw - 3rem)) / 2);
}

@media (max-width: 60rem) {
	.reservation {
		grid-template-columns: 1fr;
		margin-inline: 0;
	}
}

.reservation .calendrier {
	margin: 0;
}

/* Le panneau suit le défilement : sur une page de douze mois, le prix doit
   rester sous les yeux pendant qu'on fait défiler le calendrier. */
.panneau {
	position: sticky;
	top: 1.5rem;
}

.recap {
	background: var(--surface);
	border: 1px solid var(--bordure);
	border-radius: 8px;
	padding: 1.25rem;
}

.recap-vide {
	margin: 0;
	color: var(--texte-doux);
	font-size: 0.95rem;
}

.recap-lignes {
	list-style: none;
	margin: 0;
	padding: 0;
}

.recap-lignes li {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	align-items: baseline;
	padding: 0.4rem 0;
	font-size: 0.95rem;
}

.recap-lignes .detail {
	display: block;
	font-size: 0.85rem;
	color: var(--texte-doux);
}

.recap-total {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin: 0.75rem 0 0;
	padding-top: 0.75rem;
	border-top: 1px solid var(--texte-doux);
	font-size: 1.15rem;
	font-weight: 700;
}

.recap .mentions {
	margin-bottom: 0;
	font-size: 0.85rem;
}

.reservation .formulaire {
	margin-top: 1rem;
}

.deux-colonnes {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 0.75rem;
}

button[disabled] {
	background: var(--surface-haute);
	color: var(--texte-doux);
	cursor: not-allowed;
}

/* --- Calendrier cliquable --------------------------------------------- */

.mois td.cliquable time {
	cursor: pointer;
}

.mois td.cliquable:hover time {
	outline: 1px solid var(--lien);
	outline-offset: -1px;
}

.mois td.cliquable:focus-visible {
	outline: 2px solid var(--lien);
	outline-offset: 1px;
}

/* Les bords de la sélection sont marqués franchement, l'entre-deux plus
   discrètement : on doit lire d'un coup d'œil où commence et finit le séjour. */
.mois td.choisi time {
	background: var(--texte);
	color: var(--fond);
	font-weight: 700;
}

.mois td.entre-deux time {
	background: #4a5c4a;
	color: var(--texte);
}
