/**
 * CSS principal pour les blocs TD Valmont
 * Mobile first avec breakpoint à 1000px
 */

/* Variables CSS */
:root {
    --td-color-primary: #001932;
    --td-color-secondary: #e2017a;
    --td-color-accent: #019ee0;
    --td-color-warning: #ffed00;
    --td-border-radius: 6px;
    --td-spacing-xs: 10px;
    --td-spacing-sm: 15px;
    --td-spacing-md: 20px;
    --td-spacing-lg: 25px;
    --td-spacing-xl: 50px;
    --td-spacing-xxl: 100px;
}

/* Classe de base pour tous les blocs TD */
.wp-block-td-valmont {
    margin: var(--td-spacing-md) 0;
}

/* ═══════════════════════════════════════════
   SLIDERS (produits et références)
═══════════════════════════════════════════ */

.td-product-slider,
.td-reference-slider {
    position: relative;
    overflow: hidden;
    width: 100%;
    background: #000;
    aspect-ratio: 16 / 9;
}

.td-slider__inner {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.td-slider__item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.td-slider__item--active {
    opacity: 1;
    visibility: visible;
    position: relative;
}

.td-slider__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Bouton zoom lightbox */
.td-slider__zoom {
    position: absolute;
    bottom: var(--td-spacing-sm);
    right: var(--td-spacing-sm);
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background 0.2s ease;
    z-index: 10;
}

.td-slider__zoom:hover,
.td-slider__zoom:focus {
    background: rgba(0, 0, 0, 0.9);
    outline: 2px solid #fff;
    color: #fff;
}

/* Contrôles navigation */
.td-slider__control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s ease;
}

.td-slider__control--prev {
    left: var(--td-spacing-sm);
}

.td-slider__control--next {
    right: var(--td-spacing-sm);
}

.td-slider__control:hover,
.td-slider__control:focus {
    background: rgba(0, 0, 0, 0.8);
    outline: 2px solid #fff;
}

/* ═══════════════════════════════════════════
   RESSOURCES PRODUIT
═══════════════════════════════════════════ */

.td-product-resources {
    display: flex;
    flex-direction: column;
    gap: var(--td-spacing-sm);
}

.td-product-resources__item {
    display: flex;
    align-items: center;
    gap: var(--td-spacing-sm);
    padding: var(--td-spacing-md) var(--td-spacing-lg);
    background: #f8f9fa;
    text-decoration: none;
    color: var(--td-color-primary);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border: 1px solid #e9ecef;
}

.td-product-resources__item:hover,
.td-product-resources__item:focus {
    background: var(--td-color-primary);
    color: #fff;
    outline: none;
    transform: translateY(-1px);
 
}

.td-product-resources__label {
    flex: 1;
}

.td-product-resources__ext {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 2px 6px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.td-product-resources__item:hover .td-product-resources__ext {
    background: rgba(255, 255, 255, 0.2);
}

/* ═══════════════════════════════════════════
   ÉLÉMENTS LIÉS (produits/références)
═══════════════════════════════════════════ */

.td-product-related__title,
.td-reference-related__title {
        font-size: var(--wp--preset--font-size--large) !important;
   
        color: var(--wp--preset--color--primary) !important;
    margin: 0 0 var(--td-spacing-md) 0;
}

.td-product-related__grid,
.td-reference-related__grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--td-spacing-xxl);
}

.td-product-related__item,
.td-reference-related__item {
    display: flex;
    flex-direction: column;
}

.td-reference-related__item{
    background-color: #f6f6f6;
}
.td-product-related__link,
.td-reference-related__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: var(--td-color-primary);
    

    transition: all 0.2s ease;

}

.td-product-related__link:hover,
.td-product-related__link:focus,
.td-reference-related__link:hover,
.td-reference-related__link:focus {
  
    outline: none;
    transform: translateY(-2px);
}

.td-product-related__thumbnail,
.td-reference-related__thumbnail {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f8f9fa;
}
@media all and (min-width:1000px){
    .td-reference-related__thumbnail,
    .td-reference-related__name{
        transform: translateX(-50px);
    }
}
.td-product-related__thumbnail img,
.td-reference-related__thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.td-product-related__link:hover .td-product-related__thumbnail img,
.td-reference-related__link:hover .td-reference-related__thumbnail img {
    transform: scale(1.05);
}

.td-product-related__content,
.td-reference-related__content {
    padding: var(--td-spacing-sm);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.td-product-related__name,
.td-reference-related__name {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.3;
    flex: 1;
    margin-bottom: var(--td-spacing-xs);
}



/* Badges pour les références */
.td-reference-related__badges{
    padding: 10px 0 15px 15px;
}
.td-product-related__badge,
.td-reference-related__badge {
    font-size: 14px;
    text-transform: uppercase;
    color: #254a5d;
    font-weight: 700;
}


/* ═══════════════════════════════════════════
   DESCRIPTION RÉFÉRENCE
═══════════════════════════════════════════ */



.td-reference-description h1,
.td-reference-description h2,
.td-reference-description h3 {
    margin-top: 0;
    color: var(--td-color-primary);
}

/* ═══════════════════════════════════════════
   LIEN PROJET RÉFÉRENCE
═══════════════════════════════════════════ */

.td-reference-link__button {
    display: inline-flex;
    align-items: center;
    gap: var(--td-spacing-sm);
    padding: var(--td-spacing-md) var(--td-spacing-lg);
    background: var(--td-color-primary);
    color: #fff;
    text-decoration: none;
    border-radius: var(--td-border-radius);
    font-weight: 600;
    transition: all 0.2s ease;
}

.td-reference-link__button:hover,
.td-reference-link__button:focus {
    background: var(--td-color-secondary);
    color: #fff;
    outline: none;
    transform: translateY(-1px);
}

/* ═══════════════════════════════════════════
   ACTEURS RÉFÉRENCE
═══════════════════════════════════════════ */

.td-reference-actors {

}



.td-reference-actors__field {
    margin-bottom: var(--td-spacing-md);
}

.td-reference-actors__field:last-child {
    margin-bottom: 0;
}

.td-reference-actors__field img {
    max-width: 100%;
    height: auto;
    border-radius: var(--td-border-radius);
}

.td-reference-actors__field a {
    color: var(--td-color-accent);
    font-weight: 600;
}

.td-reference-actors__field a:hover {
    color: var(--td-color-secondary);
}

.td-reference-actors__field.td-reference-actors__field--link{
    font-size: 15px;
}

/* ═══════════════════════════════════════════
   CONTACT TAXONOMIE
═══════════════════════════════════════════ */

.td-taxonomy-contact {
    background: var(--td-color-primary);
    color: #fff;
    padding: var(--td-spacing-lg);
    border-radius: var(--td-border-radius);
}

.td-taxonomy-contact__title {
    color: var(--td-color-warning);
    margin-top: 0;
    margin-bottom: var(--td-spacing-md);
}

.td-taxonomy-contact__content a {
    color: var(--td-color-warning);
}

/* ═══════════════════════════════════════════
   ICÔNES CSS PURES
═══════════════════════════════════════════ */

.td-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Icône recherche */
.td-icon--search {
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-radius: 50%;
    position: relative;
}

.td-icon--search::after {
    content: "";
    position: absolute;
    bottom: -4px;
    right: 14px;
    width: 2px;
    height: 6px;
    background: currentColor;
    transform: rotate(45deg);
    border-radius: 1px;
}

/* Icône téléchargement */
.td-icon--download {
    width: 14px;
    height: 16px;
    border: 2px solid currentColor;
    border-radius: 2px;
    position: relative;
}

.td-icon--download::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 2px;
    transform: translateX(-50%);
    width: 2px;
    height: 7px;
    background: currentColor;
}

.td-icon--download::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 7px;
    transform: translateX(-50%);
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
}

/* Icônes chevron */
.td-icon--chevron-left,
.td-icon--chevron-right {
    width: 8px;
    height: 8px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
}

.td-icon--chevron-left {
    transform: rotate(-135deg);
}

.td-icon--chevron-right {
    transform: rotate(45deg);
}

/* Icône lien externe */
.td-icon--external-link {
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    position: relative;
}

.td-icon--external-link::before {
    content: "";
    position: absolute;
    top: -2px;
    right: -2px;
    width: 6px;
    height: 6px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
}

.td-icon--external-link::after {
    content: "";
    position: absolute;
    top: 1px;
    right: 1px;
    width: 6px;
    height: 2px;
    background: currentColor;
    transform: rotate(45deg);
}

/* ═══════════════════════════════════════════
   BREAKPOINT DESKTOP (1000px)
═══════════════════════════════════════════ */

@media (min-width: 1000px) {
    .td-product-resources {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .td-product-resources__item {
        flex: 1 1 200px;
    }

    .td-product-related__grid,
    .td-reference-related__grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .td-slider__zoom {
        width: 42px;
        height: 42px;
    }

    .td-slider__control {
        width: 48px;
        height: 48px;
    }

    .td-reference-actors {
       
    }
}

/* ═══════════════════════════════════════════
   JAVASCRIPT CLASS STATES
═══════════════════════════════════════════ */

.td-slider__item.slide-in-left {
    transform: translateX(-100%);
    opacity: 1;
    visibility: visible;
}

.td-slider__item.slide-in-right {
    transform: translateX(100%);
    opacity: 1;
    visibility: visible;
}

.td-slider__item.slide-out-left {
    transform: translateX(-100%);
    opacity: 0;
    visibility: hidden;
}

.td-slider__item.slide-out-right {
    transform: translateX(100%);
    opacity: 0;
    visibility: hidden;
}
