/*
Theme Name: Jeama
Description: Editable block theme for MB Jeama.
Version: 1.5.1
Requires at least: 6.6
Requires PHP: 8.3
Text Domain: jeama
License: GPL-2.0-or-later
*/

:root {
    --jeama-graphite: #252B29;
    --jeama-sage: #485B54;
    --jeama-steel: #87958B;
    --jeama-mineral: #E9EAE5;
    --jeama-stone: #B6AA98;
    --jeama-paper: #FAFAF7;
}

body { margin: 0; }
.wp-site-blocks { padding: 0; }
.jeama-header, .jeama-footer { border-block-end: 1px solid var(--jeama-mineral); }
.jeama-header > .wp-block-group, .jeama-footer > .wp-block-group {
    width: min(calc(100% - 32px), 1240px);
    margin-inline: auto;
}
.jeama-brand { font-family: 'Segoe UI', Arial, sans-serif; letter-spacing: .08em; }
.jeama-brand a { font-weight: 850; }
.jeama-header-inner { gap: 12px; padding-block: 14px; }
.jeama-header-inner .jeama-brand { font-size: clamp(1.4rem, 3.2vw, 2rem); }
.jeama-brand-logo { display: block; width: clamp(132px, 18vw, 188px); }
.jeama-brand-logo img { display: block; width: 100%; height: auto; }
.jeama-header-inner > .wp-block-buttons a { padding: 9px 12px; }
.jeama-header .wp-block-navigation a:hover { text-decoration: underline; text-underline-offset: .25em; }
.jeama-header .wp-block-navigation__submenu-container:not(.is-menu-open *) { min-width: 15rem; }
:where(a, button, input, select, textarea):focus-visible { outline: 3px solid var(--jeama-sage); outline-offset: 4px; }

.wp-site-blocks > .jeama-front { margin-block-start: 0; }
.jeama-front .jeama-v2-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: clamp(22px, 4vw, 65px);
    padding: clamp(22px, 4vw, 56px) max(24px, calc((100vw - 1320px) / 2));
    background: var(--jeama-graphite);
    color: var(--jeama-paper);
}
.jeama-hero-copy h1 {
    max-width: 13ch;
    margin-block: .3em;
    font-size: clamp(2.5rem, 5.5vw, 5rem);
    line-height: 1.02;
}
.jeama-hero-copy > p:not(.jeama-kicker) { max-width: 43ch; }
.jeama-kicker { color: var(--jeama-stone); font-size: .82rem; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
.jeama-v2-hero .wp-block-buttons { margin-top: 22px; }
.jeama-v2-hero .is-style-outline a { color: var(--jeama-paper); }
.jeama-v2-hero :focus-visible { outline-color: var(--jeama-stone); }
.jeama-hero-photo { position: relative; margin: 0; }
.jeama-hero-photo img { display: block; width: 100%; height: auto; }
.jeama-hero-photo figcaption, .jeama-service-card figcaption {
    position: absolute;
    right: 8px;
    bottom: 8px;
    margin: 0;
    padding: 3px 7px;
    background: var(--jeama-graphite);
    color: var(--jeama-paper);
    font-size: .75rem;
}

.jeama-section { width: min(calc(100% - 32px), 1240px); margin: 0 auto; padding: clamp(26px, 4vw, 62px) 0; }
.jeama-section > h2 { margin-block: 0 .45em; font-size: clamp(1.85rem, 4vw, 3rem); }
.jeama-section > p { max-width: 70ch; }
.jeama-section-tint { box-sizing: border-box; background: var(--jeama-mineral); padding-inline: clamp(18px, 3vw, 42px); }
.jeama-service-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 1.5vw, 24px); }
.jeama-service-card { display: flex; flex-direction: column; border: 1px solid var(--jeama-mineral); }
.jeama-service-card:not(:has(figure)) { background: var(--jeama-mineral); }
.jeama-service-card figure { margin: 0; position: relative; }
.jeama-service-card figure img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.jeama-card-copy { flex: 1; display: flex; flex-direction: column; justify-content: end; gap: 8px; padding: 16px; }
.jeama-card-copy h3, .jeama-card-copy p { margin: 0; }
.jeama-card-copy h3 { font-size: 1.3rem; }
.jeama-card-copy > a { margin-top: auto; color: var(--jeama-sage); font-weight: 650; }
.jeama-card-copy > p { margin-bottom: 8px; }
.jeama-product-links, .jeama-order-steps { display: flex; flex-wrap: wrap; gap: 12px 32px; padding-inline-start: 20px; }
.jeama-product-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 16px; }
.jeama-product-grid > .jeama-product-card { margin-block: 0; padding: clamp(16px, 2vw, 24px); border: 1px solid var(--jeama-mineral); }
.jeama-product-card > h3:first-child { margin-block-start: 0; }
.jeama-product-card > p:last-child { margin-block-end: 0; }
.jeama-shop { width: min(calc(100% - 48px), 1240px); margin-inline: auto; padding-block: clamp(32px, 5vw, 72px); }
.jeama-shop .wp-block-post-title { margin-block-start: 0; }
.jeama-shop .wp-block-post-content > p { max-width: 66ch; }
.jeama-shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
    gap: clamp(16px, 2vw, 28px);
}
.jeama-shop-grid > .jeama-shop-card {
    min-width: 0;
    margin-block: 0;
    overflow: hidden;
    border: 1px solid var(--jeama-mineral);
    border-radius: 12px;
}
.jeama-shop-card .jeama-shop-photo { margin: 0; background: var(--jeama-paper); }
.jeama-shop-photo img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: contain;
}
.jeama-shop-copy { padding: clamp(16px, 2vw, 26px); }
.jeama-shop-copy > h2:first-child { margin-block-start: 0; font-size: clamp(1.2rem, 2vw, 1.5rem); }
.jeama-shop-copy > h3 { font-size: 1rem; }
.jeama-shop-copy > ul { padding-inline-start: 1.25em; }
.jeama-shop-copy > p:last-child { margin-block-end: 0; }
.jeama-glass-example { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 24px; align-items: center; padding: 24px; background: var(--jeama-mineral); }
.jeama-glass-example > .wp-block-image { margin-block: 0; }
.jeama-glass-example > .wp-block-group > h2:first-child { margin-block-start: 0; }
@media (max-width: 660px) {
    .jeama-glass-example { grid-template-columns: minmax(0, 1fr); padding: 16px; }
}

.jeama-quote-form { display: grid; max-width: 800px; gap: 15px; }
.jeama-quote-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.jeama-quote-form label { display: grid; gap: 4px; font-weight: 650; }
.jeama-quote-form input, .jeama-quote-form select, .jeama-quote-form textarea {
    box-sizing: border-box;
    width: 100%;
    min-height: 44px;
    padding: 8px 10px;
    border: 1px solid var(--jeama-steel);
    background: var(--jeama-paper);
    color: var(--jeama-graphite);
    font: inherit;
    font-weight: 400;
}
.jeama-quote-form textarea { resize: vertical; }
.jeama-quote-form input[type='file'] { padding: 6px; }
.jeama-quote-form input::file-selector-button { min-height: 30px; font: inherit; }
.jeama-quote-form > button { justify-self: start; cursor: pointer; border: 0; font-weight: 700; }
.jeama-quote-form > small { font-size: .83rem; }
.jeama-form-status { border-inline-start: 4px solid var(--jeama-sage); padding: 9px 14px; background: var(--jeama-paper); }
.jeama-quote-trap { display: none; }

/* Earlier patterns can still be used on secondary pages. */
.jeama-hero { padding-block: clamp(38px, 6vw, 90px); }
.jeama-hero h1 { font-size: clamp(2.6rem, 5.2vw, 4.8rem); }
.jeama-hero h1 em, .jeama-lead { color: var(--jeama-sage); }
.jeama-eyebrow { font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; }
.jeama-visual img, .jeama-work img { width: 100%; height: auto; object-fit: cover; }
.jeama-contact a { overflow-wrap: anywhere; }

@media (max-width: 980px) {
    .jeama-service-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 660px) {
    .jeama-front .jeama-v2-hero { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0; }
    .jeama-hero-photo { order: -1; }
    .jeama-hero-copy { padding: 23px 16px 26px; }
    .jeama-hero-copy h1 { font-size: clamp(2.25rem, 10vw, 3.15rem); }
    .jeama-v2-hero .wp-block-button, .jeama-v2-hero .wp-block-button__link { width: 100%; box-sizing: border-box; }
    .jeama-quote-fields, .jeama-service-grid { grid-template-columns: minmax(0, 1fr); }
}
