/* ==========================================================================
   DREAM CONSULT - compléments au thème Archidex (style.css)
   Composants propres au site Django : filtres projets, contenu CKEditor,
   galerie des expertises, carte, titres de section.
   ========================================================================== */

/* --- Logo ---------------------------------------------------------------- */
header[class^="header-area"] .header__logo img,
.offset-logo img {
  max-width: 170px;
  max-height: 42px;
  width: auto;
}

/* --- Titre de section (accueil) ----------------------------------------- */
.dream-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding-bottom: 40px;
  margin-bottom: 50px;
  border-bottom: 1px solid var(--border);
}

.dream-section-head .title {
  font-size: clamp(40px, 6vw, 90px);
  line-height: 1;
  text-transform: uppercase;
  margin: 0;
}

.dream-empty {
  padding: 60px 0;
  font-size: 18px;
}

/* --- Filtres projets ----------------------------------------------------- */
.dream-filters {
  margin-bottom: 60px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--border);
}

.dream-filters__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.dream-filters__search {
  flex: 1 1 260px;
  height: 50px;
  padding: 0 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--primary);
  outline: none;
}

.dream-filters__search:focus {
  border-color: var(--primary);
}

.dream-filters .nice-select {
  height: 50px;
  line-height: 48px;
  min-width: 150px;
  border-radius: 0;
  border: 1px solid var(--border);
  float: none;
}

.dream-filters .nice-select .list {
  max-height: 300px;
  overflow-y: auto;
  border-radius: 0;
}

.dream-filters__sort {
  display: flex;
  gap: 6px;
  margin-left: auto;
}

.dream-filters__sort .sort-option {
  height: 50px;
  padding: 0 18px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--secondary);
  transition: all .3s ease;
}

.dream-filters__sort .sort-option.active,
.dream-filters__sort .sort-option:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

#projects-zone {
  transition: opacity .2s ease;
}

#projects-zone.is-loading {
  opacity: .35;
  pointer-events: none;
}

.projects__item .projects__media img {
  width: 100%;
  object-fit: cover;
}

/* --- Contenu riche (CKEditor) ------------------------------------------ */
.dream-richtext p,
.dream-richtext li {
  font-size: 18px;
  line-height: 1.6;
  color: var(--secondary);
}

.dream-richtext p {
  margin-bottom: 20px;
}

.dream-richtext h2,
.dream-richtext h3,
.dream-richtext h4 {
  margin: 30px 0 15px;
}

.dream-richtext ul,
.dream-richtext ol {
  padding-left: 20px;
  margin-bottom: 20px;
}

.dream-richtext ul {
  list-style: disc;
}

.dream-richtext ol {
  list-style: decimal;
}

.dream-richtext img {
  max-width: 100%;
  height: auto;
}

.dream-richtext a {
  text-decoration: underline;
}

/* --- Page détail expertise ---------------------------------------------- */
.dream-breadcrumb-title {
  font-size: clamp(48px, 9vw, 160px) !important;
  line-height: 1 !important;
}

.hero-area-service-details .feature-list a {
  color: inherit;
}

.dream-service-gallery__row {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 60px;
  align-items: center;
  margin-bottom: 80px;
}

.dream-service-gallery__row.is-reversed .dream-service-gallery__media {
  order: 2;
}

.dream-service-gallery__media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.dream-service-gallery__content .number {
  display: block;
  margin-bottom: 15px;
  color: var(--secondary);
}

.dream-service-gallery__content .title {
  font-size: 32px;
  margin-bottom: 15px;
}

@media (max-width: 991px) {
  .dream-service-gallery__row {
    grid-template-columns: 1fr;
    gap: 25px;
    margin-bottom: 50px;
  }

  .dream-service-gallery__row.is-reversed .dream-service-gallery__media {
    order: 0;
  }
}

/* --- Liste non cliquable (profil) --------------------------------------- */
.dream-plain-list a {
  cursor: default;
}

/* --- Page détail projet -------------------------------------------------- */
.portfolio-gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dream-socials {
  display: flex;
  gap: 12px;
  margin-top: 30px;
}

.dream-socials a {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  color: var(--primary);
  transition: all .3s ease;
}

.dream-socials a:hover {
  background: var(--primary);
  color: var(--white);
}

.dream-project-video video {
  width: 100%;
  display: block;
  margin-bottom: 80px;
}

.dream-map iframe {
  width: 100%;
  height: 450px;
  border: 0;
  filter: grayscale(1);
  margin-bottom: 60px;
}

.dream-back {
  padding-bottom: 100px;
}

/* --- Hero accueil avec vidéo en fond ----------------------------------- */
.hero-2--video {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.hero-2__video {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: #111;
}

.hero-2__video video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* voile sombre pour la lisibilité du texte */
.hero-2__video::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(17, 17, 17, .55) 0%, rgba(17, 17, 17, .35) 45%, rgba(17, 17, 17, .75) 100%);
}

.hero-2--video .hero-2__inner::before,
.hero-2--video .hero-2__inner::after,
.hero-2--video .hero-2__inner .line::before,
.hero-2--video .hero-2__inner .line::after,
.hero-2--video .hero-2__inner .line span::before {
  background: rgba(255, 255, 255, .12);
}

.hero-2--video .hero-2-content .title,
.hero-2--video .hero-2-showcase__box p,
.hero-2--video .hero-2-showcase__box .title {
  color: var(--white);
}

.hero-2--video .hero-2-content .sub-title {
  color: var(--white);
  border-color: rgba(255, 255, 255, .35);
}

.hero-2--video .hero-2-showcase__box .title span {
  color: rgba(255, 255, 255, .6);
}

.hero-2--video .rr-btn-primary.btn-black {
  background: var(--white);
  color: var(--primary);
}

.hero-2--video .rr-btn-primary.btn-black .text,
.hero-2--video .rr-btn-primary.btn-black .text span,
.hero-2--video .rr-btn-primary.btn-black i {
  color: var(--primary);
}

/* header de l'accueil : fond blanc pour garder le logo lisible au-dessus de la vidéo */
.header-area-2 .header-main {
  background: var(--white);
}

/* ==========================================================================
   Méga-menu « révélation d'image » (desktop >= 1200px)
   ========================================================================== */
@media (min-width: 1200px) {
  .header__nav-2 li[data-mega] > .dp-menu {
    display: none !important;
  }
}

.header__nav-2 li[data-mega] > a {
  position: relative;
}

.header__nav-2 li[data-mega] > a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0;
  transform: translate(-50%, 4px);
  transition: opacity .3s ease, transform .3s ease;
}

.header__nav-2 li.is-mega-active > a::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.mega-menu {
  position: fixed;
  top: var(--mega-top, 80px);
  left: 0;
  right: 0;
  z-index: 98;
  background: var(--white);
  border-top: 1px solid var(--border);
  visibility: hidden;
  clip-path: inset(0 0 100% 0);
  transition: clip-path .7s cubic-bezier(.77, 0, .175, 1), visibility 0s linear .7s;
}

.mega-menu.is-open {
  visibility: visible;
  clip-path: inset(0 0 0 0);
  transition: clip-path .7s cubic-bezier(.77, 0, .175, 1), visibility 0s;
}

.mega-menu__inner {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 80px;
  height: min(72vh, 640px);
  padding: 50px 0 60px;
}

/* --- liste ---------------------------------------------------------------- */
.mega-menu__list {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
}

.mega-menu__list::-webkit-scrollbar {
  display: none;
}

.mega-menu__eyebrow {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--secondary);
  margin-bottom: 24px;
}

.mega-menu__eyebrow sup {
  font-size: 11px;
}

.mega-menu__item {
  display: grid;
  grid-template-columns: 48px 1fr auto 28px;
  align-items: baseline;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  color: var(--primary);
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .5s ease, transform .6s cubic-bezier(.215, .61, .355, 1);
}

.mega-menu.is-open .mega-menu__item {
  opacity: 1;
  transform: none;
  transition-delay: calc(var(--i, 0) * 60ms + 250ms);
}

.mega-menu__num {
  font-size: 13px;
  color: var(--secondary);
}

.mega-menu__label {
  font-size: clamp(30px, 3.1vw, 58px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -.04em;
  text-transform: uppercase;
  color: rgba(17, 17, 17, .22);
  transition: color .35s ease, transform .45s cubic-bezier(.215, .61, .355, 1);
}

.mega-menu__meta {
  font-size: 13px;
  color: var(--secondary);
  opacity: 0;
  transition: opacity .3s ease;
}

.mega-menu__arrow {
  font-size: 20px;
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity .3s ease, transform .4s ease;
}

.mega-menu__item.is-active .mega-menu__label {
  color: var(--primary);
  transform: translateX(14px);
}

.mega-menu__item.is-active .mega-menu__meta,
.mega-menu__item.is-active .mega-menu__arrow {
  opacity: 1;
  transform: none;
}

/* --- image ---------------------------------------------------------------- */
.mega-menu__media {
  position: relative;
  overflow: hidden;
  background: #f2f2f2;
  clip-path: inset(100% 0 0 0);
  transition: clip-path .9s cubic-bezier(.77, 0, .175, 1) .15s;
}

.mega-menu.is-open .mega-menu__media {
  clip-path: inset(0 0 0 0);
}

.mega-menu__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.08);
  transition: opacity .6s ease, transform 1.4s cubic-bezier(.215, .61, .355, 1);
}

.mega-menu__img.is-current {
  opacity: 1;
  transform: scale(1);
}

.mega-menu__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 60px 28px 22px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--white);
  background: linear-gradient(0deg, rgba(17, 17, 17, .6), transparent);
}

/* --- voile sur la page ---------------------------------------------------- */
.mega-menu-overlay {
  position: fixed;
  top: var(--mega-top, 80px);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 97;
  background: rgba(17, 17, 17, .45);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .5s ease, visibility 0s linear .5s;
}

.mega-menu-overlay.is-visible {
  opacity: 1;
  visibility: visible;
  transition: opacity .5s ease, visibility 0s;
}

@media (max-width: 1199px) {
  .mega-menu,
  .mega-menu-overlay {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mega-menu,
  .mega-menu__media,
  .mega-menu__item,
  .mega-menu__img {
    transition: none !important;
  }
}
