/* Main container for the first section */
#first_section{
  position: relative;           /* Allows absolutely positioned children */
  width: 100%;
  border: 1px solid transparent;/* Placeholder border (keeps layout stable) */
  margin-top: 50px;
}

/* ---------------------------- */
/* HERO IMAGE ON THE RIGHT SIDE */
/* ---------------------------- */

#top_image{
  width: 35%;                  
  height:80vh;                 /* Tall decorative block */
  position: absolute;
  top:-10%;                    /* Moves the image upward */
  right: 0;                    /* Sticks to the right side */
  overflow: hidden;
  display: flex;               /* Centers inner content */
  align-items: center;
  justify-content: center;
  z-index: 10;                 /* Above shapes but behind main content */
}

#int_top_image{
  width: 100%;
  height:100%;
  background-image: url('/static/images/bout/a2.webp');
  background-position: center;
  background-size: cover;
  position: relative;
  z-index: 10;
  opacity: 0.5;                /* Softened image transparency */
}

/* ---------------------------- */
/* TITLE CONTAINER              */
/* ---------------------------- */

#container_titre_item{
  text-align: center;
  width: 50%;
  margin-left: 25%;            /* Centers it with fixed width method */
}

/* ---------------------------- */
/* PRODUCT / NEWS GRID WRAPPER  */
/* ---------------------------- */

#container_news_item{
  position: relative;
  z-index: 11;                 /* Above background image */
  width: 80%;
  background-color: #a0aa86;
  display: flex;               /* Horizontal layout of items */
  height: 78vh;
  min-height: 480px;
  margin-left: 10%;
  gap:5%;                      /* Spacing between item cards */
  justify-content: center;
  align-items: center;
  margin-top: 20px;
}
.back_white{
  background-color: rgb(204, 213, 182)!important;
}

/* Card for each item */
.new_items{
  height: 80%;
  width: 27%;
  background-color: #e9e2d6;
  box-shadow: 0px 8px 20px rgba(0, 0, 0, 0.582);
  display: flex;
  align-items: center;
  flex-direction: column;
  gap:15px;
  padding: 15px;
  min-height: 380px;
}

/* ---------------------------- */
/* ITEM INNER STRUCTURE         */
/* ---------------------------- */

.item_top{
  overflow: hidden;
  position: relative;
  width: 95%;
  height: fit-content;
  text-align: center;
}

.first_div{
  position: relative;
  transition: transform 0.3s ease;  /* Intended for hover animation */
}

.under_div{
  position: absolute;
  transition: transform 0.5s ease;  /* Animated overlay text */
  transform: translateY(50%);
  width: 100%;
  text-align: center;
}

.item_picture{
  position: relative;
  background-color: #e2d8c5;
  width: 85%;
  height:60%;
  user-select: none;               /* Prevents dragging/selecting image */
  display: flex;
  justify-content: center;
  align-items: center;
}
.item_white{
  background-color: #ebeae9;
}

.bottom_item{
  height:20%;
  width: 95%;
  text-align: center;
}

/* ---------------------------- */
/* BOTTOM BUTTON + TEXT         */
/* ---------------------------- */

#btn_accroche{
  margin: auto;
  margin-top: 20px;
}

#acrroche_bottom{
  text-align: center;
  margin-top: 50px;
}

/* ---------------------------- */
/* CAROUSEL WRAPPER (MOBILE)    */
/* ---------------------------- */

.carousel-wrapper {
    position: relative;
    width:100%;
    overflow: hidden;
    height:auto;
}

.carousel-track {
    overflow: hidden;
    width: 100%;
}

/* ---------------------------- */
/* MEDIA QUERIES                */
/* ---------------------------- */

@media (max-width:1280px) and (max-height: 1024px) {
  #container_news_item{
    height:64vh;
  }
}

@media (max-width:1280px) and (max-height: 800px) {
  #container_news_item{
    height:72vh;
    width: 70%;
    margin-left: 15%;
  }
}

@media (max-width:1280px) and (max-height: 720px) {
  #container_news_item{
    height:75vh;
  }
}

/* Remove top margin on medium screens */
@media (max-width: 1152px) {
  #first_section{
    margin-top: 0;
  }
}

@media (max-width: 1152px) {
  #container_news_item{
    width: 80%;
    margin-left: 10%;
  }
}

/* Tablet adjustments */
@media (max-width: 950px) {
  #container_image{
    padding: 10px;
    width: 90%;
    margin-left: 5%;
  }
  #container_news_item{
    width: 90%;
    margin-left: 5%;
    gap:2.5%;
  }
  #container_titre_item{
    width: 70%;
    margin-left: 15%;
  }
  .new_items{
    width: 28%;
  }
}

/* Hide desktop grid and use mobile carousel */
@media (max-width: 800px) {
  .bottom_grid{
    font-size: 12px!important;
    width: 100%;
  }
  #container_news_item{
    display: none;  /* Switch to carousel */
  }
  .grid_item_picture{
    height: 60%;
  }
}

/* Mobile layout tweaks */
@media (max-width: 500px) {
  #container_titre_item{
    width: 80%;
    margin-left: 10%;
  }
  #container_news_item{
    background-color: none;
  }
  #int_top_image{
    opacity: 0.2;             /* Fades image for readability */
  }
  #top_image{
    width: 100%;
    right:-0%;
  }
  #acrroche_bottom{
    width: 90%;
    margin-left: 5%;
  }
  #btn_first{
    margin-top: 20px;
  }
  .new_items{
    box-shadow: 0px 5px 5px rgba(0, 0, 0, 0.336);
  }
  .grid_item_picture{
    height: 60%;
  }
}