/*
Theme Name:   Hello Child Custom
Theme URI:    https://example.com/hello-child-custom
Description:  Thème enfant Hello Elementor - Design SaaS moderne (vert/orange) avec blog, single, archive et WooCommerce optimisé.
Author:       Custom Dev
Author URI:   https://example.com
Template:     hello-elementor
Version:      1.1.0
Requires at least: 5.8
Tested up to: 6.5
Requires PHP: 7.4
License:      GNU General Public License v2 or later
License URI:  http://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  hello-child-custom
Tags:         e-commerce, blog, custom-colors, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* ==========================================================================
   VARIABLES & RESET
   ========================================================================== */
:root {
    --primary: #16a34a;
    --primary-dark: #15803d;
    --primary-light: #22c55e;
    --accent: #f97316;
    --accent-dark: #ea580c;
    --secondary: #111827;
    --text: #1f2937;
    --text-soft: #374151;
    --text-light: #6b7280;
    --bg: #ffffff;
    --bg-soft: #f9fafb;
    --bg-mid: #f3f4f6;
    --border: #e5e7eb;
    --border-soft: #d1d5db;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.08);
    --transition: all 0.2s ease;
    --max-width: 1200px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, sans-serif;
    color: var(--text);
    line-height: 1.7;
    background: var(--bg);
    font-size: 17px;
    -webkit-font-smoothing: antialiased;
    margin: 0;
}

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

h1, h2, h3, h4, h5, h6 {
    color: var(--secondary);
    line-height: 1.3;
    font-weight: 700;
    margin-top: 0;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

p {
    margin: 0 0 1rem;
}

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

/* ==========================================================================
   SINGLE POST (référence du design)
   ========================================================================== */
.single-post-wrapper *,
.single-post-wrapper *::before,
.single-post-wrapper *::after {
    box-sizing: border-box;
}

.single-post-wrapper {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
    color: var(--text);
    line-height: 1.7;
    font-size: 17px;
}

/* HERO single */
.single-hero {
    text-align: center;
    padding: 60px 20px 40px;
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
    margin-bottom: 50px;
}

.single-hero__title {
    font-size: 42px;
    font-weight: 800;
    line-height: 1.2;
    color: var(--secondary);
    margin: 0 auto 20px;
    max-width: 800px;
}

.single-hero__meta {
    display: inline-flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    color: var(--text-light);
    font-size: 15px;
}

.single-hero__meta span {
    display: inline-flex;
    align-items: center;
}

.single-hero__separator {
    color: var(--border-soft);
}

.single-hero__meta a {
    color: var(--text-light);
}

.single-hero__meta a:hover {
    color: var(--primary);
}

/* Layout 2 colonnes */
.single-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 50px;
    padding-bottom: 60px;
}

/* Article */
.single-article {
    min-width: 0;
}

.single-article__thumbnail {
    margin-bottom: 35px;
    border-radius: var(--radius);
    overflow: hidden;
}

.single-article__thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

.single-article__content {
    font-size: 17px;
    line-height: 1.75;
    color: var(--text-soft);
}

.single-article__content p {
    margin: 0 0 20px;
}

.single-article__content h2 {
    font-size: 28px;
    font-weight: 700;
    color: var(--secondary);
    margin: 40px 0 18px;
    line-height: 1.3;
}

.single-article__content h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--secondary);
    margin: 32px 0 14px;
    line-height: 1.35;
}

.single-article__content a {
    color: var(--primary);
    text-decoration: underline;
}

.single-article__content a:hover {
    color: var(--primary-dark);
}

.single-article__content ul,
.single-article__content ol {
    margin: 0 0 20px;
    padding-left: 24px;
}

.single-article__content li {
    margin-bottom: 8px;
}

.single-article__content blockquote {
    border-left: 4px solid var(--primary);
    background: var(--bg-soft);
    padding: 18px 24px;
    margin: 28px 0;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #4b5563;
}

.single-article__content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    margin: 24px 0;
}

/* CTA en bas d'article */
.single-cta {
    margin-top: 50px;
    padding: 40px 30px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: 14px;
    text-align: center;
    color: #fff;
}

.single-cta__title {
    font-size: 26px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 12px;
}

.single-cta__text {
    font-size: 16px;
    color: #ecfdf5;
    margin: 0 auto 24px;
    max-width: 500px;
}

.single-cta__button {
    display: inline-block;
    padding: 14px 32px;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: background 0.2s ease;
}

.single-cta__button:hover {
    background: var(--accent-dark);
    color: #fff;
}

/* ==========================================================================
   SIDEBAR (commune single + blog)
   ========================================================================== */
.single-sidebar,
.blog-sidebar {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.sidebar-widget,
.sidebar-box {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
}

.sidebar-widget__title,
.sidebar-box h3 {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--secondary);
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary);
}

/* Recherche sidebar */
.sidebar-search input[type="search"],
.sidebar-box input[type="search"] {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    font-size: 14px;
    background: var(--bg-soft);
    color: var(--secondary);
    font-family: inherit;
}

.sidebar-search input[type="search"]:focus,
.sidebar-box input[type="search"]:focus {
    outline: none;
    border-color: var(--primary);
    background: #fff;
}

.sidebar-search button,
.sidebar-box button[type="submit"] {
    width: 100%;
    margin-top: 10px;
    padding: 11px;
    background: var(--secondary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s ease;
}

.sidebar-search button:hover,
.sidebar-box button[type="submit"]:hover {
    background: var(--primary);
}

/* Articles récents */
.sidebar-recent,
.sidebar-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-recent li,
.sidebar-box ul li {
    padding: 12px 0;
    border-bottom: 1px solid var(--bg-mid);
}

.sidebar-recent li:last-child,
.sidebar-box ul li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.sidebar-recent li:first-child,
.sidebar-box ul li:first-child {
    padding-top: 0;
}

.sidebar-recent a,
.sidebar-box ul li a {
    color: var(--secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.4;
    display: block;
    margin-bottom: 4px;
}

.sidebar-recent a:hover,
.sidebar-box ul li a:hover {
    color: var(--primary);
}

.sidebar-recent__date {
    font-size: 12px;
    color: var(--text-light);
}

/* ==========================================================================
   BLOG / HOME / ARCHIVE
   ========================================================================== */
.blog-wrapper {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 40px 20px;
}

.blog-hero {
    margin-bottom: 30px;
    text-align: center;
    padding: 40px 20px;
    background: var(--bg-soft);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.blog-hero h1 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    margin-bottom: 12px;
    color: var(--secondary);
}

.blog-hero p {
    color: var(--text-light);
    font-size: 1.0625rem;
    max-width: 600px;
    margin: 0 auto;
}

.blog-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
}

.blog-main {
    min-width: 0;
}

.blog-card {
    background: #fff;
    padding: 20px;
    border-radius: var(--radius);
    margin-bottom: 25px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.blog-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.blog-card img {
    width: 100%;
    border-radius: 10px;
    margin-bottom: 15px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.blog-card-thumb {
    display: block;
}

.blog-card-content {
    padding: 0 4px;
}

.blog-meta {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.blog-title {
    font-size: 1.4rem;
    line-height: 1.3;
    margin: 0 0 12px;
}

.blog-title a {
    text-decoration: none;
    color: var(--secondary);
}

.blog-title a:hover {
    color: var(--primary);
}

.blog-excerpt {
    color: var(--text-soft);
    margin-bottom: 14px;
    line-height: 1.65;
}

.blog-read {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.blog-read:hover {
    color: var(--accent-dark);
}

.blog-sidebar {
    position: sticky;
    top: 20px;
    align-self: start;
}

/* Pagination */
.blog-pagination,
.navigation.pagination,
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.5rem 0 0;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.page-numbers {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
    background: #fff;
    transition: var(--transition);
}

.page-numbers:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.page-numbers.current {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.no-results {
    text-align: center;
    padding: 4rem 1.5rem;
    color: var(--text-light);
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

/* ==========================================================================
   BOUTONS GÉNÉRIQUES
   ========================================================================== */
.btn,
.button,
.wp-block-button__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    background: var(--primary);
    color: #fff !important;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    line-height: 1.2;
    font-family: inherit;
}

.btn:hover,
.button:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    color: #fff !important;
}

/* ==========================================================================
   WOOCOMMERCE - PRODUIT
   ========================================================================== */
.product-page {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 40px 20px 60px;
}

.product-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: start;
}

.product-gallery img {
    width: 100%;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.product-summary h1 {
    font-size: 36px;
    font-weight: 800;
    margin: 0 0 16px;
    color: var(--secondary);
    line-height: 1.2;
}

.product-summary .price {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary);
    margin: 0 0 20px;
    display: block;
}

.product-summary .price del {
    color: var(--text-light);
    font-size: 20px;
    margin-right: 10px;
    opacity: 0.7;
    font-weight: 500;
}

.product-summary .price ins {
    text-decoration: none;
    background: transparent;
}

.product-summary .description,
.product-summary .woocommerce-product-details__short-description {
    color: var(--text-soft);
    font-size: 16px;
    line-height: 1.7;
    margin-bottom: 24px;
}

.product-summary form.cart {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 24px;
    padding: 20px;
    background: var(--bg-soft);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    flex-wrap: wrap;
}

.product-summary .quantity input {
    width: 80px;
    padding: 12px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    text-align: center;
    font-weight: 600;
    background: #fff;
    font-family: inherit;
}

.product-summary .single_add_to_cart_button {
    flex: 1;
    min-width: 200px;
    padding: 16px 28px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    background: var(--accent) !important;
    color: #fff !important;
    border: none !important;
    border-radius: var(--radius-sm) !important;
    cursor: pointer;
    transition: background 0.2s ease;
}

.product-summary .single_add_to_cart_button:hover {
    background: var(--accent-dark) !important;
}

/* Trust badges */
.product-trust {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 18px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.product-trust__item {
    text-align: center;
    font-size: 13px;
    color: var(--text-light);
    font-weight: 500;
}

.product-trust__icon {
    font-size: 22px;
    margin-bottom: 4px;
    display: block;
}

.product_meta {
    font-size: 14px;
    color: var(--text-light);
}

@media (max-width: 768px) {
    .product-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .product-summary h1 {
        font-size: 28px;
    }
    .product-summary .price {
        font-size: 26px;
    }
}

/* ==========================================================================
   WOOCOMMERCE - PANIER
   ========================================================================== */
.cart-wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px 60px;
}

.cart-wrap h1 {
    margin-bottom: 30px;
    text-align: center;
    font-size: 36px;
    font-weight: 800;
}

.shop_table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.shop_table th,
.shop_table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.shop_table th {
    background: var(--bg-soft);
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--secondary);
}

.cart_item img {
    width: 64px;
    height: auto;
    border-radius: var(--radius-sm);
}

.cart_item .product-name a {
    color: var(--secondary);
    font-weight: 600;
}

.cart_item .product-name a:hover {
    color: var(--primary);
}

.shop_table .actions {
    padding: 20px 16px;
    background: var(--bg-soft);
}

.shop_table .actions input[type="text"] {
    padding: 10px 14px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-right: 8px;
    font-family: inherit;
}

.cart-collaterals {
    margin-top: 30px;
    padding: 24px;
    background: var(--bg-soft);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.cart-collaterals h2 {
    font-size: 20px;
    margin: 0 0 16px;
}

.cart-collaterals .checkout-button,
.cart-collaterals .wc-proceed-to-checkout a {
    display: block;
    width: 100%;
    text-align: center;
    padding: 16px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    margin-top: 16px;
    background: var(--accent) !important;
    color: #fff !important;
    border-radius: var(--radius-sm) !important;
    text-decoration: none;
    border: none !important;
    transition: background 0.2s ease;
}

.cart-collaterals .checkout-button:hover,
.cart-collaterals .wc-proceed-to-checkout a:hover {
    background: var(--accent-dark) !important;
}

.cart-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
    font-size: 18px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

/* ==========================================================================
   WOOCOMMERCE - CHECKOUT
   ========================================================================== */
.checkout-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 20px 60px;
}

.checkout-wrap h1 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 36px;
    font-weight: 800;
}

.checkout-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 40px;
    align-items: start;
}

.checkout-form-section h3 {
    font-size: 18px;
    padding-bottom: 12px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.woocommerce form .form-row {
    margin-bottom: 14px;
}

.woocommerce form .form-row label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}

.woocommerce form .form-row input,
.woocommerce form .form-row select,
.woocommerce form .form-row textarea,
.woocommerce form .form-row .select2-selection {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    font-size: 15px;
    transition: var(--transition);
    font-family: inherit;
    background: #fff;
}

.woocommerce form .form-row input:focus,
.woocommerce form .form-row select:focus,
.woocommerce form .form-row textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

.checkout-summary {
    position: sticky;
    top: 20px;
    padding: 24px;
    background: var(--bg-soft);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.checkout-summary h3 {
    margin: 0 0 20px;
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary);
    display: inline-block;
}

.checkout-summary table.shop_table {
    box-shadow: none;
    background: transparent;
}

.checkout-summary table.shop_table th,
.checkout-summary table.shop_table td {
    padding: 12px 0;
    background: transparent;
}

#place_order {
    width: 100%;
    padding: 16px !important;
    font-size: 17px !important;
    font-weight: 700 !important;
    background: var(--accent) !important;
    color: #fff !important;
    border: none !important;
    border-radius: var(--radius-sm) !important;
    margin-top: 16px;
    cursor: pointer;
    transition: background 0.2s ease;
}

#place_order:hover {
    background: var(--accent-dark) !important;
}

.checkout-trust-badges {
    margin-top: 16px;
    text-align: center;
    font-size: 13px;
    color: var(--text-light);
    padding: 12px;
    background: #fff;
    border-radius: var(--radius-sm);
}

@media (max-width: 768px) {
    .checkout-grid {
        grid-template-columns: 1fr;
    }
    .checkout-summary {
        position: static;
    }
}

/* ==========================================================================
   WOOCOMMERCE MESSAGES
   ========================================================================== */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    list-style: none;
    font-size: 14px;
}

.woocommerce-message {
    background: #ecfdf5;
    color: #065f46;
    border-left: 4px solid var(--primary);
}

.woocommerce-info {
    background: #eff6ff;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

.woocommerce-error {
    background: #fef2f2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 900px) {
    .single-layout,
    .blog-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .blog-sidebar {
        position: static;
    }

    .single-hero {
        padding: 40px 15px 30px;
        margin-bottom: 35px;
    }

    .single-hero__title {
        font-size: 30px;
    }

    .single-hero__meta {
        gap: 12px;
        font-size: 14px;
    }

    .single-article__content {
        font-size: 16px;
    }

    .single-article__content h2 {
        font-size: 24px;
    }

    .single-article__content h3 {
        font-size: 20px;
    }

    .single-cta {
        padding: 30px 20px;
    }

    .single-cta__title {
        font-size: 22px;
    }
}

@media (max-width: 600px) {
    .single-post-wrapper,
    .blog-wrapper {
        padding-left: 15px;
        padding-right: 15px;
    }

    .single-hero__title {
        font-size: 26px;
    }

    .cart-wrap h1,
    .checkout-wrap h1 {
        font-size: 26px;
    }

    .shop_table thead {
        display: none;
    }

    .shop_table tr {
        display: block;
        margin-bottom: 16px;
        border: 1px solid var(--border);
        border-radius: var(--radius-sm);
        padding: 8px;
    }

    .shop_table td {
        display: block;
        text-align: right;
        padding: 8px 12px;
        border-bottom: 1px solid var(--bg-mid);
    }

    .shop_table td:before {
        content: attr(data-title) ": ";
        float: left;
        font-weight: 600;
        color: var(--secondary);
    }

    .shop_table td:last-child {
        border-bottom: none;
    }
}
