@use '../tokens/components';
@use '../functions/tokens';

tokens.$default-map: components.$post-blockquote;

.blockquote {
  font-size: tokens.get('post-blockquote-font-size');
  font-weight: tokens.get('post-blockquote-font-weight');
  margin: tokens.get('post-blockquote-margin-block') tokens.get('post-blockquote-margin-inline');
  padding: 0 tokens.get('post-blockquote-padding-inline-end') 0
    tokens.get('post-blockquote-padding-inline-start');
  border-inline-start: tokens.get('post-blockquote-border-width-left')
    tokens.get('post-blockquote-border-left-style') tokens.get('post-blockquote-border-left-color');
}

figure:has(.blockquote) {
  margin: tokens.get('post-blockquote-margin-block') tokens.get('post-blockquote-margin-inline');
  padding: 0 tokens.get('post-blockquote-padding-inline-end') 0
    tokens.get('post-blockquote-padding-inline-start');
  border-inline-start: tokens.get('post-blockquote-border-width-left')
    tokens.get('post-blockquote-border-left-style') tokens.get('post-blockquote-border-left-color');

  .blockquote {
    margin: 0;
    padding: 0;
    border-width: 0;
    border-style: none;
    border-color: transparent;

    q {
      quotes: '\00ab' '\00bb' '\2039' '\203A';

      /* Using inverted commas according to
         https://www.experience-hub.ch/document/2777/en#/general-regulations/typography-conventions-1686663630/inverted-commas
      */
      &:lang(en) {
        quotes: '\201C' '\201D' '\2018' '\2019';
      }
    }
  }
}

figcaption.blockquote-footer {
  margin-top: tokens.get('post-blockquote-gap-inline');

  cite {
    font-style: inherit;
  }
}
