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

$params: (
   "info-color": global.$text-muted,
   "info-font-size": global.$font-size-smaller,

   "link-font-weight": global.$font-weight-base,
   "link-color": global.$text-dark,
   "link-padding": unset,
   "link-first-padding": unset,
);

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

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

.#{component("Articles:ArticleInfo", "class")} {
   display: flex;
   flex-wrap: wrap;
   color: map.get($params, "info-color");
   font-size: map.get($params, "info-font-size");

   .link {
      display: inline-block;
      padding: map.get($params, "link-padding");
      color: map.get($params, "link-color");
      font-weight: map.get($params, "link-font-weight");

      &:first-of-type {
         padding: map.get($params, "link-first-padding");
      }
   }
}
