/* =========================================================
   BASE
========================================================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
    color: var(--text);
    background-color: var(--bg);
    background-image: var(--site-page-bg);
}

img {
    max-width: 100%;
    height: auto;
}

/* Standard content wrapper */
.site-main {
    position: relative;
    padding-top: var(--headerH);
    background: var(--bg);
    min-height: 50vh;
}

.site-main > .container {
    padding-top: 24px;
    padding-bottom: 24px;
}

a {
    color: inherit;
    text-decoration: none;
}

/* =========================================================
   PAGE SHELL / BACKGROUND HANDOFF
========================================================= */

/* Page templates and supported singles share homepage body background */
body[class*="page-template-page-"],
body.single-gallery_event,
body.single-tribe_events {
    background-color: var(--bg);
    background-image: var(--site-page-bg);
}

/* Keep content area on the same base surface */
body[class*="page-template-page-"] .site-main,
body.single-gallery_event .site-main,
body.single-tribe_events .site-main {
    background-color: var(--bg);
    background-image: none;
    margin-bottom: 0;
    padding-bottom: 0;
    position: relative;
}

/* Prevent footer seam on page templates */
body[class*="page-template-page-"] .site-footer {
    margin-top: 0;
}

/* Prevent trailing child margins from creating a visible seam */
body[class*="page-template-page-"] .site-main > *:last-child,
body[class*="page-template-page-"] .site-main > article:last-child,
body[class*="page-template-page-"] .site-main > section:last-child,
body[class*="page-template-page-"] .site-main > div:last-child {
    margin-bottom: 0;
}
