/**
 * FB | Sponsors
 *
 * Everything inherits the site's typography and colour. No font families, no
 * fixed font sizes, no brand colours are hardcoded — borders and surfaces are
 * derived from currentColor so the blocks blend into whatever theme is active.
 * Override any of the custom properties below in your theme to fine-tune.
 */

.fb-sponsors{
  --fb-sponsors-gap: 1.5rem;
  --fb-sponsors-radius: .75rem;
  --fb-sponsors-pad: 1.25rem;
  --fb-sponsors-item-min: 9.5rem;

  /**
   * Logo size follows items_per_row: fewer columns == higher tier == bigger
   * logo. 1 col -> 11rem, 2 -> 7.5rem, 3 -> 6.3rem, 4 -> 5.75rem, 6 -> 5.2rem.
   * Set --fb-sponsors-logo-h in your theme to opt out of the curve entirely.
   */
  --fb-sponsors-logo-h: calc(4rem + 7rem / var(--fb-sponsors-cols));

  /**
   * Stops a single-column (top tier) card from spanning the whole content
   * width — it is capped and centred instead. Wide enough that it never bites
   * at 2+ columns, where the track is already narrower.
   */
  --fb-sponsors-card-max: 40rem;

  /* Derived from the inherited text colour; overridable per theme. */
  --fb-sponsors-border: rgba(0,0,0,.12);
  --fb-sponsors-border-hover: rgba(0,0,0,.28);
  --fb-sponsors-surface: transparent;
  --fb-sponsors-muted: inherit;

  --fb-sponsors-cols: var(--fb-sponsors-cols-desktop, 3);

  color: inherit;
  font: inherit;
}

@supports (color: color-mix(in srgb, currentColor 10%, transparent)){
  .fb-sponsors{
    --fb-sponsors-border: color-mix(in srgb, currentColor 14%, transparent);
    --fb-sponsors-border-hover: color-mix(in srgb, currentColor 34%, transparent);
  }
}

/* ---------- Grid ---------- */

/**
 * Flexbox rather than CSS grid, specifically so an incomplete last row is
 * centred: with 5 sponsors at 3 per row, the trailing 2 sit in the middle
 * instead of hanging off the left. Grid keeps its empty tracks on the right
 * and cannot centre a partial row.
 *
 * Card width is pinned to the requested column count, so every card in the
 * block is the same size regardless of how many there are.
 */
.fb-sponsors-grid{
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--fb-sponsors-gap);
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ---------- Card ---------- */

.fb-sponsor-card{
  /**
   * Basis = one column of the requested grid. The -1px absorbs sub-pixel
   * rounding, otherwise the last card of a full row can wrap on its own.
   * min-width is what makes the block collapse to fewer per row on narrow
   * screens — no breakpoints needed.
   */
  flex: 0 1 calc(
    (100% - (var(--fb-sponsors-cols) - 1) * var(--fb-sponsors-gap) - 1px)
    / var(--fb-sponsors-cols)
  );
  min-width: var(--fb-sponsors-item-min);
  max-width: var(--fb-sponsors-card-max);

  display: flex;
  flex-direction: column;
  gap: .75rem;
  box-sizing: border-box;
  padding: var(--fb-sponsors-pad);
  border: 1px solid var(--fb-sponsors-border);
  border-radius: var(--fb-sponsors-radius);
  background: var(--fb-sponsors-surface);
  transition: border-color .2s ease, transform .2s ease;
}
.fb-sponsor-card:hover{
  border-color: var(--fb-sponsors-border-hover);
  transform: translateY(-2px);
}

.fb-sponsors--shadow .fb-sponsor-card{
  box-shadow: 0 .35rem 1.25rem rgba(0,0,0,.08);
}

.fb-sponsor-logo{
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--fb-sponsors-logo-h);
}
.fb-sponsor-logo img{
  max-height: 100%;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}
.fb-sponsor-logo a{
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
}
.fb-sponsor-logo-fallback{
  font-weight: 600;
  text-align: center;
  opacity: .7;
}

.fb-sponsor-body{
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  text-align: center;
}
.fb-sponsor-name{
  margin: 0;
  font-size: inherit;
  font-weight: 600;
  line-height: 1.3;
  color: inherit;
}
.fb-sponsor-excerpt{
  margin: 0;
  font-size: .9em;
  line-height: 1.5;
  opacity: .75;
}

.fb-sponsor-actions{ margin: 0; text-align: center; }

/* Outline button — takes its colour from the surrounding text. */
.fb-sponsor-btn,
.button-website{
  display: inline-block;
  padding: .55em 1.1em;
  border: 1px solid currentColor;
  border-radius: calc(var(--fb-sponsors-radius, .75rem) * .7);
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: opacity .2s ease;
}
.fb-sponsor-btn:hover,
.website-link:hover .button-website{
  opacity: .7;
}

.fb-sponsors-empty{ opacity: .7; }

/* ---------- Slider ---------- */

.custom-posts-slider-wrapper{
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  color: inherit;
  font: inherit;
}
.custom-posts-slider-viewport{ overflow: hidden; width: 100%; }
.custom-posts-slider-track{
  display: flex;
  flex-wrap: nowrap;
  will-change: transform;
  transform: translate3d(0,0,0);
}
.custom-posts-slider-item{
  box-sizing: border-box;
  padding: 1.25rem;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: .75rem;
  background: transparent;
  text-align: center;
}
@supports (color: color-mix(in srgb, currentColor 10%, transparent)){
  .custom-posts-slider-item{ border-color: color-mix(in srgb, currentColor 14%, transparent); }
}
.custom-posts-slider-item.is-shadow{ box-shadow: 0 .35rem 1.25rem rgba(0,0,0,.08); }

.slider-logo-box{
  width: 100%;
  height: 8rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.slider_img{
  max-height: 100%;
  width: auto;
  max-width: 100%;
  display: block;
  object-fit: contain;
}

.fb-slider-title{ text-align: center; margin: .625rem 0 0; font-weight: 600; }
.fb-slider-title-link{ color: inherit; text-decoration: none; }
.fb-slider-title-text{ color: inherit; }
.fb-slider-excerpt{ text-align: center; margin: .375rem 0 0; font-size: .9em; opacity: .75; }
.fb-slider-btnrow{ text-align: center; margin: .75rem 0 0; }

/* Arrows */
.custom-posts-slider-control{
  background-color: rgba(0,0,0,.5);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  font-size: 1.5rem;
  height: 3rem;
  line-height: 3rem;
  position: absolute;
  text-align: center;
  top: 50%;
  transform: translateY(-50%);
  width: 3rem;
  border: none;
  z-index: 5;
}
.custom-posts-slider-control-left{ left: .75rem; }
.custom-posts-slider-control-right{ right: .75rem; }

/* ---------- Company profiles ---------- */

.fb-company-profiles{
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  color: inherit;
  font: inherit;
}
.fb-company-card{
  display: flex;
  gap: 1.75rem;
  padding: 1.75rem;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: .75rem;
  background: transparent;
  align-items: flex-start;
}
@supports (color: color-mix(in srgb, currentColor 10%, transparent)){
  .fb-company-card{ border-color: color-mix(in srgb, currentColor 14%, transparent); }
}
.fb-company-left{ width: 17rem; flex: 0 0 17rem; }
.fb-company-logo img{ max-width: 100%; width: auto; height: auto; display: block; }
.fb-company-contacts{ margin-top: 1.125rem; display: flex; flex-direction: column; gap: .5rem; }
.fb-company-line a{ color: inherit; text-decoration: none; font-weight: 600; }
.fb-company-line a:hover{ text-decoration: underline; }
.fb-company-socials{ margin-top: 1.125rem; display: flex; gap: .875rem; }
.fb-social{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: .75rem;
  border: 1px solid currentColor;
  color: inherit;
  font-weight: 700;
  text-decoration: none;
}
.fb-social:hover{ opacity: .7; }
.fb-company-right{ flex: 1; min-width: 0; }
.fb-company-title{ margin: 0 0 .625rem; font-size: 1.6em; line-height: 1.15; color: inherit; }
.fb-company-desc{ color: inherit; line-height: 1.55; }
.fb-company-desc p{ margin: 0 0 .625rem; }

/* ---------- Responsive ---------- */

@media (max-width: 980px){
  .slider-logo-box{ height: 7rem; }
}
@media (max-width: 900px){
  .fb-company-card{ flex-direction: column; }
  .fb-company-left{ width: 100%; flex: 0 0 auto; }
  .fb-company-title{ font-size: 1.4em; }
}
@media (max-width: 560px){
  .slider-logo-box{ height: 6.5rem; }
  .fb-sponsors{ --fb-sponsors-gap: 1rem; --fb-sponsors-pad: 1rem; }
}
