/* ==========================================================================
   CUSTOM LAYOUT FOR: Page Without Title Template
   Target: body.page-template-page-no-title
   ========================================================================== */

/* 1. CONTAINER RESET
   We must force the theme's wrapper to be 100% wide so "Full Width" blocks
   have room to expand. We use !important to override the theme's original style.css.
*/
body.page-template-page-no-title .site-main,
body.page-template-page-no-title .entry-content {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow-x: hidden; /* Prevents horizontal scrollbar issues */
}

/* 2. DEFAULT CONTENT LOGIC (Standard Blocks)
   This mimics your theme.json "contentSize": "645px".
   It centers paragraphs, headings, lists, etc.
   'box-sizing' ensures padding doesn't make the 645px wider.
*/
body.page-template-page-no-title .entry-content > * {
    max-width: 645px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px; /* Keeps text off the edge on mobile screens */
    padding-right: 20px;
    box-sizing: border-box; 
}

/* 3. WIDE WIDTH LOGIC
   This mimics your theme.json "wideSize": "1340px".
   Targeting .alignwide class generated by WordPress.
*/
body.page-template-page-no-title .entry-content > .alignwide {
    max-width: 1340px !important;
    width: 100%;
    /* Note: We keep auto margins from section 2 so it stays centered */
}

/* 4. FULL WIDTH LOGIC
   Forces the block to span edge-to-edge.
   Targeting .alignfull class generated by WordPress.
*/
body.page-template-page-no-title .entry-content > .alignfull {
    max-width: 100% !important;
    width: 100%;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* 5. EXCEPTIONS & CLEANUP 
   Some blocks need special treatment to not look broken.
*/

/* Images: Ensure they don't overflow if they aren't wide/full */
body.page-template-page-no-title .entry-content > figure img,
body.page-template-page-no-title .entry-content > p img {
    height: auto;
    max-width: 100%;
}

/* Left/Right Aligned Images: Allow text wrapping */
body.page-template-page-no-title .entry-content > .alignleft {
    float: left;
    margin-right: 1.5em;
    max-width: 50%; /* Prevent massive images from breaking flow */
}

body.page-template-page-no-title .entry-content > .alignright {
    float: right;
    margin-left: 1.5em;
    max-width: 50%;
}

/* Clear floats to prevent layout crashes */
body.page-template-page-no-title .entry-content::after {
    content: "";
    display: table;
    clear: both;
}