/* =============================================================================
   Tull-IT — Base styles
   ============================================================================= */

@import url('./blocks/_shared.css');


/* Reset minimal */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    /* Rendu typo plus fin sur Mac/WebKit et Firefox macOS (matche le rendu de la prod) */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
img, picture, svg, video { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; }
ul, ol { padding: 0; }

/* Selection de texte aux couleurs Tull-IT */
::selection {
    background: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--white);
}

/* Accessibility */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px; width: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    position: absolute !important;
    word-wrap: normal !important;
}
.skip-link {
    position: absolute; top: -100px; left: 8px;
    padding: 12px 18px;
    background: var(--wp--preset--color--white);
    color: var(--wp--preset--color--primary);
    z-index: 9999;
    transition: top .2s ease;
}
.skip-link:focus { top: 8px; }

/* Layout */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 24px;
}
.container--narrow { max-width: 800px; }
.text-center { text-align: center; }

/* Hero H1 automatique : un H1 placé en 1er enfant direct de l'article
   prend le style "hero" (gros titre centré + ligne déco rose verticale).
   Pour désactiver, suffit de mettre le H1 dans un bloc (group, columns, etc.) */
.tull-page > h1:first-child {
    text-align: center;
    margin: 120px auto 24px;
    padding: 0 24px;
}
.tull-page > h1:first-child::after {
    content: "";
    display: block;
    width: 2px;
    height: 60px;
    background: var(--wp--preset--color--primary);
    margin: 48px auto 80px;
}
/* Style block "Sous-titre" — applicable a un paragraphe via la sidebar Gutenberg.
   S'il suit directement le H1 hero, il prend la place de la ligne deco
   (et celle-ci se deplace sous lui). */
.is-style-subtitle {
    text-align: center;
    font-size: clamp(20px, 2vw, 28px);
    font-weight: 600;
    color: var(--wp--preset--color--primary);
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px;
}
/* Si le sous-titre est juste sous le H1 hero, retire la deco du H1
   et place une nouvelle deco sous le sous-titre */
.tull-page > h1:first-child:has(+ .is-style-subtitle)::after {
    display: none;
}
.tull-page > h1:first-child + .is-style-subtitle {
    margin-top: 40px;
}
.tull-page > h1:first-child + .is-style-subtitle::after {
    content: "";
    display: block;
    width: 2px;
    height: 60px;
    background: var(--wp--preset--color--primary);
    margin: 48px auto 80px;
}
@media (max-width: 768px) {
    .tull-page > h1:first-child {
        margin: 56px auto 24px;
        padding: 0 16px;
    }
    .tull-page > h1:first-child::after,
    .tull-page > h1:first-child + .is-style-subtitle::after {
        height: 40px;
        margin: 24px auto 40px;
    }
    /* Aligne sur hero-side-images mobile : 24px H1->sub, 24px sub->deco */
    .tull-page > h1:first-child + .is-style-subtitle {
        margin-top: 24px;
    }
    .is-style-subtitle {
        padding: 0 16px;
    }

    /* Sur mobile les colonnes s'empilent : un h1 imbrique dans une colonne
       (ex : hero-text-image) devient visuellement equivalent au h1 direct
       de .tull-page → on lui applique le meme style hero + deco. */
    .tull-page .wp-block-column h1.wp-block-heading {
        text-align: center;
        margin: 56px auto 24px;
        padding: 0 16px;
    }
    .tull-page .wp-block-column h1.wp-block-heading::after {
        content: "";
        display: block;
        width: 2px;
        height: 40px;
        background: var(--wp--preset--color--primary);
        margin: 24px auto 40px;
    }
}

/* Container auto (2 niveaux) :
   - Defaut : tout enfant direct = 1400px (columns, image, buttons, gallery, etc.)
   - Texte semantique = 1140px (confort de lecture)
   - Exceptions pleine largeur : .alignfull et blocs custom Tull-IT */
.tull-page > * {
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 40px;
    padding-right: 40px;
    box-sizing: border-box;

    @media (max-width: 960px) {
        padding-left: 24px;
        padding-right: 24px;
    }
}
.tull-page > h1,
.tull-page > h2,
.tull-page > h3,
.tull-page > h4,
.tull-page > h5,
.tull-page > h6,
.tull-page > p,
.tull-page > ul,
.tull-page > ol,
.tull-page > blockquote,
.tull-page > pre,
.tull-page > .wp-block-list,
.tull-page > .wp-block-pullquote,
.tull-page > .wp-block-quote,
.tull-page > .wp-block-details {
    max-width: 1140px;
}
.tull-page > .alignfull,
.tull-page > [class*="wp-block-tull-it-"] {
    max-width: none;
    padding-left: 24px;
    padding-right: 24px;
}
/* Les blocs ACF sont rendus SANS wrapper en front (ACF n'ajoute pas de
   .wp-block-tull-it-*), donc le selecteur ci-dessus ne les attrape pas :
   leur <section> racine porte .tull-bleed.
   On ne touche QUE le max-width : chaque bloc garde son propre padding
   horizontal via un selecteur compose (.tull-bleed.tull-xxx, specificite
   0-2-0) qui passe devant le `.tull-page > *` ci-dessus (0-1-0). */
.tull-page > .tull-bleed {
    max-width: none;
}

/* Single job : contenu textuel decale vers la droite (l'aire gauche accueille
   les arcs decoratifs). Seuls les blocs texte (paragraphe, titre, liste,
   citation, preformatted, code, verse) sont decales — les blocs structurels
   (columns, image, cover, blocs custom tull-it/*, etc.) restent pleine largeur.
   Mobile conserve la mise en page normale. */
@media (min-width: 960px) {
    body.single-job .tull-page {
        position: relative;
        isolation: isolate;
    }
    body.single-job .tull-page::before {
        content: "";
        position: absolute;
        top: 1300px;
        left: 0;
        width: 70%;
        aspect-ratio: 660 / 920;
        background: url('../images/single-job-arcs.png') left top / 100% 100% no-repeat;
        pointer-events: none;
        opacity: 0.5;
        z-index: -1;
    }
    body.single-job .tull-page > :is(
        h1, h2, h3, h4, h5, h6,
        p,
        ul, ol,
        .wp-block-list,
        blockquote, .wp-block-quote,
        .wp-block-pullquote,
        pre, .wp-block-preformatted,
        .wp-block-code,
        .wp-block-verse,
        .wp-block-buttons
    ) {
        margin-left: 30%;
        margin-right: auto;
        max-width: 790px;
    }
}

/* Listes : alignement du bullet/numero sur le X des paragraphes
   (sans hack : padding-left absorbe le retrait du bullet, text-indent le ramene
   vers la gauche pour que les multi-lignes s'alignent sous le texte). */
.tull-page > ul,
.tull-page > ol {
    list-style-position: outside;
    padding-left: 5em;
}
.wp-block-column ul,
.wp-block-column ol {
    padding-left: 1.2em;
}
.tull-page > ul > li,
.tull-page > ol > li {
    padding-left: .6em;
}

.wp-block-column ul > li,
.wp-block-column ol > li {
    padding-left: .6em;
}

/* Pullquote (citation mise en avant) : ajoute juste l'icone dans un cercle
   dark debordant au-dessus du bloc. Tous les autres styles (couleur de fond,
   padding, border-radius, etc.) sont laisses aux options Gutenberg. */
.wp-block-pullquote {
    position: relative;
    overflow: visible;
    font-weight: 600;
}
.wp-block-pullquote::before {
    content: "";
    position: absolute;
    top: -36px;
    left: 50%;
    transform: translateX(-50%);
    width: 72px;
    height: 72px;
    background: var(--wp--preset--color--dark) url('../images/icon-pullquote.svg') center / 36px 36px no-repeat;
    border-radius: 50%;
}
@media (max-width: 768px) {
    .wp-block-pullquote::before {
        top: -28px;
        width: 56px;
        height: 56px;
        background-size: 28px 28px;
    }
}

/* ====================== HEADER ====================== */
.site-header {
    background: var(--wp--preset--color--dark);
    color: var(--wp--preset--color--white);
    position: relative;
    z-index: 100;
}
.site-header__inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    display: flex;
    align-items: stretch;
    gap: 40px;
    min-height: 150px;
}

/* Logo / branding */
.site-branding {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.site-branding img,
.site-branding .custom-logo-link img {
    max-height: 40px;
    width: auto;
    display: block;
}
.site-title {
    color: var(--wp--preset--color--white);
    text-decoration: none;
    font-weight: 700;
    font-size: 24px;
    text-transform: uppercase;
    letter-spacing: .02em;
}

/* Hamburger toggle — masque desktop */
.site-nav__toggle {
    display: none;
    background: none;
    border: 0;
    cursor: pointer;
    padding: 12px;
    margin-left: auto;
    margin-right: -12px;
    align-self: center;
}
.site-nav__toggle span {
    display: block;
    width: 28px;
    height: 2px;
    background: var(--wp--preset--color--white);
    margin: 6px 0;
    transition: transform .25s ease, opacity .25s ease;
}
.site-nav__toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.site-nav__toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}
.site-nav__toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Navigation : primaire prend l'espace, secondaire reste compacte */
.site-nav {
    display: flex;
    align-items: center;
}
.site-nav--primary {
    flex: 1;
    justify-content: center;
}
.site-nav--secondary {
    flex: 0 0 auto;
    justify-content: flex-end;
}
.site-nav__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 40px;
}
.site-nav__list > li {
    position: relative;
}
.site-nav__list > li > a {
    color: var(--wp--preset--color--white);
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color .2s ease;
}
.site-nav__list > li > a:hover,
.site-nav__list > li:focus-within > a {
    color: var(--wp--preset--color--primary);
}

/* Indicateur de dropdown (fleche bas) */
.site-nav__list > .menu-item-has-children > a::after {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    margin-left: 4px;
}

/* Sous-menus (hover) */
.site-nav__list .sub-menu {
    position: absolute;
    top: 100%;
    left: -16px;
    list-style: none;
    margin: 0;
    padding: 12px 0;
    background: var(--wp--preset--color--dark);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
    z-index: 100;
}
.site-nav__list > .menu-item-has-children:hover > .sub-menu,
.site-nav__list > .menu-item-has-children:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.site-nav__list .sub-menu > li > a {
    display: block;
    padding: 10px 24px;
    color: var(--wp--preset--color--white);
    text-decoration: none;
    font-size: 15px;
    transition: color .2s ease;
}
.site-nav__list .sub-menu > li > a:hover {
    color: var(--wp--preset--color--primary);
}

/* Bouton CTA "Nous contacter" */
.site-header__cta {
    display: inline-flex;
    align-items: center;
    align-self: center;
    gap: 14px;
    padding: 14px 28px;
    background: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--white);
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-radius: 0 0 0 10px;
    transition: background .2s ease, color .2s ease;
    flex-shrink: 0;
}
.site-header__cta::after {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    transform: rotate(45deg);
}
.site-header__cta:hover {
    background: var(--wp--preset--color--white);
    color: var(--wp--preset--color--primary);
}

/* ====================== HEADER MOBILE ====================== */
@media (max-width: 960px) {
    .site-header__inner {
        flex-wrap: wrap;
        padding: 0 24px;
        min-height: auto;
        gap: 0;
    }
    .site-branding {
        padding: 24px 0;
    }
    .site-nav__toggle {
        display: block;
    }

    .site-nav,
    .site-header__cta {
        display: none;
        flex-basis: 100%;
        order: 99;
    }
    .site-header[data-menu-open="true"] .site-nav {
        display: block;
    }
    .site-header[data-menu-open="true"] .site-header__cta {
        display: inline-flex;
        align-self: flex-start;
        margin: 12px 0 32px;
    }

    .site-nav__list {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }
    .site-nav__list > li > a {
        padding: 16px 0;
        font-size: 18px;
        font-weight: 700;
    }
    .site-nav__list .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        background: transparent;
        box-shadow: none;
        min-width: 0;
        max-height: 0;
        overflow: hidden;
        padding: 0 0 0 16px;
        transition: max-height .3s ease, padding .3s ease;
    }
    .site-nav__list > .menu-item-has-children[data-submenu-open="true"] > .sub-menu {
        max-height: 600px;
        padding: 0 0 12px 16px;
    }
    /* Indicateur tourne vers le haut quand sous-menu ouvert */
    .site-nav__list > .menu-item-has-children[data-submenu-open="true"] > a::after {
        transform: translateY(2px) rotate(-135deg);
    }
    .site-nav__list .sub-menu > li > a {
        padding: 8px 0;
        font-size: 15px;
    }
}

/* ====================== FOOTER ====================== */
.site-footer {
    background: var(--wp--preset--color--dark);
    color: var(--wp--preset--color--white);
    padding: 80px 0 24px;
}

/* Mini logo icone centre en haut */
.site-footer__icon {
    text-align: center;
    margin-bottom: 80px;
}
.site-footer__icon svg,
.site-footer__icon img {
    height: 48px;
    width: auto;
    display: inline-block;
}

/* Grid 4 colonnes */
.site-footer__cols {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 48px;
}
.site-footer__col {
    min-width: 0;
}
.site-footer__col--brand img,
.site-footer__col--brand .custom-logo-link img {
    max-height: 40px;
    width: auto;
    display: block;
    margin-bottom: 20px;
}
.site-footer__tagline {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    color: var(--wp--preset--color--white);
}
.site-footer__col-title {
    color: var(--wp--preset--color--primary);
    font-weight: 700;
    font-size: 18px;
    margin: 0 0 24px;
}

/* Menus footer (Services, Secteurs, Tull-IT) */
.footer-nav {
    list-style: none;
    margin: 0;
    padding: 0;
}
.footer-nav li {
    margin: 0;
}
.footer-nav a {
    display: inline-block;
    padding: 8px 0;
    color: var(--wp--preset--color--white);
    text-decoration: none;
    font-size: 15px;
    transition: color .2s ease;
}
.footer-nav a:hover {
    color: var(--wp--preset--color--primary);
}

/* Bouton CTA "Nous contacter" — meme style que header */
.site-footer__cta {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    padding: 14px 28px;
    margin-top: 24px;
    background: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--white);
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: .04em;
    border-radius: 0 0 0 10px;
    transition: background .2s ease, color .2s ease;
}
.site-footer__cta::after {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    transform: rotate(45deg);
}
.site-footer__cta:hover {
    background: var(--wp--preset--color--white);
    color: var(--wp--preset--color--primary);
}

/* Footer bar (mentions / copyright) */
.site-footer__bar {
    max-width: 1400px;
    margin: 80px auto 0;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    font-size: 13px;
    opacity: .8;
}
.legal-nav {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}
.legal-nav li + li::before {
    content: "–";
    margin: 0 8px;
    opacity: .7;
}
.legal-nav a {
    color: var(--wp--preset--color--white);
    text-decoration: none;
    transition: color .2s ease;
}
.legal-nav a:hover {
    color: var(--wp--preset--color--primary);
}
.site-footer__copy {
    margin: 0;
}

/* Footer mobile */
@media (max-width: 960px) {
    .site-footer {
        padding: 56px 0 24px;
    }
    .site-footer__icon {
        margin-bottom: 40px;
    }
    .site-footer__cols {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
        padding: 0 24px;
    }
    .site-footer__bar {
        margin-top: 56px;
        padding: 0 24px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}
@media (max-width: 600px) {
    .site-footer__cols {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

/* Bouton Gutenberg (wp:button) : la base (bg primary, texte blanc, uppercase,
   radius 0 0 0 10px, padding) vient de theme.json. On ajoute ici les
   transitions, une bordure "invisible" qui se revele au hover (le fond devient
   blanc, la bordure reste rose), un leger lift + ombre et le focus a11y. */
.wp-block-button__link {
    position: relative;
    padding-bottom: 12px;
    transition:
        background-color .25s ease,
        color .25s ease,
        border-color .25s ease,
        transform .25s ease,
        box-shadow .25s ease;
}
.wp-block-button__link:hover {
    
}
.wp-block-button__link:focus-visible {
    
}
.wp-block-button__link:active {
    transform: translateY(0);
    box-shadow: none;
}

/* Variante "outline" : ajoute la block style via block-styles.php si besoin.
   Fond transparent, bordure primary, texte primary → hover invers. */
.wp-block-button.is-style-outline .wp-block-button__link {
    background: transparent;
    color: var(--wp--preset--color--primary);
}
.wp-block-button.is-style-outline .wp-block-button__link:hover {
    background: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--white);
}

/* Forms */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="search"],
input[type="url"],
input[type="number"],
textarea,
select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--wp--preset--color--gray);
    border-radius: 6px;
    background: var(--wp--preset--color--white);
    color: var(--wp--preset--color--dark);
}
input:focus, textarea:focus, select:focus {
    outline: 2px solid var(--wp--preset--color--primary);
    outline-offset: 2px;
    border-color: var(--wp--preset--color--primary);
}
