/* style.css */

/* Body */
html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: Arial, sans-serif;
  color: #1a1a4d;
  background-color: #f5f5f5;
  background-image: url("https://cebastien29.github.io/sebastien.mace/Assets/images/background.jpg");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;

  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
header {
  background-color: #2c3e50;
  padding: 20px 0;
  color: white;
  text-align: center;

  display: flex;
  justify-content: center;
}

main {
  flex: 1;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;

  max-width: 100%;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;

  gap: 20px;
  overflow: hidden;
}

.side-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 1200px;
}

.side-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  height: auto;
  object-fit: cover;
  border-radius: 8px;
}

.title-block {
  flex: 1;
  min-width: 200px;
  text-align: center;
}

.title-block h1 {
  margin: 0;
  font-size: 2.5rem;
  color: #0043cc;
}

.title-block p {
  margin: 10px 0 0;
  font-size: 1.2rem;
  color: #dddddd;
}

/* Navigation */
nav {
  background-color: #2a6971;
  padding: 10px;
  text-align: center;
}

nav a {
  color: #ffffff;
  margin: 0 15px;
  text-decoration: none;
  font-weight: bold;
}

nav a:hover,
nav a:focus {
  text-decoration: underline;
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}

/* Profile Section */
.profile {
  display: flex;
  align-items: center;
  gap: 20px;
}

.profile img {
  max-width: 150px;
  border-radius: 8px;
}

/* Headings */
h2 {
  color: #2c3e50;
  border-bottom: 2px solid #2980b9;
  padding-bottom: 5px;
}

/* Timeline */
.timeline {
  margin-left: 20px;
  border-left: 3px solid #2980b9;
  padding-left: 15px;
}

.timeline-item {
  margin-bottom: 20px;
}

.timeline-date {
  font-weight: bold;
  color: #2980b9;
  margin-bottom: 5px;
}

/* Lists */
ul {
  padding-left: 20px;
}

/* Footer */
footer {
  text-align: center;
  color: #000000;
  padding: 15px;
  margin-top: 40px;
  font-size: 0.9em;
}

/* Global Links */
a {
  color: #0099ff;
  text-decoration: none;
}

a:hover,
a:focus {
  text-decoration: underline;
  outline: 2px solid #0099ff;
  outline-offset: 2px;
}

/* Home Content */
.home-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Section blocks */
.section {
  background: #e8eff2;
  padding: clamp(1rem, 3vw, 2rem);
  margin: clamp(1rem, 3vw, 2rem) auto;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  width: min(1200px, 90%);
}

/* Images */
.img,
.photo {
  display: block;
  margin-left: auto;
  margin-right: auto;
  border-radius: 8px;
}

.photo {
  max-width: 200px;
  height: auto;
}

/* About Section */
.about-content {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.photo-container {
  flex-shrink: 0;
}

.text-container {
  flex: 1;
}

.image-wrapper {
  position: relative;
  display: inline-block;
}

.image-wrapper img {
  display: block;
  user-select: none;
  pointer-events: none;
}

.image-wrapper::after {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}


/* Tablette */
@media (max-width: 1024px) {
  .side-group {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Image 1 sur toute la ligne */
  .side-group > *:first-child {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
  }

  /* image elle-même */
  .side-group > *:first-child img {
    width: 60%;
    max-width: 100%;
    display: block;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .side-group {
    grid-template-columns: 1fr;
  }

  .side-group > *:first-child img {
    width: 100%;
  }
}


.algorithm {
    border: 1px solid #000;
    padding: 12px;
    background: #f9f9f9;
    overflow-x: auto;
}

.algorithm h3 {
    margin-top: 0;
    font-size: 1.1em;
}

.algorithm ul {
    padding-left: 2em;
}

.algorithm li {
    margin: 0.8em 0;
}

/* Alignement à gauche des équations MathJax */
.algorithm .eq {
    text-align: left;
}

.algorithm mjx-container[jax="CHTML"][display="true"] {
    text-align: left !important;
    margin: 0.3em 0 !important;
}


/* Desktop (taille normale) */
.algorithm mjx-container {
    font-size: 100% !important;
}

/* Tablette */
@media (max-width: 1024px) {
    .algorithm mjx-container {
        font-size: 85% !important;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .algorithm mjx-container {
        font-size: 70% !important;
    }
}

@media (max-width: 480px) {
    .algorithm mjx-container {
        font-size: 60% !important;
    }
}

.algorithm {
    overflow-x: auto;
}

/* Écrans moyens (tablettes) */
@media (max-width: 1024px) {
    .algorithm mjx-container {
        font-size: 75% !important;
    }
}

/* Smartphones */
@media (max-width: 768px) {
    .algorithm {
        overflow-x: auto;
    }

    .algorithm mjx-container {
        font-size: 65% !important;
    }
}

/* Petits smartphones */
@media (max-width: 480px) {
    .algorithm mjx-container {
        font-size: 55% !important;
    }
}