@use "sass:map";
@use "@twig/scss/_global" as global;
@use "@twig/scss/variables/_variables-components" as components;

$params: (
   "breakpoint-lg": global.$lg,
   "container-size": "true",
   "container-max-width": "false", // šířka v px
   "background-color": global.$body-bg-dark,
   "border": unset,
   "margin-bottom": 0,
);

@if global-variable-exists(c-footer, components) {
   $keys: map.keys(components.$c-footer);
   @each $name in $keys {
      @if not map.get($params, $name) {
         @warn "Neexistující proměnná '#{$name}' v komponentě '$#{component("Footer", "class")}'.";
      }
   }

   $params: map.merge($params, components.$c-footer);
}

.#{component("Footer", "class")} {
   margin-top: auto;
   background-color: map.get($params, "background-color");
   container-type: inline-size;
   border-top: map.get($params, "border");
   margin-bottom: map.get($params, "margin-bottom");

   > .container {
      @if (map.get($params, "container-size") != "true") {
         max-width: global.$unset-max;
      } @else if (map.get($params, "container-max-width" ) != "false") {
         max-width: map.get($params, "container-max-width");
      }
   }

   @container (inline-size < #{map.get($params, "breakpoint-lg")}) {
      @include global.container-query-selector(" > .container") {
         display: flex;
         flex-direction: column;
      }
   }
}
