/* ==========================================================================
   Belleview — WordPress layer
   Maps block-editor markup onto the approved design system in main.css.
   A Section block     D Dynamic blocks        G Header + radius
   B Core block styles E Loose blocks + prose  H Utilities
   C Images + ratios   F Blog, project
   ========================================================================== */

/* A Section block --------------------------------------------------------- */
.container--wide { max-width: var(--w-wide); }

.bv-pad-top-none { padding-top: 0; }
.bv-pad-top-s { padding-top: clamp(1.5rem, 1rem + 2vw, 2.5rem); }
.bv-pad-top-m { padding-top: var(--space-block); }
.bv-pad-top-l { padding-top: var(--space-section); }
.bv-pad-bottom-none { padding-bottom: 0; }
.bv-pad-bottom-s { padding-bottom: clamp(1.5rem, 1rem + 2vw, 2.5rem); }
.bv-pad-bottom-m { padding-bottom: var(--space-block); }
.bv-pad-bottom-l { padding-bottom: var(--space-section); }

.bv-section--bg-white { background: var(--c-white); }
.bv-section--bg-black { background: var(--c-black); }
.bv-section--bg-charcoal { background: var(--c-charcoal); }

/* Anything on a dark surface reads light without per-block settings */
.bv-on-dark { color: var(--c-text-on-dark); }
.bv-on-dark :is(h1, h2, h3, h4) { color: var(--c-white); }
.bv-on-dark :is(.eyebrow, .is-style-eyebrow, .is-style-eyebrow-plain) { color: var(--c-silver); }
.bv-on-dark :is(.eyebrow, .is-style-eyebrow)::after { background: var(--c-line-on-dark); }
.bv-on-dark .is-style-lead { color: var(--c-white); }
.bv-on-dark .wp-block-image figcaption { color: var(--c-silver); }

.bv-layout { display: grid; grid-template-columns: minmax(0, 1fr); }
.bv-gap-none { gap: 0; }
.bv-gap-s { gap: 1rem; }
.bv-gap-m { gap: var(--gap); }
.bv-gap-l { gap: calc(var(--gap) * 2); }
.bv-layout--stack.bv-gap-m { gap: 1.5rem; }
.bv-layout--stack.bv-gap-l { gap: var(--gap); }
.bv-align-start { align-items: start; }
.bv-align-center { align-items: center; }
.bv-align-end { align-items: end; }
.bv-align-stretch { align-items: stretch; }

.bv-cols-2 { --bv-cols: repeat(2, minmax(0, 1fr)); }
.bv-cols-3 { --bv-cols: repeat(3, minmax(0, 1fr)); }
.bv-cols-4 { --bv-cols: repeat(4, minmax(0, 1fr)); }
.bv-cols-5 { --bv-cols: repeat(5, minmax(0, 1fr)); }
.bv-cols-6 { --bv-cols: repeat(6, minmax(0, 1fr)); }
.bv-ratio-7-5 { --bv-cols: minmax(0, 7fr) minmax(0, 5fr); }
.bv-ratio-5-7 { --bv-cols: minmax(0, 5fr) minmax(0, 7fr); }
.bv-ratio-8-4 { --bv-cols: minmax(0, 8fr) minmax(0, 4fr); }
.bv-ratio-4-8 { --bv-cols: minmax(0, 4fr) minmax(0, 8fr); }

.bv-layout--grid.bv-stack-never { grid-template-columns: var(--bv-cols); }
.bv-layout--row { display: flex; flex-wrap: wrap; }
.bv-layout--row > * { flex: 0 1 auto; min-width: 0; }
.bv-justify-center { justify-content: center; }
.bv-justify-end { justify-content: flex-end; }
.bv-justify-between { justify-content: space-between; }

/* Stacking: columns become one column below the chosen breakpoint */
@media (max-width: 43.99rem) {
  .bv-layout--row.bv-stack-mobile,
  .bv-layout--row.bv-stack-tablet { flex-direction: column; }
  .bv-stack-mobile.bv-stack-reverse > :first-child,
  .bv-stack-tablet.bv-stack-reverse > :first-child { order: 2; }
}
@media (min-width: 44rem) {
  .bv-layout--grid.bv-stack-mobile { grid-template-columns: var(--bv-cols); }
}
@media (min-width: 44rem) and (max-width: 61.99rem) {
  .bv-stack-mobile.bv-cols-4 { --bv-cols: repeat(2, minmax(0, 1fr)); }
  .bv-stack-mobile:is(.bv-cols-5, .bv-cols-6) { --bv-cols: repeat(3, minmax(0, 1fr)); }
  .bv-layout--row.bv-stack-tablet { flex-direction: column; }
  .bv-stack-tablet.bv-stack-reverse > :first-child { order: 2; }
}
@media (min-width: 62rem) {
  .bv-layout--grid.bv-stack-tablet { grid-template-columns: var(--bv-cols); }
}

/* B Core block styles ----------------------------------------------------- */
.wp-block-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.wp-block-buttons > .wp-block-button { display: flex; margin: 0; } /* flex, so the link sets the height with no inline line box around it */
.wp-block-button .wp-block-button__link.wp-element-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0.85rem 1.75rem;
  border: 2px solid var(--btn-bg);
  border-radius: var(--radius);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1.2;
  text-decoration: none;
  text-transform: uppercase;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.wp-block-button .wp-block-button__link.wp-element-button:is(:hover, :focus-visible) { background: var(--btn-hover-bg); color: var(--btn-hover-fg); }
.wp-block-button.is-style-outline .wp-block-button__link.wp-element-button { background: transparent; color: var(--btn-bg); }
.wp-block-button.is-style-outline .wp-block-button__link.wp-element-button:is(:hover, :focus-visible) { background: var(--btn-bg); color: var(--btn-fg); }
.wp-block-button.is-style-light .wp-block-button__link.wp-element-button { border-color: var(--c-white); background: var(--c-white); color: var(--c-black); }
.wp-block-button.is-style-light .wp-block-button__link.wp-element-button:is(:hover, :focus-visible) { background: transparent; color: var(--c-white); }
.wp-block-button.is-style-outline-light .wp-block-button__link.wp-element-button { border-color: var(--c-white); background: transparent; color: var(--c-white); }
.wp-block-button.is-style-outline-light .wp-block-button__link.wp-element-button:is(:hover, :focus-visible) { background: var(--c-white); color: var(--c-black); }
.wp-block-button.is-style-arrow .wp-block-button__link.wp-element-button {
  gap: 0.75rem;
  min-height: 0;
  padding: 0.4rem 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  border-radius: 0;
  background: none;
  color: var(--c-heading);
  line-height: 1.3;
}
.wp-block-button.is-style-arrow .wp-block-button__link::after {
  content: "\2192";
  font-size: 1.1em;
  letter-spacing: 0;
  line-height: 1;
  transition: transform 0.3s var(--ease);
}
.wp-block-button.is-style-arrow .wp-block-button__link:is(:hover, :focus-visible)::after { transform: translateX(0.35rem); }
.bv-on-dark .wp-block-button.is-style-arrow .wp-block-button__link.wp-element-button { color: var(--c-white); }

p.is-style-eyebrow,
p.is-style-eyebrow-plain {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: none;
  margin-bottom: clamp(1.25rem, 1rem + 1vw, 2rem);
  color: var(--c-text);
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: 0.18em;
  line-height: 1.4;
  text-transform: uppercase;
}
p.is-style-eyebrow { white-space: nowrap; }
p.is-style-eyebrow::after { content: ""; flex: 1; height: 1px; background: var(--c-line); }
p.is-style-lead { color: var(--c-heading); font-size: var(--fs-lead); line-height: 1.55; }
.letter__body .is-style-lead { font-size: clamp(1.25rem, 1.05rem + 0.9vw, 1.75rem); line-height: 1.45; }
.founder .wp-block-image figcaption { color: var(--c-silver); }
p.is-style-caption,
.wp-block-image figcaption {
  margin: 0.75rem 0 0;
  color: var(--c-text);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  line-height: 1.5;
  text-align: left;
  text-transform: uppercase;
}

ul.is-style-ruled { margin-top: 1.5rem; border-top: 1px solid var(--c-line); }
ul.is-style-ruled li { padding: 0.7rem 0; border-bottom: 1px solid var(--c-line); color: var(--c-heading); font-size: var(--fs-small); font-weight: 500; }

.wp-block-group.is-style-card,
.wp-block-group.is-style-card-dark { padding: clamp(1.5rem, 1rem + 2vw, 2.25rem); border: 1px solid var(--c-line); border-radius: var(--radius); }
.wp-block-group.is-style-card-dark { border-color: var(--c-black); background: var(--c-black); color: var(--c-text-on-dark); }
.wp-block-group.is-style-card-dark :is(h2, h3, h4) { color: var(--c-white); }

.wp-block-quote { margin: 0; padding: 0; border: 0; }
.founder__quote cite { display: block; margin-top: 2rem; color: var(--c-silver); font-size: var(--fs-eyebrow); font-style: normal; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; }

/* Section parts that are now nested blocks */
.hero__content > p.is-style-eyebrow-plain { color: var(--c-white); }
.hero__actions .wp-block-button { flex: 1 1 12rem; }
.hero__actions .wp-block-button__link { width: 100%; }
@media (min-width: 44rem) { .hero__actions .wp-block-button { flex: 0 0 auto; } }
.page-hero__eyebrow.page-hero__eyebrow { margin-bottom: 0; }
p.hero__eyebrow { margin-bottom: 1.25rem; color: var(--c-white); font-size: 0.6875rem; letter-spacing: 0.12em; white-space: normal; }
@media (min-width: 44rem) { p.hero__eyebrow { font-size: var(--fs-eyebrow); letter-spacing: 0.18em; } }
.country--dark :is(h2, h3) { color: var(--c-white); }
.country__address { font-style: normal; }
.office-note__address { font-style: normal; line-height: 1.7; }
.office-note__address a { color: var(--c-white); text-decoration: underline; text-underline-offset: 0.25em; }
.office-note .office-note__title { color: var(--c-white); }
.office-note :is(.is-style-eyebrow, .is-style-eyebrow-plain) { color: var(--c-silver); }
.letter__signature p { max-width: none; }
.division__index, .service-row__index { max-width: none; }

/* C Images + ratios ------------------------------------------------------- */
.wp-block-image { margin: 0; }
.wp-block-image.is-style-slats img { display: block; width: 100%; height: 100%; object-fit: cover; filter: var(--img-filter); }
.wp-block-image.is-style-slats > .media { display: block; width: 100%; height: 100%; border-radius: var(--radius); }
.has-ratio-21-9 > :is(.media, img) { aspect-ratio: 21 / 9; }
.has-ratio-16-9 > :is(.media, img) { aspect-ratio: 16 / 9; }
.has-ratio-16-10 > :is(.media, img) { aspect-ratio: 16 / 10; }
.has-ratio-3-2 > :is(.media, img) { aspect-ratio: 3 / 2; }
.has-ratio-4-3 > :is(.media, img) { aspect-ratio: 4 / 3; }
.has-ratio-5-4 > :is(.media, img) { aspect-ratio: 5 / 4; }
.has-ratio-1-1 > :is(.media, img) { aspect-ratio: 1 / 1; }
.has-ratio-4-5 > :is(.media, img) { aspect-ratio: 4 / 5; }
.has-ratio-3-4 > :is(.media, img) { aspect-ratio: 3 / 4; }
[class*="has-ratio-"] > .media,
[class*="has-ratio-"] > img { height: auto; }
.founder__figure > .media { background: var(--c-black); }
.gallery > .wp-block-image > :is(.media, img) { aspect-ratio: 16 / 9; height: auto; }
.gallery > .gallery__item--tall > :is(.media, img) { aspect-ratio: 3 / 4; }
.gallery > .gallery__item--wide > :is(.media, img) { aspect-ratio: 21 / 6; }

/* D Dynamic blocks -------------------------------------------------------- */
.work__grid--feature .work-card--slot-1 .work-card__media { aspect-ratio: 6 / 5; }
.work__grid--feature :is(.work-card--slot-3, .work-card--slot-4, .work-card--slot-5) .work-card__media { aspect-ratio: 4 / 5; }
.work__grid--feature .work-card--slot-6 .work-card__media { aspect-ratio: 3 / 2; }
@media (min-width: 44rem) {
  .work__grid--feature :is(.work-card--slot-1, .work-card--slot-6) { grid-column: 1 / -1; }
}
@media (min-width: 62rem) {
  .work__grid--feature .work-card--slot-1 { grid-column: 1 / span 7; }
  .work__grid--feature .work-card--slot-2 { grid-column: 8 / span 5; margin-top: clamp(4rem, 10vw, 9rem); }
  .work__grid--feature .work-card--slot-3 { grid-column: 1 / span 4; }
  .work__grid--feature .work-card--slot-4 { grid-column: 5 / span 4; margin-top: clamp(2.5rem, 5vw, 5rem); }
  .work__grid--feature .work-card--slot-5 { grid-column: 9 / span 4; }
  .work__grid--feature .work-card--slot-6 { grid-column: 3 / span 8; }
}
div.work-card__link { cursor: default; }
.bv-form__fallback a { color: var(--c-link); text-decoration: underline; text-underline-offset: 0.25em; }
.bv-placeholder { max-width: none; padding: 1rem 1.25rem; border: 1px dashed var(--c-silver); color: var(--c-text); font-size: var(--fs-small); line-height: 1.5; }

/* E Loose blocks + prose -------------------------------------------------- */
/* Blocks dropped straight onto a page (outside any Section) still sit on the site grid */
.entry-content > :not(.bv-section):not(section):not(figure.page-banner):not(span):not(.alignfull) {
  width: min(100% - 2 * var(--gutter), var(--w-max));
  margin-inline: auto;
  margin-block: 1.5rem;
}
.entry-content > .alignwide { width: min(100% - 2 * var(--gutter), var(--w-wide)); }

.prose { max-width: var(--w-text); }
.prose > * + * { margin-top: 1.25em; }
.prose :is(h2, h3, h4) { margin-top: 2em; }
.prose h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.125rem); }
.prose h3 { font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem); }
.prose > :first-child { margin-top: 0; }
.prose a:not(.btn):not(.wp-block-button__link):not(.link-arrow) { color: var(--c-link); text-decoration: underline; text-underline-offset: 0.2em; }
.prose a:not(.btn):not(.wp-block-button__link):not(.link-arrow):hover { color: var(--c-link-hover); }
.prose :is(ul, ol):not([class*="is-style"]) { padding-left: 1.25em; }
.prose ul:not([class*="is-style"]) { list-style: square; }
.prose ol:not([class*="is-style"]) { list-style: decimal; }
.prose li + li { margin-top: 0.4em; }
.prose blockquote { padding-left: 1.5rem; border-left: 2px solid var(--c-black); color: var(--c-heading); font-size: var(--fs-lead); }
.prose hr { height: 1px; border: 0; background: var(--c-line); margin-block: 2.5em; }
.prose table { width: 100%; border-collapse: collapse; font-size: var(--fs-small); }
.prose :is(th, td) { padding: 0.75rem 1rem; border: 1px solid var(--c-line); text-align: left; vertical-align: top; }
.prose th { color: var(--c-heading); font-weight: 600; }
.prose .wp-block-table { overflow-x: auto; }
.prose img { height: auto; border-radius: var(--radius); }
.prose code { padding: 0.1em 0.35em; border: 1px solid var(--c-line); font-size: 0.9em; }

/* F Blog, project --------------------------------------------------------- */
.post__title a { color: inherit; }
.post__title a:hover { text-decoration: underline; text-underline-offset: 0.15em; }
.bv-pagination { margin-top: var(--space-block); padding-top: 2rem; border-top: 1px solid var(--c-line); }
.bv-pagination .nav-links { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.bv-pagination .page-numbers,
.bv-pagination .post-page-numbers {
  display: grid;
  place-items: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0 0.9rem;
  border: 1px solid var(--c-line);
  border-radius: var(--radius);
  color: var(--c-heading);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.bv-pagination .page-numbers.current,
.bv-pagination a.page-numbers:is(:hover, :focus-visible) { border-color: var(--c-black); background: var(--c-black); color: var(--c-white); }
.bv-search { display: flex; gap: 0.5rem; }
.bv-search .field__control { flex: 1; min-width: 0; }
.bv-search .btn { min-height: 3.25rem; padding-inline: 1.1rem; }
.widget .bv-search { flex-direction: column; }
.widget__list a[aria-current] { text-decoration: underline; text-underline-offset: 0.25em; }
.single-post__foot { margin-top: var(--space-block); padding-top: 2rem; border-top: 1px solid var(--c-line); }
.single-post__tags { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; max-width: none; }
.single-post__tags span,
.single-post__nav span { color: var(--c-text); font-size: var(--fs-eyebrow); font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; }
.single-post__tags a { padding: 0.3rem 0.7rem; border: 1px solid var(--c-line); font-size: 0.8125rem; text-decoration: none !important; }
.single-post__nav { display: grid; gap: 1.5rem; margin-top: 2rem; }
.single-post__nav span { display: block; margin-bottom: 0.4rem; }
.single-post__nav a { color: var(--c-heading) !important; font-family: var(--font-display); font-size: 1.125rem; font-weight: 500; line-height: 1.3; text-decoration: none !important; }
@media (min-width: 44rem) { .single-post__nav { grid-template-columns: 1fr 1fr; } .single-post__next { text-align: right; } }
.project__specs { margin: 0; border-top: 1px solid var(--c-black); }
.project__specs div { display: grid; grid-template-columns: 9rem 1fr; gap: 1rem; padding: 0.85rem 0; border-bottom: 1px solid var(--c-line); }
.project__specs dt { font-size: var(--fs-eyebrow); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; padding-top: 0.2em; }
.project__specs dd { margin: 0; color: var(--c-heading); font-weight: 500; }
.project__gallery { display: grid; gap: var(--gap); margin-top: var(--space-block); }
.project__gallery .media { aspect-ratio: 4 / 3; }
@media (min-width: 44rem) { .project__gallery { grid-template-columns: 1fr 1fr; } }

/* G Header + radius ------------------------------------------------------- */
.brand__mark { height: clamp(2rem, 1.7rem + 1vw, var(--logo-h, 2.625rem)); }
.brand__img { width: auto; height: var(--logo-h, 2.625rem); max-width: 60vw; object-fit: contain; }
.brand__img--dark { display: none; }
.site-header--solid:not(.site-header--menu-open) .brand__img--light { display: none; }
.site-header--solid:not(.site-header--menu-open) .brand__img--dark { display: block; }
.has-solid-header main { padding-top: var(--header-h); }
.admin-bar .site-header { top: 32px; }
.admin-bar .mobile-menu { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header, .admin-bar .mobile-menu { top: 46px; } }
@media (max-width: 600px) { .admin-bar .site-header:not([data-sticky="static"]) { top: 0; } }
.filter__btn, .field__control, .value, .country, .office, .widget, .media { border-radius: var(--radius); }
.site-footer__legal a { display: inline-block; }

/* H Utilities ------------------------------------------------------------- */
.screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Grid and flex children must be allowed to shrink below their content's intrinsic width */
:is(.wp-block-group, .wp-block-image, .wp-block-buttons, .wp-block-quote, .work-card, .post, .office) { min-width: 0; }
.wp-block-image :is(.media, img) { min-width: 0; max-width: 100%; }

/* Free-form content: blocks stacked inside a plain Group get a default rhythm (approved sections set their own) */
.bv-layout .wp-block-group:not([class*="__"]) > * + * { margin-top: 1rem; }
.bv-layout .wp-block-group:not([class*="__"]) > :is(h2, h3, h4) + * { margin-top: 0.75rem; }
.bv-layout .wp-block-group:not([class*="__"]) > .wp-block-buttons { margin-top: 1.5rem; }

/* Comments (Journal posts, when enabled) */
.comments { margin-top: var(--space-block); padding-top: 2rem; border-top: 1px solid var(--c-line); }
.comments__title { font-size: var(--fs-h3); font-weight: 500; }
.comments__list { margin-top: 1.5rem; list-style: none; padding: 0; }
.comments__list .comment-body { padding: 1.25rem 0; border-bottom: 1px solid var(--c-line); }
.comments__list .children { padding-left: 1.5rem; list-style: none; }
.comment-meta { font-size: var(--fs-small); }
.comment-form { display: grid; gap: 1rem; margin-top: 1.5rem; }
.comment-form label { display: block; margin-bottom: 0.4rem; color: var(--c-heading); font-size: var(--fs-eyebrow); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
.comment-form :is(input[type="text"], input[type="email"], input[type="url"], textarea) {
  width: 100%;
  max-width: 100%;
  min-height: 3.25rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--c-silver);
  border-radius: var(--radius);
  background: var(--c-white);
  color: var(--c-heading);
  font: inherit;
}
.comment-form .comment-form-cookies-consent label { display: inline; letter-spacing: 0; text-transform: none; font-weight: 400; font-size: var(--fs-small); }
