/* ================================
   German Retrofit Portfolio
================================ */

.grp-portfolio-grid-section {
  width: 100%;
  padding: 0 0 70px;
  margin-top: -55px;
  background: transparent;
}

.grp-portfolio-container {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}


/* ================================
   Recherche portfolio AJAX
================================ */

.grp-portfolio-search-wrap {
  margin: 0 0 34px;
}

.grp-portfolio-search-box {
  position: relative;
  max-width: 620px;
  margin: 0 auto;
}

.grp-portfolio-search-box input {
  width: 100%;
  height: 62px;
  padding: 0 60px 0 24px;
  border: 1px solid rgba(33, 61, 123, 0.14);
  border-radius: 999px;
  background: #ffffff;
  color: #213D7B;
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  font-weight: 700;
  outline: none;
  box-shadow: 0 18px 45px rgba(33, 61, 123, 0.10);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.grp-portfolio-search-box input:focus {
  border-color: #007aff;
  box-shadow: 0 22px 55px rgba(0, 122, 255, 0.18);
}

.grp-portfolio-search-box input::placeholder {
  color: rgba(33, 61, 123, 0.55);
}

.grp-search-icon {
  position: absolute;
  right: 26px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border: 3px solid #007aff;
  border-radius: 50%;
  z-index: 2;
  font-size: 0;
  pointer-events: none;
}

.grp-search-icon::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 3px;
  background: #007aff;
  right: -7px;
  bottom: -4px;
  transform: rotate(45deg);
  border-radius: 10px;
}

.grp-portfolio-search-status {
  min-height: 24px;
  margin-top: 14px;
  text-align: center;
  color: #213D7B;
  font-size: 14px;
  font-weight: 700;
}

.grp-portfolio-search-status.is-loading {
  color: #007aff;
}

.grp-portfolio-search-status.is-error {
  color: #c62828;
}

.grp-no-results {
  grid-column: 1 / -1;
  padding: 34px 24px;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid rgba(33, 61, 123, 0.10);
  color: #213D7B;
  font-size: 18px;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 18px 45px rgba(33, 61, 123, 0.08);
}

@media (max-width: 767px) {
  .grp-portfolio-search-wrap {
    margin-bottom: 26px;
  }

  .grp-portfolio-search-box input {
    height: 56px;
    padding: 0 54px 0 18px;
    font-size: 14px;
  }

  .grp-search-icon {
    left: auto !important;
    right: 22px !important;
    width: 16px;
    height: 16px;
  }
}

.grp-portfolio-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 34px;
}

.grp-portfolio-card {
  background: #ffffff;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(33, 61, 123, 0.10);
  box-shadow: 0 18px 48px rgba(33, 61, 123, 0.10);
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.grp-portfolio-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 28px 70px rgba(33, 61, 123, 0.16);
}

.grp-portfolio-image-wrap {
  display: block;
  width: 100%;
  height: 340px;
  overflow: hidden;
  background: #eef3fb;
}

.grp-portfolio-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.grp-portfolio-card:hover .grp-portfolio-image-wrap img {
  transform: scale(1.05);
}

.grp-portfolio-card-content {
  padding: 22px 24px;
}

.grp-portfolio-card-content h3 {
  margin: 0;
  font-size: 22px;
  line-height: 1.3;
  font-weight: 800;
  color: #213D7B;
}

.grp-portfolio-card-content h3 a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: inherit;
  text-decoration: none;
}

.grp-portfolio-card-content h3 strong {
  width: 38px;
  height: 38px;
  min-width: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #007aff;
  color: #ffffff;
  border-radius: 50%;
  font-size: 20px;
  transition: transform 0.25s ease, background 0.25s ease;
}

.grp-portfolio-card:hover .grp-portfolio-card-content h3 strong {
  background: #213D7B;
  transform: translateX(4px);
}

/* ================================
   Single réalisation
================================ */

.grp-single-page {
  background: #ffffff;
}

.grp-single-wrapper {
  padding: 0 0 70px;
  margin-top: -55px;
}

.grp-single-container {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
}

.grp-single-content {
  margin-bottom: 25px;
  color: #333333;
  font-size: 16px;
  line-height: 1.8;
}

.grp-single-content p {
  margin-bottom: 16px;
}

.grp-single-content ul {
  margin: 0 0 22px 20px;
  padding: 0;
}

.grp-single-content li {
  margin-bottom: 8px;
}

.grp-simple-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 25px;
}

.grp-simple-gallery-item {
  display: block;
  overflow: hidden;
  background: #f4f6fb;
  border: 1px solid rgba(33, 61, 123, 0.12);
  border-radius: 10px;
  box-shadow: 0 18px 45px rgba(33, 61, 123, 0.12);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.grp-simple-gallery-item:hover {
  box-shadow: 0 24px 65px rgba(0, 122, 255, 0.20);
  transform: translateY(-3px);
}

.grp-simple-gallery-item img {
  display: block;
  width: 100%;
  height: 330px;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.grp-simple-gallery-item:hover img {
  transform: scale(1.04);
}

.grp-back-wrapper {
  margin-top: 42px;
  text-align: center;
}

.grp-back-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 26px;
  background: #007aff;
  color: #ffffff;
  text-decoration: none;
  font-weight: 800;
  border-radius: 8px;
  transition: background 0.25s ease, transform 0.25s ease;
}

.grp-back-button:hover {
  background: #213D7B;
  color: #ffffff;
  transform: translateY(-2px);
}

/* Supprimer espace sous le titre page détail */
.single-gr_reference .grp-single-wrapper {
  padding-top: 0 !important;
  margin-top: -90px !important;
}

.single-gr_reference .grp-single-content > .elementor {
  margin-top: 0 !important;
}

.single-gr_reference .grp-single-content .elementor-section:first-child,
.single-gr_reference .grp-single-content .elementor-widget-wrap:first-child {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* ================================
   Pagination moderne
================================ */

.grp-pagination {
  margin-top: 55px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  text-align: center;
}

.grp-pagination .nav-links {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.grp-pagination .page-numbers {
  width: 52px;
  height: 52px;
  min-width: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: #ffffff;
  color: #213D7B;
  border: 1px solid rgba(33, 61, 123, 0.12);
  box-shadow: 0 10px 28px rgba(33, 61, 123, 0.08);
  font-size: 18px;
  font-weight: 800;
  text-decoration: none;
  transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

.grp-pagination .page-numbers:hover {
  background: #007aff;
  color: #ffffff !important;
  transform: translateY(-3px);
  box-shadow: 0 18px 45px rgba(0, 122, 255, 0.22);
}

.grp-pagination .page-numbers.current {
  background: linear-gradient(135deg, #007aff 0%, #213D7B 100%);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 18px 45px rgba(0, 122, 255, 0.25);
}

.grp-pagination .prev,
.grp-pagination .next {
  font-size: 24px;
  font-weight: 800;
}


/* ================================
   Home portfolio carousel
================================ */

.grp-home-portfolio {
  position: relative;
  width: 100%;
  padding: 10px 0 20px;
  font-family: 'Montserrat', sans-serif;
}

.grp-home-slider {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 10px 2px 24px;
}

.grp-home-slider::-webkit-scrollbar {
  display: none;
}

.grp-home-slide {
  flex: 0 0 calc(33.333% - 16px);
}

.grp-home-card {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 18px 45px rgba(33, 61, 123, 0.12);
  text-decoration: none;
}

.grp-home-card img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: initial;
  transition: transform 0.55s ease;
}

.grp-home-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
  background: linear-gradient(
    180deg,
    rgba(6, 16, 38, 0.02) 0%,
    rgba(6, 16, 38, 0.25) 45%,
    rgba(6, 16, 38, 0.88) 100%
  );
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.grp-home-overlay h3 {
  margin: 0 0 10px;
  color: #ffffff;
  font-size: 21px;
  line-height: 1.25;
  font-weight: 800;
}

.grp-home-overlay span {
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
}

.grp-home-card:hover img {
  transform: scale(1.04);
}

.grp-home-card:hover .grp-home-overlay {
  opacity: 1;
  transform: translateY(0);
}

.grp-home-arrows {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
}

.grp-home-prev,
.grp-home-next {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: #213D7B;
  color: #ffffff;
  font-size: 22px;
  cursor: pointer;
  transition: background 0.25s ease, transform 0.25s ease;
}

.grp-home-prev:hover,
.grp-home-next:hover {
  background: #007aff;
  color: #ffffff;
  transform: translateY(-3px);
}

@media (max-width: 900px) {
  .grp-home-slide {
    flex-basis: calc(50% - 12px);
  }

  .grp-home-overlay {
    opacity: 1;
    transform: none;
  }
}

@media (max-width: 640px) {

  .grp-home-slider {
    gap: 16px;
  }

  .grp-home-slide {
    flex: 0 0 100%;
  }

  .grp-home-overlay {
    opacity: 1;
    transform: none;
    padding: 20px;
  }

  .grp-home-overlay h3 {
    font-size: 19px;
  }

}


@media (max-width: 640px) {
  .grp-home-slider {
    gap: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    scroll-snap-type: x mandatory;
  }

  .grp-home-slide {
    flex: 0 0 100% !important;
    min-width: 100% !important;
    scroll-snap-align: start;
    padding: 0 8px;
    box-sizing: border-box;
  }

  .grp-home-card {
    width: 100%;
  }
}


/* Header slider accueil */
.grp-home-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.grp-home-header span {
  display: inline-block;
  margin-bottom: 8px;
  color: #007aff;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.grp-home-header h2 {
  margin: 0;
  color: #213D7B;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.1;
  font-weight: 800;
}

.grp-home-all-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 18px;
  border-radius: 999px;
  background: #213D7B;
  color: #ffffff;
  text-decoration: none;
  font-weight: 800;
  white-space: nowrap;
}

.grp-home-all-link strong {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #007aff;
  border-radius: 50%;
  color: #ffffff;
}

.grp-home-all-link:hover {
  background: #007aff;
  color: #ffffff;
}

/* Flèches même format partout */
.grp-home-prev,
.grp-home-next {
  width: 56px !important;
  height: 56px !important;
  min-width: 56px !important;
  border-radius: 50% !important;
  background: #213D7B !important;
  color: #ffffff !important;
  font-size: 24px !important;
  line-height: 1 !important;
}

.grp-home-prev:hover,
.grp-home-next:hover {
  background: #007aff !important;
  color: #ffffff !important;
}

/* Mobile */
@media (max-width: 640px) {
  .grp-home-header {
    align-items: flex-start;
    flex-direction: column;
    margin-bottom: 20px;
  }

  .grp-home-all-link {
    width: 100%;
    justify-content: center;
  }

  .grp-home-prev,
  .grp-home-next {
    width: 56px !important;
    height: 56px !important;
  }
}


@media (max-width: 767px) {
  .grp-portfolio-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  .grp-portfolio-card {
    width: 100% !important;
  }

  .grp-portfolio-image-wrap {
    height: auto !important;
  }

  .grp-portfolio-image-wrap img {
    display: block;
    width: 100% !important;
    height: auto !important;
    object-fit: initial !important;
  }

  .grp-portfolio-card-content h3 a {
    align-items: center;
  }
}


@media (max-width: 767px) {

  .grp-simple-gallery {
    grid-template-columns: 1fr !important;
    gap: 18px !important;
  }

  .grp-simple-gallery-item {
    width: 100%;
  }

  .grp-simple-gallery-item img {
    width: 100%;
    height: auto !important;
    object-fit: contain !important;
    display: block;
  }

}


/* ================================
   Lightbox Galerie - Correction flèches
================================ */

#grpLightbox {
  position: fixed !important;
  inset: 0 !important;
  z-index: 999999 !important;
  display: none !important;
  align-items: center !important;
  justify-content: center !important;
  background: rgba(3, 10, 25, 0.92) !important;
}

#grpLightbox.is-open {
  display: flex !important;
}

body.grp-lightbox-active {
  overflow: hidden !important;
}

#grpLightbox img {
  max-width: 90vw !important;
  max-height: 86vh !important;
  object-fit: contain !important;
  border-radius: 12px;
}

.grp-lightbox-prev,
.grp-lightbox-next {
  position: fixed !important;
  top: 50% !important;
  bottom: auto !important;
  transform: translateY(-50%) !important;
  z-index: 1000000 !important;

  width: 56px !important;
  height: 56px !important;
  border: 0 !important;
  border-radius: 50% !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  background: #213D7B !important;
  color: #ffffff !important;
  font-size: 30px !important;
  line-height: 1 !important;
  cursor: pointer !important;
}

.grp-lightbox-prev {
  left: 30px !important;
}

.grp-lightbox-next {
  right: 30px !important;
}

.grp-lightbox-close {
  position: fixed !important;
  top: 24px !important;
  right: 24px !important;
  z-index: 1000001 !important;
}

@media (max-width: 767px) {
  .grp-lightbox-prev,
  .grp-lightbox-next {
    width: 46px !important;
    height: 46px !important;
    font-size: 26px !important;
  }

  .grp-lightbox-prev {
    left: 12px !important;
  }

  .grp-lightbox-next {
    right: 12px !important;
  }

  #grpLightbox img {
    max-width: 92vw !important;
    max-height: 78vh !important;
  }
}


/* ================================
   Taxonomy catégorie réalisations
================================ */

.grp-taxonomy-page .grp-portfolio-grid-section {
  margin-top: -20px !important;
  padding-top: 0 !important;
}

.grp-taxonomy-page header {
  margin: 20px 0 18px !important;
  text-align: center;
}

.grp-taxonomy-page h1 {
  margin: 0 !important;
  line-height: 1.1;
  color: #213D7B;
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 800;
}

.grp-taxonomy-page .grp-portfolio-search-wrap {
  margin-top: 18px !important;
}

.grp-taxonomy-page h1 {
  margin-bottom: 28px !important;
}