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

$params: (
   "margin": 0 0 global.$gap-width,

   "description-text-margin": 0 0 global.$spacer,

   "read-more-display": inline,
   "read-more-color": global.$text-dark,
   "read-more-font-size": global.$font-size-base,
   "read-more-font-weight": global.$font-weight-base,
   "read-more-text-transform": none,
   "read-more-text-decoration-mixin": "default",
);

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

   $params: map.merge($params, components.$c-section-descriptioncollapse-inline);
}

.#{component("Section:DescriptionCollapse:Inline", "class")} {
   margin: map.get($params, "margin");

   p {
      margin: map.get($params, "description-text-margin");
   }

   .read-more-link {
      display: map.get($params, "read-more-display");
      color: map.get($params, "read-more-color");
      font-size: map.get($params, "read-more-font-size");
      font-weight: map.get($params, "read-more-font-weight");
      text-transform: map.get($params, "read-more-text-transform");
      cursor: pointer;

      @if (map.get($params, "read-more-text-decoration-mixin") == "default") {
         @include global.underline-default;
      } @else if (map.get($params, "read-more-text-decoration-mixin") == "hover") {
         @include global.underline-hover;
      }
   }
}
