/**
 * @file
 * Foundations, page layout, typography and shared theme elements.
 * Dr. Florian Radut, M.D. (florian@radut.net)
 */

html {
  line-height: 1.3;
}

[dir="rtl"] body {
  text-align: right;
}

[dir="rtl"] ul,
[dir="rtl"] ol {
  direction: rtl;
}

/* Font size */
.fs0 {
  font-size: 1rem;
}

.fs1 {
  font-size: 1.125rem;
}

.fs2 {
  font-size: 1.25rem;
}

/* Contain floated content without extra clearfix classes. */
.sizer0:not(.pure-g),
#toplinks,
.menuband,
#breadcrumb,
.block-wrapper,
.shortcut-wrapper,
.page-intro,
.abc-page-intro {
  display: flow-root;
}

#pgwp {
  position: relative;
}

.sizer0 {
  margin: 0 auto;
}

#top_left,
#top_right,
#section1 {
  padding: 5px 10px 0;
}

#section2 {
  padding: 0 10px 20px;
}

#middlecontainer,
#sidebar-left,
#sidebar-right,
#main {
  margin: 10px;
}

#bottom_bg {
  box-sizing: content-box;
  min-height: 3em;
  padding-bottom: 2em;
}

#footer {
  padding: .5em 0;
  text-align: center;
  font-size: .95em;
  min-height: 3em;
}

#footer .block-content :is(ul, ol) {
  padding-inline: 0;
  list-style-position: inside;
}

.footer-below {
  width: 100%;
}

h4 {
  font-size: 1.1em;
}

h5,
h6 {
  font-size: 1em;
}

p {
  overflow-wrap: break-word;
}

a.link {
  text-decoration: none;
  border-bottom: 1px dotted;
}

a:hover,
a:focus,
.link:hover,
.link:focus {
  text-decoration: none;
  border-bottom: 1px solid;
}

h1 a,
h2 a,
a.site-logo,
.toolbar-menu a {
  border-bottom: none;
}

#name-and-slogan {
  padding: 20px;
}

.site-slogan {
  font-style: italic;
}

#site-name {
  margin: 0;
  padding: 0;
  font-size: 100%;
}

p#site-name a,
p#site-name a:hover,
h1#site-name a,
h1#site-name a:hover {
  font-weight: normal;
  text-decoration: none;
  line-height: normal;
  font-size: 2.4em;
}

#main h2.title a {
  font-size: 120%;
  line-height: normal;
  font-weight: normal;
  text-transform: none;
}

#main h1.title {
  font-size: 160%;
  padding: 10px 0;
  font-weight: normal;
  text-transform: none;
}

.logoimg {
  float: left;
  padding: 20px;
}

[dir="rtl"] .logoimg {
  float: right;
}

pre {
  background: #eee;
  padding: .75em 1.5em;
  border: 1px solid #ddd;
}

.divider {
  height: 100%;
  border-left: 1px dashed #ccc;
}

[dir="rtl"] .divider {
  border-left: none;
  border-right: 1px dashed #ccc;
}

blockquote {
  padding: 0 0 0 .5em;
  border-left: 4px solid #ddd;
  font-style: italic;
  clear: both;
}

[dir="rtl"] blockquote {
  padding: 0 .5em 0 0;
  border-left: none;
  border-right: 4px solid #ddd;
}

[dir="rtl"] .by {
  left: 0;
  text-align: left;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.block-wrapper > .block ul:not(.pager__items, .book-pager, .menu, .links) {
  padding: 0;
  padding-inline: 1em 0;
}

#header .block-wrapper > .block ul {
  padding: 0;
}

.region-topreg .block {
  margin: 0;
}

.region-header .block,
.region-header .content {
  margin: 0;
  padding: 0;
}

#middlecontainer .block {
  margin: 0 0 20px 0;
}

/* Blocks and forms use the available column width. */
:is(#sidebar-left, #sidebar-right, .sections) .block > .block-content {
  display: flow-root;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}

#mission {
  margin-bottom: 1.25rem;
}

/* Match User block heights within each desktop row. */
.sections > [class*="pure-u"] {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sections > [class*="pure-u"] > div,
.sections .region,
.sections .block-wrapper {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

#footer .block {
  margin: 5px;
}

#sidebar-left .block,
#sidebar-right .block {
  padding: 5px;
}

.sections .block {
  flex: 1;
  margin: 10px;
  padding: 5px;
}

.sections .themed-block {
  display: flex;
  flex-direction: column;
}

.sections .themed-block > .block-content {
  flex: 1;
}

/* Optional developer link. */
.byy {
  display: none;
}

.themed-block .crypto-widget-body {
  padding: .3em;
  background: #282828;
}

.block-addtoany-block .block-content {
  text-align: center;
}

.poll label.option {
  display: inline;
}

.addtoany_list a:hover {
  border-bottom: none;
}

.region-title[data-drupal-selector^="edit-blocks-region"] {
  background: rgba(68, 68, 68, 0.3);
}

.rnd .themed-block .crypto-widget-body,
.rnd pre,
.rnd .region-highlighted,
.rnd .themed-block,
.rnd #middlecontainer .block,
.rnd .sections .block,
.rnd blockquote {
  border-radius: 5px;
}

/* Apply Drupal toolbar displacement once, including an expanded tray. */
body.toolbar-fixed {
  padding-top: var(--drupal-displace-offset-top, 39px) !important;
}

body.toolbar-fixed.toolbar-horizontal.toolbar-tray-open {
  padding-top: var(--drupal-displace-offset-top, 79px) !important;
}

/* Header regions wrap independently of the PureCSS content grid. */
#header {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
}

#header > .region-header {
  order: 1;
  flex: 1 1 max-content;
  min-width: 0;
}

#header > .region-topreg {
  order: 2;
  flex: 1 1 min-content;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* Ordinary blocks occupy separate rows; compact controls share a row in block order. */
.region-topreg::after {
  display: none;
}

.region-topreg > .block-wrapper {
  flex: 0 0 100%;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

#header > .region-topreg > .block-wrapper:has(:is(.block-search, .language-selector)),
.pi #header > .region-topreg > .block-wrapper:has(.menu--account) {
  flex: 0 1 auto;
}

/* ABC-specific presentation, preserving the original colors and backgrounds. */
body {
  margin: 0;
  padding: 0;
  background: #fff;
  color: #000;
}

h1 {
  font-size: 1.6em;
  color: #000;
}

h3 {
  font-size: 1.2em;
  color: #000;
}

a {
  text-decoration: none;
  border-bottom: 1px dotted;
  color: #000;
}

a:link {
  color: #000;
}

#name-and-slogan a {
  border-bottom: none;
  color: #000;
}

h2 {
  font-size: 1.4em;
  color: #000;
  font-weight: normal;
}

h3.block-title {
  font-size: 1.4em;
  font-weight: normal;
}

.region-toplinks {
  float: right;
  text-align: right;
  padding: 0 20px;
  margin: 0 0 9px;
}

[dir="rtl"] .region-toplinks {
  float: left;
  text-align: left;
}

.region-topreg {
  position: relative;
  z-index: 9;
  text-align: end;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: .25rem .5rem;
  padding: 10px 20px;
}

.region-highlighted {
  margin-top: 10px;
  padding: 20px 20px 0;
  font-weight: normal;
  font-size: .95em;
  border: 1px solid #ddd;
  background-color: rgba(238, 238, 238, .5);
}

.themed-block {
  border: 0;
  padding: 0;
}

.themed-block .block-content {
  border: 1px solid #ddd;
  padding: 10px;
  background-color: rgba(238, 238, 238, .5);
}

.rnd .block-content {
  border-radius: 5px;
}

.sitebrand {
  height: 32px;
}

.by {
  position: absolute;
  bottom: 0;
  right: 0;
  text-align: right;
  clear: both;
  font-size: .8em;
  margin: 0 1em;
  text-decoration: none;
  border-bottom: none;
  color: #777 !important;
}

.by a,
.by a:hover {
  text-decoration: none;
  border-bottom: none;
  color: #777 !important;
}

.block ul:not(.pager__items, .book-pager, .menu) {
  margin-top: 0;
  margin-bottom: 0;
}

body:is(.bi1, .bi2, .bi3, .bi4, .bi5) {
  background-color: var(--abc-background-edge);
}

:is(.bi1, .bi2, .bi3, .bi4, .bi5) #bg1 {
  background: var(--abc-top-gradient) 0 0 / 100% 435px no-repeat;
}

:is(.bi1, .bi2, .bi3, .bi4, .bi5) #pgwpp {
  background: #fff var(--abc-bottom-gradient) 0 100% / 100% 190px no-repeat;
}

.bimg #bg2 {
  background-position: 50% 0;
  background-repeat: no-repeat;
}

.bgf #bg1,
.bgf #bg2 {
  background-attachment: fixed;
}

.bimg.bi1 #bg2 {
  background-image: url("../images/elements/top-pink.png");
}

.bimg.bi2 #bg2 {
  background-image: url("../images/elements/top-green.png");
}

.bimg.bi3 #bg2 {
  background-image: url("../images/elements/top-yellow.png");
}

.bimg.bi4 #bg2 {
  background-image: url("../images/elements/top-blue.png");
}

.bimg.bi5 #bg2 {
  background-image: url("../images/elements/top-bw.png");
}

/* Site name color */
.sn1 #name-and-slogan a {
  color: #c09;
}

.sn2 #name-and-slogan a {
  color: #390;
}

.sn3 #name-and-slogan a {
  color: #f60;
}

.sn4 #name-and-slogan a {
  color: #069;
}

.sn5 #name-and-slogan a {
  color: #444;
}

/* Node title color */
.nt1 .page-title,
.nt1 .node > header h2 a {
  color: #c09;
}

.nt2 .page-title,
.nt2 .node > header h2 a {
  color: #390;
}

.nt3 .page-title,
.nt3 .node > header h2 a {
  color: #f60;
}

.nt4 .page-title,
.nt4 .node > header h2 a {
  color: #069;
}

.nt5 .page-title,
.nt5 .node > header h2 a {
  color: #444;
}

/* blocks */
/* Titles and block title lines share the same inherited color. */
.block-title {
  font-size: 1.4em;
  margin-top: 0;
  font-weight: normal;
  color: var(--abc-block-title, #000);
}

/* ABC custom colors apply only to selectors set to Use color picker below. */
body.bi6 {
  background: var(--abc-custom-background);
}

.sn6 #name-and-slogan a {
  color: var(--abc-custom-site-name);
}

.nt6 .page-title,
.nt6 .node > header h2 a {
  color: var(--abc-custom-node-title);
}

/*** MEDIA SCREENS (35.5, 48 & 64em) ***/

@media screen and (width < 64em) {

  #header > .region-topreg {
    order: 0;
    flex-basis: 100%;
    margin-inline-start: auto;
  }

  #header > .region-header {
    flex-basis: 100%;
    box-sizing: border-box;
    min-height: 2.75rem;
  }

  #header .block-system-branding-block > .block-content {
    display: flex;
    align-items: center;
    min-width: 0;
  }

  #header .site-logo {
    flex: 0 0 auto;
  }

  #header .logoimg {
    display: block;
    float: none;
  }

  #header #name-and-slogan {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  /* Natural, top-aligned User blocks in PureCSS tablet columns. */
  .sections > [class*="pure-u"],
  .sections > [class*="pure-u"] > div,
  .sections .region,
  .sections .block-wrapper {
    display: block;
  }

  /* Sidebar blocks form independent top-aligned columns. */
  #sidebar-left > .region,
  #sidebar-right > .region {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    column-gap: 1.25rem;
  }

  #sidebar-left .block-wrapper,
  #sidebar-right .block-wrapper {
    min-width: 0;
  }

  #sidebar-left,
  #sidebar-right,
  #section1,
  #section2,
  #main {
    padding: 0;
    margin: 0;
  }

  #top_left {
    background: none !important;
    border: none;
  }

  #top_right {
    padding: 0;
    margin: 0;
    background: none !important;
    border: none;
  }

  #top_bg,
  #body_left {
    background: none !important;
    border: none;
  }

  #body_right {
    padding: 0;
    margin: 0;
    background: none !important;
    border: none;
  }

  #middlecontainer {
    background: none !important;
    border: none;
  }

  .himg #headimg,
  #headimg {
    border: none;
  }

  .logoimg {
    margin: 0;
    padding: 0;
    height: 2.5em;
  }

  #name-and-slogan {
    padding: 0 .5em;
  }

  p#site-name a,
  p#site-name a:hover,
  h1#site-name a,
  h1#site-name a:hover {
    font-size: 1.4em;
    line-height: 1.2;
  }

  .sections .block,
  .sections .themed-block {
    margin: 10px;
  }

  .breadcrumb {
    padding: 5px 10px;
  }

  .divider {
    border: none !important;
  }

  .nb1 #section1,
  .nb2 #section2,
  .nbl #sidebar-left,
  .nbr #sidebar-right,
  .by,
  .site-slogan {
    display: none;
  }

  .menuband {
    border-bottom: 1px solid #ddd;
  }

  #toplinks {
    display: none;
  }

}

@media screen and (width < 48em) {
  #sidebar-left > .region,
  #sidebar-right > .region {
    grid-template-columns: minmax(0, 1fr);
  }
}
