/*
Theme Name: White Label Affiliation
Theme URI: https://example.com/
Author: Your Name
Author URI: https://example.com
Description: Thème WordPress ultra-performant et 100% personnalisable via le Customizer natif. Conçu pour les sites d'affiliation multi-thématiques. Sans framework, sans jQuery, full Gutenberg.
Version: 1.0.1
*/

/* =========================================================
   1. RESET & BASE
   ========================================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--body-font, 'Inter'), -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-color, #222222);
    background-color: var(--bg-color, #ffffff);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--link-color, #0066cc);
    text-decoration: underline;
    transition: opacity 0.2s ease;
}

a:hover,
a:focus {
    opacity: 0.8;
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.skip-link:focus {
    position: absolute;
    left: 10px;
    top: 10px;
    width: auto;
    height: auto;
    padding: 10px 16px;
    background: var(--btn-bg, #000);
    color: var(--btn-text, #fff);
    z-index: 100000;
    text-decoration: none;
}

/* =========================================================
   2. TYPOGRAPHY
   ========================================================= */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--heading-font, 'Inter'), -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--heading-color, #111111);
    line-height: 1.3;
    margin-top: 0;
    margin-bottom: 1.2rem;
    font-weight: 700;
}

h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.6rem); }
h4 { font-size: clamp(1.1rem, 2vw, 1.3rem); }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

.entry-content p,
.entry-content ul,
.entry-content ol {
    margin-top: 0;
    margin-bottom: 1.5rem;
}

.entry-content ul,
.entry-content ol {
    padding-left: 1.5rem;
}

.entry-content li {
    margin-bottom: 0.6rem;
}

.entry-content li:last-child {
    margin-bottom: 0;
}

blockquote {
    border-left: 4px solid var(--link-color, #0066cc);
    margin: 2rem 0;
    padding: 0.5rem 0 0.5rem 1.5rem;
    font-style: italic;
    color: var(--text-color, #222);
    opacity: 0.9;
}

code, pre {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.9em;
}

code {
    background: rgba(0,0,0,0.06);
    padding: 0.15em 0.35em;
    border-radius: 4px;
}

pre {
    background: rgba(0,0,0,0.06);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
}

/* =========================================================
   3. LAYOUT
   ========================================================= */
.site-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.site-content {
    padding: 0px 0 60px;
    min-height: 60vh;
}

.entry-content {
    max-width: 1000px;
    margin: 0 auto;
}

/* Gutenberg wide / full-width support */
.alignwide {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

.alignfull {
    max-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

/* Classic editor alignments */
.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.alignleft {
    float: left;
    margin: 0 1.5rem 1rem 0;
}

.alignright {
    float: right;
    margin: 0 0 1rem 1.5rem;
}

.entry-content::after {
    content: "";
    display: table;
    clear: both;
}

/* =========================================================
   4. HEADER
   ========================================================= */
.site-header {
    background-color: var(--header-bg, #111111);
    color: var(--header-text-color, #ffffff);
    padding: 16px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.site-header.is-sticky {
    position: sticky;
    top: 0;
    z-index: 999;
}

.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.site-branding {
    flex-shrink: 0;
}

.site-title {
    margin: 0;
    font-size: 1.4rem;
    line-height: 1.2;
}

.site-title a {
    color: var(--header-text-color, #ffffff);
    text-decoration: none;
}

.custom-logo {
    width: var(--logo-width, 150px);
    max-width: 100%;
    height: auto;
}

.site-description {
    margin: 4px 0 0;
    font-size: 0.85rem;
    opacity: 0.7;
    color: var(--header-text-color, #ffffff);
}

/* =========================================================
   5. NAVIGATION
   ========================================================= */
.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 24px;
}

.main-navigation a {
    color: var(--header-text-color, #ffffff);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 6px 0;
    position: relative;
    transition: opacity 0.2s ease;
}

.main-navigation a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background-color: var(--header-text-color, #fff);
    transition: width 0.25s ease;
}

.main-navigation a:hover::after,
.main-navigation .current-menu-item > a::after {
    width: 100%;
}

/* Mobile menu toggle (hamburger) */
.menu-toggle {
    display: none;
    background: transparent;
    border: 0;
    padding: 10px;
    cursor: pointer;
    color: var(--header-text-color, #fff);
    font-size: 0;
    line-height: 0;
}

.menu-toggle .bar {
    display: block;
    width: 26px;
    height: 2px;
    background-color: currentColor;
    margin: 5px 0;
    transition: transform 0.25s ease, opacity 0.2s ease;
    border-radius: 2px;
}

.menu-toggle[aria-expanded="true"] .bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.menu-toggle[aria-expanded="true"] .bar:nth-child(2) {
    opacity: 0;
}
.menu-toggle[aria-expanded="true"] .bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .main-navigation {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--header-bg, #111);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        border-top: 1px solid rgba(255,255,255,0.05);
    }

    .site-header {
        position: relative;
    }

    .main-navigation.toggled {
        max-height: 80vh;
        overflow-y: auto;
    }

    .main-navigation ul {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 10px 20px 20px;
    }

    .main-navigation li {
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }

    .main-navigation li:last-child {
        border-bottom: 0;
    }

    .main-navigation a {
        display: block;
        padding: 14px 0;
    }
}

/* =========================================================
   6. ENTRY META (E-E-A-T) + ENTRY HEADER HERO
   ========================================================= */
/* Style "hero" uniquement sur les vues singulières (page / article) */
.single .entry-header,
.page .entry-header,
.error404 .error-404 {
    /* Hero zone est appliquée plus bas pour single/page */
}

.single .site-article > .entry-header,
.page .site-article > .entry-header {
    background-color: var(--entry-header-bg, #ffffff);
    color: var(--entry-header-text, #111111);
    text-align: center;
    margin: 0 0 2.5rem;
    padding: 50px 20px;
    /* Étend la zone hero sur toute la largeur du main */
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding-left: calc(50vw - 50%);
    padding-right: calc(50vw - 50%);
}

.single .site-article > .entry-header .entry-title,
.page .site-article > .entry-header .entry-title,
.single .site-article > .entry-header .entry-meta,
.page .site-article > .entry-header .entry-meta {
    color: var(--entry-header-text, #111111);
}

/* Sur les cards de la liste d'articles : pas de hero, juste une mise en forme simple */
.entry-header {
    margin-bottom: 1.5rem;
}

.entry-title {
    margin-bottom: 1rem;
}

.entry-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-color, #555);
    opacity: 0.9;
    flex-wrap: wrap;
}

.entry-meta .author-avatar img,
.entry-meta .author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.entry-meta .author-name {
    font-weight: 600;
}

.entry-meta .meta-separator {
    opacity: 0.5;
}

@media (max-width: 768px) {
    .single .site-article > .entry-header,
    .page .site-article > .entry-header {
        padding-top: 32px;
        padding-bottom: 32px;
        margin-bottom: 1.8rem;
    }
}

/* =========================================================
   7. BUTTONS (Gutenberg)
   ========================================================= */
.wp-block-button__link,
.wp-block-button .wp-element-button {
    background-color: var(--btn-bg, #ff4444);
    color: var(--btn-text, #ffffff);
    border: 0;
    border-radius: 8px;
    padding: 14px 28px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.wp-block-button__link:hover,
.wp-block-button .wp-element-button:hover,
.wp-block-button__link:focus,
.wp-block-button .wp-element-button:focus {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 6px 14px rgba(0,0,0,0.12);
    opacity: 1;
}

.wp-block-button.is-style-outline .wp-block-button__link {
    background-color: transparent;
    color: var(--btn-bg, #ff4444);
    border: 2px solid var(--btn-bg, #ff4444);
}

/* =========================================================
   8. TABLES (High Contrast - Comparatif)
   ========================================================= */
.entry-content figure.wp-block-table,
.entry-content .wp-block-table {
    margin: 2rem 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.entry-content table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 2px solid var(--text-color, #222);
    border-radius: 12px;
    overflow: hidden;
}

.entry-content table thead {
    background-color: var(--text-color, #222);
    color: var(--bg-color, #fff);
}

.entry-content table thead th {
    color: var(--bg-color, #fff);
    font-weight: 700;
    text-align: left;
    padding: 14px 18px;
    border-right: 1px solid var(--bg-color, #fff);
}

.entry-content table thead th:last-child {
    border-right: 0;
}

.entry-content table tbody td {
    padding: 14px 18px;
    border-bottom: 1px solid var(--text-color, #222);
    border-right: 1px solid var(--text-color, #222);
}

.entry-content table tbody td:last-child {
    border-right: 0;
}

.entry-content table tbody tr:last-child td {
    border-bottom: 0;
}

.entry-content table tbody tr:nth-child(even) td {
    background-color: rgba(0,0,0,0.025);
}

@media (max-width: 768px) {
    .entry-content table {
        white-space: nowrap;
    }
}

/* =========================================================
   9. FOOTER
   ========================================================= */
.site-footer {
    background-color: var(--header-bg, #111111);
    color: var(--header-text-color, #ffffff);
    padding: 40px 0 24px;
    margin-top: 60px;
}

.site-footer a {
    color: var(--header-text-color, #fff);
}

.footer-disclaimer {
    font-size: 0.85rem;
    line-height: 1.7;
    opacity: 0.75;
    max-width: 900px;
    margin: 0 auto 20px;
    text-align: center;
}

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.85rem;
    opacity: 0.7;
}

.footer-menu {
    list-style: none;
    margin: 0 0 18px;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 18px;
}

.footer-menu a {
    text-decoration: none;
    font-size: 0.9rem;
}

/* =========================================================
   10. 404 PAGE
   ========================================================= */
.error-404 {
    text-align: center;
    padding: 80px 20px;
    max-width: 600px;
    margin: 0 auto;
}

.error-404 .error-code {
    font-size: clamp(4rem, 12vw, 8rem);
    font-weight: 800;
    line-height: 1;
    margin: 0 0 1rem;
    color: var(--heading-color, #111);
}

.error-404 .error-title {
    margin-bottom: 1rem;
}

.error-404 .error-description {
    margin-bottom: 2rem;
    font-size: 1.05rem;
}

.btn-home {
    display: inline-block;
    background-color: var(--btn-bg, #ff4444);
    color: var(--btn-text, #fff);
    padding: 14px 32px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.btn-home:hover,
.btn-home:focus {
    transform: translateY(-2px);
    filter: brightness(1.1);
    opacity: 1;
}

/* =========================================================
   11. UTILITIES & RESPONSIVE
   ========================================================= */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    width: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    word-wrap: normal !important;
}

@media (max-width: 600px) {
    body {
        font-size: 15px;
    }

    .site-content {
        padding: 24px 0 40px;
    }

    .entry-meta {
        font-size: 0.85rem;
    }
}
