/*
 *
 * NAVBAR
 *
 */

/* Do not make navbar fixed on form pages */
@media screen and (min-width: 1024px) {
  .navbar {
    height: 4.25rem; /* Bulma only has min-height, we want to fix height for ie11 compatibility */
  }
  body.h4c-form .navbar {
    position: absolute !important;
  }
}
@media screen and (max-width: 1023px) {
  .navbar > .container {
    min-height: unset !important;
  }
}

/*
 *
 * MAIN CONTENT AREA
 *
 */

/* By removing bulmas .content class, elements to not have margin-bottom anymore */
.main-content p:not(:last-child), 
.main-content dl:not(:last-child), 
.main-content ol:not(:last-child), 
.main-content ul:not(:last-child), 
.main-content blockquote:not(:last-child), 
.main-content pre:not(:last-child), 
.main-content table:not(:last-child) {
  margin-bottom: 1em;
}

/* No margin-bottom for panel-headings to avoid unwanted gap in for elements */
.main-content p.panel-heading {
    margin-bottom: 0;
}

/* Content area defaults */ 

/* Recreate bulma heading styles (delete later from enzian ?!) */
.h4c-content h2:not(:first-child), 
.h4c-content h3:not(:first-child) {
  margin-top: 1.3333em;
}
.h4c-content h2 {
  font-size: 1.75em;
  margin-bottom: 0.5714em;
}
.h4c-content h3 {
  font-size: 1.5em;
  margin-bottom: 0.6666em;
}
.h4c-content h3, 
.h4c-content h4, 
.h4c-content h5, 
.h4c-content h6 {
  font-weight: 400;
  line-height: 1.125;
}

/* Intendation for lists/bullet points */
.h4c-content ul {
  margin-left: 2em;
  margin-top: 1em;
}

/* Overwrite bulma border-top style */
.media .media {
  border-top: none !important;
}

/* Embedded entities */

/* Set margin for embedded media. Needs to account for media with subtitle and without (tricky) and right/left aligned  */
/* Use h4c-content class for all ckeditor fields, bulmas content class' margins cannot be properly overriden here */
.h4c-content > div > figure, .h4c-content > div > .embedded-entity {
  margin-top: 1rem;
  margin-bottom: 1rem;
}

/* Make align-center class work */
.h4c-content .align-center img {
  margin: 0 auto;
}

/* Make caption always centered */
.h4c-content figcaption {
  text-align: center;
}

/* Add margin to embedded and left or right aligned entities */
/* TODO: This was designed for medium size images but should work for all sizes */
@media screen and (min-width: 565px) {
  .h4c-content .align-left  {
    margin-right: 2rem;
  }
  .h4c-content .align-right {
    margin-left: 2rem;
  }
}

/* Do not float some elements which makes formatting a page very hard (consistent look on all screen sizes) */
h2, h3, .align-right.embedded-entity, .align-left.embedded-entity {
  clear: both;
}

/* Add margin to summary on node full displays */
/* For articles there already is a margin by other means (which is acutally a bug) */
/* TODO: Article full needs to be reworked */
.node--view-mode-full:not(.node--type-article) .h4c-summary p {
  margin-bottom: 1em;
}

/*
 *
 * Short info list with fontawesome icons e.g. for orga/event full view displays, see H4C#426
 *
 */

/* General styles */
.h4c-short-infos.fa-ul li {
  line-height: 150%;
  padding-bottom: .2rem;
  list-style: none;
}
.h4c-short-infos.fa-ul .fa-li {
  color: var(--enzian--primary-color);
  font-size: 130%;
}
.h4c-short-infos .h4c-event-date {
  font-weight: 600;
  color: var(--enzian--primary-color);
}
.node:not(.node--view-mode-popup):not(.node--view-mode-preview) .h4c-short-infos .h4c-event-date {
  font-size: 1.5rem;
}

/* Line up all elements in location reference field */
.h4c-short-infos .h4c-location-info {
  display: inline;
}
.h4c-short-infos .h4c-location-info div {
  display: inherit;
}

/* Put second element (location more info) into brakets if present */
.h4c-short-infos .h4c-location-info > div:nth-of-type(2) div::before {
  content: '(';
}
.h4c-short-infos .h4c-location-info > div:nth-of-type(2) div::after {
  content: ')';
}

 /* Enzian overwrite to be removed later */
.h4c-short-infos .h4c-inner-popup .h4c-website a::before,
.h4c-short-infos .h4c-inner-popup .h4c-email::before {
  content: none;
}

/*
 *
 * MEDIA
 *
 */

/* Hero styles */ 

/* Add defaults for hero img / add same settings for media gallery fullwidth */
.hero .image img {
  width: 100%;
  height: 40vh;
  object-fit: cover;
  object-position: center;
}

/* Background colors still live in content.scss because of color override */
.hero-body {
  padding: 0;
}
.hero-body .block:not(:last-child) {
  margin-bottom: 0; /* We do not want any margin-bottom between blocks here by default */
}
.hero-body .container {
  width: 100%;
  max-width: 100%;
}
.hero-body .title {
  text-align: center;
  margin: .5rem;
}

/* Media gallery defaults */ 
.h4c-media-gallery--h4c-embed .slick--skin--fullwidth img {
  width: 100%;
  height: 40vh;
  object-fit: cover;
  object-position: center;
}

/* Add bg color to media-gallery so that elements do not shine through on hover */
main .h4c-media-gallery--h4c-embed .slick--skin--fullwidth {
  background-color: #ffffff;
}

/* Define slick-padding class */
.slick-padding .slick-slide > div {
  padding: 0 .4rem;
}

/* Positin images in popup and preview view modes centered */
.h4c-inner-popup img {
    margin: 0 auto;
}

/*
 *
 * H4C STICKY / H4C FORM / H4C ANCHOR
 *
 */

/* Use h4c-sticky class specific elements */
/* Atm used for contact forms, form navbar and campaign menu */

.h4c-sticky {
  position: -webkit-sticky;
  position: sticky;
}

/* To avoid confusion for admins: contextual-region gives position:relative which messes up styling, related: https://www.drupal.org/project/drupal/issues/2494235 */
.contextual-region.h4c-sticky {
  position: -webkit-sticky !important;
  position: sticky !important;
}

/* Give relatively high z-index to make sure it e.g. the form navbar is always on top top form items */
.h4c-sticky {
  z-index: 101;
}

/* Tabs are used on orga and campaign forms */
.h4c-sticky .tabs {
  background-color: white;
  color: gray;
}

/* Position below main navbar with varying top according to body classes and screen size */
body.toolbar-horizontal.toolbar-fixed .h4c-sticky {
  top: 148px;
}
body.toolbar-vertical.toolbar-fixed .h4c-sticky {
  top: 107px;
}
@media screen and (max-width: 975px) {
  body.toolbar-vertical.toolbar-fixed .h4c-sticky {
    top: 87px;
  }
}
@media screen and (max-width: 609px) {
  body.toolbar-vertical .h4c-sticky {
    top: 48px;
  }
}
@media screen and (max-width: 1023px) {
  .h4c-sticky {
    top: 48px;
  }
}
@media screen and (min-width: 1024px) {
  .h4c-sticky {
    top: 68px;
  }
}

/* Calculate top if h4c-form class is present  */
body.toolbar-horizontal.toolbar-fixed.h4c-form .h4c-sticky {
  top: 80px;
}
body.toolbar-vertical.toolbar-fixed.h4c-form .h4c-sticky {
  top: 39px;
}
@media screen and (min-width: 1024px) {
  body.h4c-form .h4c-sticky {
    top: 0;
  }
}

/* Do not show anchor links which have no other purpose */
.h4c-anchor {
  visibility: hidden;
}

.block.h4c-sticky:not(:last-child) {
  margin-bottom: 0;
}

/*
 *
 * IE COMPATIBILTY
 *
 */

/* h4c-fixed class is only applied by JS conditionally for IE, see js/h4c_core.ie.fixed_elements.js */
.h4c-fixed {
  position: fixed;
}
.h4c-fixed.h4c-menu--campaign--portal {
  width: 100%;
}

/*
 *
 * MOVE TO OTHER MODULES
 *
 */

/* FAQ accordion styles */
.views-accordion-header a {
  font-weight: normal;
}

.ui-accordion h3 {
  margin-bottom: 1rem;
}

.ui-accordion > .views-row:not(:last-child) {
  margin-bottom: 1rem;
}

.button.h4c-border-radius-1em {
  border-radius: 1rem;
}

/* View mode specific styles */
/* Remove some elements from h4c-info-markup field */
.node--view-mode-teaser .h4c-location-wheelchair,
.node--view-mode-teaser .h4c-organisations,
.node--view-mode-teaser .h4c-cost,
.node--view-mode-teaser .h4c-website {
  display: none;
}

/* Margin bottom for items stacked horizontally */
.h4c-blocks-teaser > div:not(:last-child) {
  margin-bottom: 1.5rem;
}

/* Content type specific hero image, will be moved later to content type module CSS */

/* VEF and oembed (oembed needs testing) height, see also #190 */
/* Move to cci module and remove/reuse when switching to cssvars */
/*
.page-node-type-h4c-campaign .hero img,
.page-node-type-h4c-campaign .hero .video-embed-field-responsive-video,
.page-node-type-h4c-campaign .hero .media-oembed-content,
.page-node-type-h4c-flexible-page .hero img,
.page-node-type-h4c-flexible-page .hero .video-embed-field-responsive-video,
.page-node-type-h4c-flexible-page .hero .media-oembed-content {
  height: 80vh;
}
*/

/* Add margin below event teasers, should be moved to generic markup */
.h4c-events.h4c-events-teaser footer button {
  margin-top: 1.5rem;
}

/* Fix scrollbar bug for iphone 11/iOS 13 pro max chrome, see https://gitlab.com/geeks4change/sites/site-h4c-commonsinvest/issues/177 */
/* Move to theme later on */ 
@media screen and (max-width: 1023px) {
  body {
    width: 100vw;
  }
}