/**
 * IBEX card styles — scoped to .ibex-card* only.
 * Does not share rules with BSS / HIA / Hope Village / SOL templates.
 */

:root {
  --ibex-green-dark: #1f6b3a;
  --ibex-green-mid: #3f9a4a;
  --ibex-green-lime: #b7db57;
  --ibex-orange: #d36b4d;
  --ibex-orange-bright: #e0703a;
  --ibex-text: #2f3430;
  --ibex-text-muted: #4a524c;
  --ibex-border: #60B059;
  --ibex-card-max: 500px;
}

html,
body.ibex-card-page {
  margin: 0;
  padding: 0 !important;
  min-height: 100%;
  background: #f3f4f2;
  color: var(--ibex-text);
  font-family: "Source Sans 3", "Segoe UI", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.ibex-card-page {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 1.5rem 1rem 2.5rem;
  box-sizing: border-box;
}

/* Neutralize theme chrome that can leak onto this full-page template */
body.ibex-card-page .site-header,
body.ibex-card-page .site-footer,
body.ibex-card-page #wpadminbar + * {
  /* keep admin bar usable; no forced hide */
}

.ibex-card {
  position: relative;
  width: 100%;
  max-width: var(--ibex-card-max);
  margin: 0 auto;
  background-color: #ffffff;
  background-image: var(--ibex-card-bg, none);
  background-repeat: no-repeat;
  background-position: top center;
  background-size: 100% 100%;
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(20, 40, 20, 0.12);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-height: 720px;
  aspect-ratio: 180 / 280;
}

.ibex-card.has-ibex-bg {
  /* Branded canvas (e.g. IBEx.jpg): waves + footer logo live in the image */
  min-height: 0;
}

.ibex-card.has-ibex-bg .ibex-card__wave {
  display: none;
}

.ibex-card.has-ibex-bg .ibex-card__brand--spacer {
  width: 100%;
  flex: 0 0 auto;
  min-height: 18%;
  padding: 0;
}

.ibex-card__wave {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 168px;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.ibex-card__wave-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.ibex-card__photo {
  position: relative;
  z-index: 2;
  top: 4rem;
  /* margin-top: 72px; */
  width: 180px;
  height: 250px;
  background: #ffffff;
  border: 1px solid var(--ibex-border);
  border-radius: 14px;
  box-sizing: border-box;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.ibex-card__photo img,
.ibex-card__photo .wp-block-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border: 0 !important;
  border-radius: 0 !important;
  margin: 0 !important;
}

.ibex-card__body {
  top: 8rem;
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 0rem 1.5rem 0.5rem;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  gap: 0;
}

.ibex-card__body > br {
  display: none;
}

.ibex-card__name {
  margin: 0 0 0.45rem;
  padding: 0 0.5rem;
  font-size: clamp(1.65rem, 5vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: var(--ibex-text);
}

/* Dot — line — dot — line — dot (matches brand divider artwork) */
.ibex-card__divider {
  width: min(72%, 220px);
  height: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.ibex-card__divider-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ibex-orange);
  flex-shrink: 0;
}

.ibex-card__divider-line {
  flex: 1 1 auto;
  height: 2px;
  background: var(--ibex-orange);
  border-radius: 1px;
}

.ibex-card__role {
  margin: 0.15rem 0 0.35rem;
  padding: 0 1rem;
  font-size: 1.05rem;
  font-weight: 400;
  line-height: 1;
  color: var(--ibex-text-muted);
}

.ibex-card__role p {
  margin: 0 0 0 0;
  padding: 0;
  border: 0 !important;
}

.ibex-card__meta {
  margin: 0.15rem 0 1.35rem;
  font-size: 1rem;
  font-weight: 400;
  color: var(--ibex-text-muted);
  letter-spacing: 0.02em;
}

.ibex-card__qr {
  margin: 0 0 1rem;
  padding: 3px;
  border: 2px solid var(--ibex-orange);
  border-radius: 14px;
  background: #fff;
  line-height: 0;
}

.ibex-card__contact {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 1rem;
  padding: 0 0.5rem;
  box-sizing: border-box;
}

.ibex-card__contact-row {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: #111111;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
}

.ibex-card__contact-row:hover,
.ibex-card__contact-row:focus {
  color: #111111;
  text-decoration: none;
}

.ibex-card__contact-row span {
  word-break: break-word;
}

.ibex-card__contact-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: block;
}

.ibex-card__qr-link {
  display: inline-block;
  line-height: 0;
  text-decoration: none;
}

.ibex-card__qr img,
.ibex-card__qr canvas,
.ibex-card__qr table {
  display: block;
  margin: 0 auto;
  max-width: 148px;
  height: auto;
}

.ibex-card__qr table {
  border-collapse: collapse;
}

.ibex-card__brand {
  width: 100%;
  padding: 0.5rem 1.25rem 1.6rem;
  box-sizing: border-box;
  margin-top: auto;
}

.ibex-card__logo {
  display: block;
  width: var(--ibex-logo-w, 150px);
  height: var(--ibex-logo-h, auto);
  max-width: 85%;
  margin: 0 auto;
  object-fit: contain;
}

@media (max-width: 480px) {
  body.ibex-card-page {
    padding: 0.75rem 0.5rem 1.5rem;
  }

  .ibex-card {
    /* Taller canvas so the background image stretches higher on mobile */
    min-height: calc(100svh + 64px);
    aspect-ratio: 180 / 310;
    border-radius: 0;
    box-shadow: none;
    max-width: 100%;
    background-size: 100% 100%;
    background-position: top center;
  }

  .ibex-card.has-ibex-bg {
    /* Override desktop min-height: 0 so the branded bg gains height */
    min-height: calc(100svh + 64px);
  }

  .ibex-card__wave {
    height: 150px;
  }

  .ibex-card__body {
    top: 6rem;
  }

  .ibex-card__logo {
    width: var(--ibex-logo-media-w, var(--ibex-logo-w, 150px));
    height: var(--ibex-logo-media-h, var(--ibex-logo-h, auto));
  }
}
