/**
 * Consistency Block Styles
 *
 * Single source of truth for block styles.
 * Used by both the editor and published sites.
 *
 * Variables used:
 * - --design-font: Font family
 * - --design-text: Text color
 * - --design-background: Background color
 * - --design-primary: Primary/accent color
 * - --design-radius: Border radius
 * - --design-border: Border color (falls back to rgba)
 * - --design-selection: Text selection highlight color
 */

/* ==========================================================================
   PUBLISHED SITE BASE STYLES
   These styles are used by published sites (not the editor)
   ========================================================================== */

/* Cross-page view transitions */
@view-transition {
  navigation: auto;
}



/* Global reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --sticky-nav-color: rgba(255, 182, 193, 0.85);
}

/* Body base styles — background-color is the nav color so Safari elastic
   overscroll at the top/bottom matches the header.  The actual page background
   (--design-background) is applied on .page-wrapper. */
body {
  font-family: var(--design-font);
  line-height: 1.5;
  color: var(--design-text);
  background-color: var(--design-nav-color, var(--design-background));
  min-height: 100vh;
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Mobile published pages: follow dynamic viewport changes when browser
   chrome (address bar) expands/collapses. */
.mobile body {
  min-height: 100vh;
  min-height: 100dvh;
}

::selection {
  background: var(--design-selection, #b4d5fe);
}

/* Grid backgrounds — applied on .page-wrapper so they layer on
   top of the design background while body keeps the nav color for overscroll.
   --grid-color and --grid-color-effective are set inline from design settings. */
.show-grid--grid {
  background-image:
    linear-gradient(90deg, var(--grid-color-effective, var(--grid-color, #e0e0e0)) 0 1px, transparent 1px),
    linear-gradient(var(--design-background, #fff), var(--design-background, #fff)),
    linear-gradient(0deg, var(--grid-color-effective, var(--grid-color, #e0e0e0)) 0 1px, transparent 1px);
  background-size: 20px 20px, 100% 20px, 20px 20px;
  background-repeat: repeat, no-repeat, repeat;
  background-position: calc(50vw - 0.5px) -12.5px;
}

.show-grid--lines {
  background-image:
    linear-gradient(var(--design-background, #fff), var(--design-background, #fff)),
    linear-gradient(0deg, var(--grid-color-effective, var(--grid-color, #e0e0e0)) 0 1px, transparent 1px);
  background-size: 100% 20px, 20px 20px;
  background-repeat: no-repeat, repeat;
  background-position: 0 0, calc(50vw - 0.5px) -12.5px;
}

.show-grid--dots {
  background-image: radial-gradient(
    circle,
    var(--grid-color-effective, var(--grid-color, #e0e0e0)) 0.75px,
    transparent 0.75px
  );
  background-size: 20px 20px;
  background-position: calc(50vw - 0.5px) -12.5px;
}

/* Page wrapper - container for grid snapping.
   Carries the design background color so the page content area is coloured
   independently of the body (which uses the nav color for overscroll). */
.page-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: max(100vh, 1000px);
  width: 100%;
  container-type: inline-size;
  container-name: page;
  background-color: var(--design-background);
}

/* On mobile, don't pin to the 1000px floor — let the page track viewport
   height so content shifts correctly as browser UI hides/shows. */
.mobile .page-wrapper {
  min-height: 100vh;
  min-height: 100dvh;
}

/* ==========================================================================
   BLOCK STYLES (shared by editor and published sites)
   ========================================================================== */

/* Reset - scoped to content area only */
.content *,
.content *::before,
.content *::after {
  box-sizing: border-box;
}

/* Text elements - line-heights snap to 20px grid, text-box-trim for tight bounding boxes */
.builder-canvas__blocks h1,
.builder-canvas__blocks h2,
.builder-canvas__blocks h3,
.builder-canvas__blocks p,
.content h1,
.content h2,
.content h3,
.content p {
  overflow-wrap: break-word;
  word-break: break-word;
  max-width: 100%;
  margin: 0;
  text-box-edge: cap alphabetic;
}

.builder-canvas__blocks h1,
.content h1 {
  font-family: var(--design-font, "GT America", Inter, sans-serif);
  font-size: 32px;
  font-weight: 600;
  line-height: 40px;
}

.builder-canvas__blocks h2,
.content h2 {
  font-family: var(--design-font, "GT America", Inter, sans-serif);
  font-size: 24px;
  font-weight: 600;
  line-height: 40px;
}

.builder-canvas__blocks h3,
.content h3 {
  font-family: var(--design-font, "GT America", Inter, sans-serif);
  font-size: 18px;
  font-weight: 600;
  line-height: 40px;
}

.builder-canvas__blocks p,
.content p {
  font-family: var(--design-font, "GT America", Inter, sans-serif);
  font-size: 16px;
  line-height: 20px;
}

.rich-text {
  color: var(--design-text, inherit);
  overflow-wrap: break-word;
  word-break: break-word;
  max-width: 100%;
}

.rich-text a {
  color: var(--design-primary, #1e1e1e);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.rich-text--headline {
  font-family: var(--design-font, "GT America", Inter, sans-serif);
  font-size: var(--text-h1);
  font-weight: var(--font-weight-semibold);
  line-height: 40px;
}

.rich-text--heading {
  font-family: var(--design-font, "GT America", Inter, sans-serif);
  font-size: var(--text-h2);
  font-weight: var(--font-weight-semibold);
  line-height: 40px;
}

.rich-text--subheading {
  font-family: var(--design-font, "GT America", Inter, sans-serif);
  font-size: var(--text-h3);
  font-weight: var(--font-weight-semibold);
  line-height: 40px;
}

.rich-text--text {
  font-family: var(--design-font, "GT America", Inter, sans-serif);
  font-size: 16px;
  line-height: 20px;
}

.rich-text--text ul,
.rich-text--text ol {
  margin: 0;
  padding-left: 20px;
  list-style-position: outside;
}

.rich-text--text li {
  min-height: 20px;
  line-height: 20px;
}

.rich-text--text li + li {
  margin-top: 20px;
}

/* ==========================================================================
   GRID ALIGNMENT - Block heights must be multiples of 20px
   ==========================================================================
   The editor uses a 20px grid. For blocks to "sit in the grid":
   - Container width snaps to 40px increments (via container queries)
   - Block heights must be multiples of 20px
   - Gap between blocks is 20px
   ========================================================================== */

/* Header Block */
.header-block {
  container-type: inline-size;
  container-name: header;
  width: 100%;
  min-height: 87px; /* Keep nav height visually aligned with the published grid phase. */
  display: flex;
  align-items: center;
  position: relative;
  z-index: 1;
  background: var(--sticky-nav-color, transparent);
}

.header-block::before {
  content: "";
  position: absolute;
  top: 0;
  right: -100vw;
  bottom: 0;
  left: -100vw;
  background: var(--sticky-nav-color, transparent);
  pointer-events: none;
  z-index: 0;
}

.header-block--sticky {
  position: sticky;
  top: 0;
  z-index: 30;
  min-height: 87px;
  background: var(--sticky-nav-color);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.header-block--sticky::before {
  top: -100px;
}

.header-block--sticky.header-block--compact {
  min-height: 87px;
}

.header-block__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0 6px;
  min-height: 40px;
  max-width: var(--page-content-max-width, 1000px);
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 1;
}

.header-block__lane {
  display: flex;
  align-items: center;
  min-width: 0;
}

.header-block__lane--left {
  flex: 0 0 auto;
  z-index: 101;
}

.header-block__lane--collapsible {
  flex: 1 1 auto;
  justify-content: flex-end;
  overflow: visible;
}

.header-block__nav-wrap {
  position: relative;
}

.header-block__lane--controls {
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 20px;
}

.header-block--sticky .header-block__inner {
  min-height: 40px;
  transition: min-height 0.2s ease;
}

.header-block--sticky.header-block--compact .header-block__inner {
  min-height: 40px;
}

.header-block__logo {
  font-family: var(--design-font, inherit);
  font-size: 14px;
  font-weight: 600;
  color: var(--design-text, inherit);
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  /* Flex-item z-index: shows through mobile nav overlay (z-index: 100)
     just like the burger button does. */
  z-index: 101;
}

.header-block__logo:hover {
  opacity: 0.8;
}

.header-block__logo img {
  height: 40px;
  width: auto;
  display: block;
  object-fit: contain;
}

.header-block__nav {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 19px;
  transform: translateX(1px);
  min-width: 0;
  overflow-wrap: normal;
  word-break: normal;
}

.header-block__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
  flex-shrink: 0;
  min-width: 100px; /* 5 grid units minimum */
  /* HOLY GRAIL: 41px height and 20.5px horizontal padding make the button borders
     align pixel-perfectly with the 20px grid. box-sizing: border-box includes
     the 1px border, so 40px/20px leaves borders 1px short of the grid lines. */
  height: 41px;
  box-sizing: border-box;
  padding: 0 20.5px;
  border: 1px solid var(--design-border, rgba(0, 0, 0, 0.1));
  border-radius: var(--design-radius, 8px);
  background: var(--design-background, #fff);
  color: var(--design-text, #1e1e1e);
  font-family: var(--design-font, inherit);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 0.15s ease-in-out,
    border-color 0.15s ease-in-out;
}

.header-block__link:hover {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.2);
}

.header-block__link--text {
  min-width: 0;
  width: auto;
  height: auto;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.header-block__link--text:hover {
  background: transparent;
  border-color: transparent;
}

.header-block__link--dropdown-parent {
  text-decoration: none;
}

.header-block__nav-item {
  flex: 0 0 auto;
  overflow-wrap: normal;
  word-break: normal;
  transition: transform 0.15s ease-out;
}

.header-block__dropdown {
  position: relative;
  display: flex;
  flex-direction: column;
}

.header-block__dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Dropdown parent trigger styled identically to .header-block__link */
.header-block__dropdown--parent .header-block__dropdown-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  flex-shrink: 0;
  height: 41px;
  box-sizing: border-box;
  padding: 0 20.5px;
  border: 1px solid var(--design-border, rgba(0, 0, 0, 0.1));
  border-radius: var(--design-radius, 8px);
  background: var(--design-background, #fff);
  color: var(--design-text, #1e1e1e);
  font-family: var(--design-font, "GT America", "GT-America-Standard-Regular", Inter, sans-serif);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition:
    background-color 0.15s ease-in-out,
    border-color 0.15s ease-in-out;
}

.header-block__dropdown--parent .header-block__dropdown-trigger:hover {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.2);
}

.header-block__dropdown-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--design-text, #1e1e1e);
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s ease-in-out;
  pointer-events: none;
  opacity: 0.6;
}

.header-block__dropdown-toggle--open {
  transform: rotate(180deg);
}

.header-block__dropdown-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  max-height: min(70vh, 480px);
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--design-border, rgba(0, 0, 0, 0.1));
  border-radius: var(--design-radius, 8px);
  background: var(--design-background, #fff);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 700;
}

.header-block__dropdown-panel--open {
  display: flex;
}

.header-block__dropdown-link {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--design-text, #1e1e1e);
  font-family: var(--design-font, "GT America", "GT-America-Standard-Regular", Inter, sans-serif);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.header-block__dropdown-link:hover {
  background: color-mix(in srgb, var(--design-text, #1e1e1e) 6%, transparent);
}

/* Collision mode: remove the collapsible lane from layout while keeping it measurable. */
.header-block.is-collision .header-block__lane--collapsible {
  position: absolute;
  right: 0;
  top: 0;
  visibility: hidden;
  pointer-events: none;
  width: max-content;
  max-width: none;
}

.header-block__add-btn {
  width: 40px; /* 2 grid units */
  height: 40px;
  min-width: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--design-border, rgba(0, 0, 0, 0.1));
  border-radius: var(--design-radius, 8px);
  background: var(--design-background, #fff);
  color: var(--design-text, #1e1e1e);
  cursor: pointer;
  transition:
    background-color 0.15s ease-in-out,
    border-color 0.15s ease-in-out;
}

.header-block__add-btn:hover {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.2);
}

.header-block__nav-item--dragging {
  opacity: 1;
}

.header-block__link--cta {
  background: var(--design-primary, #1e1e1e);
  color: #fff;
  color: var(--design-primary-contrast, #fff);
  border-color: var(--design-primary, #1e1e1e);
}

.header-block__link--cta:hover {
  opacity: 0.9;
  background: var(--design-primary, #1e1e1e);
  border-color: var(--design-primary, #1e1e1e);
}

.header-block__link--dragging {
  opacity: 1;
}

.header-block__link--ghost {
  opacity: 0.4;
  border-style: dashed;
  pointer-events: none;
}

/* ---- Burger Menu (mobile navigation) ---- */

/* Hidden checkbox — CSS state toggle for published sites */
.header-block__toggle-input {
  display: none;
}

/* Burger icon — hidden by default, shown on mobile/collision */
.header-block__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  padding: 10px;
  border: none;
  background: none;
  z-index: 101;
}

.header-block__burger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--design-text, #1e1e1e);
  border-radius: 1px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

/* Explicit close control inside open overlay (editor portal + runtime parity). */
.header-block__mobile-nav-close {
  display: flex;
}

/* Collision: hide desktop lane and show burger fallback. */
.header-block.is-collision .header-block__burger {
  display: flex;
}

/* Mobile: hide desktop nav, show burger */
.mobile .header-block__nav {
  display: none;
}
.mobile .header-block__burger {
  display: flex;
}

/* Burger → X animation (checkbox for published sites) */
.header-block__toggle-input:checked ~ .header-block__burger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.header-block__toggle-input:checked ~ .header-block__burger span:nth-child(2) {
  opacity: 0;
}
.header-block__toggle-input:checked ~ .header-block__burger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Burger → X animation (class for editor React state) */
.header-block__burger--open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.header-block__burger--open span:nth-child(2) {
  opacity: 0;
}
.header-block__burger--open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile nav overlay — full-screen on published sites */
.header-block__mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--design-background, #fff);
  z-index: 100;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.header-block__mobile-nav-entry {
  width: min(560px, calc(100% - 40px));
}

.header-block__mobile-nav-entry-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.header-block__mobile-nav-entry .header-block__dropdown-toggle {
  width: 30px;
  height: 30px;
}

.header-block__dropdown-panel--mobile {
  position: static;
  display: none;
  min-width: 0;
  width: 100%;
  margin-top: 8px;
  box-shadow: none;
  border-radius: 0;
  border: none;
  padding: 0;
  background: transparent;
  gap: 8px;
}

.header-block__dropdown-panel--mobile .header-block__dropdown-link {
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--design-border, rgba(0, 0, 0, 0.1));
  border-radius: var(--design-radius, 8px);
}

/* Show overlay when checkbox checked (published sites) */
.header-block__toggle-input:checked ~ .header-block__mobile-nav {
  display: flex;
}

/* Top bar inside mobile overlay — mirrors .header-block__inner so the
   site title and close button align with the header's logo and burger. */
.header-block__mobile-nav-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--page-content-max-width, 1000px);
  margin: 0 auto;
  width: 100%;
  min-height: 80px;
  padding: 0 20px;
  box-sizing: border-box;
}

/* Mobile nav site title — hidden on published sites because the original
   .header-block__logo shows through the overlay via z-index: 101.
   The editor overrides display to show this element instead (chrome.css). */
.header-block__mobile-nav-title {
  display: none;
  font-family: var(--design-font, inherit);
  font-size: 14px;
  font-weight: 600;
  color: var(--design-text, inherit);
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  height: 40px;
  align-items: center;
}

/* Mobile nav links — larger touch targets */
.header-block__mobile-nav .header-block__link {
  font-size: 18px;
  padding: 14px 28px;
}

/* Divider Block */
.divider-block {
  width: 100%;
  align-self: stretch;
  padding: 8px 0; /* Centers 4px line in 20px height */
  min-height: 20px; /* 1 grid cell */
  margin-right: 0;
}

.divider-block__line {
  width: 100%;
  height: 4px;
  border: none;
  background: var(--design-text, #1e1e1e);
  margin: 0;
}

/* Section Block — no padding; top/bottom spacing controlled by gap spacers. */
.section-block {
  position: relative;
  width: 100%;
  background-color: var(--section-color, var(--design-section, #f5f5f5));
  min-height: 60px; /* 3 grid cells */
  box-sizing: border-box;
  box-shadow: 0 0 0 100vw var(--section-color, var(--design-section, #f5f5f5));
  clip-path: inset(0px -100vw 0px -100vw);
}

/* Keep grid visible on section backgrounds in published output. */
.show-grid-on-sections.show-grid--grid .section-block {
  background:
    linear-gradient(90deg, var(--grid-color-effective, var(--grid-color, #e0e0e0)) 0 1px, transparent 1px),
    linear-gradient(0deg, var(--grid-color-effective, var(--grid-color, #e0e0e0)) 0 1px, transparent 1px),
    var(--section-color, var(--design-section, #f5f5f5));
  background-size: 20px 20px, 20px 20px, auto;
  /* Keep section grid phase locked when content max-width snaps in 40px steps. */
  background-position: calc(50% - 0.5px) -12.5px;
}

.show-grid-on-sections.show-grid--lines .section-block {
  background:
    linear-gradient(0deg, var(--grid-color-effective, var(--grid-color, #e0e0e0)) 0 1px, transparent 1px),
    var(--section-color, var(--design-section, #f5f5f5));
  background-size: 20px 20px, auto;
  background-position: calc(50% - 0.5px) -12.5px;
}

.show-grid-on-sections.show-grid--dots .section-block {
  background:
    radial-gradient(circle, var(--grid-color-effective, var(--grid-color, #e0e0e0)) 0.75px, transparent 0.75px),
    var(--section-color, var(--design-section, #f5f5f5));
  background-size: 20px 20px, auto;
  background-position: calc(50% - 0.5px) -12.5px;
}

.section-block__bg-image {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  z-index: 0;
}

.section-block__bg-image--mirror-left {
  left: calc(50% - 100vw);
  transform: translateX(-50%) scaleX(-1);
}

.section-block__bg-image--mirror-right {
  left: calc(50% + 100vw);
  transform: translateX(-50%) scaleX(-1);
}

.section-block__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
}

/* :not(:first-child) gives specificity 0-2-0, beating
   .content h1 { margin: 0 } at 0-1-1 — same pattern as the
   top-level .content > *:not(:first-child) rule. */
.section-block__content > *:not(:first-child) {
  margin-top: 20px;
}

/* Text Columns Block */
.text-columns-block {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0) minmax(0, 1fr);
  column-gap: 0;
  align-items: start;
}

.text-columns-block__column {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.text-columns-block__column-content {
  margin-right: var(--text-columns-right-inset, 20px);
}

/* Adjacent typography right-inset is applied as inline style on editor wrappers
   and as inline style in published HTML generation. */

.text-columns-block__gutter-spacer {
  min-width: 0;
  width: 0;
  align-self: stretch;
  background: transparent;
}

.text-columns-block__column-content > *:not(:first-child) {
  margin-top: 20px;
}

.mobile .text-columns-block {
  display: flex;
  flex-direction: column;
}

.mobile .text-columns-block__gutter-spacer {
  display: none;
}

.mobile .text-columns-block__column--right {
  margin-top: 20px;
}

@media (max-width: 768px) {
  .text-columns-block {
    display: flex;
    flex-direction: column;
  }

  .text-columns-block__gutter-spacer {
    display: none;
  }

  .text-columns-block__column--right {
    margin-top: 20px;
  }
}

/* Button Block */
.button-block {
  display: inline-block;
  min-height: 40px; /* 2 grid cells */
}

.button-block__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  min-width: 100px; /* 5 grid units */
  padding: 0 20px;
  line-height: 1;
  white-space: nowrap;
  background: var(--design-primary, #1e1e1e);
  color: var(--design-background, #fff);
  color: var(--design-primary-contrast, #fff);
  border: none;
  border-radius: var(--design-radius, 8px);
  font-family: var(--design-font, inherit);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.15s ease-in-out;
}

.button-block__btn:hover {
  opacity: 0.9;
}

.button-block__input {
  background: transparent;
  border: none;
  color: inherit;
  font: inherit;
  text-align: center;
  outline: none;
  min-width: 0;
  width: 100%;
}

.button-block__editor {
  display: inline-flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
  width: 280px; /* 14 grid units */
}

/* Newsletter Block */
.newsletter-block {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px;
  border: 1px solid var(--design-border, rgba(0, 0, 0, 0.1));
  border-radius: var(--design-radius, 8px);
  background: color-mix(in srgb, var(--design-background, #fff) 94%, var(--design-text, #1e1e1e) 6%);
}

.newsletter-block__form {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 40px;
}

.newsletter-block__input-row {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1 1 auto;
  min-width: 120px;
}

.newsletter-block__input {
  flex: 1 1 auto;
  min-width: 120px;
  height: 40px;
  border: 1px solid var(--design-border, rgba(0, 0, 0, 0.12));
  border-radius: var(--design-radius, 8px);
  padding: 0 12px;
  font-family: var(--design-font, inherit);
  font-size: 14px;
  color: var(--design-text, #1e1e1e);
  background: var(--design-background, #fff);
}

.newsletter-block__test-button {
  flex: 0 0 auto;
  min-width: 80px;
  height: 40px;
  border: 1px solid var(--design-border, rgba(0, 0, 0, 0.18));
  border-radius: var(--design-radius, 8px);
  padding: 0 20px;
  font-family: var(--design-font, inherit);
  font-size: 12px;
  font-weight: 500;
  color: var(--design-text, #1e1e1e);
  background: color-mix(in srgb, var(--design-background, #fff) 92%, var(--design-text, #1e1e1e) 8%);
  cursor: pointer;
  transition: opacity 0.15s ease-in-out;
}

.newsletter-block__test-button:hover:not(:disabled) {
  opacity: 0.9;
}

.newsletter-block__input:focus {
  outline: 1px solid color-mix(in srgb, var(--design-primary, #1e1e1e) 36%, transparent);
  outline-offset: 1px;
}

.newsletter-block__button {
  flex: 0 0 auto;
  min-width: 120px;
  height: 40px;
  border: none;
  border-radius: var(--design-radius, 8px);
  padding: 0 20px;
  font-family: var(--design-font, inherit);
  font-size: 12px;
  font-weight: 500;
  color: var(--design-background, #fff);
  color: var(--design-primary-contrast, #fff);
  background: var(--design-primary, #1e1e1e);
  cursor: pointer;
  transition: opacity 0.15s ease-in-out;
}

.newsletter-block__button:hover:not(:disabled) {
  opacity: 0.9;
}

.newsletter-block--test-receiver .newsletter-block__button {
  color: #1f1f1f;
  background-color: #ffd84d;
  background-image: repeating-linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.45) 0 8px,
    rgba(255, 255, 255, 0) 8px 16px
  );
}

.newsletter-block__button:disabled,
.newsletter-block__input:disabled,
.newsletter-block__test-button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.newsletter-block__message {
  min-height: 20px;
  font-family: var(--design-font, inherit);
  font-size: 12px;
  line-height: 20px;
  color: color-mix(in srgb, var(--design-text, #1e1e1e) 74%, transparent);
}

.newsletter-block--success .newsletter-block__message {
  color: color-mix(in srgb, #2e7a38 80%, var(--design-text, #1e1e1e) 20%);
}

.newsletter-block__honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Logo Marquee Block */
.logo-marquee-block {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 100px;
}

.logo-marquee-block__viewport {
  width: 100%;
  min-height: 80px;
  background: transparent;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.logo-marquee-block__empty {
  width: 100%;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--design-font, inherit);
  font-size: 12px;
  color: color-mix(in srgb, var(--design-text, #1e1e1e) 62%, transparent);
}

.logo-marquee-block__marquee {
  display: flex;
  align-items: center;
  --logo-marquee-gap: 20px;
  gap: var(--logo-marquee-gap);
  --logo-marquee-item-width: 140px;
  width: max-content;
  min-width: 100%;
  padding: 20px 0;
  animation: logo-marquee-scroll 24s linear infinite;
}

.logo-marquee-block:hover .logo-marquee-block__marquee {
  animation-play-state: paused;
}

.logo-marquee-block__item {
  position: relative;
  flex: 0 0 auto;
  width: var(--logo-marquee-item-width);
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
}

.logo-marquee-block--full-width .logo-marquee-block__marquee {
  --logo-marquee-gap: clamp(24px, 2.8vw, 48px);
  --logo-marquee-item-width: auto;
  min-width: max-content;
  animation-duration: 60s;
}

.logo-marquee-block--full-width .logo-marquee-block__viewport {
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  border-radius: 0;
  border-left: none;
  border-right: none;
  box-shadow: none;
  clip-path: none;
  background: transparent;
}

.logo-marquee-block--full-width .logo-marquee-block__item {
  width: auto;
  min-width: 0;
  padding: 0;
}

.logo-marquee-block--full-width .logo-marquee-block__img {
  max-height: 40px;
}

.logo-marquee-block__logo {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  color: inherit;
}

.logo-marquee-block__logo::before {
  content: "";
  position: absolute;
  inset: 0;
  background: currentColor;
  -webkit-mask-image: var(--logo-marquee-image);
  mask-image: var(--logo-marquee-image);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  pointer-events: none;
  opacity: var(--logo-marquee-mask-opacity, 1);
}

.logo-marquee-block__img {
  display: block;
  max-width: 100%;
  max-height: 32px;
  width: auto;
  height: auto;
  object-fit: contain;
  opacity: var(--logo-marquee-image-opacity, 0);
  filter: var(--logo-marquee-filter, none);
}

.logo-marquee-block__remove {
  position: absolute;
  top: 0;
  right: 0;
  width: 16px;
  height: 16px;
  border: none;
  border-radius: 999px;
  background: color-mix(in srgb, var(--design-text, #1e1e1e) 82%, transparent);
  color: var(--design-background, #fff);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.logo-marquee-block__controls {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 20px;
}

.logo-marquee-block__add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  height: 40px;
  padding: 0 20px;
  border: 1px solid var(--design-border, rgba(0, 0, 0, 0.1));
  border-radius: var(--design-radius, 8px);
  background: var(--design-background, #fff);
  color: var(--design-text, #1e1e1e);
  font-family: var(--design-font, inherit);
  font-size: 12px;
  cursor: pointer;
}

.logo-marquee-block__mode-toggle {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--design-border, rgba(0, 0, 0, 0.1));
  border-radius: var(--design-radius, 8px);
  overflow: hidden;
}

.logo-marquee-block__mode-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  height: 40px;
  padding: 0 20px;
  border: none;
  background: transparent;
  color: var(--design-text, #1e1e1e);
  font-family: var(--design-font, inherit);
  font-size: 12px;
  cursor: pointer;
}

.logo-marquee-block__mode-btn + .logo-marquee-block__mode-btn {
  box-shadow: inset 1px 0 0 var(--design-border, rgba(0, 0, 0, 0.1));
}

.logo-marquee-block__mode-btn--active {
  background: color-mix(in srgb, var(--design-primary, #1e1e1e) 10%, transparent);
}

@keyframes logo-marquee-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(calc(-50% - (var(--logo-marquee-gap, 20px) / 2)));
  }
}

@media (max-width: 768px) {
  .newsletter-block__form {
    flex-direction: column;
    align-items: stretch;
  }

  .newsletter-block__input-row {
    width: 100%;
  }

  .newsletter-block__button {
    width: 100%;
  }

  .logo-marquee-block__marquee {
    --logo-marquee-item-width: 120px;
  }
}

/* Language Picker Block */
.language-picker-block {
  display: inline-block;
  min-height: 40px; /* 2 grid cells */
}

.language-picker-block__wrapper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--design-background, #fff);
  border: 1px solid var(--design-border, rgba(0, 0, 0, 0.1));
  border-radius: var(--design-radius, 8px);
  font-family: var(--design-font, inherit);
}

.language-picker-block__icon {
  color: var(--design-text-muted, rgba(0, 0, 0, 0.65));
  flex-shrink: 0;
}

.language-picker-block__select {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--design-text, #1e1e1e);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  padding-right: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right center;
}

.language-picker-block__select:focus {
  outline: none;
}

.language-picker-block__single-lang {
  font-size: 14px;
  font-family: var(--design-font, inherit);
  color: var(--design-text, inherit);
}

.language-picker-block--single .language-picker-block__wrapper {
  cursor: default;
}

/* Footer Block */
.footer-block {
  width: 100%;
  box-shadow: inset 0 1px 0 var(--design-border, rgba(0, 0, 0, 0.1));
  margin-top: auto;
  min-height: 120px; /* 6 grid cells */
  font-family: var(--design-font, inherit);
}

.footer-block__inner {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 40px 0;
  max-width: var(--page-content-max-width, 1000px);
  margin: 0 auto;
  width: 100%;
}

.footer-block__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-block__brand {
  font-size: 14px;
  font-weight: 600;
  color: var(--design-text, #1e1e1e);
}

.footer-block__nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.footer-block__link {
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;
  color: var(--design-text-muted, rgba(0, 0, 0, 0.65));
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s ease-in-out;
}

.footer-block__link:hover {
  color: var(--design-text, #1e1e1e);
}

.footer-block__bottom {
  padding-top: 20px;
  box-shadow: inset 0 1px 0 var(--design-border, rgba(0, 0, 0, 0.1));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-block__language {
  flex-shrink: 0;
}

.footer-block__bottom .language-picker-block {
  min-height: 0;
}

.footer-block__bottom .language-picker-block__wrapper {
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
}

.footer-block__bottom .language-picker-block__icon {
  width: 14px;
  height: 14px;
}

.footer-block__bottom .language-picker-block__select,
.footer-block__bottom .language-picker-block__single-lang {
  font-size: 12px;
  color: var(--design-text-muted, rgba(0, 0, 0, 0.65));
}

.footer-block__copyright {
  font-size: 12px;
  color: var(--design-text-muted, rgba(0, 0, 0, 0.65));
}

/* Table Block */
.table-block {
  width: 100%;
  min-height: 80px; /* 4 grid cells */
  position: relative;
}

.table-block__scroll {
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.table-block__table {
  border-collapse: collapse;
  table-layout: fixed;
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--design-border, #e5e5e5);
}

.table-block__head {
  background: transparent;
}

.table-block__cell {
  padding: 0 16px;
  height: 40px; /* 2 grid cells */
  box-sizing: border-box;
  text-align: left;
  font-family: var(--design-font, inherit);
  font-size: 16px; /* Match normal text block size */
  font-weight: 400;
  color: var(--design-text, #1e1e1e);
  line-height: 20px;
  background: transparent;
  box-shadow:
    inset -1px 0 0 var(--design-border, #e5e5e5),
    inset 0 -1px 0 var(--design-border, #e5e5e5);
  vertical-align: middle;
}

.table-block__body .table-block__cell:not(.table-block__actions-cell) {
  height: 40px;
  min-height: 40px;
  padding: 10px 16px;
  vertical-align: top;
  position: relative;
}

.table-block__body tr {
  height: 40px;
}

.table-block__body tr:last-child .table-block__cell {
  box-shadow: inset -1px 0 0 var(--design-border, #e5e5e5);
}

.table-block__head .table-block__cell {
  font-weight: 600;
  background: color-mix(in srgb, var(--design-text, #1e1e1e) 8%, transparent);
  position: relative;
}

.table-block__actions-cell {
  width: 40px;
  padding: 0;
  text-align: center;
}

.table-block__cell-inner {
  display: block;
  width: 100%;
  line-height: 20px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.table-block__cell-inner--header {
  height: 40px;
  min-height: 40px;
  line-height: 40px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-block__cell-inner--body {
  min-height: 20px;
  white-space: pre-wrap;
}

.table-block__cell-input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font: inherit;
  color: inherit;
  padding: 0;
}

.table-block__head .table-block__cell-input {
  height: 40px;
  line-height: 40px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-block__cell-input--body {
  position: absolute;
  left: 16px;
  right: 16px;
  top: 10px;
  width: auto;
  height: 20px;
  line-height: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-block__cell-inner--editing-placeholder {
  visibility: hidden;
  pointer-events: none;
}

.table-block__cell--editable {
  cursor: text;
}

.table-block__row-actions-cell {
  position: relative;
  vertical-align: top;
  padding-top: 10px;
}

.table-block__row-handle {
  width: 20px;
  height: 20px;
  border: none;
  background: transparent;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  color: color-mix(in srgb, var(--design-text, #1e1e1e) 55%, transparent);
}

.table-block__row-handle:hover {
  background: color-mix(in srgb, var(--design-text, #1e1e1e) 8%, transparent);
}

.table-block__row-handle-dots {
  width: 10px;
  height: 14px;
  display: block;
  background-image: radial-gradient(currentColor 1.2px, transparent 1.3px);
  background-size: 5px 5px;
  background-position: 0 0;
}

.table-block__row-handle--placeholder {
  visibility: hidden;
  pointer-events: none;
}

.table-block__row-menu {
  position: absolute;
  right: calc(100% + 8px);
  top: 6px;
  transform: none;
  min-width: 140px;
  border-radius: 10px;
  border: 1px solid var(--design-border, rgba(0, 0, 0, 0.12));
  background: var(--design-background, #fff);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 20;
}

.table-block__row-menu-item {
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--design-text, #1e1e1e);
  text-align: left;
  padding: 0 10px;
  font-family: var(--design-font, inherit);
  font-size: 13px;
  line-height: 20px;
  cursor: pointer;
}

.table-block__row-menu-item:hover {
  background: color-mix(in srgb, var(--design-text, #1e1e1e) 8%, transparent);
}

.table-block__row-menu-item:disabled {
  opacity: 0.45;
  cursor: default;
}

.table-block__col-resize-handle {
  position: absolute;
  top: 0;
  right: -7px;
  width: 14px;
  height: 40px;
  border: none;
  background: transparent;
  padding: 0;
  cursor: ew-resize;
  z-index: 2;
}

.table-block__col-resize-handle-line {
  position: absolute;
  left: 50%;
  top: 6px;
  bottom: 6px;
  width: 1px;
  transform: translateX(-50%);
  background: color-mix(in srgb, var(--design-text, #1e1e1e) 32%, transparent);
  outline: 1px solid #ffffff;
  opacity: 0;
  transition: opacity 120ms ease-out;
}

.table-block__head .table-block__cell:hover .table-block__col-resize-handle-line,
.table-block__col-resize-handle--active .table-block__col-resize-handle-line {
  opacity: 1;
}

body.table-column-resize-active,
body.table-column-resize-active * {
  cursor: ew-resize !important;
}

.table-block__col-resize-cursor {
  position: fixed;
  width: 0;
  pointer-events: none;
  z-index: 2600;
}

.table-block__col-resize-cursor-line {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 100%;
  background: color-mix(in srgb, var(--design-text, #1e1e1e) 42%, transparent);
  outline: 1px solid #ffffff;
}

.table-block__col-resize-cursor-label {
  position: absolute;
  left: 8px;
  top: -22px;
  font-size: 10px;
  font-weight: 400;
  font-family: "GT America", var(--design-font, Inter, sans-serif);
  color: var(--design-background, #fff);
  background: color-mix(in srgb, var(--design-text, #1e1e1e) 68%, transparent);
  padding: 3px 4px;
  border-radius: 3px;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.28);
}

.table-block__hover-handle {
  width: 24px;
  height: 24px;
  border-radius: 8px;
  border: 1px solid var(--design-border, rgba(0, 0, 0, 0.18));
  background: color-mix(in srgb, var(--design-background, #fff) 88%, transparent);
  color: var(--design-text, #1e1e1e);
  font-family: var(--design-font, inherit);
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.96);
  transition: opacity 120ms ease-out, transform 120ms ease-out;
  backdrop-filter: blur(6px);
}

.table-block--editable:hover .table-block__hover-handle,
.table-block--editable:focus-within .table-block__hover-handle {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.table-block__hover-handle:disabled {
  opacity: 0.45 !important;
  cursor: default;
}

.table-block__hover-column-controls {
  position: absolute;
  right: -12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 8;
}

.table-block__hover-row-controls {
  position: absolute;
  left: 50%;
  bottom: -12px;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 8;
}

/* Gallery Block */
.gallery-block {
  width: 100%;
}

@keyframes media-skeleton-pulse {
  0% {
    opacity: 0.45;
  }
  50% {
    opacity: 0.85;
  }
  100% {
    opacity: 0.45;
  }
}

.media-skeleton {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.08) 0%,
    rgba(0, 0, 0, 0.04) 50%,
    rgba(0, 0, 0, 0.08) 100%
  );
  animation: media-skeleton-pulse 1.2s ease-in-out infinite;
}

.media-error {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  font-family: var(--design-font, inherit);
  font-size: 12px;
  line-height: 20px;
  color: var(--design-text-muted, rgba(0, 0, 0, 0.65));
  background: rgba(0, 0, 0, 0.06);
}

.gallery-block__grid {
  display: grid;
  grid-template-columns: repeat(var(--gallery-columns, 3), minmax(0, 1fr));
  gap: 20px; /* 1 grid cell */
}

.gallery-block__empty {
  background: rgba(0, 0, 0, 0.03);
  height: 200px; /* 10 grid cells */
  border-radius: var(--design-radius, 8px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--design-text-muted, rgba(0, 0, 0, 0.65));
}

.gallery-block__item {
  position: relative;
  height: 200px; /* 10 grid cells */
  border-radius: var(--design-radius, 8px);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.03);
}

.gallery-block__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
}

.gallery-block__img--loaded {
  opacity: 1;
}

.gallery-block__item.is-loaded .gallery-block__img {
  opacity: 1;
}

.gallery-block__skeleton,
.gallery-block__error {
  position: absolute;
  inset: 0;
}

.gallery-block__skeleton {
  z-index: 1;
}

.gallery-block__error {
  display: none;
  z-index: 2;
}

.gallery-block__item.is-loaded .gallery-block__skeleton,
.gallery-block__item.is-loaded .gallery-block__error {
  display: none;
}

.gallery-block__item.is-error .gallery-block__skeleton {
  display: none;
}

.gallery-block__item.is-error .gallery-block__error {
  display: flex;
}

.gallery-block__controls {
  margin-top: 10px;
}

.gallery-block__add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px; /* 2 grid cells */
  padding: 0 14px;
  border-radius: var(--design-radius, 8px);
  border: 1px solid var(--design-border, rgba(0, 0, 0, 0.1));
  background: var(--design-background, #fff);
  color: var(--design-text, #1e1e1e);
  font-family: var(--design-font, inherit);
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}

.gallery-block__remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  cursor: pointer;
  line-height: 28px;
  font-size: 18px;
}

.video-block {
  width: 100%;
}

.video-block__frame-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: var(--design-radius, 8px);
  background: #000;
  aspect-ratio: 16 / 9;
  box-shadow: inset 0 0 0 1px var(--design-border, rgba(0, 0, 0, 0.08));
}

.video-block__frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.video-block__empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  border-radius: var(--design-radius, 8px);
  box-shadow: inset 0 0 0 1px var(--design-border, rgba(0, 0, 0, 0.08));
  background: color-mix(in srgb, var(--design-text, #1e1e1e) 4%, var(--design-background, #fff));
  color: color-mix(in srgb, var(--design-text, #1e1e1e) 60%, transparent);
  font-family: var(--design-font, inherit);
  font-size: 14px;
}

/* Accordion Block */
.accordion-block {
  width: 100%;
}

.accordion-block__items {
  display: flex;
  flex-direction: column;
}

.accordion-block__item {
  box-shadow: inset 0 0 0 1px var(--design-border, rgba(0, 0, 0, 0.1));
  border-radius: var(--design-radius, 8px);
  overflow: hidden;
  background: var(--design-background, #fff);
}

.accordion-block__item:not(:last-child) {
  margin-bottom: 20px; /* 1 grid cell */
}

.accordion-block__summary {
  list-style: none;
  cursor: pointer;
  padding: 0 12px;
  height: 40px; /* 2 grid cells */
  min-height: 40px;
  font-family: var(--design-font, inherit);
  font-size: 12px;
  line-height: 20px;
  font-weight: 600;
  color: var(--design-text, #1e1e1e);
}

.accordion-block__summary::-webkit-details-marker {
  display: none;
}

.accordion-block__summary-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 40px;
  min-height: 40px;
}

.accordion-block__title {
  flex: 1;
  min-width: 0;
}

.accordion-block__title--editable {
  cursor: text;
}

.accordion-block__title--placeholder {
  color: var(--muted-foreground, rgba(0, 0, 0, 0.5));
}

.accordion-block__title-input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font: inherit;
  color: inherit;
  padding: 0;
}

.accordion-block__remove-btn {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  cursor: pointer;
  line-height: 28px;
  font-size: 18px;
  flex: 0 0 28px;
}

.accordion-block__actions-slot {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 12px;
}

.accordion-block__remove-btn--hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.accordion-block__panel {
  box-shadow: inset 0 1px 0 var(--design-border, rgba(0, 0, 0, 0.08));
  padding: 20px; /* 1 grid cell */
}

.accordion-block__text {
  margin: 0;
  color: var(--design-text, #1e1e1e);
  font-family: var(--design-font, inherit);
  font-size: 12px;
  line-height: 20px;
  white-space: pre-wrap;
}

.accordion-block__text--editable {
  cursor: text;
}

.accordion-block__text--placeholder {
  color: var(--muted-foreground, rgba(0, 0, 0, 0.5));
}

.accordion-block__content-input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--design-font, inherit);
  font-size: 12px;
  line-height: 20px;
  color: var(--design-text, #1e1e1e);
  resize: vertical;
  padding: 0;
}

.accordion-block__controls {
  margin-top: 20px; /* 1 grid cell */
  min-height: 40px; /* Reserve controls row height to prevent jump */
}

.accordion-block__add-btn {
  height: 40px; /* 2 grid cells */
  padding: 0 14px;
  border-radius: var(--design-radius, 8px);
  border: 1px solid var(--design-border, rgba(0, 0, 0, 0.12));
  background: var(--design-background, #fff);
  color: var(--design-text, #1e1e1e);
  font-family: var(--design-font, inherit);
  font-size: 12px;
  cursor: pointer;
}

.accordion-block__add-btn--hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

/* Content container */
.content {
  position: relative;
  flex: 1;
  padding: 0 20px 20px;
  max-width: var(--page-content-max-width, 1000px);
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0;
  text-align: left;
}

.content--sticky-header {
  padding-top: 0;
}

/* No header: first element's inline margin-top provides the spacing
   (set to 80px by the editor, serialised into the published HTML).
   Padding-top is 0 so the inline margin is the single source of truth. */
.content--no-header {
  padding-top: 0;
}

.content--no-footer {
  padding-bottom: 120px;
}

/* Default 20px gap between adjacent blocks.
   :not(:first-child) gives specificity 0-2-0, which beats
   .content h1 { margin: 0 } at 0-1-1. Inline style overrides
   still work for custom per-element gaps via applyGapStyle(). */
.content > *:not(:first-child) {
  margin-top: 20px;
}

.content > * {
  text-align: left;
  margin-left: 0;
  margin-right: auto;
}

/* Container queries - shrink content in 40px increments to align with grid */
/* Snap content width in 40px increments to align with 20px grid.
   Formula: @container page (max-width: X) → max-width: X - 80px
   Range: 1280px (1200 content + 80 breathing room) down to 160px.
   Queries above 1280px are omitted — page max width cap applies. */
@container page (max-width: 1280px) { .content { max-width: min(var(--page-content-max-width, 1000px), 1200px); } }
@container page (max-width: 1240px) { .content { max-width: min(var(--page-content-max-width, 1000px), 1160px); } }
@container page (max-width: 1200px) { .content { max-width: min(var(--page-content-max-width, 1000px), 1120px); } }
@container page (max-width: 1160px) { .content { max-width: min(var(--page-content-max-width, 1000px), 1080px); } }
@container page (max-width: 1120px) { .content { max-width: min(var(--page-content-max-width, 1000px), 1040px); } }
@container page (max-width: 1080px) { .content { max-width: min(var(--page-content-max-width, 1000px), 1000px); } }
@container page (max-width: 1040px) { .content { max-width: min(var(--page-content-max-width, 1000px), 960px); } }
@container page (max-width: 1000px) { .content { max-width: min(var(--page-content-max-width, 1000px), 920px); } }
@container page (max-width: 960px) { .content { max-width: min(var(--page-content-max-width, 1000px), 880px); } }
@container page (max-width: 920px) { .content { max-width: min(var(--page-content-max-width, 1000px), 840px); } }
@container page (max-width: 880px) { .content { max-width: min(var(--page-content-max-width, 1000px), 800px); } }
@container page (max-width: 840px) { .content { max-width: min(var(--page-content-max-width, 1000px), 760px); } }
@container page (max-width: 800px) { .content { max-width: min(var(--page-content-max-width, 1000px), 720px); } }
@container page (max-width: 760px) { .content { max-width: min(var(--page-content-max-width, 1000px), 680px); } }
@container page (max-width: 720px) { .content { max-width: min(var(--page-content-max-width, 1000px), 640px); } }
@container page (max-width: 680px) { .content { max-width: min(var(--page-content-max-width, 1000px), 600px); } }
@container page (max-width: 640px) { .content { max-width: min(var(--page-content-max-width, 1000px), 560px); } }
@container page (max-width: 600px) { .content { max-width: min(var(--page-content-max-width, 1000px), 520px); } }
@container page (max-width: 560px) { .content { max-width: min(var(--page-content-max-width, 1000px), 480px); } }
@container page (max-width: 520px) { .content { max-width: min(var(--page-content-max-width, 1000px), 440px); } }
@container page (max-width: 480px) { .content { max-width: min(var(--page-content-max-width, 1000px), 400px); } }
@container page (max-width: 440px) { .content { max-width: min(var(--page-content-max-width, 1000px), 360px); } }
@container page (max-width: 400px) { .content { max-width: min(var(--page-content-max-width, 1000px), 320px); } }
@container page (max-width: 360px) { .content { max-width: min(var(--page-content-max-width, 1000px), 280px); } }
@container page (max-width: 320px) { .content { max-width: min(var(--page-content-max-width, 1000px), 240px); } }
@container page (max-width: 280px) { .content { max-width: min(var(--page-content-max-width, 1000px), 200px); } }
@container page (max-width: 240px) { .content { max-width: min(var(--page-content-max-width, 1000px), 160px); } }
@container page (max-width: 200px) { .content { max-width: min(var(--page-content-max-width, 1000px), 120px); } }
@container page (max-width: 160px) { .content { max-width: min(var(--page-content-max-width, 1000px), 80px); } }

/* Typography — see scoped rules at top (.builder-canvas__blocks / .content) */

/* Published image block with preload/error states */
.image-block {
  position: relative;
  overflow: hidden;
  width: min(var(--media-w, 100%), 100%);
  max-width: 100%;
  height: max(200px, var(--media-h, 200px));
  border-radius: var(--design-radius, 8px);
  background: rgba(0, 0, 0, 0.03);
}

.image-block__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
}

.image-block__skeleton,
.image-block__error {
  position: absolute;
  inset: 0;
}

.image-block__skeleton {
  z-index: 1;
}

.image-block__error {
  display: none;
  z-index: 2;
}

.image-block.is-loaded .image-block__img {
  opacity: 1;
}

.image-block.is-loaded .image-block__skeleton,
.image-block.is-loaded .image-block__error {
  display: none;
}

.image-block.is-error .image-block__skeleton {
  display: none;
}

.image-block.is-error .image-block__error {
  display: flex;
}

/* Image placeholder */
.image-placeholder {
  background: rgba(0, 0, 0, 0.03);
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--design-text-muted, rgba(0, 0, 0, 0.65));
  border-radius: var(--design-radius, 8px);
}

/* Consistency badge */
.c-edit-button {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  left: calc(env(safe-area-inset-left, 0px) + 12px);
  z-index: 120;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: fit-content;
  max-width: calc(100vw - 20px);
  border: none;
  border-radius: 0;
  background: transparent;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}

.c-edit-button__frame {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 40px;
  padding: 0 8px;
  border: 1px solid #3f3f3f;
  border-radius: 8px;
  box-sizing: border-box;
  background: #2c2c2c;
  font-family: "GT America", Inter, sans-serif;
  font-size: 11px;
  font-weight: 400;
  line-height: 19.5px;
  letter-spacing: -0.3px;
  text-decoration: none;
}

.c-edit-button__logo {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: inline-block;
}

.c-edit-button__text {
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
}

.c-edit-button:hover {
  transform: none;
}

.c-edit-button:hover .c-edit-button__frame {
  border-color: #555;
}

@media (max-width: 640px) {
  .c-edit-button {
    top: calc(env(safe-area-inset-top, 0px) + 10px);
    left: calc(env(safe-area-inset-left, 0px) + 10px);
    max-width: calc(100vw - 12px);
  }

  .c-edit-button__frame {
    height: 40px;
    padding: 0 8px;
  }

  .c-edit-button__logo {
    width: 20px;
    height: 20px;
  }
}

.c-badge {
  position: sticky;
  bottom: 20px;
  align-self: flex-start;
  margin-top: auto;
  margin-left: -8px;
  z-index: 10;
}

.c-badge__trigger {
  display: block;
  cursor: pointer;
  text-decoration: none;
  line-height: 0;
}

.c-badge__logo {
  width: 75px;
  height: 75px;
  color: var(--design-text, #1e1e1e);
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.12));
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.c-badge__trigger:hover .c-badge__logo {
  transform: scale(1.08);
}

/* Dropdown menu — opens above the badge */
.c-badge__options {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  display: flex;
  flex-direction: column;
  min-width: 180px;
  padding: 4px 0;
  background: var(--design-background, #fff);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.08);
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  visibility: hidden;
  transition: opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.15s cubic-bezier(0.4, 0, 0.2, 1),
              visibility 0s 0.15s;
}

.c-badge:hover .c-badge__options,
.c-badge:focus-within .c-badge__options,
.c-badge--open .c-badge__options {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  visibility: visible;
  transition-delay: 0s;
}

.c-badge__option {
  display: block;
  padding: 8px 12px;
  font-family: var(--design-font, inherit);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--design-text, #1e1e1e);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.1s;
}

.c-badge__option:hover {
  background: rgba(0, 0, 0, 0.05);
}

.c-badge__separator {
  height: 1px;
  margin: 4px 0;
  background: rgba(0, 0, 0, 0.1);
}

.c-badge__option--upgrade {
  width: 100%;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--design-text-muted, rgba(0, 0, 0, 0.5));
  font-size: 12px;
  text-align: left;
}

@media (prefers-reduced-motion: reduce) {
  .media-skeleton {
    animation: none;
  }

  .image-block__img,
  .gallery-block__img {
    transition: none;
  }

  .c-badge__options {
    transition: none;
  }

  .c-badge__logo {
    transition: none;
  }

  .c-edit-button {
    transition: none;
  }
}
