/*
 * sf-partners.css — partners gallery + modal for event pages.
 * Loaded conditionally by _includes/partials/businesses-for-event.njk (only
 * when the page actually renders the section), so it stays off pages that
 * don't need it.
 */

/* ---------- Section + intro ---------- */
.sf-partners { padding: 60px 0; }
.sf-partners-intro {
  text-align: center;
  margin: 0 auto 32px;
  max-width: 640px;
  color: #5a6c7e;
  font-size: 1rem;
  line-height: 1.6;
}

/* ---------- Swiper carousel ---------- */
.sf-partners-swiper {
  /* Bottom padding tightened — pagination now flows in document order
   * (margin-top below the carousel) instead of being absolutely positioned. */
  padding: 16px 0 0;
}
/* Pagination styled to match `.gallery .swiper-pagination` on event pages,
 * so both carousels feel like one design system: 12px hollow circles with
 * the brand-blue outline, filled brand-blue when active. */
.sf-partners-swiper .swiper-pagination {
  position: relative;
  bottom: auto;
  margin-top: 20px;
}
.sf-partners-swiper .swiper-pagination-bullet {
  background-color: transparent;
  border: 1px solid #356083;
  width: 12px;
  height: 12px;
  opacity: 1;
  margin: 0 4px;
}
.sf-partners-swiper .swiper-pagination-bullet-active {
  background-color: #356083;
}
/* Full-height nav side-panels: no border / shape, just a side vignette that
 * fades toward the centre, with the chevron icon centred inside. Mirrors the
 * fade-to-transparent gradient used on .company-tile-name on the hub page. */
.sf-partners-swiper .swiper-button-prev,
.sf-partners-swiper .swiper-button-next {
  top: 0;
  bottom: 0;
  height: 100%;
  width: 60px;
  margin-top: 0;
  transform: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: #fff;
}
.sf-partners-swiper .swiper-button-prev {
  left: 0;
  background: linear-gradient(to right,
    rgba(0, 0, 0, 0.28) 0%,
    rgba(0, 0, 0, 0.10) 55%,
    rgba(0, 0, 0, 0) 100%);
}
.sf-partners-swiper .swiper-button-next {
  right: 0;
  background: linear-gradient(to left,
    rgba(0, 0, 0, 0.28) 0%,
    rgba(0, 0, 0, 0.10) 55%,
    rgba(0, 0, 0, 0) 100%);
}
.sf-partners-swiper .swiper-button-prev::after,
.sf-partners-swiper .swiper-button-next::after {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  /* Stronger shadow now that the bg is lighter, so the chevron stays
   * legible regardless of what slide content sits underneath. */
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}

/* On hover-capable devices the nav arrows hide by default and fade in when
 * the user mouses over the carousel (or focuses a slide via keyboard).
 * Touch-only viewports keep them visible since there's no hover signal —
 * the mobile media query at the bottom of this file already hides them on
 * narrow screens, so the desktop touch laptop case is the only one that
 * keeps them visible permanently. */
@media (hover: hover) {
  .sf-partners-swiper .swiper-button-prev,
  .sf-partners-swiper .swiper-button-next {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
  }
  .sf-partners-swiper:hover .swiper-button-prev,
  .sf-partners-swiper:hover .swiper-button-next,
  .sf-partners-swiper:focus-within .swiper-button-prev,
  .sf-partners-swiper:focus-within .swiper-button-next {
    opacity: 1;
    pointer-events: auto;
  }
}

/* ---------- Partner tile (carousel slide) ---------- */
.sf-partner-tile {
  position: relative;
  width: 100%;
  min-height: 200px;
  /* Two rows: the logo row absorbs all remaining vertical space (1fr) and
     centers the logo inside it; the name row hugs its content (auto) and
     therefore sits at exactly the same y-offset on every tile, regardless
     of how tall the logo above it ended up. */
  display: grid;
  grid-template-rows: 1fr auto;
  row-gap: 12px;
  padding: 28px 18px 22px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.sf-partner-tile:hover,
.sf-partner-tile:focus-visible {
  border-color: #356083;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
  outline: none;
}
.sf-partner-logo {
  align-self: center;
  justify-self: center;
  /* +12px vs the pre-card sizes: padding is inside the box (border-box), so
     the visible logo art keeps its previous 120x96 footprint. */
  max-width: 132px;
  max-height: 108px;
  width: auto;
  height: auto;
  object-fit: contain;
}
.sf-partner-logo.logo-circular {
  width: 88px;
  height: 88px;
  max-width: 88px;
  max-height: 88px;
  border-radius: 50%;
  object-fit: cover;
}

/* Logo "card" treatment (tile + modal). Logos arrive as a mix of transparent
 * SVG/PNG and white-background JPG/PNG exports with baked-in margins; on the
 * white tile the latter read as aimless empty space around the art. Framing
 * every logo with the same white card — soft shadow + hairline ring — gives
 * the white-background ones a defined edge (their margins become the card's
 * padding) and keeps transparent ones on an identical surface. Tweak the
 * shadow/padding/radius here to tune the experiment in one place. */
.sf-partner-logo,
.sf-partner-modal-logo {
  background: #fff;
  padding: 6px;
  /* border-radius: 10px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(15, 23, 42, 0.05); */
}
/* Circular logos are cover-cropped to their rim — no padding, and the radius
 * from their base rules keeps the shadow circular. */
.sf-partner-logo.logo-circular,
.sf-partner-modal-logo.logo-circular {
  padding: 0;
}
.sf-partner-name {
  font-size: 15px;
  font-weight: 600;
  color: #1c2833;
  text-align: center;
  line-height: 1.3;
  align-self: end;
  justify-self: center;
}

/* ---------- Category icon ---------- */
/* Shaped like the perk-tag pills — soft tint pill with a matching deeper
 * coloured glyph. Each category gets its own palette via .is-{category}
 * (parallel to .perk-tag.is-{tagType}) so users can scan the carousel
 * by colour as well as by glyph. Default = brand-blue if no preset matches. */
.sf-partner-category-icon {
  position: absolute;
  top: 10px;
  left: 10px;
  box-sizing: content-box;
  width: 16px;
  height: 16px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(53, 96, 131, 0.10);
  color: #356083;
  pointer-events: none;
}
.sf-partner-category-icon.is-accommodation {
  background: rgba(53, 96, 131, 0.12);
  color: #356083;
}
.sf-partner-category-icon.is-restaurant {
  background: rgba(192, 57, 43, 0.12);
  color: #c0392b;
}
.sf-partner-category-icon.is-cafe-bar {
  background: rgba(30, 132, 73, 0.12);
  color: #1e8449;
}

/* ---------- Headline badge ---------- */
.sf-partner-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  /* Default (no tagType) — neutral brand blue. The `.is-*` variants below
     match the perk-tag presets in register.css so the badge and the modal's
     tag pill use the same colour for the same perk. */
  background: #356083;
  color: #fff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.sf-partner-badge.is-discount { background: #fdecea; color: #c0392b; }
.sf-partner-badge.is-offer    { background: #e74c3c; color: #fff;    }
.sf-partner-badge.is-combo    { background: #fef3d9; color: #b9770e; }
.sf-partner-badge.is-freebie  { background: #e3f4ea; color: #1e8449; }
.sf-partner-badge.is-vip      { background: #efe2f4; color: #6c3483; }

/* ---------- Modal ---------- */
.sf-partner-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  animation: sf-modal-fade 0.15s ease-out;
}
.sf-partner-modal-backdrop[hidden] { display: none; }
@keyframes sf-modal-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.sf-partner-modal {
  position: relative;
  background: #fff;
  border-radius: 12px;
  max-width: 480px;
  width: 100%;
  /* Uniform modal height so different partners (1 vs 5 perks) look consistent.
     min-height is a floor — modals with lots of perks still grow up to max. */
  min-height: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px 28px 28px;
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.3);
  display: flex;
  flex-direction: column;
}
.sf-partner-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: #5a6c7e;
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}
.sf-partner-modal-close:hover,
.sf-partner-modal-close:focus-visible {
  background: #f4f6f8;
  color: #1c2833;
  outline: none;
}

/* Modal body — grid with four rows so the layout is uniform across partners:
   row 1 (auto)  : name pinned to the top
   row 2 (150px) : logo wrap; fixed height, logo centred inside
   row 3 (auto)  : perks list
   row 4 (auto)  : social/contact icon row
   align-content: space-between anchors row 1 to the top and row 4 to the
   bottom of the (min-height: 480) modal; rows 2-3 are distributed in between
   so the modal feels visually balanced regardless of perk count. */
.sf-partner-modal-body {
  flex: 1;
  display: grid;
  grid-template-rows: auto 150px auto auto;
  align-content: space-between;
  margin-top: 8px;
}

.sf-partner-modal-name {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #356083;
  font-family: "Raleway", "Roboto", sans-serif;
  text-align: center;
}

.sf-partner-modal-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.12), 0 0 0 1px rgba(15, 23, 42, 0.05);
}
.sf-partner-modal-logo {
  /* +12px vs the pre-card sizes — see the logo card comment above. */
  max-width: 142px;
  max-height: 122px;
  width: auto;
  height: auto;
  object-fit: contain;
}
.sf-partner-modal-logo.logo-circular {
  width: 100px;
  height: 100px;
  max-width: 100px;
  max-height: 100px;
  border-radius: 50%;
  object-fit: cover;
}

/* Social/contact icon row — circular icon buttons in the style of the
 * organizers' .social rows (cf. .events .details .social a in main.css),
 * tinted with the partners-section brand blue. Rendered from each
 * business's `links` data; replaces the old plain text visit-link. */
.sf-partner-modal-social {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.sf-partner-modal-social a {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(53, 96, 131, 0.10);
  color: #356083;
  font-size: 17px;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.sf-partner-modal-social a:hover,
.sf-partner-modal-social a:focus-visible {
  background: #356083;
  color: #fff;
  transform: translateY(-2px);
  outline: none;
}
.sf-partner-modal-social a i { line-height: 0; }

/* Custom tooltip on the contact icons (replaces the slow native title). The
   label sits in a bubble above the icon, revealed on hover/focus. */
.sf-partner-modal-social a[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  padding: 4px 9px;
  border-radius: 6px;
  background: #356083;
  color: #fff;
  font-size: 12px;
  line-height: 1.4;
  max-width: 220px;
  width: max-content;
  word-break: break-all;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s, transform 0.15s;
  z-index: 2;
}
.sf-partner-modal-social a[data-tooltip]::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  border: 5px solid transparent;
  border-top-color: #356083;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s, transform 0.15s;
  z-index: 2;
}
.sf-partner-modal-social a[data-tooltip]:hover::after,
.sf-partner-modal-social a[data-tooltip]:focus-visible::after,
.sf-partner-modal-social a[data-tooltip]:hover::before,
.sf-partner-modal-social a[data-tooltip]:focus-visible::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Modal perks list (mirrors Pass page renderPerk markup) */
.sf-partner-modal-perks {
  display: flex;
  flex-direction: column;
}
.sf-perk {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px;
  text-align: left;
  border-top: 1px solid #e2e8f0;
}
.sf-perk:first-child {
  border-top: 0;
  padding-top: 4px;
}
.sf-perk-description {
  color: #1c2833;
  font-size: 14px;
  line-height: 1.5;
}
.sf-perk-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.sf-perk-numeric {
  font-weight: 700;
  color: #356083;
  font-size: 16px;
}

/* tag pill + preset variants (same hues as register.css .perk-tag) */
.sf-perk-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  background: orange;
  color: white;
}
.sf-perk-tag.is-discount { background: #fdecea; color: #c0392b; }
.sf-perk-tag.is-offer    { background: #e74c3c; color: #fff;    }
.sf-perk-tag.is-combo    { background: #fef3d9; color: #b9770e; }
.sf-perk-tag.is-freebie  { background: #e3f4ea; color: #1e8449; }
.sf-perk-tag.is-vip      { background: #efe2f4; color: #6c3483; }

/* ---------- Responsive tightening ---------- */
@media (max-width: 575px) {
  .sf-partners { padding: 40px 0; }
  .sf-partners-swiper { padding: 8px 0 0; }
  .sf-partners-swiper .swiper-button-prev,
  .sf-partners-swiper .swiper-button-next { display: none; }
  .sf-partner-tile { min-height: 160px; padding: 24px 14px 18px; }
}
