/**
 * Blockquote print
 * @define blockquote
 */

@use 'sass:map';

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

.ecl-blockquote,
%ecl-blockquote {
  border-inline-start: map.get($blockquote, 'border-width') solid
    map.get($blockquote, 'border-color');
  border-radius: map.get($blockquote, 'border-radius');
  box-shadow: map.get($blockquote, 'shadow');
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  margin: 0;
  padding: map.get($blockquote-print, 'padding');
}

.ecl-blockquote__citation,
%ecl-blockquote {
  color: map.get($blockquote, 'quote', 'color');
  font: map.get($blockquote-print, 'quote-font');
  font-style: italic;
  margin: 0;
  quotes: '‘' '’';
  max-width: var(--max-w);

  &::before {
    content: open-quote;
  }

  &::after {
    content: close-quote;
  }

  &[lang='bg'],
  &[lang='cs'],
  &[lang='de'],
  &[lang='et'],
  &[lang='sk'],
  &[lang='sl'],
  &[lang='lt'] {
    quotes: '„' '“';
  }

  &[lang='hr'],
  &[lang='hu'],
  &[lang='pl'],
  &[lang='ro'] {
    quotes: '„' '”';
  }

  &[lang='da'] {
    quotes: '»' '«';
  }

  &[lang='el'],
  &[lang='fr'],
  &[lang='es'],
  &[lang='it'],
  &[lang='pt'] {
    quotes: '«' '»';
  }

  &[lang='fi'],
  &[lang='sv'] {
    quotes: '”' '”';
  }

  &[lang='lv'],
  &[lang='nl'],
  &[lang='mt'] {
    quotes: '“' '”';
  }
}

.ecl-blockquote__quote {
  margin: 0;
}

.ecl-blockquote__attribution,
%ecl-blockquote__author {
  margin-top: map.get($blockquote-print, 'author-margin');
  max-width: var(--max-w);
}

.ecl-blockquote__author,
%ecl-blockquote__author {
  color: map.get($blockquote, 'author', 'color');
  font: map.get($blockquote-print, 'author-font');
  font-weight: map.get($blockquote, 'author', 'font-weight');
}

.ecl-blockquote__image,
%ecl-blockquote__image {
  aspect-ratio: 1/1;
  height: 120px;
  margin-inline-end: map.get($blockquote-print, 'image-margin');
  object-fit: cover;
  width: 120px;
}
