/**
 * Card action links grid — Templates 1–4 (shared layout)
 * Rows: 1→1×1, 2→1×2, 3→1×2+1×1, 4→2×2, 5→1×2+1×2+1×1, …
 */

.tpl-card-actions-grid {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  visibility: visible;
}

.tpl-card-actions-row {
  display: grid;
  gap: 0.65rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.tpl-card-actions-row--cols-1 {
  grid-template-columns: minmax(0, 1fr);
}

.tpl-card-actions-row--cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tpl-card-actions-row .tpl-card-action-btn {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  visibility: visible;
  opacity: 1;
}

.tpl-card-action-btn__lbl {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  font-size: 0.625rem;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-align: center;
  max-height: 2.4em;
}

/* Tri suite (Templates 1 & 2) */
[data-bc-tri="1"] .tpl-cta-wrap--card-actions.tpl-card-actions-grid {
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  margin-top: 0.15rem;
  padding: 0 0 0.35rem;
}

[data-bc-tri="1"] .tpl-card-actions-row .tpl-card-action-btn,
[data-bc-tri="1"] .tpl-card-actions-row .tpl-cta {
  width: 100%;
  max-width: 100%;
}

.pub-card--template-01b .tpl-cta-wrap--card-actions.tpl-card-actions-grid,
.bc-card.bc-t-template-01b .tpl-cta-wrap--card-actions.tpl-card-actions-grid,
.pub-card--template-01 .tpl-cta-wrap--card-actions.tpl-card-actions-grid,
.bc-card.bc-t-template-01 .tpl-cta-wrap--card-actions.tpl-card-actions-grid {
  flex-direction: column;
  align-items: stretch;
  width: 100%;
}

.pub-card--template-03 .tpl-cta-wrap--card-actions.tpl-card-actions-grid,
.bc-card.bc-t-template-03 .tpl-cta-wrap--card-actions.tpl-card-actions-grid,
.pub-card--template-04 .tpl-cta-wrap--card-actions.tpl-card-actions-grid,
.bc-card.bc-t-template-04 .tpl-cta-wrap--card-actions.tpl-card-actions-grid {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
}

.pub-card--template-03 .tpl-card-actions,
.bc-card.bc-t-template-03 .tpl-card-actions,
.pub-card--template-04 .tpl-card-actions,
.bc-card.bc-t-template-04 .tpl-card-actions {
  display: block;
  visibility: visible;
  overflow: visible;
}

/* Bottom stack: primary CTA → meeting links → loan calculator */
.tpl-card-bottom-actions,
.tpl-meetings-footer {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.tpl-cta-wrap--schedule-primary {
  width: 100%;
  max-width: 100%;
  margin: 0.5rem 0 0.65rem;
  padding: 0 clamp(1rem, 4vw, 1.35rem);
  box-sizing: border-box;
}

.tpl-cta-wrap--schedule-primary .tpl-cta--schedule-book {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  min-height: 2.75rem;
  padding: 0.72rem 1.15rem;
  border-radius: var(--tpl-radius-md, 10px);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-align: center;
  border: none;
  box-sizing: border-box;
}

.tpl-cta-wrap--schedule-primary .tpl-cta--schedule-book:not([style*="background"]) {
  background: linear-gradient(180deg, var(--tpl-brand, #0099ae), var(--tpl-brand-dark, #007a8b));
  color: #fff;
}

.tpl-cta-wrap--loan-calc-footer {
  width: 100%;
  max-width: 100%;
  margin-top: 0.65rem;
  padding: 0 clamp(1rem, 4vw, 1.35rem);
  box-sizing: border-box;
}

.tpl-meetings-footer .tpl-card-actions-grid--meetings,
.tpl-card-bottom-actions .tpl-card-actions-grid--meetings {
  padding: 0 clamp(1rem, 4vw, 1.35rem);
  box-sizing: border-box;
}

.bc-t3-footer-actions .tpl-card-actions-grid--meetings,
.bc-t4-footer-actions .tpl-card-actions-grid--meetings {
  padding: 0;
}

.bc-t3-footer-actions .bc-t3-footer-action,
.bc-t3-footer-actions .bc-t3-footer-action--loan,
.bc-t4-footer-actions .bc-t4-footer-action,
.bc-t4-footer-actions .bc-t4-footer-action--loan {
  width: 100%;
  max-width: 100%;
}

/* Bottom CTA stack: schedule + meeting links + loan (no separate section headings) */
.tpl-card-bottom-actions--grouped,
.tpl-meetings-footer.tpl-card-bottom-actions--grouped {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0 clamp(1rem, 4vw, 1.35rem) 1rem;
}

.tpl-card-bottom-actions--grouped .tpl-cta-wrap--schedule-primary,
.tpl-card-bottom-actions--grouped .tpl-cta-wrap--loan-calc-footer,
.bc-t3-footer-actions.tpl-card-bottom-actions--grouped,
.bc-t4-footer-actions.tpl-card-bottom-actions--grouped {
  width: 100%;
  max-width: 100%;
}

.tpl-card-bottom-actions--grouped .tpl-cta-wrap--schedule-primary,
.tpl-card-bottom-actions--grouped .tpl-cta-wrap--loan-calc-footer,
.tpl-meetings-footer.tpl-card-bottom-actions--grouped .tpl-cta-wrap--schedule-primary,
.tpl-meetings-footer.tpl-card-bottom-actions--grouped .tpl-cta-wrap--loan-calc-footer {
  padding-left: 0;
  padding-right: 0;
}

.tpl-card-bottom-actions--grouped .tpl-card-actions-grid--meetings,
.tpl-meetings-footer.tpl-card-bottom-actions--grouped .tpl-card-actions-grid--meetings {
  padding-left: 0;
  padding-right: 0;
}

/* Templates 1 & 2: one bottom block — no stray Meeting / Loan calculator headings */
.tpl-card-bottom-actions--grouped .tpl-module__title,
.tpl-card-bottom-actions--grouped .tpl-t02-section-title,
.tpl-card-bottom-actions--grouped h2,
.tpl-card-bottom-actions--grouped h3 {
  display: none !important;
}

.pub-card--template-02 .tpl-card-bottom-actions--grouped,
.bc-card.bc-t-template-02 .tpl-card-bottom-actions--grouped {
  padding-left: 0;
  padding-right: 0;
}

.pub-card--template-02 .tpl-card-bottom-actions--grouped .tpl-card-actions-grid--meetings,
.bc-card.bc-t-template-02 .tpl-card-bottom-actions--grouped .tpl-card-actions-grid--meetings {
  padding-left: clamp(0.75rem, 3vw, 1.1rem);
  padding-right: clamp(0.75rem, 3vw, 1.1rem);
}

/* Uniform width: single-row CTAs match 2-column meeting rows (all templates) */
.bc-t3-footer-actions.tpl-card-bottom-actions--grouped,
.bc-t4-footer-actions.tpl-card-bottom-actions--grouped,
.tpl-card-bottom-actions--grouped,
.tpl-meetings-footer.tpl-card-bottom-actions--grouped {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.tpl-card-bottom-actions--grouped .tpl-cta-wrap--schedule-primary,
.tpl-card-bottom-actions--grouped .tpl-cta-wrap--loan-calc-footer,
.tpl-card-bottom-actions--grouped .tpl-card-actions-grid--meetings {
  width: 100%;
  max-width: 100%;
  align-self: stretch;
}

.tpl-card-bottom-actions--grouped .tpl-cta-wrap--loan-calc-footer .tpl-cta,
.tpl-card-bottom-actions--grouped .tpl-cta-wrap--loan-calc-footer .tpl-card-action-btn,
.tpl-card-bottom-actions--grouped .tpl-cta-wrap--loan-calc-footer a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 340px) {
  .tpl-card-actions-row--cols-2 {
    gap: 0.5rem;
  }

  .tpl-card-actions-row .tpl-card-action-btn {
    padding-left: 0.65rem;
    padding-right: 0.65rem;
    font-size: 0.75rem;
  }
}
