/*
Theme Name: MS Interieurs
Theme URI: https://ajcrea.com/
Description: Theme enfant de Fotografie Blocks pour les personnalisations MS Interieurs.
Author: Aymeric JAcquet
Version: 1.0.0
Template: fotografie-blocks
Text Domain: ms-interieurs
*/

/* Projets category visual redesign (category archive only) */
.archive.category-projets .wp-block-post-template {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(0.25rem, 0.7vw, 0.5rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.archive.category-projets .wp-block-post-template > li {
  position: relative;
  grid-column: span 12;
  overflow: hidden;
  background: #0f0f0f;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22);
  transform: translateY(0);
  transition:
    transform 0.45s ease,
    box-shadow 0.45s ease;
}

.archive.category-projets
  .wp-block-post-template
  .wp-block-post-featured-image {
  margin: 0;
  aspect-ratio: 16 / 10;
}

.archive.category-projets
  .wp-block-post-template
  .wp-block-post-featured-image
  img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.001);
  transition: transform 0.9s ease;
}

.archive.category-projets .wp-block-post-title {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  top: auto;
  bottom: 0;
  margin: 0 !important;
  padding: 0 clamp(1rem, 1.4vw, 1.3rem) clamp(0.85rem, 1.2vw, 1.15rem);
  width: 100%;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.9) 0%,
    rgba(0, 0, 0, 0.7) 40%,
    rgba(0, 0, 0, 0) 100%
  );
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.archive.category-projets .wp-block-post-title a {
  color: #ffffff !important;
  text-decoration: none;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.archive.category-projets .wp-block-post-title h1,
.archive.category-projets .wp-block-post-title h2 {
  margin: 0;
}

.archive.category-projets .wp-block-post-template > li:hover,
.archive.category-projets .wp-block-post-template > li:focus-within {
  transform: translateY(-6px);
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.28);
}

.archive.category-projets .wp-block-post-template > li:hover img,
.archive.category-projets .wp-block-post-template > li:focus-within img {
  transform: scale(1.08);
}

@media (max-width: 900px) {
  .archive.category-projets .wp-block-post-template > li,
  .archive.category-projets .wp-block-post-template > li:first-child {
    grid-column: span 12;
  }

  .archive.category-projets
    .wp-block-post-template
    .wp-block-post-featured-image {
    aspect-ratio: 16 / 11;
  }
}

@media (prefers-reduced-motion: reduce) {
  .archive.category-projets .wp-block-post-template > li,
  .archive.category-projets
    .wp-block-post-template
    .wp-block-post-featured-image
    img {
    transition: none;
  }
}

/* Home: slider léger des 5 derniers projets */
.home .wp-block-query.ms-home-projects-slider {
  margin: 0 !important;
  width: 100% !important;
  max-width: none !important;
}

.home .wp-block-recent-blog-posts > .wp-block-group-content {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.home
  .wp-block-query.ms-home-projects-slider.is-layout-constrained
  > .ms-home-projects-shell,
.home
  .wp-block-query.ms-home-projects-slider.is-layout-constrained
  > .ms-home-projects-viewport,
.home .wp-block-query.ms-home-projects-slider > .alignfull {
  max-width: none !important;
  width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.home .ms-home-projects-shell {
  position: relative;
  margin: 0 !important;
  width: 100% !important;
  max-width: none !important;
}

.home .ms-home-projects-viewport {
  margin: 0 !important;
  width: 100% !important;
  max-width: none !important;
  overflow: hidden;
  position: relative;
}

.home .ms-home-projects-track {
  display: flex;
  flex-wrap: nowrap;
  width: 100%;
  max-width: none;
  transition: transform 0.45s ease;
  will-change: transform;
}

.home .ms-home-project-slide {
  flex: 0 0 100%;
  min-width: 100%;
  max-width: 100%;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.home .ms-home-project-link {
  position: relative;
  display: block;
  width: 100%;
  text-decoration: none;
  color: #ffffff;
}

.home .ms-home-project-image {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.home .ms-home-project-title {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 0.9rem 1.1rem;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.9) 0%,
    rgba(0, 0, 0, 0.55) 45%,
    rgba(0, 0, 0, 0) 100%
  );
  text-transform: uppercase;
}

.home .ms-home-project-title span {
  color: #ffffff !important;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.home .ms-home-projects-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: rgba(15, 15, 15, 0.8);
  color: #fff;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.home .ms-home-projects-prev {
  left: 1rem;
}

.home .ms-home-projects-next {
  right: 1rem;
}

.home .ms-home-projects-nav:hover {
  background: rgba(15, 15, 15, 1);
}

.home .ms-home-projects-nav:disabled {
  opacity: 0.35;
  cursor: default;
}

@media (max-width: 900px) {
  .home .ms-home-projects-nav {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .home .ms-home-projects-prev {
    left: 0.5rem;
  }

  .home .ms-home-projects-next {
    right: 0.5rem;
  }
}

@media screen and (max-width: 37.5em) {
  .wp-block-cover.wp-block-hero-content {
    overflow: hidden;
  }

  .wp-block-cover.wp-block-hero-content .wp-block-cover__image-background {
    position: absolute !important;
    inset: 0;
    width: 100% !important;
    height: 100%;
  }

  .wp-block-cover.wp-block-hero-content .wp-block-cover__inner-container {
    position: relative;
    z-index: 1;
    width: 100%;
  }

  .wp-block-cover.wp-block-hero-content
    .wp-block-cover__inner-container
    > .wp-block-group {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .wp-block-cover.wp-block-hero-content .wp-block-media-text {
    padding-left: 0 !important;
  }

  .wp-block-cover.wp-block-hero-content .wp-block-media-text__content {
    padding-left: 12% !important;
    padding-right: 12% !important;
  }
}

/* Contact form: fond champs + alignement a gauche sans body class */
.wpforms-form,
.wpforms-form * {
  text-align: left;
}

.wpforms-form
  input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not(
    [type="button"]
  ),
.wpforms-form textarea,
.wpforms-form select {
  background-color: rgba(255, 255, 255, 0.05) !important;
}

.wpforms-form .wpforms-submit {
  text-align: center !important;
  text-transform: uppercase;
  background-color: rgba(255, 255, 255, 0.05) !important;
  color: #fff !important;
  border-radius: 3px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  font-size: 1.5rem;
  font-weight: 700;
  display: block;
  cursor: pointer;
  line-height: 40px;
  width: 100%;
}

.wpforms-form .wpforms-submit:hover,
.wpforms-form .wpforms-submit:focus-visible {
  background-color: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(255, 255, 255, 0.35);
}

.wpforms-form .wpforms-submit:active {
  background-color: rgba(255, 255, 255, 0.18) !important;
  transform: translateY(1px);
}
