/* WordPress Gutenberg markup-specific presentation.
 * All elements below are native Gutenberg blocks and remain editable.
 * Author: ropko.online
 */

/* Prevent core block layout constraints and legacy flow margins from collapsing
 * the explicitly designed grids into a single vertical stream. */
body.mp-site .wp-block-group.mp-features,
body.mp-site .wp-block-group.mp-category-grid,
body.mp-site .wp-block-group.mp-brands-grid,
body.mp-site .wp-block-group.mp-about-photos,
body.mp-site .wp-block-group.mp-gallery-grid,
body.mp-site .wp-block-group.mp-contact-cards,
body.mp-site .wp-block-group.mp-updates-preview {
  display: grid !important;
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  min-width: 0 !important;
  align-content: start;
  grid-auto-flow: row;
}
body.mp-site .wp-block-group.mp-features,
body.mp-site .mp-home-four-up { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 22px !important; }
body.mp-site .wp-block-group.mp-category-grid,
body.mp-site .mp-home-three-up { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 24px !important; }
body.mp-site .wp-block-group.mp-brands-grid,
body.mp-site .mp-home-six-up { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; gap: 20px 25px !important; }
body.mp-site .wp-block-group.mp-about-photos { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 32px !important; }
body.mp-site .wp-block-group.mp-gallery-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; gap: 24px 26px !important; }
body.mp-site .wp-block-group.mp-contact-cards { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; gap: 26px 28px !important; }
body.mp-site .wp-block-group.mp-updates-preview { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 22px !important; }

/* Explicitly reset the automatically generated WP layout constraints for grid
 * children, including Gutenberg figures wrapped by core/image. */
body.mp-site .wp-block-group:is(.mp-features,.mp-category-grid,.mp-brands-grid,.mp-about-photos,.mp-gallery-grid,.mp-contact-cards,.mp-updates-preview) > * {
  min-width: 0 !important;
  max-width: none !important;
  width: auto !important;
  margin: 0 !important;
  grid-column: auto !important;
  grid-row: auto !important;
}
body.mp-site .wp-block-group:is(.mp-gallery-grid,.mp-about-photos,.mp-brands-grid,.mp-category-grid) > figure,
body.mp-site .mp-home-six-up > figure { display: block; margin: 0 !important; }
body.mp-site .wp-block-group:is(.mp-gallery-grid,.mp-about-photos,.mp-brands-grid,.mp-category-grid) > figure > img {
  display: block;
  max-width: 100%;
}

/* Gutenberg Columns blocks rendered by the normal page pipeline. */
body.mp-site .wp-block-columns.mp-hero-grid,
body.mp-site .wp-block-columns.mp-special-grid,
body.mp-site .wp-block-columns.mp-special-page-grid,
body.mp-site .wp-block-columns.mp-special-services-grid {
  display: grid !important;
  width: 100%;
  min-width: 0;
  align-items: start;
}
body.mp-site .wp-block-columns.mp-hero-grid,
body.mp-site .mp-home-hero-grid {grid-template-columns:minmax(0,58fr) minmax(0,37fr) !important;gap:5% !important}
body.mp-site .wp-block-columns.mp-special-grid,
body.mp-site .mp-home-special-grid {grid-template-columns:minmax(0,31fr) minmax(0,69fr) !important;gap:16px !important}
body.mp-site .wp-block-columns.mp-special-page-grid {grid-template-columns:minmax(0,40fr) minmax(0,60fr) !important;gap:42px !important}
body.mp-site .wp-block-columns.mp-special-services-grid {grid-template-columns:minmax(0,60fr) minmax(0,40fr) !important;gap:45px !important}
body.mp-site .wp-block-columns:is(.mp-hero-grid,.mp-special-grid,.mp-special-page-grid,.mp-special-services-grid) > .wp-block-column {
  flex-basis:auto !important;flex-grow:0 !important;
  min-width:0 !important;max-width:100% !important;width:auto !important;
  margin:0 !important;
}

/* Page wrappers inserted by WordPress must not alter component widths. */
body.mp-site .mp-page-body > .wp-block-group {width:100%;max-width:none;}
body.mp-site .mp-page-galeria .mp-gallery-grid > figure {aspect-ratio: 1.45;overflow:hidden;border-radius:7px;}
body.mp-site .mp-page-galeria .mp-gallery-grid > figure > img {width:100% !important;height:100% !important;object-fit:cover;}
body.mp-site .mp-page-o-nas .mp-about-photos > figure > img {width:100%;height:220px;object-fit:cover;}
body.mp-site .mp-page-kontakt .mp-contact-cards > .mp-contact-card {grid-column:span 2;}
body.mp-site .mp-page-kontakt .mp-contact-cards > .mp-contact-card:nth-child(4) {grid-column:3 / span 2;}

/* The Gutenberg shortcode block receives the theme's form and feed HTML; it
 * must never gain a layout max-width that would shrink these sections. */
body.mp-site .wp-block-shortcode {max-width:100%;min-width:0;}
body.mp-site .mp-home-hero-form .mp-form-shell,
body.mp-site .mp-form-panel .mp-form-shell,
body.mp-site .mp-contact-form-section .mp-form-shell {width:100%;max-width:100%;}
body.mp-site .mp-updates-section .mp-updates-preview {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:23px;}

@media(max-width:980px) {
  body.mp-site .wp-block-columns.mp-hero-grid,
  body.mp-site .mp-home-hero-grid {grid-template-columns:minmax(0,1fr) !important;gap:32px!important}
  body.mp-site .wp-block-group.mp-features,
  body.mp-site .mp-home-four-up {grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body.mp-site .wp-block-group.mp-brands-grid,
  body.mp-site .mp-home-six-up {grid-template-columns:repeat(4,minmax(0,1fr))!important}
  body.mp-site .wp-block-group.mp-gallery-grid {grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:18px!important}
}
@media(max-width:730px) {
  body.mp-site .wp-block-group.mp-category-grid,
  body.mp-site .mp-home-three-up {grid-template-columns:1fr!important;gap:18px!important}
  body.mp-site .wp-block-group.mp-brands-grid,
  body.mp-site .mp-home-six-up {grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:15px!important}
  body.mp-site .wp-block-group.mp-gallery-grid {grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:12px!important}
  body.mp-site .wp-block-group.mp-about-photos {grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:10px!important}
  body.mp-site .wp-block-columns.mp-special-page-grid,
  body.mp-site .wp-block-columns.mp-special-services-grid {grid-template-columns:1fr!important;gap:22px!important}
  body.mp-site .mp-page-kontakt .mp-contact-cards {grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body.mp-site .mp-page-kontakt .mp-contact-cards > .mp-contact-card {grid-column: auto;}
  body.mp-site .mp-page-kontakt .mp-contact-cards > .mp-contact-card:nth-child(4) {grid-column:auto;}
  body.mp-site .mp-updates-section .mp-updates-preview {grid-template-columns:1fr!important}
}
@media(max-width:480px) {
  body.mp-site .wp-block-group.mp-features,
  body.mp-site .mp-home-four-up {grid-template-columns:1fr!important}
  body.mp-site .wp-block-group.mp-brands-grid,
  body.mp-site .mp-home-six-up {grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body.mp-site .wp-block-group.mp-gallery-grid {grid-template-columns:repeat(2,minmax(0,1fr))!important}
  body.mp-site .mp-page-kontakt .mp-contact-cards {grid-template-columns:1fr!important}
}
