/*
Theme Name: Base47 Theme
Theme URI: https://47-studio.com
Author: Stefan Gold
Author URI: https://47-studio.com
Description: Minimal shell theme for Mivon HTML templates.
Version: 2.0.0
Text Domain: base47-theme
Update URI: https://api.github.com/repos/stefangoldltd-sudo/base47-theme
*/

/* ------------------------------------
   1. BASE RESET (safe + minimal)
------------------------------------ */

html, body {
    margin: 0;
    padding: 0;
}

/* Allow templates to manage spacing */
.entry-content {
    margin: 0 !important;
    padding: 0 !important;
}

/* Media should behave but not change layout */
img, video, picture, canvas {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Optional basic anchor behavior */
a {
    color: inherit;
    text-decoration: none;
}

/* Accessibility skip link */
.skip-link {
    position: absolute;
    left: -9999px;
}

/* ------------------------------------
   2. STOP WORDPRESS / THEMES 
      from adding layout interference
------------------------------------ */

#page,
.site,
.site-main,
.entry-content,
.wp-site-blocks,
main,
#base47-main,
article,
.post,
.page {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Remove all browser-added whitespace */
* {
    box-sizing: border-box;
}

/* ------------------------------------
   3. FULL MOBILE SAFARI HEIGHT FIX
------------------------------------ */

:root {
    --vh: 1vh;
}

@media (max-width: 768px) {
    html, body {
        height: auto !important;
    }
}

/* ------------------------------------
   4. DO NOT TOUCH SECTION / CONTAINER 
      PADDING OR TYPOGRAPHY ON MOBILE
------------------------------------ */

/* Nothing here — templates must be untouched */

/* ------------------------------------
   4.5 CANVAS MODE (Like Elementor Canvas)
   Pure HTML - Zero WordPress interference
------------------------------------ */

body.base47-canvas {
    margin: 0 !important;
    padding: 0 !important;
}

body.base47-canvas * {
    /* Let Mivon templates control everything */
    box-sizing: border-box;
}

/* ----
--------------------------------
   5. MOBILE-SPECIFIC FIXES (v1.6.0)
   Block WordPress button styles that override Mivon
------------------------------------ */

@media (max-width: 768px) {
    /* Force remove any WordPress button styling */
    .wp-block-button__link,
    .wp-block-file__button {
        all: unset !important;
    }
    
    /* Ensure Mivon containers work on mobile */
    .container,
    .row,
    section {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    /* Fix any WordPress-added padding on mobile */
    body.page,
    body.single,
    body.home {
        padding: 0 !important;
        margin: 0 !important;
    }
    
    /* FIX: First section always broken - kill ALL wrappers */
    body > *:not(script):not(style),
    #page,
    main,
    article,
    .entry-content > *:first-child,
    section:first-of-type,
    .header,
    header {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
    
    /* Ensure first Mivon section displays correctly */
    body {
        overflow-x: hidden !important;
    }
}
