/**
 * MHM Brand Kit - Base Styles
 * ============================================================================
 * 
 * This stylesheet provides the foundational styles for MHM Brand Kit.
 * All styles use CSS custom properties (variables) that are dynamically
 * injected based on your active brand settings.
 * 
 * CSS VARIABLE REFERENCE:
 * 
 * Colours:
 *   --mhm-primary       Primary brand colour
 *   --mhm-secondary     Secondary brand colour
 *   --mhm-accent        Accent/highlight colour
 *   --mhm-bg            Page background
 *   --mhm-text          Body text colour
 *   --mhm-card-bg       Card/container background
 *   --mhm-link          Link colour
 *   --mhm-muted         Muted/secondary text
 *   --mhm-border        Border colour
 * 
 * Typography:
 *   --mhm-heading-font       Heading font stack
 *   --mhm-body-font          Body font stack
 *   --mhm-base-font          Base font size (px)
 *   --mhm-heading-weight     Heading font weight
 *   --mhm-body-weight        Body font weight
 *   --mhm-heading-style      Heading font style (normal/italic)
 *   --mhm-body-style         Body font style
 *   --mhm-line-height        Body line height
 *   --mhm-heading-line-height Heading line height
 * 
 * Spacing:
 *   --mhm-space         Base spacing unit
 *   --mhm-space-xs      Extra small (0.25×)
 *   --mhm-space-sm      Small (0.5×)
 *   --mhm-space-md      Medium (1×)
 *   --mhm-space-lg      Large (1.5×)
 *   --mhm-space-xl      Extra large (2×)
 *   --mhm-space-2xl     2× large (3×)
 *   --mhm-space-3xl     3× large (4×)
 * 
 * Border Radius:
 *   --mhm-radius        Default radius
 *   --mhm-radius-sm     Small radius
 *   --mhm-radius-lg     Large radius
 *   --mhm-radius-full   Pill/circle (9999px)
 * 
 * Logos:
 *   --mhm-logo-mark-size    Logo mark display size
 *   --mhm-logo-full-width   Full logo max width
 * 
 * ============================================================================
 */

/* ==========================================================================
   FOUNDATION
   ========================================================================== */

html {
    font-size: var(--mhm-base-font, 16px);
    scroll-behavior: smooth;
}

body {
    font-family: var(--mhm-body-font, system-ui, -apple-system, sans-serif);
    font-size: 1rem;
    font-weight: var(--mhm-body-weight, 400);
    font-style: var(--mhm-body-style, normal);
    line-height: var(--mhm-line-height, 1.6);
    color: var(--mhm-text, #222222);
    background-color: var(--mhm-bg, #F7F5F2);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */

/* Headings */
h1, h2, h3, h4, h5, h6,
.mhm-h1, .mhm-h2, .mhm-h3, .mhm-h4, .mhm-h5, .mhm-h6 {
    font-family: var(--mhm-heading-font, Georgia, serif);
    font-weight: var(--mhm-heading-weight, 600);
    font-style: var(--mhm-heading-style, normal);
    line-height: var(--mhm-heading-line-height, 1.2);
    color: var(--mhm-primary, #5A8258);
    margin-top: 0;
    margin-bottom: var(--mhm-space-md);
}

h1, .mhm-h1 { font-size: 2.5rem; }
h2, .mhm-h2 { font-size: 2rem; }
h3, .mhm-h3 { font-size: 1.5rem; }
h4, .mhm-h4 { font-size: 1.25rem; }
h5, .mhm-h5 { font-size: 1.125rem; }
h6, .mhm-h6 { font-size: 1rem; }

/* Display headings (larger) */
.mhm-display-xl { font-size: 3.5rem; line-height: 1.1; }
.mhm-display-lg { font-size: 3rem; line-height: 1.15; }
.mhm-display-md { font-size: 2.5rem; line-height: 1.2; }

/* Body text */
p, .mhm-text {
    margin-top: 0;
    margin-bottom: var(--mhm-space-md);
    line-height: var(--mhm-line-height, 1.6);
}

.mhm-lead {
    font-size: 1.25rem;
    line-height: 1.7;
    text-align: justify;
    color: var(--mhm-muted, #6B7280);
}

.mhm-small, small {
    font-size: 0.875rem;
}

.mhm-caption {
    font-size: 0.8125rem;
    color: var(--mhm-muted, #6B7280);
    line-height: 1.5;
}

.mhm-overline {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--mhm-muted, #6B7280);
}

/* Links */
a, .mhm-link {
    color: var(--mhm-link, #7A6317);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

a:hover, .mhm-link:hover {
    color: var(--mhm-primary, #5A8258);
}

.mhm-link-subtle {
    color: var(--mhm-muted, #6B7280);
    text-decoration: none;
}

.mhm-link-subtle:hover {
    color: var(--mhm-link, #7A6317);
    text-decoration: underline;
}

/* Lists */
ul, ol {
    margin: 0 0 var(--mhm-space-md) 0;
    padding-left: var(--mhm-space-lg);
}

li {
    margin-bottom: var(--mhm-space-xs);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.mhm-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--mhm-space-sm);
    padding: var(--mhm-space-sm) var(--mhm-space-lg);
    font-family: var(--mhm-body-font, system-ui, sans-serif);
    font-size: 0.9375rem;
    font-weight: 500;
    line-height: 1.5;
    text-decoration: none;
    border: 2px solid transparent;
    border-radius: var(--mhm-radius, 12px);
    cursor: pointer;
    transition: all 0.2s ease;
}

.mhm-btn:hover {
    transform: translateY(-1px);
}

.mhm-btn:active {
    transform: translateY(0);
}

/* Primary button */
.mhm-btn-primary {
    background: var(--mhm-primary, #5A8258);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}

.mhm-btn-primary:hover {
    background: var(--mhm-primary, #5A8258);
    filter: brightness(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    color: #ffffff;
}

/* Secondary button */
.mhm-btn-secondary {
    background: var(--mhm-secondary, #C0D5C5);
    color: var(--mhm-text, #222222);
}

.mhm-btn-secondary:hover {
    filter: brightness(0.95);
    color: var(--mhm-text, #222222);
}

/* Accent button */
.mhm-btn-accent {
    background: var(--mhm-accent, #A98B5F);
    color: #ffffff;
}

.mhm-btn-accent:hover {
    filter: brightness(1.1);
    color: #ffffff;
}

/* Ghost button */
.mhm-btn-ghost {
    background: transparent;
    color: var(--mhm-primary, #5A8258);
    border-color: var(--mhm-border, #E5E7EB);
}

.mhm-btn-ghost:hover {
    background: var(--mhm-secondary, #C0D5C5);
    border-color: var(--mhm-secondary, #C0D5C5);
}

/* Button sizes */
.mhm-btn-sm {
    padding: var(--mhm-space-xs) var(--mhm-space-md);
    font-size: 0.8125rem;
}

.mhm-btn-lg {
    padding: var(--mhm-space-md) var(--mhm-space-xl);
    font-size: 1.0625rem;
}

/* Pill button */
.mhm-btn-pill {
    border-radius: var(--mhm-radius-full);
}

/* ==========================================================================
   CARDS
   ========================================================================== */

.mhm-card {
    background: var(--mhm-card-bg, #ffffff);
    border: 1px solid var(--mhm-border, #E5E7EB);
    border-radius: var(--mhm-radius-lg, 20px);
    padding: var(--mhm-space-xl);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.mhm-card-elevated {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    border-color: transparent;
}

.mhm-card-elevated:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.mhm-card-accent {
    background: var(--mhm-accent, #A98B5F);
    border-color: transparent;
    color: #ffffff;
}

.mhm-card-accent h1, .mhm-card-accent h2, .mhm-card-accent h3,
.mhm-card-accent h4, .mhm-card-accent h5, .mhm-card-accent h6,
.mhm-card-accent a {
    color: #ffffff;
}

.mhm-card-primary {
    background: var(--mhm-primary, #5A8258);
    border-color: transparent;
    color: #ffffff;
}

.mhm-card-primary h1, .mhm-card-primary h2, .mhm-card-primary h3,
.mhm-card-primary h4, .mhm-card-primary h5, .mhm-card-primary h6,
.mhm-card-primary a {
    color: #ffffff;
}

.mhm-card-outline {
    background: transparent;
    border-width: 2px;
}

/* Card content elements */
.mhm-card__header {
    margin-bottom: var(--mhm-space-md);
}

.mhm-card__title {
    margin-bottom: var(--mhm-space-xs);
}

.mhm-card__subtitle {
    color: var(--mhm-muted, #6B7280);
    font-size: 0.875rem;
}

.mhm-card__body {
    margin-bottom: var(--mhm-space-md);
}

.mhm-card__footer {
    padding-top: var(--mhm-space-md);
    border-top: 1px solid var(--mhm-border, #E5E7EB);
}

/* ==========================================================================
   LAYOUT UTILITIES
   ========================================================================== */

/* Container */
.mhm-container {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--mhm-space-lg);
    padding-right: var(--mhm-space-lg);
}

.mhm-container-narrow {
    max-width: 800px;
}

.mhm-container-wide {
    max-width: 1400px;
}

/* Section */
.mhm-section {
    padding-top: var(--mhm-space-3xl);
    padding-bottom: var(--mhm-space-3xl);
}

.mhm-section-sm {
    padding-top: var(--mhm-space-xl);
    padding-bottom: var(--mhm-space-xl);
}

.mhm-section-lg {
    padding-top: calc(var(--mhm-space) * 5);
    padding-bottom: calc(var(--mhm-space) * 5);
}

/* Grid */
.mhm-grid {
    display: grid;
    gap: var(--mhm-space-lg);
}

.mhm-grid-2 { grid-template-columns: repeat(2, 1fr); }
.mhm-grid-3 { grid-template-columns: repeat(3, 1fr); }
.mhm-grid-4 { grid-template-columns: repeat(4, 1fr); }

.mhm-grid-auto {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* Flex */
.mhm-flex {
    display: flex;
}

.mhm-flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mhm-flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mhm-flex-wrap {
    flex-wrap: wrap;
}

.mhm-gap-xs { gap: var(--mhm-space-xs); }
.mhm-gap-sm { gap: var(--mhm-space-sm); }
.mhm-gap-md { gap: var(--mhm-space-md); }
.mhm-gap-lg { gap: var(--mhm-space-lg); }
.mhm-gap-xl { gap: var(--mhm-space-xl); }

/* ==========================================================================
   SPACING UTILITIES
   ========================================================================== */

.mhm-mt-0 { margin-top: 0; }
.mhm-mt-xs { margin-top: var(--mhm-space-xs); }
.mhm-mt-sm { margin-top: var(--mhm-space-sm); }
.mhm-mt-md { margin-top: var(--mhm-space-md); }
.mhm-mt-lg { margin-top: var(--mhm-space-lg); }
.mhm-mt-xl { margin-top: var(--mhm-space-xl); }
.mhm-mt-2xl { margin-top: var(--mhm-space-2xl); }

.mhm-mb-0 { margin-bottom: 0; }
.mhm-mb-xs { margin-bottom: var(--mhm-space-xs); }
.mhm-mb-sm { margin-bottom: var(--mhm-space-sm); }
.mhm-mb-md { margin-bottom: var(--mhm-space-md); }
.mhm-mb-lg { margin-bottom: var(--mhm-space-lg); }
.mhm-mb-xl { margin-bottom: var(--mhm-space-xl); }
.mhm-mb-2xl { margin-bottom: var(--mhm-space-2xl); }

.mhm-p-0 { padding: 0; }
.mhm-p-xs { padding: var(--mhm-space-xs); }
.mhm-p-sm { padding: var(--mhm-space-sm); }
.mhm-p-md { padding: var(--mhm-space-md); }
.mhm-p-lg { padding: var(--mhm-space-lg); }
.mhm-p-xl { padding: var(--mhm-space-xl); }
.mhm-p-2xl { padding: var(--mhm-space-2xl); }

/* ==========================================================================
   BADGES & CHIPS
   ========================================================================== */

.mhm-badge {
    display: inline-flex;
    align-items: center;
    padding: var(--mhm-space-xs) var(--mhm-space-sm);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    border-radius: var(--mhm-radius-sm, 6px);
}

.mhm-badge-primary {
    background: var(--mhm-primary, #5A8258);
    color: #ffffff;
}

.mhm-badge-secondary {
    background: var(--mhm-secondary, #C0D5C5);
    color: var(--mhm-text, #222222);
}

.mhm-badge-accent {
    background: var(--mhm-accent, #A98B5F);
    color: #ffffff;
}

.mhm-badge-outline {
    background: transparent;
    border: 1px solid var(--mhm-primary, #5A8258);
    color: var(--mhm-primary, #5A8258);
}

.mhm-chip {
    display: inline-flex;
    align-items: center;
    padding: var(--mhm-space-xs) var(--mhm-space-md);
    font-size: 0.8125rem;
    background: var(--mhm-card-bg, #ffffff);
    border: 1px solid var(--mhm-border, #E5E7EB);
    border-radius: var(--mhm-radius-full);
}

/* ==========================================================================
   FORMS
   ========================================================================== */

.mhm-input,
.mhm-textarea,
.mhm-select {
    width: 100%;
    padding: var(--mhm-space-sm) var(--mhm-space-md);
    font-family: var(--mhm-body-font, system-ui, sans-serif);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--mhm-text, #222222);
    background: var(--mhm-card-bg, #ffffff);
    border: 1px solid var(--mhm-border, #E5E7EB);
    border-radius: var(--mhm-radius, 12px);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.mhm-input:focus,
.mhm-textarea:focus,
.mhm-select:focus {
    outline: none;
    border-color: var(--mhm-primary, #5A8258);
    box-shadow: 0 0 0 3px rgba(90, 130, 88, 0.15);
}

.mhm-label {
    display: block;
    margin-bottom: var(--mhm-space-xs);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--mhm-text, #222222);
}

.mhm-form-hint {
    margin-top: var(--mhm-space-xs);
    font-size: 0.8125rem;
    color: var(--mhm-muted, #6B7280);
}

/* ==========================================================================
   DIVIDERS
   ========================================================================== */

.mhm-divider {
    height: 1px;
    background: var(--mhm-border, #E5E7EB);
    border: none;
    margin: var(--mhm-space-xl) 0;
}

.mhm-divider-gradient {
    height: 1px;
    background: linear-gradient(
        to right,
        transparent,
        var(--mhm-border, #E5E7EB),
        transparent
    );
    border: none;
}

/* ==========================================================================
   IMAGES & MEDIA
   ========================================================================== */

.mhm-img {
    max-width: 100%;
    height: auto;
    border-radius: var(--mhm-radius, 12px);
}

.mhm-img-rounded {
    border-radius: var(--mhm-radius-lg, 20px);
}

.mhm-img-circle {
    border-radius: 50%;
}

.mhm-aspect-16-9 {
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.mhm-aspect-4-3 {
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.mhm-aspect-1-1 {
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

/* ==========================================================================
   LOGOS
   ========================================================================== */

.mhm-logo {
    display: inline-block;
    max-width: 100%;
    height: auto;
}

.mhm-logo-mark {
    width: var(--mhm-logo-mark-size, 48px);
    height: var(--mhm-logo-mark-size, 48px);
    object-fit: contain;
}

.mhm-logo-full {
    max-width: var(--mhm-logo-full-width, 200px);
    height: auto;
    object-fit: contain;
}

/* ==========================================================================
   COLOUR SWATCHES
   ========================================================================== */

.mhm-swatch {
    display: flex;
    flex-direction: column;
    gap: var(--mhm-space-xs);
}

.mhm-swatch__colour {
    width: 100%;
    height: 80px;
    border-radius: var(--mhm-radius, 12px);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.mhm-swatch__meta {
    font-size: 0.8125rem;
}

.mhm-swatch__label {
    display: block;
    font-weight: 600;
    color: var(--mhm-text, #222222);
}

.mhm-swatch__value {
    display: block;
    font-size: 0.75rem;
    color: var(--mhm-muted, #6B7280);
    font-family: monospace;
}

.mhm-swatch--small .mhm-swatch__colour {
    height: 48px;
}

.mhm-swatch--large .mhm-swatch__colour {
    height: 120px;
}

/* ==========================================================================
   ALERTS & NOTES
   ========================================================================== */

.mhm-alert {
    padding: var(--mhm-space-md) var(--mhm-space-lg);
    border-radius: var(--mhm-radius, 12px);
    border-left: 4px solid;
}

.mhm-alert-info {
    background: rgba(34, 113, 177, 0.1);
    border-color: #2271b1;
    color: #1d4e74;
}

.mhm-alert-success {
    background: rgba(0, 163, 42, 0.1);
    border-color: #00a32a;
    color: #0a5c1a;
}

.mhm-alert-warning {
    background: rgba(220, 160, 0, 0.1);
    border-color: #dca000;
    color: #6e5000;
}

.mhm-alert-error {
    background: rgba(204, 28, 46, 0.1);
    border-color: #cc1c2e;
    color: #8a1323;
}

.mhm-note {
    padding: var(--mhm-space-md);
    background: var(--mhm-secondary, #C0D5C5);
    border-radius: var(--mhm-radius, 12px);
    font-size: 0.875rem;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media screen and (max-width: 768px) {
    .mhm-grid-2,
    .mhm-grid-3,
    .mhm-grid-4 {
        grid-template-columns: 1fr;
    }
    
    .mhm-display-xl { font-size: 2.5rem; }
    .mhm-display-lg { font-size: 2rem; }
    .mhm-display-md { font-size: 1.75rem; }
    
    h1, .mhm-h1 { font-size: 2rem; }
    h2, .mhm-h2 { font-size: 1.5rem; }
    
    .mhm-section {
        padding-top: var(--mhm-space-xl);
        padding-bottom: var(--mhm-space-xl);
    }
}

/* Hide on mobile */
@media screen and (max-width: 768px) {
    .mhm-hide-mobile { display: none !important; }
}

/* Hide on desktop */
@media screen and (min-width: 769px) {
    .mhm-hide-desktop { display: none !important; }
}
