// Global variables first
@import "utils/variables/defaults";

// Grid settings
@import "utils/variables/grid-settings";

// Sass Mq
// @see https://github.com/sass-mq/sass-mq
@import "sass-mq";
@import "utils/variables/breakpoints";

// Functions
@import "utils/functions/maths";
@import "utils/functions/palette";
@import "utils/functions/strip-units";
@import "utils/functions/flexy";

// Mixins
@import "utils/mixins/clearfix";
@import "utils/mixins/headings";
@import "utils/mixins/cols";
@import "utils/mixins/icon";
@import "utils/mixins/placeholder";
@import "utils/mixins/states";

// Base
@import "base/container";
@import "base/container-editor";
@import "base/images-editor";
@import "base/links";

// Layout
@import "layout/page-hero";
@import "layout/page-hero-editor";
@import "layout/footer/editor";

// Components
@import "components/grid/all";
@import "components/grid/editor";
@import "components/add-item";
@import "components/fluid";
@import "components/icon";
@import "components/pop-in/editor";
@import "components/social";
@import "components/form/input";

// Blocks
@import "blocks/action-block/main";
@import "blocks/action-block/editor";
@import "blocks/button/all";
@import "blocks/button/editor";
@import "blocks/call-to-action/all";
@import "blocks/call-to-action/editor";
@import "blocks/collapsable/main";
@import "blocks/collapsable/editor";
@import "blocks/core-blocks/blockquote";
@import "blocks/core-blocks/blockquote-editor";
@import "blocks/core-blocks/details";
@import "blocks/core-blocks/embed-editor";
@import "blocks/core-blocks/gallery-editor";
@import "blocks/core-blocks/group";
@import "blocks/core-blocks/image-editor";
@import "blocks/core-blocks/latest-posts";
@import "blocks/core-blocks/latest-posts-editor";
@import "blocks/core-blocks/menu";
@import "blocks/core-blocks/rss";
@import "blocks/core-blocks/rss-editor";
@import "blocks/core-blocks/social-links";
@import "blocks/core-blocks/social-links-editor";
@import "blocks/countdown-timer/editor";
@import "blocks/custom-card/main";
@import "blocks/custom-card/editor";
@import "blocks/download-block/style";
@import "blocks/download-block/editor";
@import "blocks/fact-block/main";
@import "blocks/fact-block/editor";
@import "blocks/header/editor";
@import "blocks/hero/main";
@import "blocks/hero/editor";
@import "blocks/iframe-button/editor";
@import "blocks/image-block/main";
@import "blocks/image-block/editor";
@import "blocks/link-group/main";
@import "blocks/link-group/editor";
@import "blocks/linklist/main";
@import "blocks/linklist/editor";
@import "blocks/links-with-icons/main";
@import "blocks/links-with-icons/editor";
@import "blocks/list-block/editor";
@import "blocks/petition-list/main";
@import "blocks/postlist/categories";
@import "blocks/postlist/categories-editor";
@import "blocks/regions/main";
@import "blocks/regions/editor";
@import "blocks/section/main";
@import "blocks/section/editor";
@import "blocks/slider/main";
@import "blocks/slider/editor";
@import "blocks/stat-counter/main";
@import "blocks/stat-counter/editor";
@import "blocks/tabbed-content/editor";
@import "blocks/term-list/main";
@import "blocks/tickcounter-embed/editor";
@import "blocks/tweet-action/tweet";
@import "blocks/tweet-action/editor";
@import "blocks/postlist/main";
@import "blocks/postlist/post-editor";

// Block Patterns
@import "block-patterns/group";

// Pages
@import "pages/search";

:root {
  --ms-base: 16;
  --ms-ratio: 1.2;
}

.amnesty-byline {
  margin-top: 24px;

  .components-panel__body.is-opened {
    padding-right: 0;
    padding-left: 0;
    border-bottom: none;
  }
}

.editor-post-title__block .editor-post-title__input,
.block-editor-block-list__layout,
.editor-styles-wrapper {
  font-family: var(--wp--preset--font-family--secondary);
}

.block-editor-block-list__layout,
.editor-styles-wrapper {
  li,
  p,
  a {
    font-family: var(--wp--preset--font-family--primary);
  }

  strong {
    font-family: var(--wp--preset--font-family--secondary);
  }
}

.form-row {
  display: flex;
}

.form-column {
  flex: 1 1 auto;
}

.form-column + .form-column {
  margin-left: 10px;
}

.form-action {
  flex: 0 0 45px;
}

.form-action button {
  margin-left: auto;
}

.form-footer {
  display: flex;
  justify-content: flex-end;
  padding-top: 10px;
  margin-top: 20px;
  border-top: 1px solid var(--wp--preset--color--grey-lighter);
}

// Gutenberg fixes
.editor-writing-flow {
  height: auto;
}

.edit-post-visual-editor .editor-writing-flow__click-redirect {
  max-height: 0;
  margin: 0;
}

// document reference input
.amnesty-docref.disabled {
  margin-top: 5px;
  margin-bottom: 5px;
  padding-top: 5px;
  padding-bottom: 5px;
  width: 100%;
  border-top: 1px solid var(--wp--preset--color--grey-lighter);
  border-bottom: 1px solid var(--wp--preset--color--grey-lighter);

  .components-text-control__input {
    background-color: var(--wp--preset--color--grey-lighter);
  }
}

.wp-block[data-type="amnesty-core/block-responsive-iframe"] {
  margin-top: 16px;
  margin-bottom: 16px;

  .wp-block-embed {
    margin: 12px;
  }
}

.rtl .is-left-aligned {
  text-align: right;
}

.is-center-aligned {
  text-align: center;
}

.is-right-aligned {
  text-align: right;

  .rtl & {
    text-align: left;
  }
}

.timezone-container {
  flex-direction: column;
  text-align: center;
}

.timezone-container h2 {
  text-decoration: underline;
}

.horizontal-search {
  margin-bottom: 0;
}
