/*
Theme Name: Hope Money
Theme URI: https://hopemoney.uk
Author: Hope Money
Description: Custom theme for Hope Money - asset-backed income fund
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: Proprietary
Text Domain: hopemoney
*/

/* === CSS Variables === */
:root {
    --hm-navy: #002060;
    --hm-navy-light: #003090;
    --hm-navy-dark: #001540;
    --hm-orange: #ff5e1a;
    --hm-orange-hover: #e54e0a;
    --hm-white: #ffffff;
    --hm-light-grey: #f5f5f7;
    --hm-text: #333333;
    --hm-text-light: #666666;
    --hm-font-body: 'Nunito Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --hm-font-heading: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
    --hm-max-width: 1200px;
    --hm-content-width: 800px;
}

/* === Reset & Base === */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--hm-font-body);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--hm-text);
    background-color: var(--hm-white);
}

/* === Typography === */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--hm-font-heading);
    font-weight: 700;
    line-height: 1.2;
    margin-top: 0;
    color: var(--hm-navy);
}

h1 { font-size: 2.5rem; margin-bottom: 1rem; }
h2 { font-size: 2rem; margin-bottom: 0.8rem; }
h3 { font-size: 1.5rem; margin-bottom: 0.6rem; }
h4 { font-size: 1.25rem; margin-bottom: 0.5rem; }

p {
    margin-top: 0;
    margin-bottom: 1rem;
}

a {
    color: var(--hm-orange);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--hm-orange-hover);
}

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

/* === Layout === */
.site-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-content {
    flex: 1;
}

.container {
    max-width: var(--hm-max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.content-area {
    max-width: var(--hm-content-width);
    margin: 0 auto;
    padding: 3rem 2rem;
}

/* === Header === */
.site-header {
    background-color: var(--hm-navy);
    padding: 1rem 0;
    position: relative;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--hm-max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.site-branding {
    display: flex;
    align-items: center;
}

.site-title {
    margin: 0;
    font-family: var(--hm-font-heading);
    font-size: 1.8rem;
    font-weight: 700;
}

.site-title a {
    color: var(--hm-white);
    text-decoration: none;
}

.site-title a:hover {
    color: var(--hm-orange);
}

/* === Navigation === */
.main-navigation {
    display: flex;
    align-items: center;
}

.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 2rem;
}

.main-navigation a {
    color: var(--hm-white);
    font-family: var(--hm-font-body);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.2s ease;
}

.main-navigation a:hover,
.main-navigation .current-menu-item a {
    color: var(--hm-orange);
}

.main-navigation a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--hm-orange);
    transition: width 0.3s ease;
}

.main-navigation a:hover::after,
.main-navigation .current-menu-item a::after {
    width: 100%;
}

/* Mobile menu toggle */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--hm-white);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* === Footer === */
.site-footer {
    background-color: var(--hm-navy-dark);
    color: var(--hm-white);
    padding: 3rem 0 1.5rem;
}

.footer-content {
    max-width: var(--hm-max-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.footer-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-widget h3 {
    color: var(--hm-orange);
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.footer-widget a {
    color: rgba(255, 255, 255, 0.7);
}

.footer-widget a:hover {
    color: var(--hm-orange);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}

/* === WordPress Content Styles === */
.entry-header {
    margin-bottom: 2rem;
}

.entry-title {
    font-size: 2.5rem;
    color: var(--hm-navy);
}

.entry-content {
    font-size: 1.05rem;
    line-height: 1.8;
}

.entry-content > * {
    max-width: var(--hm-content-width);
    margin-left: auto;
    margin-right: auto;
}

.entry-content .alignwide {
    max-width: var(--hm-max-width);
}

.entry-content .alignfull {
    max-width: none;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
}

/* === Buttons (Gutenberg + general) === */
.wp-block-button__link,
.hm-button {
    background-color: var(--hm-orange);
    color: var(--hm-white) !important;
    font-family: var(--hm-font-body);
    font-weight: 700;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    display: inline-block;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.1s ease;
    font-size: 1rem;
}

.wp-block-button__link:hover,
.hm-button:hover {
    background-color: var(--hm-orange-hover);
    transform: translateY(-1px);
}

.wp-block-button.is-style-outline .wp-block-button__link {
    background: transparent;
    border: 2px solid var(--hm-orange);
    color: var(--hm-orange) !important;
}

.wp-block-button.is-style-outline .wp-block-button__link:hover {
    background-color: var(--hm-orange);
    color: var(--hm-white) !important;
}

/* === Gutenberg Block Styles === */
.wp-block-cover {
    min-height: 400px;
}

.wp-block-group.has-background {
    padding: 2rem;
    border-radius: 8px;
}

.wp-block-columns {
    gap: 2rem;
}

.wp-block-separator {
    border-color: var(--hm-orange);
    opacity: 0.3;
}

.wp-block-quote {
    border-left: 4px solid var(--hm-orange);
    padding-left: 1.5rem;
    font-style: italic;
    color: var(--hm-text-light);
}

/* === Tool Embed === */
.hopetool-embed {
    width: 100%;
    margin: 2rem 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.hopetool-embed iframe {
    width: 100%;
    border: none;
    min-height: 500px;
    display: block;
}

/* === Hero Section (for front page) === */
.hm-hero {
    background-color: var(--hm-navy);
    color: var(--hm-white);
    padding: 5rem 2rem;
    text-align: center;
}

.hm-hero h1 {
    color: var(--hm-white);
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hm-hero p {
    font-size: 1.25rem;
    opacity: 0.85;
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* === Cards === */
.hm-card {
    background: var(--hm-white);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hm-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

/* === Widget Area === */
.widget {
    margin-bottom: 2rem;
}

.widget-title {
    font-family: var(--hm-font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--hm-navy);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--hm-orange);
}

/* === Responsive === */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .main-navigation ul {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--hm-navy);
        flex-direction: column;
        padding: 1rem 2rem;
        gap: 0;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    }

    .main-navigation.toggled ul {
        display: flex;
    }

    .main-navigation li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .main-navigation a {
        display: block;
        padding: 0.75rem 0;
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }

    .hm-hero h1 { font-size: 2rem; }
    .hm-hero { padding: 3rem 1.5rem; }

    .entry-content .alignfull {
        margin-left: -1rem;
        margin-right: -1rem;
    }
}

/* === WordPress Core Alignment === */
.alignleft {
    float: left;
    margin-right: 1.5rem;
    margin-bottom: 1rem;
}

.alignright {
    float: right;
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.aligncenter {
    display: block;
    margin: 0 auto;
}

/* Screen reader text */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
}

/* === Page template: Full Width === */
.page-template-full-width .content-area {
    max-width: var(--hm-max-width);
}

/* === Dark section (Gutenberg group block) === */
.hm-dark-section {
    background-color: var(--hm-navy);
    color: var(--hm-white);
}

.hm-dark-section h1,
.hm-dark-section h2,
.hm-dark-section h3,
.hm-dark-section h4 {
    color: var(--hm-white);
}

.hm-dark-section a {
    color: var(--hm-orange);
}

/* === Gutenberg dark-section heading inheritance ===
 * Allow group blocks with explicit background to control their own
 * heading colour via inherited color, instead of being forced to navy
 * by the global h1..h6 rule above. */
.wp-block-group.has-background h1,
.wp-block-group.has-background h2,
.wp-block-group.has-background h3,
.wp-block-group.has-background h4,
.wp-block-group.has-background h5,
.wp-block-group.has-background h6 {
    color: inherit;
}

/* === Kill block gaps between adjacent full-bleed sections === */
.entry-content > .alignfull { margin-top: 0 !important; margin-bottom: 0 !important; }
.entry-content > .alignfull + .alignfull { margin-top: 0 !important; }

/* === Stronger gap kill: zero out vertical margins on all entry-content children === */
.entry-content > * { margin-top: 0 !important; margin-bottom: 0 !important; }
.entry-content { margin: 0 !important; padding: 0 !important; }
.hopetool-embed { margin: 0 !important; padding: 0 !important; line-height: 0 !important; }
.hopetool-embed iframe { display: block !important; margin: 0 !important; }

/* === Kill border-radius and extra padding on full-bleed sections === */
.wp-block-group.has-background { border-radius: 0 !important; padding: 0; }
.wp-block-group.alignfull { border-radius: 0 !important; }
