/* ========= Flip cards: basic wrapper styles ========= */

/* Only keep what the flipcards actually use */
.WithPadding {
  padding: 3rem 1rem;
}

/* Heading + subtitle wrapper */
.flip-card-section-margins {
  max-width: 1520px;
}

/* Override the global 0%-margin rule specifically for the flip card container */
.flip-card-section-margins.mobile-main-margins {
  margin-left: auto !important;
  margin-right: auto !important;
}

.lDarkBlue {
  color: #005a9c;
}

.text-center {
  text-align: center;
}

.sub-title {
  font-size: 1rem;
  margin-bottom: 2rem;
}

.smallIcons {
  width: 22px;
  height: 22px;
  vertical-align: middle;
}

.mainColor {
  color: #005a9c;
}

.smallSpacer {
  height: 0.75rem;
}

/* ========= Flip cards core (SCOPED to #flip-cards-a11y) ========= */

/* The row of cards */
#flip-cards-a11y {
  display: flex;
  flex-flow: row wrap;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: 1.5rem auto 0 !important;
  gap: 1.5rem 0.5rem;
}

/* Unwraps the row into #flip-cards-a11y's flex flow so all cards
   from both rows fill lines together instead of wrapping per-row */
.flip-cards-row {
  display: contents;
}

#flip-cards-a11y .flip-cards-row .flip-container {
  margin-left: 0;
  margin-right: 0;
}

/* Card container (the thing that flips) */
#flip-cards-a11y .flip-container {
  position: relative;
  width: 350px;
  height: 500px;
  margin-bottom: 25px;
  perspective: 1000px;
  -webkit-perspective: 1000px;
  cursor: pointer;
  outline: none;
}

/* In case you still use this class */
#flip-cards-a11y .small-margin {
  margin: 0.5rem;
}

/* Inner flipper */
#flip-cards-a11y .flipper {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform 0.6s;
}

/* Flip state – triggered by .startFlip on the container */
#flip-cards-a11y .flip-container.startFlip .flipper {
  transform: rotateY(180deg);
  -webkit-transform: rotateY(180deg);
}

/* Card faces */
#flip-cards-a11y .front,
#flip-cards-a11y .back {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Back face rotated */
#flip-cards-a11y .back {
  transform: rotateY(180deg);
  -webkit-transform: rotateY(180deg);
}

/* Card box (visible panel inside each face) */
#flip-cards-a11y .flipCard {
  position: relative;
  display: block;
  height: 100%;
  border-radius: 15px;
  margin: 10px;
  padding: 20px;
  box-shadow: 0 5px 6px rgba(0, 0, 0, 0.25);
  background-color: #ffffff;
  overflow: hidden; /* IMPORTANT: we scroll the inner body, not this */
  transition: all 0.3s ease;
}

/* Background image styles */
#flip-cards-a11y .flipCard-background-image,
#flip-cards-a11y .flipCard-background-image-analysis {
  background-size: cover;
  background-repeat: no-repeat;
  background-color: transparent;
  background-position: center center;
  color: #ffffff;
}

/* Front heading */
#flip-cards-a11y .flipCardFront-heading {
  text-align: left;
  margin: 0 0 32px;
  background: none;
  border-radius: 0;
  display: block;
}

#flip-cards-a11y .flipCardFront-heading h2 {
  margin: 0 !important;
}

/* ========= Back content (THIS is the scroll area) ========= */

#flip-cards-a11y .flipCardBack-body {
  color: black;
  height: 100%;
  overflow-y: auto;
  padding-right: 4px;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  transform: translateZ(0);
}

#flip-cards-a11y .flipCardBack-body h2 {
  margin-top: 0.25rem;
  margin-bottom: 0.5rem;
}

#flip-cards-a11y .flipCardBack-body ul {
  padding-left: 1.1rem;
  margin-top: 0.5rem;
}

#flip-cards-a11y .flipCardBack-body li {
  margin-bottom: 0.45rem;
}

.small-h2-font {
  font-size: 1.3rem;
}

.flip-mobile-font {
  font-size: 0.9rem;
}

/* Optional underline on specific links inside cards */
.mailto-style.fee-link a {
  text-decoration: underline;
}

/* ========= Responsive tweaks ========= */

@media only screen and (max-width: 1024px) {
  .flip-card-section-margins {
    margin-left: 5%;
    margin-right: 5%;
  }
}

@media only screen and (max-width: 991px) {
  .flip-card-section-margins {
    margin-left: 10%;
    margin-right: 10%;
  }
}

#flip-cards-a11y .flip-card-placeholder {
  visibility: hidden;
  pointer-events: none;
}

@media only screen and (max-width: 800px) {
  #flip-cards-a11y {
    margin: 0;
  }

  #flip-cards-a11y .flip-container {
    width: 320px;
    height: 440px;
  }
}

@media only screen and (max-width: 350px) {
  #flip-cards-a11y .flip-container {
    width: 300px;
    height: 420px;
  }
}

/* Focus ring for keyboard nav */
#flip-cards-a11y .flip-container:focus-visible {
  box-shadow: 0 0 0 3px #005a9c99;
  border-radius: 18px;
}

/* Center the entire flipcards section on the page */
#services-flipcards {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* Make sure the cards row itself is centered within that width */
.flip-cards-container {
  justify-content: center;
  margin-left: auto;
  margin-right: auto;
}
