/* Variables */
:root {
  --accent: #e25430;
  --accent-hover: #c74224;
  --accent-ink: #9a2f19; 
  --text: #111;
  --muted: #5f6368;
  --border: #e6e6e6;
  --input-border: #cfcfcf;
  --bg-soft: #fafafa;
  --ring: rgba(242, 110, 79, 0.28);
  --card-bg: #f7f7f7;
  --card-border: #d9d9d9;
  --title-highlight: #ffe8a1;
  --title-bar-width: 92px;
  --title-bar-height: 14px;
  --title-bar-gap: 16px; 
  --max-width: 1300px;
}

/* Bannière du profil */
.profile-page {
  /* Remove global body offset just for profile page
     so content touches the fixed navbar with no gap */
  margin-top: 0;
}

.profile-banner {
  position: relative;
  height: 320px !important;
  margin-top: var(--nav-height) !important;
  background-size: cover;
  background-position: center;
}

.profile-banner .banner-actions {
  position: absolute;
  right: 24px;
  /* Push button below the fixed navbar */
  top: calc(var(--nav-height, 64px) + 12px);
  z-index: 2;
}

.btn-logout {
  margin-top: 35px;
  padding: 10px 16px;
  background: var(--accent-hover); 
  color: #fff;
  border-radius: 24px;
  font-weight: 600;
  text-decoration: none;
}

/* Contenu du profil */
.profile-content.container {
  display: flex;
  gap: 20px;
    /* Typographic scale */
    --fs-100: 0.875rem;  
    --fs-200: 1rem;      
    --fs-300: 1.125rem;  
    --fs-400: 1.25rem;   
    --fs-500: 1.5rem;    
    --fs-600: 1.75rem;  
    --fs-700: 2rem;      
  max-width: var(--max-width);
  margin: 24px auto 80px;
  padding: 0 20px;
}

/* Barre latérale */
.sidebar {
  position: sticky;
  top: 150px;
  width: 300px;
  flex: 0 0 300px;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
}

/* Carte de profil */
.profile-card {
  padding: 20px;
  background: var(--card-bg);
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  text-align: center;
}

.avatar {
  width: 110px;
  height: 110px;
  margin-top: 0;
  border: 4px solid #fff;
  border-radius: 50%;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
  object-fit: cover;
}

.profile-card .name {
  margin: 10px 0 4px;
  font-size: var(--fs-400);
}

.profile-card .role {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: var(--fs-300);
}

/* Boutons */
.btn {
  display: inline-block;
  padding: 8px 14px;
  background: transparent;
  color: var(--accent-ink); 
  border: 2px solid var(--accent-ink);
  border-radius: 20px;
  font-weight: 600;
  text-decoration: none;
  align-items: center;
  text-align: center;
  justify-content: center;
  display: flex;
}

.btn:hover {
  background-color: var(--accent-hover);
  color: #fff; 
  border-color: var(--accent-hover);
}

/*  focus  */
.btn:focus-visible,
.btn-logout:focus-visible,
.submenu-recipe a:focus-visible {
  outline: 3px solid #111;
  outline-offset: 3px;
}

.btn-edit {
  margin-top: 8px;
}

/* Badges */
.badges {
  margin-top: 18px;
}


.badges h3,
.uploaded-images h3 {
  margin-bottom: 8px;
  font-size: var(--fs-400);
}

.badges h3 a,
.uploaded-images h3 a {
  color: var(--accent-ink); 
  text-decoration: underline; 
}

.badges-grid,
.images-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.badges-grid img {
  width: 100%;
  height: auto;
  opacity: 0.9;
}

/* Images uploadées */
.uploaded-images {
  margin-top: 18px;
}



.images-grid .thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 60px;
  background: #f4f4f4;
  border: 1px dashed #e6e6e6;
  border-radius: 6px;
  overflow: hidden;
}

.images-grid .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Contenu principal */
.main {
  flex: 1;
  margin: 3rem 1.2rem 6rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.section-header h2 {
  margin: 0;
}

.see-more {
  color: var(--muted);
  font-size: var(--fs-200);
  text-decoration: underline;
}

/* Conteneur de cartes */
.cards-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cards-wrapper .see-more {
  color: var(--muted);
  font-size: 1rem;
  text-align: center;
  text-decoration: underline;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
  margin-bottom: 26px;
  text-align: center;
  justify-content: center;
  align-items: center;
}

/* Cartes */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
  overflow: visible;
  width: 100%;
}

/* .card-recipe {
  width: 350px;
} */

.card-media {
  height: 140px;
  background-size: cover;
  background-position: center;
}

.card-body {
  padding: 12px;
}

.card-body h3 {
  margin: 0 0 8px;
  font-size: var(--fs-400);
  text-align: left;

  white-space: nowrap;       
  overflow: hidden;          
  text-overflow: ellipsis;  
}

.card-meta {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
}

.card-meta.single-btn {
  justify-content: flex-end;
}

.card-options {
  padding: 4px 8px;
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 1.225rem;
  cursor: pointer;
}

.likes {
  font-weight: 600;
}

/* Bouton like */
.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: transparent;
  color: var(--muted);
  border: 0;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
}

.like-btn .heart {
  font-size: 1.05rem;
  line-height: 1;
}

.like-btn.liked .heart {
  color: #e63946;
}

.like-btn:focus {
  outline: 2px solid rgba(0, 0, 0, 0.08);
  outline-offset: 2px;
}

.section-title {
  margin: 18px 0 8px;
  font-size: var(--fs-400);
  font-weight: 700;
}

/* Page du profil */
.profile-page {
  min-height: 80vh;
  background: var(--bg-soft);
}

/* Bannière image */
.banner {
  width: 100%;
  height: auto;
  max-height: 300px;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--color-fresh);
  object-fit: cover;
}

/* Sous-menu recette */
.submenu-recipe {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 999;
  display: none;
  flex-direction: column;
  min-width: 140px;
  padding: 8px 0;
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
  text-align: left;
}

.submenu-recipe a {
  display: block;
  padding: 6px 16px;
  color: #333;
  text-decoration: none;
}

.submenu-recipe.active {
  display: flex;
}

/* ===================== RESPONSIVE ===================== */

/* Tablettes et petits écrans */
@media (max-width: 1024px) {
  .profile-content.container {
    flex-direction: column;
    max-width: 760px;
    margin: 24px auto 60px;
    padding: 0 60px;
  }

  .sidebar {
    position: static;
    width: 100%;
    flex-basis: auto;
    max-height: none;
  }

  .cards-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .profile-banner {
    height: 280px !important;
  }

  .avatar {
    width: 100px;
    height: 100px;
  }
}

/* Petits écrans et téléphones */
@media (max-width: 768px) {
  .profile-banner {
    height: 240px !important;
  }

  .cards-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    justify-content: center;
    align-items: center;
    /* margin: 0 auto; */
  }

  .cards-grid .card-recipe {
    width: 100%;
  }

  .profile-card {
    padding: 16px;
  }

  .avatar {
    width: 84px;
    height: 84px;
  }

  .card-media {
    height: 120px;
  }

  .profile-content.container {
    margin: 16px auto 40px;
  }
}

/* Ultra petits écrans (téléphones) */
@media (max-width: 480px) {
  .profile-banner {
    height: 250px !important;
    margin-top: var(--nav-height) !important;
  }

  .profile-banner .banner-actions {
    top: 80px;
    right: 12px;
  }

  .profile-card.mobile-hidden {
    display: none !important;
  }

  .cards-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .card {
    max-width: 100%;
  }

  .card-body h3 {
    font-size: 1rem;
  }

  .see-more {
    font-size: 0.9rem;
  }

  .main {
    margin: 1rem 0 3rem;
  }
}
