/* Styles pour single.php des avis de transparence */

.avis {
  margin-top: -2vw;
  margin-inline: -4vw;

  .avis-section {
    background: #7eb43c;
    color: #fff;
    padding: 2vw;

    h2 {
      color: #fff;
      padding-bottom: 1rem;
      border-bottom: 1px dashed rgba(255, 255, 255, 0.5);
    }

    .avis-label {
      color: #1d2327;
    }
  }

  .avis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
  }

  .avis-block {
    padding-block: 1rem;
  }

  .avis-field {
    padding-bottom: 0.75rem;

    a {
      color: #fff !important;
      font-weight: 500 !important;
    }
  }

  .avis-label {
    font-size: 0.875rem;
    opacity: 0.8;
    font-weight: 500;
    margin-bottom: 5px;
    letter-spacing: 1px;
  }

  .avis-value {
    font-size: 1rem;
    font-weight: 500;
  }

  .avis-opacity-75 {
    opacity: 0.75;
  }
  .avis-italic {
    font-style: italic;
  }

  /* Gallery */
  .avis-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
  }

  .avis-media-item {
    position: relative;
    cursor: pointer;
    max-width: 240px;

    .avis-lightbox {
      display: block;
      border-radius: 8px;
      transition: transform 0.3s ease;
    }

    &:hover .avis-lightbox {
      transform: scale(1.05);
    }

    &::after {
      content: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="white" d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C8.01 14 6 11.99 6 9.5S8.01 5 10.5 5 15 7.01 15 9.5 12.99 14 10.5 14z"/></svg>');
      position: absolute;
      top: 8px;
      right: 8px;
      opacity: 0;
      transition:
        opacity 0.3s ease,
        transform 0.3s ease;
      pointer-events: none;
    }

    &:hover::after {
      opacity: 1;
      transform: scale(1.2);
    }
  }

  .avis-caption {
    font-size: 0.85em;
    margin-top: 6px;
    line-height: 1.3;
  }
  .avis-copyright {
    font-style: italic;
  }
  .avis-video {
    width: 250px;
    height: 140px;
    background: #313131;
    border-radius: 8px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;

    svg > * {
      fill: #fff;
    }
  }

  .avis-btn-contact {
    display: block;
    width: max-content;
    padding: 0.5rem 0.75rem;
    background: #1d2327;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.15s ease;

    &:hover {
      color: #fff;
      background: #000;
    }
  }

  .avis-btn-group {
    display: flex;
    align-items: center;

    > * {
      line-height: 1.7em;
    }
  }

  /* section change (even) */
  .avis-section:nth-child(even) {
    background: #fff;
    color: #313131;

    h2 {
      color: #313131;
      border-bottom-color: rgba(49, 49, 49, 0.5);
    }

    .avis-label,
    p.avis-label {
      color: #7eb43c;
      padding-bottom: 0;
    }

    .avis-video {
      background: #7eb43c;
    }
  }

  /* form style */
  .avis-filters-form {
    margin-bottom: 1.25rem;
  }

  .avis-filters-label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
  }

  .avis-filters-input,
  .avis-filters-select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
  }

  .avis-filters-btn,
  .avis-filters-btn-reset {
    display: block;
    width: max-content;
    padding: 0.5rem 0.75rem;
    background: #1d2327;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.15s ease;

    &:hover {
      background: #7eb43c;
    }
  }

  .avis-filters-btn-reset {
    display: block;
    margin-left: 10px;
    background: #f0f0f0;
    color: #333 !important;

    &:hover {
      background: #d9d9d9;
    }
  }

  .avis-post-found {
    color: #666;
    margin-bottom: 20px;
  }

  /* card style */

  .avis-grid-card {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem 1rem;
    justify-content: stretch;
    align-content: space-evenly;
    align-items: stretch;
  }

  .avis-card {
    background: #7eb43c;
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 13px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    overflow: hidden;

    transition:
      transform 0.2s ease,
      box-shadow 0.2s ease;

    &:hover {
      transform: translateY(-6px);
      box-shadow: 0 5px 15px rgba(0, 0, 0, 0.12);
    }
  }

  .avis-card-link {
    text-decoration: none;
    display: flex;
    flex-direction: column;
  }

  .avis-card-thumb {
    position: relative;
    aspect-ratio: 3/2;
    overflow: hidden;
    background: #f4f4f4;

    img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      display: block;
      transition: transform 0.4s ease;
    }
  }

  .avis-card-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1rem;
  }

  .avis-card-title {
    color: #fff !important;
    font-size: 1.5rem;
    line-height: 1.2em;
  }

  .avis-card-meta {
    color: #fff;
    font-size: 0.725rem;
    line-height: 1.4;
    opacity: 0.8;
    font-weight: 500;
    margin-bottom: 1rem;
    letter-spacing: 1px;

    > span {
      display: block;

      strong {
        color: #1d2327;
      }
    }
  }

  .avis-card-summary {
    color: #fff;
    font-size: 0.875rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
  }

  .avis-card-btn {
    display: block;
    width: max-content;
    padding: 0.25rem 1rem;
    background: #1d2327;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
  }

  /* section change (even) */
  .avis-card:nth-child(even) {
    background: #fff;
    color: #1d2327;

    .avis-card-title {
      color: #1d2327 !important;
      border-bottom-color: rgba(49, 49, 49, 0.5);
    }

    .avis-card-meta {
      color: #7eb43c;

      > span {
        strong {
          color: #1d2327;
        }
      }
    }
    .avis-card-summary {
      color: #1d2327;
    }

    .avis-card-btn {
      background: #7eb43c;
    }
  }

  /* Message error */
  .avis-error {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
  }

  .avis-error-text {
    font-size: 18px;
    margin: 0;
  }

  a.avis-error-link {
    margin-top: 10px;
    font-weight: 600;
    color: #1d2327 !important;
  }

  @media (min-width: 480px) {
    .avis-card-content {
      padding: 2rem;
    }
  }
  /* Pagination style */

  .avis-pagination {
    .page-numbers {
      display: flex;
      align-content: center;
      justify-content: center;

      li {
        list-style: none;
        cursor: pointer;
        transition: background 0.15s ease;

        span.current,
        &:hover a {
          background: #7eb43c;
          color: #fff !important;
        }

        a,
        span {
          min-width: 28px;
          height: 28px;
          padding: 4px;
          border-radius: 0.5rem;
          background: #cecece;
          text-align: center;
          line-height: 20px;
          margin: 0 5px;
          color: #313131 !important;
          text-decoration: none;
        }
      }
    }
  }

  .avis-section-back {
    padding: 1vw 2vw;
    text-align: center;
  }

  .avis-btn-back {
    display: inline-block;
    width: max-content;
    padding: 0.5rem 0.75rem;
    background: #f0f0f0;
    color: #333 !important;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.15s ease;
    margin-left: 2vw;

    &:hover {
      background: #d9d9d9;
    }
  }

  /* MEDIA QUERIES*/

  @media (min-width: 768px) {
    .avis-grid-card {
      grid-template-columns: repeat(auto-fit, minmax(768px, 1fr));
      gap: 2rem 2rem;
    }

    .avis-card-link {
      flex-direction: row;
    }

    .avis-card-thumb {
      width: 40%;
    }
  }
}
