/* DS2 canvas and native-block adapter. Tokens come from design-tokens.css.
 * Content DOM, saved attributes and block serialization remain unchanged.
 * The public-body scope lets native blocks use the same geometry as Gutenberg;
 * no WordPress admin toolbar, sidebar or standalone partner page is styled. */
.editor-styles-wrapper {
  --wp--preset--font-size--gt-h1: var(--ds2-text-h1);
  --wp--preset--font-size--gt-h2: var(--ds2-text-h2);
  --wp--preset--font-size--gt-h3: var(--ds2-text-h3);
  --wp--preset--font-size--gt-h4: var(--ds2-text-h4);
  --wp--preset--font-size--gt-body: var(--ds2-text-body);
  --wp--preset--spacing--gt-m: var(--ds2-gap);
  --wp--custom--grandthai--layout--content-size: var(--ds2-content-max);
  --wp--custom--grandthai--radius--large: var(--ds2-panel-radius);
  --wp--custom--grandthai--radius--card: var(--ds2-card-radius);
  --wp--custom--grandthai--border--line: var(--ds2-border);
  --gt-button-height: var(--ds2-button-height);
  --gt-button-padding-y: var(--ds2-button-padding-y);
  --gt-button-padding-x: var(--ds2-button-padding-x);
  --gt-radius-pill: var(--ds2-pill-radius);
  --gt-radius-textarea: var(--ds2-textarea-radius);
  background: var(--ds2-surface-page);
  color: var(--ds2-text-primary);
  font-family: var(--ds2-font-family);
  font-size: var(--ds2-text-body);
  font-weight: var(--ds2-weight-body);
  line-height: var(--ds2-line-body);
}

.editor-styles-wrapper h1 {
  font-size: var(--ds2-text-h1);
  font-weight: var(--ds2-weight-h1);
  line-height: var(--ds2-line-h1);
}
.editor-styles-wrapper h2 {
  font-size: var(--ds2-text-h2);
  font-weight: var(--ds2-weight-h2);
  line-height: var(--ds2-line-h2);
}
.editor-styles-wrapper h3 {
  font-size: var(--ds2-text-h3);
  font-weight: var(--ds2-weight-h3);
  line-height: var(--ds2-line-h3);
}
.editor-styles-wrapper h4 {
  font-size: var(--ds2-text-h4);
  font-weight: var(--ds2-weight-h4);
  line-height: var(--ds2-line-h4);
}
.editor-styles-wrapper :is(.wp-element-button, .wp-block-button__link, .btn) {
  min-height: var(--ds2-button-height);
  padding: var(--ds2-button-padding-y) var(--ds2-button-padding-x);
  border-radius: var(--ds2-button-radius);
  font-size: var(--ds2-button-font-size);
  font-weight: var(--ds2-button-font-weight);
  line-height: var(--ds2-line-button);
}
.editor-styles-wrapper :is(.gt-product-grid__card, .gt-branch-slider__card, .gt-promo-grid__card) h3 {
  font-size: var(--ds2-card-title-size);
}

:is(body.gt-design-system-v2, .editor-styles-wrapper) :is(
  .gt-product-grid__cards, .gt-branch-slider__cards, .gt-master-grid__cards,
  .gt-promo-grid__cards, .gt-reviews__cards, .gt-block-branch-selector__grid
) {
  gap: var(--ds2-gap);
}
:is(body.gt-design-system-v2, .editor-styles-wrapper) :is(
  .gt-product-grid__card, .gt-branch-slider__card, .gt-master-grid__card,
  .gt-promo-grid__card, .gt-reviews__card, .gt-block-branch-selector__card
) {
  padding: var(--ds2-card-padding);
  border-radius: var(--ds2-card-radius);
  background: var(--ds2-card-bg);
  color: var(--ds2-text-primary);
}

/* Source-sized images replace legacy 22px padding offsets and cover crops.
 * Picture composition remains block-owned; portrait/landscape sources are not
 * forced into an unrelated aspect ratio. */
:is(body.gt-design-system-v2, .editor-styles-wrapper) :is(
  .gt-product-grid__card, .gt-branch-slider__card,
  .gt-promo-grid__card, .gt-master-grid__card
) img {
  display: block;
  width: calc(100% + 2 * var(--ds2-card-padding));
  max-width: none;
  height: auto;
  min-height: 0;
  aspect-ratio: auto;
  object-fit: contain;
  margin: calc(-1 * var(--ds2-card-padding)) calc(-1 * var(--ds2-card-padding)) var(--ds2-gap);
}
:is(body.gt-design-system-v2, .editor-styles-wrapper) .gt-editor-section {
  padding: var(--ds2-panel-padding);
  border-radius: var(--ds2-panel-radius);
}
:is(body.gt-design-system-v2, .editor-styles-wrapper) :is(.gt-price-list__rows, .gt-final-cta--card .gt-final-cta__layout) {
  border-radius: var(--ds2-panel-radius);
}
.editor-styles-wrapper .is-root-container > .wp-block[data-type^="grandthai/"] + .wp-block[data-type^="grandthai/"] {
  margin-block-start: var(--ds2-section-space);
}
body.gt-design-system-v2 .entry-content > :is(.gt-business-block, .gt-editor-section, .gt-block-branch-selector)
  + :is(.gt-business-block, .gt-editor-section, .gt-block-branch-selector) {
  margin-block-start: var(--ds2-section-space);
}

@media (prefers-reduced-motion: reduce) {
  .editor-styles-wrapper :is(.gt-business-block, .gt-editor-section) :is(.btn, img) {
    animation: none;
    transition: none;
    transform: none;
  }
}
