/************************
 Overrides
 Bootstrap 5 fixes shared by every TDH site. Loads after every other theme
 stylesheet (weight 100 in tdhcore5.libraries.yml).

 Site-specific styling stays in each site's "load styles last" block, which
 is stored in that site's database. Put a rule here only if it is right for
 every site.
************************/

/* ---------- Circle image style ---------- */

/* Images in the "Circle image" style (circle_i) are cropped square by the
   image style, then made round here. This used to be done by the Imagick
   "rounded corners" effect, which needs the Imagick toolkit, while the
   smart-crop effect in the same style needs GD. CSS does it with either. */
img.image-style-circle-i {
  border-radius: 50%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

/* ---------- Staff profile pop-up ---------- */

/* paragraph-styles.css styles the pop-up photo as
   .field--name-field-paragraph-profile-picture (35% column, 220px circle),
   but the photo now comes from the media field
   field--name-field-profile-picture-media, so those rules never applied.
   Bootstrap 5 also gives every image .img-fluid, which style.css sets to
   width: 100%, so the photo filled the pop-up. Same rules, media field. */
.featherlight .field--name-field-profile-picture-media {
  width: 35%;
  margin: 0;
  text-align: center;
}

.featherlight .field--name-field-profile-picture-media img {
  display: block;
  width: auto;
  max-width: 220px;
  height: auto;
  margin: 0 auto;
  padding-top: 1em;
  border-radius: 100%;
}

body.mobile .featherlight .field--name-field-profile-picture-media {
  width: 100%;
}

/* ---------- Cookie banner ---------- */

/* The message and the Accept / No thanks buttons are floated side by side
   inside an inline-block box, so both sat at the top and the shorter
   buttons (31px against the message's 55px) left a gap below them.
   Measured at 1512px. Make the box a flex row instead, so the buttons are
   centred vertically against the message. It keeps its width and stays
   centred in the banner. */
#sliding-popup .popup-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-left: auto;
  margin-right: auto;
  padding-top: 1em;
  padding-bottom: 1em;
}

#sliding-popup #popup-text,
#sliding-popup #popup-buttons {
  float: none;
  margin-top: 0;
  margin-bottom: 0;
}

#sliding-popup #popup-text {
  flex: 1 1 auto;
}

#sliding-popup #popup-buttons {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}

/* Stack the message above the buttons on narrow screens. */
@media (max-width: 767px) {
  #sliding-popup .popup-content {
    flex-direction: column;
    align-items: stretch;
  }

  #sliding-popup #popup-buttons {
    justify-content: center;
    margin-top: 0.5em;
  }
}

/* ---------- View filters ---------- */

/* Exposed filters on one line: Keyword, Year, then the Search button.
   Drupal's .form--inline floats each field but not the button's wrapper
   (.form-actions), so under Bootstrap 5 the button dropped onto its own
   line. A flex row keeps them together and lines the button up with the
   bottom of the inputs. Wraps onto further lines on narrow screens. */
.view-filters .form--inline {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  column-gap: 1em;
}

.view-filters .form--inline .form-item,
.view-filters .form--inline .form-actions {
  float: none;
  margin-top: 0;
  margin-bottom: 1em;
}

/* The clearfix ::after would otherwise take up a slot in the row. */
.view-filters .form--inline.clearfix::after {
  display: none;
}

/* ---------- Vacancies ---------- */

/* Each vacancy row has a floated orange label (style.css). Make every row
   contain its label, so a two-line label cannot push into the next row.
   Bootstrap 3 field wrappers did this; Bootstrap 5 ones do not. */
.page-node-type-vacancy .content div.field::after {
  content: "";
  display: table;
  clear: both;
}

/* ---------- Footer: social links ---------- */

/* The "Follow us" block body holds three .social-icon columns
   (col-lg-4 col-md-4 col-sm-12). Bootstrap 3 floated columns, so they sat
   side by side anywhere. Bootstrap 5 only lays columns out inside a flex
   row, and the body field is a plain div, so they stacked. Make the body
   the row: thirds from 768px, full width below, as before. */
#block-tdhcore-socialside .field--name-body {
  display: flex;
  flex-wrap: wrap;
}

/* ---------- Footer: "Toți copiii..." bar ---------- */

/* footer.css removes the paragraph's top margin but leaves the 1em bottom
   margin every paragraph gets, so the text sat high in the orange bar.
   Equal padding on the bar instead, and no paragraph margins. */
#block-toticopiiiaudreptullaocopilarieeatatdesimplu {
  padding-top: 1em;
  padding-bottom: 1em;
}

#block-toticopiiiaudreptullaocopilarieeatatdesimplu p {
  margin-top: 0;
  margin-bottom: 0;
}

/* ---------- Mobile menu drawer ---------- */

/* Makes the mobile menu match TDH Greece on every site. The sites' "load
   styles last" blocks style the desktop dropdowns (orange or black 20px
   links, grey lines between groups, light grey hover), and those rules
   also hit the dark mobile drawer: dark text on a dark background, lines
   across it, and a white bar on hover. Below 992px (Mega Menu's mobile
   breakpoint) the drawer gets one look instead: left-aligned, white text,
   no lines. Selectors start with "html body .navbar-we-mega-menu" so they
   outrank the block rules, which also use !important. Fonts are left to
   each site. */
@media only screen and (max-width: 991px) {
  html body .navbar-we-mega-menu:not(.admin) .we-mega-menu-ul {
    text-align: left !important;
  }

  /* Top level: Home, About us, What we do... */
  html body .navbar-we-mega-menu:not(.admin) .we-mega-menu-ul > .we-mega-menu-li > a,
  html body .navbar-we-mega-menu:not(.admin) .we-mega-menu-ul > .we-mega-menu-li > span {
    font-size: 18px !important;
    font-weight: 700 !important;
    text-align: left !important;
  }

  /* Submenu links, including the "menu-black-link" ones. */
  html body .navbar-we-mega-menu:not(.admin) .we-mega-menu-submenu .we-mega-menu-li,
  html body .navbar-we-mega-menu:not(.admin) .we-mega-menu-submenu .we-mega-menu-li > a,
  html body .navbar-we-mega-menu:not(.admin) .we-mega-menu-submenu .we-mega-menu-li > span,
  html body .navbar-we-mega-menu:not(.admin) .we-mega-menu-submenu .we-mega-menu-li.menu-black-link,
  html body .navbar-we-mega-menu:not(.admin) .we-mega-menu-submenu .we-mega-menu-li.menu-black-link > a,
  html body .navbar-we-mega-menu:not(.admin) .we-mega-menu-submenu .we-mega-menu-li.menu-black-link-header,
  html body .navbar-we-mega-menu:not(.admin) .we-mega-menu-submenu .we-mega-menu-li.menu-black-link-header-right {
    color: #fff !important;
    font-size: 18px !important;
    font-weight: 300 !important;
    text-transform: none !important;
    background: none !important;
    border: 0 !important;
    width: auto !important;
    margin-right: 0 !important;
  }

  /* Group headings in a submenu (Partners, Contact us) a little stronger. */
  html body .navbar-we-mega-menu:not(.admin) .we-mega-menu-submenu .we-mega-menu-li.menu-black-link-header > a,
  html body .navbar-we-mega-menu:not(.admin) .we-mega-menu-submenu .we-mega-menu-li.menu-black-link-header-right > a {
    font-weight: 700 !important;
  }

  html body .navbar-we-mega-menu:not(.admin) .we-mega-menu-submenu .we-mega-menu-li:hover,
  html body .navbar-we-mega-menu:not(.admin) .we-mega-menu-submenu .we-mega-menu-li > a:hover,
  html body .navbar-we-mega-menu:not(.admin) .we-mega-menu-submenu .we-mega-menu-li > a:focus {
    color: #fff !important;
    background-color: rgba(255, 255, 255, 0.08) !important;
  }

  /* Submenu panel: undo the desktop pull-up and add breathing room. */
  html body .navbar-we-mega-menu:not(.admin) .we-mega-menu-submenu {
    margin-top: 0 !important;
    padding-top: 6px !important;
    padding-bottom: 12px !important;
  }

  /* Submenu links in the light font, as on Greece. Univers Next Condensed
     only exists in bold here, so it can't look light. */
  html body .navbar-we-mega-menu:not(.admin) .we-mega-menu-submenu .we-mega-menu-li > a,
  html body .navbar-we-mega-menu:not(.admin) .we-mega-menu-submenu .we-mega-menu-li > span {
    font-family: 'Roboto Condensed', sans-serif !important;
    font-weight: 300 !important;
  }
}
/* Desktop mega menu: a top-level item without a dropdown (e.g. Vacancies)
   sits higher than the others and turns grey on hover. Line it up and keep
   it white. Layout only: no font or colour changes. First item is the logo. */
@media only screen and (min-width: 970px) {
  html body .we-mega-menu-ul > .we-mega-menu-li:not(.dropdown-menu):not(:first-child) {
    padding-bottom: 0;
  }
  html body .we-mega-menu-ul > .we-mega-menu-li:not(.dropdown-menu):not(:first-child) > a {
    padding-top: 24px;
    padding-bottom: 24px;
  }
  html body .we-mega-menu-ul > .we-mega-menu-li:not(.dropdown-menu):not(:first-child) > a:hover {
    background-color: #fff !important;
  }
}
