/*
 * Shared Gutenberg presentation for the editor canvas and frontend content.
 * theme.json provides the controls/tokens; this file handles robust layout,
 * responsive behavior, and named CNLAMP block styles.
 */

:where(.editor-styles-wrapper) {
  color: #334155;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.7;
}

:is(
  .entry-content,
  .projects-page-introduction,
  .shop-page-editor-content,
  .b2b-product-information-content,
  .cnlamp-flexible-section__inner,
  .editor-styles-wrapper
) {
  min-width: 0;
  overflow-wrap: break-word;
}

:is(
  .entry-content,
  .projects-page-introduction,
  .shop-page-editor-content,
  .b2b-product-information-content,
  .cnlamp-flexible-section__inner,
  .editor-styles-wrapper
) > * + * {
  margin-block-start: clamp(1rem, 2vw, 1.5rem);
}

:is(
  .entry-content,
  .projects-page-introduction,
  .shop-page-editor-content,
  .b2b-product-information-content,
  .cnlamp-flexible-section__inner,
  .editor-styles-wrapper
) :where(h1, h2, h3, h4, h5, h6) {
  font-weight: 650;
  overflow-wrap: break-word;
  text-wrap: balance;
}

:is(
  .entry-content,
  .projects-page-introduction,
  .shop-page-editor-content,
  .b2b-product-information-content,
  .cnlamp-flexible-section__inner,
  .editor-styles-wrapper
) :where(h1, h2, h3, h4, h5, h6):not(.has-text-color) {
  color: #0f172a;
}

:is(
  .entry-content,
  .projects-page-introduction,
  .shop-page-editor-content,
  .b2b-product-information-content,
  .cnlamp-flexible-section__inner,
  .editor-styles-wrapper
) :where(p, li) {
  line-height: 1.7;
}

:is(
  .entry-content,
  .projects-page-introduction,
  .shop-page-editor-content,
  .b2b-product-information-content,
  .cnlamp-flexible-section__inner,
  .editor-styles-wrapper
) :where(ul, ol):not([class]) {
  padding-inline-start: 1.4em;
}

:is(
  .entry-content,
  .projects-page-introduction,
  .shop-page-editor-content,
  .b2b-product-information-content,
  .cnlamp-flexible-section__inner,
  .editor-styles-wrapper
) ul:not([class]) {
  list-style: disc;
}

:is(
  .entry-content,
  .projects-page-introduction,
  .shop-page-editor-content,
  .b2b-product-information-content,
  .cnlamp-flexible-section__inner,
  .editor-styles-wrapper
) ol:not([class]) {
  list-style: decimal;
}

:is(
  .entry-content,
  .projects-page-introduction,
  .shop-page-editor-content,
  .b2b-product-information-content,
  .cnlamp-flexible-section__inner,
  .editor-styles-wrapper
) :where(li + li) {
  margin-block-start: 0.45rem;
}

:is(
  .entry-content,
  .projects-page-introduction,
  .shop-page-editor-content,
  .b2b-product-information-content,
  .cnlamp-flexible-section__inner,
  .editor-styles-wrapper
) :where(a):not(.wp-block-button__link) {
  color: #054779;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

:is(
  .entry-content,
  .projects-page-introduction,
  .shop-page-editor-content,
  .b2b-product-information-content,
  .cnlamp-flexible-section__inner,
  .editor-styles-wrapper
) :where(img, video, iframe, object, embed) {
  max-width: 100%;
}

:is(
  .entry-content,
  .projects-page-introduction,
  .shop-page-editor-content,
  .b2b-product-information-content,
  .cnlamp-flexible-section__inner,
  .editor-styles-wrapper
) :where(img, video) {
  height: auto;
}

:is(
  .entry-content,
  .projects-page-introduction,
  .shop-page-editor-content,
  .b2b-product-information-content,
  .cnlamp-flexible-section__inner,
  .editor-styles-wrapper
) :where(pre, .wp-block-code) {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre;
}

:is(
  .entry-content,
  .projects-page-introduction,
  .shop-page-editor-content,
  .b2b-product-information-content,
  .cnlamp-flexible-section__inner,
  .editor-styles-wrapper
) :where(.wp-block-columns, .wp-block-column, .wp-block-group, .wp-block-media-text, .wp-block-media-text__content) {
  min-width: 0;
}

:is(
  .entry-content,
  .projects-page-introduction,
  .shop-page-editor-content,
  .b2b-product-information-content,
  .cnlamp-flexible-section__inner,
  .editor-styles-wrapper
) .wp-block-columns {
  gap: clamp(1.25rem, 3vw, 2rem);
}

:is(
  .entry-content,
  .projects-page-introduction,
  .shop-page-editor-content,
  .b2b-product-information-content,
  .cnlamp-flexible-section__inner,
  .editor-styles-wrapper
) .wp-block-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

:is(
  .entry-content,
  .projects-page-introduction,
  .shop-page-editor-content,
  .b2b-product-information-content,
  .cnlamp-flexible-section__inner,
  .editor-styles-wrapper
) .wp-block-button__link {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid #054779;
  border-radius: 0;
  padding: 0.75rem 1.25rem;
  background: #054779;
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}

:is(
  .entry-content,
  .projects-page-introduction,
  .shop-page-editor-content,
  .b2b-product-information-content,
  .cnlamp-flexible-section__inner,
  .editor-styles-wrapper
) .wp-block-button__link:hover,
:is(
  .entry-content,
  .projects-page-introduction,
  .shop-page-editor-content,
  .b2b-product-information-content,
  .cnlamp-flexible-section__inner,
  .editor-styles-wrapper
) .wp-block-button__link:focus-visible {
  border-color: #032e4f;
  background: #032e4f;
  color: #ffffff;
  outline: none;
}

:is(
  .entry-content,
  .projects-page-introduction,
  .shop-page-editor-content,
  .b2b-product-information-content,
  .cnlamp-flexible-section__inner,
  .editor-styles-wrapper
) .wp-block-button.is-style-outline .wp-block-button__link {
  background: transparent;
  color: #054779;
}

:is(
  .entry-content,
  .projects-page-introduction,
  .shop-page-editor-content,
  .b2b-product-information-content,
  .cnlamp-flexible-section__inner,
  .editor-styles-wrapper
) :where(.wp-block-image, .wp-block-gallery, .wp-block-video, .wp-block-audio, .wp-block-embed) {
  max-width: 100%;
}

:is(
  .entry-content,
  .projects-page-introduction,
  .shop-page-editor-content,
  .b2b-product-information-content,
  .cnlamp-flexible-section__inner,
  .editor-styles-wrapper
) :where(.wp-block-image figcaption, .wp-block-gallery figcaption, .wp-block-video figcaption, .wp-block-table figcaption) {
  margin-block-start: 0.7rem;
  color: #64748b;
  font-size: 0.8125rem;
  line-height: 1.5;
  text-align: left;
}

:is(
  .entry-content,
  .projects-page-introduction,
  .shop-page-editor-content,
  .b2b-product-information-content,
  .cnlamp-flexible-section__inner,
  .editor-styles-wrapper
) .wp-block-table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
}

:is(
  .entry-content,
  .projects-page-introduction,
  .shop-page-editor-content,
  .b2b-product-information-content,
  .cnlamp-flexible-section__inner,
  .editor-styles-wrapper
) .wp-block-table table {
  width: 100%;
  border-collapse: collapse;
}

:is(
  .entry-content,
  .projects-page-introduction,
  .shop-page-editor-content,
  .b2b-product-information-content,
  .cnlamp-flexible-section__inner,
  .editor-styles-wrapper
) .wp-block-table :where(th, td) {
  border: 1px solid #cbd5e1;
  padding: 0.75rem 0.875rem;
  text-align: left;
  vertical-align: top;
}

:is(
  .entry-content,
  .projects-page-introduction,
  .shop-page-editor-content,
  .b2b-product-information-content,
  .cnlamp-flexible-section__inner,
  .editor-styles-wrapper
) .wp-block-table th {
  background: #eef7fb;
  color: #0f172a;
  font-weight: 700;
}

:is(
  .entry-content,
  .projects-page-introduction,
  .shop-page-editor-content,
  .b2b-product-information-content,
  .cnlamp-flexible-section__inner,
  .editor-styles-wrapper
) :where(.wp-block-quote, .wp-block-pullquote) {
  margin-inline: 0;
  padding: 1.5rem clamp(1.25rem, 3vw, 2rem);
}

:is(
  .entry-content,
  .projects-page-introduction,
  .shop-page-editor-content,
  .b2b-product-information-content,
  .cnlamp-flexible-section__inner,
  .editor-styles-wrapper
) .wp-block-cover {
  min-height: min(520px, 70vh);
  padding: clamp(1.5rem, 5vw, 4rem);
}

/* Theme-provided block styles shown in the Gutenberg Styles panel. */
.is-style-cnlamp-eyebrow {
  color: #0a7a57 !important;
  font-size: 0.75rem !important;
  font-weight: 750 !important;
  letter-spacing: 0.08em;
  line-height: 1.3 !important;
  text-transform: uppercase;
}

.wp-block-group.is-style-cnlamp-card {
  min-width: 0;
  border-top: 3px solid #054779;
  padding: clamp(1.35rem, 3vw, 2rem);
}

.wp-block-group.is-style-cnlamp-card:not(.has-background) {
  background: #f8fafc;
}

.wp-block-group.is-style-cnlamp-brand-band {
  min-width: 0;
  padding: clamp(2rem, 5vw, 3.5rem);
}

.wp-block-group.is-style-cnlamp-brand-band:not(.has-background) {
  background: #032e4f;
}

.wp-block-group.is-style-cnlamp-brand-band:not(.has-text-color),
.wp-block-group.is-style-cnlamp-brand-band:not(.has-text-color) :where(h1, h2, h3, h4, h5, h6, p) {
  color: #ffffff;
}

.wp-block-group.is-style-cnlamp-brand-band .wp-block-button__link {
  border-color: #d8e84a;
  background: #d8e84a;
  color: #032e4f;
}

.wp-block-columns.is-style-cnlamp-feature-grid {
  align-items: stretch !important;
  gap: clamp(1rem, 2.5vw, 1.5rem) !important;
}

.wp-block-columns.is-style-cnlamp-feature-grid > .wp-block-column {
  min-width: 0;
  border-top: 3px solid #054779;
  padding: clamp(1.25rem, 2.5vw, 1.75rem);
  background: #f8fafc;
}

.wp-block-quote.is-style-cnlamp-accent {
  border: 0;
  border-left: 5px solid #d8e84a;
  background: #eef7fb;
  color: #0f172a;
}

.wp-block-image.is-style-cnlamp-framed {
  padding: clamp(0.65rem, 2vw, 1.125rem);
  border: 1px solid #cbd5e1;
  background: #ffffff;
}

.wp-block-button.is-style-cnlamp-arrow .wp-block-button__link::after {
  margin-left: 0.65rem;
  content: "→";
  font-size: 1.05em;
  transition: transform 160ms ease;
}

.wp-block-button.is-style-cnlamp-arrow .wp-block-button__link:hover::after,
.wp-block-button.is-style-cnlamp-arrow .wp-block-button__link:focus-visible::after {
  transform: translateX(0.2rem);
}

.cnlamp-flexible-section.is-appearance-brand .cnlamp-flexible-section__inner :where(h1, h2, h3, h4, h5, h6):not(.has-text-color) {
  color: #ffffff;
}

.cnlamp-flexible-section.is-appearance-brand .cnlamp-flexible-section__inner .wp-block-button__link {
  border-color: #d8e84a;
  background: #d8e84a;
  color: #032e4f;
}

/* Let wide/full native blocks escape the narrow article column safely. */
:is(.site-main--page, .site-main--single) .entry-content > :where(.alignwide, .alignfull) {
  position: relative;
  left: 50%;
  width: min(1120px, calc(100vw - 2rem));
  max-width: none;
  transform: translateX(-50%);
}

:is(.site-main--page, .site-main--single) .entry-content > .alignfull {
  width: 100vw;
}

@media (max-width: 48.99rem) {
  :is(
    .entry-content,
    .projects-page-introduction,
    .shop-page-editor-content,
    .b2b-product-information-content,
    .cnlamp-flexible-section__inner,
    .editor-styles-wrapper
  ) .wp-block-columns:not(.is-not-stacked-on-mobile) {
    flex-direction: column;
  }

  :is(
    .entry-content,
    .projects-page-introduction,
    .shop-page-editor-content,
    .b2b-product-information-content,
    .cnlamp-flexible-section__inner,
    .editor-styles-wrapper
  ) .wp-block-media-text.is-stacked-on-mobile {
    grid-template-columns: 100% !important;
  }

  :is(
    .entry-content,
    .projects-page-introduction,
    .shop-page-editor-content,
    .b2b-product-information-content,
    .cnlamp-flexible-section__inner,
    .editor-styles-wrapper
  ) .wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__media,
  :is(
    .entry-content,
    .projects-page-introduction,
    .shop-page-editor-content,
    .b2b-product-information-content,
    .cnlamp-flexible-section__inner,
    .editor-styles-wrapper
  ) .wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__content {
    grid-column: 1;
  }

  :is(
    .entry-content,
    .projects-page-introduction,
    .shop-page-editor-content,
    .b2b-product-information-content,
    .cnlamp-flexible-section__inner,
    .editor-styles-wrapper
  ) .wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__media {
    grid-row: 1;
  }

  :is(
    .entry-content,
    .projects-page-introduction,
    .shop-page-editor-content,
    .b2b-product-information-content,
    .cnlamp-flexible-section__inner,
    .editor-styles-wrapper
  ) .wp-block-media-text.is-stacked-on-mobile .wp-block-media-text__content {
    grid-row: 2;
    padding: 1.5rem 0 0;
  }

  :is(.site-main--page, .site-main--single) .entry-content > .alignfull {
    width: 100vw;
  }
}
