/* The calm design language (owner, 2026-11-14), our own code: inc/calm.php, header.php (mega menu),
   front-page.php, template-parts/projects/. Loaded on every page after style.css; Tailwind is printed after it,
   so the rules here carry a parent class to outweigh single utility classes.

   Pages with the body class "bm-calm" (home, projects list, project categories, project pages) get the
   off-white page; the mega menu takes the colour of the page it opens on. */

body {
    --bm-page: #fff;
    --bm-ink: #1a1a1a;
    --bm-grey: #6b6e74;
    --bm-grey-light: #8d9096;
    --bm-tile: #ebe8e3;
    --bm-radius: 4px;
    --bm-side: 20px;
}

@media (min-width: 768px) {
    body { --bm-side: 40px; }
}

@media (min-width: 1200px) {
    body { --bm-side: 86px; }
}

body.bm-calm {
    --bm-page: #f8f8f8;
    background: var(--bm-page);
}

body.bm-calm main {
    background: var(--bm-page);
}

body.bm-calm #site-header:not(.site-header-dark) {
    background-color: var(--bm-page);
}

/* ---------- Shared pieces ---------- */

.bm-chev {
    display: inline-block;
    flex: none;
    vertical-align: middle;
}

:root[dir="rtl"] .bm-chev {
    transform: scaleX(-1);
}

/* Grey secondary link with a chevron. */
.bm-more,
a.bm-more {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 15px;
    line-height: 1.4;
    letter-spacing: .02em;
    color: var(--bm-grey);
    text-decoration: none;
    transition: color .3s ease;
}

a.bm-more:hover,
a:hover > .bm-more,
a:focus-visible > .bm-more {
    color: var(--bm-ink);
}

/* Section frame: wide side margins, generous space. */
body .bm-wrap {
    max-width: none;
    margin-inline: 0;
    padding-inline: var(--bm-side);
}

body .bm-section {
    padding-top: 56px;
    padding-bottom: 56px;
}

@media (min-width: 1024px) {
    body .bm-section {
        padding-top: 96px;
        padding-bottom: 96px;
    }
}

body .bm-head {
    margin-bottom: 28px;
}

@media (min-width: 1024px) {
    body .bm-head {
        margin-bottom: 40px;
    }
}

body .bm-head--split {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px 32px;
}

/* Large, light heading with tight letter spacing. */
body .bm-title,
body.bm-calm h1.section-title,
body.bm-calm main h2.section-title {
    font-size: 28px;
    line-height: 1.3;
    font-weight: 400;
    letter-spacing: .01em;
    text-transform: none;
    color: var(--bm-ink);
    margin: 0;
}

@media (min-width: 1024px) {
    body .bm-title,
    body.bm-calm h1.section-title,
    body.bm-calm main h2.section-title {
        font-size: 38px;
    }
}

/* Photo tile: picture, name under it (mega menu, home categories). */
a.bm-tile {
    display: block;
    color: var(--bm-ink);
    text-decoration: none;
}

.bm-tile .bm-tile__media,
.bm-card .bm-card__media {
    display: block;
    overflow: hidden;
    border-radius: var(--bm-radius);
    background: var(--bm-tile);
}

.bm-tile .bm-tile__media {
    aspect-ratio: 1 / 1;
}

.bm-tile .bm-tile__img,
.bm-card .bm-card__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    transition: transform .9s cubic-bezier(.19, 1, .22, 1);
}

/* A slight zoom of the picture on hover, on these tiles only (style.css switches it off elsewhere). */
.bm-tile:hover .bm-tile__img,
.bm-card:hover .bm-card__img {
    transform: scale(1.035) !important;
}

@media (prefers-reduced-motion: reduce) {
    .bm-tile .bm-tile__img,
    .bm-card .bm-card__img {
        transition: none;
    }

    .bm-tile:hover .bm-tile__img,
    .bm-card:hover .bm-card__img {
        transform: none !important;
    }
}

.bm-tile .bm-tile__name {
    display: block;
    margin: 12px 0 0;
    font-size: 15px;
    line-height: 1.4;
    font-weight: 400;
    letter-spacing: .02em;
    text-transform: none;
    color: var(--bm-ink);
}

a.bm-tile:focus-visible,
a.bm-card:focus-visible {
    outline: 2px solid var(--bm-ink);
    outline-offset: 4px;
    border-radius: var(--bm-radius);
}

/* ---------- Mega menu (#products-menu) ---------- */

#products-menu.bm-mm {
    top: var(--header-height);
    height: auto;
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--bm-page);
    color: var(--bm-ink);
    /* a light veil over the page below the panel; a shadow, so the pointer passes through it */
    box-shadow: 0 50vh 0 50vh rgba(26, 26, 26, .07);
}

.bm-mm .bm-mm__inner {
    padding: 8px var(--bm-side) 44px;
}

.bm-mm .bm-mm__label {
    margin: 0 0 18px;
    font-size: 15px;
    line-height: 1.5;
    font-weight: 500;
    letter-spacing: .03em;
    color: var(--bm-grey-light);
}

.bm-mm .bm-mm__rail {
    position: relative;
}

.bm-mm .bm-mm__row {
    display: flex;
    gap: 24px;
    margin: 0;
    padding: 0 0 6px;
    list-style: none;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
}

.bm-mm .bm-mm__row::-webkit-scrollbar {
    display: none;
}

.bm-mm .bm-mm__cell {
    flex: 0 0 156px;
    scroll-snap-align: start;
}

.bm-mm .bm-tile__name {
    font-size: 14px;
}

.bm-mm .bm-mm__arrow {
    position: absolute;
    top: 78px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    margin-top: -19px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .94);
    color: var(--bm-ink);
    box-shadow: 0 1px 6px rgba(0, 0, 0, .14);
    cursor: pointer;
}

.bm-mm .bm-mm__arrow[hidden] {
    display: none;
}

.bm-mm .bm-mm__arrow--prev {
    inset-inline-start: -14px;
}

.bm-mm .bm-mm__arrow--next {
    inset-inline-end: -14px;
}

/* The "previous" arrow points back. */
:root:not([dir="rtl"]) .bm-mm__arrow--prev .bm-chev {
    transform: scaleX(-1);
}

:root[dir="rtl"] .bm-mm__arrow--prev .bm-chev {
    transform: none;
}

.bm-mm .bm-mm__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 12px 48px;
    margin-top: 30px;
}

.bm-mm a.bm-mm__all {
    font-size: 14px;
    letter-spacing: .02em;
    color: var(--bm-ink);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 6px;
}

.bm-mm .bm-mm__new {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--bm-grey-light);
}

.bm-mm .bm-mm__new a {
    color: var(--bm-grey);
    text-decoration: none;
    transition: color .3s ease;
}

.bm-mm .bm-mm__new a:hover {
    color: var(--bm-ink);
}

/* ---------- Home: intro, categories, projects, logos ---------- */

body.bm-calm .bm-intro {
    padding-top: 56px;
    padding-bottom: 8px;
}

@media (min-width: 1024px) {
    body.bm-calm .bm-intro {
        padding-top: 112px;
        padding-bottom: 16px;
    }
}

body.bm-calm .bm-intro h1.section-title {
    margin-bottom: 0;
}

body.bm-calm .bm-intro .home-intro {
    font-size: 18px;
    line-height: 1.65;
    letter-spacing: .01em;
    color: #3b3d41;
}

@media (min-width: 1024px) {
    body.bm-calm .bm-intro .home-intro {
        font-size: 20px;
    }
}

body.bm-calm .bm-intro a.animated-link {
    font-size: 16px;
    letter-spacing: .02em;
}

.bm-cats .bm-cats__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

@media (min-width: 768px) {
    .bm-cats .bm-cats__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 40px 24px;
    }
}

@media (min-width: 1200px) {
    .bm-cats .bm-cats__grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 32px;
    }
}

.bm-cats .bm-tile__media {
    aspect-ratio: 4 / 3;
}

.bm-cats .bm-tile__name {
    margin-top: 14px;
}

/* Project cards: tall pictures (6:7), name, then a grey "details" link line. */
.bm-projects .bm-projects__top {
    margin-bottom: 0;
}

.bm-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 28px;
    margin: -12px 0 32px;
    padding: 0;
    list-style: none;
    font-size: 14px;
    letter-spacing: .02em;
    color: var(--bm-grey-light);
}

.bm-tabs a {
    color: var(--bm-grey);
    text-decoration: none;
    transition: color .3s ease;
}

.bm-tabs a:hover {
    color: var(--bm-ink);
}

.bm-projects .bm-rail {
    overflow: hidden;
}

/* 2026-11-14 (owner): cards about a quarter of their earlier size, so many more projects fit in one row. */
.bm-projects .bm-slide {
    width: 42%;
    height: auto;
}

@media (min-width: 768px) {
    .bm-projects .bm-slide {
        /* about four and a half cards in view on tablets */
        width: calc((100% - 4 * 32px) / 4.5);
    }
}

@media (min-width: 1200px) {
    .bm-projects .bm-slide {
        /* about seven and a half cards in view, 32px apart: the eighth is cut at the edge */
        width: calc((100% - 7 * 32px) / 7.5);
    }
}

a.bm-card {
    display: block;
    color: var(--bm-ink);
    text-decoration: none;
}

.bm-projects .bm-card__media {
    aspect-ratio: 6 / 7;
}

.bm-card .bm-card__name {
    margin: 18px 0 0;
    font-size: 19px;
    line-height: 1.35;
    font-weight: 400;
    letter-spacing: .01em;
    text-transform: none;
    color: var(--bm-ink);
}

@media (min-width: 1024px) {
    .bm-card .bm-card__name {
        font-size: 22px;
    }
}

/* The smaller project cards carry smaller captions. */
.bm-projects .bm-card .bm-card__name { margin-top: 12px; font-size: 14px; line-height: 1.35; }
@media (min-width: 1024px) { .bm-projects .bm-card .bm-card__name { font-size: 15px; } }
.bm-projects .bm-card .bm-card__line { margin-top: 3px; font-size: 12px; }
.bm-projects .bm-card .bm-more { margin-top: 4px; font-size: 13px; }

/* Home intro title: balanced lines, no single word left alone on the second line. */
body.bm-calm .bm-intro h1.bm-intro__title { text-wrap: balance; }
.bm-intro .bm-intro__inner { max-width: 680px; }

.bm-card .bm-card__line {
    display: block;
    margin-top: 6px;
    font-size: 14px;
    letter-spacing: .02em;
    color: var(--bm-grey-light);
}

.bm-card .bm-more {
    margin-top: 8px;
}

/* Logos: white tiles without borders on the off-white page. */
body.bm-calm .bm-logos .bm-head {
    margin-bottom: 28px;
}

body.bm-calm .bm-brands .home-marquee {
    max-width: none;
}

.bm-logos .bm-logos__more {
    margin-top: 28px;
}

/* ---------- Projects list, project categories, project pages ---------- */

body.bm-calm main > section.max-w-screen-2xl,
body.bm-calm main section > .max-w-screen-2xl {
    max-width: none;
    padding-inline: var(--bm-side);
}

/* Page title: large and light. */
body.bm-calm main h1.barami-title,
body.post-type-archive-project main h1 {
    font-size: 32px;
    line-height: 1.25;
    font-weight: 400;
    letter-spacing: .01em;
    text-transform: none;
}

@media (min-width: 1024px) {
    body.bm-calm main h1.barami-title,
    body.post-type-archive-project main h1 {
        font-size: 48px;
    }
}

/* Breadcrumbs and the sand strips: no coloured band, a hairline instead. */
body.bm-calm main section[aria-label="פירורי לחם"] {
    background: transparent;
    border-top: 1px solid rgba(26, 26, 26, .08);
    border-bottom: 1px solid rgba(26, 26, 26, .08);
}

body.bm-calm main section[aria-label="פירורי לחם"] > div > div {
    min-height: 64px;
    color: var(--bm-grey);
    letter-spacing: .02em;
}

/* Category links of the projects: grey, the current one dark. */
body.bm-calm main .filter-wrap {
    gap: 10px 32px;
    font-size: 14px;
    letter-spacing: .02em;
    text-transform: none;
}

/* The grid of project cards: big pictures in two columns, captions under them. */
.bm-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 48px;
}

@media (min-width: 768px) {
    .bm-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 72px 32px;
    }
}

.bm-grid .bm-card__media {
    aspect-ratio: 4 / 3;
}

.bm-grid .bm-card__name {
    font-size: 19px;
}

@media (min-width: 1024px) {
    .bm-grid .bm-card__name {
        font-size: 22px;
    }
}

/* Project page: the text rows lighter and quieter. */
body.single-project.bm-calm main .barami-content,
body.tax-project_category.bm-calm main .barami-content,
body.post-type-archive-project.bm-calm main .barami-content {
    font-size: 18px;
    line-height: 1.7;
    letter-spacing: .01em;
    color: #3b3d41;
}

body.bm-calm main p[class*="tracking-[7.258px]"] {
    font-size: 24px;
    font-weight: 400;
    letter-spacing: .01em;
    text-transform: none;
    color: var(--bm-ink);
}

@media (min-width: 1024px) {
    body.bm-calm main p[class*="tracking-[7.258px]"] {
        font-size: 30px;
    }
}

/* Project gallery: the first picture across the whole width, the rest in two columns, 32px apart. */
body.single-project.bm-calm main .grid:has(> .barami-lightbox-trigger) {
    gap: 32px;
}

/* Every picture in the same calm frame (3:2, the whole picture opens in the lightbox), the first one wider. */
body.single-project.bm-calm main .grid > .barami-lightbox-trigger img {
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    object-fit: cover;
}

@media (min-width: 768px) {
    body.single-project.bm-calm main .grid > .barami-lightbox-trigger:first-child {
        grid-column: 1 / -1;
    }

    body.single-project.bm-calm main .grid > .barami-lightbox-trigger:first-child img {
        aspect-ratio: 16 / 9;
    }
}

body.bm-calm main .barami-lightbox-trigger,
body.bm-calm main .barami-lightbox-trigger img {
    border-radius: var(--bm-radius);
}

/* "Related" blocks: the off-white page instead of alternating sand; light headings; small corners. */
body.bm-calm main section.bg-\[\#F5F1E8\],
body.bm-calm main section.bg-\[\#fff\] {
    background: var(--bm-page);
}

body.bm-calm main section h2[class*="tracking-[7.258px]"] {
    font-weight: 400;
    letter-spacing: .01em;
    text-transform: none;
}

body.bm-calm main .barami-related-card .product-item__media,
body.bm-calm main .barami-related-card img {
    border-radius: var(--bm-radius);
}

/* Home intro, 2026-11-14 (owner: same text, narrower and shorter, minimalist): one centred column of
   reading width, smaller type, little white space above and below. */
body.bm-calm .bm-intro { padding-top: 48px; padding-bottom: 8px; }
@media (min-width: 1024px) { body.bm-calm .bm-intro { padding-top: 72px; padding-bottom: 8px; } }
.bm-intro .bm-intro__inner { max-width: 640px; margin: 0 auto; text-align: center; }
body.bm-calm .bm-intro h1.bm-intro__title {
    margin: 0 0 18px;
    font-size: 22px;
    line-height: 1.4;
    font-weight: 400;
    letter-spacing: .02em;
    text-transform: none;
    color: #1A1A1A;
}
@media (min-width: 768px) { body.bm-calm .bm-intro h1.bm-intro__title { font-size: 26px; } }
body.bm-calm .bm-intro .home-intro { margin: 0 0 14px; font-size: 16px; line-height: 1.75; letter-spacing: 0; color: #4a4c50; }
@media (min-width: 768px) { body.bm-calm .bm-intro .home-intro { font-size: 17px; } }
body.bm-calm .bm-intro .home-intro p + p { margin-top: .6em; }
body.bm-calm .bm-intro a.animated-link { font-size: 14px; letter-spacing: .04em; }

/* Home clients, 2026-11-14 (owner): tiles about half the size, and every client shown. */
.bm-clients .bm-clients__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}
@media (min-width: 640px) { .bm-clients .bm-clients__grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .bm-clients .bm-clients__grid { grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 10px; } }
@media (min-width: 1400px) { .bm-clients .bm-clients__grid { grid-template-columns: repeat(12, minmax(0, 1fr)); } }
.bm-clients .bm-clients__cell { height: 46px; padding: 6px 8px; }
@media (min-width: 1024px) { .bm-clients .bm-clients__cell { height: 52px; } }

/* Home brands, 2026-11-14 (owner): one still grid of small colour logos, each opens that maker's products. */
.barami-brands--home { padding-inline: 0; max-width: none; }
.barami-brands--home .barami-brands__list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}
@media (min-width: 640px) { .barami-brands--home .barami-brands__list { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .barami-brands--home .barami-brands__list { grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 10px; } }
.barami-brands--home .barami-brands__item {
    height: 64px;
    padding: 10px 12px;
    background: #fff;
    border: 0;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.barami-brands--home .barami-brands__item img {
    filter: none !important;
    opacity: 1 !important;
    max-width: 100%;
    max-height: 34px;
    width: auto;
    height: auto;
    object-fit: contain;
}
.barami-brands--home .barami-brands__item:hover { box-shadow: 0 0 0 1px #9C6C2E inset; }

/* Forms in Hebrew: every field, phone and e-mail too, sits on the right (the browser puts tel/e-mail
   fields left-to-right); in the English form all of them sit on the left. */
:is(.barami-form, .contact-box) input[type="tel"],
:is(.barami-form, .contact-box) input[type="email"] { text-align: right; }
:is(.barami-form, .contact-box) input[type="tel"]:placeholder-shown,
:is(.barami-form, .contact-box) input[type="email"]:placeholder-shown { direction: rtl; }
.contact-box[dir="ltr"] .wpcf7,
.contact-box[dir="ltr"] .wpcf7-form { direction: ltr; text-align: left; }
.contact-box[dir="ltr"] :is(input, textarea, select) { direction: ltr !important; text-align: left !important; }

/* Home brand tiles: beat the catalogue strip's own sizes (part-catalogue.css loads after this file). */
section.barami-brands--home .barami-brands__list { display: grid; }
section.barami-brands--home .barami-brands__cell { width: auto; }
section.barami-brands--home .barami-brands__item { width: 100%; height: 64px; flex-direction: column; gap: 4px; }
/* Tiles with the "exclusive representative" line: one height for the whole grid, a little room at the sides. */
section.barami-brands--home .barami-brands__list:has(.is-exclusive) .barami-brands__item { height: 80px; padding: 8px 6px; }
section.barami-brands--home .barami-brands__excl { font-size: 11px; }
section.barami-brands--home .barami-brands__img { width: calc(var(--w) * .62); height: calc(var(--h) * .62); max-width: 100%; filter: none; opacity: 1; }
