/*
Theme Name: Momentum Blocks
Theme URI: https://momentumplanning.com.au
Description: Custom block theme for Momentum Planning with full visual control
Author: Momentum Planning
Version: 1.0.1
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: Private
Text Domain: momentum-blocks

This theme uses custom Gutenberg blocks with React editors for complete
control over HTML output and visual editing experience.
*/

/* CSS Custom Properties - Design Tokens */
:root {
    --gold: #fbb034;
    --gold-light: #fef8ed;
    --gold-dark: #e9a020;
    --dark-text: #1A202C;
    --gray: #4A5568;
    --gray-light: #718096;
    --light-bg: #FAFAFA;
    --white: #FFFFFF;
    --navy: #0B2545;
    --border: #E2E8F0;
}

/* Base Typography */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--dark-text);
    line-height: 1.7;
    background: var(--white);
    margin: 0;
    padding: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    margin: 0;
}

* {
    box-sizing: border-box;
}

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

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

/* Button Styles */
.btn {
    background: var(--gold);
    color: var(--dark-text);
    padding: 0.875rem 1.75rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-block;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background: var(--gold-dark);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--border);
    color: var(--dark-text);
}

.btn-outline:hover {
    border-color: var(--gold);
    background: transparent;
}

.btn-dark {
    background: var(--navy);
    color: var(--white);
}

.btn-dark:hover {
    background: #13315C;
}

/* General Advice Warning - Contained Box */
.footer-warning {
    background: rgba(255,255,255,0.08) !important;
    padding: 1.25rem 1.5rem !important;
    border-radius: 8px !important;
    font-size: 0.8125rem !important;
    line-height: 1.6 !important;
    margin: 0 auto 2.5rem !important;
    max-width: calc(1200px - 3rem) !important;
    color: rgba(255,255,255,0.75) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
}

.footer-warning strong {
    color: rgba(255,255,255,0.95) !important;
}


/* ============================================================
   Mobile overflow safety
   Author: Momentum Planning team
   Purpose: prevent horizontal scroll on phone-width viewports
            without affecting the desktop layout (>=769px).
   ============================================================ */

/* Safety net: never allow horizontal scrolling at the document level.
   `overflow-x: clip` is preferred to `hidden` — it doesn't break
   `position: sticky` descendants the way `hidden` does. */
html,
body {
    overflow-x: clip;
}

/* Common cause of mobile overflow: media and embeds carrying their
   intrinsic width into a narrow viewport. Force them to fit. */
img,
video,
iframe,
embed,
object,
table,
pre,
code {
    max-width: 100%;
}

/* Prevent long unbroken strings (URLs, emails) from forcing layout wide */
.entry-content,
.site-footer,
.hero p,
p,
li,
h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* ----------------------------------------------------------------
   Mobile-only structural fixes (everything inside this block is
   gated to <=768px, so desktop layout is untouched).
   ---------------------------------------------------------------- */
@media (max-width: 768px) {

    /* CSS Grid + Flex children inherit `min-width: min-content`,
       which causes long content to expand the track and overflow
       the parent. Override on the specific layout containers we
       know about so content can shrink to fit. */
    .footer-content > *,
    .footer-content > * > *,
    .hero-content > *,
    .services-grid > *,
    .testimonials-grid > *,
    .team-grid > *,
    .value-props > *,
    .two-column > * {
        min-width: 0;
    }

    /* Footer was the primary offender: a 4-column desktop grid
       collapsed to 1fr 1fr but the brand paragraph forced the
       first track to ~253px, pushing total width past viewport. */
    .footer-content {
        grid-template-columns: 1fr 1fr !important;
    }
    .footer-brand,
    .footer-bottom {
        grid-column: 1 / -1;
        min-width: 0;
    }
    .footer-brand p,
    .footer-links li,
    .footer-links a {
        min-width: 0;
        overflow-wrap: anywhere;
    }
    /* The contact email is long enough to push the footer wide; let it
       wrap aggressively on mobile. */
    .footer-links a[href^="mailto:"] {
        word-break: break-all;
    }

    /* Reduce header/footer gutter on phones so the visible content
       gets more room without hugging the edge. */
    .footer-inner {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    /* Hero blocks: prevent the columned hero layout from exceeding
       the viewport when the headline contains long words. */
    .hero,
    .hero-content,
    .hero-text {
        min-width: 0;
        max-width: 100%;
    }
    .hero-text h1 {
        overflow-wrap: anywhere;
    }
}

/* ----------------------------------------------------------------
   Very-narrow phones (320–360px) — extra safety for old / small
   devices. Still no impact on desktop.
   ---------------------------------------------------------------- */
@media (max-width: 380px) {
    .footer-inner {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    .footer-content {
        gap: 1.5rem;
    }
}

/* Long email/URL strings in page body (e.g. contact card email) — break across lines on mobile so they don't push layout wide. */
@media (max-width: 768px) {
    a[href^="mailto:"],
    a[href^="tel:"],
    .contact-detail-card,
    .contact-detail-card * {
        overflow-wrap: anywhere;
        word-break: break-word;
    }
}

/* Contact page: email card has long unbreakable address pushing flex parent wide */
@media (max-width: 768px) {
    .contact-details-content {
        flex-wrap: wrap;
    }
    .contact-detail-card {
        min-width: 0 !important;
        max-width: 100%;
        flex: 1 1 100%;
    }
    .contact-detail-card a {
        word-break: break-all;
        overflow-wrap: anywhere;
        max-width: 100%;
        display: inline-block;
    }
}
