/*
 * Centrale Product Content Stylesheet v2
 *
 * Shared between Django admin (CKEditor preview) and WordPress frontend.
 * Uses `all: initial` to create a CSS isolation boundary — no external
 * styles (theme, plugins, admin) can leak into product content.
 *
 * To deploy on WordPress:
 *   1. Copy to flatsome-child/assets/css/product_content.css
 *   2. Enqueue in functions.php:
 *      wp_enqueue_style('centrale-product-content',
 *          get_stylesheet_directory_uri() . '/assets/css/product_content.css');
 */

/* ═══════════════════════════════════════════
   Isolation boundary
   ═══════════════════════════════════════════ */
.centrale-product-content {
    all: initial;
    display: block;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.7;
    color: #374151;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ═══════════════════════════════════════════
   Product title (not a heading — WooCommerce handles h1/h2)
   ═══════════════════════════════════════════ */
.centrale-product-content #centrale_description_product_title {
    font-size: 1.25em;
    margin: 0 0 0.8em;
    padding: 0;
    line-height: 1.35;
    color: #111827;
}

/* ═══════════════════════════════════════════
   Headings — clear hierarchy with accent color
   ═══════════════════════════════════════════ */
.centrale-product-content h2 {
    display: block;
    font-size: 1.5em;
    font-weight: 700;
    margin: 1.2em 0 0.5em;
    padding: 0 0 0.3em;
    color: #111827;
    line-height: 1.3;
    letter-spacing: -0.01em;
    border-bottom: 2px solid #e5e7eb;
}

.centrale-product-content h2:first-child {
    margin-top: 0;
}

.centrale-product-content h3 {
    display: block;
    font-size: 1.2em;
    font-weight: 600;
    margin: 1.1em 0 0.4em;
    padding: 0;
    color: #1f2937;
    line-height: 1.35;
    letter-spacing: -0.005em;
}

.centrale-product-content h4 {
    display: block;
    font-size: 1.05em;
    font-weight: 600;
    margin: 1em 0 0.3em;
    padding: 0;
    color: #374151;
    line-height: 1.35;
}

.centrale-product-content h5,
.centrale-product-content h6 {
    display: block;
    font-size: 0.95em;
    font-weight: 600;
    margin: 0.8em 0 0.3em;
    padding: 0;
    color: #4b5563;
    line-height: 1.35;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ═══════════════════════════════════════════
   Paragraphs and inline text
   ═══════════════════════════════════════════ */
.centrale-product-content p {
    display: block;
    margin: 0.6em 0;
    padding: 0;
}

.centrale-product-content div {
    display: block;
    margin: 0;
    padding: 0;
}

.centrale-product-content strong,
.centrale-product-content b {
    font-weight: 600;
    color: #1f2937;
}

.centrale-product-content em,
.centrale-product-content i {
    font-style: italic;
}

.centrale-product-content br {
    display: block;
}

.centrale-product-content span {
    display: inline;
}

/* ═══════════════════════════════════════════
   Lists — clean spacing, subtle markers
   ═══════════════════════════════════════════ */
.centrale-product-content ul,
.centrale-product-content ol {
    display: block;
    margin: 0.6em 0;
    padding: 0 0 0 1.6em;
}

.centrale-product-content ul {
    list-style-type: disc;
}

.centrale-product-content ol {
    list-style-type: decimal;
}

.centrale-product-content li {
    display: list-item;
    margin: 0.35em 0;
    padding: 0 0 0 0.3em;
    line-height: 1.6;
}

.centrale-product-content li::marker {
    color: #9ca3af;
}

.centrale-product-content ol li::marker {
    color: #6b7280;
    font-weight: 600;
}

/* Nested lists */
.centrale-product-content li ul,
.centrale-product-content li ol {
    margin: 0.2em 0;
}

/* ═══════════════════════════════════════════
   Tables — modern, clean, professional
   ═══════════════════════════════════════════ */
.centrale-product-content table {
    display: table;
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
    padding: 0;
    font-size: 0.93em;
    table-layout: fixed;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
}

.centrale-product-content thead {
    display: table-header-group;
}

.centrale-product-content tbody {
    display: table-row-group;
}

.centrale-product-content tfoot {
    display: table-footer-group;
}

.centrale-product-content tr {
    display: table-row;
    transition: background-color 0.15s ease;
}

.centrale-product-content tbody tr:hover {
    background-color: #f0f4ff;
}

.centrale-product-content th,
.centrale-product-content td {
    display: table-cell;
    border: 1px solid #e5e7eb;
    padding: 10px 14px;
    text-align: left;
    vertical-align: top;
    word-wrap: break-word;
}

.centrale-product-content th {
    background-color: #f8fafc;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
    width: 35%;
    font-size: 0.92em;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* Header row in tables with thead */
.centrale-product-content thead th {
    background-color: #0076f1;
    color: #fff;
    font-weight: 600;
    font-size: 0.88em;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 10px 14px;
    border-color: #0076f1;
}

.centrale-product-content tr:nth-child(even) td {
    background-color: #f9fafb;
}

.centrale-product-content figure {
    display: block;
    margin: 0;
    padding: 0;
}

/* ═══════════════════════════════════════════
   Images
   ═══════════════════════════════════════════ */
.centrale-product-content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0.8em 0;
    padding: 0;
    border-radius: 4px;
}

/* ═══════════════════════════════════════════
   Links
   ═══════════════════════════════════════════ */
.centrale-product-content a {
    color: #2563eb;
    text-decoration: none;
    cursor: pointer;
    border-bottom: 1px solid transparent;
    transition: border-color 0.15s ease, color 0.15s ease;
}

.centrale-product-content a:hover {
    color: #1d4ed8;
    border-bottom-color: #1d4ed8;
}

/* ═══════════════════════════════════════════
   Blockquotes — accent bar + subtle background
   ═══════════════════════════════════════════ */
.centrale-product-content blockquote {
    display: block;
    margin: 1em 0;
    padding: 0.8em 1.2em;
    border-left: 4px solid #2563eb;
    background-color: #f0f4ff;
    color: #374151;
    border-radius: 0 4px 4px 0;
    font-style: italic;
}

.centrale-product-content blockquote p {
    margin: 0.3em 0;
}

/* ═══════════════════════════════════════════
   Code
   ═══════════════════════════════════════════ */
.centrale-product-content code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 0.88em;
    background-color: #f3f4f6;
    color: #dc2626;
    padding: 0.2em 0.45em;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
}

.centrale-product-content pre {
    display: block;
    background-color: #1f2937;
    color: #e5e7eb;
    padding: 1.2em;
    margin: 1em 0;
    overflow-x: auto;
    border-radius: 6px;
    font-size: 0.88em;
    line-height: 1.6;
}

.centrale-product-content pre code {
    background: none;
    color: inherit;
    padding: 0;
    border: none;
    font-size: 1em;
}

/* ═══════════════════════════════════════════
   Horizontal rule — subtle divider
   ═══════════════════════════════════════════ */
.centrale-product-content hr {
    display: block;
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 1.5em 0;
    padding: 0;
}

/* ═══════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
    .centrale-product-content {
        font-size: 14px;
    }

    .centrale-product-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .centrale-product-content th,
    .centrale-product-content td {
        padding: 8px 10px;
        font-size: 0.9em;
    }

    .centrale-product-content h2 {
        font-size: 1.3em;
    }

    .centrale-product-content h3 {
        font-size: 1.1em;
    }
}
