/* Style global */
:root {
  --bg-color: #fff2e4;
  --text-color: #333333;
  --accent-color: #A0522D;
  --card-bg: #FFFFFF;
  --header-footer-bg: #e4d4c4;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5em;
}

body {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  background-color: var(--bg-color);
  color: var(--text-color);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Titres */
h2 {
  font-size: 2em;
  margin-bottom: 0.75em;
  color: var(--accent-color);
  text-align: center;
}

h3 {
  font-size: 1.4em;
  margin-bottom: 1em;
  color: var(--text-color);
}

/* Header */
header {
  background: var(--header-footer-bg);
  padding: 1em 0;
  border-bottom: 1px solid #ddd;
  position: sticky;
  top: 0;
  z-index: 1;
}

header div {
  max-width: 70%;
  margin: auto;
  overflow: hidden;
  padding: 0 1.25em;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 {
  font-size: 1.8em;
}

header h1 a {
  text-decoration: none;
  color: var(--text-color);
}

nav ul {
  list-style: none;
  display: flex;
}

nav ul li {
  margin-left: 1.25em;
}

nav ul li a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: bold;
  transition: color 0.3s ease;
}

nav ul li a:hover,
nav ul li a.active {
  color: var(--accent-color);
}

header a:active,
header ul li a:active,
main section:nth-of-type(3)>div>div ul li a:active,
.back-link:active {
  color: #672f07;
}

/* Main */
main {
  flex-grow: 1;
  padding: 0;
}

section,
footer>div {
  width: 90%;
  max-width: 1100px;
  margin: auto;
  overflow: hidden;
  padding: 0 20px;
}

section {
  border-bottom: 1px solid #eee;
}

section:last-of-type {
  border-bottom: none;
}

/* Section Présentation */
main section:first-of-type {
  display: flex;
  align-items: center;
  justify-content: space-around;
  flex-wrap: wrap;
  text-align: center;
  padding: 4rem 0;
}

main section:first-of-type div {
  max-width: 600px;
}

main section:first-of-type h2 {
  margin-bottom: 0.25em;
  color: var(--text-color);
}

main section:first-of-type p {
  font-size: 1.1em;
  margin-bottom: 1.5em;
}

main section:first-of-type img {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1em;
  border: 3px solid var(--accent-color);
}

/* Section a-propos */
main section:nth-of-type(2) p {
  margin-bottom: 1em;
  text-align: center;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  padding-bottom: 3em;
}

/* Qualités */
main section:nth-of-type(2) h3 {
  color: var(--accent-color);
  text-align: center;
}

main section:nth-of-type(2) ul {
  list-style: none;
  padding: 0;
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 1.5em;
  margin-bottom: 3em;
}

main section:nth-of-type(2) li {
  background: var(--header-footer-bg);
  padding: 10px 15px;
  border-radius: 5px;
  font-weight: bold;
}

/* Section Compétences BUT Informatique */
main section:nth-of-type(3) {
  padding: 3rem 0;
  padding-top: 0;
  border-bottom: 1px solid #eee;
}

main section:nth-of-type(3)>div {
  margin-top: 2em;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2em;
}

main section:nth-of-type(3)>div>div {
  background: var(--card-bg);
  padding: 1.5em;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
}

main section:nth-of-type(3)>div>div h3 {
  color: var(--accent-color);
  margin-bottom: 1em;
  border-bottom: 1px solid #eee;
  padding-bottom: 0.5em;
  text-align: left;
}

main section:nth-of-type(3)>div>div h4 {
  color: var(--text-color);
  margin-top: 1.5em;
  margin-bottom: 0.8em;
}

main section:nth-of-type(3)>div>div p {
  margin-bottom: 1em;
}

main section:nth-of-type(3)>div>div ul {
  list-style: disc;
  margin-left: 20px;
  padding-left: 0;
}

main section:nth-of-type(3)>div>div ul li {
  margin-bottom: 0.5em;
}

main section:nth-of-type(3)>div>div ul li a {
  color: var(--accent-color);
  text-decoration: none;
}

main section:nth-of-type(3)>div>div ul li a:hover {
  text-decoration: underline;
}

/* Section stack techno */
main section:nth-of-type(4)>div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2em;
  margin-top: 2em;
  padding-bottom: 3em;
}

main section:nth-of-type(4)>div>div {
  background: var(--card-bg);
  padding: 1.5em;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

main section:nth-of-type(4)>div>div h3 {
  margin-bottom: 0.6em;
  color: var(--accent-color);
  border-bottom: 1px solid #eee;
  padding-bottom: 0.4em;
}

main section:nth-of-type(4)>div>div ul {
  list-style: none;
}

main section:nth-of-type(4)>div>div ul li {
  margin-bottom: 0.5em;
  padding-left: 1.2em;
  position: relative;
}

main section:nth-of-type(4)>div>div ul li::before {
  content: '✓';
  color: var(--accent-color);
  position: absolute;
  left: 0;
  font-weight: bold;
}

main section:nth-of-type(4)>div>div ul li img {
  width: 2em;
  vertical-align: middle;
  margin-right: 8px;
  transition: transform 0.3s ease;
}

main section:nth-of-type(4)>div>div ul li img:hover {
  transform: scale(1.1);
}

/* Section projets */
main section:nth-of-type(5)>div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2em;
  margin-top: 2em;
  padding-bottom: 3em; /* Espace sous la section */
}

main section:nth-of-type(5)>div>div {
  background: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

main section:nth-of-type(5)>div>div:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

main section:nth-of-type(5)>div>div>div {
  padding: 1.5em;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

main section:nth-of-type(5)>div>div>div h3 {
  margin-top: 0;
  margin-bottom: 0.35em;
  color: var(--accent-color);
}

main section:nth-of-type(5)>div>div>div p {
  margin-bottom: 1em;
  flex-grow: 1;
}

main section:nth-of-type(5)>div>div>div>div {
  margin-bottom: 1em;
}

main section:nth-of-type(5)>div>div>div>div span {
  display: inline-block;
  background: var(--header-footer-bg);
  color: var(--text-color);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.8em;
  margin-right: 5px;
  margin-bottom: 5px;
}

/* Sections expérience pro et formation */
main section:nth-of-type(6),
main section:nth-of-type(7) {
  padding-bottom: 3em;
}

main section:nth-of-type(6) ul,
main section:nth-of-type(7) ul {
  list-style: none;
  padding-left: 0;
  max-width: 700px;
  margin: 1rem auto;
}

main section:nth-of-type(6) li,
main section:nth-of-type(7) li {
  background: var(--card-bg);
  margin-bottom: 1.5em;
  padding: 1.5em;
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

main section:nth-of-type(6) li strong,
main section:nth-of-type(7) li strong {
  display: block;
  font-size: 1.2em;
  color: var(--accent-color);
  margin-bottom: 0.5em;
}

main section:nth-of-type(6) li span,
main section:nth-of-type(7) li span {
  display: block;
  color: #666;
  font-style: italic;
  margin-bottom: 0.5em;
}

/* Logo Intermarché expérience */
main section:nth-of-type(6) li:first-of-type {
  background-image: url("/images/logos/intermarche.png");
  background-size: 9em;
  background-repeat: no-repeat;
  background-position: top 1.5em right 1.5em;
}

/* Logo IUT formation */
main section:nth-of-type(7) li:first-of-type {
  background-image: url("/images/logos/iut-lannion.png");
  background-size: 5em;
  background-repeat: no-repeat;
  background-position: top 1.5em right 1.5em;
}

/* Logo Lycée formation */
main section:nth-of-type(7) li:nth-of-type(2) {
  background-image: url("/images/logos/lycee.svg");
  background-size: 9em;
  background-repeat: no-repeat;
  background-position: top 1.5em right 1.5em;
}

/* Section contact */
main section:nth-of-type(8) {
  text-align: center;
  padding-bottom: 3em;
}

main section:nth-of-type(8) ul {
  list-style: none;
  text-align: center;
}

main section:nth-of-type(8) li {
  margin-bottom: 0.8em;
  font-size: 1.1em;
}

main section:nth-of-type(8) a {
  color: var(--accent-color);
  text-decoration: none;
}

main section:nth-of-type(8) a:hover {
  text-decoration: underline;
}

main section:nth-of-type(8)>div {
  display: flex;
  gap: 2em;
  margin-top: 1em;
  align-items: center;
}

main section:nth-of-type(8)>div>div:nth-of-type(2) {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 0;
}

main section:nth-of-type(8)>div>div:nth-of-type(2)>div {
  flex: 1;
  margin-bottom: 0;
  padding-bottom: 0;
  margin-top: 0;
  padding-top: 0;
}

main section:nth-of-type(8)>div>div:nth-of-type(2)>div:nth-of-type(2) iframe {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Formulaire de contact */
main section:nth-of-type(8)>div>div:first-of-type {
  flex: 1;
  max-width: 600px;
  margin: 0 auto;
  padding: 1.5em;
  background: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

main section:nth-of-type(8)>div>div:first-of-type h3 {
  text-align: center;
  margin-bottom: 1em;
  color: var(--accent-color);
}

main section:nth-of-type(8)>div>div:first-of-type form>div {
  margin-bottom: 0.75em;
}

main section:nth-of-type(8)>div>div:first-of-type form>div label {
  display: block;
  margin-bottom: 0.25em;
  font-weight: bold;
}

main section:nth-of-type(8)>div>div:first-of-type form>div input,
main section:nth-of-type(8)>div>div:first-of-type form>div textarea,
main section:nth-of-type(8)>div>div:first-of-type form>div select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: 'Arial', sans-serif;
  background-color: var(--bg-color);
}

main section:nth-of-type(8)>div>div:first-of-type form>div textarea {
  min-height: 120px;
  max-height: 320px;
  ;
  resize: vertical;
}

main section:nth-of-type(8)>div>div:first-of-type form>div:last-of-type {
  text-align: center;
}

main section:nth-of-type(8)>div>div:first-of-type form>div:last-of-type button {
  position: initial;
  margin: 0;
}

/* Footer */
footer {
  background: var(--header-footer-bg);
  color: #666;
  text-align: center;
  padding: 1.5rem 0;
  margin-top: auto;
  border-top: 1px solid #ddd;
  font-size: 0.9em;
}

footer img {
  width: 2em;
  vertical-align: middle;
  margin-right: 8px;
}

/***********************************************************************************/
/* Boutons */
main button {
  position: fixed;
  bottom: 20px;
  right: 20px;
  border: none;
  background-color: #333;
  color: white;
  padding: 10px 15px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  z-index: 1;
}

main button:hover {
  background-color: #555;
}

main button:active {
  background-color: black;
}

.btn {
  display: inline-block;
  background: var(--accent-color);
  color: #fff;
  padding: 10px 20px;
  text-decoration: none;
  border-radius: 5px;
  transition: background-color 0.3s ease;
  border: none;
  cursor: pointer;
  font-size: 1em;
  margin: 5px;
}

.btn:hover {
  background: #8B4513;
}

.btn:active {
  background: #672f07;
}

.dl-projets {
  max-height: 50px;
  text-align: center;
  margin-bottom: 3em;
}

/* Media queries */
@media (max-width: 768px) {
  header div {
    padding: 0.5rem 0;
    flex-direction: column;
    text-align: center;
  }

  html {
    scroll-padding-top: 8em;
  }

  nav ul {
    margin-top: 1em;
    justify-content: center;
    flex-wrap: wrap;
  }

  nav ul li {
    margin: 0 5px;
  }

  h2 {
    font-size: 1.8em;
  }

  .hero {
    flex-direction: column-reverse;
    padding: 2rem 0;
  }

  .hero-text {
    text-align: center;
  }

  .hero h2 {
    text-align: center;
  }

  .skills-grid,
  main section:nth-of-type(5)>div {
    grid-template-columns: 1fr;
  }

  main section:nth-of-type(3)>div {
    grid-template-columns: 1fr;
  }

  main section:nth-of-type(8)>div {
    flex-direction: column;
  }

  main section:nth-of-type(8)>div>div:nth-of-type(2)>div:nth-of-type(2) iframe {
    height: 300px;
  }

  main section:nth-of-type(8)>div>div:first-of-type {
    order: -1;
    margin-bottom: 2em;
    width: 100%;
  }
}