/* =========================================================
   Page « Dates clés » (history.php)
   Onglets discrets, galerie des styles, frises chronologiques.
   Couleurs reprises du menu du site (bleu #428bca).
   ========================================================= */

.dates {
	--bleu: #428bca;
	--bleu-fonce: #2a6496;
	--bleu-pale: #eaf2fa;
	--papier: #f5f2ec;
	--trait: #e3ddd2;
	--texte: #333;
	--doux: #8a8178;
	--serif: Georgia, "Times New Roman", serif;
}

/* ---- Phrase d'introduction ---- */
.dates-intro {
	margin: 0 0 18px;
	color: var(--doux);
	font-size: 15px;
}

/* ---- Onglets (pastilles) ---------------------------------
   Sur smartphone, la barre défile horizontalement au doigt
   au lieu de passer sur plusieurs lignes. */
.dates-onglets {
	display: flex;
	gap: 8px;
	margin: 0 0 28px;
	padding: 0 0 4px;
	list-style: none;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}
.dates-onglets::-webkit-scrollbar { display: none; }
.dates-onglets li { flex: 0 0 auto; }
.dates-onglets a {
	display: block;
	padding: 7px 16px;
	border: 1px solid var(--trait);
	border-radius: 999px;
	color: #555;
	font-size: 14px;
	white-space: nowrap;
	text-decoration: none;
	transition: background .15s, border-color .15s, color .15s;
}
.dates-onglets a:hover,
.dates-onglets a:focus {
	border-color: #cfd8e2;
	background: #f7f9fb;
	color: var(--bleu-fonce);
	text-decoration: none;
	outline: none;
}
.dates-onglets a:focus-visible {
	outline: 2px solid var(--bleu);
	outline-offset: 2px;
}
.dates-onglets .active a,
.dates-onglets .active a:hover {
	border-color: var(--bleu);
	background: var(--bleu-pale);
	color: var(--bleu-fonce);
	font-weight: 600;
}

/* ---- Titre de chaque onglet ---- */
.dates-titre {
	margin: 0 0 24px;
	font-family: var(--serif);
	font-size: 24px;
	font-weight: normal;
	color: var(--texte);
}

/* Petite apparition en fondu au changement d'onglet */
.dates .tab-pane.active {
	animation: dates-fondu .25s ease-out;
}
@keyframes dates-fondu {
	from { opacity: 0; transform: translateY(4px); }
	to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
	.dates .tab-pane.active { animation: none; }
}

/* =========================================================
   STYLES : galerie de vignettes
   Chaque photo est posée sur un fond clair (comme un
   passe-partout), entière, sans être rognée ni déformée.
   ========================================================= */
.styles-grille {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 28px 22px;
}
.style-carte {
	margin: 0;
}
.style-cadre {
	aspect-ratio: 3 / 4;
	padding: 14px;
	border-radius: 6px;
	background: var(--papier);
	transition: transform .2s, box-shadow .2s;
}
.style-cadre img {
	display: block;
	width: 100%;
	height: 100%;
	-o-object-fit: contain;
	object-fit: contain;
}
.style-carte:hover .style-cadre {
	transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(60, 45, 20, .10);
}
.style-carte figcaption {
	padding-top: 10px;
	text-align: center;
	line-height: 1.35;
}
.style-carte strong {
	display: block;
	font-family: var(--serif);
	font-size: 16px;
	font-weight: normal;
	color: var(--texte);
}
.style-carte figcaption span {
	font-size: 13px;
	color: var(--doux);
	font-variant-numeric: tabular-nums;
}

/* =========================================================
   FRISES CHRONOLOGIQUES (inventions, comtoise, cheminée)
   Date à gauche, trait vertical, texte à droite.
   ========================================================= */
.frise-groupe + .frise-groupe {
	margin-top: 26px;
}
.frise-periode {
	margin: 0 0 6px 144px;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .04em;
	color: var(--doux);
}
/* « e » de XVIIIe en exposant, sans décaler la ligne */
.dates sup {
	top: -.4em;
	font-size: .7em;
}
.frise {
	position: relative;
	margin: 0;
	padding: 0;
	list-style: none;
	max-width: 820px;
}
/* le trait vertical */
.frise::before {
	content: "";
	position: absolute;
	top: 8px;
	bottom: 8px;
	left: 120px;
	width: 1px;
	background: var(--trait);
}
.frise li {
	display: flex;
	align-items: baseline;
	padding: 7px 0;
}
.frise-date {
	flex: 0 0 120px;
	padding-right: 22px;
	text-align: right;
	font-family: var(--serif);
	font-size: 16px;
	color: var(--bleu-fonce);
	font-variant-numeric: tabular-nums;
}
.frise-texte {
	position: relative;
	padding-left: 24px;
	color: var(--texte);
}
/* le point sur le trait */
.frise-texte::before {
	content: "";
	position: absolute;
	left: -4px;
	top: .5em;
	width: 9px;
	height: 9px;
	border: 2px solid var(--bleu);
	border-radius: 50%;
	background: #fff;
}
.frise li:hover .frise-texte::before {
	background: var(--bleu);
}
/* pays (GB, NL, F…) en petite étiquette */
.frise-pays {
	display: inline-block;
	margin-left: 4px;
	padding: 0 6px;
	border-radius: 3px;
	background: var(--papier);
	color: var(--doux);
	font-size: 11px;
	line-height: 18px;
	vertical-align: 1px;
	border-bottom: 0;
	cursor: default;
	text-decoration: none;
}

/* =========================================================
   MONTRES : cartes avec photo et caractéristiques
   ========================================================= */
.montres-grille {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 22px;
}
.montre-carte {
	overflow: hidden;
	border: 1px solid var(--trait);
	border-radius: 8px;
	background: #fff;
}
.montre-carte img {
	display: block;
	margin: 0;
	width: 100%;
	aspect-ratio: 4 / 3;
	-o-object-fit: cover;
	object-fit: cover;
}
.montre-corps {
	padding: 14px 16px 16px;
}
.montre-corps h3 {
	margin: 0 0 10px;
	font-family: var(--serif);
	font-size: 18px;
	color: var(--bleu-fonce);
}
.montre-corps dl {
	margin: 0;
	font-size: 13px;
	line-height: 1.4;
}
.montre-corps dt {
	font-weight: normal;
	color: var(--doux);
}
.montre-corps dd {
	margin: 0 0 8px;
	color: var(--texte);
}
.montre-corps dd:last-child {
	margin-bottom: 0;
}

/* =========================================================
   SMARTPHONE
   ========================================================= */
@media (max-width: 767px) {
	.dates-intro { font-size: 14px; margin-bottom: 14px; }
	.dates-onglets { margin-bottom: 20px; margin-right: -15px; }
	.dates-titre { font-size: 20px; margin-bottom: 18px; }

	.styles-grille {
		grid-template-columns: repeat(2, 1fr);
		gap: 20px 14px;
	}

	/* frise plus étroite : colonne des dates réduite */
	.frise::before { left: 84px; }
	.frise-date { flex-basis: 84px; padding-right: 16px; font-size: 14px; }
	.frise-texte { padding-left: 18px; font-size: 14px; }
	.frise-periode { margin-left: 102px; }

	.montres-grille { grid-template-columns: 1fr; }
	/* sur téléphone : photo à gauche, texte à droite */
	.montre-carte { display: flex; }
	.montre-carte img {
		flex: 0 0 40%;
		width: 40%;
		height: auto;
		align-self: stretch;
		aspect-ratio: auto;
	}
}

/* =========================================================
   GRAND ÉCRAN : texte un peu plus grand
   (suit l'agrandissement du texte de style.css)
   ========================================================= */
@media (min-width: 1500px) {
	.dates-intro { font-size: 17px; }
	.dates-onglets a { font-size: 15px; padding: 8px 18px; }
	.dates-titre { font-size: 28px; }
	.styles-grille { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
	.style-carte strong { font-size: 17px; }
	.style-carte figcaption span { font-size: 14px; }
	.frise { max-width: 900px; }
	.frise-periode { font-size: 14px; }
	.frise-date { font-size: 17px; }
	.frise-pays { font-size: 12px; line-height: 19px; }
	.montres-grille { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
	.montre-corps h3 { font-size: 20px; }
	.montre-corps dl { font-size: 14px; }
}
@media (min-width: 1800px) {
	.dates-intro { font-size: 18px; }
	.dates-onglets a { font-size: 16px; }
	.dates-titre { font-size: 30px; }
	.style-carte strong { font-size: 18px; }
	.style-carte figcaption span { font-size: 15px; }
	.frise { max-width: 960px; }
	.frise-date { font-size: 18px; }
	.montre-corps h3 { font-size: 21px; }
	.montre-corps dl { font-size: 15px; }
}
