/**
 * Widget Creator Universal Layout – All static styling migrated here
 * Version: 1.2.3 (2026-07-23 – Table containment on mobile)
 * Last modified: 2026-07-23
 *
 * CLEAN ARCHITECTURE NOTES:
 * - This file contains ONLY structural, layout, and variant modifier styles.
 * - All colors, typography, and design tokens MUST be defined in the child theme's
 *   assets/css/base/variables.css and referenced via CSS custom properties (var(--...)).
 * - No hardcoded colors, fonts (except intentional system-serif fallback for product number),
 *   or spacing values that are not already expressed as design tokens or deliberate structural constants.
 * - Border styles were migrated from universal-layout.html.twig so Twig remains
 *   a 100 % pure structural renderer.
 *
 * PHASE 1 (v1.2.1) – Dual border system is intentional and documented:
 *   1. Outer box          → registry class (wce-border-*)
 *      Emitted by Twig as border_style_class (Control Options Registry).
 *   2. Inner T-shape      → structural class (border-style-*)
 *      Emitted by Twig only when border_style ≠ "none".
 *      Required by the pros/cons below-split visual.
 * Both families must stay until a future single-class migration is coordinated
 * with the Control Options Registry and design-system tokens.
 *
 * v1.2.2 – Root + flex containment (mobile right overflow)
 * v1.2.3 – Table / html-field containment (scroll inside padded parent)
 */

.wce-universal-layout {
    --wce-desktop: 1280px;
    --wce-tablet: 1024px;
    --wce-mobile: 767px;

    /* Contain within parent padding box – fixes mobile right overflow */
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* ==========================================
   NEW SEMANTIC LAYOUT CLASSES (Phase 15/5/1)
   ========================================== */
.wce-split-col {
    flex: 1 1 50%;
    min-width: 0;
    box-sizing: border-box;
}

.wce-col-pad {
    padding: 24px;
}

@media (max-width: 1024px) {
    .wce-col-pad {
        padding: 20px;
    }
}

@media (max-width: 767px) {
    .wce-col-pad {
        padding: 16px;
    }
}

/* ==========================================
   EXISTING STYLES (unchanged behaviour)
   ========================================== */
.wce-universal-layout .wce-image-left-split,
.wce-universal-layout .wce-below-split {
    display: flex !important;
    flex-direction: column !important;
}

@media (min-width: 768px) {
    .wce-universal-layout .wce-image-left-split,
    .wce-universal-layout .wce-below-split {
        flex-direction: row !important;
    }
}

.wce-image-left-split__image-column,
.wce-image-left-split__right-column,
.wce-below-split > div {
    flex: 1;
    min-width: 0; /* allow flex children to shrink – prevents overflow */
    box-sizing: border-box;
}

.wce-image-left-split__image-column {
    aspect-ratio: 1 / 1;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 1rem;
}

.wce-product-image {
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    display: block;
}

.wce-buttons-group {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 1.25rem 0 0.5rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.wce-buttons-group .wce-button {
    width: 100%;
    max-width: 100%;
    justify-content: center;
    box-sizing: border-box;
}

/* ==========================================
   PRODUCT NUMBER STYLES
   (Pure token colours – visual result identical)
   ========================================== */
.wce-product-number {
    display: inline-block;
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 400;
    line-height: 1;
}

.wce-product-number--filled {
    font-size: 3rem;
    background: var(--color-charcoal);
    color: var(--color-white);
    padding: 0.5rem 1rem;
    border: none;
}

/* ==========================================
   PADDING SYSTEM
   ========================================== */
.wce-box-pad {
    padding: 24px;
    box-sizing: border-box;
}

.wce-content-wrapper {
    padding: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.wce-below-single {
    padding-top: 24px;
}

/* ==========================================
   TABLES – mobile containment
   Wrapper stays inside parent padding;
   wide tables scroll horizontally inside.
   ========================================== */
.wce-universal-layout .wce-html-field,
.wce-universal-layout .wce-table-responsive {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

.wce-universal-layout .wce-html-field table,
.wce-universal-layout .wce-table-responsive table,
.wce-universal-layout table.wce-table,
.wce-universal-layout table.wce-table-structured {
    width: 100%;
    max-width: none; /* allow intrinsic width for scroll */
    box-sizing: border-box;
}

.wce-universal-layout .wce-html-field table {
    margin: 16px 0;
}

/* ==========================================
   DISABLE HORIZONTAL PADDING (Phase 17/5/1)
   ========================================== */
/* Applied when "Remove side padding" is checked in Step 2 for single-box / split-box */
.wce-no-horizontal-padding {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Ensure inner columns also lose horizontal padding
   (split-box + single-box + image-split right column) */
.wce-no-horizontal-padding .wce-col-pad,
.wce-no-horizontal-padding .wce-content-wrapper {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* ==========================================
   BORDER STYLES – DUAL SYSTEM (Phase 1)
   ==========================================
   1. Outer box (registry-driven)
      Classes: .wce-border-1 | .wce-border-2 | .wce-border-transparent
      Emitted by Twig as border_style_class.
      Rules live in design-system.css (and any future token overrides).

   2. Inner T-shape dividers (structural)
      Classes: .border-style-1 | .border-style-2
      Emitted by Twig only when border_style ≠ "none".
      Required for the pros/cons below-split visual.
      Colour via design-system token --color-border-gray.
   ========================================== */

/* Top border on pros/cons columns in below-split */
.wce-below-split .wce-split-col.border-style-1,
.wce-below-split .wce-col-pad.border-style-1 {
    border-top: 1px solid var(--color-border-gray) !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: none !important;
    box-sizing: border-box;
}

.wce-below-split .wce-split-col.border-style-2,
.wce-below-split .wce-col-pad.border-style-2 {
    border-top: 1px solid var(--color-border-gray) !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: none !important;
    box-sizing: border-box;
}

/* Vertical divider between PROS and CONS columns (first child) */
.wce-below-split .wce-split-col.border-style-1:first-child,
.wce-below-split .wce-col-pad.border-style-1:first-child {
    border-right: 1px solid var(--color-border-gray) !important;
}

.wce-below-split .wce-split-col.border-style-2:first-child,
.wce-below-split .wce-col-pad.border-style-2:first-child {
    border-right: 1px solid var(--color-border-gray) !important;
}

/* Minimal fallback for other containers using border-style classes
   (kept for compatibility with current Twig output) */
.border-style-1,
.wce-split-col.border-style-1,
.wce-col-pad.border-style-1 {
    border: 1px solid var(--color-border-gray) !important;
    box-sizing: border-box;
}

.border-style-2,
.wce-split-col.border-style-2,
.wce-col-pad.border-style-2 {
    border: 1px solid var(--color-border-gray) !important;
    box-sizing: border-box;
}