
/* Mola Homepage Framework v0.1
   Uses the visual variables already defined in the child theme:
   --mola-paper, --mola-paper-light, --mola-paper-card, --mola-ink,
   --mola-text-soft, --mola-olive, --mola-brown, --mola-dark,
   --mola-border, --mola-cream
*/

.mola-home {
    width: 100%;
    color: var(--mola-ink, #4F4433);
}

.mola-home-section {
    width: min(1440px, calc(100vw - 64px));
    margin: 0 auto;
}

.mola-home h1,
.mola-home h2,
.mola-home h3,
.mola-home p {
    margin-top: 0;
}

.mola-home a {
    color: inherit;
    text-decoration: none;
}

.mola-home-hero {
    min-height: min(760px, 78vh);
    display: grid;
    grid-template-columns: minmax(360px, .9fr) minmax(0, 1.35fr);
    gap: 42px;
    align-items: center;
    padding: clamp(48px, 7vw, 110px) 0 70px;
}

.mola-home-kicker {
    margin-bottom: 18px;
    color: var(--mola-olive, #756C42);
    font-size: 12px;
    letter-spacing: .14em;
    font-weight: 700;
}

.mola-home-hero h1 {
    margin-bottom: 22px;
    max-width: 14ch;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: clamp(44px, 5vw, 78px);
    line-height: 1.04;
    font-weight: 400;
}

.mola-home-hero h1 em {
    color: var(--mola-olive, #756C42);
    font-weight: 400;
}

.mola-home-lead {
    max-width: 42ch;
    margin-bottom: 28px;
    color: var(--mola-text-soft, #786A50);
    font-size: 18px;
    line-height: 1.6;
}

.mola-home-button {
    display: inline-flex;
    align-items: center;
    gap: 22px;
    padding: 13px 20px;
    border-radius: 9px;
    font-size: 12px;
    letter-spacing: .035em;
    text-transform: uppercase;
    font-weight: 700;
}

.mola-home-button-outline {
    border: 1px solid var(--mola-border, #C3B08E);
}

.mola-home-placeholder {
    width: 100%;
    min-height: 220px;
    display: grid;
    place-items: center;
    border: 1px dashed color-mix(in srgb, var(--mola-border, #C3B08E) 74%, transparent);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(255,248,234,.48), rgba(232,215,187,.48));
    color: var(--mola-text-soft, #786A50);
    font-size: 12px;
    letter-spacing: .04em;
}

.mola-home-hero-art .mola-home-placeholder {
    min-height: clamp(420px, 56vw, 670px);
}

.mola-home-ecosystem {
    padding: 46px 0 62px;
    border-top: 1px solid color-mix(in srgb, var(--mola-border, #C3B08E) 75%, transparent);
}

.mola-home-section-head {
    margin-bottom: 24px;
    text-align: center;
}

.mola-home-section-head h2,
.mola-home-section-row h2,
.mola-home-cta h2 {
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 400;
}

.mola-home-section-head h2 {
    margin-bottom: 6px;
    font-size: clamp(30px, 3vw, 44px);
}

.mola-home-section-head p {
    color: var(--mola-text-soft, #786A50);
}

.mola-home-ecosystem-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.mola-home-branch-card {
    min-height: 310px;
    display: grid;
    grid-template-columns: 1fr .85fr;
    gap: 16px;
    align-items: end;
    padding: 22px;
    border: 1px solid var(--mola-border, #C3B08E);
    border-radius: 14px;
    background: color-mix(in srgb, var(--mola-paper-card, #E8D7BB) 56%, transparent);
}

.mola-home-branch-card .mola-home-placeholder {
    min-height: 210px;
}

.mola-home-branch-copy h3 {
    margin-bottom: 10px;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 24px;
    font-weight: 400;
}

.mola-home-branch-copy p {
    margin-bottom: 18px;
    color: var(--mola-text-soft, #786A50);
    line-height: 1.55;
}

.mola-home-branch-copy a {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.mola-home-featured {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 32px;
    padding: 38px 0 66px;
}

.mola-home-section-row {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: baseline;
    margin-bottom: 18px;
}

.mola-home-section-row h2 {
    margin-bottom: 0;
    font-size: 32px;
}

.mola-home-section-row a {
    font-size: 12px;
    font-weight: 700;
}

.mola-home-project-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.mola-home-project-card {
    padding: 10px;
    border: 1px solid var(--mola-border, #C3B08E);
    border-radius: 12px;
    background: color-mix(in srgb, var(--mola-paper-light, #F4E7D2) 72%, transparent);
}

.mola-home-project-card .mola-home-placeholder {
    min-height: 230px;
    margin-bottom: 12px;
    border-radius: 9px;
}

.mola-home-project-card h3 {
    margin-bottom: 4px;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 18px;
    font-weight: 400;
}

.mola-home-project-card p {
    margin-bottom: 0;
    color: var(--mola-text-soft, #786A50);
    font-size: 12px;
}

.mola-home-journal-preview {
    padding: 0 0 0 10px;
}

.mola-home-journal-list {
    border: 1px solid var(--mola-border, #C3B08E);
    border-radius: 12px;
    overflow: hidden;
}

.mola-home-journal-item {
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 13px;
    align-items: center;
    padding: 12px;
}

.mola-home-journal-item + .mola-home-journal-item {
    border-top: 1px solid color-mix(in srgb, var(--mola-border, #C3B08E) 72%, transparent);
}

.mola-home-journal-thumb {
    width: 74px;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 8px;
    background: var(--mola-paper-card, #E8D7BB);
}

.mola-home-journal-thumb img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.mola-home-journal-item small,
.mola-home-journal-item strong {
    display: block;
}

.mola-home-journal-item small {
    margin-bottom: 5px;
    color: var(--mola-text-soft, #786A50);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.mola-home-journal-item strong {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 16px;
    line-height: 1.25;
    font-weight: 400;
}

.mola-home-cta {
    display: grid;
    grid-template-columns: .9fr .8fr 1fr;
    gap: 34px;
    align-items: center;
    padding: 44px 0 70px;
    border-top: 1px solid var(--mola-border, #C3B08E);
}

.mola-home-cta-art .mola-home-placeholder {
    min-height: 250px;
}

.mola-home-cta h2 {
    margin-bottom: 14px;
    font-size: clamp(34px, 3vw, 48px);
    line-height: 1.08;
}

.mola-home-cta-copy p,
.mola-home-newsletter p {
    color: var(--mola-text-soft, #786A50);
    line-height: 1.55;
}

.mola-home-newsletter h3 {
    margin-bottom: 8px;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 26px;
    font-weight: 400;
}

.mola-home-newsletter-form {
    display: grid;
    grid-template-columns: 1fr auto;
    border: 1px solid var(--mola-border, #C3B08E);
    border-radius: 999px;
    overflow: hidden;
}

.mola-home-newsletter-form span,
.mola-home-newsletter-form button {
    padding: 11px 15px;
    font-size: 12px;
}

.mola-home-newsletter-form span {
    color: var(--mola-text-soft, #786A50);
}

.mola-home-newsletter-form button {
    border: 0;
    background: var(--mola-olive, #756C42);
    color: var(--mola-cream, #FFF8EA);
}

@media (max-width: 1100px) {
    .mola-home-section {
        width: min(100% - 40px, 920px);
    }

    .mola-home-hero {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .mola-home-ecosystem-grid,
    .mola-home-featured,
    .mola-home-cta {
        grid-template-columns: 1fr;
    }

    .mola-home-project-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .mola-home-journal-preview {
        padding-left: 0;
    }
}

@media (max-width: 640px) {
    .mola-home-section {
        width: min(100% - 24px, 640px);
    }

    .mola-home-hero {
        padding-top: 34px;
    }

    .mola-home-hero h1 {
        font-size: clamp(38px, 11vw, 58px);
    }

    .mola-home-branch-card {
        grid-template-columns: 1fr;
    }

    .mola-home-project-grid {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   HOMEPAGE REFERENCE LOCK — v0.3
   Reference: cream header + warm taupe hero.
   This block intentionally overrides earlier prototype rules.
   ========================================================= */

body.home,
body.home .site-main,
body.home .page-content {
    background: #B2A088 !important;
}

/* HERO */
body.home .mola-home-hero {
    width: calc(100% - 40px) !important;
    max-width: none !important;
    min-height: 485px !important;
    margin: 0 auto !important;
    padding: 8px 0 42px !important;

    grid-template-columns:
        minmax(430px, .88fr)
        minmax(0, 1.12fr) !important;

    gap: clamp(18px, 2vw, 28px) !important;
    align-items: stretch !important;

    background: #B2A088 !important;
}

body.home .mola-home-hero-copy {
    align-self: center !important;
    padding: 8px 0 0 !important;
}

body.home .mola-home-kicker {
    margin: 0 0 14px !important;
    color: #5E5937 !important;
    font-size: 10px !important;
    line-height: 1.2 !important;
    letter-spacing: .16em !important;
    font-weight: 700 !important;
}

body.home .mola-home-hero h1 {
    max-width: 10.6ch !important;
    margin: 0 0 16px !important;

    color: #4F4433 !important;
    font-size: clamp(50px, 4.6vw, 66px) !important;
    line-height: 1.015 !important;
    font-weight: 400 !important;
}

body.home .mola-home-hero h1 em {
    color: #716C42 !important;
    font-weight: 400 !important;
}

body.home .mola-home-lead {
    max-width: 34ch !important;
    margin: 0 0 18px !important;
    color: #5B4E3D !important;
    font-size: 13px !important;
    line-height: 1.5 !important;
}

body.home .mola-home-button {
    gap: 28px !important;
    padding: 10px 16px !important;
    border-radius: 5px !important;
    font-size: 10px !important;
    letter-spacing: .035em !important;
}

body.home .mola-home-button-outline {
    border-color: #8F7A5D !important;
    color: #4F4433 !important;
    background: transparent !important;
}

body.home .mola-home-hero-art {
    display: flex !important;
    min-width: 0 !important;
}

body.home .mola-home-hero-art .mola-home-placeholder {
    min-height: 435px !important;
    height: 100% !important;

    border-color: rgba(111, 92, 69, .35) !important;
    border-radius: 14px !important;

    background: #B2A088 !important;
    color: #5D5040 !important;

    font-size: 9px !important;
    letter-spacing: .05em !important;
}

/* Keep the rest of the homepage in the same warm family for now.
   We will refine each section separately after the hero is locked. */
body.home .mola-home-ecosystem,
body.home .mola-home-featured,
body.home .mola-home-cta {
    color: #4F4433 !important;
}

/* DESKTOP / SMALL LAPTOP */
@media (max-width: 1180px) {
    body.home .mola-home-hero {
        width: calc(100% - 32px) !important;
        grid-template-columns:
            minmax(390px, .9fr)
            minmax(0, 1.1fr) !important;
    }

    body.home .mola-home-hero h1 {
        font-size: clamp(46px, 4.7vw, 60px) !important;
    }
}

/* TABLET */
@media (max-width: 900px) {
    body.home .mola-home-hero {
        width: calc(100% - 28px) !important;
        min-height: auto !important;
        grid-template-columns: 1fr !important;
        padding: 30px 0 42px !important;
        gap: 28px !important;
    }

    body.home .mola-home-hero h1 {
        max-width: 12ch !important;
        font-size: clamp(46px, 8vw, 66px) !important;
    }

    body.home .mola-home-hero-art .mola-home-placeholder {
        min-height: clamp(340px, 70vw, 520px) !important;
    }
}

/* MOBILE */
@media (max-width: 560px) {
    body.home .mola-home-hero {
        width: calc(100% - 22px) !important;
        padding-top: 24px !important;
    }

    body.home .mola-home-hero h1 {
        font-size: clamp(40px, 12vw, 54px) !important;
    }

    body.home .mola-home-lead {
        font-size: 14px !important;
    }
}


/* =========================================================
   EDITABLE HOMEPAGE HERO — ACF CONTENT
   ========================================================= */
body.home .mola-home-title-line {
    display: block;
}

body.home .mola-home-placeholder-has-image {
    padding: 0 !important;
    overflow: hidden !important;
    border-style: solid !important;
}

body.home .mola-home-hero-image {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    object-fit: cover !important;
    object-position: center !important;
}


/* =========================================================
   MOLASAGA VISUAL SYSTEM v0.5.1 — ORGANIC LAYER CARDS
   - artwork stays inside a protected inner art region
   - no transform overflow
   - multi-stroke irregular SVG pencil frame
   ========================================================= */

body.home .mola-home-ecosystem {
    position: relative;
    padding-top: clamp(42px, 5vw, 72px);
    padding-bottom: clamp(52px, 6vw, 86px);
}

body.home .mola-home-ecosystem-grid {
    gap: clamp(14px, 1.6vw, 24px);
}

body.home .mola-home-branch-card.mola-home-layer-card {
    position: relative !important;
    isolation: isolate;
    min-width: 0 !important;
    min-height: clamp(270px, 24vw, 340px) !important;

    display: block !important;
    padding: clamp(24px, 2.2vw, 34px) !important;

    overflow: hidden !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;

    color: var(--mola-ink, #4F4433);
}

/* Hand-drawn multi-stroke frame generated in PHP/SVG. */
body.home .mola-home-layer-card .mola-rough-frame {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;

    display: block !important;
    z-index: 5 !important;
    pointer-events: none !important;

    color: #8F765C !important;
    opacity: .82;
    overflow: visible !important;
    mix-blend-mode: multiply;
}

/*
 * Protected artwork region:
 * the image may grow inside this area, but it is clipped here
 * and can never spill outside the card.
 */
body.home .mola-home-branch-art {
    position: absolute !important;
    z-index: 0 !important;

    top: 7% !important;
    right: 3% !important;
    bottom: 7% !important;
    left: 35% !important;

    min-width: 0 !important;

    display: flex !important;
    justify-content: center !important;
    align-items: center !important;

    overflow: hidden !important;
    pointer-events: none !important;
}

/*
 * Scale is applied as dimensions rather than transform.
 * This keeps the artwork clipped by .mola-home-branch-art.
 */
body.home .mola-home-branch-image {
    display: block !important;

    width: calc(100% * var(--mola-art-scale, 1)) !important;
    height: calc(100% * var(--mola-art-scale, 1)) !important;

    min-width: 0 !important;
    max-width: none !important;
    max-height: none !important;

    object-fit: contain !important;
    object-position: var(--mola-art-position, right center) !important;

    transform: none !important;
    margin: 0 !important;

    -webkit-mask-image:
        linear-gradient(to right, transparent 0%, rgba(0,0,0,.25) 8%, #000 24%, #000 100%),
        linear-gradient(to bottom, transparent 0%, #000 8%, #000 92%, transparent 100%);
    -webkit-mask-composite: source-in;

    mask-image:
        linear-gradient(to right, transparent 0%, rgba(0,0,0,.25) 8%, #000 24%, #000 100%),
        linear-gradient(to bottom, transparent 0%, #000 8%, #000 92%, transparent 100%);
    mask-composite: intersect;

    opacity: .94;
}

/* Copy floats above and may visually overlap the faded art edge. */
body.home .mola-home-branch-copy {
    position: relative !important;
    z-index: 2 !important;

    width: min(57%, 270px) !important;
    min-width: 0 !important;
    min-height: 100%;

    display: flex;
    flex-direction: column;
    justify-content: center;
}

body.home .mola-home-branch-copy h3 {
    margin: 0 0 12px !important;
    font-size: clamp(20px, 1.55vw, 26px) !important;
    line-height: 1.08 !important;
}

body.home .mola-home-branch-copy p {
    margin: 0 0 22px !important;
    color: color-mix(in srgb, var(--mola-ink, #4F4433) 82%, transparent);
    font-size: clamp(13px, .95vw, 15.5px) !important;
    line-height: 1.55 !important;

    overflow-wrap: anywhere;
}

body.home .mola-home-branch-copy a {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    width: fit-content;

    font-size: 11px;
    letter-spacing: .025em;
    text-transform: uppercase;
}

body.home .mola-home-branch-copy a span {
    transition: transform .18s ease;
}

body.home .mola-home-branch-copy a:hover span {
    transform: translateX(3px);
}

@media (max-width: 1100px) and (min-width: 701px) {
    body.home .mola-home-ecosystem-grid {
        grid-template-columns: 1fr !important;
    }

    body.home .mola-home-branch-card.mola-home-layer-card {
        min-height: 280px !important;
    }

    body.home .mola-home-branch-art {
        left: 42% !important;
    }

    body.home .mola-home-branch-copy {
        width: 48% !important;
        max-width: 360px !important;
    }
}

@media (max-width: 700px) {
    body.home .mola-home-ecosystem-grid {
        grid-template-columns: 1fr !important;
    }

    body.home .mola-home-branch-card.mola-home-layer-card {
        min-height: 360px !important;
        padding: 24px !important;
    }

    body.home .mola-home-branch-art {
        top: 34% !important;
        right: 4% !important;
        bottom: 5% !important;
        left: 14% !important;
    }

    body.home .mola-home-branch-image {
        -webkit-mask-image:
            linear-gradient(to bottom, transparent 0%, rgba(0,0,0,.35) 10%, #000 28%, #000 100%);
        mask-image:
            linear-gradient(to bottom, transparent 0%, rgba(0,0,0,.35) 10%, #000 28%, #000 100%);
    }

    body.home .mola-home-branch-copy {
        width: 100% !important;
        max-width: 310px !important;
        min-height: auto;
        justify-content: flex-start;
    }
}
