/*
Theme Name: Base47 Nexus
Theme URI: https://base47.art/nexus-theme/
Author: Stefan Gold
Author URI: https://base47.art
Description: A lightweight WordPress theme designed for flexible layouts and modern page builders. Includes Canvas Mode for creating fully custom pages without theme layout restrictions.
Version: 4.0.3
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: base47-nexus
Copyright: © 2026 Stefan Gold / Base47
Tags: blog, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
Requires at least: 5.0
Tested up to: 6.9
Requires PHP: 7.4
*/

/* ------------------------------------
   1. BASE RESET (safe + minimal)
   Applied to ALL pages
------------------------------------ */

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

/* Safe global box-sizing for all pages */
* {
    box-sizing: border-box;
}

/* 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;
}

/* ------------------------------------
   2. ACCESSIBILITY - Skip Link
   WCAG compliant skip-to-content link
------------------------------------ */

.skip-link,
.screen-reader-text {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

.skip-link:focus {
    position: fixed;
    left: 16px;
    top: 16px;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
    z-index: 100000;
    padding: 12px 16px;
    background: #fff;
    color: #111;
    border: 2px solid #ff4d00;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ------------------------------------
   3. CANVAS/APP MODE - Layout Control
   Scoped to canvas/app pages ONLY
------------------------------------ */

body.base47-canvas,
body.base47-app-shell {
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden;
}

/* Canvas/App mode: Remove WordPress layout interference - target specific wrappers */
body.base47-app-shell #page,
body.base47-app-shell .base47-site,
body.base47-app-shell .site-main,
body.base47-app-shell .entry-content,
body.base47-app-shell #base47-main,
body.base47-app-shell .b47-main,
body.base47-canvas #page,
body.base47-canvas .base47-site,
body.base47-canvas .site-main,
body.base47-canvas .entry-content,
body.base47-canvas #base47-main,
body.base47-canvas .b47-main {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* Canvas/App mode: Remove Base47 container padding */
body.base47-canvas .b47-container,
body.base47-canvas .b47-page-inner,
body.base47-app-shell .b47-container,
body.base47-app-shell .b47-page-inner {
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
}

/* ------------------------------------
   4. MOBILE-SPECIFIC FIXES
   Scoped to canvas/app mode ONLY
------------------------------------ */

@media (max-width: 768px) {
    /* Canvas/App mode: Remove WordPress button styling */
    body.base47-app-shell .wp-block-button__link,
    body.base47-app-shell .wp-block-file__button,
    body.base47-canvas .wp-block-button__link,
    body.base47-canvas .wp-block-file__button {
        all: unset !important;
    }
    
    /* Canvas/App mode: Fix WordPress-added padding on mobile */
    body.base47-app-shell.page,
    body.base47-app-shell.single,
    body.base47-app-shell.home,
    body.base47-canvas.page,
    body.base47-canvas.single,
    body.base47-canvas.home {
        padding: 0 !important;
        margin: 0 !important;
    }
    
    /* Canvas/App mode: First section spacing fix */
    body.base47-app-shell #page,
    body.base47-app-shell .entry-content,
    body.base47-canvas #page,
    body.base47-canvas .entry-content {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
}

/* ------------------------------------
   5. MOBILE SAFARI HEIGHT FIX
------------------------------------ */

:root {
    --vh: 1vh;
}

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

/* ------------------------------------
   6. SCROLL-TO-TOP BUTTON STYLING
------------------------------------ */

.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: #ff4d00;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(255, 77, 0, 0.3);
}

.scroll-to-top:hover {
    background-color: #e63900;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 77, 0, 0.4);
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top i {
    font-size: 18px;
}

/* Hide scroll-to-top on Canvas Mode pages */
body.base47-canvas .scroll-to-top,
body.base47-app-shell .scroll-to-top {
    display: none !important;
}

@media (max-width: 768px) {
    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
    
    .scroll-to-top i {
        font-size: 16px;
    }
}

/* ------------------------------------
   7. WORDPRESS ALIGNMENT CLASSES
   Required by Theme Check
------------------------------------ */

.alignleft {
	float: left;
	margin-right: 1.5em;
}

.alignright {
	float: right;
	margin-left: 1.5em;
}

.aligncenter {
	display: block;
	margin-left: auto;
	margin-right: auto;
}

.wp-caption {
	max-width: 100%;
}

.wp-caption-text {
	font-size: 0.875em;
	text-align: center;
}

.gallery-caption {
	font-size: 0.875em;
}

.bypostauthor {
	/* Intentionally empty — required by Theme Check */
}

/* ------------------------------------
   8. PAGE LINKS
------------------------------------ */

.page-links {
	clear: both;
	margin: 1.5em 0;
	font-size: 0.9em;
}
