/* ==========================================================================
   Homepage
============================================================================= */

/* Global styles
============================================================================= */

html {
  box-sizing: border-box;
  font-size: 62.5%; /* easier rem usage */
}

*,
*::before,
*::after {
  box-sizing: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
}

h1 {
  color: #000;
  font-size: 2.4rem;
  margin-bottom: 0;
  margin-left: 25px;
  margin-top: 0;
  padding: 0;
  text-align: left;
}

h2 {
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.45;
  margin: 0;
}

p {
  line-height: 1.45;
  margin: 0;
}

a {
  color: #777;
}

nav a {
  color: #777;
}

a:hover {
  color: #000;
}

body {
  background-color: #f0f0f0;
  color: #000;
  font-family: lato, Arial, 'Helvetica Neue', Helvetica, sans-serif;
  font-size: 1.4rem;
}

/* Page header
============================================================================= */

#page-header {
  align-items: center;
  background-color: #fff;
  border-bottom: 1px solid #e2e2e2;
  display: flex;
  justify-content: center;
  margin: 0 auto;
  width: 100%;
}

#page-header-size {
  align-items: center;
  display: flex;
  justify-content: space-between;
  min-width: 1000px;
  padding: 30px;
}

/* Navigation bar
============================================================================= */

nav a:hover {
  color: #000;
}

.submenu li a {
  color: #333;
  display: block;
  padding: 0.5rem 0.75rem;
}

.menu > ul > li > a,
.menu-toggle {
  color: #fff;
  display: inline-block;
  padding: 0.5rem 0.75rem;
}

.submenu li a:hover {
  background: #f0f0f0;
}

.nav-box {
  align-items: center;
  display: flex;
}

menu > ul {
  background: #222;
  display: flex;
  gap: 1rem;
  padding: 0.5rem 1rem;
}

.menu > ul > li {
  position: relative; /* nécessaire pour positionner le sous-menu */
}

.menu > ul > li > a:hover,
.menu-toggle:hover,
.menu-toggle:focus {
  background: #444;
}

.submenu {
  background: #fff;
  border: 1px solid #ccc;
  box-shadow: 0 4px 12px rgb(0 0 0 / 15%);
  left: 0;
  min-width: 160px;
  opacity: 0;
  padding: 0.25rem 0;
  pointer-events: none;
  position: absolute;
  top: 100%;
  transform: translateY(5px);
  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
  z-index: 1000;
}

.has-submenu:hover > .submenu,
.has-submenu:focus-within > .submenu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

nav ul {
  display: flex;
  gap: 20px;
  list-style: none;
  margin-bottom: 0;
  margin-left: 25px;
  margin-top: 0;
  padding: 0;
}

/* Page body
============================================================================= */

main {
  align-self: center;
  display: flex;
  justify-content: center;
  margin: 0 auto;
  max-width: 1000px;
  min-width: 1000px;
  padding: 30px;
  width: 100%;
}

.page-layout {
  display: flex;
  gap: 30px;
}

/* Biography
============================================================================= */

.biography-display {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: fit-content;
  justify-content: center;
  margin: 0;
  overflow: hidden;
  padding: 20px;
  width: 210px;
}

.biography-inline {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  height: fit-content;
  justify-content: center;
  margin: 0;
  padding: 20px;
  width: 210px;
}

.bio-img {
  align-self: center;
  flex-shrink: 0;
  height: 160px;
  object-fit: cover;
  width: 160px;
}

.biography > hr {
  border: 1px solid #e2e2e2;
  color: #777;
  width: 100%;
}

.articles {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 30px;
}

/* articles
============================================================================= */

.article {
  align-items: flex-start;
  display: flex;
  flex-direction: row;
  width: 700px;
}

.article-img {
  border-radius: 5px;
  flex-shrink: 0;
  height: 180px;
  object-fit: cover;
  width: 180px;
}

.article-body {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.article-title {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 6px;
}

.article-meta {
  color: #777;
  font-size: 14px;
  margin: 0 0 12px;
}

.article-text {
  color: #000;
  font-size: 14px;
  line-height: 1.45;
}

header > h2 {
  margin: 0;
}

/* Box design
============================================================================= */

.boxes {
  background-color: #fff;
  border: 1px solid #e2e2e2;
  border-radius: 5px;
  box-sizing: border-box;
  gap: 20px;
  margin: 0;
  padding: 20px;
}

/* Page footer
============================================================================= */

.page-footer {
  align-items: center;
  background-color: #000;
  height: 16px;
  margin: 0 auto;
  max-width: 100%;
  min-width: 1000px;
  padding: 30px;
  text-align: center;
  width: 100%;
}

/* Page footer
============================================================================= */

.page-footer-text {
  align-content: center;
  align-self: center;
  color: #fff;
}

/* ==========================================================================
   Special media query for the main logo
============================================================================= */

@media screen and (width <= 440px) {
  header img {
    height: auto;
    width: 100%;
  }
}

/* Desktop styles
============================================================================= */

@media (width >= 999px) {
  body {
    /* blue */
    background-color: #0f0;
  }
}

/* Tablet styles
============================================================================= */

@media (width >= 769px) and (width <= 999px) {
  body {
    align-items: center;

    /* yellow */
    background-color: #00f;
  }

  .article {
    flex-direction: column;
    width: 700px;
  }

  #page-header-size {
    display: flex;
    justify-content: space-between;
    max-width: 100%;
    min-width: 769px;
    padding: 30px;
  }

  #page-header {
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    max-width: 100vw;
    width: 100%;
  }
}

/* Mobile styles horizontal
============================================================================= */

@media (width >= 481px) and (width <= 768px) {
  body {
    /* red */
    background-color: #ff0;
  }

  /* Header horizontal style
============================================================================= */

  #page-header {
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    width: 100vw;
  }

  #page-header-size {
    display: flex;
    justify-content: space-between;
    max-width: 100vw;
    min-width: 481px;
    padding: 30px;
  }

  /* Main content horizontal style
============================================================================= */

  main {
    align-self: center;
    width: 769px;
  }

  .page-layout {
    align-items: center;
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 30px;
  }

  /* Biography horizontal style
============================================================================= */

  .biography-display {
    align-items: flex-start;
    display: flex;
    flex-direction: row;
    order: 2;
    width: 700px;
  }

  .biography-inline {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: fit-content;
    margin: 0;
    padding: 20px;
    width: 700px;
  }

  /* Page footer horizontal style
============================================================================= */

  .page-footer {
    align-items: center;
    background-color: #000;
    height: 16px;
    margin: 0 auto;
    padding: 30px;
    text-align: center;
    width: 100vw;
  }
}

/* Mobile styles vertical
============================================================================= */

@media (width <= 480px) {
  body {
    /* red */
    background-color: #f0f;
  }
}
