/* Noosfera · Our Services (pattern)
   Scoped styles; theme can override tokens.
   The loader wraps this pattern with .noosfera-pattern--services.
*/
.noosfera-pattern--services .nf-services{
  /* Tokens with theme-friendly fallbacks */
  --nf-pad: clamp(16px, 3vw, 28px);
  --nf-gap: clamp(16px, 3vw, 24px);
  --nf-card-radius: var(--noosfera-card-radius, 16px);
  --nf-card-shadow: var(--noosfera-card-shadow, 0 8px 24px rgba(22,53,120,.10));
  --nf-border: var(--noosfera-border, 1px solid rgba(22,53,120,.10));

  --nf-bg-opacity : 0.55;
  --nf-title: var(--noosfera-title, var(--wp--preset--color--primary, #4a6cf7));
  --nf-text: var(--noosfera-text, var(--wp--preset--color--foreground, #1b2b41));
  --nf-subtle: var(--noosfera-subtle, #5c6b7a);
  --nf-link: var(--noosfera-link, var(--wp--preset--color--primary, #4a6cf7));
}

/* Section spacing + background wave via pseudo-element */
.noosfera-pattern--services .nf-services{
  position: relative;
  padding-block: calc(var(--nf-pad) * 2);
}

.noosfera-pattern--services .nf-services::before{
  content: "";
  position: absolute;
  inset: 0;
  background: url("../../assets/img/wave-services.png") no-repeat right 0% center / 1920px auto;
  opacity: var(--nf-bg-opacity);
  pointer-events: none;
  z-index: 0;
}

/* Title & intro */
.noosfera-pattern--services .nf-services__title{
  color: var(--nf-title);
  line-height: 1.05;
  margin: 0 0 .35em;
  position: relative;
  z-index: 1;
}

.noosfera-pattern--services .nf-services__intro{
  color: var(--nf-subtle);
  margin: 0 0 calc(var(--nf-pad) * 1.5);
  max-width: 78ch;
  position: relative;
  z-index: 1;
}

/* Grid */
.noosfera-pattern--services .nf-services__grid{
  gap: var(--nf-gap);
  position: relative;
  z-index: 1;
}

/* Card */
.noosfera-pattern--services .nf-service-card{
  border-radius: var(--nf-card-radius);
  background-color: var(--fig-surface-accent-1);
  /*background: linear-gradient(180deg, rgba(255,255,255,.78), rgba(255,255,255,.92)); */
  box-shadow: var(--nf-card-shadow);
  border: var(--nf-border);
  padding: clamp(16px, 2.6vw, 24px);
  height: 100%;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  row-gap: 12px;
}

.noosfera-pattern--services .nf-service-card__media{
  margin: 0 0 8px;

  display: flex;
  justify-content: center;   /* center contents horizontally */
  align-items: center; 
}
.noosfera-pattern--services .nf-service-card__media img{
  max-width: min(350px, 90%);
  height: auto;
}

.noosfera-pattern--services .nf-service-card__title{
  margin-left: 0 !important;
  line-height: 1.2;
  color: var(--nf-text);
}



.noosfera-pattern--services .nf-service-card__text{
  margin: 0 0 8px;
  color: var(--nf-subtle);
}

.noosfera-pattern--services .nf-service-card__link{
  margin: auto 0 0;
  margin-left: 0 !important;
  font-weight: 600;
}
.noosfera-pattern--services .nf-service-card__link a{
  color: var(--nf-link);
  text-decoration: none;
}
/*
.noosfera-pattern--services .nf-service-card__link a:hover{
  text-decoration: underline;
}*/

/* Responsive tweaks */
@media (max-width: 1200px){
  .noosfera-pattern--services .nf-services::before{
    background-position: right -20% bottom 0;
    background-size: 900px auto;
    opacity: .5;
  }
}

@media (max-width: 960px) {
 
}

@media (max-width: 782px){
  .noosfera-pattern--services .nf-services{
    padding-block: var(--nf-pad);
  }
  .noosfera-pattern--services .nf-service-card__media img{
    width: min(160px, 60%);
  }
}


/* Opt-out of core “center children” rule for this pattern only */
.noosfera-pattern--services .nf-services.is-layout-constrained
  > :where(:not(.alignleft):not(.alignright):not(.alignfull)){
  margin-left: 0 !important;
  margin-right: auto !important; /* keep responsive max-width */
}

/*
.noosfera-pattern .is-layout-constrained
  > :where(:not(.alignleft):not(.alignright):not(.alignfull)){
  margin-left: 0 !important;
  margin-right: auto !important; 
}
*/




/* Make the media area span full card width and center its content */
.noosfera-pattern--services .nf-service-card__media{
  width: 100%;
  margin: 0 0 12px;
  display: grid;           /* simpler than flex for centering a single child */
  place-items: center;     /* centers both x and y */
}

/* Size the illustration responsively, but keep a sane max on huge screens */
.noosfera-pattern--services .nf-service-card__media img{
  display: block;
  height: auto;
  max-width: clamp(220px, 50%, 260px);  /* small≥160px, prefer ~40% of card, cap at 220px */
}

/* Safety: if your theme injects figure alignment, neutralize it here */
.noosfera-pattern--services .nf-service-card__media{
  float: none;
  text-align: initial;
}

/* Optional: if you only want to enforce centering ≥1440px */
@media (min-width: 1440px){
  .noosfera-pattern--services .nf-service-card__media{
    place-items: center;
  }
}

@media (max-width: 1200px) {
  .noosfera-pattern--services .nf-services__intro {
    margin-right: 0px !important;
    width: 100%;
  }
}


@media (max-width: 980px) and (min-width: 530.02px) {
  .nf-services__grid.wp-block-columns {
    display: flex;
    flex-wrap: wrap !important;
    gap: clamp(12px, 2.5vw, 24px);
  }
   .nf-services__grid.wp-block-columns > .wp-block-column {
    flex-grow: 0 !important;
    flex-shrink: 0 !important;
    flex-basis: calc(50% - var(--nf-gap, 24px)) !important;
    max-width:  calc(50% - var(--nf-gap, 24px)) !important;

    min-width: 0;
    margin: 0 !important;           /* kill theme margins that can break rows */
    box-sizing: border-box;
    width: auto !important;         /* beat any width overrides */
  }
}




