/*
================================================================================
  MHM BRAND KIT BASE STYLES
  Used by: all *-brand-id.css files
  Relies on CSS variables injected by the plugin:
  - Colours:
      --mhm-primary
      --mhm-secondary
      --mhm-accent
      --mhm-bg
      --mhm-text
      --mhm-card-bg
      --mhm-link
  - Typography:
      --mhm-heading-font
      --mhm-body-font
      --mhm-base-font
      --mhm-heading-weight
      --mhm-body-weight
      --mhm-heading-style
      --mhm-body-style
      --mhm-space
================================================================================
*/
/* Typography: bind base font and body font to brand variables */
html {
    font-size: var(--mhm-base-font);
}

body {
    font-family: var(--mhm-body-font);
    font-size: inherit; /* inherits from html → var(--mhm-base-font) */
    color: var(--mhm-text);
    background: var(--mhm-bg);
    line-height: 1.6;
}

.mhm-text-body {
    font-size: 1rem; /* always 1 × var(--mhm-base-font) */
    line-height: 1.7;
    color: var(--mhm-text);
    font-size: 1.2rem;
}

/* Base body styling */

body {
    font-family: var(--mhm-body-font, system-ui, sans-serif);
    font-size: var(--mhm-base-font, 16px);
    font-weight: var(--mhm-body-weight, 400);
    font-style: var(--mhm-body-style, normal);
    color: var(--mhm-text, #222222);
    background-color: var(--mhm-bg, #f7f5f2);
}

/* Generic block wrapper used by portal sections and small blocks */

.mhm-block {
    background: var(--mhm-card-bg, var(--mhm-bg, #f7f5f2));
    padding: calc(var(--mhm-space, 1rem) * 2);
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    margin-bottom: calc(var(--mhm-space, 1rem) * 2);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
}

.mhm-block-inner {
    max-width: 1040px;
    margin: 0 auto;
}

/* Brand identity page shell */

.mhm-brand-page {
    padding: calc(var(--mhm-space, 1rem) * 2);
}

/* Section layout */

.mhm-section {
    margin-bottom: calc(var(--mhm-space, 1rem) * 2.5);
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.06);
}

.mhm-section-alt {
    background: linear-gradient(
            to bottom right,
            rgba(255, 255, 255, 0.96),
            rgba(0, 0, 0, 0.02)
    );
}

.mhm-section-inner {
    padding: calc(var(--mhm-space, 1rem) * 2);
}

/* Hero section */

.mhm-section-hero {
    background: radial-gradient(
            circle at top left,
            rgba(255, 255, 255, 0.98),
            rgba(0, 0, 0, 0.03)
    );
}

.mhm-section-hero .mhm-section-inner {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr);
    gap: calc(var(--mhm-space, 1rem) * 2);
    align-items: center;
}

@media (max-width: 900px) {
    .mhm-section-hero .mhm-section-inner {
        grid-template-columns: 1fr;
    }
}

/* Typography system */

.mhm-heading-xl,
.mhm-heading-l,
.mhm-heading-m,
.mhm-heading-s {
    font-family: var(--mhm-heading-font, serif);
    font-weight: var(--mhm-heading-weight, 600);
    font-style: var(--mhm-heading-style, normal);
    color: var(--mhm-primary, #5A8258);
    margin-top: 0;
}

.mhm-heading-xl {
    font-size: calc(var(--mhm-base-font, 16px) * 2.4);
    line-height: 1.1;
}

.mhm-heading-l {
    font-size: calc(var(--mhm-base-font, 16px) * 1.8);
    line-height: 1.2;
}

.mhm-heading-m {
    font-size: calc(var(--mhm-base-font, 16px) * 1.4);
}

.mhm-heading-s {
    font-size: calc(var(--mhm-base-font, 16px) * 1.1);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.mhm-text-body {
    font-family: var(--mhm-body-font, system-ui, sans-serif);
    font-weight: var(--mhm-body-weight, 400);
    font-style: var(--mhm-body-style, normal);
    line-height: 1.7;
    color: var(--mhm-text, #222222);
    margin-bottom: calc(var(--mhm-space, 1rem) * 1.2);
}

.mhm-caption {
    font-size: 0.85em;
    line-height: 1.5;
    color: rgba(0, 0, 0, 0.6);
}

/* Inline code inside brand kit text */

.mhm-brand-page code {
    font-size: 0.85em;
    background: rgba(0, 0, 0, 0.03);
    padding: 0.1em 0.35em;
    border-radius: 4px;
}

/* Buttons */

.mhm-button-row {
    display: flex;
    flex-wrap: wrap;
    gap: calc(var(--mhm-space, 1rem));
    margin-top: calc(var(--mhm-space, 1rem) * 1.5);
    margin-bottom: calc(var(--mhm-space, 1rem));
}

.mhm-button {
    display: inline-block;
    padding: calc(var(--mhm-space, 1rem) * 0.7)
    calc(var(--mhm-space, 1rem) * 1.6);
    border-radius: 999px;
    font-weight: 500;
    font-family: var(--mhm-body-font, system-ui, sans-serif);
    font-size: 0.95em;
    text-decoration: none;
    border: 1px solid transparent;
    transition:
            transform 150ms ease,
            box-shadow 150ms ease,
            background 150ms ease,
            color 150ms ease,
            border-color 150ms ease;
}

.mhm-button-primary {
    background: var(--mhm-primary, #EB9E8D);
    color: #ffffff;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
}

.mhm-button-secondary {
    background: var(--mhm-secondary, #8DEBA9);
    color: var(--mhm-text, #222222);
}

.mhm-button-ghost {
    background: transparent;
    color: var(--mhm-primary, #EB9E8D);
    border-color: rgba(0, 0, 0, 0.2);
}

.mhm-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
}

/* Links */

.mhm-link-inline {
    color: var(--mhm-link, var(--mhm-accent, #968582));
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.mhm-link-inline:hover {
    color: var(--mhm-primary, #EB9E8D);
}

/* Image placeholders */

.mhm-img-placeholder {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    border-radius: 20px;
    background: linear-gradient(
            135deg,
            rgba(0, 0, 0, 0.04),
            rgba(255, 255, 255, 0.9)
    );
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.16);
}

.mhm-img-portrait {
    padding-top: 125%; /* 4:5 */
}

.mhm-img-landscape {
    padding-top: 42.85%; /* 21:9 */
}

.mhm-img-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--mhm-heading-font, serif);
    font-weight: 500;
    font-size: 0.9em;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(0, 0, 0, 0.55);
}

/* Colour swatches */

.mhm-swatch-row {
    display: flex;
    flex-wrap: wrap;
    gap: calc(var(--mhm-space, 1rem));
    margin-top: calc(var(--mhm-space, 1rem) * 1.5);
}

.mhm-swatch {
    width: 150px;
}

.mhm-swatch-colour {
    width: 100%;
    height: 80px;
    border-radius: 12px;
}

.mhm-swatch-meta {
    margin-top: 0.4rem;
    font-size: 0.85em;
}

.mhm-swatch-name {
    display: block;
    font-weight: 600;
}

.mhm-swatch-token {
    display: block;
    opacity: 0.7;
}

/* Typography grid */

.mhm-type-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.2fr);
    gap: calc(var(--mhm-space, 1rem) * 2);
    margin-top: calc(var(--mhm-space, 1rem) * 1.5);
}

.mhm-type-column {
    min-width: 0;
}

@media (max-width: 900px) {
    .mhm-type-grid {
        grid-template-columns: 1fr;
    }
}

/* Card grid and cards */

.mhm-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: calc(var(--mhm-space, 1rem) * 1.8);
    margin-top: calc(var(--mhm-space, 1rem) * 1.5);
}

.mhm-card {
    background: var(--mhm-card-bg, var(--mhm-bg, #f7f5f2));
    border-radius: 18px;
    padding: calc(var(--mhm-space, 1rem) * 1.6);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.14);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.mhm-card-accent {
    background: var(--mhm-accent, #968582);
    color: #ffffff;
}

.mhm-card-accent .mhm-heading-m,
.mhm-card-accent .mhm-text-body,
.mhm-card-accent .mhm-link-inline {
    color: #ffffff;
}

.mhm-card-outline {
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.18);
    box-shadow: none;
}

/* Chips */

.mhm-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.6rem;
}

.mhm-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8em;
    border: 1px solid rgba(0, 0, 0, 0.18);
    background: rgba(255, 255, 255, 0.7);
}

/* Media grid */

.mhm-media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: calc(var(--mhm-space, 1rem) * 1.8);
    margin-top: calc(var(--mhm-space, 1rem) * 1.5);
}

.mhm-figure {
    margin: 0;
}

/* Micro elements: badges and notes */

.mhm-micro-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: calc(var(--mhm-space, 1rem) * 1.3);
}

.mhm-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    font-size: 0.75em;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.mhm-badge-soft {
    background: var(--mhm-secondary, #8DEBA9);
    color: var(--mhm-text, #222222);
}

.mhm-badge-strong {
    background: var(--mhm-primary, #EB9E8D);
    color: #ffffff;
}

.mhm-badge-outline {
    background: transparent;
    border: 1px solid var(--mhm-primary, #EB9E8D);
    color: var(--mhm-primary, #EB9E8D);
}

.mhm-note {
    margin-top: calc(var(--mhm-space, 1rem) * 1.2);
    padding: calc(var(--mhm-space, 1rem) * 1.2);
    border-radius: 12px;
    border: 1px dashed rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.8);
}

/* Utility: subtle divider inside sections if needed */

.mhm-divider {
    height: 1px;
    margin: calc(var(--mhm-space, 1rem) * 1.5) 0;
    background: linear-gradient(
            to right,
            rgba(0, 0, 0, 0),
            rgba(0, 0, 0, 0.12),
            rgba(0, 0, 0, 0)
    );
}
/* Generic image block with ratio control and text flow */

/* Outer wrapper – controls alignment and text wrapping */
.mhm-img-block {
    max-width: 100%;
    margin: 0 0 var(--mhm-space, 1.5rem) 0;
}

/* Alignment options */
.mhm-img-left {
    float: left;
    margin: 0 var(--mhm-space, 1.5rem) var(--mhm-space, 1.5rem) 0;
}

.mhm-img-right {
    float: right;
    margin: 0 0 var(--mhm-space, 1.5rem) var(--mhm-space, 1.5rem);
}

.mhm-img-centre {
    float: none;
    margin: 0 auto var(--mhm-space, 1.5rem) auto;
    display: block;
    text-align: centre;
}

/* Inner frame – controls ratio and size */
.mhm-img-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 5;            /* default ratio, override per image */
    overflow: hidden;
    border-radius: 12px;
}

/* Image fills the frame without distortion */
.mhm-img-frame img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;              /* fill frame, no distortion */
}

/* Optional caption */
.mhm-img-caption {
    font-size: 0.85rem;
    line-height: 1.4;
    margin-top: 0.35rem;
    opacity: 0.8;
}
