/* block styles relevant to both the frontend and the WP block editor ***************************************/

/* standard Gutenberg blocks ********************************************************************************/

.wp-block-image {
  margin: 0;
}

.wp-block-group {
  clear: both;
  margin-bottom: 2.4em;
}

.wp-block-columns {
  /* relative positioning needed for Chrome */
  position: relative;
  clear: both;
  /* negative left and right margins, so that columns at the edges will appear without left and right margins  */
  margin: 1em -1em 1.8em -1em;
  align-items: stretch;
}

.wp-block-column {
  flex-basis: 100%;
  flex-grow: inherit;
}

.wp-block-column:not(:first-child), .wp-block-column:nth-child(2n) {
  margin-left: 1em;
}

.wp-block-column:not(:last-child), .wp-block-column:nth-child(2n+1) {
  margin-right: 1em;
}

.wp-block-column:first-child {
  margin-left: 1em;
}

.wp-block-column:last-child {
  margin-right: 1em;
}

.wp-block-quote {
  margin-top: 1.4em !important;
  margin-bottom: 2.0em !important;
  margin-left: 0;
  padding: 0.8em 0em 0.8em 2.4em;
  font-size: 1.0em;
  border-left: 4px solid var(--area-dark);
}

.wp-block-quote p:last-child {
  margin-bottom: 0;
}

.wp-block-quote p::before {
  content: '» ';
  font-size: 1.8em;
  vertical-align: text-bottom;
}

.wp-block-quote p::after {
  content: ' «';
  font-size: 1.8em;
  vertical-align: text-bottom;
}

.wp-block-code {
  color: var(--middleground) !important;
  font-size: 1.1em;
}

@media print {
  .wp-block-code {
    color: black !important;
    font-size: 1.1em;
  }
}

/* Advanced Gutenberg image block ***************************************************************************/

.advgb-image-block {
  clear: both;
  max-width: 100%;
  background-size: contain !important;
  background-repeat: no-repeat !important;
  background-color: transparent !important;
  padding: 0 !important;
}

@media print {
  .advgb-image-overlay {
    display: none;
  }
  
  .advgb-image-block {
    /* 
     The combination of the following two directives avoids 
     teared images in the print-out. 
    */
    display: block !important;
    page-break-inside: avoid;
    height: 10.0cm !important;
  }
}

/* hide image captions in frontend */
.advgb-image-title, 
.advgb-image-subtitle {
  display: none;
}

/* show image captions in editor */
.block-editor .advgb-image-title, 
.block-editor .advgb-image-subtitle {
  display: inherit;
}

.alignleft {
  margin: 0.8em 2.4em 0.2em 0 !important;
  float: left;
}

.alignright {
  margin: 0.8em 0 0.2em 2.4em !important;
  float: right;
}

.advgb_lightbox #cboxContent {
  background-color: black !important;
}

.advgb_lightbox #cboxLoadedContent {
  border: 1px solid var(--middleground) !important;
}

#colorbox.advgb_lightbox #cboxLoadedContent {
  background: black !important;
}

#colorbox.advgb_lightbox #cboxLoadingOverlay {
    background: var(--dark-gray) !important;
}


/* Advanced Gutenberg accordion block ***********************************************************************/

.advgb-accordion-wrapper {
  margin-top: 2.4em !important;
  clear: both;
}

.wp-block-advgb-accordion .advgb-accordion-header h4.advgb-accordion-header-title, 
.advgb-accordion-block .advgb-accordion-header h4.advgb-accordion-header-title {
  font-size: 0.84em !important;
}

.advgb-accordion-header {
  padding: 0.2em 0.8em 0.2em 0.8em !important;
  border-bottom: none !important;
  border-left: none !important;
  font-size: 1.0em !important;
  border-top: 1px solid var(--highlight) !important;
  border-right: 1px solid var(--highlight) !important;
  border-top-left-radius: 1.2em !important;
  border-top-right-radius: 1.2em !important;
}

.advgb-accordion-header-title {
  font-size: 0.84em !important;
}

.advgb-accordion-header-icon {
  margin: 0 !important;
  float: none !important;
  
  display: flex;
  justify-content: center;
  flex-direction: column;
  resize: vertical;
  position: absolute;
  top: 0;
  bottom: 0;
  right: 1.0em;
}

.advgb-accordion-body {
  overflow: hidden;
  padding: 0.4em !important;
  border-bottom: 2px solid var(--area-dark) !important;
  border-left: 2px solid var(--area-dark) !important;
  border-right: 1px solid var(--highlight) !important;
  border-bottom-left-radius: 1.2em !important;
  border-bottom-right-radius: 1.2em !important;
}

.advgb-accordions-wrapper table.wp-block-advgb-table,
.advgb-accordion-wrapper table.advgb-table-frontend {
  margin-top: 0 !important;
  margin-bottom: 0 !important;
}

.advgb-accordions-wrapper table.wp-block-advgb-table,
.advgb-accordion-wrapper table.advgb-table-frontend,
.advgb-accordions-wrapper table.wp-block-advgb-table td, 
.advgb-accordion-wrapper table.advgb-table-frontend td {
  border: none !important;
}

/* Advanced Gutenberg table block ***************************************************************************/

table.wp-block-advgb-table,
table.advgb-table-frontend {
/*
  border-collapse: collapse !important;
*/
  margin-top: 1.4em !important;
  margin-bottom: 2.0em !important;
  border-top: 2px solid var(--highlight);
  border-right: 2px solid var(--highlight);
  border-bottom: 2px solid var(--area-dark);
  border-left: 2px solid var(--area-dark);
  border-radius: 1.2em !important;
}

table.wp-block-advgb-table th,
table.wp-block-advgb-table td, 
table.advgb-table-frontend th,
table.advgb-table-frontend td {
  font-size: 0.84em;
  text-align: left;
  vertical-align: top;
  padding: 0.2em 0.8em 0.2em 0.8em !important;
  border: none;
}

table.wp-block-advgb-table thead td,
table.advgb-table-frontend thead th {
  font-weight: bold !important;
}

table.wp-block-advgb-table td:first-child, 
table.advgb-table-frontend th:first-child {
  border-top-left-radius: 1.4em !important;
}

table.wp-block-advgb-table td:last-child, 
table.advgb-table-frontend th:last-child {
  border-top-right-radius: 1.4em !important;
}

@media print {
  table.advgb-table-frontend thead th {
    background-color: white !important;
  }
}

/* Advanced Gutenberg form block ****************************************************************************/

/* 
  Note: Use .advgb-contact-form class without "wp-block" prefix 
  to make the styles work in the editor, too 
*/

.advgb-contact-form {
  padding-right: 0 !important;
}

.advgb-contact-form form,
.edit-post-visual-editor .advgb-contact-form {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  
  /* negative left and right margins, so that columns at the edges will appear without left and right margins  */
  margin: 2.0em -1.0em 2.4em -1.0em;
}

.advgb-contact-form .advgb-form-field,
.advgb-contact-form .advgb-grecaptcha, 
.advgb-contact-form .advgb-form-submit-wrapper {
  float: none;
  padding-left: 0;
  width: inherit;
  margin: 0 1em 1em 1em;
}

.advgb-contact-form .advgb-form-field-half {
  /* let both fields name and e-mail address take up the same space on the same row */
  flex-grow: 1 !important;
  flex-shrink: 1 !important;
  /* set inherit to overwrite the default width of 50% */
  width: inherit !important;
}

.advgb-contact-form .advgb-form-field-full {
  /* make the textarea fill an entire row */
  flex-basis: 100%;
}

.advgb-form-input-msg {
  height: 16.0em;
}
  
.advgb-contact-form .advgb-grecaptcha, 
.advgb-contact-form .advgb-form-submit-wrapper {
  flex-basis: auto;
}

.advgb-contact-form .advgb-grecaptcha {
  /* make the captcha take up extra space to the left of the send button */
  flex-grow: 1;
}

.advgb-contact-form .advgb-form-field .advgb-form-input[type="text"], 
.advgb-contact-form .advgb-form-field .advgb-form-input[type="email"], 
.advgb-contact-form .advgb-form-field .advgb-form-input {
  padding: 0.4em 0.8em 0.4em 0.8em;
}

.advgb-contact-form .advgb-form-submit,
.advgb-contact-form .advgb-form-submit-success {
  padding: 0.6em 1.0em 0.6em 1.0em;
}

.advgb-contact-form .advgb-form-submit-success {
  margin-left: 0;
}

/* Advanced Gutenberg summary block *************************************************************************/

ul.advgb-toc {
  margin-top: 2.0em !important;
  margin-bottom: 2.0em !important;
}

@media print {
  ul.advgb-toc {
    page-break-inside: avoid;
  }
}

.advgb-toc .toc-level-1 {
  margin-left: 0 !important;
}
