/* Responsive Design pour les écrans < 768px */

@media screen and (max-width: 768px) {
  /* Corps du document */
  html,
  body {
    overflow-x: hidden;
  }

  body {
    box-sizing: border-box;
  }

  /* Navigation */
  .nav {
    display: none;
  }
 .skills {
    padding: 0.5rem;
  }
   .skills-grid {
    grid-template-columns: 1fr, 1fr;  /* une card par ligne */
    gap: 1rem;
  }
.skill {
  padding: 1rem;
  width: 100;
}

  .skill-name {
    font-size: 0.9rem;
  }

  .skill-description {
    display: none;
  }

  .soft-skill {
    padding: 0.5rem;
  }

  .sidebar-toggle {
    display: block;
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: var(--background-color);
    border: none;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    color: var(--text-color);
  }

  /* Sidebar */
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 100%;
    background: var(--sidebar-bg);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 999;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    box-sizing: border-box;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar .nav-content {
    width: 100%;
    margin-bottom: 40px;
  }

  .sidebar .nav-content .nav-links {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-top: 20px;
    list-style: none;
    padding: 0;
  }

  .sidebar .nav-content .nav-links li {
    margin: 10px 0;
    text-align: center;
  }

  .sidebar .nav-content .nav-links a {
    font-size: 1.5rem;
    padding: 10px 0;
    display: block;
    color: var(--text-color);
    text-decoration: none;
  }

  /* Main Content */
  .main-content {
    margin-left: 0;
    padding: 15px;
    width: 100%;
  }

  /* Hero Section */
  .hero-content {
    padding: 15px;
    margin-top: -100px;
  }

  .hero-content h1 {
    font-size: 2rem;
    margin-bottom: 10px;
  }

  .hero-content p {
    font-size: 1.2rem;
  }

  .hero-content h1 .prenom {
    display: block;
  }

  .hero-content h1 .nom {
    display: block;
  }

  /* Sections générales */
  section {
    padding: 20px 15px;
  }

  h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
  }

  h3 {
    font-size: 1.3rem;
  }

  h4 {
    font-size: 1.1rem;
  }

  /* About Section */
  .about-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .about-text {
    text-align: left;
    margin: 0;
    margin-bottom: 20px;
    width: 100%;
    max-width: 100%;
    padding: 0 15px;
    font-size: 0.95rem;
    line-height: 1.7;
    box-sizing: border-box;
    word-wrap: break-word;
  }

  .skills {
    width: 100%;
  }

  /* Skills Grid */
  /* .skills-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 10px;
  } */

  .skill-icon {
    font-size: 1.5rem;
  }

  .soft-skills-grid {
    grid-template-columns: 1fr 1fr;
    gap: 15px;
  }

  /* Projects Grid */
  .projects-grid {
    display: flex;
    flex-direction: column;
    gap: 0px;
    padding: 0 0.5vw;

  }

  .project-card {
    padding: 10px 0;
    border-radius: 12px;
    background: var(--background-color, #181818);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .gallery {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    overflow-x: unset;
    padding: 0 !important;
    margin: 0 !important;
    margin-bottom: 2px !important;
    justify-items: center;
  }

  .site-image {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    height: 133px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  }

  .project-content {
    padding: 0;
    margin: 0;
    background: none;
  }

  .project-content h3,
  .project-content p {
    padding-left: 2vw;
    padding-right: 2vw;
  }

  .project-content p {
    padding: 0;
    margin-bottom: 0.5em;
  }

  .project-tech {
    margin: 0.5em 0;
  }

  .project-tech span {
    background: rgba(0, 184, 148, 0.08);
    border-radius: 12px;
    padding: 4px 10px;
    color: var(--accent-color, #00b894);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .see-more-btn {
    display: block;
    margin: 0.5em auto 1em auto;
    background: var(--primary-color, #00b894);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 6px 18px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
    text-align: center;
    margin-top: 15px;
    font-size: 0.7rem;
  }

  .see-more-btn:hover {
    background: var(--accent-color, #00997a);
  }

  .contact-form {
    margin-top: 20px;
  }

  .form-group {
    margin-bottom: 15px;
  }

  input,
  textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--accent-color);
    border-radius: 5px;
    background: var(--card-bg);
    color: var(--text-color);
  }

  .theme-toggle {
    top: 20px;
  }

  .profile-card {
    text-align: center;
  }

  .profile-image img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 15px;
  }

  .info-section {
    margin-bottom: 20px;
  }

  .info-section ul {
    list-style: none;
    padding: 0;
  }

  .timeline {
    position: relative;
    padding-left: 20px;
    margin-top: 20px;
  }

  .timeline-item {
    position: relative;
    margin-bottom: 30px;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .timeline-date {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--primary-color, #00b894);
    margin-bottom: 8px;
    text-align: left;
  }

  .timeline-content {
    padding: 15px;
    border-radius: 8px;
    background: var(--timeline-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-color);
  }

  .timeline-content h3,
  .timeline-content h4 {
    text-align: left;
    font-size: 1.1rem;
    margin: 0 0 5px 0;
    color: var(--text-color);
  }

  .timeline-content p {
    font-size: 0.95rem;
    margin-bottom: 8px;
    text-align: left;
    color: var(--text-color);
  }

  .timeline-tech {
    margin: 8px 0;
  }

  .techno {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.9rem;
  }

  .techno span {
    background: rgba(0, 184, 148, 0.08);
    border-radius: 12px;
    padding: 4px 10px;
    color: var(--accent-color, #00b894);
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .timeline-content ul {
    padding-left: 18px;
    margin: 8px 0 0 0;
  }

  .timeline-content ul li {
    font-size: 0.95rem;
    margin-bottom: 3px;
    color: var(--text-color);
  }

  /* CV Section */
  .cv-section {
    padding: 15px;
  }

  .cv-preview img {
    max-width: 100%;
    height: auto;
  }

  .sidebar-menu {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-top: 20px;
    list-style: none;
    padding: 0;
  }

  .sidebar-menu li {
    margin: 10px 0;
    text-align: center;
  }

  .sidebar-menu a {
    font-size: 1.5rem;
    padding: 10px 0;
    display: block;
    color: var(--text-color);
    text-decoration: none;
  }

  .project-content p {
    max-height: 4.5em;
    overflow: hidden;
    position: relative;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 0.5em;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
  }

  .project-content p.truncated {
    max-height: 6.5em;
  }

  .project-content p.expanded {
    max-height: 100em;
    -webkit-line-clamp: unset;
  }

  .project-content p {
    font-size: 0.9rem;
  }

  .contact-links {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
    flex-direction: column;
    align-items: center;
    font-size: 0.9rem;
  }

  .contact {
    background-color: var(--contact-bg);
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
  }

  .project-content p::after {
    content: "";
    display: block;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2em;
    background: linear-gradient(
      to bottom,
      rgba(255, 255, 255, 0),
      var(--background-color, #111) 90%
    );
    pointer-events: none;
    transition: opacity 0.3s;
    opacity: 1;
  }

  .project-content p.expanded::after {
    opacity: 0;
  }

  .experience h2 {
    font-size: 1.3rem;
    text-align: center;
    margin-bottom: 20px;
  }

  /* Styles spécifiques pour le thème clair en mode responsive, uniquement pour la timeline */
  .theme-light .timeline-content {
    background: rgba(44, 62, 80, 0.08) !important;
    border: 1px solid rgba(44, 62, 80, 0.1) !important;
    color: #2c3e50 !important;
  }
  .theme-light .timeline-content h3,
  .theme-light .timeline-content h4,
  .theme-light .timeline-content p,
  .theme-light .timeline-content ul li {
    color: #2c3e50 !important;
  }

  .theme-light .project-card {
    background: rgba(44, 62, 80, 0.08);
    border: 1px solid rgba(44, 62, 80, 0.1);
  }

  .theme-light .project-content h3,
  .theme-light .project-content h4 {
    color: #2c3e50;
  }

  .theme-light .project-content p {
    color: #2c3e50;
  }

  .theme-light .project-tech span {
    background: rgba(44, 62, 80, 0.08);
    color: #2c3e50;
    border: 1px solid rgba(44, 62, 80, 0.1);
  }

  .theme-light .project-tech span:hover {
    background: #2c3e50;
    color: #ffffff;
  }

  .theme-light .techno span {
    background: rgba(44, 62, 80, 0.08);
    color: #2c3e50;
    border: 1px solid rgba(44, 62, 80, 0.1);
  }

  .theme-light .techno span:hover {
    background: #2c3e50;
    color: #ffffff;
  }

  .theme-light .project-content p::after {
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #f8f9fa 90%);
  }

  .theme-light .sidebar-toggle {
    background: #2c3e50 !important;
    color: #ffffff !important;
  }

  .theme-light .sidebar {
    background: rgba(255, 255, 255, 0.98) !important;
  }
}

/* Ajustements supplémentaires pour les très petits écrans */
/* @media screen and (max-width: 480px) {
  .hero-content h1 {
    font-size: 1.8rem;
  }

  .hero-content p {
    font-size: 1rem;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .profile-card {
    padding: 10px;
  }

  .info-section {
    padding: 10px;
  }

  .sidebar {
    padding: 15px;
  }

  .sidebar-toggle {
    top: 15px;
    right: 15px;
  }

  .theme-toggle {
    top: 15px;
    right: 60px;
  }
} */