/* Personnalisation douce du site Maths — compatible MkDocs Material.
   Ce fichier ne modifie pas les scripts Python : il agit uniquement sur l'affichage. */

:root {
  --maths-ink: #0d1b2a;
  --maths-muted: #526173;
  --maths-green: #1f8f55;
  --maths-green-soft: #eef8f2;
  --maths-blue-soft: #eef5ff;
  --maths-yellow-soft: #fff8e6;
  --maths-purple-soft: #f3f0ff;
  --maths-border: rgba(13, 27, 42, 0.10);
  --maths-shadow: 0 12px 30px rgba(13, 27, 42, 0.08);
}

/* En-tête et onglets clairs, façon maquette Lycée Franklin */
:root {
  --md-accent-fg-color: var(--maths-green);
}

.md-header {
  color: var(--maths-ink);
  box-shadow: 0 1px 0 var(--maths-border);
}

.md-header,
.md-tabs {
  background-color: #ffffff;
}

.md-tabs {
  border-top: 1px solid var(--maths-border);
  color: var(--maths-muted);
}

.md-tabs__link {
  opacity: 1;
  color: var(--maths-muted);
  font-weight: 600;
}

.md-tabs__link--active,
.md-tabs__link:hover {
  color: var(--maths-green);
}

.md-header__title {
  font-weight: 800;
}

/* Logo dans l'en-tête MkDocs Material */
.md-header__button.md-logo img,
.md-header__button.md-logo svg {
  height: 2.2rem;
  width: auto;
}

.md-header__button.md-logo {
  padding: 0.2rem 0.45rem;
}

/* Page d'accueil */
.maths-home {
  max-width: 1180px;
  margin: 0 auto;
}

.maths-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 0.6rem 0 0.9rem;
}

.maths-eyebrow {
  margin: 0 0 0.25rem;
  color: var(--maths-green);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.76rem;
}

.maths-brand h1 {
  margin: 0;
  color: var(--maths-ink);
  font-size: clamp(1.2rem, 1.7vw, 1.5rem);
  font-weight: 800;
  line-height: 1.1;
}

.maths-brand p:last-child {
  margin: 0.3rem 0 0;
  color: var(--maths-muted);
  font-size: 0.95rem;
}

.maths-hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1.6rem;
  align-items: center;
  padding: clamp(1rem, 2vw, 1.5rem);
  border: 1px solid var(--maths-border);
  border-radius: 1.25rem;
  background:
    radial-gradient(circle at 15% 20%, rgba(31, 143, 85, 0.10), transparent 30%),
    linear-gradient(120deg, #ffffff 0%, #f4f1ec 42%, #cdc5b8 100%);
  box-shadow: var(--maths-shadow);
  overflow: hidden;
}

.maths-hero h2 {
  margin: 0;
  color: var(--maths-ink);
  font-size: clamp(1.3rem, 1.9vw, 1.7rem);
  line-height: 1.18;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.maths-hero p {
  max-width: 44rem;
  margin: 0.65rem 0 0;
  color: var(--maths-muted);
  font-size: 0.98rem;
  line-height: 1.5;
}

.maths-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  align-items: center;
  margin-top: 1rem;
}

.maths-button,
.maths-link-button {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-radius: 0.75rem;
  font-weight: 800;
  text-decoration: none !important;
}

.maths-button {
  padding: 0.78rem 1rem;
  color: #ffffff !important;
  background: var(--maths-ink);
}

.maths-link-button {
  color: var(--maths-green) !important;
}

.maths-illustration {
  aspect-ratio: 1672 / 941;
  border-radius: 1rem;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(255,255,255,0.8), rgba(255,255,255,0.2));
}

.maths-illustration img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.maths-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.35rem 0;
}

.maths-card {
  display: block;
  min-height: 9.5rem;
  padding: 1.25rem;
  border: 1px solid var(--maths-border);
  border-bottom: 3px solid var(--maths-card-accent, var(--maths-ink));
  border-radius: 1rem;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(13, 27, 42, 0.06);
  text-decoration: none !important;
  transition: transform 180ms ease, box-shadow 180ms ease;
  position: relative;
}

.maths-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--maths-shadow);
}

.maths-card-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 0.5rem;
}

.maths-card h3 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--maths-ink);
}

.maths-card p {
  margin: 0;
  color: var(--maths-muted);
  line-height: 1.45;
}

.maths-card-icon {
  display: inline-flex;
  flex-shrink: 0;
  width: 2.4rem;
  height: 2.4rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 1.1rem;
  background: rgba(31, 143, 85, 0.12);
}

.maths-card-arrow {
  position: absolute;
  right: 1.1rem;
  bottom: 0.9rem;
  font-size: 1.5rem;
  color: var(--maths-ink);
}

.maths-card--blue { --maths-card-accent: #2f6fed; background: linear-gradient(180deg, #ffffff 0%, var(--maths-blue-soft) 100%); }
.maths-card--green { --maths-card-accent: var(--maths-green); background: linear-gradient(180deg, #ffffff 0%, var(--maths-green-soft) 100%); }
.maths-card--yellow { --maths-card-accent: #e8a316; background: linear-gradient(180deg, #ffffff 0%, var(--maths-yellow-soft) 100%); }
.maths-card--purple { --maths-card-accent: #7c5cf0; background: linear-gradient(180deg, #ffffff 0%, var(--maths-purple-soft) 100%); }

.maths-footer-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.4rem 0 1.2rem;
}

.maths-note {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.9rem;
  align-items: start;
  padding: 1.1rem 1.2rem;
  border-radius: 1rem;
  border: 1px solid var(--maths-border);
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(13, 27, 42, 0.05);
}

.maths-quote {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.9rem;
  align-items: center;
  padding: 1.1rem 1.2rem;
  border-radius: 1rem;
  border: 1px solid var(--maths-border);
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(13, 27, 42, 0.05);
}

.maths-quote blockquote {
  margin: 0;
  border: none;
  padding: 0;
  color: var(--maths-ink);
  font-style: italic;
  font-size: 1.02rem;
  line-height: 1.5;
}

.maths-quote cite {
  display: block;
  margin-top: 0.5rem;
  color: var(--maths-muted);
  font-style: normal;
  font-size: 0.9rem;
}

.maths-quote-icon {
  font-size: 1.6rem;
}

.maths-site-footer {
  margin: 1.4rem 0 2rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--maths-border);
  color: var(--maths-muted);
  font-size: 0.85rem;
  text-align: center;
}

@media (max-width: 720px) {
  .maths-footer-row {
    grid-template-columns: 1fr;
  }
}

.maths-note-icon {
  display: inline-flex;
  width: 2.7rem;
  height: 2.7rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(31, 143, 85, 0.12);
  color: var(--maths-green);
  font-size: 1.35rem;
}

.maths-note strong {
  color: var(--maths-green);
}

/* Bandeau de navigation entre notions (précédente / suivante) */
.notion-nav {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 0.8rem;
  margin: 0.2rem 0 1.5rem;
}

.notion-nav__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  max-width: 48%;
  padding: 0.5rem 0.85rem;
  border: 1px solid var(--maths-border);
  border-radius: 0.75rem;
  background: #ffffff;
  box-shadow: 0 4px 12px rgba(13, 27, 42, 0.05);
  color: var(--maths-ink) !important;
  text-decoration: none !important;
  font-weight: 600;
  line-height: 1.25;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.notion-nav__btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--maths-shadow);
}

.notion-nav__btn--next {
  margin-left: auto;
  text-align: right;
}

.notion-nav__icon {
  display: inline-flex;
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(31, 143, 85, 0.12);
  color: var(--maths-green);
}

.notion-nav__text small {
  display: block;
  color: var(--maths-muted);
  font-weight: 700;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.notion-nav__title {
  font-size: 0.78rem;
}

@media (max-width: 640px) {
  .notion-nav__title {
    display: none;
  }
}

/* Lien Toutatice (accès Pronote via l'ENT) : icône dans les menus… */
.md-nav__link[href^="https://www.toutatice.fr"]::before,
.md-tabs__link[href^="https://www.toutatice.fr"]::before {
  content: "";
  display: inline-block;
  flex-shrink: 0;
  width: 1em;
  height: 1em;
  margin-right: 0.4em;
  vertical-align: -0.12em;
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><rect width='16' height='16' rx='3' fill='white'/><rect x='1.5' y='1.5' width='2.6' height='13' fill='%2378cbe0'/><rect x='4.1' y='1.5' width='2.6' height='13' fill='%23f39224'/><rect x='6.7' y='1.5' width='2.6' height='13' fill='%23bbd030'/><rect x='9.3' y='1.5' width='2.6' height='13' fill='white'/><rect x='11.9' y='1.5' width='2.6' height='13' fill='%23e61649'/><rect x='0.5' y='0.5' width='15' height='15' rx='2.5' fill='none' stroke='rgba(13,27,42,0.25)'/></svg>")
    center / contain no-repeat;
}

/* … et bouton dans le bandeau d'en-tête (ajouté par toutatice-header.js). */
.toutatice-header-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0.4rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--maths-border);
  border-radius: 999px;
  color: var(--maths-ink) !important;
  font-weight: 700;
  font-size: 0.65rem;
  white-space: nowrap;
  text-decoration: none !important;
  transition: border-color 160ms ease, color 160ms ease;
}

.toutatice-header-link:hover {
  color: var(--maths-green) !important;
  border-color: var(--maths-green);
}

.toutatice-header-link svg {
  width: 1rem;
  height: 1rem;
}

@media (max-width: 480px) {
  .toutatice-header-link span {
    display: none;
  }
}

/* Compteur de visites visible dans le pied de page (compteur-visites.js) */
.compteur-visites {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.6rem 0.8rem;
  color: var(--md-footer-fg-color--light);
  font-size: 0.64rem;
  white-space: nowrap;
}

/* La section Accès rapide est utilisée par les scripts : on la rend lisible. */
#accès-rapide + p,
#acces-rapide + p {
  color: var(--maths-muted);
}

.md-content h2#accès-rapide,
.md-content h2#acces-rapide {
  margin-top: 2rem;
}

.md-content h2#accès-rapide ~ ul,
.md-content h2#acces-rapide ~ ul {
  columns: 2;
  column-gap: 2rem;
}

@media (max-width: 960px) {
  .maths-hero {
    grid-template-columns: 1fr;
  }
  .maths-hero h2 {
    white-space: normal;
  }
  .maths-illustration {
    aspect-ratio: 16 / 9;
  }
  .maths-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .maths-brand {
    align-items: flex-start;
    flex-direction: column;
  }
  .maths-cards {
    grid-template-columns: 1fr;
  }
  .md-content h2#accès-rapide ~ ul,
  .md-content h2#acces-rapide ~ ul {
    columns: 1;
  }
}
