/**
 * GIMUR Child: estil del lloc migrat de mu-plugins/gimur-site/assets/gimur-styles.css
 * (2026-10-17, línies originals 1214-1824). Sistema de maquetació i pàgina About.
 * Es manté l'ordre original de la cascada: aquest fitxer es carrega en la posició
 * que tenien aquestes regles. Neteja pendent: vegeu MIGRACIO.md.
 */

/* =============================================================================
   gimur_layout_system
   Ritme vertical, composicio editorial
   ============================================================================= */

/* -- 1. SPACER HARMONITZACIO -- */

.wp-block-spacer {
  max-height: clamp(2rem, 5vw, 4.5rem) !important;
}

/* Heros i covers: l'alcada es part del disseny visual */
.wp-block-cover .wp-block-spacer,
.wp-block-cover__inner-container .wp-block-spacer {
  max-height: none !important;
}

/* Dins post cards: el gap del grid gestiona la separacio */
.wp-block-post-template .wp-block-spacer {
  display: none !important;
}

/* -- 2. POST GRID — Gap editorial -- */

.wp-block-post-template.is-flex-container {
  /* gap desactivat */
}

.wp-block-post-template.is-flex-container.columns-2 {
  /* gap desactivat */
}

/* "Other news" al single (3 cols): gap mes compacte */
.wp-block-post-template.is-flex-container.columns-3 {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 2rem 1.75rem !important;
}
.wp-block-post-template.is-flex-container.columns-3 > * {
  width: calc(33.333% - 1.167rem) !important;
  max-width: calc(33.333% - 1.167rem) !important;
  flex: 0 0 auto !important;
  margin-block-start: 0 !important;
}

/* -- 3. COLUMNES BUIDES — Col·lapsar -- */

.wp-block-column:empty {
  flex-basis: 0 !important;
  flex-grow: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  overflow: hidden;
}

/* -- 4. SINGLE POST: ara a reading.css (plantilla templates/single.html) -- */

/* -- 5. SECTION HEADINGS — Fora d'entry-content -- */

/* Headings dins groups (section titles) */
.wp-block-group > .wp-block-heading {
  margin-bottom: 0.75rem;
}

/* Classes de mida del tema: tipografia editorial */
h2.has-max-48-font-size {
  font-family: var(--wp--preset--font-family--libre-baskerville, Georgia, serif);
  line-height: 1.12;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

h2.has-max-36-font-size {
  font-family: var(--wp--preset--font-family--libre-baskerville, Georgia, serif);
  line-height: 1.18;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

/* -- 6. SEPARADORS — Ritme consistent -- */

.wp-block-separator.is-style-wide {
  margin-top: 2.5rem;
  margin-bottom: 2.5rem;
}

/* -- 7. QUERY PAGINATION -- */

.wp-block-query-pagination {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gimur-border, #e2e2e8);
  gap: 0.5rem;
}

.wp-block-query-pagination a,
.wp-block-query-pagination .current {
  padding: 0.4rem 0.85rem;
  border-radius: var(--gimur-radius-sm, 4px);
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}

.wp-block-query-pagination a:hover {
  background: var(--gimur-cool-bg, #f0f4f8);
  text-decoration: none;
}

.wp-block-query-pagination .current {
  background: var(--gimur-primary, #003966);
  color: #fff;
}

/* -- 8. COVER -> CONTINGUT transicio -- */

/* Hero cover: assegurar min-height coherent */
.site-content > .wp-block-cover:first-child,
:is(main, section).wp-block-group > .wp-block-cover:first-child {
  min-height: 320px;
}

/* -- 9. RESPONSIVE — Escala proporcional -- */

@media (max-width: 781px) {
  /* Spacers: mes curts en tablet */
  /* Homepage nav-cards: remove side borders when stacked */
  .has-primary-background-color > .wp-block-columns > .wp-block-column {
    border-right: none !important;
    border-left: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    padding-bottom: 1.5rem;
    margin-bottom: 0.5rem;
  }
  .has-primary-background-color > .wp-block-columns > .wp-block-column:last-child {
    border-bottom: none !important;
    padding-bottom: 0;
    margin-bottom: 0;
  }
  /* Reduce spacer inside nav-cards */
  .has-primary-background-color .wp-block-spacer {
    max-height: 16px !important;
  }

  .wp-block-spacer {
    max-height: 2.5rem !important;
  }
  .wp-block-cover .wp-block-spacer,
  .wp-block-cover__inner-container .wp-block-spacer {
    max-height: none !important;
  }
  /* Cap large hero spacers on small phones */
  .wp-block-cover .wp-block-spacer[style*="height:600px"],
  .wp-block-cover .wp-block-spacer[style*="height: 600px"] {
    height: clamp(200px, 50vh, 400px) !important;
  }

  /* Fix column overflow: force stacking and prevent horizontal scroll */
  .wp-block-columns:not(.is-not-stacked-on-mobile) {
    overflow-x: clip; /* clip i no hidden: hidden la converteix en contenidor de desplaçament i les àncores ignoraven scroll-margin */
  }
  .wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column {
    min-width: 0 !important;
    flex-basis: 100% !important;
    max-width: 100% !important;
  }

  /* Grid: gap reduit */
  .wp-block-post-template.is-flex-container,
  .wp-block-post-template.is-flex-container.columns-2,
  .wp-block-post-template.is-flex-container.columns-3 {
    gap: 2rem !important;
    flex-direction: column !important;
  }
  .wp-block-post-template.is-flex-container.columns-3 > * {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Logo: proporcionat */
  .site-header .wp-block-site-logo img,
  .wp-block-template-part:first-child .wp-block-site-logo img {
    max-width: 150px;
    height: auto;
  }

  /* Header: padding lateral reduit */
  header.site-header > .wp-block-group.alignfull {
    padding-left: 1.25rem !important;
    padding-right: 1.25rem !important;
  }

  /* Separadors */
  .wp-block-separator.is-style-wide {
    margin-top: 1.75rem;
    margin-bottom: 1.75rem;
  }

  /* Pagination */
  .wp-block-query-pagination {
    margin-top: 2rem;
  }
}

@media (max-width: 480px) {
  /* Spacers minims en mobil */
  /* Congress listing: smaller title on small screens */
  .gx-page-events #gimur_congresses_grid h3.jet-listing-dynamic-field__content {
    font-size: 1.05rem;
  }
  /* Cover H2 on mobile */
  .wp-block-cover .wp-block-cover__inner-container h2 {
    font-size: clamp(1.1rem, 4vw, 1.5rem) !important;
  }
  .wp-block-spacer {
    max-height: 1.75rem !important;
  }
  .wp-block-cover .wp-block-spacer,
  .wp-block-cover__inner-container .wp-block-spacer {
    max-height: none !important;
  }
  /* Cap large hero spacers on small phones */
  .wp-block-cover .wp-block-spacer[style*="height:600px"],
  .wp-block-cover .wp-block-spacer[style*="height: 600px"] {
    height: clamp(200px, 50vh, 400px) !important;
  }

  /* Fix column overflow: force stacking and prevent horizontal scroll */
  .wp-block-columns:not(.is-not-stacked-on-mobile) {
    overflow-x: clip; /* clip i no hidden: hidden la converteix en contenidor de desplaçament i les àncores ignoraven scroll-margin */
  }
  .wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column {
    min-width: 0 !important;
    flex-basis: 100% !important;
    max-width: 100% !important;
  }

  /* Header tight */
  header.site-header > .wp-block-group.alignfull {
    padding-left: 0.875rem !important;
    padding-right: 0.875rem !important;
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
  }

  /* Logo mobil */
  .site-header .wp-block-site-logo img,
  .wp-block-template-part:first-child .wp-block-site-logo img {
    max-width: 120px;
  }

  /* Section headings: mida adaptada */
  h2.has-max-48-font-size {
    font-size: clamp(1.5rem, 6vw, 2rem) !important;
  }
  h2.has-max-36-font-size {
    font-size: clamp(1.25rem, 5vw, 1.625rem) !important;
  }

  /* Hero covers: alcada reduida */
  .site-content > .wp-block-cover:first-child,
  :is(main, section).wp-block-group > .wp-block-cover:first-child {
    min-height: 240px;
  }
}


/* =============================================================================
   gimur_about_polish
   About page (gx-page-about) editorial polish v3b
   ============================================================================= */

/* -- Global width override -- */
body.gx-page-about .is-layout-constrained > :where(:not(.alignleft):not(.alignright):not(.alignfull)) {
  max-width: 860px;
}
body.gx-page-about .is-layout-constrained > .alignwide {
  max-width: 1000px;
}

/* -- Smooth section transitions -- */
body.gx-page-about > .wp-site-blocks > * + * {
  margin-block-start: 0 !important;
}

/* -- Hero cover: tighter vertical -- */
body.gx-page-about > .wp-site-blocks > .wp-block-cover:first-of-type .wp-block-spacer[style*="height:153px"] {
  height: 80px !important;
}

/* Director Welcome — float image + text containment */

/* Contain the float section */
body.gx-page-about .wp-block-image.alignleft {
  max-width: 340px;
  margin-right: 2rem;
  margin-bottom: 1.5rem;
  shape-margin: 1.5rem;
}

/* The text next to the float — prevent overflow */
body.gx-page-about .entry-content > p,
body.gx-page-about .wp-site-blocks > * > p {
  overflow-wrap: break-word;
  word-break: break-word;
}

/* Jordi Albert signature block */
body.gx-page-about .wp-block-group:has(.wp-block-heading:first-child) + .wp-block-group,
body.gx-page-about .has-text-align-right {
  clear: both;
}

/* Director section spacing */
body.gx-page-about .wp-block-media-text,
body.gx-page-about .wp-block-group:has(> .wp-block-columns > .wp-block-column > .wp-block-image) {
  margin-top: 3rem;
  margin-bottom: 3rem;
}

/* KEY FACTS — Stats Grid */

/* Override the secondary color variable INSIDE key-facts only */
body.gx-page-about #key-facts {
  --wp--preset--color--secondary: #e8a04e;
  --wp--preset--color--lightgrey: rgba(255, 255, 255, 0.55);
  border-radius: var(--gimur-radius-md, 8px);
  overflow: hidden;
  padding: 0 2rem 1.5rem !important;
}

/* Remove bloated top spacer */
body.gx-page-about #key-facts .wp-block-spacer[style*="height:166px"] {
  height: 2rem !important;
}

/* Key Facts heading */
body.gx-page-about #key-facts #keyfacts {
  font-size: clamp(1.35rem, 2.2vw, 1.75rem);
  margin-bottom: 1.5rem;
}

/* Stats grid rows */
body.gx-page-about #key-facts > .wp-block-columns:not(:first-child) {
  gap: 0;
  margin-bottom: 0;
}

/* Each stat column — uniform padding + left border separators */
body.gx-page-about #key-facts > .wp-block-columns:not(:first-child) > .wp-block-column {
  padding: 1rem 1.5rem;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}
body.gx-page-about #key-facts > .wp-block-columns:not(:first-child) > .wp-block-column:first-child {
  border-left: none;
}

/* -- Stat titles — smaller to prevent overflow -- */
body.gx-page-about #key-facts .wp-block-heading.has-secondary-color {
  font-size: clamp(0.95rem, 1.6vw, 1.25rem) !important;
  margin-bottom: 0.3rem;
  line-height: 1.3;
  font-family: var(--wp--preset--font-family--libre-baskerville);
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

/* -- Stat descriptions -- */
body.gx-page-about #key-facts p.has-lightgrey-color {
  font-size: 0.75rem;
  line-height: 1.45;
  margin: 0;
}

/* Remove nested padding inside stats */
body.gx-page-about #key-facts .wp-block-group.is-layout-constrained {
  padding: 0;
}
body.gx-page-about #key-facts .wp-block-group .wp-block-columns {
  margin-bottom: 0;
}

/* Spacer between stat rows -> minimal */
body.gx-page-about #key-facts .wp-block-spacer[style*="height:60px"] {
  height: 0.25rem !important;
}

/* Bottom spacer */
body.gx-page-about #key-facts .wp-block-spacer[style*="height:80px"] {
  height: 1rem !important;
}

/* Key Facts: border-left → border-top on mobile stacking */
@media (max-width: 781px) {
	body.gx-page-about #key-facts > .wp-block-columns:not(:first-child) > .wp-block-column {
		border-left: none;
		border-top: 1px solid rgba(255, 255, 255, 0.1);
		padding-top: 0.75rem;
	}
	body.gx-page-about #key-facts > .wp-block-columns:not(:first-child) > .wp-block-column:first-child {
		border-top: none;
	}
}

/* Advisory Council */
body.gx-page-about #advisory-council {
  margin-top: 3rem;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
}

body.gx-page-about .wp-block-spacer[style*="height:46px"] {
  height: 0 !important;
}

body.gx-page-about .wp-block-group:has(#advisory-council) .wp-block-spacer[style*="height:100px"] {
  height: 2rem !important;
}

/* Research Areas cover (dark section) */

/* Override secondary color in research areas cover too */
body.gx-page-about .wp-block-cover {
  --wp--preset--color--secondary: #e8a04e;
}

body.gx-page-about .wp-block-cover .wp-block-spacer[style*="height:25vh"] {
  height: 6vh !important;
}
body.gx-page-about .wp-block-cover .wp-block-spacer[style*="height:80px"] {
  height: 2rem !important;
}

body.gx-page-about .wp-block-cover .is-style-wide {
  opacity: 0.15;
}

body.gx-page-about .wp-block-cover p.has-lightgrey-color {
  font-size: 0.8125rem;
  line-height: 1.5;
}

/* Mission box (image + blue box) */
body.gx-page-about #img-left > .wp-block-spacer[style*="height:100px"] {
  height: 3rem !important;
}
body.gx-page-about #img-left .wp-block-spacer[style*="height:50px"] {
  height: 0 !important;
}

body.gx-page-about .is-style-round-corners.has-primary-background-color {
  padding: 2rem !important;
  border-radius: var(--gimur-radius-md, 8px) !important;
}
body.gx-page-about .is-style-round-corners .has-lightgrey-color {
  font-size: 0.9375rem;
  line-height: 1.7;
  opacity: 0.85;
}
body.gx-page-about .is-style-round-corners .has-white-color.wp-block-heading {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

/* Contact section */
body.gx-page-about #contact {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  margin-top: 3rem;
  margin-bottom: 1rem;
}

/* Global overflow & column fixes */
body.gx-page-about .wp-block-columns .wp-block-columns {
  margin-top: 0;
  margin-bottom: 0;
}

body.gx-page-about .wp-block-column {
  overflow-wrap: break-word;
  word-break: break-word;
  min-width: 0;
}
