/*
Theme Name: NC Industrial
Description: Canevas chantier/BTP maison — quatrième alternative visuelle complète (après nc-canvas, nc-editorial, nc-serene) : béton, jaune sécurité, coins coupés façon fiche technique, grille de plan en fond de hero. Un des canevas de la fabrique de sites NC ECOM.
Author: NC ECOM
Version: 1.0
Text Domain: nc-industrial
*/

/* ==========================================================================
   Variables (repli par défaut ; surchargées par site via functions.php)
   ========================================================================== */
:root {
    --color-primary: #D9720A;
    --color-primary-hover: #B85E07;
    --color-heading: #1F2421;
    --color-text: #3D4440;
    --color-background: #F1EFE9;
    --color-secondary-background: #E4E1D8;
    --color-border: #1F2421;
    --color-secondary-border: #CFCABB;
    --color-accent: #F2C230;
    --font-heading: 'Oswald', sans-serif;
    --font-body: 'Roboto', sans-serif;

    --container-width: 1200px;
    --clip: 18px;

    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 3rem;
    --space-xl: 5rem;

    --bp-mobile: 900px;
}

/* ==========================================================================
   Reset & base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--color-text);
    background: var(--color-background);
    line-height: 1.65;
    font-size: 1rem;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--color-primary); }
a:hover { color: var(--color-primary-hover); }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--color-heading);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.01em;
    line-height: 1.05;
    margin: 0 0 0.75rem;
}
h1 { font-size: clamp(2.4rem, 5.6vw, 4.2rem); }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1.25rem; }
p:last-child { margin-bottom: 0; }

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.screen-reader-text {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
}

/* ==========================================================================
   Boutons — coin coupé façon étiquette technique, jamais de pilule
   ========================================================================== */
.btn {
    display: inline-block;
    padding: 0.95rem 2rem;
    font-weight: 700;
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    text-decoration: none;
    border: none;
    cursor: pointer;
    clip-path: polygon(var(--clip) 0, 100% 0, 100% calc(100% - var(--clip)), calc(100% - var(--clip)) 100%, 0 100%, 0 var(--clip));
    transition: background 0.15s ease, transform 0.1s ease;
}
.btn--accent { background: var(--color-primary); color: #fff; }
.btn--accent:hover { background: var(--color-primary-hover); color: #fff; transform: translateY(-2px); }
.btn--light { background: var(--color-accent); color: var(--color-heading); }
.btn--light:hover { background: #fff; color: var(--color-heading); }

/* ==========================================================================
   Header — bandeau ferme, filet jaune sécurité en pied de header
   ========================================================================== */
.site-header {
    background: var(--color-heading);
    border-bottom: 5px solid var(--color-accent);
    position: sticky;
    top: 0;
    z-index: 100;
}
.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding: 1rem 1.5rem;
    max-width: var(--container-width);
    margin: 0 auto;
}
.site-branding {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    flex-shrink: 0;
}
.site-branding img { max-height: 46px; width: auto; }
.site-branding__title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #fff;
    white-space: nowrap;
}

.header-nav-area { display: flex; align-items: center; gap: var(--space-md); flex: 1; justify-content: flex-end; }

.primary-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 1.75rem;
    flex-wrap: nowrap;
}
.primary-nav a {
    color: #fff;
    font-family: var(--font-heading);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    text-decoration: none;
    white-space: nowrap;
    font-size: 0.95rem;
}
.primary-nav a:hover { color: var(--color-accent); }

.header-search { position: relative; }
.header-search__toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: #fff;
    padding: 0.4rem;
    display: flex;
    align-items: center;
}
.header-search__toggle svg { width: 20px; height: 20px; }
.header-search__form {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: #fff;
    border: 2px solid var(--color-heading);
    padding: 0.75rem;
    width: 280px;
}
.header-search__form.is-open { display: flex; gap: 0.5rem; }
.header-search__form input[type="search"] {
    flex: 1;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--color-secondary-border);
    font-family: inherit;
}
.header-search__form button {
    background: var(--color-primary);
    color: #fff;
    border: none;
    padding: 0 1rem;
    cursor: pointer;
    font-family: var(--font-heading);
    text-transform: uppercase;
}

.mobile-nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 0.4rem; }
.mobile-nav-toggle svg { width: 26px; height: 26px; color: #fff; }
.primary-nav__close { display: none; }

@media (max-width: 900px) {
    .primary-nav {
        display: none;
        position: fixed;
        inset: 0;
        z-index: 300;
        background: var(--color-heading);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 2rem;
    }
    .primary-nav.is-open { display: flex; }
    .primary-nav__close {
        display: flex;
        position: absolute;
        top: 1.25rem;
        right: 1.25rem;
        background: none;
        border: none;
        color: #fff;
        padding: 0.5rem;
    }
    .primary-nav__close svg { width: 26px; height: 26px; }
    .primary-nav ul { flex-direction: column; gap: 0.5rem; padding: 0; text-align: center; }
    .primary-nav a { display: block; padding: 0.85rem 0; font-size: 1.5rem; }
    .site-header__inner { flex-wrap: nowrap; gap: 0.75rem; padding: 0.75rem 1rem; }
    .site-branding { flex: 1 1 0; min-width: 0; }
    .site-branding img { max-height: 34px; }
    .site-branding__title { font-size: 1.15rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .header-nav-area { flex: 0 0 auto; gap: 0.5rem; }
    .mobile-nav-toggle { display: flex; }
    body.nav-is-open { overflow: hidden; }
}

/* ==========================================================================
   Sections — bandes pleines sobres ; signature du canevas concentrée sur
   le hero (grille de plan) et les cartes (coin coupé), pas sur des
   séparateurs de section (ni diagonale comme nc-canvas, ni vague comme
   nc-serene, ni filet comme nc-editorial : ici un bord franc, neutre).
   ========================================================================== */
.section { padding: var(--space-xl) 0; }
.section .section-title { margin-bottom: 2.5rem; }
.section h2 { margin-bottom: 1.25rem; }

/* Hero : grille de plan technique en filigrane derrière le voile — signature
   visuelle directe du "chantier/BTP", contrairement aux voiles neutres des
   autres canevas. */
.hero {
    position: relative;
    min-height: 460px;
    display: flex;
    align-items: center;
    color: #fff;
    background-color: var(--color-heading);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    text-align: left;
}
.hero__overlay {
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(0deg, rgba(242,194,48,0.06) 0, rgba(242,194,48,0.06) 1px, transparent 1px, transparent 40px),
        repeating-linear-gradient(90deg, rgba(242,194,48,0.06) 0, rgba(242,194,48,0.06) 1px, transparent 1px, transparent 40px),
        rgba(31,36,33,0.72);
}
.hero__content { position: relative; z-index: 1; max-width: 760px; margin: 0; padding: var(--space-lg) 1.5rem; }
.hero__content::before {
    content: "";
    display: block;
    width: 56px;
    height: 6px;
    background: var(--color-accent);
    margin-bottom: 1.5rem;
}
.hero h1 { color: #fff; }
.hero p { color: #fff; font-size: clamp(1.05rem, 1.7vw, 1.25rem); text-transform: none; opacity: 0.92; max-width: 46ch; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-lg); align-items: center; }
.split img { clip-path: polygon(var(--clip) 0, 100% 0, 100% calc(100% - var(--clip)), calc(100% - var(--clip)) 100%, 0 100%, 0 var(--clip)); }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }

/* ==========================================================================
   Grilles de cartes — bordure épaisse, coin coupé façon fiche technique
   ========================================================================== */
.section-title {
    text-align: left;
    margin-bottom: 2.5rem;
    padding-left: 1rem;
    border-left: 6px solid var(--color-primary);
}

.card-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-md);
}
.card {
    background: #fff;
    border: 2px solid var(--color-heading);
    clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 0 100%);
    overflow: hidden;
    transition: transform 0.2s ease;
    flex: 0 1 300px;
    min-width: 260px;
}
.card:hover { transform: translateY(-4px); }
.card img { width: 100%; height: 200px; object-fit: cover; }
.card__body { padding: 1.4rem 1.6rem 1.7rem; }
.card__title { margin: 0 0 0.4rem; font-size: 1.1rem; text-transform: none; font-family: var(--font-body); font-weight: 700; }
.card__title a { color: var(--color-heading); text-decoration: none; }
.card__title a:hover { color: var(--color-primary); }
.card__meta {
    font-size: 0.78rem;
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.6;
    margin: 0;
}
.card__text { font-size: 0.95rem; margin: 0.6rem 0 0; }
.card--solid { display: flex; align-items: center; justify-content: center; min-height: 130px; background-color: var(--color-heading); }
.card--solid .card__body { padding: 1.4rem; text-align: center; }

.card-grid--n2 > .card { flex: 1 1 380px; max-width: 500px; }
.card-grid--n4 > .card, .card-grid--n4 > li { flex: 1 1 220px; max-width: 260px; min-width: 0; }

/* ==========================================================================
   Bloc "Derniers articles"
   ========================================================================== */
.wp-block-latest-posts.wp-block-latest-posts__list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-md);
    list-style: none;
    margin: 0;
    padding: 0;
}
.wp-block-latest-posts__list > li {
    background: #fff;
    border: 2px solid var(--color-heading);
    clip-path: polygon(0 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 0 100%);
    overflow: hidden;
    padding-bottom: 1.2rem;
    flex: 0 1 300px;
    min-width: 260px;
}
.wp-block-latest-posts__featured-image { margin: 0 0 1rem; overflow: hidden; }
.wp-block-latest-posts__featured-image img { width: 100%; height: 200px; object-fit: cover; }
.wp-block-latest-posts__post-title {
    display: block;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1.05rem;
    text-decoration: none;
    color: var(--color-heading);
    margin: 0 1.4rem 0.4rem;
}
.wp-block-latest-posts__post-date { display: block; font-size: 0.78rem; font-family: var(--font-heading); text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.6; margin: 0 1.4rem; }

.affiliate-disclosure { font-size: 0.8rem; opacity: 0.65; margin-top: 1.5rem; }

/* ==========================================================================
   Formulaire de contact (Contact Form 7)
   ========================================================================== */
.wpcf7-form p { margin-bottom: 1.4rem; }
.wpcf7-form label { display: block; font-weight: 700; font-family: var(--font-heading); text-transform: uppercase; letter-spacing: 0.02em; margin-bottom: 0.4rem; color: var(--color-heading); font-size: 0.9rem; }
.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid var(--color-secondary-border);
    font-family: inherit;
    font-size: 1rem;
    background: #fff;
}
.wpcf7-form textarea { min-height: 160px; resize: vertical; }
.wpcf7-form input[type="submit"] {
    background: var(--color-primary);
    color: #fff;
    border: none;
    padding: 0.9rem 2.2rem;
    font-family: var(--font-heading);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    cursor: pointer;
    clip-path: polygon(var(--clip) 0, 100% 0, 100% calc(100% - var(--clip)), calc(100% - var(--clip)) 100%, 0 100%, 0 var(--clip));
}
.wpcf7-form input[type="submit"]:hover { background: var(--color-primary-hover); }
.wpcf7-not-valid-tip { color: var(--color-primary); font-size: 0.85rem; margin-top: 0.3rem; }
.wpcf7-response-output { border: 2px solid var(--color-heading); padding: 1rem; margin-top: 1.5rem; }
.nc-hp-field { position: absolute; left: -9999px; top: -9999px; height: 0; overflow: hidden; margin: 0; }

/* ==========================================================================
   Contenu générique (pages, articles)
   ========================================================================== */
.page-content, .single-content { padding: var(--space-lg) 0; }
.entry-title { font-size: clamp(2.2rem, 5vw, 3rem); margin-bottom: 0.5rem; }
.entry-meta {
    color: var(--color-text);
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    opacity: 0.65;
    font-size: 0.85rem;
    margin-bottom: var(--space-md);
}
.entry-featured-image { margin-bottom: var(--space-md); }
.entry-featured-image img { width: 100%; }
.entry-content :is(h2, h3) { margin-top: 2rem; }
.container > :is(h2, h3):not(:first-child) { margin-top: 2rem; }

/* ==========================================================================
   Pied de page
   ========================================================================== */
.single-content, .archive-results, .no-results { padding-bottom: var(--space-xl); }

.site-footer {
    background: var(--color-heading);
    color: rgba(255, 255, 255, 0.82);
    padding: var(--space-lg) 0 var(--space-md);
    border-top: 5px solid var(--color-accent);
}
.footer-menu ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem 2rem;
    list-style: none;
    margin: 0 0 var(--space-md);
    padding: 0;
}
.footer-menu a {
    color: #fff;
    opacity: 0.85;
    text-decoration: none;
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    font-size: 0.9rem;
}
.footer-menu a:hover { opacity: 1; color: var(--color-accent); }
.site-footer__copyright { text-align: center; font-size: 0.8rem; opacity: 0.6; }

/* ==========================================================================
   Recherche / archives
   ========================================================================== */
.archive-header, .search-header { padding: var(--space-lg) 0 var(--space-sm); }
.no-results { padding: var(--space-lg) 0; }

/* ==========================================================================
   Apparition au scroll
   ========================================================================== */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
}
