/**
 * Tighter vertical rhythm between page sections.
 * Adjusts only inter-section margins and plain/white blocks — not internal
 * padding of coloured cards (CTA dark/sky/light, tabs, areas grid).
 */

/* Default gap between consecutive modules */
.module + .module {
  margin-top: 6rem;
}

@media (min-width: 768px) and (max-width: 991px) {
  .module + .module {
    margin-top: 2.5rem;
  }
}

@media (max-width: 767px) {
  .module + .module {
    margin-top: 4rem;
  }
}

/* Hero → first content block */
.module.module--hero:not(.hero--talent):not(.hero--legal) + .module:not(.related-content--list):not(.module--margin-regular):not(.module--horizontal-content-list):not(.module--country-selector):not(.module--project-details) {
  margin-top: 4rem;
}

.module.module--hero + .module.module--text-image,
.module.module--hero + .module.module--areas,
.module.module--hero + .module.module--tabs,
.module.module--hero + .module.module--history,
.module.module--hero + .module.module--world-offices,
.module.module--hero + .module.module--services,
.module.module--hero + .module.module--figures,
.module.module--hero + .module.module--map,
.module.module--hero + .module.module--float-bar,
.module.module--hero + .module.module--programme-boxes,
.module.module--hero + .module.module--calls-timeline,
.module.module--hero + .module.module--async-request {
  margin-top: 4rem;
}

/* Home hero: trim empty white area below intro copy */
body.home .module.module--hero.hero--home .intro {
  padding-bottom: 3rem !important;
}

body.home .module.module--hero.hero--full.hero--home .intro::after,
body.home .module.module--hero.hero--full.hero--home .intro::before {
  height: 100% !important;
}

body.home .module.module--hero.hero--home + .module {
  margin-top: 3rem !important;
}

/* Inner pages (services, references, EU): hero--full white intro panel */
.module.module--hero.hero--full:not(.hero--home) .intro::after,
.module.module--hero.hero--full:not(.hero--home) .intro::before {
  height: 100% !important;
}

/* List heroes (offices, news, contact): drop forced min-height empty area */
.module.module--hero.hero--list:not(.hero--height-auto) .intro {
  min-height: 0 !important;
  padding-bottom: 3rem;
}

/* Newsletter / short list heroes */
.module.module--hero.hero--list.hero--height-auto .intro {
  min-height: 0 !important;
  padding-bottom: 2rem;
}

@media (max-width: 767px) {
  .module.module--hero.hero--list.hero--height-auto .intro {
    min-height: 0 !important;
  }
}

/* Detail heroes (office subpages, news articles) */
@media (max-width: 767px) {
  .module.module--hero.hero--detail:not(.hero--height-auto) .intro {
    min-height: 0 !important;
    padding-bottom: 3rem;
  }
}

/* Override site.css 24rem wysiwyg rule — use normal module rhythm instead */
.page-template-default .module.module--wysiwyg {
  margin-top: unset !important;
}

.page-template-default .module.module--hero + .module.module--wysiwyg {
  margin-top: 4rem !important;
}

.page-template-default .sidebar_wysiwyg .module.module--wysiwyg {
  margin-top: 0 !important;
}

/* Utility margin classes */
.module + .module.module--wysiwyg.module--margin-sm,
.module + .module.module--margin-sm {
  margin-top: 4rem !important;
}

@media (min-width: 768px) and (max-width: 991px) {
  .module + .module.module--margin-sm {
    margin-top: 3.5rem;
  }
}

@media (max-width: 767px) {
  .module + .module.module--margin-sm {
    margin-top: 2.5rem;
  }
}

/* News list: categories sit flush under hero on mobile */
@media (max-width: 991px) {
  .module.module--hero + .module--categories {
    margin-top: -8rem !important;
  }

  .module.module--hero.hero--height-auto + .module:not(.module--categories):not(.module--float-bar)::before {
    top: -4rem;
    height: 4rem;
  }

  .module.module--hero.hero--height-auto + .module:not(.module--categories).module--margin-regular::before {
    height: 6rem;
    top: -6rem;
  }
}

/* Plain text + image rows (home sections, offices, etc.) */
.module.module--text-image.text-image--plain .heading {
  margin-bottom: 2rem;
}

@media (max-width: 767px) {
  .module.module--text-image section.text {
    padding-top: 3rem;
  }

  .module .heading {
    margin-bottom: 3rem;
  }
}

/* Form blocks: less trailing space without shrinking fields */
.module.module--form-drip {
  margin-bottom: 2.5rem;
}

/* Footer: tighten gap between last content block and collaborators strip */
footer#footer {
  margin-top: 3rem !important;
}

@media (min-width: 768px) and (max-width: 991px) {
  footer#footer {
    margin-top: 2.5rem !important;
  }
}

@media (max-width: 767px) {
  footer#footer {
    margin-top: 2rem !important;
  }
}

/* Collaborators / certifications strip — 5 + 5 grid */
.module.module--footer-logos {
  margin-top: 0 !important;
  padding-top: 1.5rem !important;
  padding-bottom: 2.5rem !important;
}

@media (max-width: 767px) {
  .module.module--footer-logos {
    padding-bottom: 2rem !important;
  }
}

.module.module--footer-logos .footer-logos__layout {
  display: flex;
  align-items: center;
  gap: 2rem 2.5rem;
}

.module.module--footer-logos .footer-logos__caption {
  font-family: Poppins, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #1a1a36;
  max-width: 11rem;
  margin: 0;
  flex-shrink: 0;
}

.module.module--footer-logos .footer-logos__grid {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem 1.5rem;
  align-items: center;
  justify-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.module.module--footer-logos .footer-logos__grid li {
  margin: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.module.module--footer-logos .footer-logos__grid img {
  filter: none;
  opacity: 1;
  width: 100%;
  max-width: 180px;
  max-height: 56px;
  height: auto;
  object-fit: contain;
}

.module.module--footer-logos .footer-logos__grid-spacer {
  visibility: hidden;
  pointer-events: none;
}

@media (max-width: 991px) {
  .module.module--footer-logos .footer-logos__layout {
    flex-direction: column;
    align-items: flex-start;
  }

  .module.module--footer-logos .footer-logos__caption {
    max-width: none;
  }

  .module.module--footer-logos .footer-logos__grid {
    width: 100%;
    gap: 1rem 1.25rem;
  }
}

@media (max-width: 767px) {
  .module.module--footer-logos .footer-logos__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .module.module--footer-logos .footer-logos__grid-spacer {
    display: none;
  }

  .module.module--footer-logos .footer-logos__grid img {
    max-width: 160px;
    max-height: 48px;
  }
}

/* Area pages: sidebar CTA must not stretch the row and leave empty white space */
.post-type-area .module.module--wysiwyg .container > .row.space-between,
.page-template-default .module.module--wysiwyg .container > .row.space-between {
  align-items: flex-start;
}

.post-type-area .sidebar_wysiwyg {
  margin-top: 0 !important;
}

#main > .module:last-child {
  margin-bottom: 0;
}

/* Search layer: compact panel under header (not fullscreen) */
#header .layer--search {
  top: var(--header-height) !important;
  height: 0 !important;
  min-height: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  overflow: hidden !important;
}

#header .layer--search.active {
  height: 16rem !important;
  padding-top: 2.4rem !important;
  padding-bottom: 2.4rem !important;
}

#header .layer--search section {
  display: block !important;
  overflow: visible !important;
}

#header .layer--search form {
  width: min(100rem, 100%) !important;
  margin: 0 auto !important;
}

@media (max-width: 767px) {
  #header .layer--search.active {
    height: 13rem !important;
    padding-top: 1.8rem !important;
    padding-bottom: 1.8rem !important;
  }
}
