/**
 * Page header EC print
 * @define page-header
 */

@use 'sass:map';

// Exposed variables
$theme: null !default;
$page-header: null !default;
$page-header-print: null !default;

.ecl-page-header {
  padding-bottom: map.get($theme, 'spacing-print', 'xl');
}

.ecl-page-header__info {
  margin-bottom: map.get($theme, 'spacing-print', 's');
  margin-top: calc(
    #{map.get($theme, 'spacing-print', 'm')} +
      #{map.get($theme, 'spacing-print', 's')}
  );
}

.ecl-page-header__meta {
  color: var(--c-d);
  display: inline-block;
  font: var(--f-ui-m);
  list-style: none;
  margin: 0;
  padding: 0;
}

.ecl-page-header__meta-item {
  border-inline-end: 1px solid var(--c-p);
  display: inline;
  margin-inline-end: map.get($theme, 'spacing-print', 'xs');
  padding-inline-end: map.get($theme, 'spacing-print', 'xs');
  unicode-bidi: isolate;

  &:first-of-type {
    text-transform: uppercase;
  }

  &:last-child {
    border-inline-end-width: 0;
    margin-inline-end: 0;
    padding-inline-end: 0;
  }
}

.ecl-page-header__title {
  color: map.get($page-header, 'title-color');
  font: map.get($page-header, 'title-font');
  margin-bottom: 0;
  margin-top: map.get($theme, 'spacing-print', '2xs');
}

.ecl-page-header__description-container {
  align-items: flex-start;
  display: flex;
  margin-top: map.get($theme, 'spacing-print', 's');
}

.ecl-page-header__description-thumbnail {
  border: 1px solid var(--c-n-20);
  margin-inline-end: map.get($theme, 'spacing-print', 's');
  max-width: 120px;
}

.ecl-page-header__description {
  color: map.get($page-header, 'description-color');
  font: map.get($page-header, 'description-font');
  margin-bottom: 0;
  margin-top: 0;
  max-width: 80ch;
}

.ecl-page-header--image {
  .ecl-page-header__background {
    display: block;
    height: 10.875rem;
    object-fit: cover;
    object-position: 50% 0;
    width: 100%;
  }
}
