/*
 * Caledros Basic Blocks - Easy to use Gutenberg blocks
 * Copyright (C) 2025  David Arnado
 * 
 * This file is part of Caledros Basic Blocks.
 * 
 * Caledros Basic Blocks is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.

 * Caledros Basic Blocks is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License along
 * with Caledros Basic Blocks; if not, see <https://www.gnu.org/licenses/>.
 */

/*Grid container*/
.cbb-grid-container {
  display: grid;
  grid-template-columns: repeat(var(--cbb-col-lg, 1), 1fr);
  background-size: cover;
}

/*Grid container with background color*/
.cbb-grid-container--has-bg-color {
  background-color: var(--cbb-light-bg-color, #00000000);
  transition: background-color 0.3s;
  background-blend-mode: overlay;
}

/*Grid container with box shadow*/
.cbb-grid-container--has-box-shadow {
  box-shadow: var(--cbb-light-box-shadow, none);
}

/*Grid container with background gradient*/
.cbb-grid-container--has-bg-gradient {
  background-image: var(--cbb-light-bg-gradient, none);
}

/*Grid container with border*/
.cbb-grid-container--has-border {
  border-color: var(--cbb-light-border-color, #00000000);
}

/*Grid container with blur*/
.cbb-grid-container--has-blur {
  backdrop-filter: blur(var(--cbb-blur, 10px));
}

/*Grid container (Tablet)*/
@media (max-width: 810px) {
  .cbb-grid-container {
    grid-template-columns: repeat(var(--cbb-col-md, 1), 1fr);
  }
}

/*Grid container (Mobile)*/
@media (max-width: 450px) {
  .cbb-grid-container {
    grid-template-columns: repeat(var(--cbb-col-sm, 1), 1fr);
  }
}

/*Dark mode*/
/*Grid container with background color*/
html[data-theme="dark"] .cbb-grid-container--has-bg-color {
  background-color: var(--cbb-dark-bg-color, #00000000);
}

/*Grid container with background gradient*/
html[data-theme="dark"] .cbb-grid-container--has-bg-gradient {
  background-image: var(--cbb-dark-bg-gradient, none);
}

/*Grid container with box shadow*/
html[data-theme="dark"] .cbb-grid-container--has-box-shadow {
  box-shadow: var(--cbb-dark-box-shadow, none);
}

/*Grid container with border*/
html[data-theme="dark"] .cbb-grid-container--has-border {
  border-color: var(--cbb-dark-border-color, #00000000);
}

/*Full width container for mobile and tablets*/
@media (max-width: 810px) {
  .cbb-grid-container--full-width-tablet {
    max-width: 100% !important;
  }
}

/*Full width container for mobile devices*/
@media (max-width: 450px) {
  .cbb-grid-container--full-width-mobile {
    max-width: 100% !important;
  }
}

/*Fix for the image gallery block*/
.cbb-grid-container:has(> .cbb-image-gallery) {
  overflow: hidden !important;
}

/*Fix for the slider block*/
.cbb-grid-container:has(> .cbb-slider) {
  overflow: hidden !important;
}

/*Fix for grid container with global padding*/
.has-global-padding
  :where(
    :not(.alignfull.is-layout-flow)
      > .has-global-padding:not(.wp-block-block, .alignfull)
  ) {
  padding-right: var(--wp--style--root--padding-right) !important;
  padding-left: var(--wp--style--root--padding-left) !important;
}
