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

$params: (
   "margin": global.$spacer 0 global.$spacer 0,
   "gap": 80px,

   "title-margin": 0 0 20px,
   "title-color": global.$headings-color,
   "title-font-size": global.$font-size-h1,
   "title-font-weight": global.$font-weight-bold,

   "image-border": 0,
   "image-border-radius": global.$border-radius-lg,

   "lead-margin": 30px 0 40px 0,
   "lead-font-size": global.$font-size-h4,
   "lead-font-weight": global.$font-weight-base,
);

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

   $params: map.merge($params, components.$c-articles-detail-header-simple);
}

.#{component("Articles:Detail:Header:Simple", "class")} {
   position: relative;
   margin: map.get($params, "margin");

   .content {
      display: flex;
      justify-content: space-between;
      gap: map.get($params, "gap");
   }

   .#{component("Picture", "class")} {
      border: map.get($params, "image-border");

      img {
         border-radius: map.get($params, "image-border-radius");
      }
   }

   .lead {
      font-size: map.get($params, "lead-font-size");
      font-weight: map.get($params, "lead-font-weight");
      margin: map.get($params, "lead-margin");
   }

   p {
      margin: 0;
   }

   .title {
      margin: map.get($params, "title-margin");
      color: map.get($params, "title-color");
      font-size: map.get($params, "title-font-size");
      font-weight: map.get($params, "title-font-weight");
   }
}
