/* =============================================================
   Mon lab'créatif — Clémence de Gouville
   Feuille de styles principale
   ============================================================= */
   
/* -------------------------------------------------------------
   Polices hébergées sur le site (licence SIL Open Font License)
   Sous-ensemble "latin" : couvre le français (accents, œ, « », ’, …).
   Les chemins sont relatifs à ce fichier : ils fonctionnent dans /DEV comme à la racine.
   ------------------------------------------------------------- */
@font-face {
  font-family: 'Lobster';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/lobster-latin-400-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Noto Sans : police variable, un seul fichier pour tous les graisses (400, 600, 700…) */
@font-face {
  font-family: 'Noto Sans';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('../fonts/noto-sans-latin-wght-normal.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}



:root {
  --color-green: #89af35;
  --color-green-dark: #708f2a;
  --color-text-gray: #808080;
  --color-border-gray: #dfdfdf;
  --color-bg-gray: #ebebeb;
  --color-white: #ffffff;

  --font-manuscript: 'Lobster', cursive;
  --font-body: 'Noto Sans', sans-serif;
  --font-weight : 100;

 
  --size-text: 16px;

  --border-width: 1px;
  --radius-lg: 18px;
  --radius-md: 18px;
  
  --padding : 10px;
  --margin : 10px;

  --content-max-width: 1180px;
  --shadow-card: 0 0 0.5rem rgba(0, 0, 0, 0.3);
}

/* -------------------------------------------------------------
   Reset léger
   ------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--size-text);
  line-height: 1.4;
  color: #808080;
  background: var(--color-white);
}

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

a {
  color: inherit;
  cursor:pointer;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1, h2, h3 {
  margin: 0;
  font-weight: normal;
}

p {
font-size : 1rem;
  margin: 0 0 1rem;
}

.no-margin-bottom, .page-annexe li.no-margin-bottom, .footer__col li.no-margin-bottom {
	margin-bottom : 0;
}

.container {
  max-width: var(--content-max-width);
  margin: 0 auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/*a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--color-green-dark);
  outline-offset: 2px;
}*/

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

/* -------------------------------------------------------------
   En-tête / hero
   ------------------------------------------------------------- */
.hero {
  position: relative;
  background-image: url('https://www.clemencedegouville.fr/images/CSS/visuel_fond-entete_automne.jpg');
  background-size: cover;
  background-position: center;
  height : 14rem;
}

.hero__inner {
  margin: 0 auto;
  height: 100%;
  position: relative;
}

/* Petit logo (pages intérieures uniquement) */
.hero__logo {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background-color: var(--color-green);
  width: 3rem;
  height: 4.5rem;
  padding: 0.5rem;
  border-radius: 0.5rem;
  border: 2px solid var(--color-white);
  background-image: url("https://www.clemencedegouville.fr/images/CSS/logo-blanc.svg");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: auto 3.5rem;
}

.hero__logo span {
	display:none;
}

.hero__logo img {
  height: 100%;
}

/* Bouton menu (rond, en haut à droite) */
.menu-toggle {
  position: fixed;
  top:1rem;
  right: 1rem;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  /*background: var(--color-green);*/
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  z-index: 20;
}

.menu-toggle img {
  width: 3rem;
  height: 3rem;
}

/* Un seul bouton : l'icône change selon l'état du menu */
.menu-toggle {
  /*border: var(--border-width) solid var(--color-white);*/
  z-index: 110; /* au-dessus du menu, y compris en plein écran mobile */
}

.menu-toggle .menu-toggle__icon--close {
  display: none;
}

.menu-toggle[aria-expanded="true"] {
  /*background: var(--color-white);
  border-color: var(--color-green);*/
}

.menu-toggle[aria-expanded="true"] .menu-toggle__icon--open {
  display: none;
}

.menu-toggle[aria-expanded="true"] .menu-toggle__icon--close {
  display: block;
}

.menu-toggle.autres-pages {
	top : 1.75rem;
}

/* -------------------------------------------------------------
   Badge central (fiole / mini-visuel de rubrique)
   ------------------------------------------------------------- */
.badge-wrap {
  display: flex;
  justify-content: center;
}

.badge {
  
  border-radius: 1.5rem;
  /*padding : 1.5rem;*/
  position: relative;
  z-index: 10;
  text-align: center;
  /*box-shadow: var(--shadow-card);*/
  border : 2px solid var(--color-border-gray);
  /*margin-top:-9rem;*/
  /*margin-top:-6.5rem;*/
  width: 9rem;
  padding: 0;
  margin-top: -6.5rem;
  background-color:white;
}

.badge.badge-accueil {
	background: var(--color-green);
}

.hero--sub {
  height: 15rem;
}

/*.badge.badge--sub{
  width: 9rem;
  padding: 0;
  margin-top: -6.5rem;
  background-color:white;
}*/

/* -------------------------------------------------------------
   Intro de rubrique (titre + chapô)
   ------------------------------------------------------------- */
.rubrique-intro, section.first {
  text-align: center;
  padding-top: 1rem;
}

.rubrique-intro__chapo {
  max-width: 40rem;
  margin: 0 auto;
  

}

/* -------------------------------------------------------------
   Galerie rectangulaire + info-bulles (rubrique Travaux graphiques)
   ------------------------------------------------------------- */
.rubrique-info h1 {
	margin-bottom:0.5rem;
}

.gallery-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  margin-top:2rem;
}

.gallery-item {
  position: relative;
  margin: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  flex: 1 1 100%;
  max-width:25rem;
 
}

.gallery-item--wide {
  max-width:none;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 1 / 1;
}

.gallery-item--wide img {
  aspect-ratio: 2 / 1;
}

.gallery-item__info-btn {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--color-green);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.gallery-item__info-btn img {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  object-fit: contain;
}

/* Un seul bouton : l'icône bascule info <-> fermer, comme pour le menu */
.gallery-item__info-btn-icon--close {
  display: none;
}

.gallery-item__info-btn[aria-expanded="true"] .gallery-item__info-btn-icon--open {
  display: none;
}

.gallery-item__info-btn[aria-expanded="true"] .gallery-item__info-btn-icon--close {
  display: block;
}

.gallery-item__tooltip {
	position: absolute;
	/*left: 1rem;*/
  right: 1rem;
  bottom: 4.5rem;
  background: var(--color-white);
  border-radius: 0.5rem;
  border : 2px solid var(--color-green);
  box-shadow: var(--shadow-card);
  padding: 1rem;
  text-align: left;
}

.gallery-item__tooltip[hidden] {
  display: none;
}

.gallery-item__tooltip p {
  margin: 0;
  font-size: 0.875rem;
  line-height:1rem;
  color: var(--color-green);
}

.gallery-item__year {
  display: block;
  color: var(--color-text-gray);
  margin-top: 0.25rem;
  font-size:0.7rem;
}

.badge h1 {
	line-height:0;
	margin-bottom : 0;
	background: url(https://www.clemencedegouville.fr/images/CSS/logo-blanc_automne.svg) no-repeat;
	background-position : center center;
	/*width: 12rem;
	height: 12rem;*/
	width:9rem;
	height:9rem;
	background-size: auto;
	
}

.badge span {
	display:none;
	/*line-height:1.6rem;
	display:block;
	margin:0;*/
}

/*.badge__logo {
  height : 7rem;
  margin: 0 auto 1rem;
}*/

.badge__image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 1.5rem;
  /*margin-bottom: 12px;*/
}


/*.badge.badge-accueil {
	padding:0;
}*/

.badge__brand {
  font-family: var(--font-manuscript);
  color: var(--color-white);
  font-size: /*26px*/1.875rem;
  margin: 0;
}

.badge__owner {
  font-family: var(--font-body);
  color: var(--color-white);
  font-size:0.875rem;
}

/* -------------------------------------------------------------
   Menu (overlay)
   ------------------------------------------------------------- */
.nav-overlay {
  position: fixed;
  /*top: 24px;
  right: 24px;
  width: 350px;
  max-width: calc(100% - 48px);*/
  top: 1rem;
  right: 5rem;
  border: 2px solid var(--color-green);
  background: var(--color-green);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.nav-overlay.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}


.nav-overlay__list li {
  border-bottom: var(--border-width) solid var(--color-white);
}

.nav-overlay__list li:last-child {
  border-bottom: none;
  
}

li:first-child .nav-overlay__link  {
  border-radius : var(--radius-md) var(--radius-md) 0 0;
}

.nav-overlay__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  color: var(--color-white);
  text-decoration: none;
  font-size: var(--size-text);
}

.nav-overlay__link[aria-current="page"] {
  background-color: var(--color-white);
  color : var(--color-green);
}
li:last-child .nav-overlay__link[aria-current="page"] {
	border-radius : 0 0 var(--radius-md) var(--radius-md);
}

.nav-overlay__link[aria-current="page"] svg path{
  stroke:  var(--color-green)!important;
}

.nav-overlay__icon {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

/* Fond cliquable pour fermer le menu au clic en dehors */
.nav-overlay-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: transparent;
  border: none;
  padding: 0;
  cursor: default;
  display: none;
}

.nav-overlay-backdrop.is-open {
  display: block;
}

/* Sous 768px : menu plein écran */
@media (max-width: 767px) {
  .nav-overlay {
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    border-radius: 0;
    transform: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .nav-overlay.is-open {
    transform: none;
  }
  
  .nav-overlay__list li:last-child {
	border-bottom: 1px solid var(--color-white);
	}
	
	li:first-child .nav-overlay__link, li:last-child .nav-overlay__link[aria-current="page"]  {
	  border-radius : 0;
	}
}

/* -------------------------------------------------------------
   Contenu — introduction (page d'accueil)
   ------------------------------------------------------------- */
section, footer {
  padding : 4rem 2rem ;
}
  
.intro {
	  padding-top : 1rem;
	  text-align: center;
  }

h1, h2 {
  font-family: var(--font-manuscript);
  color: var(--color-green);
  font-size: 2.375rem;
  line-height : 2.375rem;
  text-align:center;
  margin-bottom : 1rem;
}

.intro__text {
  max-width: 49rem;
  margin: 0 auto;
  text-align: left;
}

.intro__text a {
  color: var(--color-green);
  text-decoration: underline;
  font-weight: 600;
}



/* -------------------------------------------------------------
   Cartes rubriques
   ------------------------------------------------------------- */
 .rubriques {
	 background-color : var(--color-bg-gray);
 }
 
 .rubriques h2 {
	 margin-bottom : 1rem;
 }
 
/*.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}*/

 .cards {
	display: grid;
    grid-template-columns: 1fr;
	margin : auto;
	gap:2rem;
	max-width:24.66rem;
  }



.card {
  background: var(--color-white);
  border-radius: 2.5rem;
  border : 2px solid #dfdfdf;
  padding: 0 2.5rem 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  /*max-width:24.66rem;*/
}

.card__image {
  width: 11rem;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 0 0 2.5rem 2.5rem;
  margin-bottom: 0.5rem;
  border : 2px solid #dfdfdf;
  border-top:none;
}

.card__title {
  font-family: var(--font-manuscript);
  color: var(--color-green);
  font-size: 1.75rem;
  line-height: 1.9rem;
  
}

.card__divider {
  width: 2.5rem;
  height: var(--border-width);
  background: var(--color-border-gray);
  margin: 1rem 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  background: var(--color-green);
  color: var(--color-white);
  font-family: var(--font-body);
  font-size: var(--size-text);
  text-decoration: none;
  line-height:1.2rem;
  padding : 0.85rem 2rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.btn:hover {
  background: var(--color-green-dark);
}

/* -------------------------------------------------------------
   Bandeau "Autres galeries à découvrir" (pages rubriques)
   ------------------------------------------------------------- */
.related {
  background: var(--color-green);
  /*padding: 56px 0;*/
  text-align: center;
}

.related h2 {
  font-family: var(--font-manuscript);
  color: var(--color-white);
  font-size: 2.375rem;
  margin-bottom: 2rem;
}

.related .cards {
	grid-template-columns: 1fr;
	max-width:22.5rem;
}

.related .card__title {
  color: var(--color-green);
}

/* -------------------------------------------------------------
   Galerie encadrée + lightbox (rubrique Illustrations et hommages)
   ------------------------------------------------------------- */
.illus-grid {
  --illus-gap: 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--illus-gap);
  margin-top: 2rem;
}

.illus-item {
  flex: 1 1 100%;
  max-width: 25rem;
  margin: 0;
  text-align: center;
}

.illus-item__open {
  position: relative;
  display: block;
  width: 100%;
  padding: 2rem;
  background: var(--color-white);
  border: 0.8rem solid var(--color-border-gray);
  border-radius: 0.5rem;
  cursor: pointer;
}

.illus-item__thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

.illus-item__zoom {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  width: 3rem;
  height: 3rem;
}

.illus-item__caption {
  margin-top: 0.75rem;
}

.illus-item__title {
  display: block;
  font-family: var(--font-manuscript);
  color: var(--color-text-gray);
  font-size: 1.125rem;
  line-height: 1.4rem;
}

.illus-item__year {
  display: block;
  font-size: 0.875rem;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120; /* au-dessus du bouton menu (110) */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4.5rem 1rem 5.5rem;
  background: rgba(255, 255, 255, 0.92);
}

.lightbox[hidden] {
  display: none;
}

.lightbox__figure {
  margin: 0;
  text-align: center;
}

.lightbox__img {
  display: block;
  margin: 0 auto;
  max-width: 100%;
  max-height: calc(100vh - 14rem);
  border: 1px solid var(--color-border-gray);
}

.lightbox__title {
  display: block;
  margin-top: 1rem;
  font-family: var(--font-manuscript);
  color: var(--color-text-gray);
  font-size: 1.375rem;
  line-height: 1.8rem;
}

.lightbox__year {
  display: block;
}

.lightbox__close,
.lightbox__nav {
  position: fixed;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}

.lightbox__close {
  top: 1.75rem; /* même emplacement que le bouton menu des pages intérieures (.autres-pages) */
  right: 1rem;
}

.lightbox__nav {
  bottom: 1.25rem;
}

.lightbox__nav--prev {
  left: calc(50% - 3.5rem);
}

.lightbox__nav--next {
  right: calc(50% - 3.5rem);
}

.lightbox__close img,
.lightbox__nav img {
  width: 100%;
  height: 100%;
}

/* -------------------------------------------------------------
   Rubrique Mathématique illustrée (blocs éditoriaux)
   ------------------------------------------------------------- */
:root {
  /* Couleurs de la légende des tournesols */
  --color-math-prime-palindrome: #e6007e;
  --color-math-palindrome: #79b928;
  --color-math-prime: #009fe3;
}

.math-block--gray {
  background: var(--color-bg-gray);
}

.math-block__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
}

.math-block h2 {
  font-size: 2.2rem;
  line-height: 2.5rem;
  text-align: left;
  margin-bottom: 0.5rem;
}

.math-block__header {
  max-width: 40rem;
  margin: 0 auto 2rem;
  text-align: center;
}

.math-block__header h2 {
  text-align: center;
}

.math-block__text {
  text-align: left;
}

.math-block__text > :last-child {
  margin-bottom: 0;
}

.math-block__note,
.math-block__caption {
  font-size: 0.8125rem;
  font-style: italic;
  line-height: 1.3;
}

.math-block figure {
  margin: 0;
}

.math-block__grid--solar figure.math-block__main {
	margin:auto;
}

/* Images isolées : on limite leur largeur quand les blocs sont empilés */
.math-block__main,
.math-slideshow,
.math-details {
  width: 100%;
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}

.math-details {
	max-width:none;
	padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-white);
}

.math-block__main img {
  width: 100%;
  height: auto;
  border-radius: 1.5rem;
}

.math-block__thumbs {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
}

.math-block__thumbs img {
  width: 100%;
  height: auto;
  border-radius: 1rem;
}

/* Bloc dépliable : replié sous 1024 px (géré par js/responsive-details.js),
   toujours ouvert et sans bouton au-delà */
.math-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /*gap: 1rem;
  padding: 0.85rem 1rem;
  background: var(--color-white);
  border: var(--border-width) solid var(--color-border-gray);
  border-radius: var(--radius-md);*/
  color: var(--color-green);
  cursor: pointer;
  list-style: none;
  /*padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-white);*/
}

.math-details > summary::-webkit-details-marker {
  display: none;
}

.math-details > summary::after {
  content: "";
  flex: 0 0 0.6rem;
  width: 0.6rem;
  height: 0.6rem;
  margin-top: -0.25rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.math-details[open] > summary::after {
  margin-top: 0.25rem;
  transform: rotate(-135deg);
}

.math-details[open] > summary {
  margin-bottom: 1rem;
}

.math-details > summary:focus-visible {
  outline: 3px solid var(--color-green-dark);
  outline-offset: 2px;
}

.math-block__caption {
  margin-top: 0.5rem;
  text-align: left;
}

/* Bloc dépliable : pendant la fermeture animée (js/responsive-details.js),
   le chevron se retourne dès le début, sans attendre la fin de l'animation */
.math-details.is-closing > summary::after {
  margin-top: -0.25rem;
  transform: rotate(45deg);
}

/* Diaporama des tournesols : fondu enchaîné, sans flèches ni pastilles */
.math-slideshow {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 1.5rem;
  background: var(--color-white);
}

.math-slideshow__slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.math-slideshow__slide.is-active {
  opacity: 1;
}

/* Séparateurs, liste des illustrations et légende des couleurs */
.math-block__rule {
  margin: 1rem 0;
  border: 0;
  border-top: var(--border-width) solid var(--color-border-gray);
}

.math-block__list,
.math-legend {
  margin: 0 0 1rem;
}

.math-block__list li,
.math-legend li {
  margin-bottom: 0.25rem;
}

.math-legend li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.math-legend__dot {
  flex: 0 0 0.75rem;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
}

.math-legend__dot--prime-palindrome {
  background: var(--color-math-prime-palindrome);
}

.math-legend__dot--palindrome {
  background: var(--color-math-palindrome);
}

.math-legend__dot--prime {
  background: var(--color-math-prime);
}

/* Pastilles de navigation du diaporama des tournesols (créées par js/slideshow.js) */
.math-slideshow__dots {
  position: absolute;
  left: 50%;
  bottom: 0rem;
  z-index: 1;
  display: flex;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  border-radius: 1rem 1rem 0 0;
  background-color:white;
  transform: translateX(-50%);
}

/* Zone cliquable de 24 px, pastille visible de 8 px */
.math-slideshow__dot {
  position: relative;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.math-slideshow__dot::before {
  content: "";
  position: absolute;
  inset: 0.5rem;
  border-radius: 50%;
  /*opacity: 0.55;
  transition: opacity 0.2s ease, transform 0.2s ease;*/
  border:1px solid var(--color-green);
}

.math-slideshow__dot.is-active::before {
  opacity: 1;
  transform: scale(1.25);
  background: var(--color-green);
}

/* Retour aux fondamentaux */
.math-fundamentals {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
}

.math-fundamentals__item img {
  width: 100%;
  height: auto;
  background: var(--color-white);
  border-radius: var(--radius-lg);
}

.math-fundamentals__caption {
  margin-top: 0.75rem;
  text-align: center;
  text-transform: uppercase;
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.02em;
}

@media (min-width: 500px) {
  .math-block__thumbs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  .math-fundamentals {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .math-fundamentals__item--wide {
    grid-column: 1 / -1;
  }
}

@media (min-width: 1024px) {
  .math-block__grid {
    gap: 2rem 3rem;
    align-items: start;
  }

  .math-block__main,
  .math-slideshow,
  .math-details {
    max-width: none;
  }

  /* Bloc 1 : texte + captures à gauche, grande illustration à droite.
     Les deux lignes "1fr" vides aux extrémités centrent verticalement le bloc de gauche
     face à l'illustration, quelle que soit la colonne la plus haute. */
  .math-block__grid--solar {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    grid-template-rows: 1fr auto auto 1fr;
    grid-template-areas:
      ". main"
      "text main"
      "details main"
      ". main";
    row-gap: 0;
  }

  .math-block__grid--solar .math-block__text   { grid-area: text; }
  .math-block__grid--solar .math-block__main   { grid-area: main; align-self: center; }
  .math-block__grid--solar .math-details       { grid-area: details; margin-top: 2rem; }

  .math-details > summary {
    display: none;
  }

  /* Bloc 2 : diaporama à gauche, texte à droite */
  .math-block__grid--sunflowers {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "image text";
    align-items: center;
  }

  .math-block__grid--sunflowers .math-slideshow  { grid-area: image; }
  .math-block__grid--sunflowers .math-block__text { grid-area: text; }
}

/* -------------------------------------------------------------
   Contenu — Pages annexes
   ------------------------------------------------------------- */
   .page-annexe .container {
	   max-width:55rem;
   }
   
   .page-annexe .rubrique-intro__chapo {
	   text-align:center;
   }
   
   .page-annexe .preambule {
	   font-style:italic;
   }
   
    #a-propos .page-annexe .preambule {
	   margin-top:1rem;
	   font-size:1.1rem;
	   font-weight:600;
   }
   
   .page-annexe a{
	   color:var(--color-green); 
   }
   
   .page-annexe section.first, .page-annexe h2 {
	   text-align : left;
   }
   
    .page-annexe h3 {
	  color:var(--color-green);
	  text-transform: uppercase;
		margin-bottom: 0.5rem;
   }
   
   .page-annexe h2{
	   font-size : 1.8rem;
	   line-height:1.8rem;
   }
   
   .page-annexe li {
	list-style-type:disc;
	list-style-position: inside;
	margin-bottom:0.5rem;
   }
   
   .page-annexe ul {
	   margin-bottom:1rem;
   }
   
   .page-annexe hr {
	   margin: 2rem 0;
	border: 1px solid var(--color-border-gray);
   }
   
   .page-annexe .rubrique-info hr {
		width: 5rem;
		margin: 2rem auto;
   }
      
   .page-annexe .container figure {
	   margin : 2rem 0;
	   width:100%;
   }
   
    .page-annexe .container figure img {
	   border-radius : var(--radius-lg);
	   border: 2px solid var(--color-border-gray);
   }
   
   .page-annexe .container figure figcaption{
	   margin-top:0.3rem;
	   text-align:center;
	   font-size:0.80rem;
   }
   
   .italic{
	  font-style:italic;
   }
   
   #a-propos section.first {
	   text-align : left;
   }
   
   .page-annexe .container .deux-images figure{
		   margin:1rem 0;
	   }
   
   
   
   @media (min-width: 600px) {
	   
	   .deux-images {
		   display:grid;
		   grid-template-columns: 1fr 1fr;
			gap: 1rem;
			padding: 1rem;
			background-color:var(--color-bg-gray);
			border-radius:var(--radius-lg);
			border: 1px solid var(--color-border-gray);
			margin-bottom:1rem;
	   }
	   .page-annexe .container .deux-images figure{
		   margin:0;
	   }
	   
	   .page-annexe .container .deux-images figure img{
		   border-radius:0;
	   }
	  

   }
   
   
   
   

/* -------------------------------------------------------------
   Bouton "retour en haut de page"
   ------------------------------------------------------------- */
.back-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 80; /* sous le menu (90-110) et la lightbox (120) */
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.5rem);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top img {
  width: 100%;
  height: 100%;
}


/* -------------------------------------------------------------
   Pied de page
   ------------------------------------------------------------- */
.site-footer {
  position: relative;
  background-image:
    linear-gradient(rgba(137, 175, 53, 0.85), rgba(137, 175, 53, 0.8)),
    url('https://www.clemencedegouville.fr/images/CSS/visuel_automne_fond-PDP.jpg');
  background-size: cover;
  background-position: center;
  color: var(--color-white);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  /*align-items: center;*/
}

.footer__rule {
	/*display:none;*/
	background: white;
  height: 1px;
  margin: auto;
  width: 2rem;
}

.footer__brand img {
  height: 5rem;
  margin : auto;
}

.footer__brand p.badge__owner{
  margin : 0;
  line-height:0.5rem;
}

.site-footer .container {
	  text-align:center;
  }


.footer__col h3 {
  font-family: var(--font-body);
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-transform:uppercase;
}

.footer__col li {
  margin-bottom: 0.5rem;
}

.footer__col a {
  text-decoration: underline;
  font-size: var(--size-text);
}

.footer__col a.btn {
  text-decoration: none;
  /*margin-top: 1rem;*/
  border: 1px solid var(--color-white);
}

.footer__copyright {
  text-align: center;
  padding: 1rem;
}

.footer__copyright p {
  font-size: 0.85rem;
  margin: 0;
}

.footer__copyright p a {
	color:var(--color-green);
}


/* -------------------------------------------------------------
   Page 404
   ------------------------------------------------------------- */
#page-404 .cards {
  margin-top: 2.5rem;
}



/* -------------------------------------------------------------
   Responsive
   ------------------------------------------------------------- */


/*---------- Traitement spécifique de la galerie rubrique graphisme-----------
----------------------- entre 500 et 767 px ----------------------------------*/

@media (min-width: 500px) and (max-width:767px) {
	
	#rubrique-graphisme section.first {
		padding : 1rem 1rem 4rem 1rem;
	}
	
	.gallery-item {
	  border-radius: 0.75rem;
	  flex: 48%;
	}
	
	.gallery-item img {
		aspect-ratio: 4/3;
	}
	
	.gallery-grid {
	  gap: 1rem;
	}
	
	.gallery-item__info-btn {
		height:2rem;
		width:2rem;
	}
	
	.gallery-item__tooltip p {
	  font-size: 0.8rem;
	  line-height: 1rem;
	}
	
	.gallery-item__tooltip {
	  left: 0.75rem;
	  right: 3.5rem;
	  bottom: 1rem;
	  padding: 0.5rem;
	  text-align: center;
	}

	/* Galerie encadrée (rubrique Illustrations) */
	.illus-grid {
	  --illus-gap: 1rem;
	}

	.illus-item {
	  flex: 0 1 calc((100% - var(--illus-gap)) / 2);
	  max-width: none;
	}
}

@media (min-width: 768px) {
	
	.hero {
		height : 18rem;
	}

	.hero--sub {
		height: 20rem;
	}
	
	.hero__logo {
  width: auto;
  padding-left:3rem;
  padding-right:1rem;
  background-position: 0.5rem center;
  text-decoration:none;
}

	.hero__logo span{
  display : block;
  
}

	.hero__logo span.badge__brand{
		font-size:1.3rem;
		line-height:1.3rem;
		padding-top:0.5rem;
}

	.hero__logo span.badge__owner{
		font-size:0.65rem;
}

.badge h1 {
	width: 13rem;
	height: 13rem;*/
	/*background-size: 5.5rem auto;*/
}
	
.badge/*.badge--sub*/ {
margin-top: -10rem;
width: 13rem;
}
	
  /*.badge {
		margin-top:-9rem;
	}*/
	
	section, footer {
	  padding : 4rem 2rem;
  }
  
   /*.cards {
    grid-template-columns: 1fr 1fr;
	max-width:none;
  }*/


  .footer__grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

	
	.gallery-item {
	flex: 0 1 calc((100% - 3rem) / 3);
	}

	.gallery-item--wide {
	flex: 0 1 calc(((100% - 3rem) / 3) * 2 + 1.5rem);
	}
	
	.gallery-grid {
	  gap: 1.5rem;
	}

	/* Galerie encadrée (rubrique Illustrations) */
	.illus-grid {
	  --illus-gap: 1.5rem;
	}

	.illus-item {
	  flex: 0 1 calc((100% - 2 * var(--illus-gap)) / 3);
	  max-width: none;
	}

}

@media (min-width: 768px)and (max-width:1024px){

.related .cards, .cards {
	grid-template-columns: 1fr /*1fr*/;
	max-width:44rem;
	gap:1.5rem;
	
}

.card {
  padding: 0;
  flex-direction: inherit;
  border-radius:2rem;
}

.card__image {
	width:22%;
  border-radius: 2rem 0 0 2rem;
  margin:0;
  border-bottom:none;
  border-left:none;
  border-top:none;
}

.card__title {
	padding:0 1.5rem;
	border-right: 1px solid var(--color-bg-gray);
	margin-right: 1.5rem;
	margin-bottom:0;
	width:41%;
	text-align:left;
}

.card__divider {
	display:none;
}

.card .btn {
	padding:0.85rem;
	width:30%;
}

}

@media (min-width: 1024px) {
	
	
	.badge/*.badge--sub*/ {
    margin-top: -12rem;
    width: 15rem;
	border-radius:2rem;
  }
  
  .badge h1 {
	  width:15rem;
	  height:15rem;
  }
  
  .badge__image {
	  border-radius:2rem;
  }


.related .cards {
  padding-bottom: 0;
  grid-template-columns: 1fr 1fr;
  justify-content: center;
  max-width:48rem;
}

.cards {
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width:none;
}
	
/*.border {
	border-right : 1px solid white;
}*/

.footer__grid {
  /*display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  /*gap: 2rem;
  align-items: center;*/
  grid-template-columns: 1fr 1px 1fr 1px 1fr;
  gap: 2rem;
  /*align-items: center;*/
}

.footer__rule {
	/*display:block;
  width: var(--border-width);
  background: rgba(255, 255, 255, 0.5);
  align-self: stretch;*/
  width: 1px;
  height: 100%;
}




.gallery-grid {
	margin-top : 2rem;
}

/*.illus-item__open {
	/*padding: 1.5rem;
	border-width: 0.75rem;
}*/

/*.illus-item__zoom {
	width: 3rem;
	height: 3rem;
}*/

.lightbox {
	padding: 4.5rem 9rem;
}

.lightbox__img {
	max-height: calc(100vh - 12rem);
}

.lightbox__nav {
	bottom: auto;
	top: 50%;
	transform: translateY(-50%);
}

.lightbox__nav--prev {
	left: 2rem;
}

.lightbox__nav--next {
	right: 2rem;
}

.math-fundamentals__item img.last-child{
	max-width:45rem;
	margin:auto;
}

}

@media (min-width: 1366px) {
	
	section {
	  padding : 5.5rem 0;
  }

	
	.hero {
		height : 22rem;
		background-image: url('https://www.clemencedegouville.fr/images/CSS/visuel_fond-entete_automne_HD.jpg');
	}

	.hero--sub {
		height: 22rem;
	}
	
	/*.badge h1 {
		width: 15rem;
		height: 15rem;
		/*background-size: 6rem auto;
	}
	
	
  .badge {
		margin-top:-12rem;
	}*/

	section {
	  padding : 5.5rem 0;
  }
  
.gallery-item {
flex: 0 1 calc((100% - 4rem) / 3);
}

.gallery-item--wide {
flex: 0 1 calc(((100% - 4rem) / 3) * 2 + 2rem);
}
  
  .gallery-grid {
	  gap: 2rem;
	}

	.illus-grid {
	  --illus-gap: 2rem;
	}
}

