/* SMTLinks Site Design System V1.3.2
 * Unified Group + CSS Grid composition. Gutenberg owns content; this layer owns layout and visual defaults.
 * Keep selector scope predictable and avoid !important so explicit Gutenberg block styles can override defaults.
 */

/* WordPress/Astra theme containment: keep the design system inside SMTLinks page roots. */
.smt-layout-home,
.smt-layout-product-archive,
.smt-layout-solution-archive,
.smt-layout-case-archive,
.smt-layout-article-archive,
.smt-layout-about,
.smt-layout-contact,
.smt-layout-page,
.smt-layout-product-single,
.smt-layout-solution-single,
.smt-layout-case-single,
.smt-layout-article-single { min-width: 0; }

.smt-layout-home *, .smt-layout-product-archive *, .smt-layout-solution-archive *,
.smt-layout-case-archive *, .smt-layout-article-archive *, .smt-layout-about *,
.smt-layout-contact *, .smt-layout-page *, .smt-layout-product-single *,
.smt-layout-solution-single *, .smt-layout-case-single *, .smt-layout-article-single * { min-width: 0; }

/* Vertical-flow sections: only direct section Groups receive consistent block spacing. */
.smt-layout-home > .wp-block-group > .smt-section,
.smt-layout-home > .smt-section { padding-block: clamp(48px, 6vw, 80px); }
.smt-section > .smt-container { margin-inline: auto; }
.smt-section-header { width: 100%; }
.smt-section-header > :last-child { margin-bottom: 0; }

/* Grid-only composition helpers; apply these classes to Gutenberg Group blocks. */
.smt-grid { display: grid; width: 100%; align-items: stretch; }
.smt-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.smt-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.smt-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.smt-grid--auto { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.smt-home-hero__layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.smt-home-hero__media { width: 100%; }
.smt-home-hero__media img { display: block; width: 100%; height: auto; object-fit: cover; }
.smt-home-feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.smt-home-about { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(28px, 5vw, 64px); align-items: start; }

/* Buttons: horizontal layout belongs to the Buttons wrapper; Gutenberg inline block styles remain authoritative. */
.smt-home-hero__actions,
.smt-action-row,
.smt-cta__actions,
.smt-product-actions { display: flex; flex-flow: row wrap; align-items: center; gap: 12px; }
.smt-home-hero__actions .wp-block-buttons,
.smt-action-row .wp-block-buttons,
.smt-cta__actions .wp-block-buttons { display: flex; flex-flow: row wrap; align-items: center; gap: 12px; }
.smt-home-hero__actions .wp-block-button,
.smt-action-row .wp-block-button,
.smt-cta__actions .wp-block-button { margin: 0; }
.smt-btn { display: inline-flex; align-items: center; justify-content: center; max-width: 100%; text-align: center; text-decoration: none; cursor: pointer; }
/* Default color only when Gutenberg has not provided an explicit inline color. */
.wp-block-button.smt-btn--primary:not([style*="background-color"]) > .wp-block-button__link,
.wp-block-button.smt-btn:not(.smt-btn--secondary):not(.smt-btn--text):not([style*="background-color"]) > .wp-block-button__link { background: var(--smt-primary); color: #fff; }
.wp-block-button.smt-btn--secondary:not([style*="background-color"]) > .wp-block-button__link { background: #fff; color: var(--smt-heading); border: 1px solid var(--smt-border); }
.wp-block-button.smt-btn--primary > .wp-block-button__link:hover { background-color: var(--smt-primary-dark); color: #fff; }
.wp-block-button.smt-btn--secondary > .wp-block-button__link:hover { border-color: var(--smt-primary); color: var(--smt-primary); }

/* Typography: normalize spacing without overriding Gutenberg's explicit font-size/color choices. */
.smt-layout-home .smt-home-hero__eyebrow,
.smt-layout-home .smt-section-header__eyebrow { margin: 0 0 12px; color: var(--smt-primary); font-size: 14px; font-weight: 600; }
.smt-layout-home .smt-home-hero h1 { max-width: 780px; margin: 0 0 16px; }
.smt-layout-home .smt-home-hero__description { max-width: 760px; margin: 0; color: var(--smt-text-secondary); font-size: clamp(16px, 1.4vw, 18px); }
.smt-layout-home .smt-section-header h2 { margin: 0; }
.smt-layout-home .smt-section-header__description { margin: 10px 0 0; color: var(--smt-text-secondary); }
.smt-layout-home .smt-product-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; }
.smt-layout-home .smt-product-card h3,
.smt-layout-home .smt-product-card .smt-card__title { margin: 16px 0 0; font-size: 20px; line-height: 1.4; }
.smt-layout-home .smt-product-card p { margin: 8px 0 0; color: var(--smt-text-secondary); }

/* Avoid intrinsic overflow from long labels, tables and media. */
.smt-layout-home .wp-block-image, .smt-layout-home figure { max-width: 100%; }
.smt-layout-home .wp-block-buttons { max-width: 100%; }
.smt-layout-home .wp-block-button__link { white-space: normal; }

@media (max-width: 1199px) {
  .smt-grid--4, .smt-home-feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .smt-home-hero__layout { grid-template-columns: minmax(0, 1fr) minmax(260px, .85fr); gap: 32px; }
  .smt-layout-contact .smt-contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 767px) {
  .smt-grid--2, .smt-grid--3, .smt-grid--4, .smt-home-feature-grid,
  .smt-home-hero__layout, .smt-home-about, .smt-layout-contact .smt-contact-grid,
  .smt-layout-product-single .smt-product-main, .smt-layout-article-single .smt-article-layout { grid-template-columns: minmax(0, 1fr); }
  .smt-home-hero__layout { gap: 24px; }
  .smt-home-hero__actions, .smt-action-row, .smt-cta__actions,
  .smt-home-hero__actions .wp-block-buttons,
  .smt-action-row .wp-block-buttons,
  .smt-cta__actions .wp-block-buttons { flex-direction: row; flex-wrap: wrap; }
  .smt-home-hero__actions .wp-block-button, .smt-action-row .wp-block-button,
  .smt-cta__actions .wp-block-button { width: auto; }
  .smt-layout-home .smt-home-hero h1 { font-size: clamp(30px, 8vw, 36px); }
  .smt-layout-home .smt-product-card img { aspect-ratio: 4 / 3; }
}
