/* Variables CSS */
:root {
    --primary-color: #34495e; /* Bleu foncé/gris pour les accents */
    --secondary-color: #899699; /* Gris clair pour les fonds */
    --text-color: #2c3e50; /* Texte foncé */
    --light-text-color: #fdfdfd; /* Texte clair */
    --accent-color: #e74c3c; /* Rouge pour les liens/boutons */
    --font-family-primary: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --font-family-secondary: 'Georgia', serif;
    --max-width: 1200px;
}

/* Réinitialisation des styles de base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family-primary);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--secondary-color);
    padding: 20px;
}

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

a:hover {
    text-decoration: underline;
}

ul {
    list-style: none;
}

/* Header */
header {
    background-color: var(--primary-color);
    color: var(--light-text-color);
    padding: 1rem 0;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    border-radius: 18px;
    position: relative;
}

/*header img {
    position: ;
    top: 75px;
    left: 20px;
}*/

header h1 {
    margin-bottom: 0.5rem;
}

/* Navigation */
nav ul {
    display: flex;
    justify-content: center;
    padding: 0.5rem 0;
}

nav ul li {
    margin: 0 15px;
}

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

nav ul li a:hover {
    color: var(--accent-color);
    text-decoration: none;
}

/* Mise en page principale */
main {
    display: flex;
    justify-content: space-between;
    max-width: var(--max-width);
    margin: 0 auto;
    gap: 20px;
}

.blog-posts {
    flex: 3;
    background-color: #dddbdb;
    padding: 30px;
    border-radius: 18px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.blog-posts article {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.blog-posts article:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.blog-posts h2 {
    color: var(--primary-color);
    font-family: var(--font-family-secondary);
    margin-bottom: 0.5rem;
    border: none; /* Supprime le style h2 existant */
    background-color: transparent; /* Supprime le style h2 existant */
    padding: 0; /* Supprime le style h2 existant */
    text-align: left; /* Supprime le style h2 existant */
}

.blog-posts .post-meta {
    font-size: 0.9em;
    color: #7f8c8d;
    margin-bottom: 1rem;
}

.blog-posts img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1rem 0;
    border-radius: 5px;
}

.blog-posts p {
    margin-bottom: 1rem;
}

.blog-posts .read-more,
.blog-posts .read-more-btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--light-text-color);
    padding: 8px 15px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.blog-posts article::after {
    content: "";
    display: table;
    clear: both;
}

.blog-posts .read-more:hover,
.blog-posts .read-more-btn:hover {
    background-color: var(--accent-color);
    text-decoration: none;
}

/* Sidebar */
.sidebar {
    flex: 1;
    background-color: #34495e;
  padding: 20px;
    border-radius: 18px;
    box-shadow: 0 2px 5px rgba(8, 8, 8, 0.1);
  color: var(--light-text-color);
    position: relative;
    padding-bottom: 220px;  /*Make space for the QR code */
}

.qr-container {
    position: relative;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
}

.sidebar h3 {
  color: var(--light-text-color);
    margin-bottom: 1rem;
    font-family: var(--font-family-secondary);
}

.sidebar ul {
    margin-top: 1rem;
}

.sidebar ul li {
    margin-bottom: 0.5rem;
}

.sidebar ul li a {
  color: var(--light-text-color);
  transition: color 0.3s ease;
}

.sidebar ul li a:hover {
    color: var(--accent-color);
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: var(--light-text-color);
    text-align: center;
    padding: 1rem 0;
    margin-top: 30px;
    border-radius: 8px;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
}

/* Responsive design */
@media (max-width: 768px) {
    main {
        flex-direction: column;
        gap: 20px;
    }

    .blog-posts, .sidebar {
        flex: auto;
        width: 100%;
    }

    nav ul {
        flex-direction: column;
    }

    nav ul li {
        margin: 5px 0;
    }

    .like-button {
        float: none;
        display: block; /* S'assure que c'est un bloc pour le centrage */
        margin: 15px auto; /* Centre le bouton */
    }

    .blog-posts img {
        width: 100%; /* Force l'image à ne pas déborder */
        height: auto; /* Garde les bonnes proportions */
    }
}
/* From Uiverse.io by Priyanshu02020 */ 
.on {
  display: none;
}

.like-button {
  position: relative;
  cursor: pointer;
  display: flex;
  height: 48px;
  width: 136px;
  border-radius: 16px;
  border: none;
  background-color: #1d1d1d;
  overflow: hidden;
  box-shadow:
    inset -2px -2px 5px rgba(255, 255, 255, 0.2),
    inset 2px 2px 5px rgba(0, 0, 0, 0.1),
    4px 4px 10px rgba(0, 0, 0, 0.4),
    -2px -2px 8px rgba(255, 255, 255, 0.1);
  float: right;
}

.like {
  width: 70%;
  height: 100%;
  display: flex;
  cursor: pointer;
  align-items: center;
  justify-content: space-evenly;
}

.like-icon {
  fill: #505050;
  height: 28px;
  width: 28px;
}

.like-text {
  color: #fcfcfc;
  font-size: 16px;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

.like-count {
  position: absolute;
  right: 0;
  width: 30%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #717070;
  font-size: 16px;
  border-left: 2px solid #4e4e4e;
  transition: all 0.5s ease-out;
}

.like-count.two {
  transform: translateY(40px);
}

.on:checked ~ .like .like-icon {
  fill: #fc4e4e;
  animation: enlarge 0.2s ease-out 1;
  transition: all 0.2s ease-out;
}

.on:checked ~ .like-count.two {
  transform: translateX(0);
  color: #fcfcfc;
}

.on:checked ~ .like-count.one {
  transform: translateY(-40px);
}

@keyframes enlarge {
  0% {
    transform: scale(0.5);
  }
  100% {
    transform: scale(1.2);
  }
}

/* Styles for Comments Section */
.comments-toggle {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--light-text-color);
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 1rem;
    transition: background-color 0.3s ease;
}

.comments-toggle:hover {
    background-color: var(--accent-color);
}

.comments-section {
    margin-top: 1rem;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 5px;
    display: none; /* Initially hidden */
}

.comment-form {
    margin-bottom: 1rem;
}

.comment-form input[type="text"],
.comment-form textarea {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: var(--font-family-primary);
}

.comment-form button {
    background-color: var(--accent-color);
    color: var(--light-text-color);
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.comment-form button:hover {
    background-color: #c0392b;
}

.comments-list {
    list-style-type: none;
}

.comment {
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.comment:last-child {
    border-bottom: none;
}

.comment .comment-author {
    font-weight: bold;
    color: var(--primary-color);
}

.comment .comment-date {
    font-size: 0.8em;
    color: #7f8c8d;
    margin-left: 10px;
}

.full-text {
    display: none;
}

.hidden-content {
    display: none;
}

/* From Uiverse.io by augustin_4687 -------------------------------------------------------------------*/ 
.button {
  --stone-50: #fafaf9;
  --stone-800: #292524;
  --yellow-300: #fde047;
  --yellow-400: #facc15;
  --yellow-500: #eab308;
  --black-25: rgba(0, 0, 0, 0.25);

  position: relative;
  display: block;
  width: 4rem;
  height: 4rem;
  cursor: pointer;

  & > button {
    cursor: pointer;
    display: inline-block;
    height: 100%;
    width: 100%;
    appearance: none;
    border: 2px solid var(--stone-800);
    border-radius: 0.25rem;
    background-color: var(--yellow-400);
    outline: 2px solid transparent;
    outline-offset: 2px;
    cursor: pointer;
    transition: background-color 0.2s;

    &:hover {
      background-color: var(--yellow-300);
    }

    &:checked {
      background-color: var(--stone-800);
      border-color: var(--stone-800);

      &:hover {
        background-color: #44403c;
      }
    }

    &:active {
      outline-color: var(--stone-800);
    }

    &:focus-visible {
      outline-color: var(--stone-800);
      outline-style: dashed;
    }
  }

  & > span:nth-child(2) {
    position: absolute;
    inset: 3px;
    pointer-events: none;
    background-color: var(--yellow-400);
    border-bottom: 2px solid var(--black-25);
    transition: transform 75ms;

    &::before {
      content: "";
      position: absolute;
      inset: 0;
      background-image: radial-gradient(
          rgb(255 255 255 / 80%) 20%,
          transparent 20%
        ),
        radial-gradient(rgb(255 255 255 / 100%) 20%, transparent 20%);
      background-position:
        0 0,
        4px 4px;
      background-size: 8px 8px;
      mix-blend-mode: hard-light;
      opacity: 0.5;
      animation: dots 0.5s infinite linear;
    }
  }

  & > span:nth-child(3) {
    position: absolute;
    pointer-events: none;
    inset: 0;

    &::before {
      content: "";
      width: 0.375rem;
      height: 0.375rem;
      position: absolute;
      top: 0.25rem;
      left: 0.25rem;
      background-color: var(--stone-800);
      border-radius: 0.125rem;
      box-shadow:
        3.125em 0 var(--stone-800),
        0 3.125em var(--stone-800),
        3.125em 3.125em var(--stone-800);
    }
  }

  & > span:nth-child(4) {
    position: absolute;
    pointer-events: none;
    inset: 0;
    filter: drop-shadow(0.25em 0.25em 0 rgba(0, 0, 0, 0.2));
    transition: all 75ms;

    &::after {
      content: "";
      width: 0.25rem;
      height: 0.25rem;
      position: absolute;
      top: 0.875rem;
      left: 1rem;
      border-radius: 0.0625px;
      background-color: var(--stone-800);
      box-shadow:
        0.75em 2em var(--stone-800),
        1em 2em var(--stone-800),
        0.75em 1.75em var(--stone-800),
        1em 1.75em var(--stone-800),
        0.75em 1.25em var(--stone-800),
        1em 1.25em var(--stone-800),
        0.75em 1em var(--stone-800),
        1em 1em var(--stone-800),
        1em 0.75em var(--stone-800),
        1.5em 0.75em var(--stone-800),
        1.25em 0.75em var(--stone-800),
        1.25em -0.25em var(--stone-800),
        1.5em 0em var(--stone-800),
        1.25em 0.5em var(--stone-800),
        1.5em 0.5em var(--stone-800),
        1.25em 0.25em var(--stone-800),
        1.5em 0.25em var(--stone-800),
        1.25em 0 var(--stone-800),
        1em -0.25em var(--stone-800),
        0.75em -0.25em var(--stone-800),
        0.5em -0.25em var(--stone-800),
        0.25em -0.25em var(--stone-800),
        0.25em 0 var(--stone-800),
        0 0.25em var(--stone-800),
        0 0.5em var(--stone-800),
        0.25em 0.25em var(--stone-800),
        0.25em 0.5em var(--stone-800);
    }
  }

  & > span:nth-child(5) {
    position: absolute;
    background-color: var(--yellow-400);
    border: 2px solid var(--stone-800);
    border-radius: 0.75rem;
    pointer-events: none;
    z-index: -1;
    inset: 0.5rem 1.5rem;
    box-shadow:
      7px 0 0 0 var(--stone-800),
      inset 0 2px 0 0 var(--yellow-300),
      inset 0 -2px 0 0 var(--yellow-500);
    transition: all 0ms cubic-bezier(0, 0.5, 0.4, 1);
  }

  & button:active ~ span:nth-child(5) {
    transform: translateY(-200%);
    transition-duration: 200ms;
    opacity: 0;
  }

  & button:hover ~ span:nth-child(4) {
    filter: drop-shadow(0.125em 0.125em 0 rgba(0, 0, 0, 0.2));
  }
}

@keyframes dots {
  0% {
    background-position:
      0 0,
      4px 4px;
  }
  100% {
    background-position:
      8px 0,
      12px 4px;
  }
}

@media (prefers-color-scheme: dark) {
  .button {
    & button:active,
    & button:focus-visible {
      outline-color: var(--yellow-400);
    }
  }
}
