/* B80 - Card Gated
   Dipende da /css/b80-modules.css (token, temi).
   Le card hanno colori invertiti rispetto allo sfondo della sezione. */

/* Colori card: stesso tono della sezione, invertiti al passaggio del mouse.
   Sezione chiara/grigia -> card chiare (bianche), hover scuro */
.b80-gcards.b80--light,
.b80-gcards.b80--grey {
  --gc-bg: var(--b80-white);
  --gc-fg: var(--b80-navy);
  --gc-bg-hover: var(--b80-navy);
  --gc-fg-hover: var(--b80-white);
}
/* Sezione scura/notte -> card scure (navy più scuro dello sfondo), hover chiaro */
.b80-gcards.b80--dark,
.b80-gcards.b80--night {
  --gc-bg: var(--b80-navy-900);
  --gc-fg: var(--b80-white);
  --gc-bg-hover: var(--b80-grey-50);
  --gc-fg-hover: var(--b80-navy);
}
.b80-gcards.b80--light { --b80-bg: var(--b80-grey-50); } /* come mockup "Problem Addressed" */

.b80 .b80-gcards__inner {
  padding-inline: var(--b80-inset);
}

/* Griglia ---------------------------------------------------------------- */
.b80 .b80-gcards__grid {
  display: grid;
  grid-template-columns: repeat(var(--gc-cols, 4), minmax(0, 1fr));
  column-gap: 16px;
  row-gap: 24px;
}
.b80-gcards--cols-2 { --gc-cols: 2; }
.b80-gcards--cols-3 { --gc-cols: 3; }
.b80-gcards--cols-4 { --gc-cols: 4; }

/* Card ------------------------------------------------------------------- */
.b80 .b80-gcard {
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: var(--gc-bg);
  color: var(--gc-fg);
  transition: var(--b80-transition);
}

/* Allineamento testi tra card nella stessa riga */
@supports (grid-template-rows: subgrid) {
  .b80 .b80-gcard {
    display: grid;
    grid-row: span 5;
    grid-template-rows: subgrid;
    row-gap: 0;
  }
}

.b80 .b80-gcard__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 32px;
  padding: 6px 12px;
  background-color: var(--b80-white);
  color: var(--b80-navy);
}
.b80 .b80-gcard__kind {
  font-family: var(--b80-font-bold);
  font-size: 11px;
  line-height: 1.2;
  letter-spacing: 0.03em;
}
.b80 .b80-gcard__badge {
  /* misura standard del logo cliente (Marco 10/11/2026): stessa area per tutti, logo contenuto
     senza deformarsi e allineato a destra. L'altezza resta quella di prima (22px). */
  display: block;
  width: 110px;
  height: 22px;
  object-fit: contain;
  object-position: right center;
}

.b80 .b80-gcard__media img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.b80 .b80-gcard__title {
  margin: 0;
  padding: 12px 16px 0;
  color: inherit;
  font-family: var(--b80-font-light);
  font-size: clamp(22px, 1.8vw, 28px);
  font-weight: 300;
  line-height: 1.15;
  text-transform: none;
}

.b80 .b80-gcard__text {
  padding: 16px 16px 24px;
  color: inherit;
  font-size: 15px;
  line-height: 1.45;
}

.b80 .b80-gcard__foot {
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
  padding: 0 16px 14px;
}

.b80 .b80-gcard__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  font-family: var(--b80-font-semibold);
  font-size: 13px;
  line-height: 1.2;
  text-decoration: none;
}
.b80 .b80-gcard__cta .b80-icon { color: var(--b80-gold); }

/* Tutta la card cliccabile */
.b80 .b80-gcard--linked .b80-gcard__cta::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}
.b80 .b80-gcard--linked { cursor: pointer; }

/* Hover / focus: colori invertiti */
.b80 .b80-gcard--linked:hover,
.b80 .b80-gcard--linked:focus-within {
  background-color: var(--gc-bg-hover);
  color: var(--gc-fg-hover);
}
.b80 .b80-gcard--linked:hover .b80-icon { transform: translateX(3px); }
.b80 .b80-gcard__cta:focus-visible { outline: none; }
.b80 .b80-gcard--linked:focus-within {
  outline: 2px solid var(--b80-focus);
  outline-offset: 3px;
}

/* Responsive ------------------------------------------------------------- */
@media (max-width: 1024px) {
  .b80-gcards--cols-3,
  .b80-gcards--cols-4 { --gc-cols: 2; }
}
@media (max-width: 640px) {
  .b80-gcards--cols-2,
  .b80-gcards--cols-3,
  .b80-gcards--cols-4 { --gc-cols: 1; }
}
