/**
 * AI Templates - Base Template Styles
 * Provides CSS reset and isolation for template content
 */

.ait-template-wrapper {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Full width override for common theme containers */
.ait-template-page .ait-template-wrapper {
    max-width: none;
    width: 100%;
}

/* Reset theme container constraints on ancestor elements
   of .ait-template-wrapper. Only target common WP content wrappers,
   NOT the main page layout containers that handle sidebar offsets.
   Elements in header/footer do NOT contain .ait-template-wrapper
   so they are never matched by :has(). */
.ait-template-page .ait-template-wrapper,
.ait-template-page .entry-content:has(.ait-template-wrapper),
.ait-template-page .post-content:has(.ait-template-wrapper),
.ait-template-page .page-content:has(.ait-template-wrapper),
.ait-template-page article:has(.ait-template-wrapper) {
    max-width: none !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Hide common theme elements on template pages */
.ait-template-page .page-title,
.ait-template-page .entry-title,
.ait-template-page .page-header,
.ait-template-page .entry-header {
    display: none;
}

/* Ensure images are responsive */
.ait-template-wrapper img {
    max-width: 100%;
    height: auto;
}

/* Reset box-sizing within template */
.ait-template-wrapper *,
.ait-template-wrapper *::before,
.ait-template-wrapper *::after {
    box-sizing: border-box;
}
